user-inviteregist-2.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <!DOCTYPE html>
  2. <html class="h100p">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>分享注册2-创业帮</title>
  6. <meta name="keywords" content="分享注册2-创业帮">
  7. <meta name="description" content="分享注册2-创业帮">
  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="分享注册2-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. <style>.invite-regist-box-input .van-field__button .van-button--default{background-color:#FBFBFB;}</style>
  17. </head>
  18. <body class="invite_bg h100p nopb" style="padding-top:0;">
  19. <div id="app" v-cloak>
  20. <van-nav-bar class="user_rank_explan_title" title="创业帮新用户注册" v-if="toptitleisshow" left-arrow>
  21. <template #left> <img src="./static/images/left.png" alt=""></template>
  22. </van-nav-bar>
  23. <div class="invite-user tc">
  24. <div class="f18 c333 b">您的好友<span v-cloak>{{inviteinfo.name}}</span>诚邀您加入创业帮</div>
  25. </div>
  26. <div class="pl16 pr16 rel">
  27. <div class="invite-regist-box-input bgcfff">
  28. <div class="f16 c333 b mb12">新用户注册</div>
  29. <van-field class="mb12" v-model="userInfo.Mobile" @input="checkLogin" type="number" placeholder="请输入注册手机号"></van-field>
  30. <van-field class="user-phone mb12" center clearable placeholder="请输入验证码" @input="checkLogin" v-model="userInfo.MobileCode">
  31. <template #button>
  32. <van-button class="fl" plain color="#FD824D" @click="getsmscode" v-if="codeisclick">获取验证码</van-button>
  33. <van-button class="fl" plain color="#FD824D" disabled v-else>{{countdown}}s</van-button>
  34. </template>
  35. </van-field>
  36. <van-field class="mb12" v-model="'推荐码:'+ inviteinfo.code" readonly></van-field>
  37. <van-field v-model="userInfo.LoginPwd" @input="checkLogin" :type="isShowPwd ? 'text' : 'password'" placeholder="请设置登录密码">
  38. <template #button>
  39. <van-button class="fr" @click="showPwd()"><img class="fr" :src="isShowPwd ? './static/images/show-icon@3x.png' : './static/images/noshow-icon@3x.png'" alt=""></van-button>
  40. </template>
  41. </van-field>
  42. <div class="df pt16">
  43. <van-checkbox v-model="agreement" @input="checkLogin" icon-size=".426667rem" checked-color="#FFD500"><span class="f14 c999">我已阅读并同意</span></van-checkbox><span class="f14 c333" @click="gotoservice">「创业帮服务协议」</span>
  44. </div>
  45. <div class="pt16 bc333" v-cloak>
  46. <van-button type="primary" block round color="#FFD500" :disabled="canRegist ? false : true" @click="regist">注册</van-button>
  47. </div>
  48. <div class="pt16 tc">
  49. <div class="f12 c999">注意:用户年龄必须18-60周岁</div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <script src="./static/js/klm-vv.min.js"></script>
  55. <script src="./static/js/appfunc.min.js"></script>
  56. <script src="./static/js/klm-axios-config.js"></script>
  57. <script src="./static/js/publicfn.js?j=123456"></script>
  58. <script src="//res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
  59. <script>
  60. // 通过 CDN 引入时不会自动注册 Lazyload 组件
  61. // 可以通过下面的方式手动注册
  62. Vue.use(vant.Lazyload);
  63. // 在 #app 标签下渲染一个按钮组件
  64. let app = new Vue({
  65. el: '#app',
  66. data() {
  67. return {
  68. toptitleisshow:false,
  69. active: 0,
  70. isShowPwd: false,
  71. inviteinfo:{
  72. name:'',
  73. code:''
  74. },
  75. userInfo:{
  76. Mobile: '',
  77. MobileCode: '',
  78. ReferenceCode:'',
  79. LoginPwd: '',
  80. OpenId:PublicLib.getCookieInfo('openid'),
  81. },
  82. agreement: true,
  83. canRegist: false,
  84. codeisclick:true,
  85. countdown:60
  86. };
  87. },
  88. created(){
  89. this.inviteinfo.code = PublicLib.getCookieInfo('inviteCode');
  90. this.userInfo.ReferenceCode = PublicLib.getCookieInfo('inviteCode');
  91. this.inviteinfo.name = PublicLib.getCookieInfo('inviteName');
  92. },
  93. methods: {
  94. //- getUrlParam(name){
  95. //- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
  96. //- var r = window.location.search.substr(1).match(reg); //匹配目标参数
  97. //- if (r != null) return unescape(r[2]);
  98. //- return null; //返回参数值
  99. //- },
  100. showPwd(){
  101. this.isShowPwd = !this.isShowPwd;
  102. },
  103. //- 获取验证码
  104. async getsmscode(){
  105. if(verification(this.userInfo.Mobile)) return;
  106. this.codeisclick = false;
  107. setTimeout(()=>{
  108. this.codeisclick = true;
  109. },60000);
  110. const timer = setInterval(()=>{
  111. this.countdown--;
  112. if(this.countdown === 0) {
  113. this.countdown = 60;
  114. clearInterval(timer)
  115. }
  116. },1000);
  117. const res = await postRequest('api/v1/mobilecodecheck/sendsms',JSON.stringify({Mobile:this.userInfo.Mobile}));
  118. if(res) tips('验证码已发送,请注意查收');
  119. },
  120. //- 点击注册
  121. async regist(){
  122. if(verification(this.userInfo.Mobile)) return;
  123. if(verificationpassword(this.userInfo.LoginPwd)) return;
  124. if(verificationmobilecode(this.userInfo.MobileCode)) return;
  125. const value = JSON.stringify(this.userInfo);
  126. const res = await postRequest('api/v1/users/register',value);
  127. if(res.status !== '1') return tips(res.info);
  128. tips('注册成功,2s后自动关闭,请下载app查看');
  129. setTimeout(()=>{
  130. //- WeixinJSBridge.call('closeWindow')
  131. window.location.href = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.kexiaoshuang.creator'; // 跳转应用宝
  132. },2000)
  133. },
  134. checkLogin(){
  135. this.canRegist = (this.userInfo.Mobile !== '' && this.userInfo.LoginPwd !== '' && this.userInfo.MobileCode !== '' && this.agreement === true) ? true : false;
  136. },
  137. gotoservice(){
  138. window.location.href = ' /p/user-maker-code';
  139. },
  140. }
  141. });
  142. </script>
  143. </body>
  144. </html>