Procházet zdrojové kódy

用户订单状态修改

jiayubo před 1 týdnem
rodič
revize
8c91c41a29
4 změnil soubory, kde provedl 42 přidání a 24 odebrání
  1. 8 8
      api/userList.js
  2. 1 1
      config.js
  3. 0 1
      pages/classify.vue
  4. 33 14
      pages/common/classify/orderlist.vue

+ 8 - 8
api/userList.js

@@ -21,14 +21,14 @@ export function orderInfomainOrderId(mainOrderId) {
 //获取用户订单列表状态
 export function systemDictdaTalist() {
 	return request({
-		url: `/system/dict/data/list`,
-		method: 'get',
-		params: {
-			pageNum: 1,
-			pageSize: 10,
-			dictType: 'order_status'
-		}
-	})
+    url: `/system/dict/data/list`,
+    method: 'get',
+    params: {
+      pageNum: 1,
+      pageSize: 10,
+      dictType: 'lrr_service_status',
+    },
+  })
 }
 
 // 用户评价小订单

+ 1 - 1
config.js

@@ -3,7 +3,7 @@ const config = {
 	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
 	//cloud后台网关地址
 	baseUrl: 'http://192.168.100.95:9527',//嵘哥
-	baseUrl: 'http://192.168.100.121:9527',//龙哥
+	// baseUrl: 'http://192.168.100.121:9527',//龙哥
 	// baseUrl: 'https://zybooks.tech/prod-api',
 	mapKey:'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
 	appName: '金邻助家',

+ 0 - 1
pages/classify.vue

@@ -101,7 +101,6 @@
   console.log('进入');
   try {
     const res = await systemDictdaTalist().catch(err => {
-      console.error('接口请求失败:', err);
       throw err; // 重新抛出以进入 catch 块
     });
     console.log(res, '用户状态获取成功');

+ 33 - 14
pages/common/classify/orderlist.vue

@@ -38,16 +38,22 @@
 							</view>
 							<view class="Wrap-Btn">
 								<!-- 沟通按钮 -->
-								<up-button type="primary" text="沟通"  shape="circle" :customStyle="wrapqx">
+								<up-button type="primary" text="沟通" shape="circle" :customStyle="wrapqx">
 								</up-button>
 
 								<!-- 当 orderStatus 为 3 显示退款按钮 -->
 								<up-button v-if="item.orderStatus === '3'" type="error" text="退款" 
-									shape="circle":customStyle="wrapqx" @click="handleRefund(item)" >
+									shape="circle" :customStyle="wrapqx" @click="handleRefund(item)">
 								</up-button>
 
-								<!-- 否则显示查看按钮 -->
-								<up-button v-else type="error" text="查看"  shape="circle" :customStyle="wrapqx"
+								<!-- 当 orderStatus 为 1 显示取消订单按钮 -->
+								<up-button v-if="item.orderStatus === '1'" type="warning" text="取消" 
+									shape="circle" :customStyle="wrapqx" @click="handleCancel(item)">
+								</up-button>
+
+								<!-- 其他状态显示查看按钮 -->
+								<up-button v-if="item.orderStatus !== '1' && item.orderStatus !== '3'" 
+									type="info" text="查看" shape="circle" :customStyle="wrapqx"
 									@click="handlClick(item)">
 								</up-button>
 							</view>
@@ -93,7 +99,7 @@
 			value: "4",
 		},
 		{
-			name: "已取消",
+			name: "售后",
 			value: "2",
 		}
 	]
@@ -130,13 +136,6 @@
 		});
 	}
 
-	// 评论
-	const handleComment = () => {
-		uni.navigateTo({
-			url: `/pages_classify/pages/orderItem/userComment`
-		});
-	}
-
 	function onChange(tabItem) {
 		emits('fetchData', tabItem.value)
 	}
@@ -152,7 +151,26 @@
 	const wrapqx = {
 		height: '50rpx',
 		width: '100rpx',
+		marginLeft: '8rpx'
 	}
+
+	// 取消订单
+	const handleCancel = (item) => {
+		const mainOrderId = item.mainOrderId;
+		uni.showModal({
+			title: '提示',
+			content: '确定要取消该订单吗?',
+			success: function(res) {
+				if (res.confirm) {
+					// TODO: 调用取消订单接口
+					uni.showToast({
+						title: '订单已取消',
+						icon: 'success'
+					});
+				}
+			}
+		});
+	};
 </script>
 
 <style scoped>
@@ -212,8 +230,9 @@
 
 	.Wrap-Btn {
 		display: flex;
-		gap: 6px;
-		/* 按钮间距 */
+		gap: 8px;
+		flex-wrap: wrap;
+		justify-content: flex-end;
 	}
 
 </style>