Quellcode durchsuchen

fix : 1.修改写游记的bug

suwenjiang vor 1 Monat
Ursprung
Commit
a0cec2e0dc

+ 4 - 4
.env.development

@@ -3,8 +3,8 @@ VITE_APP_ENV=development
 
 # 测试服
 # VITE_APP_BASE_URL=https://service.xiaoyaotravel.com/api/
-VITE_APP_BASE_URL=http://101.126.146.250:8082/
-VITE_APP_IM_URL=ws://101.126.146.250:8082/system/message
+# VITE_APP_BASE_URL=http://101.126.146.250:8082/
+# VITE_APP_IM_URL=ws://101.126.146.250:8082/system/message
 
 # 陈英政
 # VITE_APP_BASE_URL=http://101.126.146.250:8084/
@@ -31,9 +31,9 @@ VITE_APP_IM_URL=ws://101.126.146.250:8082/system/message
 # VITE_APP_IM_URL=ws://q9943037p3.goho.co/system/message
 
 # 张维本地
-# VITE_APP_BASE_URL=http://192.168.1.73:8082/
+VITE_APP_BASE_URL=http://192.168.1.73:8082/
 # 本地socoket
-# VITE_APP_IM_URL=ws://192.168.1.73:8082/system/message
+VITE_APP_IM_URL=ws://192.168.1.73:8082/system/message
 
 # 花生壳
 # VITE_APP_BASE_URL=http://5nfhmg.natappfree.cc

+ 0 - 3
src/components/CreateNote/HeaderImage.vue

@@ -56,7 +56,6 @@
 </template>
 
 <script setup>
-const bannerUrl = defineModel('bannerUrl')
 const imgUrls = defineModel('imgUrls')
 const show = defineModel('show')
 
@@ -119,8 +118,6 @@ function lookImage(imgIndex) {
 function setHeadImage() {
   let url = imgUrls.value[imageIndex.value]
   imgUrls.value.splice(imageIndex.value, 1)
-  bannerUrl.value = url
-
   imgUrls.value.unshift(url)
   imageIndex.value = 0
 

+ 42 - 30
src/pages/note-create/index.client.vue

@@ -2,7 +2,6 @@
   <div v-if="!loading" class="h-[100vh] box-border pb-110">
     <div v-if="!previewOptions.show">
       <CreateNoteHeaderImage
-        v-model:bannerUrl="noteJson.travelNotesBanner"
         v-model:imgUrls="noteJson.imgUrls"
         v-model:show="showExpandTextInput"
       />
@@ -383,7 +382,6 @@ const inputDiv = ref(null)
 const projectTitleRef = ref(null)
 
 const defaultNoteJson = {
-  travelNotesBanner: null,
   projectTitle: null,
   departureTime: null,
   countTimes: null,
@@ -572,17 +570,19 @@ async function handleSaveDraft() {
           }
         }
       })
+      console.log('草稿前:', parmas.topics)
     }
 
     if (parmas?.topicsList.length) {
       parmas.topics.forEach((i) => {
-        const matchingItem = parmas.topicsList.find((o) => o.name === i.name)
+        const matchingItem = parmas.topicsList.find((o) => o.topicName === i.name)
         if (matchingItem && i.id === '') {
           i.id = matchingItem.id
         }
       })
     }
-    console.log(parmas.topics, ' parmas.topics')
+
+    console.log('草稿后:', parmas.topics)
 
     let memberList = getMention('@')
 
@@ -719,6 +719,18 @@ async function requestPublish() {
         }
       })
     }
+    console.log('发布前:', parmas.topics)
+
+    if (parmas?.topicsList.length) {
+      parmas.topics.forEach((i) => {
+        const matchingItem = parmas.topicsList.find((o) => o.topicName === i.name)
+        if (matchingItem && i.id === '') {
+          i.id = matchingItem.id
+        }
+      })
+    }
+
+    console.log('发布后:', parmas.topics)
 
     let memberList = getMention('@')
 
@@ -757,32 +769,32 @@ const queryParmas = reactive({
 })
 
 const topicLoading = ref(false)
-async function getTopicList(parmas, searchText) {
-  try {
-    // if (!topicLoading.value) return
-    topicLoading.value = true
-    const { data } = await request(parmas.apiUrl, {
-      query: {
-        ...queryParmas,
-        name: searchText
-      }
-    }).finally(() => (topicLoading.value = false))
-
-    if (parmas.fn == TOPIC_TEXT) {
-      topicList.value = data
-    }
-    if (parmas.fn == EIT_TEXT) {
-      eitList.value = data
-    }
-  } catch (e) {
-    if (parmas.fn == TOPIC_TEXT) {
-      topicList.value = []
-    }
-    if (parmas.fn == EIT_TEXT) {
-      eitList.value = []
-    }
-  }
-}
+// async function getTopicList(parmas, searchText) {
+//   try {
+//     // if (!topicLoading.value) return
+//     topicLoading.value = true
+//     const { data } = await request(parmas.apiUrl, {
+//       query: {
+//         ...queryParmas,
+//         name: searchText
+//       }
+//     }).finally(() => (topicLoading.value = false))
+//
+//     if (parmas.fn == TOPIC_TEXT) {
+//       topicList.value = data
+//     }
+//     if (parmas.fn == EIT_TEXT) {
+//       eitList.value = data
+//     }
+//   } catch (e) {
+//     if (parmas.fn == TOPIC_TEXT) {
+//       topicList.value = []
+//     }
+//     if (parmas.fn == EIT_TEXT) {
+//       eitList.value = []
+//     }
+//   }
+// }
 
 // 计算出热门话题
 const hotTopicList = computed(() => {