index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <view class="">
  3. <view class="padding">
  4. <view class="box">
  5. <view class="tit">账户余额</view>
  6. <view class="pri"><text>¥{{balance?balance:'0'}}</text> </view>
  7. <view style="font-size: 26rpx; color: #999;padding-bottom: 20rpx;"><text>可提现金额:¥{{balance?balance:'0'}}</text> </view>
  8. <!-- <view class="flex align-center justify-between margin-top-xl"> -->
  9. <!-- <view class="">
  10. <view>总资金</view>
  11. <view style="font-size: 44rpx;">{{money?money:'0'}}</view>
  12. </view> -->
  13. <!-- <view class="">
  14. <view>冻结资金</view>
  15. <view style="font-size: 44rpx;">2.00</view>
  16. </view> -->
  17. <!-- </view> -->
  18. </view>
  19. <!-- <view class="flex align-center justify-between padding-top">
  20. <view>
  21. <view class="padding-bottom-xs">总资产(元)</view>
  22. <view class="text-bold" style="font-size: 48rpx;">{{balance?balance:'0'}}</view>
  23. </view>
  24. <view class="flex align-center">
  25. <view class="cz" @click="goTo('/my/wallet/Txmoney')">提现</view>
  26. <view class="tx" @click="gocz()">充值</view>
  27. </view>
  28. </view> -->
  29. </view>
  30. <view style="padding: 0 30rpx;">
  31. <view class="padding" style="background: #fff; border-radius: 16rpx;">
  32. <view class="title">
  33. 提现
  34. </view>
  35. <view style="padding: 20rpx 0;">
  36. 提现金额
  37. </view>
  38. <view class="two_box">
  39. <view style="border-radius: 13rpx 0rpx 0rpx 13rpx;width: 80rpx; height: 80rpx; font-size: 40rpx; background: #ffe9e9; color: #f56c6c;text-align: center;line-height: 80rpx;border-top: 1rpx solid #ccc;border-left: 1rpx solid #ccc;border-bottom: 1rpx solid #ccc;">
  40. ¥
  41. </view>
  42. <u-input style="width: 100%;height: 80rpx;" v-model="money" type="number" :clearable="false" placeholder="请输入提现金额" />
  43. </view>
  44. <view class="part_three">
  45. <view style="padding: 20rpx 0;">提现方式</view>
  46. <view class="btn">
  47. <view class="btn_right" :class="current==1?'btna':''" @click="bindToindex(1)">
  48. <image src="../static/zhifubao.png"></image>
  49. <text>支付宝</text>
  50. </view>
  51. <view v-if="isWxAway == '是'" class="btn_left" :class="current==2?'btna':''" @click="bindToindex(2)">
  52. <image src="../static/weixin.png"></image>
  53. <text>微信</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="submit" @click="getOut()">立即提现</view>
  58. <view style="font-size: 26rpx; color: #999;text-align: center;">
  59. 预计到账时间: 1-3个工作日
  60. </view>
  61. </view>
  62. </view>
  63. <view style="padding: 0 30rpx;margin-top: 30rpx;">
  64. <view class="padding" style="background: #fff; border-radius: 16rpx;">
  65. <view class="flex" style="justify-content: space-between;">
  66. <view class="title">
  67. 交易记录
  68. </view>
  69. <view class="flex" style="padding: 10rpx; border-radius: 12rpx;background: #f5f5f5;">
  70. <view v-for="(item, index) in listtab" :key="index" @click="tablists(index)" :class="tabvalue == index ? 'tabg' : 'tab'">
  71. {{ item.title }}
  72. </view>
  73. </view>
  74. </view>
  75. <view style="margin-top: 20rpx;">
  76. <view>
  77. <view class="list_box2" v-for="(item,index) in list.slice(0, 5)" :key="index">
  78. <view class="name flex align-center" @click="copyClick(item.title)" v-if="item.type==1">
  79. {{item.title}}
  80. <image src="../static/copy.png" style="width: 30upx;height: 30upx;"></image>
  81. </view>
  82. <view v-else>{{item.title}}</view>
  83. <!-- <view>{{item.content}}</view> -->
  84. <view class="data">{{item.createTime}}</view>
  85. </view>
  86. </view>
  87. </view>
  88. <view @click="goTo('/my/wallet/Acontlist')" style="margin-top: 20rpx; font-size: 26rpx; color: #999; text-align: center;">查看更多记录</view>
  89. </view>
  90. </view>
  91. <!-- 我的列表 -->
  92. <!-- <view class="mylist">
  93. <view class="list_box" @click="goTo('/my/wallet/Acontlist')">
  94. <view class="list_left">
  95. <view class="margin-right-xs">
  96. <image src="../static/zijin.png" style="width: 52rpx;height: 52rpx;"></image>
  97. </view>
  98. <view class="t">资金明细</view>
  99. </view>
  100. <view class="">
  101. <image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
  102. </view>
  103. </view>
  104. <view class="list_box" @click="goTo('/my/wallet/zhifubao')">
  105. <view class="list_left">
  106. <view class="margin-right-xs">
  107. <image src="../static/zhanghao.png" style="width: 52rpx;height: 52rpx;"></image>
  108. </view>
  109. <view class="t">提现账号</view>
  110. </view>
  111. <view class="">
  112. <image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
  113. </view>
  114. </view>
  115. <view class="list_box" @click="goTo('/my/wallet/cashList')">
  116. <view class="list_left">
  117. <view class="margin-right-xs">
  118. <image src="../static/tixian.png" style="width: 52rpx;height: 52rpx;"></image>
  119. </view>
  120. <view class="t">提现记录</view>
  121. </view>
  122. <view class="">
  123. <image src="../static/icon_go.png" style="width: 18rpx;height: 32rpx;"></image>
  124. </view>
  125. </view>
  126. </view> -->
  127. </view>
  128. </template>
  129. <script>
  130. export default {
  131. data() {
  132. return {
  133. current: '1',
  134. money: 0,
  135. mylist: [{
  136. id: 1,
  137. name: '保证金',
  138. image: '../../../static/rider/qqq.png'
  139. }, {
  140. id: 2,
  141. name: '账户明细',
  142. image: '../../../static/rider/qq.png'
  143. }],
  144. shangxian: '是',
  145. balance:0,
  146. isWxAway: '是',
  147. listtab: [
  148. {
  149. value: 1,
  150. title: '全部'
  151. },
  152. {
  153. value: 2,
  154. title: '收入'
  155. },
  156. {
  157. value: 3,
  158. title: '支出'
  159. },
  160. ],
  161. tabvalue: 0,
  162. list: [],
  163. page: 1,
  164. totalCount: 0,
  165. zhiFuBaoName: '',
  166. zhifubao: ''
  167. }
  168. },
  169. onLoad() {
  170. this.shangxian = uni.getStorageSync('shangxian')
  171. this.taskData2()
  172. },
  173. onShow() {
  174. // this.taskData()
  175. this.getUserInfo()
  176. this.zhiFuBao = uni.getStorageSync('zhiFuBao')
  177. this.zhiFuBaoName = uni.getStorageSync('zhiFuBaoName')
  178. },
  179. methods: {
  180. tablists(index) {
  181. this.tabvalue = index
  182. this.taskData2()
  183. },
  184. bindToindex(e) {
  185. this.current = e
  186. console.log(e, this.current)
  187. },
  188. // 获取任务数据
  189. taskData2() {
  190. this.$Request.getT('/app/userMoney/selectUserMoneyDetails?classify=4&page=' + this.page + '&limit=15&userType=2&type=' + this.tabvalue).then(res => {
  191. if (res.code == 0) {
  192. this.list = res.data.records
  193. }
  194. });
  195. },
  196. // 获取个人信息
  197. getUserInfo() {
  198. let userId = this.$queue.getData('userId');
  199. this.$Request.getT("/app/user/selectUserDetails?userId=" + userId).then(res => {
  200. if (res.code == 0) {
  201. this.balance = res.data.balance
  202. } else {
  203. this.$queue.logout();
  204. uni.showModal({
  205. showCancel: false,
  206. title: '登录失败',
  207. content: res.msg,
  208. });
  209. }
  210. });
  211. },
  212. goTo(url){
  213. uni.navigateTo({
  214. url
  215. })
  216. },
  217. // 获取任务数据
  218. taskData() {
  219. this.$Request.getT('/app/userinfo/findBalance').then(res => {
  220. if (res.code == 0) {
  221. if (res.data) {
  222. this.money = res.data
  223. }
  224. }
  225. console.log('res', res)
  226. });
  227. },
  228. bindTxmoney() {
  229. uni.navigateTo({
  230. url: '/pages/riderMy/myAccount/Txmoney/Txmoney'
  231. })
  232. },
  233. getMoney() {
  234. let that = this;
  235. let token = this.$queue.getData('token');
  236. let userId = this.$queue.getData('userId');
  237. if (token) {
  238. //this.$queue.showLoading("加载中...");
  239. //可以提现金额查询预估收入查询
  240. let userId = this.$queue.getData('userId');
  241. this.$Request.getT("/app/user/selectUserDetails?userId=" + userId).then(res => {
  242. if (res.code === 0 && res.data) {
  243. that.mayMoney = res.data.balance;
  244. that.zhifubao = res.data.zhiFuBao;
  245. that.zhifubaoName = res.data.zhiFuBaoName;
  246. that.wximg = res.data.cashQrCode
  247. } else if (res.code === -102) {
  248. this.$queue.showToast(res.msg);
  249. this.$queue.logout();
  250. // uni.navigateTo({
  251. // url: '/pages/public/login'
  252. // });
  253. } else {
  254. that.mayMoney = '0';
  255. //this.$queue.showToast(res.msg);
  256. }
  257. });
  258. }
  259. },
  260. getOut() {
  261. let that = this;
  262. let token = that.$queue.getData('token');
  263. let userId = that.$queue.getData('userId');
  264. if (token) {
  265. if (that.current == 1) {
  266. if (!that.zhifubao || !that.zhifubaoName) {
  267. uni.navigateTo({
  268. url: '/my/wallet/zhifubao'
  269. });
  270. return
  271. }
  272. if (!/^\d+$/.test(that.money)) {
  273. uni.showToast({
  274. icon: 'none',
  275. title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  276. });
  277. return;
  278. }
  279. if (Number(that.money) < Number(that.minMoney)) {
  280. uni.showToast({
  281. icon: 'none',
  282. title: '提现金额不能小于' + that.minMoney + '元'
  283. });
  284. return;
  285. }
  286. if (Number(that.money) > Number(that.manMoney)) {
  287. uni.showToast({
  288. icon: 'none',
  289. title: '提现金额不能大于' + that.manMoney + '元'
  290. });
  291. return;
  292. }
  293. uni.showModal({
  294. title: '提现申请提示',
  295. content: '请仔细确认收款人信息\n姓名:' + that.zhifubaoName + '\n提现金额:' + that.money + '\n提现手续费:' +
  296. parseFloat(that.money * that.shouxufei).toFixed(2) + '元' + '\n收款账号:' + that
  297. .zhifubao + '',
  298. success: e => {
  299. if (e.confirm) {
  300. that.$queue.showLoading('提现中...');
  301. that.$Request.getT('/app/cash/cashMoney?userType=2&classify=' + that
  302. .current +
  303. '&money=' + that.money).then(res => {
  304. if (res.code === 0) {
  305. that.$queue.showToast('提现申请成功,预计三个工作日到账');
  306. that.money = ''
  307. that.getMoney();
  308. that.mayMoney = ''
  309. } else {
  310. uni.showModal({
  311. title: '温馨提示',
  312. content: res.msg,
  313. showCancel: false,
  314. cancelText: '取消',
  315. confirmText: '确认'
  316. });
  317. }
  318. uni.hideLoading();
  319. });
  320. }
  321. }
  322. });
  323. } else {
  324. if (!/^\d+$/.test(that.money)) {
  325. uni.showToast({
  326. icon: 'none',
  327. title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  328. });
  329. return;
  330. }
  331. if (Number(that.money) < Number(that.minMoney)) {
  332. uni.showToast({
  333. icon: 'none',
  334. title: '提现金额不能小于' + that.minMoney + '元'
  335. });
  336. return;
  337. }
  338. if (Number(that.money) > Number(that.manMoney)) {
  339. uni.showToast({
  340. icon: 'none',
  341. title: '提现金额不能大于' + that.manMoney + '元'
  342. });
  343. return;
  344. }
  345. if (this.values == 2) { //如果是微信手动提现才判断微信收款码
  346. if (!that.wximg) {
  347. uni.showModal({
  348. title: '提现提示',
  349. content: '请上传微信收款码',
  350. showCancel: true,
  351. cancelText: '取消',
  352. confirmText: '上传',
  353. success: res => {
  354. if (res.confirm) {
  355. that.show = true;
  356. }
  357. },
  358. fail: () => {},
  359. complete: () => {}
  360. });
  361. return;
  362. }
  363. }
  364. uni.showModal({
  365. title: '提现申请提示',
  366. content: '请仔细确认收款信息\n金额:' + that.money + '元' + '\n提现手续费:' + parseFloat(that.money *
  367. that.shouxufei).toFixed(2) + '元',
  368. success: e => {
  369. if (e.confirm) {
  370. that.$queue.showLoading('提现中...');
  371. that.$Request.getT('/app/cash/cashMoney?userType=2&classify=' + that.current +
  372. '&money=' + that.money).then(res => {
  373. if (res.code === 0) {
  374. that.$queue.showToast('提现申请成功,预计三个工作日到账');
  375. that.money = ''
  376. that.getMoney();
  377. that.mayMoney = ''
  378. } else {
  379. uni.showModal({
  380. title: '温馨提示',
  381. content: res.msg,
  382. showCancel: false,
  383. cancelText: '取消',
  384. confirmText: '确认'
  385. });
  386. }
  387. uni.hideLoading();
  388. });
  389. }
  390. }
  391. });
  392. }
  393. } else {
  394. uni.showToast({
  395. title: '提现失败',
  396. icon: 'none'
  397. })
  398. }
  399. },
  400. }
  401. }
  402. </script>
  403. <style lang="less">
  404. page {
  405. background: #F5F5F5;
  406. }
  407. .list_box2 {
  408. width: 100%;
  409. margin: 0 auto;
  410. /* display: flex; */
  411. line-height: 45rpx;
  412. padding-top: 20rpx;
  413. padding-bottom: 20upx;
  414. border-bottom: 1rpx solid #f8f8f8;
  415. }
  416. .list_left {
  417. /* flex: 2; */
  418. }
  419. .name {
  420. width: 500rpx;
  421. font-size: 26rpx;
  422. color: #333333;
  423. font-weight: bold;
  424. letter-spacing: 2rpx;
  425. }
  426. .data {
  427. color: #999999;
  428. font-size: 24rpx;
  429. }
  430. .tabg {
  431. padding: 8rpx 20rpx;
  432. border-radius: 12rpx;
  433. background: #00c18a;
  434. color: #fff;
  435. }
  436. .tab {
  437. padding: 8rpx 20rpx;
  438. border-radius: 12rpx;
  439. color: #999999;
  440. background: #f5f5f5;
  441. }
  442. .box {
  443. width: 690rpx;
  444. // height: 312rpx;
  445. background: #fff;
  446. border-radius: 16rpx;
  447. text-align: center;
  448. padding: 50rpx 40rpx 30rpx;
  449. .tit {
  450. font-size: 32rpx;
  451. font-family: PingFang SC;
  452. font-weight: 500;
  453. }
  454. .pri {
  455. margin: 20rpx;
  456. text {
  457. font-size: 68rpx;
  458. font-family: DINPro;
  459. font-weight: 600;
  460. color: #00c18a;
  461. margin-right: 10rpx;
  462. }
  463. }
  464. }
  465. .title {
  466. font-size: 36rpx;
  467. font-weight: bold;
  468. }
  469. .part_three {
  470. width: 100%;
  471. margin: 0 auto;
  472. background: #FFFFFF;
  473. margin-top: 20rpx;
  474. border-radius: 20rpx;
  475. }
  476. .three_name {
  477. width: 100%;
  478. margin: 0 auto;
  479. font-size: 33rpx;
  480. color: black;
  481. line-height: 80rpx;
  482. }
  483. .btn {
  484. width: 100%;
  485. margin: 0 auto;
  486. // display: flex;
  487. // justify-content: space-between;
  488. padding-bottom: 30rpx;
  489. }
  490. .btn_left {
  491. flex: 1;
  492. /* width: 240rpx; */
  493. height: 90rpx;
  494. border: 1rpx solid #ccc;
  495. border-radius: 16rpx;
  496. display: flex;
  497. align-items: center;
  498. padding: 0 30rpx;
  499. }
  500. .btn_right {
  501. flex: 1;
  502. /* width: 240rpx; */
  503. height: 90rpx;
  504. border: 1rpx solid #ccc;
  505. border-radius: 16rpx;
  506. display: flex;
  507. align-items: center;
  508. margin-bottom: 20rpx;
  509. padding: 0 30rpx;
  510. }
  511. .btna {
  512. border: 1rpx solid #00c18a !important;
  513. }
  514. .submit {
  515. width: 100%;
  516. height: 80rpx;
  517. background: #00c18a;
  518. color: #fff;
  519. text-align: center;
  520. line-height: 80rpx;
  521. font-size: 34rpx;
  522. border-radius: 12rpx;
  523. margin-bottom: 20rpx;
  524. }
  525. .btn_left image {
  526. width: 50rpx;
  527. height: 50rpx;
  528. margin-right: 12rpx;
  529. }
  530. .btn_right image {
  531. width: 50rpx;
  532. height: 50rpx;
  533. margin-right: 12rpx;
  534. }
  535. .two_box {
  536. width: 100%;
  537. margin: 0 auto;
  538. display: flex;
  539. align-items: center;
  540. font-size: 32rpx;
  541. font-weight: bold;
  542. }
  543. .u-input__input {
  544. height: 80rpx !important;
  545. padding: 0 30rpx;
  546. // font-size: 50rpx !important;
  547. // color: #747474 !important;
  548. border-top: 1rpx solid #cccccc;
  549. border-bottom: 1rpx solid #cccccc;
  550. border-right: 1rpx solid #cccccc;
  551. border-radius: 0rpx 13rpx 13rpx 0rpx;
  552. }
  553. .tx {
  554. width: 160rpx;
  555. height: 70rpx;
  556. border: 3rpx solid #0186FF;
  557. border-radius: 8rpx;
  558. text-align: center;
  559. line-height: 70rpx;
  560. color: #0186FF;
  561. }
  562. .cz {
  563. width: 160rpx;
  564. height: 70rpx;
  565. border-radius: 8rpx;
  566. text-align: center;
  567. line-height: 70rpx;
  568. color: #FFFFFF;
  569. margin-left: 20rpx;
  570. background: #0186FF;
  571. }
  572. /* 我的列表 */
  573. .mylist {
  574. background-color: #FFFFFF;
  575. margin-top: 20rpx;
  576. padding: 30rpx 28rpx;
  577. }
  578. .list_box {
  579. display: flex;
  580. height: 95rpx;
  581. align-items: center;
  582. }
  583. .list_left {
  584. flex: 1;
  585. display: flex;
  586. justify-content: left;
  587. align-items: center;
  588. .t{
  589. letter-spacing: 1rpx;
  590. }
  591. }
  592. </style>