club-detail.vue 13 KB

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