songzhen 1 mesiac pred
rodič
commit
0771472cdf

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

@@ -27,7 +27,7 @@
       </div>
       <div class="flex items-center">
         <span class="flex-1 truncate text-3xl font-semibold text-[#FF1D1D]"
-          >{{ itemData.price }}{{ itemData.unit }}</span
+          >{{ itemData.unit }}{{ itemData.price }}</span
         >
         <span class="shrink-0 text-sm text-black-9">(10小时)</span>
       </div>

+ 18 - 6
src/components/NavBar/Login.client.vue

@@ -1,12 +1,12 @@
 <template>
   <template v-if="!token">
-    <NuxtLink
-      :to="`/login?redirect=${$route.fullPath}`"
+    <div
+      @click="handleToLogin"
       class="flex h-32 cursor-pointer items-center space-x-5 rounded-full bg-white px-20 text-base text-primary"
     >
       <span>登录</span>
       <span class="iconfont icon-profile" style="font-size: 18px"></span>
-    </NuxtLink>
+    </div>
   </template>
 
   <div v-else class="flex items-center space-x-10 text-sm">
@@ -41,7 +41,7 @@
             --el-menu-sub-item-height: 30px;
             --el-menu-item-font-size: 12px;
             --el-menu-text-color: #333;
-            --el-menu-active-color: #FD9A00
+            --el-menu-active-color: #fd9a00;
           "
         >
           <el-sub-menu index="1">
@@ -122,6 +122,18 @@ const { token } = storeToRefs(authStore)
 const userInfoStore = useUserInfoStore()
 const { userInfo } = storeToRefs(userInfoStore)
 
