register-unid.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <view class="container register" :style="{ paddingTop: CustomBar + 'px' }">
  3. <view class="register-main title clearfix" v-if="isUnderLogin">
  4. <view class="register-row clearfix" style="padding: 24rpx;margin-bottom: 0;">
  5. <view class="error-title">审核未通过原因:</view>
  6. <view class="error-main">
  7. {{ auditNote }}
  8. </view>
  9. </view>
  10. </view>
  11. <view class="register-main clearfix">
  12. <view class="register-row clearfix">
  13. <view class="register-from">
  14. <view class="label"><text>*</text>联系人</view>
  15. <input
  16. class="row-input"
  17. type="text"
  18. v-model="params.linkMan"
  19. placeholder="请输入联系姓名"
  20. placeholder-class="placeholder"
  21. maxlength="6"
  22. />
  23. </view>
  24. </view>
  25. <view class="register-row clearfix">
  26. <view class="register-from">
  27. <view class="label"><text>*</text>机构名称</view>
  28. <input
  29. class="row-input"
  30. type="text"
  31. v-model="params.name"
  32. placeholder="请输入您的机构名称"
  33. placeholder-class="placeholder"
  34. maxlength="30"
  35. />
  36. </view>
  37. </view>
  38. <view class="register-row clearfix">
  39. <view class="register-from" @click="showMulLinkageThreePicker">
  40. <view class="label"><text>*</text>机构地址</view>
  41. <text class="row-input" :class="handleAddress === '请选择机构所在地区' ? 'none' : ''">
  42. {{ handleAddress }}
  43. </text>
  44. <text class="iconfont icon-xiangyou"></text>
  45. </view>
  46. </view>
  47. <view class="register-row text-textarea clearfix">
  48. <view
  49. class="textarea"
  50. v-if="isShowInput"
  51. placeholder-class="placeholder"
  52. @click="showTextareaFocus"
  53. >{{
  54. params.address ? params.address : '详细地址:如道路、门牌号、小区等'
  55. }}</view
  56. >
  57. <textarea
  58. v-else
  59. class="textarea"
  60. type="text"
  61. v-model="params.address"
  62. placeholder="详细地址:如道路、门牌号、小区等"
  63. placeholder-class="placeholder"
  64. maxlength="25"
  65. @input="onTextareaInput"
  66. @focus="textareaFocus"
  67. @blur="hideTextareaFocus"
  68. :class="isShowInput ? '' : ''"
  69. />
  70. </view>
  71. <view class="register-row clearfix">
  72. <view class="register-from">
  73. <view class="label"><text>*</text>营业执照编号</view>
  74. <input
  75. class="row-input"
  76. type="text"
  77. v-model="params.socialCreditCode"
  78. placeholder="请填写社会统一信用代码"
  79. placeholder-class="placeholder"
  80. maxlength="18"
  81. />
  82. </view>
  83. </view>
  84. <view class="register-row clearfix">
  85. <view class="register-picture">
  86. <view class="label"><text>*</text>营业执照</view>
  87. <view class="upload-picture">
  88. <view class="upload-none" v-if="!params.businessLicense" @click="uploadFileImage(1)">
  89. <text class="iconfont icon-shangchuantupian"></text>
  90. <text>选择图片</text>
  91. </view>
  92. <view class="upload-image" v-else>
  93. <image :src="params.businessLicense" mode="" @click="handleViewImage(params.businessLicense)"></image>
  94. <view class="upload-del" @click="handleDelete(1)">
  95. <text class="iconfont icon-shanchu"></text>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. <view class="register-row clearfix">
  102. <view class="register-picture">
  103. <view class="label"><text>*</text>门头照</view>
  104. <view class="upload-picture">
  105. <view class="upload-none" v-if="!params.shopPhoto" @click="uploadFileImage(2)">
  106. <text class="iconfont icon-shangchuantupian"></text>
  107. <text>选择图片</text>
  108. </view>
  109. <view class="upload-image" v-else>
  110. <image :src="params.shopPhoto" mode="" @click="handleViewImage(params.shopPhoto)"></image>
  111. <view class="upload-del" @click="handleDelete(2)">
  112. <text class="iconfont icon-shanchu"></text>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="register-row clearfix">
  119. <view class="register-picture">
  120. <view class="label"><text>*</text>医疗执业许可证</view>
  121. <view class="upload-picture">
  122. <view class="upload-none" v-if="!params.medicalPracticeLicense" @click="uploadFileImage(3)">
  123. <text class="iconfont icon-shangchuantupian"></text>
  124. <text>选择图片</text>
  125. </view>
  126. <view class="upload-image" v-else>
  127. <image :src="params.medicalPracticeLicense" mode="" @click="handleViewImage(params.medicalPracticeLicense)"></image>
  128. <view class="upload-del" @click="handleDelete(3)">
  129. <text class="iconfont icon-shanchu"></text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="register-row ">
  136. <view class="register-btn sub" @click.stop="handleConfirm">重新提交审核</view>
  137. </view>
  138. </view>
  139. <!-- 地址 -->
  140. <mpvue-city-picker
  141. :themeColor="themeColor"
  142. ref="mpvueCityPicker"
  143. :pickerValueDefault="cityPickerValueDefault"
  144. @onCancel="onCancel"
  145. @onConfirm="onConfirm"
  146. >
  147. </mpvue-city-picker>
  148. <!-- 弹窗提示 -->
  149. <tui-modal
  150. :show="modal"
  151. @click="handleClick"
  152. @cancel="modal = false"
  153. :content="'注册尚未完成,确定放弃注册吗?'"
  154. :button="modalButton"
  155. color="#333"
  156. :size="32"
  157. shape="circle"
  158. :maskClosable="false"
  159. >
  160. </tui-modal>
  161. </view>
  162. </template>
  163. <script>
  164. import { mapState, mapMutations } from 'vuex'
  165. import authorize from '@/common/config/authorize.js'
  166. import wxLogin from '@/common/config/wxLogin.js'
  167. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
  168. import { uploadFileImage } from '@/services/public.js'
  169. export default {
  170. components: {
  171. mpvueCityPicker
  172. },
  173. data() {
  174. return {
  175. params: {
  176. name:'',
  177. linkMan:'',
  178. provinceId: '',
  179. cityId: '',
  180. townId:'',
  181. address: '',
  182. organizeType:1, //外部商城机构类型 0内部机构 1外部机构
  183. shopPhoto:'',
  184. businessLicense:'',
  185. medicalPracticeLicense:'',
  186. },
  187. handleAddress:'请选择机构所在地区',
  188. isUnderLogin:false,
  189. auditNote:''
  190. }
  191. },
  192. onLoad(option) {
  193. this.updateModifyInfo()
  194. },
  195. computed: {
  196. ...mapState(['isWxAuthorize'])
  197. },
  198. methods: {
  199. ...mapMutations(['login', 'wxLogin']),
  200. async updateModifyInfo() {
  201. const resolve =await this.$api.getStorage()
  202. this.params.userId = resolve.userId ? resolve.userId : 0
  203. if(resolve.clubStatus === 92){
  204. this.isUnderLogin = true
  205. }
  206. try{
  207. const res =await this.UserService.OrganizationUpdateModifyInfo({ userId: this.params.userId })
  208. let club = res.data.club
  209. let user = res.data.user
  210. this.auditNote = user.auditNote
  211. this.params.clubId = user.clubId
  212. this.handleAddress = club.provincialAddress ? club.provincialAddress : '请选择机构所在地区'
  213. this.params = {...this.params , ...club}
  214. }catch(error){
  215. this.$util.msg(error.msg, 2000)
  216. }
  217. },
  218. handleConfirm(){
  219. // 提交审核
  220. if (this.params.linkMan == '') {
  221. this.$util.msg('请输入联系人名称', 2000)
  222. return
  223. }
  224. if (this.params.name == '') {
  225. this.$util.msg('请输入机构名称', 2000)
  226. return
  227. }
  228. if (this.params.townId == '') {
  229. this.$util.msg('请选择机构地址', 2000)
  230. return
  231. }
  232. if (this.params.addressDetail == '') {
  233. this.$util.msg('请填写机构详细地址', 2000)
  234. return
  235. }
  236. if (this.params.businessLicense == '') {
  237. this.$util.msg('请上传营业执照', 2000)
  238. return
  239. }
  240. if (this.params.shopPhoto == '') {
  241. this.$util.msg('请上传门头照', 2000)
  242. return
  243. }
  244. if (this.params.medicalPracticeLicense == '') {
  245. this.$util.msg('请上传医疗执业许可证', 2000)
  246. return
  247. }
  248. this.clubUpdate(this.params)
  249. },
  250. async clubUpdate(params) {
  251. // 注册
  252. try{
  253. await this.UserService.OrganizationUpdate(params)
  254. this.$util.msg('提交成功', 2000)
  255. this.$api.navigateBack(1)
  256. }catch(error){
  257. this.$util.msg(error.msg, 2000)
  258. }
  259. },
  260. storeUpdataeStatus(data) {
  261. uni.setStorageSync('token', data.token)
  262. this.$store.commit('updateStatus', data)
  263. this.login(data)
  264. },
  265. // 三级联动选择
  266. showMulLinkageThreePicker() {
  267. this.isShowInput = true
  268. this.$refs.mpvueCityPicker.show()
  269. },
  270. onConfirm(e) {
  271. this.handleAddress = e.name
  272. this.params.townId = e.townCode
  273. this.params.cityId = e.cityCode
  274. this.params.provinceId = e.provinceCode
  275. },
  276. onTextareaInput(e) {
  277. //文本框获取焦点
  278. this.params.address = e.detail.value
  279. },
  280. showTextareaFocus() {
  281. //文本框获取焦点
  282. this.isShowInput = false
  283. this.textareaFocus = true
  284. },
  285. hideTextareaFocus() {
  286. //文本框失去焦点
  287. this.isShowInput = true
  288. this.textareaFocus = false
  289. },
  290. //上传
  291. async uploadFileImage(type){
  292. try{
  293. const res = await uploadFileImage()
  294. const data = JSON.parse(res.data).data
  295. switch (type){
  296. case 1:
  297. this.params.businessLicense = data
  298. break;
  299. case 2:
  300. this.params.shopPhoto = data
  301. break;
  302. case 3:
  303. this.params.medicalPracticeLicense = data
  304. break;
  305. }
  306. }catch(error){
  307. console.log('error',error)
  308. }
  309. },
  310. //预览
  311. handleViewImage(url) {
  312. this.isPreviewImage = true
  313. let mentuzArray = []
  314. mentuzArray.push(url)
  315. uni.previewImage({
  316. urls: mentuzArray,
  317. current: 0
  318. })
  319. },
  320. //删除
  321. handleDelete(type){
  322. switch (type){
  323. case 1:
  324. this.$util.modal('', '确定删除营业执照图片吗?', '确定', '取消', true, () => {
  325. this.params.businessLicense = ''
  326. })
  327. break;
  328. case 2:
  329. this.$util.modal('', '确定删除门头照图片吗?', '确定', '取消', true, () => {
  330. this.params.shopPhoto = ''
  331. })
  332. break;
  333. case 3:
  334. this.$util.modal('', '确定删除资质图片吗?', '确定', '取消', true, () => {
  335. this.params.medicalPracticeLicense = ''
  336. })
  337. break;
  338. }
  339. },
  340. handleClick1(){
  341. this.$api.switchTabTo('/pages/tabBar/user/user')
  342. }
  343. },
  344. onShow() {
  345. if (this.isPreviewImage) {
  346. this.isPreviewImage = false
  347. return
  348. }
  349. }
  350. }
  351. </script>
  352. <style lang="scss">
  353. .register {
  354. width: 100%;
  355. height: 100%;
  356. box-sizing: border-box;
  357. background-size: contain;
  358. .register-tabs{
  359. width: 100%;
  360. height: 40rpx;
  361. box-sizing: border-box;
  362. padding:0 160rpx;
  363. margin: 110rpx 0 40rpx 0;
  364. .tabs-item{
  365. float: left;
  366. line-height: 40rpx;
  367. font-size: $font-size-30;
  368. color: #B2B2B2;
  369. .iconfont{
  370. font-size: 40rpx;
  371. }
  372. &.active{
  373. color: $color-system;
  374. }
  375. &.line{
  376. width: 50rpx;
  377. height: 40rpx;
  378. margin: 0 20rpx;
  379. .iconfont{
  380. font-size: 58rpx;
  381. }
  382. }
  383. }
  384. }
  385. .register-main {
  386. width: 100%;
  387. height: auto;
  388. position: relative;
  389. &.title {
  390. background: #FEF6F6;
  391. .error-title {
  392. line-height: 40rpx;
  393. font-size: $font-size-28;
  394. color: #F85050;
  395. text-align: left;
  396. }
  397. .error-main {
  398. font-size: $font-size-26;
  399. color: #F85050;
  400. text-align: justify;
  401. line-height: 44rpx;
  402. }
  403. }
  404. .register-consult {
  405. width: 110rpx;
  406. height: 68rpx;
  407. background: linear-gradient(223deg, rgba(225, 86, 21, 0.6) 0%, rgba(225, 86, 10, 0.3) 100%);
  408. border-radius: 34rpx 0 0 34rpx;
  409. position: absolute;
  410. right: 0;
  411. bottom: 120rpx;
  412. text-align: left;
  413. line-height: 68rpx;
  414. padding-left: 20rpx;
  415. .icon-kefunv {
  416. font-size: 48rpx;
  417. color: #31313b;
  418. float: left;
  419. }
  420. .text {
  421. font-size: $font-size-24;
  422. display: block;
  423. float: left;
  424. width: 60rpx;
  425. line-height: 30rpx;
  426. color: #ffffff;
  427. margin-top: 6rpx;
  428. }
  429. }
  430. &.detailed {
  431. padding-bottom: 330rpx;
  432. }
  433. .register-row {
  434. width: 100%;
  435. height: auto;
  436. padding: 0 24rpx;
  437. margin-bottom: 30rpx;
  438. box-sizing: border-box;
  439. &.none {
  440. margin-bottom: 0;
  441. }
  442. .register-from {
  443. width: 100%;
  444. height: 80rpx;
  445. background: #ffffff;
  446. position: relative;
  447. border-bottom: 1px solid #e1e1e1;
  448. .label {
  449. text-align: left;
  450. font-size: $font-size-28;
  451. color: #666666;
  452. line-height: 80rpx;
  453. float: left;
  454. text{
  455. color: #F85050;
  456. }
  457. }
  458. .row-input {
  459. width: 440rpx;
  460. padding-left: 24rpx;
  461. font-size: $font-size-28;
  462. color: $text-color;
  463. line-height: 80rpx;
  464. float: left;
  465. height: 80rpx;
  466. box-sizing: border-box;
  467. &.none {
  468. color: #999999;
  469. }
  470. &.code {
  471. width: 330rpx;
  472. }
  473. }
  474. .row-btn {
  475. width: 180rpx;
  476. height: 64rpx;
  477. float: left;
  478. background: $btn-confirm;
  479. padding: 0;
  480. border-radius: 32rpx;
  481. .row-input {
  482. width: 180rpx;
  483. height: 64rpx;
  484. line-height: 64rpx;
  485. padding: 0;
  486. color: #ffffff;
  487. background: $btn-confirm;
  488. text-align: center;
  489. border-radius: 32rpx;
  490. &.none {
  491. background: #f7f7f7;
  492. }
  493. }
  494. &.disabled {
  495. background: #f7f7f7;
  496. .row-input {
  497. background: #f7f7f7;
  498. color: #999999;
  499. font-size: 24rpx;
  500. }
  501. }
  502. }
  503. &.btn {
  504. margin-top: 0;
  505. }
  506. }
  507. .icon-xiangyou {
  508. width: 88rpx;
  509. height: 88rpx;
  510. position: absolute;
  511. right: 0;
  512. top: 0;
  513. line-height: 88rpx;
  514. text-align: center;
  515. }
  516. &.text-textarea {
  517. background: #ffffff;
  518. .textarea {
  519. width: 100%;
  520. height: 120rpx;
  521. padding:24rpx 0 ;
  522. font-size: $font-size-28;
  523. color: $text-color;
  524. z-index: 1;
  525. border-bottom: 1px solid #e1e1e1;
  526. }
  527. .textarea.hide {
  528. opacity: 0;
  529. }
  530. .textarea.show {
  531. color: #999999;
  532. }
  533. }
  534. }
  535. .register-picture {
  536. width: 100%;
  537. height: auto;
  538. float: left;
  539. .label {
  540. float: left;
  541. font-size: $font-size-28;
  542. color: $text-color;
  543. line-height: 80rpx;
  544. width: 100%;
  545. text-align: left;
  546. text{
  547. color: #F85050;
  548. }
  549. }
  550. .upload-picture {
  551. float: left;
  552. height: auto;
  553. .upload-none {
  554. width: 210rpx;
  555. height: 210rpx;
  556. border: 1px dashed #B2B2B2;
  557. border-radius: 10rpx;
  558. display: flex;
  559. justify-content: center;
  560. flex-direction: column;
  561. align-items: center;
  562. font-size: $font-size-28;
  563. color: #B2B2B2;
  564. line-height: 50rpx;
  565. .iconfont {
  566. font-size: $font-size-28;
  567. }
  568. }
  569. .upload-image {
  570. width: 210rpx;
  571. height: 210rpx;
  572. border-radius: 10rpx;
  573. margin: 0 20rpx;
  574. position: relative;
  575. image {
  576. width: 210rpx;
  577. height: 210rpx;
  578. border-radius: 10rpx;
  579. }
  580. .upload-del {
  581. width: 40rpx;
  582. height: 40rpx;
  583. position: absolute;
  584. top: -20rpx;
  585. right: -20rpx;
  586. line-height: 40rpx;
  587. text-align: center;
  588. .iconfont {
  589. font-size: $font-size-40;
  590. color: #F85050;
  591. }
  592. }
  593. }
  594. }
  595. }
  596. .register-input {
  597. width: 654rpx;
  598. height: 40rpx;
  599. padding: 24rpx;
  600. margin: 0 auto;
  601. margin-bottom: 60rpx;
  602. background: #f7f7f7;
  603. border-radius: 14rpx;
  604. .input {
  605. width: 100%;
  606. height: 100%;
  607. background: #f7f7f7;
  608. font-size: $font-size-28;
  609. line-height: 40rpx;
  610. color: #333333;
  611. border-radius: 14rpx;
  612. }
  613. }
  614. .register-btn {
  615. width: 100%;
  616. height: 88rpx;
  617. border-radius: 44rpx;
  618. font-size: $font-size-28;
  619. line-height: 88rpx;
  620. color: #ffffff;
  621. margin: 40rpx auto;
  622. text-align: center;
  623. background: $btn-confirm;
  624. &.none {
  625. border: 1px solid $color-system;
  626. background: #ffffff;
  627. color: $color-system;
  628. margin-top: 0;
  629. }
  630. }
  631. }
  632. }
  633. .tui-alert-box {
  634. width: 100%;
  635. height: 100%;
  636. display: flex;
  637. align-items: center;
  638. justify-content: center;
  639. flex-direction: column;
  640. position: fixed;
  641. left: 0;
  642. top: 0;
  643. opacity: 1;
  644. background: rgba(51, 51, 51, 0.5);
  645. z-index: 99999;
  646. .tui-alert-content {
  647. width: 580rpx;
  648. height: 324rpx;
  649. border-radius: 16rpx;
  650. background-color: #ffffff;
  651. position: absolute;
  652. top: 0;
  653. bottom: 0;
  654. right: 0;
  655. left: 0;
  656. margin: auto;
  657. .tui-alert-main {
  658. width: 100%;
  659. height: 234rpx;
  660. box-sizing: border-box;
  661. padding: 60rpx 30rpx;
  662. line-height: 60rpx;
  663. font-size: $font-size-26;
  664. color: #666666;
  665. text-align: justify;
  666. .red {
  667. color: #F3B574;
  668. }
  669. }
  670. .tui-alert-btn {
  671. width: 100%;
  672. height: 90rpx;
  673. box-sizing: border-box;
  674. line-height: 90rpx;
  675. background: $btn-confirm;
  676. color: #ffffff;
  677. text-align: center;
  678. font-size: $font-size-28;
  679. border-radius: 0 0 16rpx 16rpx;
  680. }
  681. }
  682. }
  683. .tui-modal-custom {
  684. text-align: center;
  685. }
  686. .tui-modal-custom-text {
  687. font-size: 30rpx;
  688. color: #333;
  689. padding: 30rpx 0 50rpx;
  690. }
  691. .tui-button-custom{
  692. width: 420rpx;
  693. height: 84rpx;
  694. line-height: 84rpx;
  695. text-align: center;
  696. color: #FFFFFF;
  697. background: $btn-confirm;
  698. font-size: $font-size-28;
  699. margin: 15rpx auto;
  700. border-radius: 42rpx;
  701. }
  702. .tui-prompt-title {
  703. padding-bottom: 20rpx;
  704. font-size: 34rpx;
  705. }
  706. </style>