club-detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  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="text" size="default" @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-normal',
  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. this.$toast.loading({
  171. message: '保存成功',
  172. duration: 1000,
  173. })
  174. } catch (e) {
  175. console.log(e)
  176. }
  177. },
  178. },
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. @media screen and (min-width: 768px) {
  183. .page {
  184. display: flex;
  185. justify-content: center;
  186. position: relative;
  187. }
  188. .position-select {
  189. width: 100vw;
  190. height: 100vh;
  191. background: rgba(0, 0, 0, 0.39);
  192. position: fixed;
  193. top: 0;
  194. left: 0;
  195. z-index: 999;
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. .position-select-container {
  200. background: #fff;
  201. width: 60%;
  202. box-sizing: border-box;
  203. padding: 24px;
  204. .position-select-footer {
  205. position: relative;
  206. display: flex;
  207. justify-content: flex-end;
  208. align-items: center;
  209. padding-top: 24px;
  210. .lnglat {
  211. position: absolute;
  212. font-size: 14px;
  213. color: #666;
  214. left: 0;
  215. top: 50%;
  216. transform: translateY(-50%);
  217. }
  218. }
  219. .postion-control {
  220. width: 120px;
  221. height: 40px;
  222. font-size: 14px;
  223. border-radius: 4px;
  224. display: flex;
  225. justify-content: center;
  226. align-items: center;
  227. cursor: pointer;
  228. margin-left: 16px;
  229. &.position-confirm {
  230. background: #f56c6c;
  231. color: #fff;
  232. }
  233. &.position-cancel {
  234. background: #b1b1b1;
  235. color: #fff;
  236. }
  237. }
  238. }
  239. }
  240. .page-content {
  241. max-width: 760px;
  242. padding-bottom: 167px;
  243. .updated {
  244. position: absolute;
  245. top: 50px;
  246. right: 200px;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. ::v-deep .el-button--text {
  251. color: blue;
  252. font-size: 24px;
  253. }
  254. }
  255. .title {
  256. font-size: 24px;
  257. color: #282828;
  258. font-weight: bold;
  259. text-align: center;
  260. padding: 60px 0;
  261. }
  262. .tip {
  263. font-size: 16px;
  264. color: #b2b2b2;
  265. margin-top: 200px;
  266. margin-bottom: 24px;
  267. text-align: center;
  268. }
  269. .btn {
  270. width: 98px;
  271. height: 36px;
  272. background: #bc1724;
  273. border-radius: 4px;
  274. text-align: center;
  275. line-height: 36px;
  276. color: #fff;
  277. font-size: 16px;
  278. margin: 0 auto;
  279. cursor: pointer;
  280. }
  281. .row {
  282. display: flex;
  283. align-items: flex-start;
  284. margin: 32px 0;
  285. .col {
  286. font-size: 16px;
  287. }
  288. .label {
  289. color: #666666;
  290. min-width: 100px;
  291. }
  292. .content {
  293. color: #282828;
  294. .el-image {
  295. width: 106px;
  296. height: 106px;
  297. border: 1px solid #dcdcdc;
  298. margin-right: 4px;
  299. &:last-child {
  300. margin-right: 0;
  301. }
  302. }
  303. .postion-btn {
  304. height: 28px;
  305. line-height: 28px;
  306. font-size: 14px;
  307. color: #fff;
  308. background: #1890ff;
  309. display: flex;
  310. justify-content: center;
  311. align-items: center;
  312. cursor: pointer;
  313. border-radius: 4px;
  314. padding: 0 8px;
  315. &::before {
  316. content: '';
  317. display: inline-block;
  318. width: 16px;
  319. height: 16px;
  320. background: url(~assets/theme-images/common/icon-position.png) no-repeat center;
  321. background-size: 16px 16px;
  322. }
  323. }
  324. }
  325. }
  326. }
  327. }
  328. @media screen and (max-width: 768px) {
  329. .page {
  330. display: flex;
  331. justify-content: center;
  332. position: relative;
  333. }
  334. .position-select {
  335. width: 100vw;
  336. height: 100vh;
  337. background: rgba(0, 0, 0, 0.39);
  338. position: fixed;
  339. top: 0;
  340. left: 0;
  341. z-index: 999;
  342. display: flex;
  343. justify-content: center;
  344. align-items: center;
  345. .position-select-container {
  346. background: #fff;
  347. width: 80%;
  348. box-sizing: border-box;
  349. padding: 3.2vw;
  350. .position-select-footer {
  351. padding-top: 10vw;
  352. position: relative;
  353. display: flex;
  354. justify-content: flex-end;
  355. align-items: center;
  356. .lnglat {
  357. position: absolute;
  358. font-size: 3.2vw;
  359. color: #666;
  360. left: 0;
  361. top: 5vw;
  362. transform: translateY(-50%);
  363. }
  364. }
  365. .postion-control {
  366. width: 16vw;
  367. height: 7vw;
  368. font-size: 3.4vw;
  369. border-radius: 0.4vw;
  370. display: flex;
  371. justify-content: center;
  372. align-items: center;
  373. cursor: pointer;
  374. margin-left: 3.6vw;
  375. &.position-confirm {
  376. background: #f56c6c;
  377. color: #fff;
  378. }
  379. &.position-cancel {
  380. background: #b1b1b1;
  381. color: #fff;
  382. }
  383. }
  384. }
  385. }
  386. .page-content {
  387. padding: 0 4vw;
  388. .updated {
  389. position: absolute;
  390. top: 6.5vw;
  391. right: 4vw;
  392. display: flex;
  393. justify-content: center;
  394. align-items: center;
  395. ::v-deep .el-button--text {
  396. color: blue;
  397. font-size: 4.2vw;
  398. }
  399. }
  400. .title {
  401. font-size: 4.2vw;
  402. color: #282828;
  403. font-weight: bold;
  404. text-align: center;
  405. padding: 8vw 0;
  406. }
  407. .tip {
  408. font-size: 3vw;
  409. color: #b2b2b2;
  410. margin-top: 60vw;
  411. margin-bottom: 4.8vw;
  412. text-align: center;
  413. }
  414. .btn {
  415. width: 36vw;
  416. height: 8.8vw;
  417. background: #bc1724;
  418. border-radius: 0.4vw;
  419. text-align: center;
  420. line-height: 8.8vw;
  421. color: #fff;
  422. font-size: 3.4vw;
  423. margin: 0 auto;
  424. }
  425. .row {
  426. display: flex;
  427. align-items: flex-start;
  428. margin: 5.6vw 0;
  429. &.block {
  430. display: block;
  431. .label {
  432. margin-bottom: 2.4vw;
  433. }
  434. }
  435. .col {
  436. font-size: 3.4vw;
  437. }
  438. .label {
  439. color: #666666;
  440. min-width: 20.4vw;
  441. }
  442. .content {
  443. color: #282828;
  444. .el-image {
  445. width: 26vw;
  446. height: 26vw;
  447. border: 0.1vw solid #dcdcdc;
  448. margin-right: 0.6vw;
  449. &:last-child {
  450. margin-right: 0;
  451. }
  452. }
  453. .postion-btn {
  454. height: 6.8vw;
  455. line-height: 6.8vw;
  456. font-size: 3.2vw;
  457. color: #fff;
  458. background: #1890ff;
  459. display: flex;
  460. justify-content: center;
  461. align-items: center;
  462. cursor: pointer;
  463. border-radius: 0.4vw;
  464. padding: 0 1.2vw;
  465. &::before {
  466. content: '';
  467. display: inline-block;
  468. width: 3.58vw;
  469. height: 3.58vw;
  470. background: url(~assets/theme-images/common/icon-position.png) no-repeat center;
  471. background-size: 3.58vw;
  472. }
  473. }
  474. }
  475. }
  476. }
  477. }
  478. </style>