Txmoney.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <template>
  2. <view class="content" v-if="XCXIsSelect != '否'">
  3. <view class="part_one">
  4. <view class="one_title">可提现金额</view>
  5. <view class="one_price">¥{{ mayMoney }}</view>
  6. </view>
  7. <view class="part_two">
  8. <view class="two_title">
  9. 提现金额
  10. <text>提现最低额度{{ minMoney }}元</text>
  11. </view>
  12. <view class="two_box">
  13. ¥
  14. <u-input v-model="money" type="number" :clearable="false" :border="border" placeholder="请输入提现金额" />
  15. </view>
  16. <view class="beizhu">*注单笔限制提现最低额度{{ minMoney }}元,最大提现额度为{{ manMoney }}元,单笔提现手续费{{ shouxufei * 100 }}%</view>
  17. </view>
  18. <view class="part_three">
  19. <view class="three_name">兑换方式</view>
  20. <view class="btn">
  21. <view class="btn_left" :class="current == 2 ? 'btna' : ''" @click="bindToindex(2)">
  22. <image src="../../../../static/my/weixin.png"></image>
  23. <text>微信</text>
  24. </view>
  25. <view class="btn_right" :class="current == 1 ? 'btna' : ''" @click="bindToindex(1)">
  26. <image src="../../../../static/my/zhifubao.png"></image>
  27. <text>支付宝</text>
  28. </view>
  29. </view>
  30. </view>
  31. <view style="margin-top: 59upx" class="padding-lr margin-lr-sm">
  32. <view class="yinghang">提现银行卡信息</view>
  33. <view style="color: #333333; text-align: left">
  34. 银行卡号:
  35. <text class="yinghang2">{{ yingNo }}</text>
  36. </view>
  37. <view style="color: #333333; text-align: left">
  38. 开户行:
  39. <text class="yinghang2">{{ yingName }}</text>
  40. </view>
  41. <view style="color: #333333; text-align: left">
  42. 开户人姓名:
  43. <text class="yinghang2">{{ yingPeople }}</text>
  44. </view>
  45. <!-- <view class="flex justify-between margin-bottom-xl" v-for="(item,index) in openLists" :key="index">
  46. <view class="flex align-center">
  47. <image :src="item.image" style="width:23px;height:20px"></image>
  48. <text class="text-lg margin-left-sm" style="color:#333333;font-weight:700;">{{item.text}}</text>
  49. </view>
  50. <view>
  51. <radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
  52. <label class="tui-radio">
  53. <radio color="#FF7F00" :checked="openWay === item.id ? true : false" />
  54. </label>
  55. </radio-group>
  56. </view>
  57. </view> -->
  58. </view>
  59. <view class="part_four">
  60. <view class="submit" @click="getOut()">立即提现</view>
  61. <view class="four_box">
  62. <view class="box_left" @click="goZhifuBao">提现账户</view>
  63. <view class="box_right" @click="list">提现记录</view>
  64. <view class="box_right" @click="isShow">微信收款码</view>
  65. </view>
  66. </view>
  67. <!-- 微信收款码弹框 -->
  68. <u-popup v-model="show" mode="center">
  69. <view class="padding">
  70. <view class="text-center text-lg text-bold flex justify-between">
  71. <view></view>
  72. <view>添加微信收款码</view>
  73. <view @click="show = false">X</view>
  74. </view>
  75. <!-- <view class="text-center padding-top-sm padding-bottom-lg" style="color: #999999;">请提交微信号和微信二维码
  76. </view> -->
  77. <view style="width: 80%; margin: 0 auto">
  78. <view class="margin-top" @click.stop="weixin" style="border: 4rpx solid #010101; border-radius: 16rpx; overflow: hidden">
  79. <image v-if="!wximg" src="../../../../static/image/erweima.png"></image>
  80. <image v-else :src="wximg" mode=""></image>
  81. </view>
  82. </view>
  83. <!-- <view class="text-center margin-top-sm " @click="submit"
  84. style="border-radius: 10rpx;background-color: #7E59FF;color: #fff;height: 80rpx;line-height: 80rpx;">保存</view> -->
  85. </view>
  86. </u-popup>
  87. </view>
  88. </template>
  89. <script>
  90. import { showToast } from '../../../../common/queue'
  91. import configdata from '../../../../common/config.js'
  92. export default {
  93. data() {
  94. return {
  95. show: false,
  96. current: '1',
  97. // value: 10,
  98. money: '',
  99. zhifubaoName: '',
  100. zhifubao: '',
  101. shouxufei: 0.01,
  102. minMoney: '10',
  103. manMoney: '200',
  104. mayMoney: '',
  105. XCXIsSelect: '否',
  106. wximg: '',
  107. values: '',
  108. // 银行卡号
  109. yingNo: '',
  110. // 开户行
  111. yingName: '',
  112. // 开户人姓名
  113. yingPeople: ''
  114. }
  115. },
  116. onLoad() {
  117. this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
  118. if (this.XCXIsSelect == '否') {
  119. uni.setNavigationBarTitle({
  120. title: '隐私政策'
  121. })
  122. } else {
  123. uni.setNavigationBarTitle({
  124. title: '余额提现'
  125. })
  126. }
  127. },
  128. onShow() {
  129. this.getMoney()
  130. //最低可提现金额度
  131. this.$Request.getT('/app/common/type/112').then((res) => {
  132. if (res.code === 0) {
  133. this.minMoney = res.data.value
  134. }
  135. })
  136. //最高可提现金额度
  137. this.$Request.getT('/app/common/type/153').then((res) => {
  138. if (res.code === 0) {
  139. this.manMoney = res.data.value
  140. }
  141. })
  142. //手续费
  143. this.$Request.getT('/app/common/type/114').then((res) => {
  144. if (res.code === 0) {
  145. this.shouxufei = res.data.value
  146. }
  147. })
  148. //判断微信提现方式
  149. this.$Request.getT('/app/common/type/290').then((res) => {
  150. if (res.code == 0) {
  151. if (res.data && res.data.value) {
  152. this.values = res.data.value
  153. }
  154. }
  155. })
  156. // 银行卡信息
  157. let data = {
  158. userId: uni.getStorageSync('userId')
  159. }
  160. this.$Request.getT('/app/rider/bank/getUserId', data).then((res) => {
  161. if (res.code == 0) {
  162. this.yingNo = res.data.cardNo
  163. this.yingName = res.data.openBank
  164. this.yingPeople = res.data.realName
  165. }
  166. })
  167. },
  168. methods: {
  169. //用户收款码弹框
  170. isShow() {
  171. this.getMoney()
  172. this.show = true
  173. },
  174. //微信 支付宝提现选择
  175. bindToindex(e) {
  176. this.current = e
  177. console.log(e, this.current)
  178. },
  179. list() {
  180. uni.navigateTo({
  181. url: '/pages/riderMy/myAccount/AcontMoney/cashList'
  182. })
  183. },
  184. goZhifuBao() {
  185. uni.navigateTo({
  186. url: '/pages/riderMy/myAccount/AcontMoney/zhifubao'
  187. })
  188. },
  189. getMoney() {
  190. let that = this
  191. let token = this.$queue.getData('token')
  192. let userId = this.$queue.getData('userId')
  193. if (token) {
  194. //this.$queue.showLoading("加载中...");
  195. //可以提现金额查询预估收入查询
  196. that.$Request.getT('/app/userinfo/findUserInfoById').then((res) => {
  197. console.log(res, '111')
  198. if (res.code === 0 && res.data) {
  199. that.mayMoney = res.data.balance
  200. this.zhifubao = res.data.zhiFuBao
  201. this.zhifubaoName = res.data.zhiFuBaoName
  202. that.wximg = res.data.cashQrCode
  203. } else if (res.code === -102) {
  204. that.$queue.showToast(res.msg)
  205. that.$queue.logout()
  206. // uni.navigateTo({
  207. // url: '/pages/public/login'
  208. // });
  209. } else {
  210. that.mayMoney = '0'
  211. //this.$queue.showToast(res.msg);
  212. }
  213. })
  214. }
  215. },
  216. getOut() {
  217. let that = this
  218. let token = that.$queue.getData('token')
  219. let userId = that.$queue.getData('userId')
  220. if (token) {
  221. if (that.current == 1) {
  222. // if (!this.zhifubao || !this.zhifubaoName) {
  223. // uni.navigateTo({
  224. // url: '/pages/riderMy/myAccount/AcontMoney/zhifubao'
  225. // })
  226. // return
  227. // }
  228. if (!/^\d+$/.test(that.money)) {
  229. // uni.showToast({
  230. // icon: 'none',
  231. // title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  232. // });
  233. that.$queue.showToast('请输入正确金额,不能包含中文,英文,特殊字符和小数')
  234. return
  235. }
  236. if (Number(that.money) < Number(that.minMoney)) {
  237. uni.showToast({
  238. icon: 'none',
  239. title: '提现金额不能小于' + that.minMoney + '元'
  240. })
  241. return
  242. }
  243. if (Number(that.money) > Number(that.manMoney)) {
  244. uni.showToast({
  245. icon: 'none',
  246. title: '提现金额不能大于' + that.manMoney + '元'
  247. })
  248. return
  249. }
  250. uni.showModal({
  251. title: '提现申请提示',
  252. content:
  253. '请仔细确认收款人信息\r\n姓名:' +
  254. that.yingPeople +
  255. `\r\n提现金额:` +
  256. that.money +
  257. '元' +
  258. '\r\n提现手续费:' +
  259. parseFloat(that.money * that.shouxufei).toFixed(2) +
  260. '元' +
  261. '\r\n收款账号:' +
  262. that.yingNo +
  263. '',
  264. success: (e) => {
  265. if (e.confirm) {
  266. let data = {
  267. classify: that.current,
  268. money: that.money
  269. }
  270. that.$queue.showLoading('提现中...')
  271. that.$Request.getT('/app/cash/cashMoney', data).then((res) => {
  272. if (res.code === 0) {
  273. that.$queue.showToast('提现申请成功,预计三个工作日到账')
  274. that.getMoney()
  275. that.mayMoney = ''
  276. } else {
  277. uni.showModal({
  278. title: '温馨提示',
  279. content: res.msg,
  280. showCancel: false,
  281. cancelText: '取消',
  282. confirmText: '确认'
  283. })
  284. }
  285. uni.hideLoading()
  286. })
  287. }
  288. }
  289. })
  290. } else if (that.current == 2) {
  291. if (!/^\d+$/.test(that.money)) {
  292. // uni.showToast({
  293. // icon: 'none',
  294. // title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  295. // });
  296. that.$queue.showToast('请输入正确金额,不能包含中文,英文,特殊字符和小数')
  297. return
  298. }
  299. if (Number(that.money) < Number(that.minMoney)) {
  300. uni.showToast({
  301. icon: 'none',
  302. title: '提现金额不能小于' + that.minMoney + '元'
  303. })
  304. return
  305. }
  306. if (Number(that.money) > Number(that.manMoney)) {
  307. uni.showToast({
  308. icon: 'none',
  309. title: '提现金额不能大于' + that.manMoney + '元'
  310. })
  311. return
  312. }
  313. if (that.values == 2) {
  314. that.$Request.getT('/app/userinfo/findUserInfoById').then((res) => {
  315. if (res.code === 0) {
  316. let wxImg = res.data.cashQrCode
  317. if (!wxImg) {
  318. uni.showModal({
  319. title: '提现提示',
  320. content: '请上传微信收款码',
  321. showCancel: true,
  322. cancelText: '取消',
  323. confirmText: '上传',
  324. success: (res) => {
  325. if (res.confirm) {
  326. that.show = true
  327. }
  328. },
  329. fail: () => {},
  330. complete: () => {}
  331. })
  332. return
  333. }
  334. if (that.money * 1 >= that.minMoney * 1) {
  335. uni.showModal({
  336. title: '提现申请提示',
  337. content:
  338. '请仔细确认收款人信息\r\n姓名:' +
  339. that.yingPeople +
  340. '\r\n提现金额:' +
  341. that.money +
  342. '元' +
  343. '\r\n提现手续费:' +
  344. parseFloat(that.money * that.shouxufei).toFixed(2) +
  345. '元' +
  346. '\r\n收款账号:' +
  347. that.yingNo +
  348. '',
  349. success: (e) => {
  350. if (e.confirm) {
  351. that.$queue.showLoading('提现中...')
  352. let data = {
  353. money: that.money,
  354. classify: 2
  355. }
  356. that.$Request.getT('/app/cash/cashMoney', data).then((res) => {
  357. if (res.code === 0) {
  358. setTimeout(function () {
  359. that.$queue.showToast('提现申请成功,预计三个工作日到账')
  360. }, 1000)
  361. that.getMoney()
  362. that.money = ''
  363. } else {
  364. uni.showModal({
  365. title: '温馨提示',
  366. content: res.msg,
  367. showCancel: false,
  368. cancelText: '取消',
  369. confirmText: '确认'
  370. })
  371. }
  372. uni.hideLoading()
  373. })
  374. }
  375. }
  376. })
  377. } else {
  378. setTimeout(function () {
  379. that.$queue.showToast('提现金额必须大于或等于' + that.minMoney + '元才可提现')
  380. }, 1000)
  381. }
  382. } else {
  383. that.$queue.showToast('网络状态不好,请刷新后重试!')
  384. }
  385. })
  386. } else {
  387. if (!/^\d+$/.test(that.money)) {
  388. // uni.showToast({
  389. // icon: 'none',
  390. // title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  391. // });
  392. that.$queue.showToast('请输入正确金额,不能包含中文,英文,特殊字符和小数')
  393. return
  394. }
  395. if (parseFloat(that.money).toFixed(1) >= that.minMoney) {
  396. uni.showModal({
  397. title: '提现申请提示',
  398. content:
  399. '请仔细确认收款人信息\r\n姓名:' +
  400. that.yingPeople +
  401. '\r\n提现金额:' +
  402. that.money +
  403. '元' +
  404. '\r\n提现手续费:' +
  405. parseFloat(that.money * that.shouxufei).toFixed(2) +
  406. '元' +
  407. '\r\n收款账号:' +
  408. that.yingNo +
  409. '',
  410. success: (e) => {
  411. if (e.confirm) {
  412. that.$queue.showLoading('提现中...')
  413. let data = {
  414. money: that.money,
  415. classify: 2,
  416. type: 3
  417. }
  418. that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then((res) => {
  419. if (res.code === 0) {
  420. setTimeout(function () {
  421. that.$queue.showToast('提现申请成功,预计三个工作日到账')
  422. }, 1000)
  423. that.getMoney()
  424. that.money = ''
  425. } else {
  426. uni.showModal({
  427. title: '温馨提示',
  428. content: res.msg,
  429. showCancel: false,
  430. cancelText: '取消',
  431. confirmText: '确认'
  432. })
  433. that.getMoney()
  434. }
  435. uni.hideLoading()
  436. })
  437. }
  438. }
  439. })
  440. } else {
  441. that.$queue.showToast('提现金额必须大于或等于' + that.minMoney + '元才可提现')
  442. }
  443. }
  444. }
  445. } else {
  446. uni.showToast({
  447. title: '提现失败'
  448. })
  449. }
  450. },
  451. config: function (name) {
  452. var info = null
  453. if (name) {
  454. var name2 = name.split('.') //字符分割
  455. if (name2.length > 1) {
  456. info = configdata[name2[0]][name2[1]] || null
  457. } else {
  458. info = configdata[name] || null
  459. }
  460. if (info == null) {
  461. // let web_config = cache.get("web_config");
  462. // if (web_config) {
  463. // if (name2.length > 1) {
  464. // info = web_config[name2[0]][name2[1]] || null;
  465. // } else {
  466. // info = web_config[name] || null;
  467. // }
  468. // }
  469. }
  470. }
  471. return info
  472. },
  473. weixin() {
  474. let that = this
  475. uni.chooseImage({
  476. count: 1, //默认9
  477. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  478. sourceType: ['album', 'camera'], //从相册选择
  479. success: (res) => {
  480. that.$queue.showLoading('上传中...')
  481. for (let i = 0; i < 1; i++) {
  482. uni.uploadFile({
  483. // 上传接口
  484. url: that.config('APIHOST1') + '/alioss/upload', //真实的接口地址
  485. filePath: res.tempFilePaths[i],
  486. name: 'file',
  487. success: (uploadFileRes) => {
  488. let img = JSON.parse(uploadFileRes.data).data
  489. let userId = that.$queue.getData('userId')
  490. let data = {
  491. cashQrCode: img
  492. }
  493. that.$Request.postJson('/app/user/updateUser', data).then((res) => {
  494. if (res.code == 0) {
  495. that.getMoney()
  496. setTimeout(function () {
  497. that.$queue.showToast('上传成功')
  498. }, 1000)
  499. }
  500. })
  501. uni.hideLoading()
  502. // that.show = false
  503. }
  504. })
  505. }
  506. }
  507. })
  508. }
  509. }
  510. }
  511. </script>
  512. <style>
  513. body {
  514. background: #f5f5f5;
  515. }
  516. .content {
  517. width: 100%;
  518. }
  519. .part_one {
  520. width: 90%;
  521. margin: 0 auto;
  522. background: #ffffff;
  523. margin-top: 20rpx;
  524. border-radius: 20rpx;
  525. height: 170rpx;
  526. }
  527. .one_title {
  528. width: 90%;
  529. margin: 0 auto;
  530. font-size: 32rpx;
  531. letter-spacing: 1rpx;
  532. padding-top: 30rpx;
  533. }
  534. .one_price {
  535. width: 90%;
  536. margin: 0 auto;
  537. margin-top: 20rpx;
  538. font-size: 47rpx;
  539. font-weight: bold;
  540. }
  541. .part_two {
  542. width: 90%;
  543. margin: 0 auto;
  544. background: #ffffff;
  545. margin-top: 20rpx;
  546. border-radius: 20rpx;
  547. }
  548. .two_title {
  549. width: 90%;
  550. margin: 0 auto;
  551. line-height: 95rpx;
  552. font-size: 34rpx;
  553. }
  554. .two_title text {
  555. font-size: 27rpx;
  556. margin-left: 34rpx;
  557. }
  558. .two_box {
  559. width: 90%;
  560. margin: 0 auto;
  561. display: flex;
  562. align-items: center;
  563. font-size: 32rpx;
  564. font-weight: bold;
  565. }
  566. .u-input__input {
  567. font-size: 50rpx !important;
  568. color: #747474 !important;
  569. border-bottom: 1rpx solid #cccccc;
  570. }
  571. .tit {
  572. width: 90%;
  573. margin: 0 auto;
  574. font-size: 31rpx;
  575. margin-top: 10rpx;
  576. color: black;
  577. }
  578. .beizhu {
  579. width: 90%;
  580. margin: 0 auto;
  581. line-height: 55rpx;
  582. color: red;
  583. letter-spacing: 1rpx;
  584. }
  585. .part_three {
  586. width: 90%;
  587. margin: 0 auto;
  588. background: #ffffff;
  589. margin-top: 20rpx;
  590. border-radius: 20rpx;
  591. }
  592. .three_name {
  593. width: 90%;
  594. margin: 0 auto;
  595. font-size: 33rpx;
  596. color: black;
  597. line-height: 80rpx;
  598. }
  599. .btn {
  600. width: 96%;
  601. margin: 0 auto;
  602. display: flex;
  603. padding-bottom: 30rpx;
  604. }
  605. .btn_left {
  606. flex: 1;
  607. height: 90rpx;
  608. border: 1rpx solid #ccc;
  609. border-radius: 20rpx;
  610. margin-right: 10rpx;
  611. display: flex;
  612. justify-content: center;
  613. align-items: center;
  614. }
  615. .btn_right {
  616. flex: 1;
  617. /* width: 240rpx; */
  618. height: 90rpx;
  619. border: 1rpx solid #ccc;
  620. border-radius: 20rpx;
  621. margin-left: 10rpx;
  622. display: flex;
  623. justify-content: center;
  624. align-items: center;
  625. }
  626. .btna {
  627. border: 1rpx solid #e34b21 !important;
  628. }
  629. .btn_left image {
  630. width: 50rpx;
  631. height: 50rpx;
  632. margin-right: 12rpx;
  633. }
  634. .btn_right image {
  635. width: 50rpx;
  636. height: 50rpx;
  637. margin-right: 12rpx;
  638. }
  639. .part_four {
  640. width: 90%;
  641. margin: 0 auto;
  642. /* background: #FFFFFF; */
  643. margin-top: 20rpx;
  644. border-radius: 20rpx;
  645. }
  646. .submit {
  647. width: 100%;
  648. height: 90rpx;
  649. background: #f8501f;
  650. color: #f8ebd2;
  651. text-align: center;
  652. line-height: 90rpx;
  653. font-size: 37rpx;
  654. border-radius: 12rpx;
  655. }
  656. .four_box {
  657. width: 90%;
  658. margin: 0 auto;
  659. height: 125rpx;
  660. display: flex;
  661. color: #838383;
  662. }
  663. .box_left {
  664. flex: 1;
  665. display: flex;
  666. justify-content: center;
  667. align-items: center;
  668. }
  669. .box_right {
  670. flex: 1;
  671. display: flex;
  672. justify-content: center;
  673. align-items: center;
  674. }
  675. /* // 提现银行卡信息 */
  676. .yinghang {
  677. height: 80rpx;
  678. line-height: 80rpx;
  679. font-size: 36rpx;
  680. font-weight: 700;
  681. text-align: left;
  682. }
  683. .yinghang2 {
  684. height: 80rpx;
  685. line-height: 80rpx;
  686. font-size: 36rpx;
  687. font-weight: 700;
  688. }
  689. </style>