h5Registr.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="page">
  3. <view class="header dis a-end">
  4. <image class="logo mr-2" src="/static/image/my/logo.png" mode=""></image>
  5. <view class="dis f-c a-start title">
  6. <text>晋掌柜</text>
  7. <text>高效、智能车险工具,让车险交易更简单</text>
  8. </view>
  9. </view>
  10. <view class="content-form mt-2" v-if="callback.isJoined==null">
  11. <view class="inviteHeader dis f-c a-c mt-3">
  12. <image class="avatar" :src="userInfo.headSculpture? userInfo.headSculpture :'/static/image/avatar.png'"
  13. mode=""></image>
  14. <text class="mt-2 mb-1"> <text class="font-weight">{{userInfo.name }}</text>邀请你加入</text>
  15. <text class="">{{userInfo.deptName}}</text>
  16. </view>
  17. <u--form labelPosition="left" :model="info" class="info" ref="ownerForm" labelWidth="60" errorType="message"
  18. :labelStyle="{fontWeight:'bold',color:'#333'}">
  19. <u-form-item label="手机号" borderBottom>
  20. <u--input v-model="info.mobile" border="none" clearable placeholder="请输入手机号" maxlength="11"
  21. placeholderStyle="color:#999"></u--input>
  22. </u-form-item>
  23. <!-- #ifdef H5 -->
  24. <u-form-item label="验证码" borderBottom>
  25. <u--input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
  26. placeholderStyle="color:#999">
  27. <template slot="suffix">
  28. <u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
  29. style="color: #F9E000;" uniqueKey="h5Registr"></u-code>
  30. <view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
  31. </template>
  32. </u--input>
  33. </u-form-item>
  34. <u-form-item label="新密码" borderBottom>
  35. <u--input v-model="info.password" border="none" clearable placeholder="请输入密码"
  36. placeholderStyle="color:#999" :password="isHidePassword">
  37. <template slot="suffix">
  38. <image class="icon-img"
  39. :src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
  40. mode="" @tap="isHidePassword=!isHidePassword"></image>
  41. </template>
  42. </u--input>
  43. </u-form-item>
  44. <!-- #endif -->
  45. <!-- #ifdef APP-PLUS -->
  46. <u-form-item label="验证码" borderBottom>
  47. <u-input v-model="info.smsCode" border="none" clearable placeholder="请输入手机验证码" maxlength="6"
  48. placeholderStyle="color:#999">
  49. <template slot="suffix">
  50. <u-code ref="uCode2" @change="codeChange2" keep-running start-text="发送验证码"
  51. style="color: #F9E000;" uniqueKey="h5Registr"></u-code>
  52. <view @tap="getCode2" :text="tips2" class="u-page__code-text">{{tips2}}</view>
  53. </template>
  54. </u-input>
  55. </u-form-item>
  56. <u-form-item label="新密码" borderBottom>
  57. <u-input v-model="info.password" border="none" clearable placeholder="请输入密码"
  58. placeholderStyle="color:#999" :password="isHidePassword">
  59. <template slot="suffix">
  60. <image class="icon-img"
  61. :src="isHidePassword?'/static/image/login/icon-hide.png':'/static/image/login/icon-show.png'"
  62. mode="" @tap="isHidePassword=!isHidePassword"></image>
  63. </template>
  64. </u-input>
  65. </u-form-item>
  66. <!-- #endif -->
  67. </u--form>
  68. <view class="btn dis a-c j-c " @click="submitRegistr">
  69. 立即加入
  70. </view>
  71. <view class="description dis j-c">点击立即加入代表你已阅读并同意 <text
  72. style="color: #1F1F1F;margin: 0 10rpx;">用户协议</text> 和 <text
  73. style="color: #1F1F1F;margin-left: 10rpx;">隐私政策</text> </view>
  74. </view>
  75. <view class="content-form mt-2" v-if="callback.isJoined==0">
  76. <view class="inviteHeader dis f-c a-c mt-3">
  77. <image class="avatar" src="/static/icon/joinSuccess.png" mode=""></image>
  78. <text class="mt-2 mb-1 font-weight" style="font-size: 36rpx;">加入成功</text>
  79. <text class="" style="font-size: 30rpx;">您已加入{{callback.deptName}}。使用 +86{{callback.mobile}}
  80. 登录晋掌柜并选择进入{{callback.systemCode}},即可开展车险业务</text>
  81. </view>
  82. <view class="btn dis a-c j-c " style="margin-top: 150rpx;margin-bottom: 30rpx;" @click="redirectDownload">
  83. 下载晋掌柜
  84. </view>
  85. <view class="description dis j-c"> 已有晋掌柜APP  
  86. <a style="color: #1F1F1F;margin-left: 10rpx;text-decoration: none;" href="zgcx://">打开</a>
  87. </view>
  88. </view>
  89. <view class="content-form mt-2" v-if="callback.isJoined==1">
  90. <view class="inviteHeader dis f-c a-c mt-3">
  91. <image class="avatar" src="/static/icon/joinSuccess.png" mode=""></image>
  92. <text class="mt-2 mb-1 font-weight" style="font-size: 36rpx;">您已加入该企业</text>
  93. <text class="" style="font-size: 30rpx;">你已加入该机构,无需重复加入。使用 +86{{callback.mobile}}
  94. 登录晋掌柜并选择进入{{callback.systemCode}},即可开展车险业务</text>
  95. </view>
  96. <view class="btn dis a-c j-c " style="margin-top: 150rpx;margin-bottom: 30rpx;" @click="redirectDownload">
  97. 下载晋掌柜
  98. </view>
  99. <view class="description dis j-c"> 已有晋掌柜APP <a
  100. style="color: #1F1F1F;margin-left: 10rpx;text-decoration: none;" href="zgcxapp://">打开</a>
  101. </view>
  102. </view>
  103. </view>
  104. </template>
  105. <script>
  106. export default {
  107. data() {
  108. return {
  109. isHidePassword: true, //是否隐藏密码
  110. info: {
  111. mobile: "",
  112. password: "",
  113. smsCode: "",
  114. }, //表单
  115. tips2: '',
  116. userInfo: {}, //推荐人信息
  117. callback: {
  118. isJoined: null,
  119. },
  120. systemCode: "",
  121. page: "",
  122. }
  123. },
  124. onShow() {
  125. console.log(this.callback);
  126. },
  127. onLoad(options) {
  128. if (options) {
  129. console.log(options);
  130. this.systemCode = options.systemCode;
  131. this.page = options.page;
  132. this.userInfo = JSON.parse(options.info);
  133. }
  134. },
  135. methods: {
  136. //注册接口
  137. async submitRegistr() {
  138. let api = this.page == '分销员注册' ? 'distributorInvite' : 'invitationRegister'
  139. let res = await this.$http.post(`/appUser/${api}`, {
  140. userId: this.page == '分销员注册' ? this.userInfo.infoId : this.userInfo.id,
  141. systemCode: this.systemCode,
  142. ...this.info
  143. });
  144. if (res.code == 200) {
  145. this.callback = res.data;
  146. console.log(this.callback);
  147. } else {
  148. uni.showToast({
  149. title: res.msg,
  150. icon: 'none'
  151. });
  152. }
  153. },
  154. redirectDownload() {
  155. uni.navigateTo({
  156. url: '/pages/registr/appPromoPage'
  157. })
  158. },
  159. codeChange2(text) {
  160. this.tips2 = text;
  161. },
  162. //点击发送验证码
  163. getCode2() {
  164. if (!this.info.mobile) {
  165. uni.showToast({
  166. title: '手机号为空',
  167. icon: 'none'
  168. });
  169. return;
  170. }
  171. if (this.$refs.uCode2.canGetCode) {
  172. this.smsCode(); // 向后端请求验证码
  173. uni.showLoading({
  174. title: '正在获取验证码'
  175. })
  176. setTimeout(() => {
  177. uni.hideLoading();
  178. // 这里此提示会被this.start()方法中的提示覆盖
  179. uni.$u.toast('验证码已发送');
  180. // 通知验证码组件内部开始倒计时
  181. this.$refs.uCode2.start();
  182. }, 1000);
  183. } else {
  184. uni.$u.toast('倒计时结束后再发送');
  185. }
  186. },
  187. //验证码接口
  188. async smsCode() {
  189. let res = await this.$http.get('/auth/sendSmsCode?mobile=' + this.info.mobile);
  190. },
  191. }
  192. }
  193. </script>
  194. <style lang="scss" scoped>
  195. ::v-deep {
  196. .u-form-item__body {
  197. padding: 30rpx 0;
  198. }
  199. }
  200. .page {
  201. background-color: #f8f8f8;
  202. height: 100vh;
  203. }
  204. .header {
  205. width: 100%;
  206. padding: 30rpx 35rpx;
  207. box-sizing: border-box;
  208. background: linear-gradient(77deg, #FFFFFF 0%, #FFFDED 100%), #FFFFFF;
  209. .logo {
  210. width: 120rpx;
  211. height: 120rpx;
  212. }
  213. .title {
  214. margin-bottom: 8rpx;
  215. text:first-child {
  216. font-size: 36rpx;
  217. color: #333;
  218. font-weight: bold;
  219. margin-bottom: 12rpx;
  220. }
  221. text:last-child {
  222. font-size: 30rpx;
  223. color: #333;
  224. }
  225. }
  226. }
  227. .content-form {
  228. background-image: url('../../static/image/h5Registr-bg.png');
  229. background-size: 100% 100%;
  230. padding: 30rpx;
  231. box-sizing: border-box;
  232. .inviteHeader {
  233. .avatar {
  234. width: 90rpx;
  235. height: 90rpx;
  236. border-radius: 50%;
  237. }
  238. text {
  239. font-size: 32rpx;
  240. color: #1F1F1F;
  241. }
  242. }
  243. .btn {
  244. margin: 40rpx 25rpx 90rpx;
  245. padding: 20rpx;
  246. box-sizing: border-box;
  247. background: #FDE935;
  248. border-radius: 45rpx 45rpx 45rpx 45rpx;
  249. font-size: 36rpx;
  250. color: #1F1F1F;
  251. font-weight: bold;
  252. }
  253. }
  254. .info {
  255. padding: 60rpx 25rpx;
  256. box-sizing: border-box;
  257. .icon-img {
  258. width: 30rpx;
  259. height: 30rpx;
  260. }
  261. }
  262. //发送验证码样式
  263. .u-page__code-text {
  264. padding: 4rpx 18rpx;
  265. background: rgba(253, 233, 53, 0.2);
  266. border-radius: 6rpx 6rpx 6rpx 6rpx;
  267. border: 1rpx solid #FDE935;
  268. color: #333333;
  269. font-size: 26rpx;
  270. }
  271. .description {
  272. font-size: 26rpx;
  273. color: #999;
  274. }
  275. </style>