user-changebank.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. <!DOCTYPE html>
  2. <html>
  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/crop.css">
  16. <link rel="stylesheet" href="./static/css/main.css">
  17. </head>
  18. <body class="nopb pt0" style="padding-top:0;">
  19. <div id="app" v-cloak>
  20. <van-nav-bar class="user_rank_explan_title user_title_normal" left-arrow @click-left="goback" v-if="toptitleisshow">
  21. <template #left> <img src="./static/images/left.png" alt=""></template>
  22. </van-nav-bar>
  23. <div class="pt16 pb16 pl16 pr16 bb8f7f7f7">
  24. <div class="f14 c333 mb6">上传结算卡照片</div>
  25. <van-row class="pt8 pb8" @click="takephoto">
  26. <van-col offset="4" span="16"><img :src="showphoto" alt="" width="100%"></van-col>
  27. </van-row>
  28. </div>
  29. <div class="mb20 bb8f7f7f7">
  30. <van-field v-model="username" @input="checkValue" label="变更人" readonly></van-field>
  31. <van-field v-model="real.Mobile" @input="checkValue" label="手机号" readonly></van-field>
  32. <van-field class="user-phone" center clearable label="验证码" @input="checkValue" placeholder="请输入验证码" v-model="real.MobileCode">
  33. <template #button>
  34. <van-button class="fl plain-nb" plain color="#ff502a" @click="getsmscode" v-if="codeisclick">获取验证码</van-button>
  35. <van-button class="fl plain-nb" plain color="#ff502a" disabled v-else>{{countdown}}s</van-button>
  36. </template>
  37. </van-field>
  38. <van-field v-model="real.SettleBankCardNo" @input="checkValue" label="结算银行卡" placeholder="请输入您的结算银行卡号"></van-field>
  39. <van-field v-model="real.BankMobile" @input="checkValue" label="预留手机号" placeholder="请输入结算银行卡预留手机号"></van-field>
  40. <van-field class="mb12" v-model="real.SettleBankName" placeholder="请选择" readonly @click="typeisshow" label="结算银行名称" right-icon="arrow-down"></van-field>
  41. <van-field class="mb12" v-model="Bankdetailname" placeholder="模糊搜索" label="搜索信息"></van-field>
  42. <van-field class="mb12" v-model="real.BankName" placeholder="请填入信息后选择银行卡开户行全称" label="选择开户行" readonly right-icon="arrow-down" @click="BankNameflagfn"></van-field>
  43. <van-popup v-model="BankNameflag" position="bottom">
  44. <van-picker title="开户行全称" show-toolbar :columns="BankNamelist" @confirm="banknamefn" @cancel="BankNameflag = false"></van-picker>
  45. </van-popup>
  46. </div>
  47. <div class="pt16 bc333" v-cloak>
  48. <van-button type="primary" block color="#FFD500" :disabled="canRegist ? false : true" @click="uploadheadhpotofn">确认提交</van-button>
  49. </div>
  50. <van-dialog v-model="showSuccess" theme="round-button" @close="closefinish" confirm-button-text="知道了">
  51. <div class="pt16 pl16 pr16 tc"><img src="./static/images/success@3x.png" width="48">
  52. <div class="f14 c333">变更成功</div>
  53. <div class="pt16 pb16 f12 c999">欢迎加入创业帮团队</div>
  54. </div>
  55. </van-dialog>
  56. <van-dialog v-model="showFail" theme="round-button" confirm-button-text="返回修改">
  57. <div class="pt16 pl16 pr16 tc"><img src="./static/images/fail@3x.png" width="48">
  58. <div class="f14 c333">变更失败</div>
  59. <div class="pt16 pb16 f12 c999">信息有误,请核对信息确认无误后提交</div>
  60. </div>
  61. </van-dialog>
  62. <input type="file" accept="image/*" id="upload" style="display:none;">
  63. <van-popup v-model="choseType" position="bottom">
  64. <van-picker title="开户银行" show-toolbar :columns="typecolumns" @confirm="choseTypeonConfirm" @cancel="choseType = false"></van-picker>
  65. </van-popup>
  66. </div>
  67. <script src="./static/js/clipboard.min.js"></script>
  68. <script src="./static/js/klm-vv.min.js"></script>
  69. <script src="./static/js/appfunc.min.js"></script>
  70. <script src="./static/js/klm-axios-config.js"></script>
  71. <script src="./static/js/publicfn.js"></script>
  72. <script src="./static/js/exif.js"></script>
  73. <script src="./static/js/transformation-matrix.js"></script>
  74. <script src="./static/js/prefix-umd.js"></script>
  75. <script src="./static/js/index.js"></script>
  76. <script src="./static/js/arealist.js"></script>
  77. <script>
  78. //上回后回调方法,用于调用缩放、裁切、旋转功能
  79. function AppUpload(imgpath) {
  80. setTimeout(function () {
  81. PublicLib.WapCropForApp(600, 380, 'upload', imgpath, 1);
  82. }, 300);
  83. }
  84. //裁切结束后回调方法
  85. function ShowPhoto(url) {
  86. //获取最终的图片地址
  87. app.changebankimg(url);
  88. }
  89. if (isWeb) {
  90. PublicLib.WapCrop(600, 380, 'upload', 1);
  91. }
  92. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  93. // 可以通过下面的方式手动注册
  94. Vue.use(vant.Lazyload);
  95. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  96. // 在 #app 标签下渲染一个按钮组件
  97. let app = new Vue({
  98. el: '#app',
  99. data() {
  100. return {
  101. Bankdetailname:'',
  102. BankType:'',
  103. BankNameflag:false,
  104. BankNamelist:[],
  105. choseType:false,
  106. toptitleisshow:false,
  107. active: 0,
  108. showSuccess: false,
  109. showFail: false,
  110. username: '',
  111. real:{
  112. SettleBankCardNo: '',
  113. Mobile: '',
  114. MobileCode: '',
  115. BankName:'',
  116. SettleBankName:'',
  117. BankCardPositiveImage:'',
  118. BankMobile:''
  119. },
  120. showphoto:'./static/images/realauth-4-b.png',
  121. canRegist: false,
  122. show: false,
  123. codeisclick:true,
  124. countdown:60,
  125. typecolumns:[],
  126. SettleBankName:'',
  127. };
  128. },
  129. mounted() {
  130. this.toptitleisshow = toptitleisshow;
  131. this.giveToast();
  132. this.getbankinfo();
  133. },
  134. methods: {
  135. closefinish(){
  136. this.goback();
  137. },
  138. async BankNameflagfn(){
  139. this.BankNameflag = true;
  140. //- 发起请求
  141. res = await getRequest('api/v1/openbanktable/list?t='+Math.random(6),JSON.stringify({PageSize:50,PageNum:1,SearchKey:this.Bankdetailname}));
  142. if(res.status !== '1') return tips(user.info);
  143. //- console.log(res)
  144. let arr = [];
  145. res.data.forEach(item=>{
  146. arr.push(item.BankName);
  147. })
  148. this.BankNamelist = arr;
  149. },
  150. banknamefn(data){
  151. this.BankNameflag = false;
  152. this.real.BankName = data;
  153. this.checkValue()
  154. },
  155. //- 选择器选择
  156. choseTypeonConfirm(date){
  157. this.real.SettleBankName = date.value;
  158. this.choseType = false;
  159. this.checkValue()
  160. },
  161. async typeisshow(){
  162. this.choseType = true;
  163. res = await getRequest('api/v1/merchantaddinfo/options?t='+Math.random(6),JSON.stringify({PageSize:1000,PageNum:1,Kind:4}));
  164. if(res.status !== '1') return tips('账户类型请求错误,请关闭重试!');
  165. this.typecolumns = res.data;
  166. },
  167. giveToast(){
  168. //- vant.Toast('提示');
  169. // 警告通知
  170. vant.Notify({color: '#333', background: '#FFD500',duration: 3000, message: '请选择中/农/工/建/招等大型银行或者商业银行,有助于到账' });
  171. },
  172. takephoto(){
  173. PublicLib.UploadPhoto({
  174. Quality:1,
  175. PhotoCount:1,
  176. Width:300,
  177. Height:300,
  178. });
  179. },
  180. checkValue(){
  181. this.canRegist = (this.username !== '' && this.real.Mobile !== '' && this.real.MobileCode !== '' && this.real.BankName !== '' && this.real.SettleBankName !== '' && this.real.SettleBankCardNo !== '' && this.real.BankCardPositiveImage !== '') ? true : false;
  182. },
  183. goback(){
  184. PublicLib.GoBack({Level:2});
  185. },
  186. async getbankinfo(){
  187. const Id = PublicLib.getCookieInfo('userId');
  188. const res = await getRequest('api/v1/users/authinfo?t='+Math.random(6),JSON.stringify({Id}));
  189. if(res.status !== '1' ) return tips('获取结算卡信息失败,请重试!')
  190. this.username = res.data.RealName;
  191. this.real.Mobile = res.data.Mobile;
  192. },
  193. //- 获取验证码
  194. async getsmscode(){
  195. if(verification(this.real.Mobile)) return;
  196. this.codeisclick = false;
  197. setTimeout(()=>{
  198. this.codeisclick = true;
  199. },60000);
  200. const timer = setInterval(()=>{
  201. this.countdown--;
  202. if(this.countdown === 0) {
  203. this.countdown = 60;
  204. clearInterval(timer);
  205. }
  206. },1000);
  207. const res = await postRequest('api/v1/mobilecodecheck/sendsms',JSON.stringify({Mobile:this.real.Mobile}));
  208. if(res) tips('验证码已发送,请注意查收');
  209. },
  210. changebankimg(url){
  211. this.real.BankCardPositiveImage = url;
  212. this.showphoto = showHost + url;
  213. this.checkValue();
  214. },
  215. //- 变更结算卡
  216. async uploadheadhpotofn(){
  217. if(verification(this.real.BankMobile)) return;
  218. if(!verificationbankcardId(this.real.SettleBankCardNo)) return tips('银行卡格式错误!');
  219. const Id = PublicLib.getCookieInfo('userId');
  220. const res = await postRequest('api/v1/users/changebankcard?t='+Math.random(6),JSON.stringify({Id,SettleBankCardNo:this.real.SettleBankCardNo,BankCardPositiveImage:this.real.BankCardPositiveImage,Mobile:this.real.Mobile,MobileCode:this.real.MobileCode,BankName:this.real.BankName,SettleBankName:this.real.SettleBankName,BankMobile:this.real.BankMobile}));
  221. if(res.status !== '1') return this.showFail = true;
  222. this.showSuccess = true;
  223. }
  224. }
  225. });
  226. </script>
  227. </body>
  228. </html>