lrf há 2 semanas atrás
pai
commit
71e0f1f389

+ 5 - 3
src/views/win/introduceParts/combriefIndex.vue

@@ -39,7 +39,7 @@ import { get, head } from 'lodash-es'
 // eslint-disable-next-line @typescript-eslint/no-explicit-any
 const list = ref<any[]>([])
 const active = ref('1')
-const info = ref({ id: '', title: '', txt: '' })
+const info: any = ref({ id: '1', title: '', txt: '' })
 
 /* 选择 */
 const toChange = (event: { id: string; title: string; txt: string }) => {
@@ -81,11 +81,13 @@ const init = async () => {
   const result = await jtjs.gsjs()
   if (result.errcode == 0) {
     list.value = get(result, 'data', [])
-    active.value = get(head(get(result, 'data', [])), 'id', '1')
+    const first = head(get(result, 'data', []))
+    active.value = get(first, 'id', '1') as string
+    info.value = first
   }
 }
 const toOpen = () => {
-  const channel_id = get(info, 'channel_id', get(info, 'id'))
+  const channel_id = get(info, 'value.channel_id', get(info, 'id'))
   if (!channel_id) return
   window.open(
     `/${import.meta.env.VITE_BASE_URL}/introduceDetail?channel_id=${channel_id}&type=gsjs`,

+ 6 - 3
src/views/win/introduceParts/gsjsDetail.vue

@@ -48,8 +48,11 @@ const viewChannel = ref(197)
 const tabActive = ref('1')
 /* 选择 */
 const tabChange = (event: { id: string }) => {
-  tabActive.value = event.id
-  dealNowTag(event.id)
+  const tab = tabList.value.find((f) => `${f.channel_id}` == event.id)
+  if (!tab) return
+  const id = get(tab, 'id')
+  tabActive.value = id
+  dealNowTag(id)
 }
 /**根据标签页id,处理显示内容 */
 const dealNowTag = (id: string) => {
@@ -90,7 +93,7 @@ const route = useRoute()
 /* 初始化 */
 onMounted(() => {
   const id: any = get(route, 'query.channel_id')
-  if (id) dealNowTag(id)
+  if (id) tabChange({ id })
 })
 </script>
 

+ 6 - 3
src/views/win/introduceParts/scfmDetail.vue

@@ -48,8 +48,11 @@ const viewChannel = ref(197)
 const tabActive = ref('1')
 /* 选择 */
 const tabChange = (event: { id: string }) => {
-  tabActive.value = event.id
-  dealNowTag(event.id)
+  const tab = tabList.value.find((f) => `${f.channel_id}` == event.id)
+  if (!tab) return
+  const id = get(tab, 'id')
+  tabActive.value = id
+  dealNowTag(id)
 }
 /**根据标签页id,处理显示内容 */
 const dealNowTag = (id: string) => {
@@ -86,7 +89,7 @@ const route = useRoute()
 /* 初始化 */
 onMounted(() => {
   const id: any = get(route, 'query.channel_id')
-  if (id) dealNowTag(id)
+  if (id) tabChange({ id })
 })
 </script>
 

+ 2 - 2
src/views/win/newsParts/listIndex.vue

@@ -35,7 +35,7 @@
             <el-col :span="24" class="brief" v-html="item.brief"> </el-col>
           </el-col>
           <el-col :span="6" class="imgs">
-            <el-image class="images" :src="item.url"></el-image>
+            <el-image class="images" :src="item.url || defUrl"></el-image>
           </el-col>
         </el-col>
       </el-col>
@@ -53,7 +53,7 @@ import dayjs from 'dayjs'
 /* 分页 */
 import pagesIndex from '../../../components/windows/pagesIndex.vue'
 import { get } from 'lodash-es'
-
+const defUrl = 'zxzx.jpg'
 const tabList = ref([
   {
     id: '1',