register.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  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" name="input" 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" name="input" v-model="regEmailCode" placeholder="请输入邮箱验证码" maxlength="4"/>
  25. </view>
  26. <view class="register-from btn" :class="[isEmialDisabled ? 'disabled' : '']">
  27. <button class="row-input"
  28. type="button"
  29. @click.stop="getEmailCodeFn"
  30. :disabled="isEmialDisabled">
  31. {{ emailCodeText }}
  32. </button>
  33. </view>
  34. </view>
  35. <view class="register-row clearfix">
  36. <view class="register-from">
  37. <view class="label">登录密码:</view>
  38. <input class="row-input" type="password" name="input" v-model="password" placeholder="密码必须为8-16位字母数字组合" maxlength="16"/>
  39. </view>
  40. </view>
  41. <view class="register-row clearfix">
  42. <view class="register-from">
  43. <view class="label">确认密码:</view>
  44. <input class="row-input" type="password" name="input" v-model="passwordCheck" placeholder="请确认密码" maxlength="16"/>
  45. </view>
  46. </view>
  47. <view class="register-row clearfix">
  48. <view class="register-btn" @click="registerStepsfirst">下一步</view>
  49. </view>
  50. <view class="register-row">
  51. <view class="register-text">
  52. <text class="txt">注:</text>
  53. <text>邮件可能存在1-2分钟的延迟,同时请留意垃圾箱邮件!</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="register-main clearfix" v-if="tabCurrentIndex === 2">
  58. <view class="register-row clearfix">
  59. <view class="register-from">
  60. <view class="label">机构名称:</view>
  61. <input class="row-input" type="text" name="input" v-model="clubName" placeholder="请输入您的机构名称" maxlength="30"/>
  62. </view>
  63. </view>
  64. <view class="register-row clearfix">
  65. <view class="register-from">
  66. <view class="label">联系人:</view>
  67. <input class="row-input" type="text" name="input" v-model="clubContact" placeholder="请输入联系姓名" maxlength="6"/>
  68. </view>
  69. </view>
  70. <view class="register-row clearfix">
  71. <view class="register-from">
  72. <view class="label">手机号:</view>
  73. <input class="row-input" type="number" name="input" v-model="registerMobile" placeholder="请输入手机号" maxlength="11"/>
  74. </view>
  75. </view>
  76. <view class="register-row clearfix">
  77. <view class="register-from imgcode">
  78. <view class="label">图形验证码:</view>
  79. <input class="row-input" type="text" name="input" v-model="imageCode" placeholder="请输入图形验证码" maxlength="4"/>
  80. </view>
  81. <view class="register-from img-btn">
  82. <view class="vscodeimg">
  83. <image :src="imageCodeUrl" mode=""></image>
  84. </view>
  85. <view class="vscod-refresh" @click.stop="getVerificationCode">
  86. <text class="iconfont icon-shuaxin"></text>
  87. <text class="ref-text">刷新</text>
  88. </view>
  89. </view>
  90. </view>
  91. <view class="register-row clearfix">
  92. <view class="register-from code">
  93. <view class="label">短信验证码:</view>
  94. <input class="row-input" type="text" v-model="mobileCode" placeholder="请输入短信验证码" maxlength="6"/>
  95. </view>
  96. <view class="register-from btn" :class="[isMobileDisabled ? 'disabled' : '']" >
  97. <button class="row-input"
  98. type="button"
  99. @click.stop="getMobileCodeFn"
  100. :disabled="isMobileDisabled">
  101. {{ mobileCodeText }}
  102. </button>
  103. </view>
  104. </view>
  105. <view class="register-row clearfix">
  106. <view class="register-btn" @click="registerStepsTwo">下一步</view>
  107. </view>
  108. <view class="register-row clearfix">
  109. <view class="register-btn none" @click="steps(1)">上一步</view>
  110. </view>
  111. </view>
  112. <view class="register-main detailed clearfix" v-if="tabCurrentIndex === 3">
  113. <view class="register-tips"><text class="iconfont icon-gantanhao-yuankuang">详细信息请尽量填写,有利于快速审核通过</text></view>
  114. <view class="register-row clearfix">
  115. <view class="register-from">
  116. <view class="label">机构简称:</view>
  117. <input class="row-input" type="text" v-model="abbreviation" placeholder="请输入您的机构简称" maxlength="10"/>
  118. </view>
  119. </view>
  120. <view class="register-row clearfix">
  121. <view class="register-from" @click="showMulLinkageThreePicker">
  122. <view class="label">机构地址:</view>
  123. <text class="row-input" :class="addressData.address === '请选择机构所在地区' ? 'none' : ''">
  124. {{addressData.address}}
  125. </text>
  126. <text class="iconfont icon-xiayibu"></text>
  127. </view>
  128. </view>
  129. <view class="register-row text-textarea clearfix">
  130. <view class="textarea show" v-if="isShowInput">{{addressData.addressDetail ? addressData.addressDetail :'详细地址:如道路、门牌号、小区等'}}</view>
  131. <textarea v-else
  132. class="textarea"
  133. type="text"
  134. v-model="addressData.addressDetail"
  135. placeholder="详细地址:如道路、门牌号、小区等"
  136. placeholder-class="placeholder"
  137. maxlength="25"
  138. @input="onTextareaInput"
  139. :class="isShowInput ? '':''"
  140. />
  141. </view>
  142. <view class="register-row clearfix" >
  143. <view class="register-from">
  144. <view class="label">营业执照编号:</view>
  145. <input class="row-input" type="text" v-model="socialCreditCode" placeholder="请填写社会统一信用代码" maxlength="16"/>
  146. </view>
  147. </view>
  148. <view class="register-row clearfix">
  149. <view class="register-picture">
  150. <view class="label">营业执照:</view>
  151. <view class="upload-picture">
  152. <view class="upload-none" v-if="uploadBusinessImage === ''" @click="chooseBusinessImage"><text class="iconfont icon-jiahao"></text></view>
  153. <view class="upload-image" v-else>
  154. <image :src="uploadBusinessImage" mode="" @click="viewBusinessImage"></image>
  155. <view class="upload-del" @click="delBusinessImage">
  156. <text class='iconfont icon-shanchu1'></text>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. <view class="register-row clearfix">
  163. <view class="register-picture">
  164. <view class="label">门头照:</view>
  165. <view class="upload-picture">
  166. <view class="upload-none" v-if="uploadMentuzImage === ''" @click="chooseMentuzImage"><text class="iconfont icon-jiahao"></text></view>
  167. <view class="upload-image" v-else>
  168. <image :src="uploadMentuzImage" mode="" @click="viewMentuzImage"></image>
  169. <view class="upload-del" @click="delMentuzImage">
  170. <text class='iconfont icon-shanchu1'></text>
  171. </view>
  172. </view>
  173. </view>
  174. </view>
  175. </view>
  176. <view class="register-row clearfix">
  177. <view class="register-from picker">
  178. <view class="label">机构类型:</view>
  179. <view class="row-input picker" @click="bindPickerChange">{{ organizationTypeText }}</view>
  180. <!-- <picker @change="bindPickerChange" :value="index" :range="organizationTypeList" range-key="name">
  181. <view class="row-input" :class="[isOrganizationType == 0 ? 'none' : '']">{{organizationTypeList[typtIndex].name}}</view>
  182. </picker> -->
  183. <text class="iconfont icon-xiayibu"></text>
  184. </view>
  185. </view>
  186. <view class="register-row clearfix" v-if="isOrganizationType == 1" >
  187. <view class="register-from radio">
  188. <radio-group @change="radioChange">
  189. <label class="row-input" v-for="(item, index) in beautyList" :key="item.value">
  190. <radio class="row-radio" :value="item.value" :checked="index === current" color="#E15616"/>
  191. <view class="row-text">{{item.name}}</view>
  192. </label>
  193. </radio-group>
  194. </view>
  195. </view>
  196. <view class="register-row clearfix" v-show="isDepartment" >
  197. <view class="register-from">
  198. <view class="label">科室:</view>
  199. <input class="row-input keshi" type="text" v-model="department" placeholder="请填写经营的科室,至少三个,用逗号隔开" maxlength="16"/>
  200. </view>
  201. </view>
  202. <view class="register-row clearfix" v-if="isOrganizationType == 1">
  203. <view class="register-picture">
  204. <view class="label zz">医疗执业许可证:</view>
  205. <view class="upload-picture">
  206. <view class="upload-none" v-if="uploadMedicalImage === ''" @click="chooseMedicalImage"><text class="iconfont icon-jiahao"></text></view>
  207. <view class="upload-image" v-else>
  208. <image :src="uploadMedicalImage" mode="" @click="viewMedicalImage"></image>
  209. <view class="upload-del" @click="delMedicalImage">
  210. <text class='iconfont icon-shanchu1'></text>
  211. </view>
  212. </view>
  213. </view>
  214. </view>
  215. </view>
  216. <view class="register-row clearfix" v-if="isOrganizationType == 1">
  217. <view class="register-from group">
  218. <view class="label">主营内容:</view>
  219. <checkbox-group class="content-class" @change="chooseMaleLike" >
  220. <label class="item" v-for="(item, index) in mentuzCampList" :key="index" :class="{on: item.checked}">
  221. <checkbox :value="item.value"></checkbox>
  222. <text class="item-text">{{item.name}}</text>
  223. </label>
  224. </checkbox-group>
  225. </view>
  226. <view class="register-from group btn">
  227. <view class="content-class btn">
  228. <view class="item" @click="showAustomItem">
  229. <text class="item-text">其他</text>
  230. </view>
  231. </view>
  232. </view>
  233. <view class="register-from group btn" v-show="isShowAustomItem">
  234. <view class="content-class btn">
  235. <input class="row-input other" type="text" v-model="customItemValue" placeholder="请输入自定义项目" @blur="onBlurInput" maxlength="5"/>
  236. <button type="default"
  237. class="confirm-btn other"
  238. :class="[isDisabled === true ? 'disabled' : 'none']"
  239. :disabled="isDisabled"
  240. @click.stop="addCustomItem"
  241. >确认添加</button>
  242. </view>
  243. </view>
  244. </view>
  245. <view class="register-row clearfix" v-if="isOrganizationType == 2">
  246. <view class="register-from group">
  247. <view class="label">主营内容:</view>
  248. <checkbox-group class="content-class" @change="chooseMaleLikes">
  249. <label class="item" v-for="(item, index) in medicaCampList" :key="index" :class="{on: item.checked}">
  250. <checkbox :value="item.value"></checkbox>
  251. <text class="item-text">{{item.name}}</text>
  252. </label>
  253. </checkbox-group>
  254. </view>
  255. <view class="register-from group btn">
  256. <view class="content-class btn">
  257. <view class="item" @click="showAustomItem">
  258. <text class="item-text">其他</text>
  259. </view>
  260. </view>
  261. </view>
  262. <view class="register-from group btn" v-show="isShowAustomItem">
  263. <view class="content-class btn">
  264. <input class="row-input other" type="text" v-model="customItemValue" placeholder="请输入自定义项目" @blur="onBlurInput" maxlength="5"/>
  265. <button type="default"
  266. class="confirm-btn"
  267. :class="[isDisabled === true ? 'disabled' : 'none']"
  268. :disabled="isDisabled"
  269. @click.stop="addCustomItem"
  270. >确认添加</button>
  271. </view>
  272. </view>
  273. </view>
  274. <view class="register-fiexd clearfix">
  275. <view class="register-agree">
  276. <view class="agree-text" @tap.stop="agreeCheck()">
  277. <button class="checkbox iconfont" :class="[isCheck?'icon-gouxuan':'icon-weigouxuan']"></button>
  278. 我已阅读并同意
  279. <text @click.stop="this.$api.navigateTo('/pages/service/organagree')">《机构协议》</text>
  280. <text @click.stop="this.$api.navigateTo('/pages/service/useragree')">《用户协议》</text>及
  281. <text @click.stop="this.$api.navigateTo('/pages/service/privacyagree')">《隐私权政策》</text>
  282. </view>
  283. </view>
  284. <view class="register-row ">
  285. <view class="register-btn sub" @click.stop="registerStepsSub">提交审核</view>
  286. </view>
  287. <view class="register-row clearfix">
  288. <view class="register-btn none" @click="steps(2)">上一步</view>
  289. </view>
  290. </view>
  291. <mpvue-city-picker :themeColor="themeColor"
  292. ref="mpvueCityPicker"
  293. :pickerValueDefault="cityPickerValueDefault"
  294. @onCancel="onCancel"
  295. @onConfirm="onConfirm">
  296. </mpvue-city-picker>
  297. </view>
  298. </view>
  299. </template>
  300. <script>
  301. import { mapMutations } from 'vuex';
  302. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
  303. import authorize from '@/common/config/authorize.js'
  304. import { organizationRegister , organizationVerifyRegisterFirst ,organizationVerifyRegisterTwo } from "@/api/use.js"
  305. import { getImageCode, getEmailCode, getMobileCode, uploadFileImage } from "@/api/utils.js"
  306. var self;
  307. export default{
  308. components:{
  309. mpvueCityPicker
  310. },
  311. data() {
  312. return{
  313. nvabarData: { //顶部自定义导航
  314. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  315. showSearch: 0,
  316. title: '注册', // 导航栏 中间的标题
  317. },
  318. CustomBar:this.CustomBar,// 顶部导航栏高度
  319. tabCurrentIndex:1, //显示step
  320. isPreviewImage:false, //预览图片开关
  321. isEmialDisabled: false, //验证码按钮控制
  322. isMobileDisabled: false, //手机验证码按钮控制
  323. count: '', //倒计时
  324. emailCodeText: '获取验证码',
  325. mobileCodeText: '获取验证码',
  326. codeTime: null,
  327. registerEmail:'', //注册邮箱
  328. regEmailCode:'', //邮箱验证码
  329. password:'', //密码
  330. passwordCheck:'', //校验密码
  331. clubName:'', //机构名称
  332. abbreviation:'', //机构简称
  333. clubContact:'', //联系人
  334. registerMobile:'', //联系人手机号
  335. mobileCode:'', //手机验证码
  336. imageCode:'', //图形验证码
  337. imageCodeUrl:'', //图形验证码图片
  338. imageCodetoken:'', //图形验证校验
  339. socialCreditCode:'', //统一社会信用代码
  340. isAgreed:0, //是否勾选协议
  341. isDisabled:true,
  342. isShowInput:false,
  343. isCheck:false, //是否勾选协议
  344. uploadBusinessImage:'', //营业执照图片
  345. uploadMentuzImage:'', //门头照图片
  346. uploadMedicalImage:'', //资质照图片
  347. department:'', //科室
  348. isDepartment:false, //是否显示科室
  349. secondClubType:'', //机构类型二级分类
  350. mainpro:'', //主营内容
  351. isOrganizationType:0,
  352. organizationTypeText:'请选择机构类型',
  353. beautyList:[{value:'1',name:'诊所'},{value:'2',name:'门诊'},{value:'3',name:'医院'}],
  354. mentuzCampList:[{value:'1',name:'整形'},{value:'2',name:'轻医美'},{value:'3',name:'皮肤科'}],
  355. medicaCampList:[
  356. {value:'1',name:'美容'},
  357. {value:'2',name:'美体'},
  358. {value:'3',name:'美发'},
  359. {value:'4',name:'皮肤管理'},
  360. {value:'5',name:'光电'},
  361. {value:'6',name:'综合类'},
  362. {value:'7',name:'中医养生'},
  363. {value:'8',name:'spa'}
  364. ],
  365. typtIndex:0,
  366. organizationType:3,
  367. current:0,
  368. isShowAustomItem:false, //是否显示其他添加
  369. customItemValue:'', //自定义项目
  370. addressData:{
  371. address:'请选择机构所在地区',
  372. townID:'', //区ID
  373. cityID:'', //区ID
  374. provinceID:'', //区ID
  375. addressDetail: '', //地址
  376. },
  377. }
  378. },
  379. onLoad(option) {
  380. console.log(option)
  381. },
  382. methods:{
  383. hanldNavigateBack(){
  384. this.$util.modal('','注册尚未完成,确定放弃注册吗?','确定','取消',true,() =>{
  385. uni.navigateBack({
  386. delta: 1
  387. });
  388. })
  389. },
  390. registerStepsfirst(){
  391. let params ={
  392. email:this.registerEmail,
  393. mailboxCode:this.regEmailCode,
  394. password:this.password,
  395. passWordConfirm:this.passwordCheck,
  396. whichStep:1,
  397. }
  398. organizationVerifyRegisterFirst(params).then(res =>{
  399. console.log(res)
  400. this.tabCurrentIndex = 2
  401. this.getVerificationCode()
  402. }).catch(res =>{
  403. this.$util.msg(res.msg,2000);
  404. })
  405. },
  406. registerStepsTwo(){
  407. let params ={
  408. name:this.clubName,
  409. linkMan:this.clubContact,
  410. bindMobile:this.registerMobile,
  411. activationCode:this.mobileCode,
  412. whichStep:2,
  413. }
  414. organizationVerifyRegisterTwo(params).then(res =>{
  415. console.log(res)
  416. this.tabCurrentIndex = 3
  417. }).catch(res =>{
  418. this.$util.msg(res.msg,2000);
  419. })
  420. },
  421. registerStepsSub(){
  422. if(!this.isCheck){
  423. this.$util.msg('请勾选同意协议',2000);
  424. return
  425. }
  426. let params ={
  427. email:this.registerEmail,
  428. mailboxCode:this.regEmailCode,
  429. password:this.password,
  430. passWordConfirm:this.passwordCheck,
  431. name:this.clubName,
  432. linkMan:this.clubContact,
  433. bindMobile:this.registerMobile,
  434. activationCode:this.mobileCode,
  435. sname:this.abbreviation,
  436. provinceID:this.addressData.provinceID,
  437. cityID:this.addressData.cityID,
  438. townID:this.addressData.townID,
  439. address:this.addressData.addressDetail,
  440. socialCreditCode:this.socialCreditCode,
  441. businessLicenseImage:this.uploadBusinessImage,
  442. headpic:this.uploadMentuzImage,
  443. firstClubType:this.isOrganizationType, //机构类型分类 医美:0和生美:1
  444. secondClubType:this.secondClubType, //机构类型二级分类 诊所:1,门诊:2,医院:3
  445. department:this.department, //科室
  446. medicalPracticeLicenseImg:this.uploadMedicalImage,//资质图片
  447. isAgreed:this.isAgreed, //是否勾选协议
  448. mainpro:this.mainpro,
  449. whichStep:3
  450. }
  451. organizationRegister(params).then(res =>{
  452. this.$util.msg('您的机构账号已提交审核',2000);
  453. this.$api.switchTabTo('/pages/tabBar/home/home')
  454. }).catch(res =>{
  455. this.$util.msg(res.msg,2000);
  456. })
  457. },
  458. getEmailCodeFn(){
  459. if( this.registerEmail == ''){
  460. this.$util.msg('请输入邮箱地址',2000);
  461. return
  462. }
  463. if(!this.$reg.isEmail(this.registerEmail)){
  464. this.$util.msg('请输入正确的邮箱地址',2000);
  465. return
  466. }
  467. this.isEmialDisabled = true;
  468. getEmailCode({email:this.registerEmail,status:2}).then(res =>{
  469. this.$util.msg('邮箱验证码已发送',2000);
  470. const TIME_COUNT = 60;
  471. if (!this.codeTime) {
  472. this.count = TIME_COUNT;
  473. this.isEmialDisabled = true;
  474. this.codeTime = setInterval(() => {
  475. if (this.count > 1 && this.count <= TIME_COUNT) {
  476. this.count--
  477. this.emailCodeText = this.count +'s重新发送'
  478. } else {
  479. clearInterval(this.codeTime)
  480. this.codeTime = null
  481. this.emailCodeText = '获取验证码'
  482. this.isEmialDisabled = false;
  483. }
  484. },1000)
  485. }
  486. }).catch( res =>{
  487. this.$util.msg(res.msg,2000);
  488. this.isEmialDisabled = false;
  489. })
  490. },
  491. getMobileCodeFn(){
  492. if( this.registerMobile == ''){
  493. this.$util.msg('请输入手机号',2000);
  494. return
  495. }
  496. if(!this.$reg.isMobile(this.registerMobile)){
  497. this.$util.msg('请输入正确的手机号',2000);
  498. return
  499. }
  500. if( this.imageCode == ''){
  501. this.$util.msg('请输入图形验证码',2000);
  502. return
  503. }
  504. let params = {
  505. mobile:this.registerMobile,
  506. activateCodeType:2,
  507. platformType:2,
  508. imgCode:this.imageCode,
  509. token:this.imageCodetoken,
  510. }
  511. this.isMobileDisabled = true;
  512. getMobileCode(params).then(res =>{
  513. this.$util.msg('验证短信已发送',2000);
  514. const TIME_COUNT = 60;
  515. if (!this.codeTime) {
  516. this.count = TIME_COUNT;
  517. this.isMobileDisabled = true;
  518. this.codeTime = setInterval(() => {
  519. if (this.count > 1 && this.count <= TIME_COUNT) {
  520. this.count--
  521. this.mobileCodeText = this.count +'s重新发送'
  522. } else {
  523. this.isMobileDisabled = false;
  524. clearInterval(this.codeTime)
  525. this.codeTime = null
  526. this.mobileCodeText = '获取验证码'
  527. }
  528. },1000)
  529. }
  530. }).catch( res =>{
  531. this.$util.msg(res.msg,2000);
  532. this.isEmialDisabled = false;
  533. })
  534. },
  535. getVerificationCode(){//获取图形验证
  536. getImageCode().then(res => {
  537. this.imageCodeUrl = res.data.baseImage
  538. this.imageCodetoken = res.data.token
  539. })
  540. },
  541. showMulLinkageThreePicker() {//三级地址联动
  542. this.isShowInput = true
  543. this.$refs.mpvueCityPicker.show()
  544. },
  545. onConfirm(e) {//获取选择的地址信息
  546. console.log('地址',e);
  547. this.addressData.address = e.name;
  548. this.addressData.townID = e.townCode;
  549. this.addressData.cityID = e.cityCode;
  550. this.addressData.provinceID = e.provinceCode;
  551. },
  552. onTextareaInput(e){//地址详细信息
  553. this.addressData.addressDetail = e.detail.value;
  554. },
  555. chooseBusinessImage() {//营业执照图片上传
  556. uploadFileImage().then(res =>{
  557. this.uploadBusinessImage = JSON.parse(res.data).data
  558. })
  559. },
  560. chooseMentuzImage() {//门头照图片上传
  561. uploadFileImage().then(res =>{
  562. this.uploadMentuzImage = JSON.parse(res.data).data
  563. })
  564. },
  565. chooseMedicalImage() {//资质照图片上传
  566. uploadFileImage().then(res =>{
  567. this.uploadMedicalImage = JSON.parse(res.data).data
  568. })
  569. },
  570. viewBusinessImage(e) {//预览营业执照图片
  571. this.myPreviewImageFn(this.uploadBusinessImage)
  572. },
  573. viewMentuzImage(e) {//预览门头照图片
  574. this.myPreviewImageFn(this.uploadMentuzImage)
  575. },
  576. viewMedicalImage(e) {//预览资质照图片
  577. this.myPreviewImageFn(this.uploadMedicalImage)
  578. },
  579. myPreviewImageFn(url){//预览图片公共方法
  580. this.isPreviewImage = true
  581. let mentuzArray = []
  582. mentuzArray.push(url)
  583. uni.previewImage({
  584. urls: mentuzArray,
  585. current: 0
  586. });
  587. },
  588. delBusinessImage(){//删除营业执照图片
  589. this.$util.modal('','确定删除营业执照图片吗?','确定','取消',true,() =>{
  590. this.uploadBusinessImage = ''
  591. })
  592. },
  593. delMentuzImage(){//删除门头照图片
  594. this.$util.modal('','确定删除门头照图片吗?','确定','取消',true,() =>{
  595. this.uploadMentuzImage = ''
  596. })
  597. },
  598. delMedicalImage(){//删除资质图片
  599. this.$util.modal('','确定删除资质图片吗?','确定','取消',true,() =>{
  600. this.uploadMedicalImage = ''
  601. })
  602. },
  603. bindPickerChange() {//机构类型选择
  604. let self = this
  605. uni.showActionSheet({
  606. title:'标题',
  607. itemList: ['医美', '生美'],
  608. success: (e) => {
  609. self.isOrganizationType = e.tapIndex+1
  610. switch(e.tapIndex){
  611. case 0:
  612. this.organizationTypeText = '医美'
  613. break;
  614. case 1:
  615. this.organizationTypeText = '生美'
  616. break;
  617. }
  618. }
  619. })
  620. },
  621. bindPickerChange2(e) {
  622. console.log('picker携带值为:' + e.target.value)
  623. this.typtIndex = e.target.value
  624. this.isOrganizationType = e.target.value
  625. },
  626. radioChange(e) {
  627. this.secondClubType = e.target.value;
  628. if( this.secondClubType == '2' || this.secondClubType == '3'){
  629. this.isDepartment = true
  630. }else{
  631. this.isDepartment = false
  632. }
  633. for (let i = 0; i < this.beautyList.length; i++) {
  634. if (this.beautyList[i].value === this.secondClubType) {
  635. this.current = i;
  636. break;
  637. }
  638. }
  639. },
  640. chooseMaleLike(e){
  641. this.mainpro = this.checkLikes(e,this.mentuzCampList)
  642. console.log(this.mainpro)
  643. },
  644. chooseMaleLikes(e){
  645. this.mainpro = this.checkLikes(e,this.medicaCampList)
  646. console.log(this.mainpro)
  647. },
  648. checkLikes(e,list){
  649. let items = list
  650. let values = e.detail.value
  651. let arr = []
  652. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  653. const item = items[i]
  654. if(values.indexOf(item.value) >= 0){
  655. this.$set(item,'checked',true)
  656. arr.push(item.name)
  657. }else{
  658. this.$set(item,'checked',false)
  659. }
  660. }
  661. return arr.toString()
  662. },
  663. agreeCheck() {
  664. this.isCheck = !this.isCheck
  665. if(this.isCheck){
  666. this.isAgreed = 1
  667. }
  668. },
  669. onBlurInput(e){//
  670. if(e.detail.value ===''){
  671. this.isDisabled = true
  672. }else{
  673. this.isDisabled = false
  674. }
  675. },
  676. showAustomItem() {
  677. this.isShowAustomItem = !this.isShowAustomItem
  678. },
  679. addCustomItem(){
  680. if(this.isOrganizationType == 1){
  681. let item = {value:`${this.mentuzCampList.length+1}`,name:this.customItemValue}
  682. this.mentuzCampList.push(item)
  683. }else{
  684. let item = {value:`${this.medicaCampList.length+1}`,name:this.customItemValue}
  685. this.medicaCampList.push(item)
  686. }
  687. },
  688. steps(index) {//$attrstab切换
  689. console.log(index)
  690. this.tabCurrentIndex = index;
  691. }
  692. },
  693. onShow() {
  694. if(this.isPreviewImage){
  695. this.isPreviewImage = false
  696. return
  697. }
  698. }
  699. }
  700. </script>
  701. <style lang="scss">
  702. .register{
  703. width: 100%;
  704. height: auto;
  705. .model-warp.none{
  706. display: none;
  707. }
  708. .model-warp.show{
  709. display: block;
  710. }
  711. .register-tab{
  712. width: 570rpx;
  713. height: 60rpx;
  714. padding: 60rpx 90rpx;
  715. position: relative;
  716. .nav-item{
  717. width: 142rpx;
  718. background: #FFFFFF;
  719. line-height: 60rpx;
  720. border-radius: 30rpx;
  721. text-align: center;
  722. color: #999999;
  723. font-size:$font-size-26;
  724. float: left;
  725. margin-right: 72rpx;
  726. position: relative;
  727. .line{
  728. height: 3rpx;
  729. width: 50rpx;
  730. background: #999999;
  731. position: absolute;
  732. right: -58rpx;
  733. top: 32rpx;
  734. }
  735. &:last-child{
  736. margin-right: 0;
  737. }
  738. &.current{
  739. color:#FFFFFF;
  740. background: $btn-confirm;
  741. }
  742. }
  743. }
  744. .register-main{
  745. width: 100%;
  746. height: auto;
  747. &.detailed{
  748. padding-bottom: 330rpx;
  749. }
  750. .register-tips{
  751. display: flex;
  752. flex-direction: column;
  753. align-items: center;
  754. line-height: 44rpx;
  755. font-size: $font-size-24;
  756. color: #FF0000;
  757. margin-bottom: 40rpx;
  758. .iconfont{
  759. font-size: $font-size-24;
  760. }
  761. }
  762. .register-row{
  763. width: 702rpx;
  764. height: auto;
  765. padding: 0 24rpx;
  766. margin-bottom: 20rpx;
  767. .register-text{
  768. line-height: 44rpx;
  769. margin-top: 100rpx;
  770. font-size: $font-size-24;
  771. color: #999999;
  772. text-align: justify;
  773. .txt{
  774. margin-right: 15rpx;
  775. }
  776. }
  777. .register-from{
  778. width: 654rpx;
  779. height: 40rpx;
  780. padding: 24rpx;
  781. background: $sub-bg-color;
  782. border-radius: 14rpx;
  783. position: relative;
  784. .label{
  785. text-align: left;
  786. font-size: $font-size-28;
  787. color: $text-color;
  788. line-height: 40rpx;
  789. float: left;
  790. }
  791. .row-input{
  792. width: 440rpx;
  793. padding-left:10rpx;
  794. font-size: $font-size-28;
  795. color: $text-color;
  796. line-height: 40rpx;
  797. float: left;
  798. height: 40rpx;
  799. &.none{
  800. color: #999999;
  801. }
  802. &.picker{
  803. text-align: left;
  804. color: #999999;
  805. }
  806. &.keshi{
  807. width: 550rpx;
  808. }
  809. }
  810. &.img-btn{
  811. width: 220rpx;
  812. height: 88rpx;
  813. padding: 0;
  814. float: left;
  815. background: #FFFFFF;
  816. display: block;
  817. .vscodeimg{
  818. width: 150rpx;
  819. height: 88rpx;
  820. float: left;
  821. display: flex;
  822. flex-direction: column;
  823. align-items: center;
  824. border-radius: 14rpx;
  825. image{
  826. width: 150rpx;
  827. height: 88rpx;
  828. border-radius: 14rpx;
  829. }
  830. }
  831. .vscod-refresh{
  832. width: 70rpx;
  833. float: right;
  834. text-align: right;
  835. display: flex;
  836. flex-direction: column;
  837. align-items: center;
  838. line-height: 44rpx;
  839. .icon-shuaxin{
  840. font-size: 48rpx;
  841. color: #333333;
  842. }
  843. .ref-text{
  844. font-size: 24rpx;
  845. color: #333333;
  846. }
  847. }
  848. }
  849. &.imgcode{
  850. width: 410rpx;
  851. float: left;
  852. margin-right: 20rpx;
  853. .row-input{
  854. width: 230rpx;
  855. }
  856. }
  857. &.code{
  858. width: 410rpx;
  859. float: left;
  860. margin-right: 20rpx;
  861. .row-input{
  862. width: 230rpx;
  863. }
  864. }
  865. &.btn{
  866. width: 224rpx;
  867. height: 88rpx;
  868. float: left;
  869. background: $btn-confirm;
  870. padding: 0;
  871. .row-input{
  872. width: 224rpx;
  873. height: 88rpx;
  874. line-height: 88rpx;
  875. padding: 0;
  876. color: #FFFFFF;
  877. background: $btn-confirm;
  878. text-align: center;
  879. border-radius: 14rpx;
  880. &.other{
  881. width: 224rpx;
  882. background: #F7F7F7;
  883. margin-right: 20rpx;
  884. }
  885. &.none{
  886. background: #F7F7F7;
  887. }
  888. }
  889. &.disabled{
  890. background: #F7F7F7;
  891. .row-input{
  892. background: #F7F7F7;
  893. color: #999999;
  894. }
  895. }
  896. }
  897. &.picker{
  898. padding: 0 24rpx;
  899. width: 654rpx;
  900. height: 88rpx;
  901. line-height: 88rpx;
  902. .label{
  903. line-height: 88rpx;
  904. }
  905. .row-input{
  906. width: 470rpx;
  907. height: 88rpx;
  908. line-height: 88rpx;
  909. padding-left: 30rpx;
  910. }
  911. }
  912. &.radio{
  913. padding: 0 24rpx;
  914. width: 654rpx;
  915. height: 288rpx;
  916. .row-input{
  917. width: 100%;
  918. height: 88rpx;
  919. line-height: 88rpx;
  920. padding-left: 0;
  921. }
  922. .row-radio{
  923. float: left;
  924. transform: scale(0.8);
  925. }
  926. .row-text{
  927. width: 100rpx;
  928. text-align: center;
  929. float: left;
  930. }
  931. }
  932. &.group{
  933. padding: 0 24rpx;
  934. width: 654rpx;
  935. height: auto;
  936. background: #FFFFFF;
  937. margin-top: 30rpx;
  938. .row-input{
  939. width: 100%;
  940. height: 88rpx;
  941. line-height: 88rpx;
  942. padding-left: 0;
  943. }
  944. .row-radio{
  945. float: left;
  946. }
  947. .row-text{
  948. width: 100rpx;
  949. text-align: center;
  950. float: left;
  951. }
  952. }
  953. &.btn{
  954. margin-top: 0;
  955. }
  956. .content-class {
  957. width: 520rpx;
  958. margin: 20rpx auto;
  959. display: flex;
  960. flex-flow: row wrap;
  961. justify-content: space-between;
  962. align-items: center;
  963. &.btn{
  964. margin: 0 auto;
  965. margin-left: 126rpx;
  966. }
  967. .row-input{
  968. display: flex;
  969. width: 220rpx;
  970. height: 40rpx;
  971. padding: 24rpx;
  972. text-align: left;
  973. border-radius: 10rpx;
  974. font-size: $font-size-28;
  975. color: $text-color;
  976. }
  977. .confirm-btn{
  978. width: 200rpx;
  979. height: 88rpx;
  980. border-radius: 10rpx;
  981. line-height: 88rpx;
  982. text-align: center;
  983. &.other{
  984. width: 213rpx;
  985. }
  986. &.none{
  987. color: #FFFFFF;
  988. background: $btn-confirm;
  989. }
  990. &.disabled{
  991. color: #999999;
  992. }
  993. }
  994. .item {
  995. width: 155rpx;
  996. height: 60rpx;
  997. font-size:$font-size-28;
  998. line-height: 60rpx;
  999. border-radius:10rpx;
  1000. margin: 10rpx;
  1001. text-align: center;
  1002. box-sizing: border-box;
  1003. border: 1rpx solid #EFEFEF;
  1004. checkbox {
  1005. display: none;
  1006. }
  1007. }
  1008. .on {
  1009. border-color: $color-system;
  1010. color:$color-system;
  1011. }
  1012. }
  1013. }
  1014. .icon-xiayibu{
  1015. width: 88rpx;
  1016. height: 88rpx;
  1017. position: absolute;
  1018. right: 0;
  1019. top: 0;
  1020. line-height: 88rpx;
  1021. text-align: center;
  1022. }
  1023. &.text-textarea{
  1024. background: #FFFFFF;
  1025. .textarea{
  1026. width: 654rpx;
  1027. height: 180rpx;
  1028. background: #F7F7F7;
  1029. padding: 24rpx;
  1030. font-size: $font-size-28;
  1031. color: $text-color;
  1032. z-index: 1;
  1033. border-radius: 14rpx;
  1034. }
  1035. .textarea.hide{
  1036. opacity: 0;
  1037. }
  1038. .textarea.show{
  1039. color: #999999;
  1040. }
  1041. }
  1042. }
  1043. .register-picture{
  1044. height: 102rpx;
  1045. margin: 40rpx 0 0 0;
  1046. .label{
  1047. float: left;
  1048. font-size: $font-size-28;
  1049. color: $text-color;
  1050. line-height: 102rpx;
  1051. width: 150rpx;
  1052. text-align: right;
  1053. &.zz{
  1054. width: 230rpx;
  1055. }
  1056. }
  1057. .upload-picture{
  1058. float: left;
  1059. height: 100rpx;
  1060. .upload-none{
  1061. width: 100rpx;
  1062. height: 100rpx;
  1063. text-align: center;
  1064. line-height: 100rpx;
  1065. color: #999999;
  1066. border: 1px solid #999999;
  1067. border-radius: 10rpx;
  1068. margin: 0 20rpx;
  1069. .iconfont{
  1070. font-size: $font-size-28;
  1071. }
  1072. }
  1073. .upload-image{
  1074. width: 100rpx;
  1075. height: 100rpx;
  1076. border-radius: 10rpx;
  1077. margin: 0 20rpx;
  1078. position: relative;
  1079. image{
  1080. width: 100rpx;
  1081. height: 100rpx;
  1082. border-radius: 10rpx;
  1083. }
  1084. .upload-del{
  1085. width: 40rpx;
  1086. height: 40rpx;
  1087. position: absolute;
  1088. top: -20rpx;
  1089. right: -20rpx;
  1090. line-height: 40rpx;
  1091. text-align: center;
  1092. .iconfont{
  1093. font-size: $font-size-32;
  1094. color: #999999;
  1095. }
  1096. }
  1097. }
  1098. }
  1099. }
  1100. .register-input{
  1101. width: 654rpx;
  1102. height: 40rpx;
  1103. padding: 24rpx;
  1104. margin: 0 auto;
  1105. margin-bottom: 60rpx;
  1106. background: #F7F7F7;
  1107. border-radius: 14rpx;
  1108. .input{
  1109. width: 100%;
  1110. height: 100%;
  1111. background: #F7F7F7;
  1112. font-size: $font-size-28;
  1113. line-height: 40rpx;
  1114. color: #333333;
  1115. border-radius: 14rpx;
  1116. }
  1117. }
  1118. .register-fiexd{
  1119. width: 100%;
  1120. height: auto;
  1121. position: fixed;
  1122. bottom: 0;
  1123. left: 0;
  1124. z-index: 999;
  1125. background: #FFFFFF;
  1126. .register-agree{
  1127. display: flex;
  1128. flex-direction: column;
  1129. align-items: center;
  1130. margin: 32rpx 0;
  1131. .agree-text{
  1132. .checkbox{
  1133. float: left;
  1134. margin: 4rpx 6rpx 0 0;
  1135. color: #999999;
  1136. font-size: $font-size-32;
  1137. &.icon-gouxuan{
  1138. color: $color-system;
  1139. }
  1140. }
  1141. font-size: 20rpx;
  1142. line-height: 44rpx;
  1143. color: #999999;
  1144. text{
  1145. color:#0091FF;
  1146. }
  1147. }
  1148. }
  1149. }
  1150. .register-btn{
  1151. width: 702rpx;
  1152. height: 88rpx;
  1153. border-radius: 14rpx;
  1154. font-size: $font-size-28;
  1155. line-height: 88rpx;
  1156. color: #FFFFFF;
  1157. margin: 0 auto;
  1158. text-align: center;
  1159. background: $btn-confirm;
  1160. margin-top: 96rpx;
  1161. &.none{
  1162. background: #FFFFFF;
  1163. color: $text-color;
  1164. margin-top: 0;
  1165. }
  1166. &.sub{
  1167. margin-top: 0;
  1168. }
  1169. }
  1170. }
  1171. }
  1172. </style>