Forráskód Böngészése

联调团餐订单、订单明细;

郭鹏飞 10 hónapja
szülő
commit
7034731910

+ 4 - 1
components/list-scroll-view/index.vue

@@ -81,7 +81,7 @@ export default {
 					use: true,
 					tip: this.emptyText || '暂无数据',
 					btnText: this.emptyBtnText,
-					icon: '/static/common/empty.png',
+					// icon: '/static/common/empty.png',
 				}
 			};
 			return obj;
@@ -144,6 +144,9 @@ export default {
 					// 数据
 					this.dataList = this.dataList.concat(records);
 					this.mescroll.endBySize(records.length, result.total || result[this.keyName].total);
+				} else {
+					this.$tip.error('数据请求发生错误');
+					this.mescroll.endErr();
 				}
 			}).catch(e => {
 				this.mescroll.endErr();

+ 7 - 0
pages/groupMeal/goods/list.vue

@@ -19,6 +19,7 @@
 					padding: '0 20rpx',
 					borderLeft: '1rpx solid #DDDDDD'
 				}"
+				@search="onSearch" @custom="onSearch"
 			></u-search>
 		</view>
 
@@ -200,6 +201,7 @@ export default {
 			if (this.currentStatusTab == 0) {
 				params = {
 					status: 1,
+					reviewStatus: 1,
 				}
 			}
 			// 审核中 
@@ -260,6 +262,11 @@ export default {
 				}));
 			}
 		},
+		onSearch(value) {
+			this.$refs[`listScroll`].reloadList({
+				queryName: value,
+			});
+		},
 		// 主分类事件
 		onTabChange(e) {
 			this.currentStatusTab = e;

+ 198 - 48
pages/groupMeal/orders/order-alist.vue

@@ -5,7 +5,7 @@
 			<view class="navbar-title">团餐订单</view>
 			<view slot="right" class="navbar-right">
 				<text class="nav-btn" @click="goToDetail">订单明细</text>
-				<text class="nav-btn manage-btn" @click="toggleManageMode">{{ isManaging ? '退出管理' : '批量管理' }}</text>
+				<text class="nav-btn manage-btn" v-if="currentStatusTab == 0" @click="toggleManageMode">{{ isManaging ? '退出管理' : '批量管理' }}</text>
 			</view>
 		</u-navbar>
 
@@ -19,6 +19,7 @@
 					padding: '0 20rpx',
 					borderLeft: '1rpx solid #DDDDDD'
 				}"
+				@search="onSearch" @custom="onSearch"
 			></u-search>
 		</view>
 
@@ -39,28 +40,60 @@
 		></u-tabs>
 
 		<!-- 订单列表 -->
-		<scroll-view scroll-y class="order-scroll-view" :style="{ paddingBottom: isManaging ? '120rpx' : '0' }">
-			<u-checkbox-group v-model="selectedOrders" placement="column">
-				<view class="order-card" v-for="item in filteredOrders" :key="item.id">
-					<u-image width="100rpx" height="100rpx" border-radius="12rpx" :src="item.image" mode="aspectFill"></u-image>
-					<view class="order-info">
-						<view class="order-title">{{ item.title }}</view>
-						<view class="order-line">
-							<view class="leader-name">团长姓名{{ item.leaderName }}</view>
-							<view class="quantity-tag">团购数量{{ item.quantity }}</view>
+		<view class="order-scroll-view" :style="{ paddingBottom: isManaging ? '120rpx' : '0' }">
+			<ListScrollView ref="listScroll" 
+				:api="api"
+				:init="{
+					...initParams,
+				}">
+				<template v-slot:list="{ data }">
+					<u-checkbox-group width="40rpx" inactiveColor="#fff" placement="column"
+						v-model="selectedOrders"
+						@change="onSelect"
+					>
+						<view class="order-item" v-for="item in data" :key="item.orderId">
+							<view class="order-header">
+								<view class="location-box">
+									<view class="location-info">
+										<view class="name">
+											<!-- <u-image width="40rpx" height="40rpx" src="/static/groupMeal/icon_user.png"></u-image> -->
+											<u-icon name="account" color="#000000" size="30"></u-icon>
+											<text>{{ item.headName }}</text>
+										</view>
+										<view class="desc">
+											<text>合计份数:</text>
+											<text class="val">{{ item.buyNumber }}份</text>
+										</view>
+									</view>
+									<view class="location-address">
+										<view class="atext">{{ item.address }}</view>
+										<view class="btext">{{ item.region }}</view>
+									</view>
+								</view>
+								<view class="order-actions" v-if="isManaging">
+									<u-checkbox :name="item.orderId" shape="circle" v-model="item.checked"></u-checkbox>
+								</view>
+							</view>
+							<view class="order-card" v-for="(eItem, ei) in item.merchantPackageOrderDTOS" :key="ei">
+								<u-image width="84rpx" height="84rpx" border-radius="12rpx" :src="eItem.productImage && `${$config.apiUrl}/${eItem.productImage.split(',')[0]}`" mode="aspectFill"></u-image>
+								<view class="order-info">
+									<view class="order-title">{{ eItem.packageName }}</view>
+									<view class="order-line">
+										<view class="leader-name">{{ eItem.dishName }}</view>
+										<view class="quantity-tag">{{ eItem.numberUserCount }}份</view>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-					<view class="order-actions" v-if="isManaging">
-						<u-checkbox :name="item.id" shape="circle" v-model="item.checked"></u-checkbox>
-					</view>
-				</view>
-			</u-checkbox-group>
-		</scroll-view>
+					</u-checkbox-group>
+				</template>
+			</ListScrollView>
+		</view>
 
 		<!-- 批量操作底部栏 -->
 		<view class="footer-bar" v-if="isManaging">
 			<u-checkbox-group v-model="isAllSelected" placement="row">
