register-unid.vue 17 KB

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