cashDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. <template>
  2. <view class="cash">
  3. <view
  4. style="background-image: url('../../static/images/my/qanbaobg.png');background-size: 100%;height: 400upx;">
  5. <view style="font-size: 32upx;padding-top: 100upx;">可提现总额</view>
  6. <view style="font-size: 40upx;padding-top: 20upx;">¥ {{money}}</view>
  7. <view
  8. style="width: 90%;height: max-content;margin-left: 40upx;background-color: #FFFFFF;box-shadow: rgba(183, 183, 183, 0.3) 0px 1px 10px;margin-top: 50upx;border-radius: 20upx;">
  9. <view style="display: flex;flex-direction: row;padding: 20upx;">
  10. <view style="font-size: 32upx;color: #333333;">提现金额 <text style="font-size: 28upx;color: #FF2638;"
  11. v-if="shouxufei">(注:提现手续费为{{shouxufei * 100}}%)</text>
  12. </view>
  13. </view>
  14. <view style="display: flex;flex-direction: row;padding: 20upx;">
  15. <view style="font-size: 40upx;color: #333333;">¥</view>
  16. <input type="text" v-model="moneys" placeholder="请输入金额"
  17. style="font-size: 40upx;color: #333333;text-align: left;margin-left: 10upx;width: 100%;" />
  18. </view>
  19. <view style="background: #E6E6E6;width: 100%;height: 1upx;"></view>
  20. <view style="display: flex;flex-direction: row;flex-wrap: wrap;">
  21. <view style="display: flex;flex-direction: row;" v-for="(item, index) in moneyList" :key="index">
  22. <view>
  23. <view style="padding: 20upx;" @click="getOut(item.money)">
  24. <view
  25. style="padding-top: 40upx;width: 180upx; height: 120upx;background-color: #FFFFFF;border:1px solid #FFCC00;border-radius: 10upx;">
  26. {{ item.money }}
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view style="margin-top:59upx" class="padding-lr margin-lr-sm">
  34. <view class="yinghang">提现银行卡信息</view>
  35. <view style="color:#333333;text-align: left;">
  36. 银行卡号:<text class="yinghang2">{{yingNo}}</text>
  37. </view>
  38. <view style="color:#333333;text-align: left;">
  39. 开户行:<text class="yinghang2">{{yingName}}</text>
  40. </view>
  41. <view style="color:#333333;text-align: left;">
  42. 开户人姓名:<text class="yinghang2">{{yingPeople}}</text>
  43. </view>
  44. <!-- <view class="flex justify-between margin-bottom-xl" v-for="(item,index) in openLists" :key="index">
  45. <view class="flex align-center">
  46. <image :src="item.image" style="width:23px;height:20px"></image>
  47. <text class="text-lg margin-left-sm" style="color:#333333;font-weight:700;">{{item.text}}</text>
  48. </view>
  49. <view>
  50. <radio-group name="openWay" style="margin-left: 20upx;" @tap='selectWay(item)'>
  51. <label class="tui-radio">
  52. <radio color="#FF7F00" :checked="openWay === item.id ? true : false" />
  53. </label>
  54. </radio-group>
  55. </view>
  56. </view> -->
  57. </view>
  58. <view @click="getOut()"
  59. style="margin: 32upx;font-size: 18px;background: #FFCC00;border-radius: 10px;height: 40px;line-height: 40px">
  60. 提现
  61. </view>
  62. <view style="display: flex;width: 100%;justify-content: center;">
  63. <!-- <view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goZhifuBao">提现账号
  64. </view> -->
  65. <view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="goqianbao">钱包明细
  66. </view>
  67. <!-- <view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="isShow">微信收款码
  68. </view> -->
  69. <view style="color: grey;padding-bottom: 30px;padding-top: 20upx;flex: 1;" @click="gojilu">提现记录
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 微信收款码弹框 -->
  74. <u-popup v-model="show" mode="center">
  75. <view class="padding">
  76. <view class="text-center text-lg text-bold flex justify-between">
  77. <view></view>
  78. <view>添加微信收款码</view>
  79. <view @click="show=false">X</view>
  80. </view>
  81. <!-- <view class="text-center padding-top-sm padding-bottom-lg" style="color: #999999;">请提交微信号和微信二维码
  82. </view> -->
  83. <view style="width: 80%;margin: 0 auto;">
  84. <view class="margin-top" @click.stop="weixin"
  85. style="border: 4rpx solid #010101;border-radius: 16rpx;overflow: hidden;">
  86. <image v-if="!wximg" src="../../static/images/my/erweima.png"></image>
  87. <image v-else :src="wximg" mode=""></image>
  88. </view>
  89. </view>
  90. <!-- <view class="text-center margin-top-sm " @click="submit"
  91. style="border-radius: 10rpx;background-color: #7E59FF;color: #fff;height: 80rpx;line-height: 80rpx;">保存</view> -->
  92. </view>
  93. </u-popup>
  94. <!-- <view v-if="show" class="popup">
  95. </view> -->
  96. </view>
  97. </template>
  98. <script>
  99. export default {
  100. data() {
  101. return {
  102. show: false,
  103. money: '',
  104. moneys: '',
  105. zhifubao: '',
  106. mayMoney: '0',
  107. zhifubaoName: '',
  108. shouxufei: '',
  109. moneyList: [{
  110. money: '10'
  111. },
  112. {
  113. money: '500'
  114. },
  115. {
  116. money: '1000'
  117. },
  118. {
  119. money: '3000'
  120. },
  121. {
  122. money: '5000'
  123. },
  124. {
  125. money: '10000'
  126. }
  127. ],
  128. value: 0,
  129. min: '',
  130. zhifubao: '',
  131. zhifubaoName: '',
  132. openLists: [],
  133. openWay: 1,
  134. values: '',
  135. wximg: '',
  136. yingName:'',
  137. yingNo:'',
  138. yingPeople:'',
  139. };
  140. },
  141. onLoad() {
  142. this.getUserInfo()
  143. this.getyinghanglist()
  144. this.$Request.getT('/common/type/290').then(res => { //判断微信提现方式
  145. if (res.code == 0) {
  146. if (res.data && res.data.value) {
  147. this.values = res.data.value
  148. }
  149. }
  150. })
  151. //提现手续费
  152. this.$Request.getT('/common/type/115').then(res => {
  153. if (res.code === 0) {
  154. this.shouxufei = res.data.value;
  155. }
  156. });
  157. this.openLists = [{
  158. image: '../../static/images/img/icon_weixin.png',
  159. text: '微信',
  160. id: 1
  161. }, {
  162. image: '../../static/images/img/zhifubao.png',
  163. text: '支付宝',
  164. id: 2
  165. }];
  166. this.openWay = 1;
  167. },
  168. onShow: function(e) {
  169. this.getwalletMoney();
  170. this.getUserInfo()
  171. this.getyinghanglist()
  172. },
  173. onNavigationBarButtonTap() {
  174. this.list();
  175. },
  176. methods: {
  177. //获取商户银行信息
  178. getyinghanglist(){
  179. let data = {
  180. userId: this.$queue.getData('userId')
  181. }
  182. this.$Request.getA('/admin/shop/bank/get-by-user',
  183. data).then(
  184. res => {
  185. if (res.msg == 'success') {
  186. this.yingName=res.data.openBank
  187. this.yingNo=res.data.cardNo
  188. this.yingPeople=res.data.realName
  189. }else if(res.msg=='shopId对应的银行卡记录不存在'){
  190. uni.showToast({
  191. icon: 'none',
  192. title: '银行信息不完整无法提现'
  193. });
  194. }
  195. });
  196. },
  197. //用户收款码弹框
  198. isShow() {
  199. this.getUserInfo()
  200. this.show = true
  201. },
  202. //微信 支付宝提现选择
  203. selectWay: function(item) {
  204. this.openWay = item.id;
  205. },
  206. //获取用户信息获取用户是否上传收款码
  207. getUserInfo() {
  208. this.$Request.getA("/sys/user/info").then(res => {
  209. if (res.code == 0) {
  210. this.zhifubao = res.user.userEntity.zhiFuBao
  211. this.zhifubaoName = res.user.userEntity.zhiFuBaoName
  212. this.wximg = res.user.userEntity.cashQrCode;
  213. // console.log(this.zhifubao, this.zhifubaoName, '-')
  214. }
  215. });
  216. },
  217. //获取账户余额
  218. getwalletMoney() {
  219. this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
  220. if (res.code == 0) {
  221. this.money = res.data.money;
  222. }
  223. uni.hideLoading();
  224. });
  225. },
  226. gojilu() {
  227. uni.navigateTo({
  228. url: '/my/other/moneydetail'
  229. });
  230. },
  231. goqianbao() {
  232. uni.navigateTo({
  233. url: '/my/other/cashList'
  234. });
  235. },
  236. goZhifuBao() {
  237. uni.navigateTo({
  238. url: '/my/other/zhifubao'
  239. });
  240. },
  241. weixin() {
  242. let that = this
  243. uni.chooseImage({
  244. count: 1, //默认9
  245. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  246. sourceType: ['album', 'camera'], //从相册选择
  247. success: (res) => {
  248. console.log('`````````````', res)
  249. that.$queue.showLoading("上传中...");
  250. for (let i = 0; i < 1; i++) {
  251. uni.uploadFile({ // 上传接口
  252. url: 'https://mxys.chuanghai-tech.com/sqx_fast/alioss/upload', //真实的接口地址
  253. filePath: res.tempFilePaths[i],
  254. name: 'file',
  255. success: (uploadFileRes) => {
  256. let img = JSON.parse(uploadFileRes.data).data
  257. // let userId = that.$queue.getData('userId');
  258. let data = {
  259. cashQrCode: img
  260. }
  261. that.$Request.getA('/shop/shopmoney/shopBindingQrCode',
  262. data).then(
  263. res => {
  264. if (res.code == 0) {
  265. that.getUserInfo()
  266. setTimeout(function() {
  267. that.$queue.showToast('上传成功')
  268. }, 1000)
  269. }
  270. });
  271. uni.hideLoading();
  272. // that.show = false
  273. }
  274. });
  275. }
  276. }
  277. });
  278. },
  279. //校验用户输入金额
  280. checkMobile(money) {
  281. return RegExp(/^1[34578]\d{9}$/).test(money);
  282. },
  283. getOut(money) {
  284. let that = this
  285. if (money) {
  286. that.moneys = money
  287. }
  288. if (!/^\d+$/.test(that.moneys)) {
  289. uni.showToast({
  290. icon: 'none',
  291. title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  292. });
  293. return;
  294. }
  295. if (that.openWay == 2) { //支付宝提现
  296. if (that.zhifubao != null && that.zhifubaoName != null) {
  297. uni.showModal({
  298. title: "提现申请提示",
  299. content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n收款人账号:' + that.zhifubao +
  300. '\n\n提现金额:' + that.moneys + '元\t\t手续费:' + (that.moneys * that.shouxufei).toFixed(
  301. 1),
  302. success: (e) => {
  303. if (e.confirm) {
  304. that.$queue.showLoading("提现中...");
  305. let data = {
  306. money: that.moneys,
  307. // classify: '1'
  308. }
  309. that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
  310. res => {
  311. if (res.status === 0 && res.data) {
  312. setTimeout(function() {
  313. that.$queue.showToast("提现申请成功,预计三个工作日到账");
  314. }, 3000)
  315. that.getwalletMoney();
  316. } else {
  317. that.$queue.showToast(res.msg);
  318. that.getwalletMoney();
  319. }
  320. uni.hideLoading();
  321. });
  322. }
  323. }
  324. });
  325. } else {
  326. uni.navigateTo({
  327. url: '/my/other/zhifubao'
  328. });
  329. }
  330. } else if (that.openWay == 1) { //微信提现
  331. if (that.values == 2) {
  332. that.$Request.getA('/sys/user/info').then(res => {
  333. if (res.code === 0) {
  334. let wxImg = res.user.userEntity.cashQrCode;
  335. if (!wxImg) {
  336. uni.showModal({
  337. title: '提现提示',
  338. content: '请上传微信收款码',
  339. showCancel: true,
  340. cancelText: '取消',
  341. confirmText: '上传',
  342. success: res => {
  343. if (res.confirm) {
  344. that.show = true
  345. }
  346. },
  347. fail: () => {},
  348. complete: () => {}
  349. });
  350. return;
  351. }
  352. if (!/^\d+$/.test(that.moneys)) {
  353. uni.showToast({
  354. icon: 'none',
  355. title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  356. });
  357. return;
  358. }
  359. if (that.moneys * 1 >= that.value * 1) {
  360. uni.showModal({
  361. title: '提现申请提示',
  362. content: '金额:' + that.moneys + '元'+','+'手续费:' + (that.moneys *that.shouxufei).toFixed(1),
  363. success: e => {
  364. if (e.confirm) {
  365. that.$queue.showLoading('提现中...');
  366. let data = {
  367. money: that.moneys,
  368. // classify: 2
  369. }
  370. that.$Request.getT('/shop/shopmoney/shopCashMoney',
  371. data).then(
  372. res => {
  373. if (res.code === 0) {
  374. setTimeout(function() {
  375. that.$queue.showToast(
  376. '提现申请成功,预计三个工作日到账');
  377. }, 1000)
  378. that.getwalletMoney();
  379. } else {
  380. uni.showModal({
  381. title: '温馨提示',
  382. content: res.msg,
  383. showCancel: false,
  384. cancelText: '取消',
  385. confirmText: '确认'
  386. });
  387. }
  388. uni.hideLoading();
  389. });
  390. }
  391. }
  392. });
  393. } else {
  394. setTimeout(function() {
  395. that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
  396. }, 1000)
  397. }
  398. } else {
  399. that.$queue.showToast('网络状态不好,请刷新后重试!');
  400. }
  401. });
  402. } else {
  403. if (!/^\d+$/.test(that.moneys)) {
  404. uni.showToast({
  405. icon: 'none',
  406. title: '请输入正确金额,不能包含中文,英文,特殊字符和小数'
  407. });
  408. return;
  409. }
  410. if (parseFloat(that.moneys).toFixed(1) >= that.value) {
  411. uni.showModal({
  412. title: '提现申请提示',
  413. content: '金额:' + that.moneys + '元'+','+'手续费:' + parseFloat(that.moneys *
  414. that.shouxufei).toFixed(1),
  415. success: e => {
  416. if (e.confirm) {
  417. that.$queue.showLoading('提现中...');
  418. let data = {
  419. money: that.moneys,
  420. // classify: 2
  421. }
  422. that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
  423. res => {
  424. if (res.code === 0) {
  425. setTimeout(function() {
  426. that.$queue.showToast('提现申请成功,预计三个工作日到账');
  427. }, 1000)
  428. that.getwalletMoney();
  429. } else {
  430. uni.showModal({
  431. title: '温馨提示',
  432. content: res.msg,
  433. showCancel: false,
  434. cancelText: '取消',
  435. confirmText: '确认'
  436. });
  437. that.getwalletMoney();
  438. }
  439. uni.hideLoading();
  440. });
  441. }
  442. }
  443. });
  444. } else {
  445. that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
  446. }
  447. }
  448. }
  449. },
  450. }
  451. };
  452. </script>
  453. <style lang="less">
  454. // @import '../../static/css/index.css';
  455. .view2-view-text {
  456. font-size: 14px;
  457. color: #000000;
  458. margin-left: 20upx;
  459. width: 80%;
  460. }
  461. .view2-view-image-right {
  462. width: 18upx;
  463. height: 30upx;
  464. margin-left: 50upx;
  465. }
  466. .cash {
  467. text-align: center;
  468. background: white;
  469. height: 100%;
  470. position: absolute;
  471. width: 100%;
  472. .cash-top {
  473. padding: 32upx 32upx 50upx 32upx;
  474. /* border-bottom: 1px solid gainsboro; */
  475. background: #FF2638;
  476. }
  477. .leiji {
  478. font-size: 14px;
  479. color: #ffffff;
  480. margin-bottom: 10px;
  481. }
  482. // 提现银行卡信息
  483. .yinghang{
  484. height: 80rpx;
  485. line-height: 80rpx;
  486. font-size: 36rpx;
  487. font-weight: 700;
  488. text-align: left;
  489. }
  490. .yinghang2{
  491. height: 80rpx;
  492. line-height: 80rpx;
  493. font-size: 36rpx;
  494. font-weight: 700;
  495. }
  496. }
  497. </style>