cashDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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. import configdata from '@/common/config.js';
  100. export default {
  101. data() {
  102. return {
  103. show: false,
  104. money: '',
  105. moneys: '',
  106. zhifubao: '',
  107. mayMoney: '0',
  108. zhifubaoName: '',
  109. shouxufei: '',
  110. moneyList: [{
  111. money: '10'
  112. },
  113. {
  114. money: '500'
  115. },
  116. {
  117. money: '1000'
  118. },
  119. {
  120. money: '3000'
  121. },
  122. {
  123. money: '5000'
  124. },
  125. {
  126. money: '10000'
  127. }
  128. ],
  129. value: 0,
  130. min: '',
  131. zhifubao: '',
  132. zhifubaoName: '',
  133. openLists: [],
  134. openWay: 1,
  135. values: '',
  136. wximg: '',
  137. yingName:'',
  138. yingNo:'',
  139. yingPeople:'',
  140. };
  141. },
  142. onLoad() {
  143. this.getUserInfo()
  144. this.getyinghanglist()
  145. this.$Request.getT('/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. this.$Request.getT('/common/type/115').then(res => {
  154. if (res.code === 0) {
  155. this.shouxufei = res.data.value;
  156. }
  157. });
  158. this.openLists = [{
  159. image: '../../static/images/img/icon_weixin.png',
  160. text: '微信',
  161. id: 1
  162. }, {
  163. image: '../../static/images/img/zhifubao.png',
  164. text: '支付宝',
  165. id: 2
  166. }];
  167. this.openWay = 1;
  168. },
  169. onShow: function(e) {
  170. this.getwalletMoney();
  171. this.getUserInfo()
  172. this.getyinghanglist()
  173. },
  174. onNavigationBarButtonTap() {
  175. this.list();
  176. },
  177. methods: {
  178. //获取商户银行信息
  179. getyinghanglist(){
  180. let data = {
  181. userId: this.$queue.getData('userId')
  182. }
  183. this.$Request.getA('/admin/shop/bank/get-by-user',
  184. data).then(
  185. res => {
  186. if (res.msg == 'success') {
  187. this.yingName=res.data.openBank
  188. this.yingNo=res.data.cardNo
  189. this.yingPeople=res.data.realName
  190. }else if(res.msg=='shopId对应的银行卡记录不存在'){
  191. uni.showToast({
  192. icon: 'none',
  193. title: '银行信息不完整无法提现'
  194. });
  195. }
  196. });
  197. },
  198. //用户收款码弹框
  199. isShow() {
  200. this.getUserInfo()
  201. this.show = true
  202. },
  203. //微信 支付宝提现选择
  204. selectWay: function(item) {
  205. this.openWay = item.id;
  206. },
  207. //获取用户信息获取用户是否上传收款码
  208. getUserInfo() {
  209. this.$Request.getA("/sys/user/info").then(res => {
  210. if (res.code == 0) {
  211. this.zhifubao = res.user.userEntity.zhiFuBao
  212. this.zhifubaoName = res.user.userEntity.zhiFuBaoName
  213. this.wximg = res.user.userEntity.cashQrCode;
  214. // console.log(this.zhifubao, this.zhifubaoName, '-')
  215. }
  216. });
  217. },
  218. //获取账户余额
  219. getwalletMoney() {
  220. this.$Request.getT('/shop/shopmoney/selectShopMoney').then(res => {
  221. if (res.code == 0) {
  222. this.money = res.data.money;
  223. }
  224. uni.hideLoading();
  225. });
  226. },
  227. gojilu() {
  228. uni.navigateTo({
  229. url: '/my/other/moneydetail'
  230. });
  231. },
  232. goqianbao() {
  233. uni.navigateTo({
  234. url: '/my/other/cashList'
  235. });
  236. },
  237. goZhifuBao() {
  238. uni.navigateTo({
  239. url: '/my/other/zhifubao'
  240. });
  241. },
  242. weixin() {
  243. let that = this
  244. uni.chooseImage({
  245. count: 1, //默认9
  246. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  247. sourceType: ['album', 'camera'], //从相册选择
  248. success: (res) => {
  249. console.log('`````````````', res)
  250. that.$queue.showLoading("上传中...");
  251. for (let i = 0; i < 1; i++) {
  252. uni.uploadFile({ // 上传接口
  253. url: that.config("APIHOST1") + '/alioss/upload', //真实的接口地址
  254. filePath: res.tempFilePaths[i],
  255. name: 'file',
  256. success: (uploadFileRes) => {
  257. let img = JSON.parse(uploadFileRes.data).data
  258. // let userId = that.$queue.getData('userId');
  259. let data = {
  260. cashQrCode: img
  261. }
  262. that.$Request.getA('/shop/shopmoney/shopBindingQrCode',
  263. data).then(
  264. res => {
  265. if (res.code == 0) {
  266. that.getUserInfo()
  267. setTimeout(function() {
  268. that.$queue.showToast('上传成功')
  269. }, 1000)
  270. }
  271. });
  272. uni.hideLoading();
  273. // that.show = false
  274. }
  275. });
  276. }
  277. }
  278. });
  279. },
  280. config: function(name) {
  281. var info = null;
  282. if (name) {
  283. var name2 = name.split("."); //字符分割
  284. if (name2.length > 1) {
  285. info = configdata[name2[0]][name2[1]] || null;
  286. } else {
  287. info = configdata[name] || null;
  288. }
  289. if (info == null) {
  290. let web_config = cache.get("web_config");
  291. if (web_config) {
  292. if (name2.length > 1) {
  293. info = web_config[name2[0]][name2[1]] || null;
  294. } else {
  295. info = web_config[name] || null;
  296. }
  297. }
  298. }
  299. }
  300. return info;
  301. },
  302. //校验用户输入金额
  303. checkMobile(money) {
  304. return RegExp(/^1[34578]\d{9}$/).test(money);
  305. },
  306. getOut(money) {
  307. let that = this
  308. if (money) {
  309. that.moneys = money
  310. }
  311. if (!/^\d+$/.test(that.moneys)) {
  312. uni.showModal({
  313. title: '提示',
  314. content: '请输入正确金额,不能包含中文,英文,特殊字符和小数',
  315. success: function (res) {
  316. if (res.confirm) {
  317. } else if (res.cancel) {
  318. }
  319. }
  320. });
  321. return;
  322. }
  323. if (that.openWay == 2) { //支付宝提现
  324. if (that.zhifubao != null && that.zhifubaoName != null) {
  325. uni.showModal({
  326. title: "提现申请提示",
  327. content: '请仔细确认收款人信息\n\n收款人姓名:' + that.zhifubaoName + '\n\n收款人账号:' + that.zhifubao +
  328. '\n\n提现金额:' + that.moneys + '元\t\t手续费:' + (that.moneys * that.shouxufei).toFixed(
  329. 1),
  330. success: (e) => {
  331. if (e.confirm) {
  332. that.$queue.showLoading("提现中...");
  333. let data = {
  334. money: that.moneys,
  335. // classify: '1'
  336. }
  337. that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
  338. res => {
  339. if (res.status === 0 && res.data) {
  340. setTimeout(function() {
  341. that.$queue.showToast("提现申请成功,预计三个工作日到账");
  342. }, 3000)
  343. that.getwalletMoney();
  344. } else {
  345. that.$queue.showToast(res.msg);
  346. that.getwalletMoney();
  347. }
  348. uni.hideLoading();
  349. });
  350. }
  351. }
  352. });
  353. } else {
  354. uni.navigateTo({
  355. url: '/my/other/zhifubao'
  356. });
  357. }
  358. } else if (that.openWay == 1) { //微信提现
  359. if (that.values == 2) {
  360. that.$Request.getA('/sys/user/info').then(res => {
  361. if (res.code === 0) {
  362. let wxImg = res.user.userEntity.cashQrCode;
  363. if (!wxImg) {
  364. uni.showModal({
  365. title: '提现提示',
  366. content: '请上传微信收款码',
  367. showCancel: true,
  368. cancelText: '取消',
  369. confirmText: '上传',
  370. success: res => {
  371. if (res.confirm) {
  372. that.show = true
  373. }
  374. },
  375. fail: () => {},
  376. complete: () => {}
  377. });
  378. return;
  379. }
  380. if (!/^\d+$/.test(that.moneys)) {
  381. uni.showModal({
  382. title: '提示',
  383. content: '请输入正确金额,不能包含中文,英文,特殊字符和小数',
  384. success: function (res) {
  385. if (res.confirm) {
  386. } else if (res.cancel) {
  387. }
  388. }
  389. });
  390. return;
  391. }
  392. if (that.moneys * 1 >= that.value * 1) {
  393. uni.showModal({
  394. title: '提现申请提示',
  395. content: '金额:' + that.moneys + '元'+','+'手续费:' + (that.moneys *that.shouxufei).toFixed(1),
  396. success: e => {
  397. if (e.confirm) {
  398. that.$queue.showLoading('提现中...');
  399. let data = {
  400. money: that.moneys,
  401. // classify: 2
  402. }
  403. that.$Request.getT('/shop/shopmoney/shopCashMoney',
  404. data).then(
  405. res => {
  406. if (res.code === 0) {
  407. setTimeout(function() {
  408. that.$queue.showToast(
  409. '提现申请成功,预计三个工作日到账');
  410. }, 1000)
  411. that.getwalletMoney();
  412. } else {
  413. uni.showModal({
  414. title: '温馨提示',
  415. content: res.msg,
  416. showCancel: false,
  417. cancelText: '取消',
  418. confirmText: '确认'
  419. });
  420. }
  421. uni.hideLoading();
  422. });
  423. }
  424. }
  425. });
  426. } else {
  427. setTimeout(function() {
  428. that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
  429. }, 1000)
  430. }
  431. } else {
  432. that.$queue.showToast('网络状态不好,请刷新后重试!');
  433. }
  434. });
  435. } else {
  436. if (!/^\d+$/.test(that.moneys)) {
  437. uni.showModal({
  438. title: '提示',
  439. content: '请输入正确金额,不能包含中文,英文,特殊字符和小数',
  440. success: function (res) {
  441. if (res.confirm) {
  442. } else if (res.cancel) {
  443. }
  444. }
  445. });
  446. return;
  447. }
  448. if (parseFloat(that.moneys).toFixed(1) >= that.value) {
  449. uni.showModal({
  450. title: '提现申请提示',
  451. content: '金额:' + that.moneys + '元'+','+'手续费:' + parseFloat(that.moneys *
  452. that.shouxufei).toFixed(1),
  453. success: e => {
  454. if (e.confirm) {
  455. that.$queue.showLoading('提现中...');
  456. let data = {
  457. money: that.moneys,
  458. // classify: 2
  459. }
  460. that.$Request.getT('/shop/shopmoney/shopCashMoney', data).then(
  461. res => {
  462. if (res.code === 0) {
  463. setTimeout(function() {
  464. that.$queue.showToast('提现申请成功,预计三个工作日到账');
  465. }, 1000)
  466. that.getwalletMoney();
  467. } else {
  468. uni.showModal({
  469. title: '温馨提示',
  470. content: res.msg,
  471. showCancel: false,
  472. cancelText: '取消',
  473. confirmText: '确认'
  474. });
  475. that.getwalletMoney();
  476. }
  477. uni.hideLoading();
  478. });
  479. }
  480. }
  481. });
  482. } else {
  483. that.$queue.showToast('提现金额必须大于或等于' + that.value + '元才可提现');
  484. }
  485. }
  486. }
  487. },
  488. }
  489. };
  490. </script>
  491. <style lang="less">
  492. // @import '../../static/css/index.css';
  493. .view2-view-text {
  494. font-size: 14px;
  495. color: #000000;
  496. margin-left: 20upx;
  497. width: 80%;
  498. }
  499. .view2-view-image-right {
  500. width: 18upx;
  501. height: 30upx;
  502. margin-left: 50upx;
  503. }
  504. .cash {
  505. text-align: center;
  506. background: white;
  507. height: 100%;
  508. position: absolute;
  509. width: 100%;
  510. .cash-top {
  511. padding: 32upx 32upx 50upx 32upx;
  512. /* border-bottom: 1px solid gainsboro; */
  513. background: #FF2638;
  514. }
  515. .leiji {
  516. font-size: 14px;
  517. color: #ffffff;
  518. margin-bottom: 10px;
  519. }
  520. // 提现银行卡信息
  521. .yinghang{
  522. height: 80rpx;
  523. line-height: 80rpx;
  524. font-size: 36rpx;
  525. font-weight: 700;
  526. text-align: left;
  527. }
  528. .yinghang2{
  529. height: 80rpx;
  530. line-height: 80rpx;
  531. font-size: 36rpx;
  532. font-weight: 700;
  533. }
  534. }
  535. </style>