Browse Source

fix:游记内容换行问题

qiao 3 months ago
parent
commit
8eb58c4964
3 changed files with 11 additions and 13 deletions
  1. 2 2
      .env.development
  2. 5 7
      src/pages/travel-notes/index.vue
  3. 4 4
      src/pages/yj/[id].vue

+ 2 - 2
.env.development

@@ -1,7 +1,7 @@
 VITE_APP_ENV=development
 
-VITE_APP_BASE_URL=https://www.xiaoyaotravel.com/api/
-# VITE_APP_BASE_URL=http://1.94.207.143:8082/
+# VITE_APP_BASE_URL=https://www.xiaoyaotravel.com/api/
+VITE_APP_BASE_URL=http://101.126.146.250:8082/
 # VITE_APP_BASE_URL=http://192.168.1.204:8082
 VITE_APP_EMOJI_API=https://v.xiaoyaotravel.com/emoji/
 VITE_APP_IM_USER_SUFFIX=dev

+ 5 - 7
src/pages/travel-notes/index.vue

@@ -1,7 +1,6 @@
 <template>
-  <div class="">
-    <!-- <Navbar :title="`${menuName ?? ''}精品旅游`" /> -->
-    <div v-if="filterList.length" class="sticky top-60 z-50 bg-white w-full border-t">
+  <div>
+    <div v-if="filterList.length" class="sticky top-50 z-50 bg-white w-full border-t">
       <van-dropdown-menu active-color="#FF9300" ref="dropDownMenuRef">
         <van-dropdown-item @closed="onAreaFilterClose" :title="areaFilterTitle" ref="itemRef">
           <van-tree-select @click-nav="handleAreaClick" @click-item="handleFilterClick" v-model:active-id="activeId"
@@ -12,12 +11,11 @@
       </van-dropdown-menu>
     </div>
     <div class="px-10 pt-20">
-      <van-list v-if="dataList.length" v-model:loading="loading" :immediate-check="false" :finished="finished"
-        finished-text="" @load="loadMore">
+      <van-list v-if="dataList.length" v-model:loading="loading" :immediate-check="false" :finished="finished" loading-text="加载中..." error-text="获取失败" @load="loadMore">
         <template v-for="itemData in dataList">
           <NuxtLink class="group flex relative cursor-pointer bg-white  pb-10 mb-20" :to="`/yj/${itemData.id}`">
             <div class="aspect-[120/80] h-80 shrink-0 rounded overflow-hidden bg-[#ddd]">
-              <img :src="itemData.tourismUrl" class="w-full h-full rounded object-cover" alt="" srcset="" />
+              <img v-if="Array.isArray(itemData?.tourismUrlsAfterConvert)" :src="itemData?.tourismUrlsAfterConvert[0]" class="w-full h-full rounded object-cover" alt="" srcset="" />
             </div>
             <div class="h-80  pl-[5px] flex flex-col text-[#FD9A00] justify-between  w-[calc(100%-120px)]">
               <div class="truncate w-full text-[14px] ">
@@ -89,7 +87,7 @@ function onAreaFilterClose() { areaIndex.value = activeIndex.value }
 const pageNum = ref(1)
 const pageSize = ref(10)
 const dataList = ref([])
-const loading = ref(false)
+const loading = ref(true)
 const finished = ref(false)
 // 是否原创 0 全部 1 原创 
 const travelWriteType = ref(0)

+ 4 - 4
src/pages/yj/[id].vue

@@ -2,7 +2,7 @@
   <div>
     <div v-if="['success'].includes(status)" @click="pageClick">
       <div class="p-10">
-        <img :src="detailData.tourismUrl" class="aspect-[316/204] w-full object-cover rounded" />
+        <img v-if="Array.isArray(detailData?.tourismUrlsAfterConvert)" :src="detailData?.tourismUrlsAfterConvert[0]" class="aspect-[316/204] w-full object-cover rounded" />
         <div class="flex mt-10">
           <img src="~/assets/img/article_title.png" class="w-[32px] h-[32px] shrink-0" alt="">
           <div class="ml-10 text-[16px] text-[#333] leading-[28px]">
@@ -94,7 +94,7 @@
             <img :src="con.content" class="w-full rounded-xl" alt="">
           </template>
           <template v-else>
-            <div v-html="con.content"></div>
+            <div class="w-full" style="word-wrap: break-word" v-html="con.content"></div>
           </template>
         </div>
 
@@ -181,7 +181,7 @@
                 <img class="w-[84px]" src="~/assets/img/yj/no-comments.png" alt="">
               </div>
               <div class="text-center text-[#999]">
-                没有评论
+                暂无评论
               </div>
             </div>
           </div>
@@ -232,7 +232,7 @@
 
             </div>
             <div @click="addComment"
-              class="pt-6 pb-6 pl-20 pr-20 mr-5 bg-[#FD9A00] text-[#fff] flex items-center justify-center rounded-full">
+              class="pt-6 pb-6 pl-20 pr-20 mr-5 bg-[#FD9A00] text-[#fff] flex items-center justify-center rounded-full shrink-0">
               评论
             </div>
           </div>