club-detail.vue 12 KB

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