addWithdrawal.vue 11 KB

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