deposit.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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(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. message:'',
  36. amount:'',//提现金额
  37. payType:1,//支付方式
  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.find(item => item.type == this.payType).account) return uni.showToast({title:'请绑定' + (this.payType == 0 ?'微信' : '支付宝') +'账号',icon:'none'})
  59. if (this.amount == 0) return
  60. this.$api.withdrawal({amount:this.amount,type:this.payType == 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 (type) {
  69. uni.navigateTo({url: '/pages/me/WeChat?type=' + type})
  70. },
  71. changePay (type) {
  72. this.payType = type
  73. },
  74. //huoqu
  75. getAccount () {
  76. this.$api.getWithdrawalSetting().then(res=>{
  77. if (res.code === 1) {
  78. let alipay = this.payList.find(item => item.type == 1)
  79. alipay.account = res.data.alipay.account
  80. let wechat = this.payList.find(item => item.type == 0)
  81. wechat && (wechat.account = res.data.wechat.account)
  82. }
  83. })
  84. },
  85. getMessage () {
  86. this.$api.agreement({name:'withdrawal_instruction'}).then(res=>{
  87. if (res.code === 1) {
  88. this.message = res.data.content
  89. }
  90. })
  91. }
  92. },
  93. onShow() {
  94. this.getAccount()
  95. },
  96. onLoad() {
  97. this.getMessage()
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. .deposit {
  103. padding: 0 35rpx 0 25rpx;
  104. .deposit_head {
  105. .deposit_head_name {
  106. font-size: 32rpx;
  107. padding: 30rpx 0 20rpx 20rpx;
  108. }
  109. .deposit_head_main {
  110. background: #FFFFFF;
  111. padding: 30rpx 30rpx 58rpx 20rpx;
  112. .deposit_head_txt {
  113. font-size: 28rpx;
  114. margin-bottom: 30rpx;
  115. }
  116. .deposit_head_ipt {
  117. padding: 20rpx 0;
  118. border-bottom: 2rpx solid #EBEBEB;
  119. text {
  120. font-size: 36rpx;
  121. margin-right: 20rpx;
  122. }
  123. input {
  124. color: #F6AF32;
  125. font-size: 36rpx;
  126. }
  127. }
  128. }
  129. }
  130. }
  131. .deposit_main {
  132. .deposit_main_name {
  133. font-size: 32rpx;
  134. padding: 50rpx 0 30rpx 20rpx;
  135. }
  136. .deposit_main_ul {
  137. background: #FFFFFF;
  138. .deposit_main_li {
  139. padding: 30rpx 20rpx;
  140. .deposit_main_img {
  141. image {
  142. width: 50rpx;
  143. height: 50rpx;
  144. margin-right: 20rpx;
  145. }
  146. text {
  147. font-size: 28rpx;
  148. }
  149. }
  150. .deposit_main_li_select {
  151. width: 32rpx;
  152. height: 32rpx;
  153. }
  154. }
  155. }
  156. .deposit_main_txt {
  157. padding: 20rpx 0;
  158. }
  159. }
  160. .deposit_btn {
  161. height: 98rpx;
  162. color: #333333;
  163. font-size: 30rpx;
  164. margin-top: 150rpx;
  165. background: #FFFFFF;
  166. box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(220, 220, 220, 0.2);
  167. border-radius: 20rpx;
  168. }
  169. </style>