information.vue 15 KB

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