goldDeposit.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <view class="deposit">
  3. <view class="deposit_head">
  4. <view class="deposit_head_name">提现金额</view>
  5. <view class="deposit_head_main">
  6. <view class="deposit_head_txt">提现比例1:1</view>
  7. <view class="deposit_head_ipt flexs">
  8. <text>¥</text>
  9. <input type="digit" placeholder="请输入" v-model="amount" maxlength="9" placeholder-style="color:#999999" />
  10. </view>
  11. </view>
  12. </view>
  13. <view class="deposit_main">
  14. <view class="deposit_main_name">选择提现方式</view>
  15. <view class="deposit_main_ul">
  16. <view class="deposit_main_li flex" v-for="(item,index) in payList" :key="index" @click="changePay(item.type)">
  17. <view class="deposit_main_img flexs" @click.stop="bindAccount(index)">
  18. <image :src="item.image" mode=""></image>
  19. <text>{{ item.name }}{{ item.account ? '('+ item.account +')' : ' (请绑定)' }}</text>
  20. </view>
  21. <view class="deposit_main_li_select">
  22. <image :src="item.type == payIndex ? '/static/image/publice/xuanzhong1@2x.png' : '/static/image/publice/weixuanzhong@2x.png'" mode=""></image>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="deposit_main_txt"><u-parse :content="message" ></u-parse></view>
  27. </view>
  28. <button class="deposit_btn" hover-class="hover-view" @click="submit">提交</button>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. message:'',
  36. amount:'',//提现金额
  37. payIndex:0,//支付方式
  38. payList:[
  39. {
  40. name:'微信提现',
  41. type:'0',
  42. account:'',
  43. image:'/static/image/me/weixin@2x.png'
  44. },
  45. {
  46. name:'支付宝提现',
  47. type:'1',
  48. account:'',
  49. image:'/static/image/me/zhifubao@2x.png'
  50. }
  51. ],//支付列表
  52. };
  53. },
  54. methods:{
  55. submit () {
  56. // return uni.showToast({title:'不支持体现',icon:'none'})
  57. if (!this.amount) return uni.showToast({title:'请输入金额',icon:'none'})
  58. if (!this.payList[this.payIndex].account) return uni.showToast({title:'请绑定' + (this.payIndex == 0 ?'微信' : '支付宝') +'账号',icon:'none'})
  59. if (this.amount == 0) return
  60. this.$api.goldDeposit({amount:this.amount,type:this.payIndex == 0 ? 'wechat' : 'alipay'}).then(res=>{
  61. if (res.code === 1) {
  62. uni.showToast({title:res.msg})
  63. this.amount = ''
  64. }
  65. })
  66. },
  67. //绑定账号
  68. bindAccount (index) {
  69. uni.navigateTo({url: '/pages/me/WeChat?type=' + index})
  70. },
  71. changePay (index) {
  72. this.payIndex = index
  73. },
  74. //huoqu
  75. getAccount () {
  76. this.$api.getWithdrawalSetting().then(res=>{
  77. if (res.code === 1) {
  78. this.payList[1].account = res.data.alipay.account
  79. this.payList[0].account = res.data.wechat.account
  80. }
  81. })
  82. },
  83. getMessage () {
  84. this.$api.agreement({name:'withdrawal_instruction'}).then(res=>{
  85. if (res.code === 1) {
  86. this.message = res.data.content
  87. }
  88. })
  89. }
  90. },
  91. onShow() {
  92. this.getAccount()
  93. },
  94. onLoad() {
  95. this.getMessage()
  96. }
  97. }
  98. </script>
  99. <style lang="scss">
  100. .deposit {
  101. padding: 0 35rpx 0 25rpx;
  102. .deposit_head {
  103. .deposit_head_name {
  104. font-size: 32rpx;
  105. padding: 30rpx 0 20rpx 20rpx;
  106. }
  107. .deposit_head_main {
  108. background: #FFFFFF;
  109. padding: 30rpx 30rpx 58rpx 20rpx;
  110. .deposit_head_txt {
  111. font-size: 28rpx;
  112. margin-bottom: 30rpx;
  113. }
  114. .deposit_head_ipt {
  115. padding: 20rpx 0;
  116. border-bottom: 2rpx solid #EBEBEB;
  117. text {
  118. font-size: 36rpx;
  119. margin-right: 20rpx;
  120. }
  121. input {
  122. color: #F6AF32;
  123. font-size: 36rpx;
  124. }
  125. }
  126. }
  127. }
  128. }
  129. .deposit_main {
  130. .deposit_main_name {
  131. font-size: 32rpx;
  132. padding: 50rpx 0 30rpx 20rpx;
  133. }
  134. .deposit_main_ul {
  135. background: #FFFFFF;
  136. .deposit_main_li {
  137. padding: 30rpx 20rpx;
  138. .deposit_main_img {
  139. image {
  140. width: 50rpx;
  141. height: 50rpx;
  142. margin-right: 20rpx;
  143. }
  144. text {
  145. font-size: 28rpx;
  146. }
  147. }
  148. .deposit_main_li_select {
  149. width: 32rpx;
  150. height: 32rpx;
  151. }
  152. }
  153. }
  154. .deposit_main_txt {
  155. padding: 20rpx 0;
  156. }
  157. }
  158. .deposit_btn {
  159. height: 98rpx;
  160. color: #333333;
  161. font-size: 30rpx;
  162. margin-top: 150rpx;
  163. background: #FFFFFF;
  164. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(220, 220, 220, 0.2);
  165. border-radius: 20rpx;
  166. }
  167. </style>