Txmoney.vue 18 KB

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