+const route = useRoute()
+async function handleToLogin() {
+  await navigateTo({
+    path: '/login',
+    query: {
+      redirect: route.path,
+      ...route.query
+    },
+    replace: true
+  })
+}
+
 watch(
   token,
   () => {
@@ -147,7 +159,7 @@ async function handleLogout() {
   border-right: none;
 }
 :deep(.el-menu-item:hover),
-:deep(.el-sub-menu__title:hover){
-  color: #FD9A00;
+:deep(.el-sub-menu__title:hover) {
+  color: #fd9a00;
 }
 </style>

+ 5 - 4
src/components/TravelDetail/NomalBookButton.vue

@@ -1,9 +1,6 @@
 <template>
   <div>
-    <el-button
-      @click="nomalBookModalOptions.show = true"
-      type="primary"
-      size="large"
+    <el-button @click="handleBook" type="primary" size="large"
       >单独购买</el-button
     >
     <TravelDetailNomalBookModal
@@ -33,6 +30,10 @@ const props = defineProps({
 const nomalBookModalOptions = reactive({
   show: false
 })
+async function handleBook() {
+  await needLogin()
+  nomalBookModalOptions.show = true
+}
 </script>
 
 <style lang="scss" scoped></style>

+ 4 - 1
src/components/TravelDetail/NomalBookModal.vue

@@ -59,7 +59,10 @@
                           calendarData[$dayjs(cell.date).format('YYYY-MM-DD')]
                             ?.adultPrice
                         "
-                        >¥{{
+                        >{{
+                          calendarData[$dayjs(cell.date).format('YYYY-MM-DD')]
+                            ?.priceUnit
+                        }}{{
                           calendarData[$dayjs(cell.date).format('YYYY-MM-DD')]
                             ?.adultPrice
                         }}</span

+ 6 - 4
src/components/TravelDetail/PinTuan/KaiTuanButton.vue

@@ -1,9 +1,6 @@
 <template>
   <div>
-    <el-button
-      @click="applyKaiTuanModalOptions.show = true"
-      type="primary"
-      size="large"
+    <el-button @click="handleKaituan" type="primary" size="large"
       >我要开团</el-button
     >
     <TravelDetailPinTuanKaiTuanApplyModal
@@ -16,6 +13,11 @@
 const applyKaiTuanModalOptions = reactive({
   show: false
 })
+
+async function handleKaituan() {
+  await needLogin()
+  applyKaiTuanModalOptions.show = true
+}
 </script>
 
 <style lang="scss" scoped></style>

+ 6 - 2
src/components/TravelDetail/PinTuan/ResultModal.vue

@@ -41,16 +41,20 @@
           </div>
         </template>
         <span v-else>拼团成功</span>
-        <div class="mt-20 w-[90%] bg-[#f7f8f9] p-10 text-base">
+        <div
+          v-if="pinTuanInfo.success == 0"
+          class="mt-20 w-[90%] bg-[#f7f8f9] p-10 text-base"
+        >
           <span>分享链接:</span>
           <span class="text-primary underline">{{ shareUrl }}</span>
         </div>
         <el-button
+          v-if="pinTuanInfo.success == 0"
           type="primary"
           size="large"
           style="width: 200px; margin-top: 20px"
           @click="handleCopy"
-          >复制并分享</el-button
+          >复制链接</el-button
         >
       </div>
     </el-dialog>

+ 2 - 1
src/components/TravelDetail/PinTuan/index.client.vue

@@ -217,7 +217,8 @@ const applyKaiTuanModalOptions = reactive({
   title: ''
 })
 
-function handlePinTuan() {
+async function handlePinTuan() {
+  needLogin()
   if (currentPinTuan.value.maxCount === currentPinTuan.value.nowCount) {
     applyKaiTuanModalOptions.show = true
     applyKaiTuanModalOptions.title =

+ 1 - 1
src/components/TravelProjectsHome/PinTuanProjects/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="flex justify-center">
     <div
-      class="relative h-[450px] w-wrap bg-yellow-100 bg-[url('~/assets/img/travel_project_home/travel_project_home_pintuan_bg.png')] bg-cover bg-no-repeat px-60 pt-40"
+      class="relative h-[450px] w-wrap bg-[url('~/assets/img/travel_project_home/travel_project_home_pintuan_bg.png')] bg-cover bg-no-repeat px-60 pt-40"
     >
       <ClientOnly>
         <swiper-container ref="containerRef">

+ 1 - 1
src/pages/car/submit-order.client.vue

@@ -105,7 +105,7 @@
       <div class="mt-40 flex justify-end">
         <div>
           <div class="text-6xl font-semibold text-[#FF0F0F]">
-            {{ orderPrice }}
+            {{ carInfo.unit }} {{ orderPrice }}
           </div>
           <el-button
             type="primary"

+ 1 - 1
src/pages/profile/car-order/[id].client.vue

@@ -18,7 +18,7 @@
           <div>
             <span class="label">订单金额:</span>
             <span class="text-[#FF1717]"
-              >{{ orderInfo.totalPrice }}{{ orderInfo.totalPriceUnit }}</span
+              >{{ orderInfo.totalPriceUnit }}{{ orderInfo.totalPrice }}</span
             >
           </div>
           <div>

+ 19 - 15
src/pages/profile/index.client.vue

@@ -46,19 +46,25 @@
             </template>
           </div>
           <template v-if="personalSign">
-            <div class="flex flex-row items-center mt-8 w-max text-nowrap text-sm text-black-3">
+            <div
+              class="mt-8 flex w-max flex-row items-center text-nowrap text-sm text-black-3"
+            >
               {{ personalSign }}
-                <el-popover
-                    v-if="isShowMore"
-                    placement="bottom-end"
-                    :width="200"
-                    trigger="hover"
-                >
-                  <span class="text-black-6 text-sm">{{ userInfo.personalSign }}</span>
-                  <template #reference>
-                    <span class="text-sm text-black-6 ml-5 cursor-pointer">更多</span>
-                  </template>
-                </el-popover>
+              <el-popover
+                v-if="isShowMore"
+                placement="bottom-end"
+                :width="200"
+                trigger="hover"
+              >
+                <span class="text-sm text-black-6">{{
+                  userInfo.personalSign
+                }}</span>
+                <template #reference>
+                  <span class="ml-5 cursor-pointer text-sm text-black-6"
+                    >更多</span
+                  >
+                </template>
+              </el-popover>
             </div>
           </template>
         </div>
@@ -138,7 +144,6 @@ const tabList = ref([
   { label: '获赞', listType: null, numText: '0' }
 ])
 
-
 // 个性签名显示逻辑
 let isShowMore = ref(false)
 const personalSign = computed(() => {
@@ -156,7 +161,6 @@ const personalSign = computed(() => {
   return personalSign.substring(0, 30) + '...'
 })
 
-
 const followModalProps = ref({
   visible: false,
   listType: null
@@ -200,7 +204,7 @@ onMounted(() => {
 
 <style lang="scss" scoped>
 .profile-page {
-  height: calc(100vh - 60px);
+  // height: calc(100vh - 60px);
   background: #e9f1f8;
 
   .page-content {

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

@@ -39,7 +39,7 @@
         <div class="flex items-center text-2xl font-bold">
           <span class="text-black-3">订单金额:</span>
           <span class="text-[#FF1717]"
-            >{{ item.totalPrice }}{{ item.totalPriceUnit }}</span
+            >{{ item.totalPriceUnit }}{{ item.totalPrice }}</span
           >
         </div>
         <div

+ 3 - 1
src/pages/profile/index/travel-orders.vue

@@ -42,7 +42,9 @@
               {{ formatStatus(item.orderStatus) }}
             </div>
           </div>
-          <div>日期:{{ $dayjs(item.departureDate).format('YYYY-MM-DD') }}</div>
+          <div>
+            出发日期:{{ $dayjs(item.departureDate).format('YYYY-MM-DD') }}
+          </div>
           <div>联系人:{{ item.customerName }}</div>
           <div v-if="item.tourProjectGroupPurchase" class="flex items-center">
             <span>拼团进度:</span>

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

@@ -16,7 +16,7 @@ async function getAmount() {
   const { data } = await request(
     '/website/app/tourProjectGroupPurchaseRebate/getTotalRebateAmount'
   )
-  totalAmount.value = data.rebateAmount
+  totalAmount.value = data.rebateAmount ?? 0
 }
 
 onMounted(() => {

+ 3 - 0
src/pages/t/[id].vue

@@ -75,6 +75,9 @@ const currentTab = ref(0)
 function handleTabsChange(index) {
   currentTab.value = index
 }
+
+const route = useRoute()
+console.log(route)
 </script>
 
 <style lang="scss" scoped></style>

+ 22 - 3
src/utils/index.js

@@ -4,12 +4,30 @@ import accounting from 'accounting'
 const setIntervalImmediately = (fn, duration) =>
   setInterval((() => (fn(), fn))(), duration)
 
-function jumpToLoginPage() {
+async function needLogin() {
   const route = useRoute()
+  const useAuth = useAuthStore()
+  const { token } = storeToRefs(useAuth)
+  if (!token.value) {
+    await navigateTo({
+      path: '/login',
+      query: {
+        redirect: route.fullPath,
+        ...route.query
+      },
+      replace: true
+    })
+    return
+  }
+}
 
-  navigateTo('/login', {
+function jumpToLoginPage() {
+  const route = useRoute()
+  navigateTo({
+    path: '/login',
     query: {
-      redirect: route.fullPath
+      redirect: route.path,
+      ...route.query
     },
     replace: true
   })
@@ -85,6 +103,7 @@ const formatNumber = (n) => {
 
 export {
   setIntervalImmediately,
+  needLogin,
   jumpToLoginPage,
   formatImgSrc,
   isEmail,