withdraw.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <view class="margin-30">
  3. <navigator v-if="$isEmpty(bank)" url="/pages/userBank/add" class="card_add" hover-class="none">
  4. <view class="margin-bottom-10">
  5. <u-icon name="plus-circle-fill" color="#F5A85B" size="70"></u-icon>
  6. </view>
  7. <view class="" style="color: #666666;">
  8. 添加银行卡
  9. </view>
  10. </navigator>
  11. <navigator url="select-bank" class="bank" v-else hover-class="none">
  12. <view class="left center">
  13. <image :src="bank.bankType?'/static/bank/'+bank.bankType+'.png':''" mode=""></image>
  14. <view class="content">
  15. <text>{{bank.bankTypeLabel}}</text>
  16. <text>{{bank.cardNo}}</text>
  17. </view>
  18. </view>
  19. <view class="center">
  20. <text class="cuIcon-right" style="font-size: 36rpx;color: #888888;"></text>
  21. </view>
  22. </navigator>
  23. <view class="card">
  24. <text class="title">提现金额</text>
  25. <view class="input">
  26. <text class="text-price center text-bold" style="font-size: 60rpx;"></text>
  27. <view @click="show" class="margin-left-20 center"
  28. style="width: 60%;justify-content: flex-start;color: #ff9900;">
  29. <text class="text-xl" v-text="withdrawAmount"></text>
  30. <view class="cusor"></view>
  31. </view>
  32. <view @click="allWithdraw" class="center margin-bottom-10 margin-left-20">
  33. <view class="cu-btn withdraw-btn sm round center">
  34. <text>全部提现</text>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="canWithdraw">
  39. 可提现金额
  40. <text class="text-price margin-left-20" style="font-size: 34rpx;">{{canWithDraw}}</text>
  41. </view>
  42. <view class="rate">
  43. <view class="item">
  44. <text>服务费</text>
  45. <text class="text-price">0.10</text>
  46. </view>
  47. <view class="item">
  48. <view class="">
  49. <text>费率</text>
  50. <text @click="rateShow=true" class="cuIcon-question margin-left-10 text-lg"></text>
  51. </view>
  52. <text class="">0.05%</text>
  53. </view>
  54. </view>
  55. </view>
  56. <u-popup v-model="rateShow" :mask-close-able="false" mode="center" height="40%" width="76%" borderRadius="20"
  57. negative-top="100">
  58. <view class="popup-content" style="height: 98%;">
  59. <view class="">
  60. <text class="popup-title">费率说明</text>
  61. <view class="popup-desc">
  62. <text>累计营收0-1000元,费率为0.5%;</text>
  63. <text>1001-10000元,费率为0.38%;</text>
  64. <text>10000-100000元,费率0.3%;</text>
  65. <text>100000元起申请更低费率。</text>
  66. </view>
  67. </view>
  68. <view class="center">
  69. <view class="cu-btn btn-bg-color round" style="height: 80rpx;font-size: 30rpx;width: 80%;"
  70. @click="rateShow=false">
  71. 确认
  72. </view>
  73. </view>
  74. </view>
  75. </u-popup>
  76. <amountInput :maxNumber="canWithDraw" ref="amountInput" confirmText="确认提现" btnColor="#ff9900" @change="change"
  77. @confirm="withdrawConfirm"></amountInput>
  78. </view>
  79. </template>
  80. <script>
  81. import amountInput from '@/components/amountInput/amountInput.vue';
  82. export default {
  83. components: {
  84. amountInput
  85. },
  86. data() {
  87. return {
  88. rateShow: false,
  89. bank: {},
  90. //可提现
  91. canWithDraw: '',
  92. //提现金额
  93. withdrawAmount: 0,
  94. };
  95. },
  96. onLoad() {
  97. this.fetchCardList()
  98. this.fetchShopDetail()
  99. },
  100. onShow() {
  101. if (this.canReset) {
  102. this.bank = this.$util.getBackParams('bank')
  103. }
  104. this.canReset = true
  105. },
  106. methods: {
  107. async fetchShopDetail() {
  108. let params = {
  109. id: this.vuex_shopId || '6625'
  110. }
  111. let data = (await this.$api.shop.detail(params)).data
  112. let originalData = this.$digital.floatSub(data.withdrawTotalPrice, data.totalPointValue)
  113. this.canWithDraw = this.$digital.keepTwoDecimal(originalData)
  114. },
  115. fetchCardList() {
  116. let params = {
  117. userId: this.vuex_shopId || '6625',
  118. size: 10
  119. }
  120. this.$api.userBank.appList(params).then(res => {
  121. this.bank = res.data.records[0]
  122. })
  123. },
  124. change(e) {
  125. if (!e) {
  126. this.withdrawAmount = 0
  127. } else {
  128. this.withdrawAmount = e
  129. }
  130. },
  131. show() {
  132. this.$refs.amountInput.show()
  133. },
  134. //全部提现
  135. allWithdraw(){
  136. this.withdrawAmount=this.canWithDraw
  137. this.$refs.amountInput.initialMoney(this.withdrawAmount)
  138. },
  139. withdrawConfirm(){
  140. }
  141. }
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. .bank {
  146. border-radius: 20rpx;
  147. background-color: #FFFFFF;
  148. padding: 44rpx;
  149. display: flex;
  150. justify-content: space-between;
  151. .left {
  152. display: flex;
  153. image {
  154. width: 90rpx;
  155. height: 90rpx;
  156. margin-right: 20rpx;
  157. }
  158. .content {
  159. display: flex;
  160. flex-direction: column;
  161. text:first-child {
  162. color: #252525;
  163. font-weight: 800;
  164. font-size: 34rpx;
  165. }
  166. text:last-child {
  167. margin-top: 15rpx;
  168. color: #888888;
  169. font-size: 26rpx;
  170. }
  171. }
  172. }
  173. }
  174. .card_add {
  175. border-radius: 20rpx;
  176. padding: 40rpx 0;
  177. background-color: #FFFFFF;
  178. display: flex;
  179. justify-content: center;
  180. align-items: center;
  181. flex-direction: column;
  182. }
  183. .card {
  184. border-radius: 20rpx;
  185. margin-top: 30rpx;
  186. padding: 40rpx;
  187. background-color: #FFFFFF;
  188. display: flex;
  189. flex-direction: column;
  190. .title {
  191. font-size: 36rpx;
  192. font-weight: 800;
  193. margin-bottom: 30rpx;
  194. }
  195. .input {
  196. display: flex;
  197. border-bottom: 1rpx solid #DFDFDF;
  198. .withdraw-btn {
  199. background-color: #FFFFFF;
  200. color: #EE9230;
  201. border: 1rpx solid #EE9230;
  202. height: 54rpx;
  203. width: 180rpx;
  204. font-size: 28rpx;
  205. line-height: 54rpx;
  206. }
  207. }
  208. .canWithdraw {
  209. margin-top: 24rpx;
  210. color: #252525;
  211. }
  212. .rate {
  213. margin-top: 40rpx;
  214. .item {
  215. margin-bottom: 20rpx;
  216. display: flex;
  217. justify-content: space-between;
  218. text:first-child {
  219. color: #252525;
  220. }
  221. text:last-child {
  222. color: #999999;
  223. }
  224. }
  225. }
  226. }
  227. .submit-btn {
  228. background-color: #EE9230;
  229. color: #FFFFFF;
  230. border-radius: 10rpx;
  231. }
  232. .popup-content {
  233. height: 100%;
  234. padding: 50rpx 60rpx;
  235. display: flex;
  236. flex-direction: column;
  237. justify-content: space-between;
  238. .popup-title {
  239. font-size: 38rpx;
  240. font-weight: 800;
  241. }
  242. .popup-desc {
  243. margin-top: 50rpx;
  244. color: #666666;
  245. display: flex;
  246. flex-direction: column;
  247. text {
  248. line-height: 40rpx;
  249. margin-bottom: 10rpx;
  250. }
  251. }
  252. }
  253. .cusor {
  254. margin-left: 10rpx;
  255. width: 6rpx;
  256. border-radius: 20rpx;
  257. height: 60%;
  258. background-color: #ff9900;
  259. animation: blink 1200ms infinite ease-in-out;
  260. }
  261. @keyframes blink {
  262. from {
  263. opacity: 0;
  264. }
  265. }
  266. </style>