Ver código fonte

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

qiao 2 meses atrás
pai
commit
555b56c754

+ 7 - 1
src/components/Car/Search/CarList/Item.vue

@@ -23,7 +23,13 @@
       </div>
       <div class="flex items-center space-x-10">
         <span class="text-base font-semibold text-black-6">评分</span>
-        <van-rate disabled :size="14" v-model="itemData.score" />
+        <van-rate
+          disabled
+          :size="14"
+          v-model="itemData.score"
+          disabled-color="#FD9A00"
+          color="#FD9A00"
+        />
       </div>
       <div class="flex items-center justify-between">
         <div>

+ 73 - 89
src/components/NavigationBar/LeftMenu.vue

@@ -5,22 +5,13 @@
     </div>
     <div class="px-20">
       <NuxtLink v-if="!token" to="/login" class="flex items-center space-x-15">
-        <div
-          class="flex items-center justify-center bg-[#d9d9d9] rounded-full h-60 w-60"
-        >
-          <span
-            class="iconfont icon-profile text-black-6"
-            style="font-size: 30px"
-          ></span>
+        <div class="flex items-center justify-center bg-[#d9d9d9] rounded-full h-60 w-60">
+          <span class="iconfont icon-profile text-black-6" style="font-size: 30px"></span>
         </div>
         <span class="text-black-6 text-base">登录</span>
       </NuxtLink>
 
-      <div
-        @click="handleToProfile"
-        v-else-if="token"
-        class="flex items-center space-x-15"
-      >
+      <div @click="handleToProfile" v-else-if="token" class="flex items-center space-x-15">
         <van-image
           :src="userInfo.headImageUrl || defaultAvatar"
           height="60"
@@ -34,9 +25,7 @@
           </div>
           <div v-if="userInfo.personalSign" class="text-black-6 text-sm">
             <span class="text-black-6">个性签名:</span>
-            <span class="text-black-3 break-all">{{
-              userInfo.personalSign
-            }}</span>
+            <span class="text-black-3 break-all">{{ userInfo.personalSign }}</span>
           </div>
         </div>
       </div>
@@ -69,147 +58,142 @@
       </div>
     </div>
 
-    <van-button
-      v-if="token"
-      round=""
-      @click="handleLogout"
-      plain
-      style="margin: 20px 20px"
-      >退出登录</van-button
-    >
+    <van-button v-if="token" round="" @click="handleLogout" plain style="margin: 20px 20px">
+      退出登录
+    </van-button>
   </div>
 </template>
 
 <script setup>
-import menu_travel_home from "~/assets/img/navbar/menu_home.png";
-import menu_car from "@/assets/img/navbar/menu_car.png";
-import menu_create_note from "@/assets/img/navbar/menu_create_note.png";
-import menu_house from "@/assets/img/navbar/menu_house.png";
-import menu_labour from "@/assets/img/navbar/menu_loubar.png";
-import menu_tickets from "@/assets/img/navbar/menu_tickets.png";
-import menu_travel_note from "@/assets/img/navbar/menu_travel_note.png";
-import menu_travel_project from "@/assets/img/navbar/menu_travel_project.png";
-import menu_visa from "@/assets/img/navbar/menu_visa.png";
-import menu_profile from "@/assets/img/navbar/menu_profile.png";
-import defaultAvatar from "~/assets/img/default_avatar.png";
-import LeftMenuItem from "./LeftMenuItem.vue";
+import menu_travel_home from '~/assets/img/navbar/menu_home.png'
+import menu_car from '@/assets/img/navbar/menu_car.png'
+import menu_create_note from '@/assets/img/navbar/menu_create_note.png'
+import menu_house from '@/assets/img/navbar/menu_house.png'
+import menu_labour from '@/assets/img/navbar/menu_loubar.png'
+import menu_tickets from '@/assets/img/navbar/menu_tickets.png'
+import menu_travel_note from '@/assets/img/navbar/menu_travel_note.png'
+import menu_travel_project from '@/assets/img/navbar/menu_travel_project.png'
+import menu_visa from '@/assets/img/navbar/menu_visa.png'
+import menu_profile from '@/assets/img/navbar/menu_profile.png'
+import defaultAvatar from '~/assets/img/default_avatar.png'
+import LeftMenuItem from './LeftMenuItem.vue'
 
-const visible = defineModel("visible");
+const visible = defineModel('visible')
 
-const route = useRoute();
+const route = useRoute()
 
-const authStore = useAuthStore();
-const { token } = storeToRefs(authStore);
+const authStore = useAuthStore()
+const { token } = storeToRefs(authStore)
 
-const userInfoStore = useUserInfoStore();
-const { userInfo } = storeToRefs(userInfoStore);
+const userInfoStore = useUserInfoStore()
+const { userInfo } = storeToRefs(userInfoStore)
 
