addWithdrawal.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <template>
  2. <!-- 申请提现 -->
  3. <view class="Withdrawal" :class="['qn-page-' + theme]">
  4. <view class="w-view w-channel clearfix" @click="openPay" v-if="shenhe == 1">
  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. shenhe: 0,//1->审核中 0->已过审
  128. };
  129. },
  130. onShow() {
  131. this.getCustomerInfo();
  132. this.getSh()
  133. },
  134. methods: {
  135. getSh() {
  136. this.$u.api.getSh().then(({data})=> {
  137. this.shenhe = data
  138. })
  139. },
  140. // 获取用户信息
  141. getCustomerInfo() {
  142. this.$u.api.getCustomerInfo().then(({ data }) => {
  143. this.userInfo = data;
  144. this.$store.commit('commit_userStatus', data);
  145. });
  146. },
  147. // 申请提现
  148. withdrawalsAdd() {
  149. if (this.cash_out_form.reflectType === '支付宝') {
  150. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  151. this.$u.toast('请输入您的真实姓名');
  152. return;
  153. }
  154. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  155. this.$u.toast('请输入您的支付宝账号');
  156. return;
  157. }
  158. } else if (this.cash_out_form.reflectType === '银行卡') {
  159. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  160. this.$u.toast('请输入您的真实姓名');
  161. return;
  162. }
  163. if (!this.$u.trim(this.cash_out_form.reflectInfo.bankName)) {
  164. this.$u.toast('请选择银行名称');
  165. return;
  166. }
  167. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  168. this.$u.toast('请输入您的银行账号');
  169. return;
  170. }
  171. if (!this.$u.trim(this.agin_card_num)) {
  172. this.$u.toast('请再次输入您的银行账号');
  173. return;
  174. }
  175. if (this.agin_card_num !== this.cash_out_form.reflectInfo.account) {
  176. this.$u.toast('确认卡号与银行卡号不一致');
  177. return;
  178. }
  179. } else {
  180. if (!this.$u.trim(this.cash_out_form.reflectInfo.name)) {
  181. this.$u.toast('请输入您的真实姓名');
  182. return;
  183. }
  184. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  185. this.$u.toast('请输入您的微信手机号');
  186. return;
  187. }
  188. if (!this.$u.trim(this.cash_out_form.reflectInfo.account)) {
  189. this.$u.toast('请输入您的微信账号');
  190. return;
  191. }
  192. }
  193. if (!this.cash_out_form.money) {
  194. this.$u.toast('请输入要提现金额');
  195. return;
  196. }
  197. if (Number(this.cash_out_form.money) < this.min_money) {
  198. this.$u.toast('最低提现金额为' + this.min_money + '元');
  199. return;
  200. }
  201. if (Number(this.cash_out_form.money) > Number(this.userInfo.memberBalance)) {
  202. this.$u.toast('可提现金额不足');
  203. return;
  204. }
  205. this.isLoding = true;
  206. this.$u.api
  207. .addReflectDetail({
  208. ...this.cash_out_form,
  209. customerId: this.userInfo.id
  210. })
  211. .then(res => {
  212. this.isLoding = false;
  213. this.$u.toast('提现申请成功');
  214. setTimeout(res => {
  215. this.goPage('/pages/user/user', 'switchTab');
  216. }, 2000);
  217. })
  218. .catch(res => {
  219. this.isLoding = false;
  220. });
  221. },
  222. // 全部提现按钮点击事件
  223. allWitjdrawal() {
  224. this.cash_out_form.money = this.cash_out_form.nowMoney;
  225. },
  226. // 自动提现
  227. paymentChange(val) {
  228. this.cash_out_form.reflectType = val;
  229. this.closePayPop();
  230. },
  231. closePayPop() {
  232. this.payPop = false;
  233. this.cash_out_form.reflectInfo.account = '';
  234. this.cash_out_form.reflectInfo.bankName = '';
  235. },
  236. openPay() {
  237. this.payPop = true;
  238. }
  239. }
  240. };
  241. </script>
  242. <style lang="scss">
  243. .Withdrawal {
  244. width: 702upx;
  245. margin: 20upx auto;
  246. padding: 0 24upx 50upx;
  247. background-color: #ffffff;
  248. font-size: 28upx;
  249. .w-view {
  250. border-bottom: 1px solid #f5f5f5;
  251. padding: 24upx 0;
  252. .ibonjinru {
  253. font-size: 28upx;
  254. color: #666;
  255. height: 32upx;
  256. margin-left: 10upx;
  257. }
  258. .w-input {
  259. width: 480rpx;
  260. }
  261. .w-input-place {
  262. color: #b0b3bf;
  263. font-size: 26upx;
  264. }
  265. .w-tit {
  266. .w-tit-r {
  267. margin-left: 10upx;
  268. font-size: 24upx;
  269. color: #b0b3bf;
  270. }
  271. }
  272. }
  273. .w-money {
  274. .w-money-input-view {
  275. padding-top: 40upx;
  276. .rmb-ic {
  277. font-size: 60upx;
  278. font-weight: bold;
  279. display: inline-block;
  280. vertical-align: middle;
  281. height: 70upx;
  282. }
  283. .w-money-input {
  284. display: inline-block;
  285. width: 580upx;
  286. height: 70upx;
  287. font-size: 60upx;
  288. padding-left: 20upx;
  289. font-weight: bold;
  290. vertical-align: middle;
  291. padding-top: 6rpx;
  292. }
  293. }
  294. }
  295. .w-tip {
  296. font-size: 24upx;
  297. padding: 20upx 0 50upx;
  298. }
  299. .w-btn {
  300. margin: 0 auto;
  301. width: 660upx;
  302. line-height: 70upx;
  303. height: 70upx;
  304. color: #666;
  305. text-align: center;
  306. font-size: 28upx;
  307. border-radius: 70upx;
  308. background-color: #eee;
  309. }
  310. .w-btn-on {
  311. color: #fff;
  312. background-color: #fe582e;
  313. }
  314. }
  315. .pay-pop-view {
  316. background-color: #ffffff;
  317. border-top-left-radius: 12upx;
  318. border-top-right-radius: 12upx;
  319. padding-bottom: 40upx;
  320. font-size: 28upx;
  321. .pay-sel-title {
  322. padding: 0 30upx;
  323. line-height: 88upx;
  324. font-weight: bold;
  325. font-size: 32upx;
  326. .ibonfont {
  327. color: #999;
  328. font-weight: 400;
  329. width: 50rpx;
  330. text-align: center;
  331. font-size: 24rpx;
  332. }
  333. }
  334. .pay-btn {
  335. width: 690upx;
  336. height: 80upx;
  337. line-height: 80upx;
  338. color: #fff;
  339. font-size: 32upx;
  340. text-align: center;
  341. margin: 20upx auto 0;
  342. border-radius: 80upx;
  343. }
  344. .pay-ul {
  345. .pay-tip {
  346. font-size: 24upx;
  347. color: #999999;
  348. line-height: 32upx;
  349. padding: 20upx 30upx 0;
  350. }
  351. .pay-li {
  352. line-height: 100upx;
  353. .ibonfont {
  354. padding-left: 30upx;
  355. font-size: 46upx;
  356. vertical-align: middle;
  357. margin-right: 24upx;
  358. }
  359. .ibonweixinzhifu {
  360. color: #04be02;
  361. }
  362. .ibonumidd17 {
  363. color: #108ee9;
  364. }
  365. .ibonyinhangqia {
  366. color: #f2b844;
  367. }
  368. .pay-name {
  369. width: 650upx;
  370. display: inline-block;
  371. padding-right: 30upx;
  372. vertical-align: middle;
  373. border-bottom: 1px solid #f5f5f5;
  374. .ibonxuanze,
  375. .ibonxuanze_xuanzhong {
  376. margin-right: 0;
  377. padding-left: 0;
  378. font-size: 38upx;
  379. }
  380. }
  381. }
  382. .pay-li:last-child {
  383. .pay-name {
  384. border-bottom: 0 none;
  385. }
  386. }
  387. }
  388. }
  389. </style>