fundCash.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="container">
  3. <picker @change="bindPickerChange" v-if="!rspData.state" :value="payIndex" :range="payList">
  4. <view class="header">
  5. <template v-if="payName">
  6. <image src="/static/img/pro/usme1.png" />
  7. <view class="header-info">
  8. <view class="type">{{ payName }}</view>
  9. <view class="acount">账号为{{ payName == '支付宝' ? zfb.alipay_num : bank.bank_num }}</view>
  10. </view>
  11. </template>
  12. <view class="header-info" v-if="!payName"><view class="type">请选择提现方式</view></view>
  13. <view class="yticon icon-you"></view>
  14. </view>
  15. </picker>
  16. <navigator url="/pages/user/funManage/bindMethods" class="header" v-if="rspData.state">
  17. <view class="header-info"><view class="type">请先绑定收款信息</view></view>
  18. <view class="yticon icon-you"></view>
  19. </navigator>
  20. <view class="centers">
  21. <view class="center-title">提现金额</view>
  22. <view class="center-input">
  23. <view class="center-icon">¥</view>
  24. <input type="number" placeholder-style="font-size:32rpx" v-model="num" placeholder="请输入提现金额" />
  25. <text @click="num = userInfo.userInfo.money" class="prosecond fontmid">全部提现</text>
  26. </view>
  27. <view class="tips">账户余额{{ userInfo.userInfo.money || '0.00' }}元,</view>
  28. </view>
  29. <view class="mt30 fontmid red">你将提现的金额为:</view>
  30. <view class="fontmid red">提现24小时内到账,公司会在9:00-17:00集中处理提现, 申请后请耐心等待</view>
  31. <navigator url="/pages/user/funManage/list?type=1" class="mt30 fontmid prosecond">提现记录></navigator>
  32. <u-button color="#ED742F" shape="circle" class="custom-style" @click="submitClickEvent">提现</u-button>
  33. <!-- <payPassWord ref="pwdKeyboard" @onConfirm="confirmEvent"></payPassWord>
  34. <ylx-modal ref="ylxModel" title="提示" @onConfirm="navTo('/pages/wallet/bind-colletMoney')" text="请先设置收款信息"></ylx-modal> -->
  35. </view>
  36. </template>
  37. <script>
  38. import payPassWord from '@/components/pay-password-keyboard/pay-password-keyboard.vue';
  39. import { mapState, mapActions } from 'vuex';
  40. export default {
  41. computed: {
  42. ...mapState({ userInfo: state => state.userInfo })
  43. },
  44. components: {
  45. payPassWord
  46. },
  47. data() {
  48. return {
  49. id: 0,
  50. total: '0.00',
  51. num: '',
  52. selCash: {},
  53. rspData: {},
  54. payList: [],
  55. payIndex: '',
  56. zfb: {},
  57. bank: {},
  58. payName: ''
  59. };
  60. },
  61. onLoad(opt) {
  62. this.total = opt.total || 0.0;
  63. },
  64. onShow() {
  65. console.log(this.selCash);
  66. this.getList();
  67. },
  68. methods: {
  69. getList() {
  70. this.$api.request(`/user_pay/payList`).then(res => {
  71. if (res.code == '200') {
  72. this.rspData.list = res.data;
  73. let arr = res.data;
  74. this.payList = [];
  75. arr.forEach(item => {
  76. if (item.alipay_num) {
  77. this.payList.push('支付宝');
  78. this.zfb = item;
  79. } else {
  80. this.payList.push('银行卡');
  81. this.bank = item;
  82. }
  83. });
  84. this.rspData.state = false;
  85. if (res.data.length < 1) {
  86. this.rspData.state = true;
  87. }
  88. console.log(this.rspData.state);
  89. }
  90. });
  91. },
  92. bindPickerChange(e) {
  93. let index = e.target.value;
  94. this.payIndex = index;
  95. this.payName = this.payList[index];
  96. },
  97. submitClickEvent() {
  98. console.log(12);
  99. if (this.num <= 0) {
  100. this.$api.toast('请输入提现金额!');
  101. return;
  102. } else if (Number(this.userInfo.userInfo.money) < Number(this.num)) {
  103. this.$api.toast('可提现金额不足!');
  104. return;
  105. }
  106. if (!this.payName) return this.$api.toast('请选择提现方式!');
  107. this.confirmEvent();
  108. // this.$refs['pwdKeyboard'].open();
  109. },
  110. async confirmEvent(psd) {
  111. console.log(1);
  112. // let psdword = await this.$api.request(`/api/users/checkMd`, {
  113. // passmd: psd
  114. // });
  115. // if (psdword.code == 200) {
  116. this.$api
  117. .request(`/withdrawal/cashUp`, {
  118. pay_id: this.payName == '支付宝' ? this.zfb.id : this.bank.id,
  119. money: this.num
  120. })
  121. .then(res => {
  122. // this.$refs.pwdKeyboard.pwd = '';
  123. // this.$refs['pwdKeyboard'].close();
  124. this.$api.toast(res.msg);
  125. if (res.code == '200') {
  126. setTimeout(res => {
  127. uni.navigateTo({
  128. url: '/pages/user/funManage/list?type=1'
  129. });
  130. }, 800);
  131. }
  132. });
  133. // } else {
  134. // this.$refs.pwdKeyboard.pwd = '';
  135. // this.$api.toast(psdword.msg);
  136. // }
  137. }
  138. }
  139. };
  140. </script>
  141. <style lang="scss">
  142. page {
  143. background-color: #fff;
  144. }
  145. </style>
  146. <style lang="scss" scoped>
  147. page {
  148. background-color: #f7f7f7;
  149. }
  150. .custom-style {
  151. background: #ed742e;
  152. width: 690rpx;
  153. margintop: 600rpx;
  154. color: #fff;
  155. margin-top: 40rpx;
  156. }
  157. .container {
  158. background-color: #f7f7f7;
  159. padding: 20rpx 30rpx;
  160. // width: 100%;
  161. // height: auto;
  162. // display: flex;
  163. // flex-direction: column;
  164. // align-items: center;
  165. }
  166. .header {
  167. height: auto;
  168. background-color: #ffffff;
  169. padding: 30rpx 30rpx;
  170. display: flex;
  171. flex-direction: row;
  172. align-items: center;
  173. justify-content: space-between;
  174. border-radius: 16rpx;
  175. image {
  176. width: 72rpx;
  177. height: 72rpx;
  178. margin-right: 30rpx;
  179. }
  180. .header-info {
  181. margin: 0 80rpx;
  182. flex: 1;
  183. display: flex;
  184. flex-direction: column;
  185. .type {
  186. font-size: 32rpx;
  187. color: #333333;
  188. }
  189. .acount {
  190. margin-top: 10rpx;
  191. font-size: 28rpx;
  192. color: #999999;
  193. }
  194. .mui-icon-arrowright {
  195. color: #999999;
  196. }
  197. }
  198. .icon-you {
  199. color: #999999;
  200. }
  201. }
  202. .centers {
  203. height: auto;
  204. background-color: #ffffff;
  205. padding: 30rpx;
  206. margin-top: 20rpx;
  207. border-radius: 16rpx;
  208. .center-title {
  209. font-size: 28rpx;
  210. }
  211. .center-input {
  212. width: 100%;
  213. height: auto;
  214. display: flex;
  215. flex-direction: row;
  216. align-items: center;
  217. margin: 20rpx 0;
  218. .center-icon {
  219. font-size: 68rpx;
  220. font-weight: 600;
  221. margin-right: 10rpx;
  222. }
  223. input {
  224. font-size: 64rpx;
  225. font-weight: 600;
  226. flex: 1;
  227. }
  228. }
  229. .tips {
  230. font-size: 28rpx;
  231. color: #9d9d9d;
  232. margin-top: 20rpx;
  233. }
  234. }
  235. .code-item {
  236. width: 100%;
  237. height: auto;
  238. background-color: #ffffff;
  239. padding: 30rpx;
  240. margin-top: 20rpx;
  241. display: flex;
  242. flex-direction: row;
  243. align-items: center;
  244. input {
  245. font-size: 32rpx;
  246. flex: 1;
  247. }
  248. .code-btn {
  249. font-size: 28rpx;
  250. color: #c82226;
  251. }
  252. .left {
  253. font-size: 28rpx;
  254. color: #333333;
  255. flex: 1;
  256. }
  257. .right {
  258. font-size: 28rpx;
  259. color: #333333;
  260. }
  261. }
  262. </style>