deposit.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="deposit" v-if="canTi == 1">
  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(item.type)">
  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 == payType ? '/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. canTi: '',
  36. message: '',
  37. amount: '', //提现金额
  38. payType: 1, //支付方式
  39. payList: [
  40. // {
  41. // name:'微信提现',
  42. // type:'0',
  43. // account:'',
  44. // image:'/static/image/me/weixin@2x.png'
  45. // },
  46. {
  47. name: '支付宝提现',
  48. type: '1',
  49. account: '',
  50. image: '/static/image/me/zhifubao@2x.png'
  51. }
  52. ] //支付列表
  53. };
  54. },
  55. methods: {
  56. submit() {
  57. // return uni.showToast({title:'不支持体现',icon:'none'})
  58. if (!this.amount) return uni.showToast({ title: '请输入金额', icon: 'none' });
  59. if (!this.payList.find(item => item.type == this.payType).account)
  60. return uni.showToast({ title: '请绑定' + (this.payType == 0 ? '微信' : '支付宝') + '账号', icon: 'none' });
  61. if (this.amount == 0) return;
  62. this.$api.withdrawal({ amount: this.amount, type: this.payType == 0 ? 'wechat' : 'alipay' }).then(res => {
  63. if (res.code === 1) {
  64. uni.showToast({ title: res.msg });
  65. this.amount = '';
  66. }
  67. });
  68. },
  69. //绑定账号
  70. bindAccount(type) {
  71. uni.navigateTo({ url: '/pages/me/WeChat?type=' + type });
  72. },
  73. changePay(type) {
  74. this.payType = type;
  75. },
  76. //huoqu
  77. getAccount() {
  78. this.$api.getWithdrawalSetting().then(res => {
  79. if (res.code === 1) {
  80. let alipay = this.payList.find(item => item.type == 1);
  81. alipay.account = res.data.alipay.account;
  82. let wechat = this.payList.find(item => item.type == 0);
  83. wechat && (wechat.account = res.data.wechat.account);
  84. }
  85. });
  86. },
  87. getMessage() {
  88. this.$api.agreement({ name: 'withdrawal_instruction' }).then(res => {
  89. if (res.code === 1) {
  90. this.message = res.data.content;
  91. }
  92. });
  93. }
  94. },
  95. onShow() {
  96. this.getAccount();
  97. },
  98. onLoad() {
  99. this.getMessage();
  100. this.$api.checkSwitch().then(({ data }) => {
  101. this.canTi = data;
  102. });
  103. }
  104. };
  105. </script>
  106. <style lang="scss">
  107. .deposit {
  108. padding: 0 35rpx 0 25rpx;
  109. .deposit_head {
  110. .deposit_head_name {
  111. font-size: 32rpx;
  112. padding: 30rpx 0 20rpx 20rpx;
  113. }
  114. .deposit_head_main {
  115. background: #ffffff;
  116. padding: 30rpx 30rpx 58rpx 20rpx;
  117. .deposit_head_txt {
  118. font-size: 28rpx;
  119. margin-bottom: 30rpx;
  120. }
  121. .deposit_head_ipt {
  122. padding: 20rpx 0;
  123. border-bottom: 2rpx solid #ebebeb;
  124. text {
  125. font-size: 36rpx;
  126. margin-right: 20rpx;
  127. }
  128. input {
  129. color: #f6af32;
  130. font-size: 36rpx;
  131. }
  132. }
  133. }
  134. }
  135. }
  136. .deposit_main {
  137. .deposit_main_name {
  138. font-size: 32rpx;
  139. padding: 50rpx 0 30rpx 20rpx;
  140. }
  141. .deposit_main_ul {
  142. background: #ffffff;
  143. .deposit_main_li {
  144. padding: 30rpx 20rpx;
  145. .deposit_main_img {
  146. image {
  147. width: 50rpx;
  148. height: 50rpx;
  149. margin-right: 20rpx;
  150. }
  151. text {
  152. font-size: 28rpx;
  153. }
  154. }
  155. .deposit_main_li_select {
  156. width: 32rpx;
  157. height: 32rpx;
  158. }
  159. }
  160. }
  161. .deposit_main_txt {
  162. padding: 20rpx 0;
  163. }
  164. }
  165. .deposit_btn {
  166. height: 98rpx;
  167. color: #333333;
  168. font-size: 30rpx;
  169. margin-top: 150rpx;
  170. background: #ffffff;
  171. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(220, 220, 220, 0.2);
  172. border-radius: 20rpx;
  173. }
  174. </style>