club-detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. <template>
  2. <div class="club-detail page">
  3. <div class="page-top"></div>
  4. <div class="page-content">
  5. <div class="title">机构认证信息</div>
  6. <div class="updated" v-if="isAuth">
  7. <el-button type="warning" size="default" plain @click="editData">{{ status ? '修改' : '保存' }}</el-button>
  8. </div>
  9. <template v-if="!isAuth">
  10. <div class="tip">抱歉,您暂未认证机构</div>
  11. <div class="btn" @click="toAuth">去认证</div>
  12. </template>
  13. <template v-else>
  14. <div v-if="status">
  15. <div class="row">
  16. <div class="col label">机构名称:</div>
  17. <div class="col content">{{ clubInfo.authParty }}</div>
  18. </div>
  19. <div class="row">
  20. <div class="col label">联系电话:</div>
  21. <div class="col content">{{ clubInfo.mobile }}</div>
  22. </div>
  23. <div class="row">
  24. <div class="col label">运营联系人:</div>
  25. <div class="col content">{{ clubInfo.linkMan }}</div>
  26. </div>
  27. <div class="row">
  28. <div class="col label">运营联系人手机号:</div>
  29. <div class="col content">{{ clubInfo.linkMobile }}</div>
  30. </div>
  31. <div class="row">
  32. <div class="col label">所在地区:</div>
  33. <div class="col content">{{ clubInfo.area }}</div>
  34. </div>
  35. <div class="row">
  36. <div class="col label">详细地址:</div>
  37. <div class="col content">{{ clubInfo.address }}</div>
  38. </div>
  39. <div class="row">
  40. <div class="col label">所在位置:</div>
  41. <div class="col content">
  42. <div class="postion-btn" @click="initMap">查看定位</div>
  43. </div>
  44. </div>
  45. <div class="row block">
  46. <div class="col label">logo:</div>
  47. <div class="col content">
  48. <el-image :src="clubInfo.logo" v-if="clubInfo.logo"></el-image>
  49. </div>
  50. </div>
  51. <div class="row block">
  52. <div class="col label">门头照:</div>
  53. <div class="col content">
  54. <template v-for="(image, index) in clubInfo.bannerList">
  55. <el-image :src="image" :key="index"></el-image>
  56. </template>
  57. </div>
  58. </div>
  59. <div class="row">
  60. <div class="col label">机构类型:</div>
  61. <div class="col content">{{ firstClubTypeName }}</div>
  62. </div>
  63. <div class="row">
  64. <div class="col label">医美类型:</div>
  65. <div class="col content">{{ secondClubTypeName }}</div>
  66. </div>
  67. <div class="row block">
  68. <div class="col label">医疗许可证:</div>
  69. <div class="col content">
  70. <el-image :src="clubInfo.medicalLicenseImage" v-if="clubInfo.medicalLicenseImage"></el-image>
  71. </div>
  72. </div>
  73. <div class="row">
  74. <div class="col label">员工人数:</div>
  75. <div class="col content">{{ clubInfo.empNum }}</div>
  76. </div>
  77. </div>
  78. <div v-else>
  79. <FormClubInfo ref="clubInfoForm" @step="onClubInfoFormStep" :clubInfo="clubInfo" />
  80. </div>
  81. </template>
  82. </div>
  83. <div class="position-select" v-if="mapVisiable">
  84. <div class="position-select-container">
  85. <SimpleAMap ref="aMap" :lnglat="lnglat" />
  86. <div class="position-select-footer">
  87. <div class="lnglat">当前经纬度:{{ clubInfo.lngAndLat }}</div>
  88. <div class="position-confirm postion-control" @click="mapVisiable = false">确定</div>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import { mapGetters } from 'vuex'
  96. import FormClubInfo from '../form/components/form-club-edit.vue'
  97. export default {
  98. layout: 'app-ph',
  99. data() {
  100. return {
  101. mapVisiable: false,
  102. clubInfo: {},
  103. status: true,
  104. clubData: {},
  105. }
  106. },
  107. components: { FormClubInfo },
  108. computed: {
  109. ...mapGetters(['userInfo', 'routePrefix']),
  110. isAuth() {
  111. return this.clubInfo.auditStatus === 1
  112. },
  113. firstClubTypeName() {
  114. if (!this.clubInfo.firstClubType) return '其他'
  115. return ['医美', '生美', '项目公司', '个人', '其他'][this.clubInfo.firstClubType - 1]
  116. },
  117. secondClubTypeName() {
  118. if (!this.clubInfo.secondClubType) return '其他'
  119. return ['诊所', '门诊', '医院', '其他', '美容院', '养生馆', '其他'][this.clubInfo.secondClubType - 1]
  120. },
  121. lnglat() {
  122. return this.clubInfo.lngAndLat ? this.clubInfo.lngAndLat.split(',') : null
  123. },
  124. },
  125. created() {
  126. this.fetchClubDetail()
  127. },
  128. methods: {
  129. // 获取机构详情
  130. async fetchClubDetail() {
  131. try {
  132. const authId = this.userInfo.authId
  133. if (!authId) return
  134. const res = await this.$http.api.fetchClubAuthInfoData({ authId })
  135. this.clubInfo = res.data
  136. } catch (error) {
  137. console.log(error)
  138. }
  139. },
  140. // 去认证
  141. toAuth() {
  142. this.$router.push(`${this.routePrefix}/form/club-register`)
  143. },
  144. // 地图定位
  145. initMap() {
  146. this.mapVisiable = true
  147. this.$nextTick(() => {
  148. this.$refs.aMap.init()
  149. })
  150. },
  151. // 修该数据
  152. editData() {
  153. if (!this.status) {
  154. this.$refs.clubInfoForm.validate().then(() => {
  155. return this.status = true
  156. }).catch(() => {
  157. return this.status = false
  158. })
  159. }
  160. this.status = false
  161. },
  162. async onClubInfoFormStep(authdata) {
  163. console.log(authdata)
  164. this.$toast.loading({
  165. message: '正在保存请稍后...',
  166. duration: 0,
  167. })
  168. try {
  169. await this.$http.api.authClubSave1(authdata)
  170. await this.fetchClubDetail()
  171. this.$toast.loading({
  172. message: '保存成功',
  173. duration: 1000,
  174. })
  175. } catch (e) {
  176. console.log(e)
  177. }
  178. },
  179. },
  180. }
  181. </script>
  182. <style lang="scss" scoped>
  183. @media screen and (min-width: 768px) {
  184. .page {
  185. display: flex;
  186. justify-content: center;
  187. position: relative;
  188. }
  189. .position-select {
  190. width: 100vw;
  191. height: 100vh;
  192. background: rgba(0, 0, 0, 0.39);
  193. position: fixed;
  194. top: 0;
  195. left: 0;
  196. z-index: 999;
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. .position-select-container {
  201. background: #fff;
  202. width: 60%;
  203. box-sizing: border-box;
  204. padding: 24px;
  205. .position-select-footer {
  206. position: relative;
  207. display: flex;
  208. justify-content: flex-end;
  209. align-items: center;
  210. padding-top: 24px;
  211. .lnglat {
  212. position: absolute;
  213. font-size: 14px;
  214. color: #666;
  215. left: 0;
  216. top: 50%;
  217. transform: translateY(-50%);
  218. }
  219. }
  220. .postion-control {
  221. width: 120px;
  222. height: 40px;
  223. font-size: 14px;
  224. border-radius: 4px;
  225. display: flex;
  226. justify-content: center;
  227. align-items: center;
  228. cursor: pointer;
  229. margin-left: 16px;
  230. &.position-confirm {
  231. background: #f56c6c;
  232. color: #fff;
  233. }
  234. &.position-cancel {
  235. background: #b1b1b1;
  236. color: #fff;
  237. }
  238. }
  239. }
  240. }
  241. .page-content {
  242. max-width: 760px;
  243. padding-bottom: 167px;
  244. .updated {
  245. position: absolute;
  246. top: 50px;
  247. right: 200px;
  248. display: flex;
  249. justify-content: center;
  250. align-items: center;
  251. ::v-deep .el-button {
  252. font-size: 24px;
  253. }
  254. ::v-deep .el-button--warning {
  255. color: #f3920d;
  256. background: #fff;
  257. border-color: #f3920d;
  258. }
  259. }
  260. .title {
  261. font-size: 24px;
  262. color: #282828;
  263. font-weight: bold;
  264. text-align: center;
  265. padding: 60px 0;
  266. }
  267. .tip {
  268. font-size: 16px;
  269. color: #b2b2b2;
  270. margin-top: 200px;
  271. margin-bottom: 24px;
  272. text-align: center;
  273. }
  274. .btn {
  275. width: 98px;
  276. height: 36px;
  277. background: #bc1724;
  278. border-radius: 4px;
  279. text-align: center;
  280. line-height: 36px;
  281. color: #fff;
  282. font-size: 16px;
  283. margin: 0 auto;
  284. cursor: pointer;
  285. }
  286. .row {
  287. display: flex;
  288. align-items: flex-start;
  289. margin: 32px 0;
  290. .col {
  291. font-size: 16px;
  292. }
  293. .label {
  294. color: #666666;
  295. min-width: 100px;
  296. }
  297. .content {
  298. color: #282828;
  299. .el-image {
  300. width: 106px;
  301. height: 106px;
  302. border: 1px solid #dcdcdc;
  303. margin-right: 4px;
  304. &:last-child {
  305. margin-right: 0;
  306. }
  307. }
  308. .postion-btn {
  309. height: 28px;
  310. line-height: 28px;
  311. font-size: 14px;
  312. color: #fff;
  313. background: #1890ff;
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. cursor: pointer;
  318. border-radius: 4px;
  319. padding: 0 8px;
  320. &::before {
  321. content: '';
  322. display: inline-block;
  323. width: 16px;
  324. height: 16px;
  325. background: url(~assets/theme-images/common/icon-position.png) no-repeat center;
  326. background-size: 16px 16px;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. }
  333. @media screen and (max-width: 768px) {
  334. .page {
  335. display: flex;
  336. justify-content: center;
  337. position: relative;
  338. }
  339. .position-select {
  340. width: 100vw;
  341. height: 100vh;
  342. background: rgba(0, 0, 0, 0.39);
  343. position: fixed;
  344. top: 0;
  345. left: 0;
  346. z-index: 999;
  347. display: flex;
  348. justify-content: center;
  349. align-items: center;
  350. .position-select-container {
  351. background: #fff;
  352. width: 80%;
  353. box-sizing: border-box;
  354. padding: 3.2vw;
  355. .position-select-footer {
  356. padding-top: 10vw;
  357. position: relative;
  358. display: flex;
  359. justify-content: flex-end;
  360. align-items: center;
  361. .lnglat {
  362. position: absolute;
  363. font-size: 3.2vw;
  364. color: #666;
  365. left: 0;
  366. top: 5vw;
  367. transform: translateY(-50%);
  368. }
  369. }
  370. .postion-control {
  371. width: 16vw;
  372. height: 7vw;
  373. font-size: 3.4vw;
  374. border-radius: 0.4vw;
  375. display: flex;
  376. justify-content: center;
  377. align-items: center;
  378. cursor: pointer;
  379. margin-left: 3.6vw;
  380. &.position-confirm {
  381. background: #f56c6c;
  382. color: #fff;
  383. }
  384. &.position-cancel {
  385. background: #b1b1b1;
  386. color: #fff;
  387. }
  388. }
  389. }
  390. }
  391. .page-content {
  392. padding: 0 4vw;
  393. .updated {
  394. position: absolute;
  395. top: 6.5vw;
  396. right: 4vw;
  397. display: flex;
  398. justify-content: center;
  399. align-items: center;
  400. ::v-deep .el-button {
  401. font-size: 3.4vw;
  402. }
  403. ::v-deep .el-button--warning {
  404. color: #f3920d;
  405. background: #fff;
  406. border-color: #f3920d;
  407. }
  408. }
  409. .title {
  410. font-size: 4.2vw;
  411. color: #282828;
  412. font-weight: bold;
  413. text-align: center;
  414. padding: 8vw 0;
  415. }
  416. .tip {
  417. font-size: 3vw;
  418. color: #b2b2b2;
  419. margin-top: 60vw;
  420. margin-bottom: 4.8vw;
  421. text-align: center;
  422. }
  423. .btn {
  424. width: 36vw;
  425. height: 8.8vw;
  426. background: #bc1724;
  427. border-radius: 0.4vw;
  428. text-align: center;
  429. line-height: 8.8vw;
  430. color: #fff;
  431. font-size: 3.4vw;
  432. margin: 0 auto;
  433. }
  434. .row {
  435. display: flex;
  436. align-items: flex-start;
  437. margin: 5.6vw 0;
  438. &.block {
  439. display: block;
  440. .label {
  441. margin-bottom: 2.4vw;
  442. }
  443. }
  444. .col {
  445. font-size: 3.4vw;
  446. }
  447. .label {
  448. color: #666666;
  449. min-width: 20.4vw;
  450. }
  451. .content {
  452. color: #282828;
  453. .el-image {
  454. width: 26vw;
  455. height: 26vw;
  456. border: 0.1vw solid #dcdcdc;
  457. margin-right: 0.6vw;
  458. &:last-child {
  459. margin-right: 0;
  460. }
  461. }
  462. .postion-btn {
  463. height: 6.8vw;
  464. line-height: 6.8vw;
  465. font-size: 3.2vw;
  466. color: #fff;
  467. background: #1890ff;
  468. display: flex;
  469. justify-content: center;
  470. align-items: center;
  471. cursor: pointer;
  472. border-radius: 0.4vw;
  473. padding: 0 1.2vw;
  474. &::before {
  475. content: '';
  476. display: inline-block;
  477. width: 3.58vw;
  478. height: 3.58vw;
  479. background: url(~assets/theme-images/common/icon-position.png) no-repeat center;
  480. background-size: 3.58vw;
  481. }
  482. }
  483. }
  484. }
  485. }
  486. }
  487. </style>