register.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. <template>
  2. <view class="container register" :style="{paddingTop:CustomBar+'px'}" v-if="isWxAuthorize">
  3. <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom>
  4. <view class="register-main clearfix">
  5. <view class="register-logo">
  6. <image class="logo" src="https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/logo.png" mode=""></image>
  7. </view>
  8. <view class="register-row clearfix">
  9. <view class="register-from">
  10. <view class="label">联系人:</view>
  11. <input class="row-input" type="text" name="input" v-model="userName" placeholder="请输入机构联系人姓名" maxlength="6"/>
  12. </view>
  13. </view>
  14. <view class="register-row clearfix">
  15. <view class="register-from">
  16. <view class="label">手机号:</view>
  17. <input class="row-input" type="number" name="input" v-model="bindMobile" placeholder="请输入联系人常用手机号" maxlength="11"/>
  18. </view>
  19. </view>
  20. <view class="register-row clearfix">
  21. <view class="register-from">
  22. <view class="label">短信验证码:</view>
  23. <input class="row-input code" type="text" v-model="mobileCode" placeholder="请输入短信验证码" maxlength="6"/>
  24. <view class="row-btn" :class="[isMobileDisabled ? 'disabled' : '']">
  25. <button class="row-input"
  26. type="button"
  27. @click.stop="getMobileCodeFn"
  28. :disabled="isMobileDisabled">
  29. {{ mobileCodeText }}
  30. </button>
  31. </view>
  32. </view>
  33. </view>
  34. <view class="register-row clearfix">
  35. <view class="register-from">
  36. <view class="label">登录密码:</view>
  37. <input class="row-input" type="password" name="input" v-model="password" placeholder="密码必须为8-16位字母数字组合" maxlength="16"/>
  38. </view>
  39. </view>
  40. <view class="register-row clearfix">
  41. <view class="register-from">
  42. <view class="label">确认密码:</view>
  43. <input class="row-input" type="password" name="input" v-model="passwordCheck" placeholder="请确认密码" maxlength="16"/>
  44. </view>
  45. </view>
  46. <view class="register-main clearfix">
  47. <view class="register-agree">
  48. <view class="agree-text" @tap.stop="agreeCheck()">
  49. <button class="checkbox iconfont" :class="[isCheck?'icon-gouxuan':'icon-weigouxuan']"></button>
  50. 我已阅读并同意
  51. <text @click.stop="this.$api.navigateTo('/pages/service/organagree')">《机构协议》</text>
  52. <text @click.stop="this.$api.navigateTo('/pages/service/useragree')">《用户协议》</text>及
  53. <text @click.stop="this.$api.navigateTo('/pages/service/privacyagree')">《隐私权政策》</text>
  54. </view>
  55. </view>
  56. <view class="register-row ">
  57. <view class="register-btn sub" @click.stop="registerStepsfirst">注册</view>
  58. </view>
  59. <view class="register-row login">
  60. <view class="row-login" @click.stop="this.$api.navigateTo('/pages/login/login')">账号登录</view>
  61. <view class="row-logincode" @click.stop="this.$api.navigateTo('/pages/login/logincode')">邀请码登录</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. import { mapState,mapMutations } from 'vuex';
  69. import authorize from '@/common/config/authorize.js'
  70. import wxLogin from "@/common/config/wxLogin.js"
  71. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
  72. import { beautyList,mentuzCampNullList,medicaCampNullList } from '@/common/json/data.json.js' //本地数据
  73. import { organizationVerifyRegisterFirst } from "@/services/use.js"
  74. import { getRegisterMobileCode, uploadFileImage } from "@/services/public.js"
  75. export default{
  76. components:{
  77. mpvueCityPicker
  78. },
  79. data() {
  80. return{
  81. nvabarData: {//顶部自定义导航
  82. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  83. showSearch: 0,
  84. title: '机构注册', // 导航栏 中间的标题
  85. haveBack:true,
  86. textLeft:this.$store.state.isIphone
  87. },
  88. CustomBar:this.CustomBar,// 顶部导航栏高度
  89. isMobileDisabled: false, //手机验证码按钮控制
  90. mobilCount: '', //倒计时
  91. mobileCodeText: '获取验证码',
  92. mobilTime: null,
  93. password:'', //密码
  94. passwordCheck:'', //校验密码
  95. userName:'', //联系人
  96. bindMobile:'', //联系人手机号
  97. mobileCode:'', //手机验证码
  98. imageCode:'', //图形验证码
  99. imageCodeUrl:'', //图形验证码图片
  100. imageCodetoken:'', //图形验证校验
  101. isAgreed:0, //是否勾选协议
  102. isCheck:false, //是否勾选协议
  103. userID:'', //机构userID
  104. clubID:'', //机构ID
  105. }
  106. },
  107. onLoad(option) {
  108. },
  109. computed:{
  110. ...mapState(['isWxAuthorize'])
  111. },
  112. methods:{
  113. ...mapMutations(['login']),
  114. hanldNavigateBack(){
  115. this.$util.modal('','注册尚未完成,确定放弃注册吗?','确定','取消',true,() =>{
  116. uni.navigateBack({
  117. delta: 1
  118. });
  119. })
  120. },
  121. registerStepsfirst(){
  122. wx.getUserInfo({
  123. success: res => {
  124. let params ={
  125. source:1,
  126. userName:this.userName,
  127. bindMobile:this.bindMobile,
  128. activationCode:this.mobileCode,
  129. password:this.password,
  130. passWordConfirm:this.passwordCheck,
  131. isAgreed:this.isAgreed, //是否勾选协议
  132. nickName:res.userInfo.nickName,
  133. headimgurl:res.userInfo.avatarUrl,
  134. }
  135. organizationVerifyRegisterFirst(params).then(response =>{
  136. this.storeUpdataeStatus(response.data)
  137. wxLogin.wxLoginAuthorize()
  138. setTimeout(() =>{
  139. this.$api.switchTabTo('/pages/tabBar/user/user')
  140. },2000)
  141. }).catch(error =>{
  142. this.$util.msg(error.msg,2000);
  143. })
  144. }
  145. })
  146. },
  147. storeUpdataeStatus(data){
  148. uni.setStorageSync('token',data.token)
  149. this.$store.commit('updateStatus',data)
  150. this.login(data);
  151. },
  152. getMobileCodeFn(){
  153. if( this.bindMobile == ''){
  154. this.$util.msg('请输入手机号',2000);
  155. return
  156. }
  157. if(!this.$reg.isMobile(this.bindMobile)){
  158. this.$util.msg('请输入正确的手机号',2000);
  159. return
  160. }
  161. let params = {
  162. mobile:this.bindMobile,
  163. activateCodeType:2,
  164. platformType:2
  165. }
  166. this.isMobileDisabled = true;
  167. getRegisterMobileCode(params).then(response =>{
  168. this.$util.msg('验证短信已发送',2000);
  169. const TIME_COUNT = 60;
  170. if (!this.mobilTime) {
  171. this.mobilCount = TIME_COUNT;
  172. this.isMobileDisabled = true;
  173. this.mobilTime = setInterval(() => {
  174. if (this.mobilCount > 1 && this.mobilCount <= TIME_COUNT) {
  175. this.mobilCount--
  176. this.mobileCodeText = this.mobilCount +'s重新发送'
  177. } else {
  178. this.isMobileDisabled = false;
  179. clearInterval(this.mobilTime)
  180. this.mobilTime = null
  181. this.mobileCodeText = '获取验证码'
  182. }
  183. },1000)
  184. }
  185. }).catch( error =>{
  186. this.$util.msg(error.msg,2000);
  187. this.isMobileDisabled = false;
  188. })
  189. },
  190. agreeCheck() {
  191. this.isCheck = !this.isCheck
  192. if(this.isCheck){
  193. this.isAgreed = 1
  194. }else{
  195. this.isAgreed = 0
  196. }
  197. }
  198. },
  199. onShow() {
  200. authorize.getSetting().then(wxResponse =>{// console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  201. if(wxResponse == 1){
  202. wxLogin.wxLoginQuick()
  203. }else{
  204. this.$api.navigateTo('/pages/authorization/authorization?type=0')
  205. }
  206. })
  207. }
  208. }
  209. </script>
  210. <style lang="scss">
  211. .register{
  212. width: 100%;
  213. height: 100%;
  214. background: url(https://admin-b.caimei365.com/userfiles/1/images/photo/2020/11/%E8%83%8C%E6%99%AF.png) no-repeat left bottom;
  215. box-sizing: border-box;
  216. background-size: contain;
  217. .register-main{
  218. width: 100%;
  219. height: auto;
  220. position: relative;
  221. .register-consult{
  222. width: 110rpx;
  223. height: 68rpx;
  224. background:linear-gradient(223deg,rgba(225,86,21,0.6) 0%,rgba(225,86,10,0.3) 100%);
  225. border-radius: 34rpx 0 0 34rpx;
  226. position: absolute;
  227. right: 0;
  228. bottom: 120rpx;
  229. text-align: left;
  230. line-height: 68rpx;
  231. padding-left: 20rpx;
  232. .icon-kefunv{
  233. font-size: 48rpx;
  234. color: #31313B;
  235. float: left;
  236. }
  237. .text{
  238. font-size: $font-size-24;
  239. display: block;
  240. float: left;
  241. width: 60rpx;
  242. line-height: 30rpx;
  243. color: #FFFFFF;
  244. margin-top: 6rpx;
  245. }
  246. }
  247. .register-agree{
  248. display: flex;
  249. flex-direction: column;
  250. align-items: center;
  251. margin: 100rpx 0 20rpx 0;
  252. .agree-text{
  253. .checkbox{
  254. float: left;
  255. margin: 4rpx 6rpx 0 0;
  256. color: #999999;
  257. font-size: $font-size-34;
  258. &.icon-gouxuan{
  259. color: $color-system;
  260. }
  261. }
  262. font-size: $font-size-22;
  263. line-height: 44rpx;
  264. color: #999999;
  265. text{
  266. color:#1890f9;
  267. }
  268. }
  269. }
  270. .register-logo{
  271. width: 100%;
  272. display: flex;
  273. flex-direction: column;
  274. align-items: center;
  275. height: 189rpx;
  276. padding:60rpx 0 40rpx 0;
  277. .logo{
  278. width:467rpx;
  279. height: 189rpx;
  280. display: block;
  281. }
  282. }
  283. &.detailed{
  284. padding-bottom: 330rpx;
  285. }
  286. .register-row{
  287. width: 100%;
  288. height: auto;
  289. padding: 0 75rpx;
  290. margin-bottom: 30rpx;
  291. box-sizing: border-box;
  292. &.none{
  293. margin-bottom: 0;
  294. }
  295. &.login{
  296. display: flex;
  297. }
  298. .register-text{
  299. line-height: 44rpx;
  300. margin-top: 100rpx;
  301. font-size: $font-size-24;
  302. color: #999999;
  303. text-align: justify;
  304. .txt{
  305. margin-right: 15rpx;
  306. }
  307. }
  308. .register-title{
  309. line-height: 44rpx;
  310. font-size: $font-size-24;
  311. color: $text-color;
  312. text-align: left;
  313. &.first{
  314. margin-top: 20rpx;
  315. }
  316. }
  317. .register-tip{
  318. line-height: 64rpx;
  319. font-size: $font-size-24;
  320. color: #CECECE;
  321. text-align: left;
  322. }
  323. .register-from{
  324. width: 100%;
  325. height: 80rpx;
  326. background: #FFFFFF;
  327. position: relative;
  328. border-bottom: 1px solid #e1e1e1;
  329. .label{
  330. text-align: left;
  331. font-size: $font-size-28;
  332. color:#666666;
  333. line-height: 88rpx;
  334. float: left;
  335. }
  336. .row-input{
  337. width: 440rpx;
  338. padding-left:10rpx;
  339. font-size: $font-size-28;
  340. color: $text-color;
  341. line-height: 80rpx;
  342. float: left;
  343. height: 80rpx;
  344. &.none{
  345. color: #999999;
  346. }
  347. &.picker{
  348. text-align: left;
  349. color: #333333;
  350. }
  351. &.keshi{
  352. width: 550rpx;
  353. }
  354. &.code{
  355. width: 264rpx;
  356. }
  357. }
  358. &.img-btn{
  359. width: 220rpx;
  360. height: 80rpx;
  361. padding: 0;
  362. float: left;
  363. background: #FFFFFF;
  364. display: block;
  365. .vscodeimg{
  366. width: 150rpx;
  367. height: 80rpx;
  368. float: left;
  369. display: flex;
  370. flex-direction: column;
  371. align-items: center;
  372. border-radius: 14rpx;
  373. image{
  374. width: 150rpx;
  375. height: 80rpx;
  376. border-radius: 14rpx;
  377. }
  378. }
  379. .vscod-refresh{
  380. width: 70rpx;
  381. float: right;
  382. text-align: right;
  383. display: flex;
  384. flex-direction: column;
  385. align-items: center;
  386. line-height: 44rpx;
  387. .icon-shuaxin{
  388. font-size: 48rpx;
  389. color: #333333;
  390. }
  391. .ref-text{
  392. font-size: 24rpx;
  393. color: #333333;
  394. }
  395. }
  396. }
  397. &.imgcode{
  398. width: 410rpx;
  399. float: left;
  400. margin-right: 20rpx;
  401. .row-input{
  402. width: 230rpx;
  403. }
  404. }
  405. .row-btn{
  406. width: 180rpx;
  407. height:64rpx;
  408. float: left;
  409. background: $btn-confirm;
  410. padding: 0;
  411. border-radius: 32rpx;
  412. .row-input{
  413. width: 180rpx;
  414. height: 64rpx;
  415. line-height: 64rpx;
  416. padding: 0;
  417. color: #FFFFFF;
  418. background: $btn-confirm;
  419. text-align: center;
  420. border-radius: 32rpx;
  421. &.other{
  422. width: 180rpx;
  423. background: #F7F7F7;
  424. margin-right: 20rpx;
  425. }
  426. &.none{
  427. background: #F7F7F7;
  428. }
  429. }
  430. &.disabled{
  431. background: #F7F7F7;
  432. .row-input{
  433. background: #F7F7F7;
  434. color: #999999;
  435. }
  436. }
  437. }
  438. &.picker{
  439. padding: 0 24rpx;
  440. width: 654rpx;
  441. height: 88rpx;
  442. line-height: 88rpx;
  443. .label{
  444. line-height: 88rpx;
  445. }
  446. .row-input{
  447. width: 470rpx;
  448. height: 88rpx;
  449. line-height: 88rpx;
  450. padding-left: 30rpx;
  451. }
  452. }
  453. &.radio{
  454. padding: 0 24rpx;
  455. width: 654rpx;
  456. height: 288rpx;
  457. .row-input{
  458. width: 100%;
  459. height: 88rpx;
  460. line-height: 88rpx;
  461. padding-left: 0;
  462. }
  463. .row-radio{
  464. float: left;
  465. transform: scale(0.8);
  466. }
  467. .row-text{
  468. width: 100rpx;
  469. text-align: center;
  470. float: left;
  471. }
  472. }
  473. &.group{
  474. padding: 0 24rpx;
  475. width: 654rpx;
  476. height: auto;
  477. background: #FFFFFF;
  478. margin-top: 30rpx;
  479. .label{
  480. line-height: 76rpx;
  481. }
  482. .row-input{
  483. width: 100%;
  484. height: 88rpx;
  485. line-height: 88rpx;
  486. padding-left: 0;
  487. }
  488. .row-radio{
  489. float: left;
  490. }
  491. .row-text{
  492. width: 100rpx;
  493. text-align: center;
  494. float: left;
  495. }
  496. }
  497. &.btn{
  498. margin-top: 0;
  499. }
  500. .content-class {
  501. margin: 20rpx auto;
  502. display: flex;
  503. flex-flow: row wrap;
  504. justify-content: space-between;
  505. align-items: center;
  506. &.btn{
  507. margin: 0 auto;
  508. margin-left: 116rpx;
  509. }
  510. .row-input{
  511. display: flex;
  512. width: 220rpx;
  513. height: 40rpx;
  514. padding: 24rpx;
  515. text-align: left;
  516. border-radius: 10rpx;
  517. font-size: $font-size-28;
  518. color: $text-color;
  519. }
  520. .confirm-btn{
  521. width: 200rpx;
  522. height: 88rpx;
  523. border-radius: 10rpx;
  524. line-height: 88rpx;
  525. text-align: center;
  526. &.other{
  527. width: 213rpx;
  528. }
  529. &.none{
  530. color: #FFFFFF;
  531. background: $btn-confirm;
  532. }
  533. &.disabled{
  534. color: #999999;
  535. }
  536. }
  537. .item {
  538. width: 155rpx;
  539. height: 60rpx;
  540. font-size:$font-size-28;
  541. line-height: 60rpx;
  542. border-radius:10rpx;
  543. margin: 10rpx;
  544. text-align: center;
  545. box-sizing: border-box;
  546. border: 1rpx solid #EFEFEF;
  547. float: left;
  548. checkbox {
  549. display: none;
  550. }
  551. }
  552. .on {
  553. border-color: $color-system;
  554. color:$color-system;
  555. }
  556. }
  557. }
  558. .row-login{
  559. flex: 1;
  560. font-size: $font-size-28;
  561. color: $text-color;
  562. text-align: left;
  563. }
  564. .row-logincode{
  565. flex: 1;
  566. font-size: $font-size-28;
  567. color: $text-color;
  568. text-align: right;
  569. }
  570. .icon-xiayibu{
  571. width: 88rpx;
  572. height: 88rpx;
  573. position: absolute;
  574. right: 0;
  575. top: 0;
  576. line-height: 88rpx;
  577. text-align: center;
  578. }
  579. &.text-textarea{
  580. background: #FFFFFF;
  581. .textarea{
  582. width: 654rpx;
  583. height: 180rpx;
  584. background: #F7F7F7;
  585. padding: 24rpx;
  586. font-size: $font-size-28;
  587. color: $text-color;
  588. z-index: 1;
  589. border-radius: 14rpx;
  590. }
  591. .textarea.hide{
  592. opacity: 0;
  593. }
  594. .textarea.show{
  595. color: #999999;
  596. }
  597. }
  598. }
  599. .register-picture{
  600. height: 102rpx;
  601. margin: 30rpx 0;
  602. width: 42%;
  603. float: left;
  604. &.zz{
  605. width: 100%;
  606. }
  607. .label{
  608. float: left;
  609. font-size: $font-size-28;
  610. color: $text-color;
  611. line-height: 102rpx;
  612. width: 150rpx;
  613. text-align: right;
  614. &.zz{
  615. width: 230rpx;
  616. }
  617. }
  618. .upload-picture{
  619. float: left;
  620. height: 100rpx;
  621. .upload-none{
  622. width: 100rpx;
  623. height: 100rpx;
  624. text-align: center;
  625. line-height: 100rpx;
  626. color: #999999;
  627. border: 1px solid #999999;
  628. border-radius: 10rpx;
  629. margin: 0 20rpx;
  630. .iconfont{
  631. font-size: $font-size-28;
  632. }
  633. }
  634. .upload-image{
  635. width: 100rpx;
  636. height: 100rpx;
  637. border-radius: 10rpx;
  638. margin: 0 20rpx;
  639. position: relative;
  640. image{
  641. width: 100rpx;
  642. height: 100rpx;
  643. border-radius: 10rpx;
  644. }
  645. .upload-del{
  646. width: 40rpx;
  647. height: 40rpx;
  648. position: absolute;
  649. top: -20rpx;
  650. right: -20rpx;
  651. line-height: 40rpx;
  652. text-align: center;
  653. .iconfont{
  654. font-size: $font-size-32;
  655. color: #999999;
  656. }
  657. }
  658. }
  659. }
  660. }
  661. .register-input{
  662. width: 654rpx;
  663. height: 40rpx;
  664. padding: 24rpx;
  665. margin: 0 auto;
  666. margin-bottom: 60rpx;
  667. background: #F7F7F7;
  668. border-radius: 14rpx;
  669. .input{
  670. width: 100%;
  671. height: 100%;
  672. background: #F7F7F7;
  673. font-size: $font-size-28;
  674. line-height: 40rpx;
  675. color: #333333;
  676. border-radius: 14rpx;
  677. }
  678. }
  679. .register-fiexd{
  680. width: 100%;
  681. height: auto;
  682. position: fixed;
  683. bottom: 0;
  684. left: 0;
  685. z-index: 999;
  686. background: #FFFFFF;
  687. }
  688. .register-btn{
  689. width: 100%;
  690. height: 88rpx;
  691. border-radius: 44rpx;
  692. font-size: $font-size-28;
  693. line-height: 88rpx;
  694. color: #FFFFFF;
  695. margin: 0 auto;
  696. text-align: center;
  697. background: $btn-confirm;
  698. margin-top: 96rpx;
  699. &.none{
  700. border: 1px solid $color-system;
  701. background: #FFFFFF;
  702. color:$color-system;
  703. margin-top: 0;
  704. }
  705. &.sub{
  706. margin-top: 0;
  707. }
  708. }
  709. }
  710. }
  711. </style>