user-Withdrawal1.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <!DOCTYPE html>
  2. <html class="h100p">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>个人中心-提现-创业帮</title>
  6. <meta name="keywords" content="个人中心-提现-创业帮">
  7. <meta name="description" content="个人中心-提现-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="个人中心-提现-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>
  17. .aic{
  18. padding-top:.326667rem;
  19. }
  20. .pop-forgetpwd{
  21. top: .406667rem !important;
  22. }
  23. </style>
  24. </head>
  25. <body class="nopb login pt0" style="padding-top:0;">
  26. <div class="rel bankwithdrawal" id="app" v-cloak>
  27. <van-nav-bar class="mall_title user_title_normal user_rank_explan_title" left-arrow title="提现" v-if="toptitleisshow" right-text="提现记录" @click-left="goback" @click-right="withdrawallist">
  28. <template #left> <img src="./static/images/left.png" alt=""></template>
  29. </van-nav-bar>
  30. <div class="bankcard cfff pl16 pr16 pt16 pb16" :class="banktype(bankcardinfo.BankName).color">
  31. <div class="cardtop df">
  32. <div class="df banktype">
  33. <svg class="icon" v-if="banktype(bankcardinfo.BankName).icon === ''" t="1639551432401" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2083" width="200" height="200">
  34. <path d="M910.199521 304.727853L539.173184 142.199521c-0.408619-0.20431-0.919393-0.408619-1.328012-0.612929-2.553871-1.532322-13.484437-7.559457-25.334398-8.070231h-1.328013c-11.952115 0.612929-22.780527 6.537909-25.436552 8.070231-0.408619 0.20431-0.817239 0.510774-1.328013 0.612929L114.209098 304.727853c-6.537909 2.553871-10.419792 9.09178-10.419792 15.527534v19.613727c0 6.742219 5.414206 12.156425 12.156424 12.156425h40.044693c5.516361 0 10.317638 3.575419 11.747805 8.88747 5.005587 19.102953 26.253791 17.97925 29.6249 17.77494h628.252195c3.371109 0.306464 24.619314 1.430168 29.6249-17.77494 1.430168-5.312051 6.231445-8.88747 11.747806-8.88747h40.044692c6.742219 0 12.156425-5.414206 12.156425-12.156425v-18.592179c0-0.612929 0.102155-1.328013 0.20431-1.940941 0.715084-6.027135-3.064645-11.441341-9.193935-14.608141z m-26.66241 510.569833H140.769354c-28.501197 0-27.888268 27.888268-27.888269 27.888268v34.528332c0 6.742219 5.414206 12.156425 12.156425 12.156424h774.12929c6.742219 0 12.156425-5.414206 12.156424-12.156424v-34.528332c0.102155 0 0.817239-27.888268-27.786113-27.888268zM221.267358 419.447725v314.126098h-31.770151c-23.495611 0-26.764565 22.269753-27.173185 26.560255 0 0.408619-0.102155 0.817239-0.102154 1.123703v13.893057c0 6.742219 5.414206 12.156425 12.156424 12.156425h676.877893c6.742219 0 12.156425-5.414206 12.156425-12.156425v-13.893057c0-0.408619 0-0.817239-0.102155-1.123703-0.408619-4.290503-3.677574-26.560255-27.173184-26.560255h-31.770152V419.447725c0-6.742219-5.414206-12.156425-12.156425-12.156424h-78.046289c-6.742219 0-12.156425 5.414206-12.156424 12.156424v314.126098h-62.314445V419.447725c0-6.742219-5.414206-12.156425-12.156425-12.156424h-77.43336c-6.742219 0-12.156425 5.414206-12.156425 12.156424v314.739027h-50.56664V419.447725c0-6.742219-5.414206-12.156425-12.156424-12.156424h-77.43336c-6.742219 0-12.156425 5.414206-12.156425 12.156424v314.126098h-62.314445V419.447725c0-6.742219-5.414206-12.156425-12.156425-12.156424h-77.43336c-7.048683 0-12.462889 5.414206-12.462889 12.156424z m0-12.156424" p-id="2084"></path>
  35. </svg>
  36. <div class="svgbc mr16 df" v-else>
  37. <svg class="icon" aria-hidden="true">
  38. <use :href="banktype(bankcardinfo.BankName).icon"></use>
  39. </svg>
  40. </div>
  41. <div class="f12">{{bankcardinfo.BankName}}</div>
  42. </div>
  43. <div class="cardtype">借记卡</div>
  44. </div>
  45. <div class="cardnumber tc mt16 df pl16 pr16">
  46. <div class="num">{{splice(bankcardinfo.SettleBankCardNo,0,4)}}</div>
  47. <div class="num">{{splice(bankcardinfo.SettleBankCardNo,4,9)}}</div>
  48. <div class="num">{{splice(bankcardinfo.SettleBankCardNo,7,11)}}</div>
  49. <div class="num">{{splice(bankcardinfo.SettleBankCardNo,12,bankcardinfo.SettleBankCardNo.length)}}</div>
  50. </div>
  51. </div>
  52. <div class="balanceinfo pl16 pr16 df f14">
  53. <div class="balance">可提余额:{{balanceinfo.BalanceAmount}}元</div>
  54. <div class="more" @click="withdrawal">全部提现</div>
  55. </div>
  56. <van-field class="inputbalancecount pl16 f16" placeholder="请输入提现金额" type="number" v-model="withdrawalcount" @input="withdrawalinput"></van-field>
  57. <div class="btn pl16 pr16 mt16 bc333">
  58. <van-button color="#FFD500" block @click="surewithdrawal" :disabled="isauth !== '1'">确认提现</van-button>
  59. <div class="f14 c333 mt16 tc" v-if="isauth !== '1'"> <span class="more" @click="gorealauth">提现认证失败,</span><span class="more" @click="gorealauth" style="text-decoration:underline;">点击修改认证资料</span></div>
  60. </div>
  61. <div class="withdrawalrules pl16 pr16">
  62. <div class="title">提现规则:</div>
  63. <div class="content mt8 c999" v-html="rules.Contents"></div>
  64. </div>
  65. <van-popup class="pwdPop" v-model="pwdPop" position="bottom" closeable close-icon-position="top-left" :style="{ height: '60%' }">
  66. <div class="tc pt16 rel aic">
  67. <div class="f18 c333">输入密码</div>
  68. <div class="pop-forgetpwd abs f14 c666" @click.stop="forgetpaypwd">忘记密码</div>
  69. </div>
  70. <div class="pt8">
  71. <van-password-input class="mt8" :value="value" :info="pwdInfo" :error-info="errorInfo" :focused="showKeyboard" @focus="showKeyboard = true"></van-password-input>
  72. </div>
  73. <van-number-keyboard v-model="value" maxlength="6" :show="true">
  74. <template #extra-key>
  75. <van-icon @click="onKeyboardHide" name="shrink"></van-icon>
  76. </template>
  77. </van-number-keyboard>
  78. </van-popup>
  79. </div>
  80. <script src="./static/js/klm-vv.min.js"></script>
  81. <script src="./static/js/appfunc.min.js"></script>
  82. <script src="./static/js/klm-axios-config.js"></script>
  83. <script src="./static/js/publicfn.js"></script>
  84. <script src="./static/js/iconfont.js"></script>
  85. <script>
  86. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  87. // 可以通过下面的方式手动注册
  88. Vue.use(vant.Lazyload);
  89. // 在 #app 标签下渲染一个按钮组件
  90. let app = new Vue({
  91. el: '#app',
  92. data() {
  93. return {
  94. //- dialogisshow:false,
  95. toptitleisshow:false,
  96. bankcardinfo:{
  97. SettleBankCardNo:'',
  98. BankName:'',
  99. },
  100. balanceinfo:{},
  101. rules:{
  102. Title:'',
  103. Contents:'',
  104. },
  105. withdrawalcount:'',
  106. pwdPop:false,
  107. value:'',
  108. pwdInfo: '密码为 6 位数字',
  109. showKeyboard: true,
  110. errorInfo:'',
  111. isauth:'',
  112. };
  113. },
  114. created() {
  115. this.toptitleisshow = toptitleisshow;
  116. this.getrules();
  117. this.getbankcardinfo();
  118. this.getbalance();
  119. this.getCashauthFailInfo();
  120. //- if(PublicLib.getCookieInfo('withdrawRealAuth') === 'true'){
  121. //- this.isauth = false;
  122. //- };
  123. },
  124. watch: {
  125. //- 监控密码输入是否正确
  126. async value(value) {
  127. if(value.length === 6){
  128. //- 验证原支付密码
  129. const Id = PublicLib.getCookieInfo('userId');
  130. const res = await getRequest('api/v1/users/checkpaypwd?t='+Math.random(6),JSON.stringify({Id,PayPwd:this.value}));
  131. if(res.status === '1'){
  132. this.pwdInfo = '密码正确';
  133. const that = this;
  134. this.putwithdrawal();
  135. this.pwdPop = false;
  136. this.withdrawalcount = '';
  137. setTimeout(function(){
  138. that.value = '';
  139. },800);
  140. }else{
  141. this.errorInfo = '密码错误';
  142. const that = this;
  143. setTimeout(function(){
  144. that.value = '';
  145. },800);
  146. };
  147. } else if(value.length === 0){
  148. this.errorInfo = '';
  149. this.pwdInfo = '密码为 6 位数字';
  150. } else{
  151. this.errorInfo = '';
  152. this.pwdInfo = '再输入' + (6 - value.length) + '位密码';
  153. };
  154. },
  155. },
  156. methods: {
  157. gorealauth(){
  158. this.dialogisshow = true;
  159. PublicLib.Goto({Url:'new-pag1'});
  160. },
  161. //- 实时监控金额输入框
  162. withdrawalinput(){
  163. if(Number(this.withdrawalcount) > Number(this.balanceinfo.BalanceAmount)){
  164. this.withdrawalcount = this.balanceinfo.BalanceAmount;
  165. this.withdrawalcount = Number(this.withdrawalcount).toFixed(2);
  166. };
  167. },
  168. //- 忘记支付密码
  169. forgetpaypwd(){
  170. PublicLib.putCookieInfo("settingto",'forgetpaypwd');
  171. PublicLib.Goto({Url:'user-verification'});
  172. },
  173. surewithdrawal:undebounce(async function(){
  174. //- 确认提现按钮
  175. const Id = PublicLib.getCookieInfo('userId');
  176. const res = await getRequest('api/v1/users/existpaypwd?t='+Math.random(6),JSON.stringify({Id}));
  177. if(res.status !== '1') return PublicLib.Goto({Url:'user-setpaypwd-1'});
  178. if(this.withdrawalcount === '') return tips('请输入提现金额');
  179. if(Number(this.withdrawalcount) < 100) return tips('提现最低金额100.00元');
  180. this.pwdPop = true;
  181. }),
  182. //- 关闭密码输入框
  183. onKeyboardHide(){
  184. this.pwdPop = false;
  185. },
  186. //- 返回个人中心
  187. goback(){
  188. PublicLib.GoBack({Level:1});
  189. },
  190. //- 跳转提现记录
  191. withdrawallist(){
  192. PublicLib.Goto({Url:'user-withdrawal-list'});
  193. },
  194. //- 截取银行卡函数
  195. splice(num,begin,end){
  196. return num.substring(begin,end);
  197. },
  198. //- 全部提现
  199. withdrawal(){
  200. this.withdrawalcount = this.balanceinfo.BalanceAmount;
  201. },
  202. //- 获取规则
  203. async getrules(){
  204. const res = await getRequest('api/v1/pageinfo/detail?t='+Math.random(6),JSON.stringify({Id:7}));
  205. if(res.status !== '1') return tips('提现规则获取失败!');
  206. this.rules = res.data;
  207. },
  208. gtouchstart(){
  209. const that = this;
  210. this.timeOutEvent = setTimeout(()=>{
  211. that.longPress()
  212. },500);
  213. },
  214. gtouchend(){
  215. clearTimeout(this.timeOutEvent);
  216. },
  217. gtouchmove(){
  218. clearTimeout(this.timeOutEvent);
  219. this.timeOutEvent = 0;
  220. },
  221. longPress(){
  222. this.timeOutEvent = 0;
  223. PublicLib.SaveToSd({PicPath:'https://bs.kexiaoshuang.com/static/qrcode.jpg'});
  224. // 下载分享图片
  225. },
  226. //获取认证状态及失败原因
  227. async getCashauthFailInfo(){
  228. const Id = PublicLib.getCookieInfo('userId');
  229. const res = await getRequest('api/v1/users/cashauthfailinfo?t='+Math.random(6),JSON.stringify({Id}))
  230. this.isauth = res.status
  231. },
  232. //- 获取银行卡信息
  233. async getbankcardinfo(){
  234. const Id = PublicLib.getCookieInfo('userId');
  235. const res = await getRequest('api/v1/users/bindbankinfo?t='+Math.random(6),JSON.stringify({Id}));
  236. if(res.status !== '1') return tips('结算卡信息获取失败!');
  237. this.bankcardinfo = res.data;
  238. this.bankcardinfo.SettleBankCardNo = hidemiddlenum(this.bankcardinfo.SettleBankCardNo,0,5);
  239. //- this.bankcardinfo.BankName = '中国建设银行';
  240. },
  241. //- 获取账户余额信息
  242. async getbalance(){
  243. //- PublicLib.ShowLoading({Message:''});
  244. const UserId = PublicLib.getCookieInfo('userId');
  245. const res = await getRequest('api/v1/useraccount/myaccount?t='+Math.random(6),JSON.stringify({UserId}));
  246. if(res.status !== '1') return tips('余额信息获取失败!');
  247. //- PublicLib.HideLoading();
  248. this.balanceinfo = res.data;
  249. this.balanceinfo.BalanceAmount = res.data.BalanceAmount.toFixed(2);
  250. },
  251. //- 提交提现申请
  252. async putwithdrawal(){
  253. const that = this;
  254. const UserId = PublicLib.getCookieInfo('userId');
  255. const res = await postRequest('api/v1/usercashrecord/postwithdraw?t='+Math.random(6),JSON.stringify({UserId,TradeAmount:Number(this.withdrawalcount)}));
  256. if(res.status !== '1')return tips('提现发起失败,请稍后重试!');
  257. tips('提现发起成功,请关注提现审核结果!');
  258. setTimeout(function(){
  259. that.getbalance();
  260. },800);
  261. },
  262. //- 动态匹配银行
  263. banktype(bankname){
  264. switch(bankname){
  265. case '建设银行':
  266. return {color:'CCB',icon:'#icon-jiansheyinhang'};
  267. case '工商银行':
  268. return {color:'ICBC',icon:'#icon-zhongguogongshangyinhang'};
  269. case '汇丰银行':
  270. return {color:'HSBC',icon:'#icon-huifengyinhang'};
  271. case '中国银行':
  272. return {color:'BOC',icon:'#icon-zhongxinyinhang'};
  273. case '农业银行':
  274. return {color:'ABC',icon:'#icon-zhongguonongyeyinhang'};
  275. case '交通银行':
  276. return {color:'BC',icon:'#icon-jiaotongyinhang'};
  277. case '招商银行':
  278. return {color:'CMERB',icon:'#icon-zhaoshangyinhang'};
  279. case '中国民生银行':
  280. return {color:'CMINB',icon:'#icon-zhongguominshengyinhang'};
  281. case '中信银行':
  282. return {color:'CITIC',icon:'#icon-zhongxinyinhang'};
  283. case '华夏银行':
  284. return {color:'HB',icon:'#icon-huaxiayinhang'};
  285. case '兴业银行':
  286. return {color:'CIB',icon:'#icon-xingyeyinhang'};
  287. case '广东发展银行':
  288. return {color:'GDB',icon:'#icon-guangfayinhang'};
  289. case '平安银行':
  290. return {color:'PABC',icon:'#icon-pinganyinhang'};
  291. case '邮政银行':
  292. return {color:'PSBC',icon:'#icon-youzhengyinhang'};
  293. case '光大银行':
  294. return {color:'GDBC',icon:'#icon-guangdayinhang'};
  295. case '贵阳银行':
  296. return {color:'GYBC',icon:'#icon-guiyangyinhangguiyangshishangyeyinhang'};
  297. case '恒生银行':
  298. return {color:'HSBC',icon:'#icon-hengshengyinhanglogo'};
  299. case '浦发银行':
  300. return {color:'PFBC',icon:'#icon-yinhanglogo-1'};
  301. case '重庆银行':
  302. return {color:'PFBC',icon:'#icon-yinhanglogo-'};
  303. default:
  304. return {color:'DEFAULT',icon:''};
  305. };
  306. }
  307. }
  308. });
  309. </script>
  310. </body>
  311. </html>