瀏覽代碼

Merge branch 'dev' of http://1.94.207.143:3000/xyy/xyy-m into dev

songzhen 3 月之前
父節點
當前提交
e9e0c350fe

+ 7 - 3
src/components/Profile/Notes/Auditing/Item.vue

@@ -1,14 +1,18 @@
 <template>
   <van-swipe-cell>
     <div class="relative flex mb-10 border-[#fff] space-x-10 p-10 rounded-xl bg-[#FFF]">
-      <img
+      
+      <div class="w-147 h-109 border-box">
+        <img
         :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
-        class="aspect-[4/3] h-109 shrink-0 object-cover"
+        class="w-full h-full shrink-0  object-cover"
       />
+      </div>
+     
 
       <div class="flex w-0 flex-1 flex-col justify-between">
         <div class="mt-15">
-          <div class="line-clamp-1 break-all text-base font-semibold text-black-3">
+          <div class="line-clamp-1  truncate break-all text-base font-semibold text-black-3">
             {{ data?.projectTitle || '未命名草稿' }}
           </div>
           <div class="mt-2 text-sm text-black-3">

+ 27 - 6
src/components/Profile/Notes/Auditing/index.vue

@@ -1,15 +1,29 @@
 <template>
-  <div class="w-full min-h-400 pb-10">
+  <div style="height: calc(100vh - 105px);" class="w-full  pb-10">
     <!-- 审核中 -->
     <ProfileNotesEmpty v-if="!loading && !draftList.length" />
 
     <div v-else-if="draftList.length">
-      <ProfileNotesAuditingItem
+
+      <van-list
+       v-model:loading="loading"
+       v-model:error="error"
+      :finished="finished"
+      :immediate-check="false"
+       offset="80"
+       error-text="请求失败,点击重新加载"
+       finished-text=""
+       @load="getNotesList"
+    >
+    <ProfileNotesAuditingItem
         v-for="item in draftList"
         :key="item.id"
         :data="item"
         @on-revoke="handleRevoke(item)"
       />
+    
+    </van-list>
+      
     </div>
   </div>
 </template>
@@ -17,20 +31,27 @@
 <script setup>
 const { loading, setLoading } = useLoading()
 loading.value = true
-
+const finished = ref(false);
+const error = ref(false);
+const pageNum=ref(1)
 const draftList = ref([])
 
 async function getNotesList() {
   setLoading(true)
+  pageNum.value++
   try {
     const { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
       query: {
-        pageNum: 1,
-        pageSize: 10000,
+        pageNum: pageNum.value,
+        pageSize: 5,
         type: 1
       }
     })
-    draftList.value = data.dataList
+    draftList.value = draftList.value.concat(data.dataList);
+    loading.value = false;
+    if (draftList.value.length >= data.totalCount) {
+      finished.value = true;
+    }
   } finally {
     setLoading(false)
   }

+ 7 - 4
src/components/Profile/Notes/Draft/Item.vue

@@ -1,14 +1,17 @@
 <template>
   <van-swipe-cell>
     <div class="relative flex space-x-10 p-10 mb-10 bg-[#fff] rounded-xl">
-      <img
+      <div class="w-147 h-109 border-box">
+        <img
         :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
-        class="aspect-[4/3] h-109 shrink-0 rounded-xl object-cover"
+        class="w-full h-full shrink-0  object-cover"
       />
+      </div>
+      
 
-      <div class="flex w-0 flex-1 flex-col justify-between">
+      <div class="flex w-152 justify-between">
         <div class="pt-15">
-          <div class="line-clamp-2 break-all text-xl font-semibold text-black-3">
+          <div class="line-clamp-2 truncate break-all text-xl font-semibold text-black-3">
             {{ data?.projectTitle || '未命名草稿' }}
           </div>
           <div class="mt-10 text-sm text-black-9">

+ 36 - 9
src/components/Profile/Notes/Draft/index.vue

@@ -1,43 +1,68 @@
 <template>
-  <div class="min-h-400 pb-10">
+  <div style="height: calc(100vh - 90px);" class=" pb-10">
     <ProfileNotesEmpty v-if="!loading && !draftList.length" />
-
     <div v-else-if="draftList.length">
-      <div class="text-black-3 px-10">
+      <div class="text-black-3 px-10 pb-11">
         <p class="text-base font-bold">{{ draftList?.length }}篇草稿</p>
         <p class="text-sm text-[#FF2929]">
           【您好,您还有{{ draftList?.length }}篇草稿没有完成,我们期待您的大作哦~】
         </p>
       </div>
-      <div>
+      <van-list
+       v-model:loading="loading"
+       v-model:error="error"
+      :finished="finished"
+      :immediate-check="false"
+       offset="80"
+       error-text="请求失败,点击重新加载"
+       finished-text=""
+       @load="getNotesList"
+    >
         <ProfileNotesDraftItem
           v-for="item in draftList"
           :key="item.id"
           :data="item"
           @on-delete="handleDelete(item)"
         />
