소스 검색

团餐出餐bug

baijunde 2 달 전
부모
커밋
97e28dc38e
3개의 변경된 파일55개의 추가작업 그리고 3개의 파일을 삭제
  1. 53 1
      pages/groupMeal/orders/order-blist.vue
  2. 1 1
      pages/groupMeal/orders/order-details.vue
  3. 1 1
      pages/groupMeal/orders/refund.vue

+ 53 - 1
pages/groupMeal/orders/order-blist.vue

@@ -77,7 +77,13 @@
 								<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>
+							<u-button
+								v-if="currentStatusTab === 0"
+								type="primary"
+								size="small"
+								text="出餐"
+								@click="handleOrderReady(group)"
+							></u-button>
 						</view>
 					</view>
 				</template>
@@ -156,6 +162,52 @@ export default {
 				this.$refs.listScroll.downCallback();
 			});
 		},
+		getOrderReadyIds(group) {
+			let ids = [];
+			(group.orderChildren || []).forEach(item => {
+				const orderIds = item.merchantOrderIds || item.merchantOrderId || item.orderId || item.userOrderId;
+				if (Array.isArray(orderIds)) {
+					ids = ids.concat(orderIds);
+				} else if (orderIds) {
+					ids = ids.concat(String(orderIds).split(','));
+				}
+			});
+			return ids.filter(Boolean);
+		},
+		handleOrderReady(group) {
+			const orderIds = this.getOrderReadyIds(group);
+			if (!orderIds.length) {
+				this.$tip.toast('未获取到订单信息');
+				return;
+			}
+			uni.showModal({
+				title: '提示',
+				content: '是否确认已经出餐?',
+				success: (modalRes) => {
+					if (!modalRes.confirm) return;
+					let params = {
+						orderId: orderIds.join()
+					};
+					this.$http.get('/groupmeal/merchantPackageOrder/orderReady', {params}).then(res => {
+						if (res.data.code === 200) {
+							uni.showToast({
+								icon: 'success',
+								title: res.data.message
+							});
+							this.currentStatusTab = 1;
+							this.$nextTick(() => {
+								this.$refs.listScroll.downCallback();
+							});
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.data.message
+							});
+						}
+					});
+				}
+			});
+		},
 		onClick(item) {
 			if (this.currentStatusTab == 2) {
 				let params = {

+ 1 - 1
pages/groupMeal/orders/order-details.vue

@@ -118,7 +118,7 @@
 			
 				<view class="title">配送信息</view>
 				<view class="data">
-					<text>配送团:</text>
+					<text>配送团:</text>
 					{{ product.nickName ? product.nickName : '--' }}
 				</view>
 				<view class="data">

+ 1 - 1
pages/groupMeal/orders/refund.vue

@@ -24,7 +24,7 @@
 						<image :src="data.userAvatar" alt="" />
 					</view>
 					<view class="message">
-						<text>{{data.nickName}}</text>
+						<text>{{data.linkName}}</text>
 						<text class="time">申请售后</text>
 					</view>
 				</view>