gztq.vue 11 KB

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