-				<u-checkbox name="all" shape="circle" v-model="isAllSelected" @change="selectAll">全选</u-checkbox>
+				<u-checkbox name="all" shape="circle" v-model="isAllSelected" @change="onSelectAll">全选</u-checkbox>
 			</u-checkbox-group>
 			<view class="action-buttons">
 				<u-button type="primary" @click="handleBatchAction">出餐</u-button>
@@ -68,35 +101,70 @@
 		</view>
 
 		<Tabbar />
+
+		<!-- 弹窗 -->
+		<Modal ref="myModal"
+			:title="modalText.title" 
+			:content="modalText.content" 
+		/>
 	</view>
 </template>
 
 <script>
+import Modal from '@/components/modal/index.vue';
 import Tabbar from '@/pages/groupMeal/tabbar/index.vue';
+import ListScrollView from '@/components/list-scroll-view/index.vue';
 export default {
 	components: {
-		Tabbar
+		Modal,
+		Tabbar,
+		ListScrollView
 	},
 	data() {
 		return {
+			api: {
+				url: '/groupmeal/merchantPackageOrder/pageList',
+				method: 'POST',
+			},
 			isManaging: false,
 			statusTabs: [{ name: '待出餐' }, { name: '已出餐' }],
 			currentStatusTab: 0,
-			allOrders: [
-				// 模拟订单数据
-				{ id: 1, status: 0, title: '套餐名称套餐名称套餐名称', leaderName: 'b', quantity: 20, image: '/static/demo/goods1.png' },
-				{ id: 2, status: 0, title: '套餐名称套餐名称套餐名称', leaderName: 'a', quantity: 20, image: '/static/demo/goods2.png' },
-				{ id: 3, status: 0, title: '套餐名称套餐名称套餐名称', leaderName: 'b', quantity: 20, image: '/static/demo/goods3.png' },
-				{ id: 4, status: 1, title: '已出餐套餐', leaderName: 'c', quantity: 15, image: '/static/demo/goods1.png' },
-			],
 			selectedOrders: [],
 			isAllSelected: false,
+			// 弹窗
+			modalText: {
+				title: '提示',
+				btntext: '好的',
+				content: ''
+			},
 		};
 	},
 	computed: {
-		filteredOrders() {
-			return this.allOrders.filter(order => order.status === this.currentStatusTab);
+		// 数据参数
+		initParams() {
+			let params = {
+				// 订单状态 0 未成团 1 已成团 2 已出餐 3 已送达
+				orderStatus: 0,
+			}
+			// 待出餐
+			if (this.currentStatusTab == 0) {
+				params = {
+					...params,
+					orderStatus: 1,
+				}
+			}
+			// 已出餐
+			else if (this.currentStatusTab == 1) {
+				params = {
+					...params,
+					orderStatus: 2,
+				}
+			}
+			return params;
 		}
+	},
+	onLoad() {
+		
 	},
 	methods: {
 		goToDetail() {
@@ -111,16 +179,34 @@ export default {
 		},
 		onTabChange(e) {
 			this.currentStatusTab = e;
+			// 清除已选数据
 			this.selectedOrders = [];
 			this.isAllSelected = false;
+			// 关闭批量
+			this.isManaging = false;
+			// 触发更新
+			this.$nextTick(() => {
+				this.$refs.listScroll.downCallback();
+			});
+		},
+		onSearch(value) {
+			this.$refs[`listScroll`].reloadList({
+				queryName: value,
+			});
+		},
+		onSelect(e) {
+			this.selectedOrders = e;
+			// 控制全选
+			this.isAllSelected = e.length === this.$refs.listScroll.dataList.length;
 		},
-		selectAll(e) {
+		onSelectAll(e) {
+			let allOrders = this.$refs.listScroll.dataList;
 			if (e.value) {
-				this.selectedOrders = this.filteredOrders.map(order => order.id);
+				this.selectedOrders = allOrders.map(order => order.orderId);
 			} else {
 				this.selectedOrders = [];
 			}
-			this.filteredOrders.forEach(item => {
+			allOrders.forEach(item => {
 				item.checked = e.value;
 			});
 		},
@@ -129,8 +215,19 @@ export default {
 				this.$tip.toast("请先选择订单")
 				return;
 			}
-			console.log('批量出餐的订单ID:', this.selectedOrders);
-			this.$tip.success("操作成功")
+			this.modalText.content = '是否确认已经出餐?';
+			this.$refs.myModal.onOpen(false, () => {
+				let params = {
+					orderId: this.selectedOrders.join()
+				};
+				this.$http.get('/groupmeal/merchantPackageOrder/orderReady', {params}).then(res => {
+					if (res.data.code === 200) {
+						this.$tip.success(res.data.message);
+					} else {
+						this.$tip.error(res.data.message);
+					}
+				});
+			});
 		}
 	}
 };
@@ -171,10 +268,66 @@ export default {
 
 	.order-scroll-view {
 		flex: 1;
-		background-color: #fff;
+		height: 0;
+		padding: 20rpx 24rpx;
+		background-color: #F7F8FC;
 		.u-checkbox-group {
 			width: 100%;
 		}
+		.order-item {
+			width: 100%;
+			margin-bottom: 24rpx;
+			background: #fff;
+			.order-actions {
+				
+			}
+		}
+		.order-header {
+			gap: 24rpx;
+			padding: 24rpx;
+			display: flex;
+			align-items: center;
+			background: linear-gradient(90deg, #FDFDFF 0%, #E3F0FF 100%);
+			.location-box {
+				flex: 1;
+			}
+			.location-info {
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.name {
+					font-weight: 500;
+					font-size: 28rpx;
+					color: #333333;
+					display: flex;
+					align-items: center;
+					text {
+						padding-left: 10rpx;
+					}
+				}
+				.desc {
+					font-weight: 400;
+					font-size: 24rpx;
+					color: #666666;
+					.val {
+						color: #449AFF;
+					}
+				}
+			}
+			.location-address {
+				margin-top: 10rpx;
+				.atext {
+					font-weight: 500;
+					font-size: 26rpx;
+					color: #333333;
+				}
+				.btext {
+					font-weight: 400;
+					font-size: 26rpx;
+					color: #666666;
+				}
+			}
+		}
 		.order-card {
 			width: 100%;
 			padding: 24rpx;
@@ -183,9 +336,9 @@ export default {
 			border-bottom: 1rpx solid #f0f0f0;
 			.order-info {
 				flex: 1;
-				margin: 0 20rpx;
+				margin-left: 20rpx;
 				.order-title {
-					font-size: 28rpx;
+					font-size: 26rpx;
 					font-weight: 500;
 					color: #303133;
 					font-weight: bold;
@@ -198,19 +351,16 @@ export default {
 					margin-top: 8rpx;
 					display: flex;
 					align-items: center;
+					.leader-name {
+						font-weight: 400;
+						font-size: 22rpx;
+						color: #8A91A8;
+					}
+					.quantity-tag {
+						font-size: 24rpx;
+						color: #333333;
+					}
 				}
-				.leader-name {
-					width: 70%;
-					font-weight: 400;
-					font-size: 26rpx;
-					color: #666666;
-				}
-				.quantity-tag {
-					font-size: 26rpx;
-					color: #FD4912;
-				}
-			}
-			.order-actions {
 			}
 		}
 	}

+ 208 - 173
pages/groupMeal/orders/order-blist.vue

@@ -12,6 +12,7 @@
 					padding: '0 20rpx',
 					borderLeft: '1rpx solid #DDDDDD'
 				}"
+				@search="onSearch" @custom="onSearch"
 			></u-search>
 		</view>
 
@@ -31,113 +32,128 @@
 			@change="onTabChange"
 		></u-tabs>
 
-		<scroll-view scroll-y class="detail-scroll-view">
-			<view v-if="currentStatusTab !== 2">
-				<view class="location-group" v-for="group in orderGroups" :key="group.location.id">
-					<view class="location-header">
-						<view class="location-info">
-							<view class="location-name">{{ group.location.name }}</view>
-							<view class="location-address">{{ group.location.address }}</view>
+		<view class="detail-scroll-view">
+			<ListScrollView ref="listScroll" 
+				:api="api"
+				:init="{
+					...initParams,
+				}">
+				<template v-slot:list="{ data }">
+					<view class="order-group" v-for="(group, oi) in data" :key="oi">
+						<view class="order-header">
+							<view class="location-info">
+								<view class="location-name">{{ group.address }}</view>
+								<view class="location-address">{{ group.region }}</view>
+							</view>
+							<!-- <view class="nav-button">
+								<u-icon name="map" color="#2979ff" size="36"></u-icon>
+								<text>导航</text>
+							</view> -->
+							<view :class="['refund-status', `status-${group.orderStatus}`]" v-if="currentStatusTab == 2">
+								{{ getRefundStatusText(group.orderStatus) }}
+							</view>
 						</view>
-						<view class="nav-button">
-							<u-icon name="map" color="#2979ff" size="36"></u-icon>
-							<text>导航</text>
+						<view v-for="(item, si) in group.orderChildren" :key="si" @click="onClick(item)">
+							<view class="pickup-info">
+								<text>取餐号:{{ item.mealNumber }}</text>
+								<text :class="['status', `status-${item.orderStatus}`]">{{ getStatusText(item.orderStatus) }}</text>
+							</view>
+							<view class="order-item">
+								<u-image width="120rpx" height="120rpx" border-radius="12rpx" :src="item.productImage && `${$config.apiUrl}/${item.productImage.split(',')[0]}`" mode="aspectFill"></u-image>
+								<!-- <image class="goods-image" :src="item.image" mode="aspectFill"></image> -->
+								<view class="item-details">
+									<view class="item-title">{{ item.packageName }}</view>
+									<view class="item-desc">{{ item.dishName }}</view>
+									<view class="item-line">
+										<view class="item-quantity">数量:{{ item.packageNumber }}</view>
+										<view class="item-price">成团价:<text class="price-value"><text class="unit">¥</text>{{ item.price }}</text></view>
+									</view>
+								</view>
+							</view>
 						</view>
-					</view>
-					<view class="pickup-info">
-						<text>取餐号:{{ group.pickupCode }}</text>
-					</view>
-					<view class="order-item" v-for="item in group.items" :key="item.id">
-						<u-image width="120rpx" height="120rpx" border-radius="12rpx" :src="item.image" mode="aspectFill"></u-image>
-						<!-- <image class="goods-image" :src="item.image" mode="aspectFill"></image> -->
-						<view class="item-details">
-							<view class="item-title">{{ item.title }}</view>
-							<view class="item-desc">{{ item.description }}</view>
-							<view class="item-quantity">数量:{{ item.quantity }}</view>
-							<view class="item-price">成团价:<text class="price-value"><text class="unit">¥</text>{{ item.price }}</text></view>
-						</view>
-					</view>
-					<view class="group-footer">
-						<view class="info">
-							<view class="m">合计金额 ¥<text class="v">{{ group.totalQuantity }}</text></view>
-							<view class="n">共{{ group.totalQuantity }}份</view>
-						</view>
-						<u-button v-if="currentStatusTab === 0" type="primary" size="small" text="出餐"></u-button>
-					</view>
-				</view>
-			</view>
-
-			<!-- 售后Tab内容 -->
-			<view v-if="currentStatusTab === 2">
-				<view class="refund-group" v-for="item in refundList" :key="item.id">
-					<view class="location-header">
-						<view class="location-info">
-							<view class="location-name">{{ item.locationName }}</view>
-							<view class="location-address">{{ item.address }}</view>
-						</view>
-						<view :class="['refund-status', `status-${item.refundStatus.code}`]">
-							{{ item.refundStatus.text }}
+						<view class="group-footer">
+							<view class="info">
+								<view class="m">合计金额 ¥<text class="v">{{ group.copiesAmount }}</text></view>
+								<view class="n">共 {{ group.copies }} 份</view>
+							</view>
+							<u-button v-if="currentStatusTab === 0" type="primary" size="small" text="出餐"></u-button>
 						</view>
 					</view>
-					<view class="pickup-info">
-						<text>取餐号:{{ item.pickupCode }}</text>
-					</view>
-					<view class="order-item">
-						<u-image width="120rpx" height="120rpx" border-radius="12rpx" :src="item.image" mode="aspectFill"></u-image>
-						<!-- <image class="goods-image" :src="item.image" mode="aspectFill"></image> -->
-						<view class="item-details">
-							<view class="item-title">{{ item.title }}</view>
-							<view class="item-desc">{{ item.description }}</view>
-							<view class="item-quantity">数量:{{ item.quantity }}</view>
-							<view class="item-price">成团价:<text class="price-value">¥{{ item.price }}</text></view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</scroll-view>
-
+				</template>
+			</ListScrollView>
+		</view>
 	</view>
 </template>
 
 <script>
+import ListScrollView from '@/components/list-scroll-view/index.vue';
 export default {
+	components: {
+		ListScrollView
+	},
 	data() {
 		return {
+			api: {
+				url: '/groupmeal/merchantPackageOrder/getOrderDteails',
+				method: 'POST',
+			},
 			statusTabs: [{ name: '待出餐' }, { name: '已出餐' }, { name: '售后' }],
 			currentStatusTab: 0,
-			// 模拟待出餐和已出餐数据
-			orderGroups: [
-				{
-					location: { id: 1, name: '信达国际金融中心25层', address: '山西省太原市万柏林区迎泽西大街79号' },
-					pickupCode: 'C-1',
-					totalQuantity: 20,
-					items: [
-						{ id: 101, title: '套餐名称套餐名称套餐名称', description: '米饭, 鱼香肉丝, 宫保鸡丁, 炒土豆...', quantity: 1, price: 10.8, image: '/static/demo/goods1.png' },
-						{ id: 102, title: '套餐名称套餐名称套餐名称', description: '米饭, 鱼香肉丝, 宫保鸡丁, 炒土豆...', quantity: 1, price: 14.8, image: '/static/demo/goods2.png' },
-						{ id: 103, title: '套餐名称套餐名称套餐名称', description: '米饭, 鱼香肉丝, 宫保鸡丁, 炒土豆...', quantity: 1, price: 13.1, image: '/static/demo/goods3.png' },
-					]
-				},
-				{
-					location: { id: 2, name: '国际能源7层', address: '山西省太原市万柏林区' },
-					pickupCode: 'D-2',
-					totalQuantity: 10,
-					items: [
-						{ id: 201, title: '另一个套餐', description: '米饭, 红烧排骨...', quantity: 1, price: 18.8, image: '/static/demo/goods1.png' },
-					]
-				}
-			],
-			// 模拟售后数据
-			refundList: [
-				{ id: 301, locationName: '信达国际金融中心25层', address: '山西省太原市万柏林区迎泽西大街79号', pickupCode: 'C-1', refundStatus: { code: 'processing', text: '退款中' }, title: '套餐名称', description: '描述...', quantity: 1, price: 10.8, image: '/static/demo/goods1.png' },
-				{ id: 302, locationName: '国际能源7层', address: '山西省太原市万柏林区', pickupCode: 'D-2', refundStatus: { code: 'applying', text: '退款申请' }, title: '套餐名称', description: '描述...', quantity: 1, price: 14.8, image: '/static/demo/goods2.png' },
-				{ id: 303, locationName: '国际能源7层', address: '山西省太原市万柏林区', pickupCode: 'E-3', refundStatus: { code: 'failed', text: '退款失败' }, title: '套餐名称', description: '描述...', quantity: 1, price: 13.1, image: '/static/demo/goods3.png' },
-				{ id: 304, locationName: '国际能源7层', address: '山西省太原市万柏林区', pickupCode: 'F-4', refundStatus: { code: 'success', text: '退款成功' }, title: '套餐名称', description: '描述...', quantity: 1, price: 10.8, image: '/static/demo/goods1.png' },
-			]
 		};
 	},
+	computed: {
+		// 数据参数
+		initParams() {
+			let params = {
+				orderStatus: this.currentStatusTab + 1,
+			}
+			return params;
+		}
+	},
 	methods: {
+		getStatusText(status) {
+			// 订单状态 0 待支付 1 待成团 2 已成团 3 已出餐 4 已送达 5 已取消 6 售后
+			const statusMap = {
+				0: '待支付',
+				1: '待成团',
+				2: '已成团',
+				3: '已出餐',
+				4: '已送达',
+				5: '已取消',
+			};
+			return statusMap[status] || '--';
+		},
+		getRefundStatusText(status) {
+			// 
+			const statusMap = {
+				0: '退款申请',
+				1: '退款成功',
+				2: '退款失败',
+			};
+			return statusMap[status] || '';
+		},
+		onSearch(value) {
+			this.$refs[`listScroll`].reloadList({
+				queryName: value,
+			});
+		},
 		onTabChange(e) {
 			this.currentStatusTab = e;
+			// 触发更新
+			this.$nextTick(() => {
+				this.$refs.listScroll.downCallback();
+			});
+		},
+		onClick(item) {
+			let params = {
+				packageId: item.packageId,
+				userOrderId: item.userOrderId,
+				hostOrderId: item.hostOrderId,
+			};
+			let str = this.$u.queryParams(params);
+			uni.navigateTo({
+				url: `/pages/groupMeal/orders/order-details${str}`
+			});
 		}
 	}
 };
@@ -163,109 +179,128 @@ export default {
 .detail-scroll-view {
 	flex: 1;
 	height: 0;
-
-	.location-group, .refund-group {
-		margin: 24rpx;
-		background-color: #fff;
-		border-radius: 16rpx;
-		overflow: hidden;
-	}
-
-	.location-header {
-		padding: 24rpx;
+	padding: 24rpx;
+	.item-line {
 		display: flex;
-		align-items: flex-start;
+		align-items: center;
 		justify-content: space-between;
-		background: linear-gradient(90deg, #FDFDFF 0%, #E3F0FF 100%);
-		.location-info {
-			.location-name {
-				font-size: 30rpx;
-				font-weight: bold;
-				color: #303133;
+	}
+	.order-group {
+		margin-bottom: 24rpx;
+		border-radius: 16rpx;
+		background-color: #fff;
+		overflow: hidden;
+		.order-header {
+			padding: 24rpx;
+			display: flex;
+			align-items: flex-start;
+			justify-content: space-between;
+			background: linear-gradient(90deg, #FDFDFF 0%, #E3F0FF 100%);
+			.location-info {
+				.location-name {
+					font-size: 30rpx;
+					font-weight: bold;
+					color: #303133;
+				}
+				.location-address {
+					font-size: 26rpx;
+					color: #606266;
+					margin-top: 4rpx;
+				}
+			}
+			.nav-button {
+				font-weight: 500;
+				font-size: 26rpx;
+				color: #449AFF;
+				display: flex;
+				align-items: center;
+				flex-direction: column;
 			}
-			.location-address {
+			.refund-status {
+				font-weight: 500;
 				font-size: 26rpx;
-				color: #606266;
-				margin-top: 4rpx;
+				color: #449AFF;
+				&.status-applying { color: #f9ae3d; }
+				&.status-failed { color: #fa3534; }
+				&.status-success { color: #19be6b; }
 			}
 		}
-		.nav-button {
+		.pickup-info {
 			font-weight: 500;
 			font-size: 26rpx;
 			color: #449AFF;
+			padding: 24rpx 25rpx 0;
 			display: flex;
 			align-items: center;
-			flex-direction: column;
-		}
-		.refund-status {
-			font-size: 26rpx;
-			&.status-processing { color: #f9ae3d; }
-			&.status-applying { color: #f9ae3d; }
-			&.status-failed { color: #fa3534; }
-			&.status-success { color: #19be6b; }
-		}
-	}
-	.pickup-info {
-		font-weight: 500;
-		font-size: 26rpx;
-		color: #449AFF;
-		padding: 24rpx 25rpx 12rpx;
-	}
-	.order-item {
-		display: flex;
-		padding: 12rpx 24rpx;
-		.goods-image {
-			width: 120rpx;
-			height: 120rpx;
-			border-radius: 12rpx;
-			flex-shrink: 0;
-		}
-		.item-details {
-			flex: 1;
-			margin-left: 20rpx;
-			.item-title {
-				font-size: 28rpx;
-				font-weight: bold;
+			justify-content: space-between;
+			.status {
+				min-width: 100rpx;
+				text-align: center;
+				padding: 4rpx 12rpx;
+				background: #F1F8FF;
+				border-radius: 8rpx;
+				&.status-2 {
+					color: #8B93A7;
+					background: rgba(139,147,167,0.1);
+				}
 			}
-			.item-desc, .item-quantity {
-				font-size: 22rpx;
-				color: #8A91A8;
-				margin-top: 6rpx;
+		}
+		.order-item {
+			display: flex;
+			padding: 20rpx 24rpx;
+			.goods-image {
+				width: 120rpx;
+				height: 120rpx;
+				border-radius: 12rpx;
+				flex-shrink: 0;
 			}
-			.item-price {
-				font-size: 22rpx;
-				color: #8A91A8;
-				margin-top: 6rpx;
-				.price-value {
-					color: #FD4912;
-					font-size: 32rpx;
+			.item-details {
+				flex: 1;
+				margin-left: 20rpx;
+				.item-title {
+					font-size: 28rpx;
 					font-weight: bold;
-					.unit {
-						font-size: 22rpx;
+				}
+				.item-desc, .item-quantity {
+					font-size: 22rpx;
+					color: #8A91A8;
+					margin-top: 6rpx;
+				}
+				.item-price {
+					font-size: 22rpx;
+					color: #8A91A8;
+					margin-top: 6rpx;
+					.price-value {
+						color: #FD4912;
+						font-size: 32rpx;
+						font-weight: bold;
+						.unit {
+							font-size: 22rpx;
+						}
 					}
 				}
 			}
 		}
-	}
-	.group-footer {
-		padding: 24rpx;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		border-top: 1rpx solid #f0f0f0;
-		.info {
-			.m {
-				font-weight: 500;
-				font-size: 22rpx;
-				color: #FF6A42;
-				.v {
-					font-size: 36rpx;
+		.group-footer {
+			padding: 24rpx;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			border-top: 1rpx solid #f0f0f0;
+			.info {
+				.m {
+					font-weight: 500;
+					font-size: 22rpx;
+					color: #FF6A42;
+					.v {
+						font-size: 36rpx;
+					}
+				}
+				.n {
+					font-weight: 400;
+					font-size: 22rpx;
+					color: #666666;
 				}
-			}
-			.n {
-				font-weight: 400;
-				font-size: 22rpx;
-				color: #666666;
 			}
 		}
 	}

+ 14 - 21
pages/groupMeal/orders/order-details.vue

@@ -26,29 +26,24 @@
 			<view class="refund" @click="onPopupOpen" v-if="product.refundType == 1">
 				退款去向详情
 			</view>
-			<view class="product" v-if="product.categoryId != categoryId">
-				<view class="title">
-					商品信息
-				</view>
+
+			<view class="product">
+				<view class="title">商品信息</view>
 				<view class="center">
 					<view class="img">
-						<image :src="product.productImage" mode=""></image>
+						<image :src="product.productImage && `${$config.apiUrl}/${product.productImage.split(',')[0]}`" mode=""></image>
 					</view>
 					<view class="box">
-						<view class="name">{{ product.productName }}</view>
+						<view class="name">{{ product.packageName }}</view>
 						<view class="price">
-							<text class="p">¥<text class="v">{{ product.costPrice }}</text>/份</text>
-							<text class="r">实付款:<text class="p">¥<text class="v">{{ product.orderPrice
-										}}</text></text></text>
+							<text class="p">¥<text class="v">{{ product.price }}</text>/份</text>
+							<text class="r">实付款:<text class="p">¥<text class="v">{{ product.price }}</text></text></text>
 						</view>
 					</view>
 				</view>
 			</view>
 			<view class="product" v-if="product.categoryId == categoryId">
-				<view class="title" v-if="product.categoryId != categoryId">
-					商品信息
-				</view>
-
+				<view class="title">商品信息</view>
 				<ListExpand :items="product.productsLinkCategorySpecItems">
 					<template v-slot:="{ items }">
 						<view class="repair-list">
@@ -77,6 +72,7 @@
 					</span>
 				</view>
 			</view>
+			
 			<view class="product">
 				<view class="title negotiate" v-if="!product.auditType">
 					<text>协商历史</text>
@@ -193,7 +189,7 @@ export default {
 	},
 	data() {
 		return {
-			orderId: '',
+			query: {},
 			product: {
 				state: '待支付',
 				differenceMinutes: 1000,
@@ -206,20 +202,17 @@ export default {
 			},
 			categoryId: 1945013773786701826,
 			isShow: false,
-			isExpanded: false
 		}
 	},
 	onLoad(query) {
-		this.orderId = query.orderId
-	},
-	mounted() {
-		this.getDetail()
+		this.query = query;
+		if (query.hostOrderId) this.getDetail();
 	},
 	methods: {
 		getDetail() {
-			this.$http.get("/app/order/locaOrder/queryById?orderId=" + this.orderId).then(res => {
+			this.$http.post("/groupmeal/merchantPackageOrder/refundDetails", this.query).then(res => {
 				if (res.data.code == 200) {
-					this.product = res.data.result
+					this.product = res.data.result;
 				}
 			})
 		},

+ 2 - 3
pages/groupMeal/users/index.vue

@@ -32,12 +32,12 @@ export default {
 				{
 					name: '团餐设置',
 					icon: '/static/groupMeal/icon_file.png',
-					path: '/pages/groupMeal/users/settings'
+					path: '/pages/groupMeal/users/settings?isEnterprise=1'
 				},
 				{
 					name: '企业团餐设置',
 					icon: '/static/groupMeal/icon_build.png',
-					path: '/pages/groupMeal/users/settings'
+					path: '/pages/groupMeal/users/settings?isEnterprise=2'
 				},
 			]
 		}
@@ -47,7 +47,6 @@ export default {
 	},
 	methods: {
 		onClick(e) {
-			console.log(e)
 			if (!e.path) return;
 			uni.navigateTo({
 				url: `${e.path}`

+ 43 - 13
pages/groupMeal/users/settings.vue

@@ -6,8 +6,8 @@
 			<view class="meal-section" v-for="(meal, index) in form.mealTimes" :key="index">
 				<view class="section-title">{{ meal.name }}</view>
 				
-				<u-form-item :label="`拼团最低起送量`" :prop="`mealTimes.${index}.minAmount`" borderBottom :required="isEdited(index)">
-					<u-input v-model="meal.minAmount" type="number" placeholder="输入数量" height="41" inputAlign="right"></u-input>
+				<u-form-item :label="`拼团最低起送量`" :prop="`mealTimes.${index}.minGroupSize`" borderBottom :required="isEdited(index)">
+					<u-input v-model="meal.minGroupSize" type="number" placeholder="输入数量" height="41" inputAlign="right"></u-input>
 				</u-form-item>
 				
 				<u-form-item :label="`开团时间`" :prop="`mealTimes.${index}.startTime`" borderBottom :required="isEdited(index)">
@@ -49,12 +49,13 @@ export default {
 		return {
 			form: {
 				mealTimes: [
-					{ id: 'breakfast', name: '早餐', minAmount: '', startTime: '', endTime: '' },
-					{ id: 'lunch', name: '午餐', minAmount: '', startTime: '', endTime: '' },
-					{ id: 'dinner', name: '晚餐', minAmount: '', startTime: '', endTime: '' },
+					{ id: 1, name: '早餐', minGroupSize: '', startTime: '', endTime: '' },
+					{ id: 2, name: '午餐', minGroupSize: '', startTime: '', endTime: '' },
+					{ id: 3, name: '晚餐', minGroupSize: '', startTime: '', endTime: '' },
 				],
 			},
 			rules: {}, // 规则将动态生成
+			query: {},
 			showPicker: false,
 			pickerValue: '',
 			currentEditing: { // 记录当前正在编辑的时间
@@ -68,7 +69,7 @@ export default {
 		isSubmitDisabled() {
 			// 如果所有餐次的所有字段都为空,则禁用
 			return this.form.mealTimes.every(meal => 
-				!meal.minAmount && !meal.startTime && !meal.endTime
+				!meal.minGroupSize && !meal.startTime && !meal.endTime
 			);
 		}
 	},
@@ -84,6 +85,11 @@ export default {
 			deep: true
 		}
 	},
+	onLoad(query) {
+		console.log(this.$Route)
+		this.query = query;
+		if (query.isEnterprise) this.getData();
+	},
 	mounted() {
 		// 页面加载完成后,为 u-form 实例设置初始规则
 		this.$nextTick(() => {
@@ -91,10 +97,20 @@ export default {
 		});
 	},
 	methods: {
+		getData() {
+			let params = {
+				isEnterprise: this.query.isEnterprise
+			};
+			this.$http.get('/groupmeal/gmMerchantSettings/getByIsEnterprise', {params}).then(res => {
+				if (res.data.code === 200 && res.data.result.length > 0) {
+					this.form.mealTimes = res.data.result;
+				}
+			});
+		},
 		// 判断一个餐次区块是否被编辑过
 		isEdited(index) {
 			const meal = this.form.mealTimes[index];
-			return !!(meal.minAmount || meal.startTime || meal.endTime);
+			return !!(meal.minGroupSize || meal.startTime || meal.endTime);
 		},
 		updateValidationRules() {
 			// 确保 u-form 实例存在
@@ -106,13 +122,12 @@ export default {
 			this.form.mealTimes.forEach((meal, index) => {
 				if (this.isEdited(index)) {
 					// 如果有任何一个字段被填写,则该餐次的所有字段都变为必填
-					newRules[`mealTimes.${index}.minAmount`] = [{ required: true, message: '请输入起送量', trigger: ['blur', 'change'] }];
+					newRules[`mealTimes.${index}.minGroupSize`] = [{ required: true, message: '请输入起送量', trigger: ['blur', 'change'] }];
 					newRules[`mealTimes.${index}.startTime`] = [
 						{ required: true, message: '请设置开团时间', trigger: ['blur', 'change'] },
 						{
 							validator: (rule, value, callback) => {
 								const endTime = this.form.mealTimes[index].endTime;
-								console.log(endTime, value)
 								let flag = endTime && value && value >= endTime;
 								return !flag;
 							},
@@ -152,10 +167,25 @@ export default {
 		},
 		submit() {
 			this.$refs.formRef.validate().then(res => {
-				console.log('表单校验成功', this.form);
-				uni.showToast({
-					title: '提交成功',
-					icon: 'success'
+				let params = {
+					gmMerchantSettingsList: this.form.mealTimes.filter((item, index) => this.isEdited(index)).map(item => {
+						return {
+							category: item.id,
+							merchantId: uni.getStorageSync('login_user_info').merchantId,
+							minGroupSize: item.minGroupSize - 0,
+							isEnterprise: this.query.isEnterprise - 0,
+							strEndTime: item.endTime,
+							strStartTime: item.startTime
+						}
+					})
+				};
+				console.log('表单校验成功', this.form, params);
+				this.$http.post('/groupmeal/gmMerchantSettings/add', params).then(res => {
+					if (res.data.code === 200) {
+						this.$tip.success('设置成功');
+					} else {
+						this.$tip.error(res.data.message);
+					}
 				});
 			}).catch(errors => {
 				console.log('表单校验失败', errors);