-      </div>
+    
+    </van-list>
     </div>
+
+   
+   
   </div>
 </template>
 
 <script setup>
+
+const finished = ref(false);
+const error = ref(false);
 const { loading, setLoading } = useLoading()
 loading.value = true
 
+const pageNum=ref(1)
+
 const draftList = ref([])
 
 async function getNotesList() {
   setLoading(true)
+  pageNum.value++
   try {
-    const { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
+    let { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
       query: {
-        pageNum: 1,
-        pageSize: 10000,
+        pageNum: pageNum.value,
+        pageSize: 5,
         type: 0
       }
     })
-    draftList.value = data?.dataList
+   
+    draftList.value = draftList.value.concat(data.dataList);
+    loading.value = false;
+    if (draftList.value.length >= data.totalCount) {
+      finished.value = true;
+    }
+  
+
   } finally {
     setLoading(false)
   }
@@ -65,6 +90,8 @@ async function handleDelete(item) {
     })
 }
 
+
+
 onMounted(() => {
   getNotesList()
 })

+ 1 - 1
src/components/Profile/Notes/Empty.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="flex h-360 flex-col items-center justify-center space-y-10">
+  <div style="height: calc(100vh - 105px);"  class="flex  flex-col items-center justify-center space-y-10">
     <img src="~/assets/img/empty.png" class="h-80 object-cover" />
     <div class="text-base text-[#999999]">{{ title }}</div>
     <NuxtLink

+ 9 - 10
src/components/Profile/Notes/Published/Item.vue

@@ -1,20 +1,19 @@
 <template>
   <van-swipe-cell>
     <div class="relative group flex border-box p-10 mb-10 bg-[#fff] rounded-xl">
-      <div class="aspect-[4/3] h-109 border-box">
-        <van-image
-          width="100%"
-          height="100%"
-          fit="contain"
-          :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
-        />
+      <div class="w-147 h-109 border-box">
+        <img
+        :src="formatImgSrc(data.tourismUrlsAfterConvert) || noteDraftCoverBg"
+        class="w-full h-full shrink-0  object-cover"
+      />
       </div>
-
-      <div class="flex-1 ml-15">
+   
+      <div class="w-152 ml-15">
         <div class="min-h-70">
           <NuxtLink
+            :title="data?.projectTitle"
             :to="`/yj/${data?.id}`"
-            class="cursor-pointer truncate break-all text-base font-bold text-black-3 transition-all text-bold"
+            class="w-full cursor-pointer line-clamp-1 truncate break-all text-base font-bold text-black-3 text-bold"
           >
             {{ data?.projectTitle }}
           </NuxtLink>

+ 39 - 12
src/components/Profile/Notes/Published/index.vue

@@ -1,15 +1,29 @@
 <template>
-  <div class="w-full box-border min-h-400 pb-10 px-1">
+  <div style="height: calc(100vh - 105px);" class="w-full box-border  pb-10 px-1">
     <!-- 发布中 -->
     <ProfileNotesEmpty v-if="!noteList.length" />
-    <div v-else-if="noteList.length">
-      <ProfileNotesPublishedItem
+    <div  v-else-if="noteList.length">
+
+      <van-list
+       v-model:loading="loading"
+       v-model:error="error"
+      :finished="finished"
+      :immediate-check="false"
+       offset="80"
+       error-text="请求失败,点击重新加载"
+       finished-text=""
+       @load="getList"
+    >
+       <ProfileNotesPublishedItem
         v-for="item in noteList"
         :key="item.id"
         :data="item"
         @on-note-down="handleNoteDown(item)"
         @on-share="changeShowShare(item)"
       />
+    
+    </van-list>
+      
     </div>
 
     <van-share-sheet v-model:show="showShare" :options="options" @select="onSelectShare" />
@@ -85,6 +99,7 @@ const shareToWeChat = (type) => {
   // })
 }
 
+// 复制链接
 const copyLink = () => {
   const url = `${import.meta.env.VITE_APP_BASE_URL}yj/${yjId.value}`
   navigator.clipboard.writeText(url).then(
@@ -96,29 +111,41 @@ const copyLink = () => {
     }
   )
 }
-// const { loading, setLoading } = useLoading()
+const finished = ref(false);
+const error = ref(false);
+const { loading, setLoading } = useLoading()
+loading.value = true
 
 const noteList = ref([])
 const pageNum = ref(1)
 
