index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <template>
  2. <view :data-theme="theme">
  3. <workNavBar titleText="工作台" bagColor="#f5f5f5" :iconColor="iconColor" :textColor="iconColor" :isScrolling="isScrolling" showBack>
  4. <view class="word_header_text">
  5. <view class="text-box line1 wx-text-box">
  6. 结算申请
  7. </view>
  8. </view>
  9. </workNavBar>
  10. <view class='cash-withdrawal'>
  11. <view class='nav acea-row'>
  12. <view v-for="(item,index) in navList" :key="index" class='item font-color'
  13. @click="swichNav(index,item)">
  14. <view class='line bg_color' :class='currentTab==index ? "on":""'></view>
  15. <view class='iconfont' :class='item.icon+" "+(currentTab==index ? "on":"")'></view>
  16. <view class="tab_text">{{item.name}}</view>
  17. </view>
  18. </view>
  19. <view class='wrapper'>
  20. <view :hidden='currentTab != 0' class='list'>
  21. <form @submit="subCash" report-submit='true'>
  22. <view class='item acea-row row-between-wrapper'>
  23. <view class='name'>姓名</view>
  24. <view class='input'>
  25. <input placeholder='请输入持卡人姓名' placeholder-class='placeholder' name="cardholder"
  26. maxlength="20"></input>
  27. </view>
  28. </view>
  29. <view class='item acea-row row-between-wrapper'>
  30. <view class='name'>卡号</view>
  31. <view class='input'>
  32. <input type='number' placeholder='请填写卡号' placeholder-class='placeholder'
  33. name="bankCardNo" maxlength="19"></input>
  34. </view>
  35. </view>
  36. <view class='item acea-row row-between-wrapper'>
  37. <view class='name'>Bank</view>
  38. <view class='input'>
  39. <picker @change="bindPickerChange" :value="index" :range="bankList">
  40. <text class='Bank'>{{bankList[index]}}</text>
  41. <text class='iconfont icon-qiepian38'></text>
  42. </picker>
  43. </view>
  44. </view>
  45. <view class='item acea-row row-between-wrapper'>
  46. <view class='name'>结算</view>
  47. <view class='input'><input
  48. :placeholder='settlementConfig.minPrice? "最低结算金额"+ settlementConfig.minPrice:"最低结算金额"+ 0'
  49. placeholder-class='placeholder' name="closingPrice" type='digit'></input></view>
  50. </view>
  51. <button formType="submit" class='bnt'
  52. :class="parseFloat(settlementConfig.brokerage)>parseFloat(settlementConfig.minPrice) ?'bg-color': 'bg-color-hui'">结算申请</button>
  53. </form>
  54. </view>
  55. <view :hidden='currentTab != 1' class='list'>
  56. <form @submit="subCash" report-submit='true'>
  57. <view class='item acea-row row-between-wrapper'>
  58. <view class='name'>姓名</view>
  59. <view class='input'>
  60. <input placeholder='请填写您的真实姓名' placeholder-class='placeholder' name="realName"
  61. maxlength="20"></input>
  62. </view>
  63. </view>
  64. <view class='item acea-row row-between-wrapper'>
  65. <view class='name'>账号</view>
  66. <view class='input'>
  67. <input placeholder='请填写您的微信账号' placeholder-class='placeholder' name="wechatNo"
  68. maxlength="20"></input>
  69. </view>
  70. </view>
  71. <view class='item acea-row row-between-wrapper'>
  72. <view class='name'>结算</view>
  73. <view class='input'>
  74. <input :placeholder='"最低结算金额"+ settlementConfig.minPrice|| 0'
  75. placeholder-class='placeholder' name="closingPrice" type='digit'
  76. maxlength="5"></input>
  77. </view>
  78. </view>
  79. <view class='item acea-row row-top row-between'>
  80. <view class='name'>收款码</view>
  81. <view class="input acea-row">
  82. <view class="picEwm" v-if="qrcodeUrlW">
  83. <image :src="qrcodeUrlW"></image>
  84. <text class='iconfont icon-guanbi1 font-color' @click='DelPicW'></text>
  85. </view>
  86. <view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic("W")'
  87. v-else>
  88. <text class='iconfont icon-icon25201'></text>
  89. <view>上传图片</view>
  90. </view>
  91. </view>
  92. </view>
  93. <button formType="submit" class='bnt'
  94. :class="parseFloat(settlementConfig.brokerage)>parseFloat(settlementConfig.minPrice) ?'bg-color': 'bg-color-hui'">结算申请</button>
  95. </form>
  96. </view>
  97. <view :hidden='currentTab != 2' class='list'>
  98. <form @submit="subCash" report-submit='true'>
  99. <view class='item acea-row row-between-wrapper'>
  100. <view class='name'>姓名</view>
  101. <view class='input'>
  102. <input placeholder='请填写您的真实姓名' placeholder-class='placeholder' name="realName"
  103. maxlength="20"></input>
  104. </view>
  105. </view>
  106. <view class='item acea-row row-between-wrapper'>
  107. <view class='name'>账号</view>
  108. <view class='input'>
  109. <input placeholder='请填写您的支付宝账号' placeholder-class='placeholder' name="alipayAccount"
  110. maxlength="20"></input>
  111. </view>
  112. </view>
  113. <view class='item acea-row row-between-wrapper'>
  114. <view class='name'>结算</view>
  115. <view class='input'>
  116. <input :placeholder='"最低结算金额"+settlementConfig.minPrice' placeholder-class='placeholder'
  117. name="closingPrice" type='digit' maxlength="5"></input>
  118. </view>
  119. </view>
  120. <view class='item acea-row row-top row-between'>
  121. <view class='name'>收款码</view>
  122. <view class="input acea-row">
  123. <view class="picEwm" v-if="qrcodeUrlZ">
  124. <image :src="qrcodeUrlZ"></image>
  125. <text class='iconfont icon-guanbi1 font-color' @click='DelPicZ'></text>
  126. </view>
  127. <view class='pictrue acea-row row-center-wrapper row-column' @click='uploadpic("Z")'
  128. v-else>
  129. <text class='iconfont icon-icon25201'></text>
  130. <view>上传图片</view>
  131. </view>
  132. </view>
  133. </view>
  134. <button formType="submit" class='bnt'
  135. :class="parseFloat(settlementConfig.brokerage)>parseFloat(settlementConfig.minPrice) ?'bg-color': 'bg-color-hui'">结算申请</button>
  136. </form>
  137. </view>
  138. <view class='tip'>
  139. 当前可提现金额: <text
  140. class="price">¥{{settlementConfig.brokerage?settlementConfig.brokerage:0}},</text>冻结:¥{{settlementConfig.freezeBrokerage?settlementConfig.freezeBrokerage:0}}
  141. </view>
  142. <view class='tip'>
  143. 说明: 每笔佣金的冻结期为{{settlementConfig.freezeDay?settlementConfig.freezeDay:0}}天,到期后可提现
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. </template>
  149. <script>
  150. // +----------------------------------------------------------------------
  151. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  152. // +----------------------------------------------------------------------
  153. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  154. // +----------------------------------------------------------------------
  155. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  156. // +----------------------------------------------------------------------
  157. // | Author: CRMEB Team <admin@crmeb.com>
  158. // +----------------------------------------------------------------------
  159. import workNavBar from '../components/workNavBar.vue';
  160. import {
  161. extractCash,closingConfigApi
  162. } from '@/api/rider.js'
  163. import {
  164. toLogin
  165. } from '@/libs/login.js';
  166. import {
  167. mapGetters
  168. } from "vuex";
  169. import {
  170. Debounce
  171. } from '@/utils/validate.js'
  172. let app = getApp();
  173. export default {
  174. components: {
  175. workNavBar
  176. },
  177. data() {
  178. return {
  179. navList: [{
  180. 'name': '',
  181. 'icon': 'icon-yinhangqia',
  182. 'type': 'bank'
  183. },
  184. {
  185. 'name': '',
  186. 'icon': 'icon-weixin2',
  187. 'type': 'wechat'
  188. },
  189. {
  190. 'name': '',
  191. 'icon': 'icon-icon34',
  192. 'type': 'alipay'
  193. }
  194. ],
  195. type: 'bank',
  196. currentTab: 0,
  197. index: 0,
  198. bankList: [], //提现银行
  199. userInfo: [],
  200. isClone: false,
  201. settlementConfig: {}, //结算配置
  202. qrcodeUrlW: "",
  203. qrcodeUrlZ: "",
  204. isCommitted: false, //防止多次提交
  205. theme: app.globalData.theme,
  206. iconColor: '#000000'
  207. };
  208. },
  209. computed: mapGetters(['isLogin']),
  210. watch: {
  211. isLogin: {
  212. handler: function(newV, oldV) {
  213. if (newV) {
  214. this.getClosingConfig();
  215. }
  216. },
  217. deep: true
  218. }
  219. },
  220. onLoad(options) {
  221. if (this.isLogin) {
  222. this.getClosingConfig();
  223. } else {
  224. toLogin();
  225. }
  226. },
  227. methods: {
  228. uploadpic: function(type) {
  229. let that = this;
  230. that.$util.uploadImageOne({
  231. url: 'upload/image',
  232. name: 'multipart',
  233. model: "user",
  234. pid: 1
  235. }, function(res) {
  236. if (type === 'W') {
  237. that.qrcodeUrlW = res;
  238. } else {
  239. that.qrcodeUrlZ = res;
  240. }
  241. });
  242. },
  243. /**
  244. * 删除图片
  245. *
  246. */
  247. DelPicW: function() {
  248. this.qrcodeUrlW = "";
  249. },
  250. DelPicZ: function() {
  251. this.qrcodeUrlZ = "";
  252. },
  253. /**
  254. * 获取用户结算配置
  255. *
  256. */
  257. getClosingConfig() {
  258. closingConfigApi().then(res => {
  259. let data = res.data;
  260. this.$set(this, 'bankList', data.bankList);
  261. this.settlementConfig = res.data;
  262. })
  263. },
  264. swichNav: function(i, item) {
  265. this.currentTab = i;
  266. this.type = item.type;
  267. },
  268. bindPickerChange: function(e) {
  269. this.index = e.detail.value;
  270. },
  271. moneyInput(e) {
  272. //正则表达试
  273. e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  274. //重新赋值给input
  275. this.$nextTick(() => {
  276. this.money = e.target.value
  277. })
  278. },
  279. subCash: Debounce(function(e) {
  280. let that = this,
  281. value = e.detail.value;
  282. if(parseFloat(that.settlementConfig.brokerage) <=0) return;
  283. switch (that.currentTab) {
  284. case 0:
  285. if (value.cardholder.length == 0) return this.$util.Tips({
  286. title: '请填写持卡人姓名'
  287. });
  288. if (value.bankCardNo.length == 0) return this.$util.Tips({
  289. title: '请填写卡号'
  290. });
  291. value.bankName = that.bankList[that.index];
  292. break;
  293. case 1:
  294. if (value.wechatNo.length == 0) return this.$util.Tips({
  295. title: '请填写微信号'
  296. });
  297. if (value.realName.length == 0) return this.$util.Tips({
  298. title: '请填写真实姓名'
  299. });
  300. if (!that.qrcodeUrlW) return this.$util.Tips({
  301. title: '请填写微信收款码'
  302. });
  303. value.paymentCode = that.qrcodeUrlW;
  304. break;
  305. default:
  306. if (value.alipayAccount.length == 0) return this.$util.Tips({
  307. title: '请填写支付宝账号'
  308. });
  309. if (value.realName.length == 0) return this.$util.Tips({
  310. title: '请填写真实姓名'
  311. });
  312. if (!that.qrcodeUrlZ) return this.$util.Tips({
  313. title: '请填写支付宝收款码'
  314. });
  315. value.paymentCode = that.qrcodeUrlZ;
  316. break;
  317. }
  318. value.type = this.type;
  319. if (value.closingPrice.length == 0) return this.$util.Tips({
  320. title: '请填写结算金额'
  321. });
  322. if (!(/^(\d?)+(\.\d{0,2})?$/.test(value.closingPrice))) return this.$util.Tips({
  323. title: '结算金额保留2位小数'
  324. });
  325. if (parseFloat(value.closingPrice) < parseFloat(that.settlementConfig.minPrice)) return this.$util
  326. .Tips({
  327. title: '结算金额不能低于' + that.settlementConfig.minPrice
  328. });
  329. if (this.isCommitted == false) {
  330. this.isCommitted = true;
  331. extractCash(value).then(res => {
  332. return this.$util.Tips({
  333. title: "申请成功",
  334. icon: 'success'
  335. }, {
  336. tab: 2,
  337. url: '/pages/rider_index/cashwithdrawal/index'
  338. });
  339. this.isCommitted = false;
  340. }).catch(err => {
  341. this.isCommitted = false;
  342. return this.$util.Tips({
  343. title: err
  344. });
  345. });
  346. }
  347. })
  348. }
  349. }
  350. </script>
  351. <style>
  352. body {
  353. height: 100% !important;
  354. }
  355. </style>
  356. <style lang="scss">
  357. page {
  358. background-color: #fff !important;
  359. }
  360. .cash-withdrawal .nav {
  361. height: 130rpx;
  362. box-shadow: 0 10rpx 10rpx #f8f8f8;
  363. }
  364. .cash-withdrawal .nav .item {
  365. font-size: 26rpx;
  366. flex: 1;
  367. text-align: center;
  368. }
  369. .cash-withdrawal .nav .item~.item {
  370. border-left: 1px solid #f0f0f0;
  371. }
  372. .cash-withdrawal .nav .item .iconfont {
  373. width: 40rpx;
  374. height: 40rpx;
  375. border-radius: 50%;
  376. @include coupons_border_color(theme);
  377. @include main_color(theme);
  378. text-align: center;
  379. line-height: 37rpx;
  380. margin: 0 auto 6rpx auto;
  381. font-size: 22rpx;
  382. box-sizing: border-box;
  383. }
  384. .cash-withdrawal .nav .item .iconfont.on {
  385. @include main_bg_color(theme);
  386. color: #fff !important;
  387. @include coupons_border_color(theme);
  388. // border-color: $theme-color;
  389. }
  390. .cash-withdrawal .nav .item .line {
  391. width: 2rpx;
  392. height: 20rpx;
  393. margin: 0 auto;
  394. transition: height 0.3s;
  395. }
  396. .tab_text {
  397. @include main_color(theme);
  398. }
  399. .bg_color {
  400. @include main_bg_color(theme);
  401. }
  402. .cash-withdrawal .nav .item .line.on {
  403. height: 39rpx;
  404. }
  405. .cash-withdrawal .wrapper .list {
  406. padding: 0 30rpx;
  407. }
  408. .cash-withdrawal .wrapper .list .item {
  409. border-bottom: 1rpx solid #eee;
  410. min-height: 28rpx;
  411. font-size: 30rpx;
  412. color: #333;
  413. padding: 39rpx 0;
  414. }
  415. .cash-withdrawal .wrapper .list .item .name {
  416. width: 130rpx;
  417. }
  418. .cash-withdrawal .wrapper .list .item .input {
  419. width: 505rpx;
  420. }
  421. .cash-withdrawal .wrapper .list .item .input .placeholder {
  422. color: #bbb;
  423. }
  424. .cash-withdrawal .wrapper .list .item .picEwm,
  425. .cash-withdrawal .wrapper .list .item .pictrue {
  426. width: 140rpx;
  427. height: 140rpx;
  428. border-radius: 3rpx;
  429. position: relative;
  430. margin-right: 23rpx;
  431. }
  432. .cash-withdrawal .wrapper .list .item .picEwm image {
  433. width: 100%;
  434. height: 100%;
  435. border-radius: 3rpx;
  436. }
  437. .cash-withdrawal .wrapper .list .item .picEwm .icon-guanbi1 {
  438. position: absolute;
  439. right: -14rpx;
  440. top: -16rpx;
  441. font-size: 40rpx;
  442. }
  443. .cash-withdrawal .wrapper .list .item .pictrue {
  444. border: 1px solid rgba(221, 221, 221, 1);
  445. font-size: 22rpx;
  446. color: #BBBBBB;
  447. }
  448. .cash-withdrawal .wrapper .list .item .pictrue .icon-icon25201 {
  449. font-size: 47rpx;
  450. color: #DDDDDD;
  451. margin-bottom: 3px;
  452. }
  453. .cash-withdrawal .wrapper .tip {
  454. font-size: 26rpx;
  455. color: #999;
  456. margin-top: 25rpx;
  457. padding: 0 30rpx;
  458. }
  459. .cash-withdrawal .wrapper .bnt {
  460. font-size: 32rpx;
  461. color: #fff;
  462. width: 690rpx;
  463. height: 90rpx;
  464. text-align: center;
  465. border-radius: 50rpx;
  466. line-height: 90rpx;
  467. margin: 64rpx auto;
  468. }
  469. .cash-withdrawal .wrapper .tip2 {
  470. font-size: 26rpx;
  471. color: #999;
  472. text-align: center;
  473. margin: 44rpx 0 20rpx 0;
  474. }
  475. .cash-withdrawal .wrapper .value {
  476. height: 135rpx;
  477. line-height: 135rpx;
  478. border-bottom: 1rpx solid #eee;
  479. width: 690rpx;
  480. margin: 0 auto;
  481. }
  482. .cash-withdrawal .wrapper .value input {
  483. font-size: 80rpx;
  484. color: #282828;
  485. height: 135rpx;
  486. text-align: center;
  487. }
  488. .cash-withdrawal .wrapper .list .value .placeholder2 {
  489. color: #bbb;
  490. }
  491. .price {
  492. @include price_color(theme);
  493. }
  494. .word_header_text {
  495. /* #ifdef H5 */
  496. margin-top: 20rpx;
  497. /* #endif */
  498. color: #fff;
  499. text-align: center;
  500. display: flex;
  501. align-items: center;
  502. justify-content: center;
  503. .popup-box {
  504. text-align: right;
  505. width: 180rpx;
  506. overflow: hidden;
  507. white-space: nowrap;
  508. text-overflow: ellipsis;
  509. }
  510. .icon-xiangxia {
  511. font-size: 18rpx;
  512. }
  513. }
  514. .wx-text-box{
  515. max-width: 240rpx;
  516. }
  517. .text-box {
  518. flex: 1;
  519. padding-left: 16rpx;
  520. color: #000000;
  521. }
  522. </style>