register.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. <template>
  2. <view class="container register">
  3. <view class="register-tab">
  4. <view class="nav-item" :class="{ current: tabCurrentIndex === 1 }" >
  5. 账户信息<view class="line"></view>
  6. </view>
  7. <view class="nav-item" :class="{ current: tabCurrentIndex === 2 }" >
  8. 基本信息<view class="line"></view>
  9. </view>
  10. <view class="nav-item" :class="{ current: tabCurrentIndex === 3 }" >
  11. 详细信息
  12. </view>
  13. </view>
  14. <view class="register-main clearfix" v-if="tabCurrentIndex === 1">
  15. <view class="register-row clearfix">
  16. <view class="register-from">
  17. <view class="label">邮箱:</view>
  18. <input class="row-input" type="text" v-model="registerEmail" placeholder="请输入您的常用邮箱" maxlength="30"/>
  19. </view>
  20. </view>
  21. <view class="register-row clearfix">
  22. <view class="register-from code">
  23. <view class="label">邮箱验证码:</view>
  24. <input class="row-input" type="text" v-model="regEmailCode" placeholder="请输入邮箱验证码" maxlength="6"/>
  25. </view>
  26. <view class="register-from btn" :class="[isDisabled === true ? 'disabled' : 'none']">
  27. <button class="row-input" type="button" @click.stop="getEmailCode" :disabled="isDisabled">获取验证码</button>
  28. </view>
  29. </view>
  30. <view class="register-row clearfix">
  31. <view class="register-from">
  32. <view class="label">登录密码:</view>
  33. <input class="row-input" type="password" v-model="password" placeholder="密码必须为8-16位字母数字组合" maxlength="20"/>
  34. </view>
  35. </view>
  36. <view class="register-row clearfix">
  37. <view class="register-from">
  38. <view class="label">确认密码:</view>
  39. <input class="row-input" type="password" v-model="passwordCheck" placeholder="请确认密码" maxlength="20"/>
  40. </view>
  41. </view>
  42. <view class="register-row clearfix">
  43. <view class="register-btn" @click="steps(2)">下一步</view>
  44. </view>
  45. </view>
  46. <view class="register-main clearfix" v-if="tabCurrentIndex === 2">
  47. <view class="register-row clearfix">
  48. <view class="register-from">
  49. <view class="label">机构名称:</view>
  50. <input class="row-input" type="text" v-model="clubName" placeholder="请输入您的机构名称" maxlength="30"/>
  51. </view>
  52. </view>
  53. <view class="register-row clearfix">
  54. <view class="register-from">
  55. <view class="label">联系人:</view>
  56. <input class="row-input" type="text" v-model="clubContact" placeholder="请输入联系姓名" maxlength="6"/>
  57. </view>
  58. </view>
  59. <view class="register-row clearfix">
  60. <view class="register-from">
  61. <view class="label">手机号:</view>
  62. <input class="row-input" type="number" v-model="registerEmail" placeholder="请输入手机号" maxlength="11"/>
  63. </view>
  64. </view>
  65. <view class="register-row clearfix">
  66. <view class="register-from imgcode">
  67. <view class="label">图形验证码:</view>
  68. <input class="row-input" type="text" v-model="regEmailCode" placeholder="请输入图形验证码" maxlength="6"/>
  69. </view>
  70. <view class="register-from img-btn">
  71. <view class="vscodeimg">
  72. <image src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2158189919,2752757953&fm=26&gp=0.jpg" mode=""></image>
  73. </view>
  74. <view class="vscod-refresh">
  75. <text class="iconfont icon-shuaxin"></text>
  76. <text class="ref-text">刷新</text>
  77. </view>
  78. </view>
  79. </view>
  80. <view class="register-row clearfix">
  81. <view class="register-from code">
  82. <view class="label">短信验证码:</view>
  83. <input class="row-input" type="text" v-model="regEmailCode" placeholder="请输入短信验证码" maxlength="6"/>
  84. </view>
  85. <view class="register-from btn" :class="[isDisabled === true ? 'disabled' : 'none']">
  86. <button class="row-input" type="button" @click.stop="getEmailCode" :disabled="isDisabled">获取验证码</button>
  87. </view>
  88. </view>
  89. <view class="register-row clearfix">
  90. <view class="register-btn" @click="steps(3)">下一步</view>
  91. </view>
  92. <view class="register-row clearfix">
  93. <view class="register-btn none" @click="steps(1)">上一步</view>
  94. </view>
  95. </view>
  96. <view class="register-main detailed clearfix" v-if="tabCurrentIndex === 3">
  97. <view class="register-tips"><text class="iconfont icon-gantanhao-yuankuang">详细信息请尽量填写,有利于快速审核通过</text></view>
  98. <view class="register-row clearfix">
  99. <view class="register-from">
  100. <view class="label">机构简称:</view>
  101. <input class="row-input" type="text" v-model="clubContact" placeholder="请输入您的机构简称" maxlength="16"/>
  102. </view>
  103. </view>
  104. <view class="register-row clearfix">
  105. <view class="register-from" @click="showMulLinkageThreePicker">
  106. <view class="label">机构地址:</view>
  107. <text class="row-input" :class="addressData.address === '请选择机构所在地区' ? 'none' : ''">
  108. {{addressData.address}}
  109. </text>
  110. <text class="iconfont icon-xiayibu"></text>
  111. </view>
  112. </view>
  113. <view class="register-row text-textarea clearfix">
  114. <view class="textarea show" v-if="isShowInput">{{addressData.addressDetail ? addressData.addressDetail :'详细地址:如道路、门牌号、小区等'}}</view>
  115. <textarea v-else
  116. class="textarea"
  117. type="text"
  118. v-model="addressData.addressDetail"
  119. placeholder="详细地址:如道路、门牌号、小区等"
  120. placeholder-class="placeholder"
  121. maxlength="50"
  122. @input="onTextareaInput"
  123. :class="isShowInput ? '':''"
  124. />
  125. </view>
  126. <view class="register-row clearfix">
  127. <view class="register-from">
  128. <view class="label">营业执照编号:</view>
  129. <input class="row-input" type="text" v-model="clubContact" placeholder="请填写社会统一信用代码" maxlength="16"/>
  130. </view>
  131. </view>
  132. <view class="register-row clearfix">
  133. <view class="register-picture">
  134. <view class="label">营业执照:</view>
  135. <view class="upload-picture">
  136. <view class="upload-none" v-if="uploadBusinessImage === ''" @click="chooseBusinessImage"><text class="iconfont icon-jiahao"></text></view>
  137. <view class="upload-image" v-else>
  138. <image :src="uploadBusinessImage" mode="" @click="viewBusinessImage"></image>
  139. <view class="upload-del" @click="delBusinessImage">
  140. <text class='iconfont icon-shanchu1'></text>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="register-row clearfix">
  147. <view class="register-picture">
  148. <view class="label">门头照:</view>
  149. <view class="upload-picture">
  150. <view class="upload-none" v-if="uploadMentuzImage === ''" @click="chooseMentuzImage"><text class="iconfont icon-jiahao"></text></view>
  151. <view class="upload-image" v-else>
  152. <image :src="uploadMentuzImage" mode="" @click="viewMentuzImage"></image>
  153. <view class="upload-del" @click="delMentuzImage">
  154. <text class='iconfont icon-shanchu1'></text>
  155. </view>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. <view class="register-fiexd clearfix">
  161. <view class="register-agree">
  162. <view class="agree-text" @tap.stop="agreeCheck()">
  163. <button class="checkbox iconfont" :class="[isCheck?'icon-gouxuan':'icon-weigouxuan']"></button>
  164. 我已阅读并同意<text>《机构协议》</text><text>《用户协议》</text>及<text>《隐私权政策》</text>
  165. </view>
  166. </view>
  167. <view class="register-row">
  168. <view class="register-btn sub">提交审核</view>
  169. </view>
  170. <view class="register-row clearfix">
  171. <view class="register-btn none" @click="steps(2)">上一步</view>
  172. </view>
  173. </view>
  174. <mpvue-city-picker :themeColor="themeColor"
  175. ref="mpvueCityPicker"
  176. :pickerValueDefault="cityPickerValueDefault"
  177. @onCancel="onCancel"
  178. @onConfirm="onConfirm">
  179. </mpvue-city-picker>
  180. </view>
  181. </view>
  182. </template>
  183. <script>
  184. import { mapMutations } from 'vuex';
  185. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
  186. import authorize from '@/common/config/authorize.js'
  187. import URLCONFIG from '@/common/config/config.js'
  188. var self;
  189. export default{
  190. components:{
  191. mpvueCityPicker
  192. },
  193. data() {
  194. return{
  195. isDisabled:true,
  196. tabCurrentIndex:3,
  197. isShowInput:false,
  198. isCheck:false, //是否全选
  199. uploadBusinessImage:'',
  200. uploadMentuzImage:'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1431188283,1203112303&fm=26&gp=0.jpg',
  201. invitationCode:'', //获取用户登录的邀请码
  202. isToast:false, //控制显示未输入邀请码提示
  203. isUserInfo:false, //控制显示授权弹窗
  204. nickName:'', //存储用户名
  205. userInfo:'', //存储微信用户授权信息
  206. isSuccess:false,
  207. toestText:'',
  208. telPhone:'',
  209. registerType:'', //跳转类型
  210. alertText:'',
  211. listType: '',
  212. listVal: '',
  213. detilType:'',
  214. id:'',//商品ID
  215. addressData:{
  216. addressID:'',
  217. address:'请选择机构所在地区',
  218. userID: '', //用户id ,只在新增收货地址时传
  219. shouHuoRen: '', //收货人
  220. mobile:'', //收货人手机
  221. townID:'', //区ID
  222. addressDetail: '', //地址
  223. defaultFlag:0, //是否默认收货地址(0 不是默认,1 默认)
  224. },
  225. }
  226. },
  227. onLoad(option) {
  228. console.log(option)
  229. self = this;
  230. self.registerType = option.type;
  231. self.id = option.id
  232. if(option.listType) {
  233. self.listType = option.listType;
  234. self.listVal = option.listVal;
  235. }
  236. },
  237. methods:{
  238. ...mapMutations(['register']),
  239. goregister() {
  240. self.$api.get('/register/isEnabled',{userOrganizeID:self.userOrganizeID,invitationCode:self.invitationCode}, res => {
  241. if (res.code == "1") {
  242. //查看此微信用户是否已经授权过
  243. authorize.getSetting().then(res =>{
  244. // console.log('是否已授权',res);//0:为取消授权 1:为已授权 2:为未操作
  245. if(res == 2){
  246. self.isUserInfo = true
  247. }else{
  248. self.isUserInfo = false
  249. self.wxGetUserInfo()
  250. }
  251. })
  252. }else if(res.code =='0'){
  253. self.toestText ='请输入邀请码';
  254. self.alertText ='邀请码';
  255. self.telPhone = res.msg;
  256. self.isToast = true;
  257. }else if(res.code =='-2'){
  258. self.toestText ='邀请码已失效';
  259. self.alertText ='新邀请码';
  260. self.telPhone = res.msg;
  261. self.isToast = true;
  262. }else if(res.code =='-3'){
  263. self.toestText ='邀请码已被使用';
  264. self.alertText ='新邀请码';
  265. self.telPhone = res.msg;
  266. self.isToast = true;
  267. }else{
  268. uni.showToast({icon:'none', title: res.msg, duration: 3000});
  269. self.isUserInfo = false
  270. }
  271. })
  272. },
  273. // 三级联动选择
  274. showMulLinkageThreePicker() {
  275. this.isShowInput = true
  276. this.$refs.mpvueCityPicker.show()
  277. },
  278. onConfirm(e) {
  279. // console.log('地址',e);
  280. this.addressData.address = e.name;
  281. this.addressData.townID = e.cityCode;
  282. },
  283. onTextareaInput(e){
  284. this.addressData.addressDetail = e.detail.value;
  285. // console.log(this.addressData.addressDetail)
  286. },
  287. chooseBusinessImage() {
  288. let self = this;
  289. uni.chooseImage({
  290. count: 1, //默认1
  291. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  292. sourceType: ['album','camera'], //从相册选择
  293. success: (res) => {
  294. const tempFilePaths = res.tempFilePaths;
  295. const uploadTask = uni.uploadFile({
  296. url : 'https://mall-b.caimei365.com/formData/MultiPictareaddData',
  297. filePath: tempFilePaths[0],
  298. name: 'file',
  299. formData: {
  300. 'user': 'test'
  301. },
  302. success: function (data) {
  303. console.log(data.data);
  304. this.uploadBusinessImage = res.tempFilePaths
  305. },
  306. error : function(e){
  307. console.log(e);
  308. }
  309. })
  310. },
  311. })
  312. },
  313. chooseMentuzImage() {
  314. let self = this;
  315. uni.chooseImage({
  316. count: 1, //默认1
  317. sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
  318. sourceType: ['album','camera'], //从相册选择
  319. success: (res) => {
  320. const tempFilePaths = res.tempFilePaths;
  321. const uploadTask = uni.uploadFile({
  322. url : 'https://mall-b.caimei365.com/formData/MultiPictareaddData',
  323. filePath: tempFilePaths[0],
  324. name: 'file',
  325. formData: {
  326. 'user': 'test'
  327. },
  328. success: function (res) {
  329. console.log(res.data);
  330. this.uploadMentuzImage = res.data
  331. },
  332. error : function(e){
  333. console.log(e);
  334. }
  335. })
  336. }
  337. });
  338. },
  339. viewMentuzImage(e) {
  340. let self = this
  341. uni.previewImage({
  342. urls: self.uploadMentuzImage,
  343. current: e.currentTarget.dataset.url
  344. });
  345. },
  346. viewBusinessImage(e) {
  347. let self = this
  348. uni.previewImage({
  349. urls: self.uploadBusinessImage,
  350. current: e.currentTarget.dataset.url
  351. });
  352. },
  353. delBusinessImage(){
  354. this.uploadBusinessImage = ''
  355. },
  356. delMentuzImage(){
  357. this.uploadMentuzImage = ''
  358. },
  359. agreeCheck() {
  360. this.isCheck = !this.isCheck
  361. },
  362. steps(index) {//tab切换
  363. console.log(index)
  364. this.tabCurrentIndex = index;
  365. }
  366. }
  367. }
  368. </script>
  369. <style lang="scss">
  370. .register{
  371. width: 100%;
  372. height: auto;
  373. .model-warp.none{
  374. display: none;
  375. }
  376. .model-warp.show{
  377. display: block;
  378. }
  379. .register-tab{
  380. width: 570rpx;
  381. height: 60rpx;
  382. padding: 60rpx 90rpx;
  383. border-top: 1px solid #F7F7F7;
  384. position: relative;
  385. .nav-item{
  386. width: 142rpx;
  387. background: #FFFFFF;
  388. line-height: 60rpx;
  389. border-radius: 30rpx;
  390. text-align: center;
  391. color: #999999;
  392. font-size:$font-size-sb;
  393. float: left;
  394. margin-right: 72rpx;
  395. position: relative;
  396. .line{
  397. height: 3rpx;
  398. width: 50rpx;
  399. background: #999999;
  400. position: absolute;
  401. right: -58rpx;
  402. top: 32rpx;
  403. }
  404. &:last-child{
  405. margin-right: 0;
  406. }
  407. &.current{
  408. color:#FFFFFF;
  409. background: $color-system;
  410. }
  411. }
  412. }
  413. .register-main{
  414. width: 100%;
  415. height: auto;
  416. &.detailed{
  417. padding-bottom: 300rpx;
  418. }
  419. .register-tips{
  420. display: flex;
  421. flex-direction: column;
  422. align-items: center;
  423. line-height: 44rpx;
  424. font-size: $font-size-sm;
  425. color: #FF0000;
  426. margin-bottom: 40rpx;
  427. }
  428. .register-row{
  429. width: 702rpx;
  430. height: auto;
  431. padding: 0 24rpx;
  432. margin-bottom: 20rpx;
  433. .register-from{
  434. width: 654rpx;
  435. height: 40rpx;
  436. padding: 24rpx;
  437. background: $sub-bg-color;
  438. border-radius: 14rpx;
  439. .label{
  440. text-align: left;
  441. font-size: $font-size-base;
  442. color: $text-color;
  443. line-height: 40rpx;
  444. float: left;
  445. }
  446. .row-input{
  447. width: 440rpx;
  448. padding-left:10rpx;
  449. font-size: $font-size-base;
  450. color: $text-color;
  451. line-height: 40rpx;
  452. float: left;
  453. &.none{
  454. color: #999999;
  455. }
  456. }
  457. &.img-btn{
  458. width: 220rpx;
  459. height: 88rpx;
  460. padding: 0;
  461. float: left;
  462. background: #FFFFFF;
  463. display: block;
  464. .vscodeimg{
  465. width: 150rpx;
  466. height: 88rpx;
  467. float: left;
  468. display: flex;
  469. flex-direction: column;
  470. align-items: center;
  471. border-radius: 14rpx;
  472. image{
  473. width: 150rpx;
  474. height: 88rpx;
  475. border-radius: 14rpx;
  476. }
  477. }
  478. .vscod-refresh{
  479. width: 70rpx;
  480. float: right;
  481. text-align: right;
  482. display: flex;
  483. flex-direction: column;
  484. align-items: center;
  485. line-height: 44rpx;
  486. .icon-shuaxin{
  487. font-size: 48rpx;
  488. color: #333333;
  489. }
  490. .ref-text{
  491. font-size: 24rpx;
  492. color: #333333;
  493. }
  494. }
  495. }
  496. &.imgcode{
  497. width: 410rpx;
  498. float: left;
  499. margin-right: 20rpx;
  500. .row-input{
  501. width: 230rpx;
  502. }
  503. }
  504. &.code{
  505. width: 410rpx;
  506. float: left;
  507. margin-right: 20rpx;
  508. .row-input{
  509. width: 230rpx;
  510. }
  511. }
  512. &.btn{
  513. width: 176rpx;
  514. float: left;
  515. .row-input{
  516. width: 176rpx;
  517. padding: 0;
  518. background: #F7F7F7;
  519. text-align: center;
  520. }
  521. &.none{
  522. background: $color-system;
  523. .row-input{
  524. color: #FFFFFF;
  525. background: $color-system;
  526. }
  527. }
  528. &.disabled{
  529. .row-input{
  530. color: #999999;
  531. }
  532. }
  533. }
  534. }
  535. .icon-xiayibu{
  536. float: right;
  537. }
  538. &.text-textarea{
  539. background: #FFFFFF;
  540. .textarea{
  541. width: 654rpx;
  542. height: 180rpx;
  543. background: #F7F7F7;
  544. padding: 24rpx;
  545. font-size: $font-size-base;
  546. color: $text-color;
  547. z-index: 1;
  548. border-radius: 14rpx;
  549. }
  550. .textarea.hide{
  551. opacity: 0;
  552. }
  553. .textarea.show{
  554. color: #999999;
  555. }
  556. }
  557. }
  558. .register-picture{
  559. height: 102rpx;
  560. margin: 30rpx 0 0 0;
  561. .label{
  562. float: left;
  563. font-size: $font-size-base;
  564. color: $text-color;
  565. line-height: 102rpx;
  566. width: 120rpx;
  567. text-align: right;
  568. }
  569. .upload-picture{
  570. float: left;
  571. height: 100rpx;
  572. .upload-none{
  573. width: 100rpx;
  574. height: 100rpx;
  575. text-align: center;
  576. line-height: 100rpx;
  577. color: #999999;
  578. border: 1px solid #999999;
  579. border-radius: 10rpx;
  580. margin: 0 20rpx;
  581. .iconfont{
  582. font-size: $font-size-lg;
  583. }
  584. }
  585. .upload-image{
  586. width: 100rpx;
  587. height: 100rpx;
  588. border-radius: 10rpx;
  589. margin: 0 20rpx;
  590. position: relative;
  591. image{
  592. width: 100rpx;
  593. height: 100rpx;
  594. border-radius: 10rpx;
  595. }
  596. .upload-del{
  597. width: 40rpx;
  598. height: 40rpx;
  599. position: absolute;
  600. top: -20rpx;
  601. right: -20rpx;
  602. line-height: 40rpx;
  603. text-align: center;
  604. .iconfont{
  605. font-size: $font-size-base;
  606. color: #999999;
  607. }
  608. }
  609. }
  610. }
  611. }
  612. .register-input{
  613. width: 654rpx;
  614. height: 40rpx;
  615. padding: 24rpx;
  616. margin: 0 auto;
  617. margin-bottom: 60rpx;
  618. background: #F7F7F7;
  619. border-radius: 14rpx;
  620. .input{
  621. width: 100%;
  622. height: 100%;
  623. background: #F7F7F7;
  624. font-size: $font-size-base;
  625. line-height: 40rpx;
  626. color: #333333;
  627. border-radius: 14rpx;
  628. }
  629. }
  630. .register-fiexd{
  631. width: 100%;
  632. height: auto;
  633. // position: fixed;
  634. // bottom: 0;
  635. // left: 0;
  636. background: #FFFFFF;
  637. .register-agree{
  638. display: flex;
  639. flex-direction: column;
  640. align-items: center;
  641. margin: 32rpx 0;
  642. .agree-text{
  643. .checkbox{
  644. float: left;
  645. margin: 4rpx 6rpx 0 0;
  646. color: #999999;
  647. font-size: $font-size-lg;
  648. &.icon-gouxuan{
  649. color: $color-system;
  650. }
  651. }
  652. font-size: 20rpx;
  653. line-height: 44rpx;
  654. color: #999999;
  655. text{
  656. color:#0091FF;
  657. }
  658. }
  659. }
  660. }
  661. .register-btn{
  662. width: 702rpx;
  663. height: 88rpx;
  664. border-radius: 14rpx;
  665. font-size: $font-size-base;
  666. line-height: 88rpx;
  667. color: #FFFFFF;
  668. margin: 0 auto;
  669. text-align: center;
  670. background: $btn-confirm;
  671. margin-top: 96rpx;
  672. &.none{
  673. background: #FFFFFF;
  674. color: $text-color;
  675. margin-top: 0;
  676. }
  677. &.sub{
  678. margin-top: 0;
  679. }
  680. }
  681. }
  682. }
  683. </style>