+
 async function getList() {
+  setLoading(true)
+  pageNum.value++
   try {
-    let {
-      data: { dataList }
-    } = await request('/website/tourism/publishTravelNotes/getDraftList', {
+    let { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
       query: {
         pageNum: pageNum.value,
-        pageSize: 10000,
+        pageSize: 5,
         type: 3
       }
     })
-    if (Array.isArray(dataList) && dataList.length) {
-      noteList.value = dataList
-      pageNum.value++
+   
+    noteList.value = noteList.value.concat(data.dataList);
+    loading.value = false;
+    if (noteList.value.length >= data.totalCount) {
+      finished.value = true;
     }
-  } catch (error) {}
+  
+
+  } finally {
+    setLoading(false)
+  }
 }
 
+
+
 // 下架
 async function handleNoteDown(item) {
   showConfirmDialog({

+ 6 - 4
src/components/Profile/Notes/Rejected/Item.vue

@@ -1,12 +1,14 @@
 <template>
   <van-swipe-cell>
     <div class="relative group flex space-x-10 p-10 mb-10 bg-[#fff] rounded-xl">
-      <img
+   
+      <div class="w-147 h-109 border-box">
+        <img
         :src="formatImgSrc(data?.tourismUrlsAfterConvert) || noteDraftCoverBg"
-        class="aspect-[4/3] h-109 shrink-0 object-cover"
+        class="w-full h-full shrink-0  object-cover"
       />
-
-      <div class="flex w-0 flex-1 flex-col justify-between">
+      </div>
+      <div class="flex w-0 w-152 justify-between">
         <div class="">
           <div class="mt-15 line-clamp-2 break-all text-xl font-semibold text-black-3">
             {{ data?.projectTitle || '未命名草稿' }}

+ 33 - 7
src/components/Profile/Notes/Rejected/index.vue

@@ -1,36 +1,62 @@
 <template>
-  <div class="min-h-400 pb-10">
+  <div style="height: calc(100vh - 105px);" class=" pb-10">
     <!-- 未通过 -->
     <ProfileNotesEmpty v-if="!loading && !draftList.length" />
 
     <div v-else-if="draftList.length">
-      <ProfileNotesRejectedItem
+
+      <van-list
+       v-model:loading="loading"
+       v-model:error="error"
+      :finished="finished"
+      :immediate-check="false"
+       offset="80"
+       error-text="请求失败,点击重新加载"
+       finished-text=""
+       @load="getNotesList"
+    >
+       <ProfileNotesRejectedItem
         v-for="item in draftList"
         :key="item.id"
         :data="item"
         @on-delete="handleDelete(item)"
       />
+    
+    </van-list>
+      
     </div>
   </div>
 </template>
 
 <script setup>
+
 const { loading, setLoading } = useLoading()
 loading.value = true
-
 const draftList = ref([])
+const finished = ref(false);
+const error = ref(false);
+const pageNum = ref(1)
+
 
 async function getNotesList() {
   setLoading(true)
+  pageNum.value++
   try {
-    const { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
+    let { data } = await request('/website/tourism/publishTravelNotes/getDraftList', {
       query: {
-        pageNum: 1,
-        pageSize: 10000,
+        pageNum: pageNum.value,
+        pageSize: 5,
         type: 2
       }
     })
-    draftList.value = data.dataList
+   
+    draftList.value = draftList.value.concat(data.dataList);
+    loading.value = false;
+    if (draftList.value.length >= data.totalCount) {
+      finished.value = true;
+    }
+  
+
   } finally {
     setLoading(false)
   }

+ 7 - 4
src/pages/note-create/index.client.vue

@@ -400,8 +400,7 @@ import draft from '~/assets/img/note-create/draft.svg'
 // import { cloneDeep } from 'lodash-es'
 import { VueDraggable } from 'vue-draggable-plus'
 import { nanoid } from 'nanoid'
-const useAuth = useAuthStore()
-const { token } = storeToRefs(useAuth)
+
 
 const dragOptions = {
   disabled: false, // 是否禁用拖拽
@@ -476,7 +475,6 @@ const draftDialogContent = {
 const showDialog = (parmas) => {
   showConfirmDialog(parmas)
     .then(() => {
-      // getNoteDetail()
       handleSaveDraft()
     })
     .catch(() => {})
@@ -620,7 +618,12 @@ function handleSaveCover(item) {
   showToast('设置封面成功')
 }
 
+// 保存草稿
 async function handleSaveDraft() {
+  noteJson.endPlace = noteJson?.endPlaceId
+  delete noteJson.endPlaceId
+
+  
   try {
     await request('/website/tourism/publishTravelNotes/saveDraft', {
       method: 'post',
@@ -706,7 +709,7 @@ async function requestPublish() {
 
     noteJson.endPlace = noteJson.endPlaceId
     delete noteJson.endPlaceId
-    console.log(noteJson, 'noteJson')
+   
     await request('/website/tourism/publishTravelNotes/publishDraft', {
       method: 'post',
       body: {

+ 1 - 1
src/pages/profile/notes/index.vue

@@ -4,7 +4,7 @@
       <ProfileNotesTabs :tabs="tabs"></ProfileNotesTabs>
     </van-sticky>
 
-    <div class="w-full h-[200vh]">
+    <div class="w-full ">
       <van-pull-refresh v-model="loading" @refresh="onRefresh">
         <div v-if="tab === 'published'">
           <ProfileNotesPublished />