addWithdrawal.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <!-- 申请提现 -->
  3. <view class="Withdrawal" :class="['qn-page-' + theme]">
  4. <view class="w-view w-channel clearfix" @click="openPay">
  5. <view class="float_left">转出方式</view>
  6. <view class="float_right">
  7. <text v-if="cash_out_form.reflectType">{{ cash_out_form.reflectType }}</text>
  8. <text v-else class="w-input-place">请选择</text>
  9. <text class="ibonfont ibonjinru"></text>
  10. </view>
  11. </view>
  12. <view class="w-view clearfix" v-if="cash_out_form.reflectType">
  13. <view class="float_left">姓名</view>
  14. <view class="float_right">
  15. <input type="text" placeholder-class="w-input-place" placeholder="请输入真实姓名" class="w-input" v-model="cash_out_form.reflectInfo.name" />
  16. </view>
  17. </view>
  18. <block v-if="cash_out_form.reflectType === '微信钱包'">
  19. <view class="w-view clearfix">
  20. <view class="float_left">微信账号</view>
  21. <view class="float_right">
  22. <input placeholder-class="w-input-place" class="w-input" placeholder="请输入微信账号" type="text" v-model="cash_out_form.reflectInfo.account" />
  23. </view>
  24. </view>
  25. </block>
  26. <block v-if="cash_out_form.reflectType === '支付宝'">
  27. <view class="w-view clearfix">
  28. <view class="float_left">支付宝账号</view>
  29. <view class="float_right">
  30. <input placeholder-class="w-input-place" class="w-input" placeholder="请输入支付宝账号" type="text" v-model="cash_out_form.reflectInfo.account" />
  31. </view>
  32. </view>
  33. </block>
  34. <block v-if="cash_out_form.reflectType === '银行卡'">
  35. <view class="w-view clearfix">
  36. <view class="float_left">开户银行</view>
  37. <view class="float_right">
  38. <input placeholder-class="w-input-place" placeholder="请输入开户银行" class="w-input" type="text" v-model="cash_out_form.reflectInfo.bankName" />
  39. </view>
  40. </view>
  41. <view class="w-view clearfix">
  42. <view class="float_left">银行卡号</view>
  43. <view class="float_right">
  44. <input placeholder-class="w-input-place" placeholder="请输入银行卡号" class="w-input" type="number" v-model="cash_out_form.reflectInfo.account" />
  45. </view>
  46. </view>
  47. <view class="w-view clearfix">
  48. <view class="float_left">确认卡号</view>
  49. <view class="float_right"><input placeholder-class="w-input-place" placeholder="请再次输入银行卡号" class="w-input" type="text" v-model="agin_card_num" /></view>
  50. </view>
  51. </block>
  52. <view class="w-view w-money">
  53. <view class="w-tit">
  54. <text>提现金额</text>
  55. <text class="w-tit-r">最少提现金额{{ min_money }}元</text>
  56. </view>
  57. <view class="w-money-input-view">
  58. <text class="rmb-ic">¥</text>
  59. <input class="w-money-input" type="number" v-model="cash_out_form.money" />
  60. </view>
  61. </view>
  62. <view class="clearfix w-tip">
  63. <view class="float_left">
  64. <text>可提现:¥{{ userInfo.memberBalance }}</text>
  65. <!-- <text>(手续费:10%)</text> -->
  66. </view>
  67. <view class="float_right primary-color" @click="allWitjdrawal">全部提现</view>
  68. </view>
  69. <view class="w-btn w-btn-on" @click="withdrawalsAdd">
  70. <u-loading :show="isLoding"></u-loading>
  71. <text style="margin-left: 10rpx;">提现</text>
  72. </view>
  73. <u-popup mode="bottom" v-model="payPop" :border-radius="12">
  74. <view class="pay-pop-view">
  75. <view class="pay-sel-title clearfix">
  76. <text class="float_left">提现方式</text>
  77. <text class="float_right ibonfont ibonguanbi1" @click="closePayPop"></text>
  78. </view>
  79. <view class="pay-ul">
  80. <view class="pay-li" @click="paymentChange('微信钱包')">
  81. <text class="ibonfont ibonweixinzhifu"></text>
  82. <view class="pay-name clearfix">
  83. <text class="float_left">微信钱包</text>
  84. <text class="float_right ibonfont primary-color" :class="[cash_out_form.reflectType === '微信钱包' ? 'ibonxuanze_xuanzhong' : 'ibonxuanze']"></text>
  85. </view>
  86. </view>
  87. <view class="pay-li" @click="paymentChange('支付宝')">
  88. <text class="ibonfont ibonumidd17"></text>
  89. <view class="pay-name clearfix">
  90. <text class="float_left">支付宝</text>
  91. <text class="float_right ibonfont primary-color" :class="[cash_out_form.reflectType === '支付宝' ? 'ibonxuanze_xuanzhong' : 'ibonxuanze']"></text>
  92. </view>
  93. </view>
  94. <view class="pay-li" @click="paymentChange('银行卡')">
  95. <text class="ibonfont ibonyinhangqia"></text>
  96. <view class="pay-name clearfix">
  97. <text class="float_left">银行卡</text>
  98. <text class="float_right ibonfont primary-color" :class="[cash_out_form.reflectType === '银行卡' ? 'ibonxuanze_xuanzhong' : 'ibonxuanze']"></text>
  99. </view>
  100. </view>
  101. </view>
  102. </view>
  103. </u-popup>
  104. </view>
  105. </template>
  106. <script>
  107. // import { getOpenid } from '@/access/common.js';
  108. export default {
  109. data() {
  110. return {
  111. min_money: 1, // 最少提现
  112. isLoding: false,
  113. payPop: false,
  114. cash_out_form: {
  115. customerId: '',
  116. reflectType: '', //提现方式
  117. money: 0, // 输入提现金额
  118. reflectInfo: {
  119. name: '', // 提现者姓名
  120. account: '', // 提现账号
  121. bankName: '' //银行名称
  122. },
  123. remark: ''
  124. },
  125. agin_card_num: '', //确认卡号
  126. userInfo: {}
  127. };
  128. },
  129. onShow() {
  130. this.getCustomerInfo();
  131. },
  132. methods: {
  133. // 获取用户信息
  134. getCustomerInfo() {
  135. this.$u.api.getCustomerInfo().then(({ data }) => {
  136. this.userInfo = data;
  137. this.$store.commit('commit_userStatus', data);
  138. });
  139. },
  140. // 申请提现
  141. withdrawalsAdd() {
  142. if (this.cash_out_form.reflectType === '支付宝') {
  143. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  144. this.$u.toast('请输入您的真实姓名');
  145. return;
  146. }
  147. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  148. this.$u.toast('请输入您的支付宝账号');
  149. return;
  150. }
  151. } else if (this.cash_out_form.reflectType === '银行卡') {
  152. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  153. this.$u.toast('请输入您的真实姓名');
  154. return;
  155. }
  156. if (!this.$u.trim(this.cash_out_form.reflectInfo.bankName)) {
  157. this.$u.toast('请选择银行名称');
  158. return;
  159. }
  160. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  161. this.$u.toast('请输入您的银行账号');
  162. return;
  163. }
  164. if (!this.$u.trim(this.agin_card_num)) {
  165. this.$u.toast('请再次输入您的银行账号');
  166. return;
  167. }
  168. if (this.agin_card_num !== this.cash_out_form.reflectInfo.account) {
  169. this.$u.toast('确认卡号与银行卡号不一致');
  170. return;
  171. }
  172. } else {
  173. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  174. this.$u.toast('请输入您的真实姓名');
  175. return;
  176. }
  177. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  178. this.$u.toast('请输入您的微信手机号');
  179. return;
  180. }
  181. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  182. this.$u.toast('请输入您的微信账号');
  183. return;
  184. }
  185. }
  186. if (!this.cash_out_form.money) {
  187. this.$u.toast('请输入要提现金额');
  188. return;
  189. }
  190. if (Number(this.cash_out_form.money) < this.min_money) {
  191. this.$u.toast('最低提现金额为' + this.min_money + '元');
  192. return;
  193. }
  194. if (Number(this.cash_out_form.money) > Number(this.userInfo.memberBalance)) {
  195. this.$u.toast('可提现金额不足');
  196. return;
  197. }
  198. this.isLoding = true;
  199. this.$u.api
  200. .addReflectDetail({
  201. ...this.cash_out_form,
  202. customerId: this.userInfo.id
  203. })
  204. .then(res => {
  205. this.isLoding = false;
  206. this.$u.toast('提现申请成功');
  207. setTimeout(res => {
  208. this.goPage('/pages/user/user', 'switchTab');
  209. }, 2000);
  210. })
  211. .catch(res => {
  212. this.isLoding = false;
  213. });
  214. },
  215. // 全部提现按钮点击事件
  216. allWitjdrawal() {
  217. this.cash_out_form.money = this.cash_out_form.nowMoney;
  218. },
  219. // 自动提现
  220. paymentChange(val) {
  221. this.cash_out_form.reflectType = val;
  222. this.closePayPop();
  223. },
  224. closePayPop() {
  225. this.payPop = false;
  226. this.cash_out_form.reflectInfo.account = '';
  227. this.cash_out_form.reflectInfo.bankName = '';
  228. },
  229. openPay() {
  230. this.payPop = true;
  231. }
  232. }
  233. };
  234. </script>
  235. <style lang="scss">
  236. .Withdrawal {
  237. width: 702upx;
  238. margin: 20upx auto;
  239. padding: 0 24upx 50upx;
  240. background-color: #ffffff;
  241. font-size: 28upx;
  242. .w-view {
  243. border-bottom: 1px solid #f5f5f5;
  244. padding: 24upx 0;
  245. .ibonjinru {
  246. font-size: 28upx;
  247. color: #666;
  248. height: 32upx;
  249. margin-left: 10upx;
  250. }
  251. .w-input {
  252. width: 480rpx;
  253. }
  254. .w-input-place {
  255. color: #b0b3bf;
  256. font-size: 26upx;
  257. }
  258. .w-tit {
  259. .w-tit-r {
  260. margin-left: 10upx;
  261. font-size: 24upx;
  262. color: #b0b3bf;
  263. }
  264. }
  265. }
  266. .w-money {
  267. .w-money-input-view {
  268. padding-top: 40upx;
  269. .rmb-ic {
  270. font-size: 60upx;
  271. font-weight: bold;
  272. display: inline-block;
  273. vertical-align: middle;
  274. height: 70upx;
  275. }
  276. .w-money-input {
  277. display: inline-block;
  278. width: 580upx;
  279. height: 70upx;
  280. font-size: 60upx;
  281. padding-left: 20upx;
  282. font-weight: bold;
  283. vertical-align: middle;
  284. padding-top: 6rpx;
  285. }
  286. }
  287. }
  288. .w-tip {
  289. font-size: 24upx;
  290. padding: 20upx 0 50upx;
  291. }
  292. .w-btn {
  293. margin: 0 auto;
  294. width: 660upx;
  295. line-height: 70upx;
  296. height: 70upx;
  297. color: #666;
  298. text-align: center;
  299. font-size: 28upx;
  300. border-radius: 70upx;
  301. background-color: #eee;
  302. }
  303. .w-btn-on {
  304. color: #fff;
  305. background-color: #fe582e;
  306. }
  307. }
  308. .pay-pop-view {
  309. background-color: #ffffff;
  310. border-top-left-radius: 12upx;
  311. border-top-right-radius: 12upx;
  312. padding-bottom: 40upx;
  313. font-size: 28upx;
  314. .pay-sel-title {
  315. padding: 0 30upx;
  316. line-height: 88upx;
  317. font-weight: bold;
  318. font-size: 32upx;
  319. .ibonfont {
  320. color: #999;
  321. font-weight: 400;
  322. width: 50rpx;
  323. text-align: center;
  324. font-size: 24rpx;
  325. }
  326. }
  327. .pay-btn {
  328. width: 690upx;
  329. height: 80upx;
  330. line-height: 80upx;
  331. color: #fff;
  332. font-size: 32upx;
  333. text-align: center;
  334. margin: 20upx auto 0;
  335. border-radius: 80upx;
  336. }
  337. .pay-ul {
  338. .pay-tip {
  339. font-size: 24upx;
  340. color: #999999;
  341. line-height: 32upx;
  342. padding: 20upx 30upx 0;
  343. }
  344. .pay-li {
  345. line-height: 100upx;
  346. .ibonfont {
  347. padding-left: 30upx;
  348. font-size: 46upx;
  349. vertical-align: middle;
  350. margin-right: 24upx;
  351. }
  352. .ibonweixinzhifu {
  353. color: #04be02;
  354. }
  355. .ibonumidd17 {
  356. color: #108ee9;
  357. }
  358. .ibonyinhangqia {
  359. color: #f2b844;
  360. }
  361. .pay-name {
  362. width: 650upx;
  363. display: inline-block;
  364. padding-right: 30upx;
  365. vertical-align: middle;
  366. border-bottom: 1px solid #f5f5f5;
  367. .ibonxuanze,
  368. .ibonxuanze_xuanzhong {
  369. margin-right: 0;
  370. padding-left: 0;
  371. font-size: 38upx;
  372. }
  373. }
  374. }
  375. .pay-li:last-child {
  376. .pay-name {
  377. border-bottom: 0 none;
  378. }
  379. }
  380. }
  381. }
  382. </style>