Xiao_123 5 ヶ月 前
コミット
b7aa762df5

+ 1 - 1
src/layout/index.vue

@@ -69,7 +69,7 @@ onMounted(async () => {
   z-index: 999;
 }
 .content {
-  min-height: calc(100vh - 256px);
+  min-height: calc(100vh - 242px);
   margin-top: 50px;
 }
 </style>

+ 4 - 2
src/views/mall/components/confirm_order/index.vue

@@ -29,12 +29,14 @@ defineOptions({name: 'confirm_order-index'})
 import Confirm from '@/plugins/confirm'
 import Snackbar from '@/plugins/snackbar'
 import { useI18n } from '@/hooks/web/useI18n'
-import { useRouter } from 'vue-router'; const router = useRouter()
+import { useRouter, useRoute } from 'vue-router'; const router = useRouter()
 import { computed, ref } from 'vue'
 import confirm from './confirm.vue'
 import pay from './pay.vue'
 const { t } = useI18n()
 
+const route = useRoute()
+const { spuId } = route.query
 const skuInfo = ref(localStorage.getItem('confirm_order_data')) // 购买商品规格信息
 
 const confirmRef = ref()
@@ -68,7 +70,7 @@ let closeConfirm = false // 关闭路由拦截
 
 const paySuccess = (e) => {
   closeConfirm = true
-  router.replace({ path: '/mall/payOver', query: { price: e.price, spuId: id, orderId: orderId.value } })
+  router.replace({ path: '/mall/payOver', query: { price: e.price, spuId, orderId: orderId.value } })
 }
 const payCancel = () => {
   Snackbar.warning('您已取消支付!')

+ 1 - 1
src/views/mall/components/details.vue

@@ -186,7 +186,7 @@ const onBuy = async (e) => {
 
   localStorage.setItem('confirm_order_data', data)
   nextTick(() => {
-    router.push('/mall/confirm_order')
+    router.push({path: '/mall/confirm_order', query: { price: e.price, spuId: id }})
   })
 }
 

+ 34 - 28
src/views/recruit/personal/PersonalCenter/tradeOrder/components/detail.vue

@@ -3,6 +3,33 @@
     <div class="default-width pb-5">
       <v-banner color="primary" :text="formatOrderStatusDescription(order)" style="background-color: #00897B; color: #fff;"></v-banner>
 
+      <!-- 商品列表 -->
+      <v-card class="my-3 pa-5">
+        <h3 class="mb-3">商品列表</h3>
+        <v-divider></v-divider>
+
+        <CtTable
+          class="mt-3"
+          :items="order.items"
+          :headers="headers"
+          :loading="false"
+          :elevation="0"
+          :isTools="false"
+          :showPage="false"
+          itemKey="id"
+        >
+          <template #picUrl="{ item }">
+            <v-img :src="item.picUrl" width="90" height="90" class="my-1"></v-img>
+          </template>
+          <template #spuName="{ item }">
+            <span class="color-primary cursor-pointer" @click="handleToGoodsDetail(item)">{{ item.spuName }}</span>
+          </template>
+        </CtTable>
+        <div class="text-end color-primary mr-3 mt-5 font-size-20">
+          共{{ order.productCount }}件商品,合计:¥{{ fen2yuan(order.payPrice) }}
+        </div>
+      </v-card>
+
       <v-row no-gutters class="mt-3">
         <v-col span="6">
           <!-- 订单信息 -->
@@ -31,33 +58,6 @@
           </v-card>
         </v-col>
       </v-row>
-
-      <!-- 商品列表 -->
-      <v-card class="my-3 pa-5">
-        <h3 class="mb-3">商品列表</h3>
-        <v-divider></v-divider>
-
-        <CtTable
-          class="mt-3"
-          :items="order.items"
-          :headers="headers"
-          :loading="false"
-          :elevation="0"
-          :isTools="false"
-          :showPage="false"
-          itemKey="id"
-        >
-          <template #picUrl="{ item }">
-            <v-img :src="item.picUrl" width="90" height="90"></v-img>
-          </template>
-          <template #spuName="{ item }">
-            <span class="color-primary cursor-pointer" @click="handleToGoodsDetail(item)">{{ item.spuName }}</span>
-          </template>
-        </CtTable>
-        <div class="text-end color-primary mr-3 mt-5 font-size-20">
-          共{{ order.productCount }}件商品,合计:¥{{ fen2yuan(order.payPrice) }}
-        </div>
-      </v-card>
     </div>
   </div>
 </template>
@@ -84,8 +84,14 @@ const headers = [
 ]
 
 onMounted(async () =>{
-  if (!id) return Snackbar.error('订单不存在')
   const data = await getMallOrderDetail(id)
+  if (!data) {
+    Snackbar.warning('订单不存在')
+    setTimeout(() => {
+      window.close()
+    }, 1000)
+    return
+  }
   order.value = data
 })