serviceDetail.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <custom-layout class="main">
  3. <el-col :span="24" class="one">
  4. <div class="w_1300">
  5. <div class="info_1"></div>
  6. <div class="info_2">
  7. <div class="top">
  8. <div class="info_left">
  9. <el-carousel height="260px">
  10. <el-carousel-item v-for="(item, index) in info.file" :key="index">
  11. <el-image class="image" :src="getUrl(item.uri)" fit="fill" />
  12. </el-carousel-item>
  13. </el-carousel>
  14. </div>
  15. <div class="info_right">
  16. <div class="info_title">
  17. <div class="name">{{ info.name || '暂无' }}</div>
  18. <div class="collect iscollect" @click="toCollect" v-if="info.is_collection">
  19. <el-icon :size="24" color="#1073ff"><StarFilled /></el-icon>
  20. <span>已收藏</span>
  21. </div>
  22. <div class="collect" v-else @click="toCollect">
  23. <el-icon :size="24"><Star /></el-icon>
  24. <span>收藏</span>
  25. </div>
  26. </div>
  27. <el-col :span="24" class="other_1">
  28. <span>服务领域:</span>
  29. {{ info.field || '暂无服务领域' }}
  30. </el-col>
  31. <el-col :span="24" class="other_1">
  32. <span>登记时间:</span>
  33. {{ info.time || '暂无运营主体' }}
  34. </el-col>
  35. </div>
  36. </div>
  37. <div class="center">
  38. <div class="title">简介</div>
  39. <div class="content">{{ info.brief || '暂无' }}</div>
  40. </div>
  41. <div class="bottom">
  42. <div class="title">相关平台</div>
  43. <div class="content">
  44. <el-row :gutter="16">
  45. <el-col :span="12" v-for="(item, index) in list" :key="index" @click="toView(item)">
  46. <div class="list">
  47. <el-col :span="24" class="name textOne">
  48. <el-tooltip effect="dark" :content="item.name" placement="top">
  49. {{ item.name || '暂无名称' }}
  50. </el-tooltip>
  51. </el-col>
  52. <el-col :span="24" class="other">
  53. <el-col :span="12" class="other_1">
  54. <span>服务领域:</span>
  55. {{ item.field || '暂无服务领域' }}
  56. </el-col>
  57. <el-col :span="12" class="other_1">
  58. <span>登记时间:</span>
  59. {{ item.time || '暂无运营主体' }}
  60. </el-col>
  61. </el-col>
  62. </div>
  63. </el-col>
  64. </el-row>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </el-col>
  70. </custom-layout>
  71. </template>
  72. <script setup>
  73. // 接口
  74. import { SupportStore } from '@/store/api/platform/support'
  75. const store = SupportStore()
  76. import { UserStore } from '@/store/user'
  77. const userStore = UserStore()
  78. const user = computed(() => userStore.user)
  79. // 加载中
  80. const loading = ref(false)
  81. // 路由
  82. const router = useRouter()
  83. const route = useRoute()
  84. const info = ref({})
  85. // 列表
  86. const list = ref([])
  87. // 请求
  88. onMounted(async () => {
  89. loading.value = true
  90. await searchOther()
  91. await search()
  92. loading.value = false
  93. })
  94. const searchOther = async () => {
  95. const data = {
  96. skip: 0,
  97. limit: 3,
  98. status: '1',
  99. is_use: '0'
  100. }
  101. let res
  102. res = await store.query(data)
  103. if (res.errcode == '0') list.value = res.data
  104. }
  105. const search = async () => {
  106. let id = route.query.id
  107. if (id) {
  108. let res = await store.fetch(id)
  109. if (res.errcode == '0') info.value = res.data
  110. }
  111. }
  112. // 查看
  113. const toView = (item) => {
  114. router.push({ path: '/service/detail', query: { id: item.id || item._id } })
  115. }
  116. const getUrl = (item) => {
  117. if (item) return `${import.meta.env.VITE_APP_HOST}${item}`
  118. }
  119. const toCollect = async () => {
  120. if (user.value.id) {
  121. info.value.is_collection = !info.value.is_collection
  122. } else ElMessage({ message: '未登录!', type: 'error' })
  123. }
  124. </script>
  125. <style scoped lang="scss">
  126. .main {
  127. .one {
  128. padding-bottom: 40px;
  129. background: #f9faff url(/images/fw-det-bg.jpg) center top no-repeat;
  130. .info_1 {
  131. padding: 30px 0;
  132. }
  133. .info_2 {
  134. background-color: #fff;
  135. box-shadow: 0 0 13px 0 rgba(14, 5, 10, 0.16);
  136. padding: 27px;
  137. margin-bottom: 20px;
  138. .top {
  139. display: flex;
  140. .info_left {
  141. width: 460px;
  142. height: 260px;
  143. .image {
  144. height: 100%;
  145. width: 100%;
  146. }
  147. }
  148. .info_right {
  149. margin-left: 40px;
  150. width: 740px;
  151. .info_title {
  152. display: flex;
  153. justify-content: space-between;
  154. align-items: center;
  155. margin-bottom: 30px;
  156. .name {
  157. color: #22284e;
  158. font-size: $global-font-size-26;
  159. line-height: 26px;
  160. }
  161. .collect {
  162. display: flex;
  163. align-items: center;
  164. justify-content: flex-end;
  165. width: 35%;
  166. font-size: $global-font-size-20;
  167. color: #929292;
  168. cursor: default;
  169. span {
  170. margin: 0 0 0 5px;
  171. }
  172. }
  173. .iscollect {
  174. color: #1073ff;
  175. }
  176. }
  177. .other_1 {
  178. font-size: $global-font-size-18;
  179. margin: 10px 0;
  180. span {
  181. color: #686f7b;
  182. margin-left: 0;
  183. margin-right: 15px;
  184. }
  185. }
  186. }
  187. }
  188. .center {
  189. margin: 20px 0 0 0;
  190. .title {
  191. color: #000;
  192. display: inline-block;
  193. margin-right: 80px;
  194. padding-bottom: 20px;
  195. font-size: $global-font-size-20;
  196. color: #000000;
  197. border-bottom: 5px solid #378cff;
  198. cursor: pointer;
  199. }
  200. .content {
  201. padding: 20px;
  202. font-size: $global-font-size-16;
  203. }
  204. }
  205. .bottom {
  206. margin: 20px 0 0 0;
  207. .title {
  208. color: #000;
  209. display: inline-block;
  210. margin-right: 80px;
  211. padding-bottom: 20px;
  212. font-size: $global-font-size-20;
  213. color: #000000;
  214. border-bottom: 5px solid #378cff;
  215. cursor: pointer;
  216. }
  217. .content {
  218. padding: 20px 0;
  219. .list {
  220. float: left;
  221. width: 565px;
  222. height: 159px;
  223. border: solid 1px #cedbe7;
  224. background: url(/images/bg-teclist.jpg) no-repeat right;
  225. padding: 25px 0 0;
  226. margin: 10px 5px;
  227. .name {
  228. font-size: $global-font-size-20;
  229. font-weight: bold;
  230. display: inline-block;
  231. margin: 0 0 50px 7px;
  232. }
  233. .name:hover {
  234. color: #2374ff;
  235. cursor: pointer;
  236. }
  237. .other {
  238. display: flex;
  239. .other_1 {
  240. font-family: 'PingFangSC-Light', 'Microsoft YaHei', 'WenQuanYi Micro Hei', arial, sans-serif;
  241. font-size: $global-font-size-18;
  242. font-weight: normal;
  243. color: #666;
  244. }
  245. .other_1:hover {
  246. color: #2374ff;
  247. cursor: pointer;
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. </style>