Przeglądaj źródła

1.修改商品详情页添加购物车成功提示信息,
2.修改个人中心图片加载时变形问题;
3.修改个人中心点订单各个状态到订单列表页显示应是对应的订单状态

ext.liuqiwen3 1 tydzień temu
rodzic
commit
6429d76316

+ 1 - 1
pages/goods/goods_details/index.vue

@@ -918,7 +918,7 @@
 				};
 				await postCartAdd(params);
 				Toast({
-					title: "添加购物车成功",
+					title: "添加成功",
 					icon: "success",
 					success: () => getCartCount(true),
 				});

+ 36 - 10
pages/order_list/index.vue

@@ -29,6 +29,7 @@
 		onMounted
 	} from "vue";
 	import {
+    onLoad,
 		onShow,
 		onReachBottom
 	} from "@dcloudio/uni-app";
@@ -86,24 +87,30 @@
 
 	const list = ref([{
 			name: '待付款',
-			orderStatus: 0
+			orderStatus: 0,
+      value: 0
 		},
 		{
 			name: '待发货',
-			orderStatus: 1
+			orderStatus: 1,
+      value: 1
 		},
 		{
 			name: '待收货',
-			orderStatus: 2
+			orderStatus: 2,
+      value: 2
 		},
+    {
+      name: '退款/换货',
+      orderStatus: -3,
+      value: 3
+    },
 		{
 			name: '已完成',
-			orderStatus: 4
-		},
-		{
-			name: '退货/退款',
-			orderStatus: -3
+			orderStatus: 4,
+      value: 4
 		},
+
 	]) //头部导航
 
 	// 生命周期
@@ -120,7 +127,6 @@
 	});
 
 	// 页面显示时
-
 	onShow(() => {
 		if (appStore.isLogin) {
 			loadend.value = false;
@@ -132,7 +138,27 @@
 			toLogin();
 		}
 	});
+  onLoad((options) => {
+    if (options.status) {
+      const statusValue = parseInt(options.status);
+
+      // 验证状态是否有效
+      const validStatuses = [0, 1, 2, 4, -3];
+      if (validStatuses.includes(statusValue)) {
+        // 设置状态
+        orderStatus.value = statusValue;
+        // 找到对应的索引
+        const index = list.value.findIndex(item => item.orderStatus === statusValue);
+        if (index !== -1) {
+          oldOrderStatus.value = index;  // 设置索引值
+        }
 
+        console.log("设置订单状态为:", statusValue, "索引为:", index);
+      } else {
+        console.warn("无效的状态参数:", statusValue);
+      }
+    }
+  })
 	// 下拉加载
 	onReachBottom(() => {
 		getOrderListFn();
@@ -226,7 +252,7 @@
 	}
 
 	function statusClick(item) {
-
+    console.log(item)
 		if (item.orderStatus === orderStatus.value) return;
 		
 		orderStatus.value = item.orderStatus;

+ 2 - 2
pages/user/index.vue

@@ -176,7 +176,7 @@
 
               :src="item.iconUrl"
               mode="widthFix"
-              :style="{ width: (item.iconSize || '60') + 'rpx' }"
+              :style="{ width: (item.iconSize || '60') + 'rpx',height: (item.iconSize || '60') + 'rpx' }"
             ></image>
           </view>
           <text class="function-name">{{ item.iconName }}</text>
@@ -388,7 +388,7 @@ const orderStatus = ref([
   {
     src: `${HTTP_REQUEST_URL_IMG}setting/tuikuan.png`,
     name: "退款/换货",
-    id: 5,
+    id: -3,
   },
   {
     src: `${HTTP_REQUEST_URL_IMG}setting/yiwancheng.png`,