register-unid.vue 16 KB

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