-const menuData = ref([]);
+const menuData = ref([])
 
 const writeNoteMenu = {
-  title: "写游记",
+  title: '写游记',
   icon: menu_create_note,
-  to: "/note-create",
-};
+  to: '/note-create'
+}
 
 const fixedMenuData = [
   {
-    title: "首页",
+    title: '首页',
     icon: menu_travel_home,
-    to: "/",
+    to: '/'
   },
   {
-    title: "游记",
+    title: '游记',
     icon: menu_travel_note,
-    to: "/travel-notes",
+    to: '/travel-notes'
   },
   {
-    title: "旅游项目",
+    title: '旅游项目',
     icon: menu_travel_project,
-    to: "/travel-projects",
+    to: '/travel-projects'
   },
   {
-    title: "签证居留",
+    title: '签证居留',
     icon: menu_visa,
-    to: "/visa",
+    to: '/visa'
   },
   {
-    title: "全球包车",
+    title: '全球包车',
     icon: menu_car,
-    to: "/car",
+    to: '/car'
   },
   {
-    title: "买房卖房",
+    title: '买房卖房',
     icon: menu_house,
-    to: "/house",
-  },
-];
+    to: '/house'
+  }
+]
 
 const profileMenu = [
   {
-    title: "旅游订单",
-    to: "/profile/travel-orders",
+    title: '旅游订单',
+    to: '/profile/travel-orders'
   },
   {
-    title: "包车订单",
-    to: "/profile/car-orders",
+    title: '包车订单',
+    to: '/profile/car-orders'
   },
   {
-    title: "签证订单",
-    to: "/profile/visa-orders",
+    title: '签证订单',
+    to: '/profile/visa-orders'
   },
   {
-    title: "我的收藏",
-    to: "/profile/collection",
+    title: '我的收藏',
+    to: '/profile/collection'
   },
   {
-    title: "我的游记",
-    to: "/profile/notes",
+    title: '我的游记',
+    to: '/profile/notes'
   },
   {
-    title: "我的评论",
-    to: "/",
-  },
-];
+    title: '我的评论',
+    to: '/profile/my-comment'
+  }
+]
 
-const isProfileMenuExpanded = ref(false);
+const isProfileMenuExpanded = ref(false)
 
 watch(
   token,
   (val) => {
     if (!val) {
-      menuData.value = fixedMenuData;
+      menuData.value = fixedMenuData
     } else {
-      userInfoStore.getUserInfo();
-      menuData.value = [...fixedMenuData, writeNoteMenu];
+      userInfoStore.getUserInfo()
+      menuData.value = [...fixedMenuData, writeNoteMenu]
     }
   },
   {
-    immediate: true,
+    immediate: true
   }
-);
+)
 
 function handleClickMenu(item) {
-  visible.value = false;
+  visible.value = false
   navigateTo({
-    path: item.to,
-  });
+    path: item.to
+  })
 }
 
 function handleToProfile() {
-  visible.value = false;
+  visible.value = false
   navigateTo({
-    path: "/profile",
-  });
+    path: '/profile'
+  })
 }
 
 function handleLogout() {
   try {
-    request("/website/web/doLogout", { method: "post" });
+    request('/website/web/doLogout', { method: 'post' })
   } finally {
-    authStore.cleanToken();
-    navigateTo("/");
-    visible.value = false;
+    authStore.cleanToken()
+    navigateTo('/')
+    visible.value = false
   }
 }
 </script>

+ 15 - 1
src/pages/car/search.client.vue

@@ -21,6 +21,9 @@
 <script setup>
 const route = useRoute();
 
+// const authStore = useAuthStore();
+// const { token } = storeToRefs(authStore);
+
 const selectedCar = ref({});
 const selectedDriver = ref({});
 
@@ -60,7 +63,18 @@ function handleSelectDriver(driver) {
   toBookOrder();
 }
 
-function toBookOrder() {
+async function toBookOrder() {
+  // if (!token.value) {
+  //   await navigateTo({
+  //     path: "/login",
+  //     replace: true,
+  //     query: {
+  //       redirect: route.fullPath,
+  //     },
+  //   });
+
+  //   return;
+  // }
   navigateTo({
     path: "/car/submit-order",
     query: {

+ 15 - 0
src/pages/car/submit-order.client.vue

@@ -113,6 +113,9 @@
 <script setup>
 const route = useRoute();
 
+const authStore = useAuthStore();
+const { token } = storeToRefs(authStore);
+
 const useUserInfo = useUserInfoStore();
 const { userInfo } = storeToRefs(useUserInfo);
 
@@ -171,6 +174,18 @@ function onSubmit(val) {
  * handleSubmit()
  */
 async function handleSubmit() {
+  if (!token.value) {
+    navigateTo({
+      path: "/login",
+      query: {
+        redirect: route.path,
+        ...route.query,
+      },
+      replace: true,
+    });
+    return;
+  }
+
   if (!formData.connectPhone) {
     showToast("请填写手机号");
     return;

+ 1 - 0
src/pages/profile/car-orders.vue

@@ -37,6 +37,7 @@
             </div>
             <span>{{ item.startPlaceIdDictMap?.name ?? "" }}</span>
             <span>{{ item.categoryTypeDictMap?.name ?? "" }}</span>
+            <span v-if="item.driveMark || item.categoryMark">已打分</span>
           </div>
           <div>
             <span class="text-[#FF1717] font-semibold"

+ 1 - 0
src/pages/profile/my-comment.vue

@@ -289,6 +289,7 @@ const commentDropdownMenuList = [
 function onCommentFilterClose(value) {
   commentIndex.value = value
   document.title = value == 0 ? '我的评论' : value == 1 ? '收到的评论' : '发出的评论'
+  commentList.value = []
   getMyCommentList()
 }