information.vue 16 KB

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