merchant-detail-pos-completion.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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. </head>
  17. <body class="bgc-back nopb pt0" style="padding-top:0;">
  18. <div id="app" v-cloak>
  19. <van-nav-bar class="bgc-back user_rank_explan_title" left-arrow @click-left="goback" v-if="toptitleisshow">
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. </van-nav-bar>
  22. <div class="regist-box-input pt8 pb32 pl32 pr32">
  23. <div class="f24 c333 b pb32">商户信息管理</div>
  24. <div class="f12 c666 mb6">真实姓名</div>
  25. <van-field class="mb12" v-model="reg.RealName" @input="checkValue" :readonly="!isall" placeholder="请输入商户的真实姓名"></van-field>
  26. <div class="f12 c666 mb6">手机号</div>
  27. <van-field class="mb12" v-model="reg.Mobile" @input="checkValue" :readonly="!isall" placeholder="请输入商户手机号"></van-field>
  28. <div class="f12 c666 mb6">身份证号码</div>
  29. <van-field class="mb12" v-model="reg.Idcard" @input="checkValue" :readonly="!isall" placeholder="请输入商户身份证号码"></van-field>
  30. <div class="f12 c666 mb6">机具类型</div>
  31. <van-field class="mb12" v-model="reg.MerchantType" readonly @click="choseType = true" @input="checkValue" placeholder="请输入商户身份证号码"></van-field>
  32. <div class="pt16 bc333" v-cloak>
  33. <van-button type="primary" block color="#FFD500" v-if="isall" :disabled="canRegist ? false : true" @click="changepwd">确认</van-button>
  34. </div>
  35. </div>
  36. </div>
  37. <script src="./static/js/klm-vv.min.js"></script>
  38. <script src="./static/js/appfunc.min.js"></script>
  39. <script src="./static/js/klm-axios-config.js"></script>
  40. <script src="./static/js/publicfn.js"></script>
  41. <script>
  42. if ('OTPCredential' in window) {
  43. // DOMContentLoaded 事件会等待 DOM树准备好
  44. window.addEventListener('DOMContentLoaded', e => {
  45. const input = document.querySelector('input[autocomplete="one-time-code"]');
  46. if (!input) return;
  47. const ac = new AbortController();
  48. // 用户可以自己输入验证码并且提交,使用 AbortController 终止 Web OTP API 的自动填充
  49. // AbortController 还可以终止 fetch 的请求
  50. // 监听终止事件 ac.signal.addEventListener('abort', function(){});
  51. const form = input.closest('form');
  52. if (form) {
  53. form.addEventListener('submit', e => {
  54. ac.abort(); // 终止 Web OTP API 的自动填充
  55. });
  56. }
  57. navigator.credentials.get({
  58. otp: { transport:['sms'] },
  59. signal: ac.signal
  60. }).then(otp => {
  61. input.value = otp.code;
  62. if (form) form.submit();
  63. }).catch(err => {
  64. console.log(err);
  65. });
  66. });
  67. }
  68. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  69. // 可以通过下面的方式手动注册
  70. Vue.use(vant.Lazyload);
  71. // 在 #app 标签下渲染一个按钮组件
  72. let app = new Vue({
  73. el: '#app',
  74. data() {
  75. return {
  76. //- 选择器选择项(动态生成)
  77. typecolumns: [
  78. ],
  79. choseTypetitle:'',
  80. choseType:false,
  81. toptitleisshow,
  82. reg:{
  83. Mobile: '',
  84. RealName:'',
  85. Idcard: '',
  86. MerchantType: '',
  87. },
  88. isall:false,
  89. canRegist: false,
  90. products:[],
  91. };
  92. },
  93. created(){
  94. //- this.getproductlist();
  95. this.getmerchantinfo();
  96. },
  97. methods: {
  98. //- choseTypeonConfirm(date){
  99. //- this.products.forEach(item=>{
  100. //- if(item.Name === date){
  101. //- this.reg.MerchantType = date;
  102. //- this.reg.BrandId = item.Id;
  103. //- };
  104. //- });
  105. //- this.choseType = false;
  106. //- },
  107. async getproductlist(){
  108. const res = await getRequest('api/v1/pos/kqproducts/list?t='+Math.random(6),JSON.stringify({PageSize:10,PageNum:1}));
  109. if(res.status === '1') {
  110. //- this.typecolumns = res.data.map(item=>{
  111. //- return item.Name
  112. //- });
  113. this.products = res.data;
  114. };
  115. },
  116. //- 确定按钮是否能够使用(需要将信息填入完整)
  117. checkValue(){
  118. this.canRegist = (this.reg.Mobile !== '' && this.reg.RealName !== '' && this.reg.Idcard !== '') ? true : false;
  119. },
  120. //- 获取商户详情
  121. async getmerchantinfo(){
  122. const list = await getRequest('api/v1/pos/kqproducts/list?t='+Math.random(6),JSON.stringify({PageSize:10,PageNum:1}));
  123. if(list.status === '1') {
  124. this.products = list.data;
  125. };
  126. const Id = PublicLib.getCookieInfo('merchantId');
  127. const res = await getRequest('/api/v1/pos/merchantinfo/detail',JSON.stringify({Id}));
  128. if(res.status !== '1') return tips(res.info);
  129. this.products.forEach(item=>{
  130. if(item.Name === res.data.ProductType){
  131. this.reg.BrandId = item.Id;
  132. };
  133. });
  134. if(res.data.MerIdcardNo === null){
  135. this.isall = true;
  136. }else{
  137. this.reg = {
  138. Mobile:res.data.MerchantMobile,
  139. RealName:res.data.MerRealName,
  140. Idcard:res.data.MerIdcardNo,
  141. };
  142. //- this.products.forEach(item=>{
  143. //- if(item.Id === res.data.BrandId){
  144. //- this.reg.MerchantType = item.Name;
  145. //- };
  146. //- });
  147. };
  148. this.reg.MerchantType = res.data.ProductType;
  149. },
  150. changepwd:undebounce(async function(){
  151. //- if(!verificationName(this.reg.RealName)) return tips('请输入中文姓名');
  152. if(this.reg.RealName.length > 14) return tips('请输入正确商户姓名');
  153. if(verification(this.reg.Mobile)) return;
  154. if(!verificationIdCardNumber(this.reg.Idcard)) return tips('请输入正确的身份证号码');
  155. const Id = PublicLib.getCookieInfo('merchantId');
  156. const res = await postRequest('/api/v1/pos/posmerchantinfo/editinfo?t='+Math.random(6),JSON.stringify({Id,MerchantMobile:this.reg.Mobile,MerRealName:this.reg.RealName,MerIdcardNo:this.reg.Idcard,BrandId:this.reg.BrandId}));
  157. if(res.status !== '1') return tips(res.info);
  158. tips('商户信息维护成功!');
  159. setTimeout(()=>{
  160. this.goback();
  161. },1500);
  162. },300),
  163. goback(){
  164. PublicLib.GoBack({Level:1});
  165. }
  166. }
  167. });
  168. </script>
  169. </body>
  170. </html>