Browse Source

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

qiao 3 months ago
parent
commit
e1e1469c6e

+ 7 - 0
nuxt.config.ts

@@ -55,6 +55,13 @@ export default defineNuxtConfig({
       link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.svg" }],
       // script: [
       //   {
+      //     src: "https://cdn.jsdelivr.net/npm/eruda",
+      //     type: "text/javascript",
+      //   },
+      //   {
+      //     innerHTML: "eruda.init();",
+      //   },
+      //   {
       //     src: "//unpkg.com/vconsole@latest/dist/vconsole.min.js",
       //     type: "text/javascript",
       //   },

BIN
src/assets/img/note-create/user_xian.png


BIN
src/assets/img/note-create/userinfo_modal_h.png


+ 2 - 0
src/components/CreateNote/Form.vue

@@ -151,6 +151,7 @@ import rate from '~/assets//img/note-create/rate.svg'
 const departureTime = defineModel('departureTime')
 const countTimes = defineModel('countTimes')
 const endPlace = defineModel('endPlace')
+const endPlaceId = defineModel('endPlaceId')
 const role = defineModel('role')
 const averageCost = defineModel('averageCost')
 const recommendationRate = defineModel('recommendationRate')
@@ -189,6 +190,7 @@ const showPicker = ref(false)
 const onConfirmAddr = ({ selectedValues, selectedOptions }) => {
   showPicker.value = false
   endPlace.value = selectedOptions[selectedValues.length - 1].menuName
+  endPlaceId.value = selectedOptions[selectedValues.length - 1].id
 }
 
 // 出行方式

+ 25 - 33
src/components/CreateNote/HeaderBanner.vue

@@ -29,10 +29,10 @@
       </div>
     </div>
 
-    <van-dialog title="图片剪裁" v-model:show="cropperDialogVisible" width="375">
-      <div class="h-full w-full">
-        <img ref="cropperRef" :src="cropperImageBase64" alt="" />
-        <!-- <vueCropper
+    <!-- <van-dialog title="图片剪裁" v-model:show="cropperDialogVisible" width="375"> -->
+    <!-- <div class="h-full w-full"> -->
+    <!-- <img ref="cropperRef" :src="cropperImageBase64" alt="" /> -->
+    <!-- <vueCropper
           ref="cropperRef"
           :img="cropperImageBase64"
           autoCrop
@@ -44,8 +44,8 @@
           :full="true"
           :fixedNumber="[3.2, 1]"
         ></vueCropper> -->
-      </div>
-      <template #footer>
+    <!-- </div> -->
+    <!-- <template #footer>
         <div class="flex items-center justify-center space-x-20 pt-10 pb-10">
           <van-button
             round
@@ -66,8 +66,8 @@
             确认
           </van-button>
         </div>
-      </template>
-    </van-dialog>
+      </template> -->
+    <!-- </van-dialog> -->
   </div>
 </template>
 
@@ -75,49 +75,42 @@
 import { useFileDialog } from '@vueuse/core'
 import icon_image_fill from '~/assets/img/note-create/icon-image-fill.png'
 import image from '~/assets/img/note-create/image.svg'
-import { VueCropper } from 'vue-cropper'
-import 'vue-cropper/dist/index.css'
+// import { VueCropper } from 'vue-cropper'
+// import 'vue-cropper/dist/index.css'
 
 const bannerUrl = defineModel('bannerUrl')
 
-// const emit = defineEmits(['onSelectImage'])
-
 const { open, onChange } = useFileDialog({
   accept: '.png,.png,.jpeg,.JPG,Png '
 })
 
-const cropperImageBase64 = ref('')
-const fileList = ref({})
-onChange((files) => {
+// const cropperImageBase64 = ref('')
+
+function handleSelectImage() {
+  open()
+}
+
+onChange(async (files) => {
   if (!files.length) return
   const reader = new FileReader()
   reader.readAsDataURL(files[0])
   reader.onload = () => {
-    console.log(reader.result, '123')
-
-    cropperDialogVisible.value = true
-    cropperImageBase64.value = reader.result
-    fileList.value = files[0]
+    bannerUrl.value = reader.result
+    handleCropperOk(files[0])
   }
 })
 
-function handleSelectImage() {
-  open()
-}
-
-const cropperRef = ref(null)
-const cropperDialogVisible = ref(false)
+// const cropperRef = ref(null)
+// const cropperDialogVisible = ref(false)
 const loading = ref(false)
-// async
 
-async function handleCropperOk() {
-  // cropperRef.value.getCropBlob(async (data) => {
+async function handleCropperOk(data) {
   try {
-    // loading.value = true
+    loading.value = true
     // 此处需上传图片,保存URL
     const formData = new FormData()
 
-    formData.append('uploadFile', fileList.value)
+    formData.append('uploadFile', data)
     formData.append('asImage', true)
     formData.append('fieldName', 'travelNotesBanner')
     const res = await request('/admin/app/tourismProjectTravelNotesWrite/upload', {
@@ -125,12 +118,11 @@ async function handleCropperOk() {
       body: formData
     })
     const url = res.data.fileUrl
+    loading.value = true
     bannerUrl.value = url
-    cropperDialogVisible.value = false
   } finally {
     loading.value = false
   }
-  // })
 }
 </script>
 

+ 1 - 1
src/components/CreateNote/PublishResultModal.client.vue

@@ -20,7 +20,7 @@
         <img
           @click="visible = false"
           class="w-full h-full"
-          src="../../assets/img/note-create/close.svg"
+          src="~/assets/img/note-create/close.svg"
           alt=""
         />
       </div>

+ 11 - 14
src/components/CreateNote/UserInfoModal.client.vue

@@ -13,11 +13,18 @@
         class="flex w-full flex-col items-center rounded-[20px] bg-gradient-to-b from-[#ffe6c0] to-[#fffffe] py-30"
       >
         <img
-          src="~/assets/img/note-create/userinfo_modal.jpg"
-          class="w-70 absolute right-13 top-5"
+          src="~/assets/img/note-create/userinfo_modal_h.png"
+          class="w-70 absolute left-10 top-5"
         />
+        <img
+          src="~/assets/img/note-create/user_xian.png"
+          class="w-114 absolute left-1/2 -translate-x-1/2 top-57 -tan z-50"
+        />
+        <div class="absolute top-10 right-10 z-100">
+          <img class="w-32 h-32" @click="visible = false" :src="close_circle" alt="" />
+        </div>
         <div class="text-xl font-semibold text-black-3">请完善您的个人信息</div>
-        <div class="mt-20 w-255 relative">
+        <div class="mt-20 w-255">
           <van-form
             ref="formRef"
             style="--van-cell-background: transparent !important"
@@ -98,24 +105,14 @@
           >
             提交
           </button>
-          <button
-            native-type="submit"
-            @click="visible = false"
-            class="flex h-40 w-110 cursor-pointer items-center justify-center rounded-full bg-primary text-xl font-semibold text-white hover:opacity-80"
-          >
-            取消
-          </button>
         </div>
       </template>
-      <!-- <div class="border fixed -bottom-20 left-1/2 z-100">
-        <img class="w-40 h-40" :src="close_circle" alt="" />
-      </div> -->
     </van-dialog>
   </div>
 </template>
 
 <script setup>
-import close_circle from '~/assets/img/note-create/close-circle.svg'
+import close_circle from '~/assets/img/note-create/close.svg'
 const visible = defineModel('visible', false)
 
 const emit = defineEmits(['submitOk'])

+ 8 - 16
src/components/Profile/Notes/Auditing/Item.vue

@@ -1,14 +1,18 @@
 <template>
   <van-swipe-cell>
-    <div class="relative group flex space-x-10 p-10 transition-all rounded-xl bg-[#FFF]">
-      <img
+    <div class="relative flex mb-10 border-[#fff] space-x-10 p-10 rounded-xl bg-[#FFF]">
+      
+      <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">
@@ -19,18 +23,6 @@
         <div class="absolute top-1/2 right-0 -translate-y-1/2 z-1 w-11 h-10">
           <img class="w-full h-full" :src="left_arrow" alt="" />
         </div>
-        <!-- <div @click="$emit('onRevoke')" class="flex mb-10 items-center space-x-5">
-          <div class="flex cursor-pointer items-center p-5 text-primary">
-            <span class="w-15 h-15">
-              <img
-                class="w-full h-full shrink-0 object-cover"
-                src="~/assets/img/note-create/cancel.svg"
-                alt=""
-              />
-            </span>
-            <span class="text-base">撤销审核</span>
-          </div>
-        </div> -->
       </div>
     </div>
 

+ 29 - 7
src/components/Profile/Notes/Auditing/index.vue

@@ -1,14 +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" class="flex flex-col divide-y">
-      <ProfileNotesAuditingItem
+    <div v-else-if="draftList.length">
+
+      <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>
@@ -16,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)
   }

+ 8 - 5
src/components/Profile/Notes/Draft/Item.vue

@@ -1,14 +1,17 @@
 <template>
   <van-swipe-cell>
-    <div class="relative group flex space-x-10 p-10 transition-all mb-10 bg-[#fff] rounded-xl">
-      <img
+    <div class="relative flex space-x-10 p-10 mb-10 bg-[#fff] rounded-xl">
+      <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 class="grid grid-cols-1">
+      <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

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

@@ -1,20 +1,19 @@
 <template>
   <van-swipe-cell>
-    <div class="relative group flex border-box p-10 transition-all 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="relative group flex border-box p-10 mb-10 bg-[#fff] rounded-xl">
+      <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>

+ 56 - 21
src/components/Profile/Notes/Published/index.vue

@@ -1,14 +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" />
@@ -20,11 +35,11 @@
 const showShare = ref(false)
 
 const options = [
-  { name: '微信', icon: 'wechat' },
-  { name: '微博', icon: 'weibo' },
-  { name: '复制链接', icon: 'link' },
-  { name: '分享海报', icon: 'poster' },
-  { name: '二维码', icon: 'qrcode' }
+  // { name: '微信', icon: 'wechat' },
+  // { name: '微博', icon: 'weibo' },
+  { name: '复制链接', icon: 'link' }
+  // { name: '分享海报', icon: 'poster' },
+  // { name: '二维码', icon: 'qrcode' }
 ]
 
 const yjId = ref(null)
@@ -39,7 +54,9 @@ const onSelectShare = (option) => {
     shareToWeChat('friend')
   } else if (option.name === '朋友圈') {
     shareToWeChat('timeline')
-  } else if (option.name === '复制链接') {
+  } else if (option.name == '复制链接') {
+    console.log(123)
+
     copyLink()
   }
   showShare.value = false
@@ -82,35 +99,53 @@ const shareToWeChat = (type) => {
   // })
 }
 
+// 复制链接
 const copyLink = () => {
   const url = `${import.meta.env.VITE_APP_BASE_URL}yj/${yjId.value}`
-  navigator.clipboard.writeText(url).then(() => {
-    showToast('链接已复制')
-  })
+  navigator.clipboard.writeText(url).then(
+    () => {
+      showNotify({ type: 'success', message: '链接已复制' })
+    },
+    () => {
+      showNotify({ message: '链接复制失败' })
+    }
+  )
 }
-// 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({

+ 7 - 5
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 transition-all mb-10 bg-[#fff] rounded-xl">
-      <img
+    <div class="relative group flex space-x-10 p-10 mb-10 bg-[#fff] rounded-xl">
+   
+      <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 || '未命名草稿' }}

+ 35 - 8
src/components/Profile/Notes/Rejected/index.vue

@@ -1,35 +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" class="grid grid-cols-1">
-      <ProfileNotesRejectedItem
+    <div v-else-if="draftList.length">
+
+      <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)
   }

+ 35 - 32
src/pages/note-create/index.client.vue

@@ -2,7 +2,21 @@
   <div v-if="!loading" class="box-border pb-85">
     <div v-if="!previewOptions.show">
       <CreateNoteHeaderBanner v-model:bannerUrl="noteJson.travelNotesBanner" />
-
+      <div class="mt-12">
+        <van-cell-group class="border" inset>
+          <van-field
+            v-model="noteJson.projectTitle"
+            rows="1"
+            autosize
+            clearable
+            type="textarea"
+            @update:model-value="handleInsertOrEditProjectTitle"
+            placeholder="从这里开始游记大标题..."
+            maxlength="50"
+            show-word-limit
+          ></van-field>
+        </van-cell-group>
+      </div>
       <CreateNoteForm
         v-model:departureTime="noteJson.departureTime"
         v-model:countTimes="noteJson.countTimes"
@@ -18,25 +32,11 @@
         <div class="w-2 h-14 bg-[#FF9300] mr-16"></div>
         <h1 class="text-sm font-bold">编辑游记文章</h1>
       </div>
-      <div class="mb-12">
-        <van-cell-group class="border" inset>
-          <van-field
-            v-model="noteJson.projectTitle"
-            rows="1"
-            autosize
-            clearable
-            type="textarea"
-            @update:model-value="handleInsertOrEditProjectTitle"
-            placeholder="从这里开始游记大标题..."
-            maxlength="50"
-            show-word-limit
-          ></van-field>
-        </van-cell-group>
-      </div>
+
       <VueDraggable v-model="noteJson.travelNotesContent" :options="dragOptions">
         <template v-for="(item, index) in noteJson.travelNotesContent" :key="item.tmpId">
-          <div v-if="item.type === defaultSectionTitle.type" class="h-50 mb-12 relative box-border">
-            <van-cell-group class="border h-full" inset>
+          <div v-if="item.type === defaultSectionTitle.type" class="h-50 mb-12 box-border">
+            <van-cell-group class="border h-full focus:border-[#FF9300]" inset>
               <van-field
                 v-model="item.content"
                 rows="1"
@@ -68,7 +68,10 @@
             class="h-100 mb-12 relative box-border"
           >
             <!-- focus:outline-none focus:caret-[#FF9300] active:border-[#FF9300]  focus:border-[#FF9300]-->
-            <van-cell-group class="border h-full" inset>
+            <van-cell-group
+              class="border h-full active:shadow-[_0px_6px_4px_0px_rgba(0,0,0,0.25)]"
+              inset
+            >
               <van-field
                 autofocus
                 v-model="item.content"
@@ -148,7 +151,7 @@
                 <div
                   class="w-86 flex justify-between items-center h-16 absolute top-10 right-26 z-100"
                 >
-                  <span @click="handleSaveCover(item)" class="text-sm text-black-3">
+                  <span @click="showToast('请上传图片')" class="text-sm text-black-3">
                     设为封面图
                   </span>
                   <div class="w-16 h-16 inline-block">
@@ -397,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, // 是否禁用拖拽
@@ -429,6 +431,7 @@ const defaultNoteJson = {
   travelNotesBanner: null,
   projectTitle: null,
   departureTime: null,
+  endPlaceId: null,
   countTimes: null,
   endPlace: null,
   role: null,
@@ -472,7 +475,6 @@ const draftDialogContent = {
 const showDialog = (parmas) => {
   showConfirmDialog(parmas)
     .then(() => {
-      // getNoteDetail()
       handleSaveDraft()
     })
     .catch(() => {})
@@ -595,15 +597,6 @@ async function handleCropperOk(data) {
 
 /******************插入图片逻辑*******************/
 
-// function handleInsertImageOk(fileUrlList) {
-//   const imageList = fileUrlList.map((e) => ({
-//     type: defaultSectionImage.type,
-//     content: e.fileUrl,
-//     tmpId: nanoid()
-//   }))
-//   noteJson.travelNotesContent = (noteJson.travelNotesContent ?? []).concat(imageList)
-// }
-
 function handleDeleteImage(index) {
   showConfirmDialog(deleteDialogContent)
     .then(() => {
@@ -625,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',
@@ -704,9 +702,14 @@ async function handlePublish() {
 }
 
 const publishLoading = ref(false)
+// async
 async function requestPublish() {
   try {
     publishLoading.value = true
+
+    noteJson.endPlace = noteJson.endPlaceId
+    delete noteJson.endPlaceId
+   
     await request('/website/tourism/publishTravelNotes/publishDraft', {
       method: 'post',
       body: {

+ 4 - 3
src/pages/profile/index.vue

@@ -3,20 +3,21 @@
     <div
       class="h-250 relative w-full bg-[url('~/assets/img/profile/profile_banner.png')] bg-no-repeat bg-cover"
     >
-      <div class="absolute left-20 bottom-10 right-20">
+      <div class="absolute left-20 bottom-10 right-20 text-black-3">
         <NuxtLink to="/profile/userInfo" class="flex items-center space-x-10">
           <van-image
             :src="userInfo.headImageUrl"
+            class="shrink-0"
             width="75px"
             height="75px"
             fit="cover"
             radius="37.5px"
           />
-          <span class="text-2xl break-all font-semibold text-white">
+          <span class="text-2xl flex-1 break-all font-semibold">
             {{ userInfo.showName }}</span
           >
         </NuxtLink>
-        <div class="text-xl break-all text-white font-semibold mt-15">
+        <div class="text-xl break-all font-semibold mt-15">
           个性签名:{{ userInfo.personalSign || "暂未填写" }}
         </div>
       </div>

+ 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 />

+ 54 - 16
src/pages/profile/userInfo.vue → src/pages/profile/userInfo.client.vue

@@ -4,16 +4,36 @@
       <van-cell-group inset>
         <van-field name="uploader" label="头像">
           <template #input>
-            <van-uploader
+            <div @click="handleChangeAvatar">
+              <van-image
+                v-if="form.headImageUrl"
+                :src="form.headImageUrl"
+                width="75px"
+                height="75px"
+                radius="37.5px"
+              />
+              <div
+                v-else
+                class="w-75 h-75 rounded-full bg-black-d flex items-center justify-center"
+              >
+                <span
+                  class="iconfont icon-profile text-black-6"
+                  style="font-size: 36px"
+                ></span>
+              </div>
+            </div>
+
+            <!-- <van-uploader
               style="--van-uploader-border-radius: 40px"
               :after-read="afterRead"
-              v-model="fileList"
               :max-count="1"
               :deletable="false"
               :multiple="false"
+              v-model="fileList"
+              result-type="file"
               accept="image/*"
               reupload
-            />
+            /> -->
           </template>
         </van-field>
         <van-field
@@ -89,8 +109,6 @@
 const userInfoStore = useUserInfoStore();
 const { userInfo } = storeToRefs(userInfoStore);
 
-const fileList = ref([]);
-
 const form = reactive({
   showName: null,
   email: null,
@@ -107,21 +125,40 @@ const validatorEmail = (val) =>
     val
   );
 
-async function afterRead(file) {
-  console.log(file);
+const { open, onChange } = useFileDialog({
+  accept: ".png,.png,.jpeg,.JPG,Png ",
+});
+
+function handleChangeAvatar() {
+  open();
+}
+
+onChange(async (files) => {
+  if (!files.length) return;
+
   const formData = new FormData();
-  formData.append("uploadFile", file.file);
+  formData.append("uploadFile", files[0]);
   formData.append("asImage", true);
   formData.append("fieldName", "headImageUrl");
+
   try {
+    showLoadingToast({
+      message: "图片上传中...",
+      duration: 1000000,
+    });
     const { data } = await request("/website/tourism/user/upload", {
       method: "post",
       body: formData,
     });
     form.headImageUrl = data.fileUrl;
-    userInfoStore.getUserInfo();
-  } catch (error) {}
-}
+    closeToast();
+    // userInfoStore.getUserInfo();
+  } catch (error) {
+    closeToast();
+    showToast("图片上传失败");
+    console.log("图片上传失败");
+  }
+});
 
 watch(
   userInfo,
@@ -130,9 +167,6 @@ watch(
     form.email = userInfo.value.email;
     form.sex = userInfo.value.sex;
     form.headImageUrl = userInfo.value.headImageUrl;
-    fileList.value[0] = {
-      url: userInfo.value.headImageUrl,
-    };
     form.address = userInfo.value.address;
     form.job = userInfo.value.job;
     form.personalSign = userInfo.value.personalSign;
@@ -151,11 +185,15 @@ async function handleSubmit() {
   try {
     await request("/website/tourism/user/update", {
       method: "post",
-      body: form,
+      body: {
+        ...form,
+      },
     });
     showToast("保存成功");
     userInfoStore.getUserInfo();
-  } catch (error) {}
+  } catch (error) {
+    console.log(error);
+  }
 }
 </script>
 

+ 1 - 0
src/pages/travel-projects/index.client.vue

@@ -104,6 +104,7 @@ function handleCountryClick(item) {
 function reSearch() {
   requestQuery.pageNum = 1;
   listData.value = [];
+  finished.value = false;
   getList();
 }