Bladeren bron

修复展示

忆雪 10 maanden geleden
bovenliggende
commit
ab026d61a5
3 gewijzigde bestanden met toevoegingen van 359 en 350 verwijderingen
  1. 270 265
      src/pageMerchant/components/orderList.vue
  2. 85 81
      src/pageMerchant/storeModule/appointList.vue
  3. 4 4
      src/pageMerchant/tabbar/order.vue

+ 270 - 265
src/pageMerchant/components/orderList.vue

@@ -1,288 +1,293 @@
-<template>
-	<view class="container">
-		<!-- 订单 -->
-		<view class="order">
-			<view class="order-box">
+<template>
+	<view class="container">
+		<!-- 订单 -->
+		<view class="order">
+			<view class="order-box">
 				<view class="order-item" v-for="(item, index) of list" :key="index">
 					<view class="item-allnumb-box">
-						<view class="allnumb-left"> 
-							<image class="img" src="@/static/QR57a.jpg"  style="width: 50rpx; height: 50rpx"   />
-							<span>用户名</span>
+						<view class="allnumb-left">
+							<image class="img" :src="item.avatar || '@/tatic/logo.png' "
+								style="width: 50rpx; height: 50rpx" />
+							<span>{{item.memberUsername}}</span>
+						</view>
+						<view class="allnumb-right" :style="{color: getStatusColor(item.status)}">
+							{{ getStatusText(item.status) }}
 						</view>
-					 <view class="allnumb-right" :style="{color: getStatusColor(item.status)}">
-					    {{ getStatusText(item.status) }}
-					  </view>
-					</view>
-
-					<u-line margin="20rpx 0"></u-line>
-
-					<view class="item-center" :key="idx" v-for="(itm, idx) of item.goodsInfo">
-						<view class="center-left">
-							<image :src="itm.goodsPic" class="img"></image>
-						</view>
-						<view class="center-right">
-							<view class="r-l">
-								<view class="right-name"> {{ itm.goodsName }} </view>
-								<view class="right-descript"> 测试商品描述111 </view>
-								<view class="l-box">
-									<view class="right-price"> ¥{{ itm.goodsPrice }} </view>
-									<view class="right-numb"> ×{{ itm.goodsQuantity }} </view>
-								</view>
-							</view>
-						</view>
-					</view>
-
-					<view class="item-allnumb-box">
-						<view class="allnumb-left"></view>
-						<view class="allnumb-right">
-							<span class="r-text">实付款</span>¥{{ item.payAmount }}
-						</view>
 					</view>
-					
-					<u-line margin="20rpx 0" dashed="true"></u-line>
+
+					<u-line margin="20rpx 0"></u-line>
+
+					<view class="item-center" :key="idx" v-for="(itm, idx) of item.goodsInfo">
+						<view class="center-left">
+							<image :src="itm.goodsPic" class="img"></image>
+						</view>
+						<view class="center-right">
+							<view class="r-l">
+								<view class="right-name"> {{ itm.goodsName }} </view>
+								<!-- <view class="right-descript"> 测试商品描述111 </view> -->
+								<view class="l-box">
+									<view class="right-price"> ¥{{ itm.goodsPrice }} </view>
+									<view class="right-numb"> ×{{ itm.goodsQuantity }} </view>
+								</view>
+							</view>
+						</view>
+					</view>
+
+					<view class="item-allnumb-box">
+						<view class="allnumb-left"></view>
+						<view class="allnumb-right">
+							<span class="r-text">实付款</span>¥{{ item.payAmount }}
+						</view>
+					</view>
+
+					<u-line margin="20rpx 0" dashed="true"></u-line>
 
 					<view class="item-top">
-						<view class="top-left gray-color">订单编号 : {{ item.orderSn }}</view>
+						<view class="top-left gray-color">订单编号 : {{ item.id }}</view>
 						<view class="top-right">{{ type_name }}</view>
 					</view>
 					<view class="item-top">
-						<view class="top-left gray-color">下单时间 : {{ formatTime1( item.createTime) }}</view>
+						<view class="top-left gray-color">下单时间 : {{ formatTime1(item.createTime)  }}</view>
 						<view class="top-right"></view>
 					</view>
 					<view class="item-top">
-						 <view v-if="item.status == 2" class="top-left gray-color">核销时间: {{ formatTime1(item.createTime) }}</view>
-						    <view v-if="item.status == 3" class="top-left gray-color">退款时间: {{ formatTime1(item.createTime) }}</view>
-						    <view v-if="item.status == 4" class="top-left gray-color">过期时间: {{ formatTime1(item.createTime) }}</view>
+						<view v-if="item.status == 2" class="top-left gray-color">核销时间:
+							{{ formatTime1(item.receive_time) }}</view>
+						<view v-if="item.status == 3" class="top-left gray-color">退款时间:
+							{{ formatTime1(item.updateTime) }}</view>
+						<!-- <view v-if="item.status == 4" class="top-left gray-color">过期时间:
+							{{ formatTime1(item.createTime) }}</view> -->
 						<!--    <view v-else class="top-left gray-color"></view>
 						    <view class="top-right"></view> -->
-					</view>
-
-					
-				</view>
-			</view>
-			<view  style="margin-top: 40rpx" v-if="list.length === 0" >
-				<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
+					</view>
+
+
+				</view>
+			</view>
+			<view style="margin-top: 40rpx" v-if="list.length === 0">
+				<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
 			</view>
-			
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		userOrdersApi,
-		getUserOrderList,
-		cancelOrder
-	} from '@/api/client/order';
+
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		userOrdersApi,
+		getUserOrderList,
+		cancelOrder
+	} from '@/api/client/order';
 	export default {
 		props: {
-		  typeStyle: {
-		    type: Number,
-		    default: 0,
-		  },
-		  list: {
-		    type: Array,
-		    default: [],
-		  },
-		},
-		data() {
-			return {
-				
-			};
-		},
-		mounted() {
-		
-		},
-		onShow() {
-			
-		},
-		computed: {
-			
-		},
+			typeStyle: {
+				type: Number,
+				default: 0,
+			},
+			list: {
+				type: Array,
+				default: [],
+			},
+		},
+		data() {
+			return {
+
+			};
+		},
+		mounted() {
+
+		},
+		onShow() {
+
+		},
+		computed: {
+
+		},
 		methods: {
 			getStatusColor(status) {
-			      switch (status) {
-			        case 1:
-			          return 'blue';
-			        case 2:
-			          return 'red';
-			        case 3:
-			          return 'orange';
-			        case 4:
-			          return 'green';
-			        default:
-			          return 'black';
-			      }
-			    },
-			    getStatusText(status) {
-			      switch (status) {
-			        case 1:
-			          return '待核销';
-			        case 2:
-			          return '已核销';
-			        case 3:
-			          return '已退款';
-			        case 4:
-			          return '已过期';
-			        default:
-			          return '';
-			      }
-			    },
-			// 跳转到订单详情
-			handlerSkipDetail(e) {
-				uni.navigateTo({
-					url: `/PageMine/orderModules/orderDetail?orderList=${JSON.stringify(e)}`,
-				});
+				switch (status) {
+					case 1:
+						return 'blue';
+					case 2:
+						return 'red';
+					case 3:
+						return 'orange';
+					case 4:
+						return 'green';
+					default:
+						return 'black';
+				}
+			},
+			getStatusText(status) {
+				switch (status) {
+					case 1:
+						return '待核销';
+					case 2:
+						return '已核销';
+					case 3:
+						return '已退款';
+					case 4:
+						return '已过期';
+					default:
+						return '';
+				}
+			},
+			// 跳转到订单详情
+			handlerSkipDetail(e) {
+				uni.navigateTo({
+					url: `/PageMine/orderModules/orderDetail?orderList=${JSON.stringify(e)}`,
+				});
 			},
 			formatTime1(timestamp) {
-			  const date = new Date(timestamp * 1000); // 转换为毫秒
-			  const year = date.getFullYear();
-			  const month = ('0' + (date.getMonth() + 1)).slice(-2);
-			  const day = ('0' + date.getDate()).slice(-2);
-			  const hour = ('0' + date.getHours()).slice(-2);
-			  const minute = ('0' + date.getMinutes()).slice(-2);
-			  const second = ('0' + date.getSeconds()).slice(-2);
-			  
-			  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
-			}
-		},
-	};
-</script>
-
-<style lang="scss" scoped>
-	.order {
-		margin-top: 10px;
-		padding: 10rpx 20rpx 20rpx;
-		box-sizing: border-box;
-
-		.order-box {
-			.order-item {
-				margin-bottom: 20rpx;
-				background-color: #fff;
-				border-radius: 20rpx;
-				padding: 20rpx;
-				box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
-
-				.item-top {
-					display: flex;
-					justify-content: space-between;
-					margin-bottom: 10rpx;
-				}
-
-				.item-center {
-					display: flex;
-					align-items: center;
-					margin-bottom: 10rpx;
-
-					.center-left {
-						height: 160rpx;
-
-						.img {
-							width: 160rpx;
-							height: 160rpx;
-						}
-					}
-
-					.center-right {
-						width: 100%;
-						height: 160rpx;
-						display: flex;
-						justify-content: space-between;
-						margin-left: 20rpx;
-
-						.r-l {
-							display: flex;
-							flex-direction: column;
-							justify-content: space-around;
-
-							.right-name {
-								color: #4d5671;
-								font-size: 32rpx;
-								font-weight: bold;
-							}
-
-							.right-descript {
-								font-size: 28rpx;
-								color: #858797;
-							}
-
-							.l-box {
-								display: flex;
-								font-size: 24rpx;
-								align-items: center;
-								font-style: italic;
-
-								.right-price {
-									margin-right: 20rpx;
-									font-weight: bold;
-									font-size: 28rpx;
-									color: #f57f32;
-								}
-
-								.right-numb {
-									font-size: 24rpx;
-									color: #858797;
-								}
-							}
-						}
-
-						.r-r {
-							.r-item {
-								align-items: center;
-							}
-						}
-					}
-				}
-
-				.item-allnumb-box {
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
-					font-weight: bold;
-
+				const date = new Date(timestamp ); // 转换为毫秒
+				const year = date.getFullYear();
+				const month = ('0' + (date.getMonth() + 1)).slice(-2);
+				const day = ('0' + date.getDate()).slice(-2);
+				const hour = ('0' + date.getHours()).slice(-2);
+				const minute = ('0' + date.getMinutes()).slice(-2);
+				const second = ('0' + date.getSeconds()).slice(-2);
+
+				return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+			}
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	.order {
+		margin-top: 10px;
+		padding: 10rpx 20rpx 20rpx;
+		box-sizing: border-box;
+
+		.order-box {
+			.order-item {
+				margin-bottom: 20rpx;
+				background-color: #fff;
+				border-radius: 20rpx;
+				padding: 20rpx;
+				box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
+
+				.item-top {
+					display: flex;
+					justify-content: space-between;
+					margin-bottom: 10rpx;
+				}
+
+				.item-center {
+					display: flex;
+					align-items: center;
+					margin-bottom: 10rpx;
+
+					.center-left {
+						height: 160rpx;
+
+						.img {
+							width: 160rpx;
+							height: 160rpx;
+						}
+					}
+
+					.center-right {
+						width: 100%;
+						height: 160rpx;
+						display: flex;
+						justify-content: space-between;
+						margin-left: 20rpx;
+
+						.r-l {
+							display: flex;
+							flex-direction: column;
+							justify-content: space-around;
+
+							.right-name {
+								color: #4d5671;
+								font-size: 32rpx;
+								font-weight: bold;
+							}
+
+							.right-descript {
+								font-size: 28rpx;
+								color: #858797;
+							}
+
+							.l-box {
+								display: flex;
+								font-size: 24rpx;
+								align-items: center;
+								font-style: italic;
+
+								.right-price {
+									margin-right: 20rpx;
+									font-weight: bold;
+									font-size: 28rpx;
+									color: #f57f32;
+								}
+
+								.right-numb {
+									font-size: 24rpx;
+									color: #858797;
+								}
+							}
+						}
+
+						.r-r {
+							.r-item {
+								align-items: center;
+							}
+						}
+					}
+				}
+
+				.item-allnumb-box {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+					font-weight: bold;
+
 					.allnumb-left {
-						display:flex;
-						justify-content:start;
-						 align-items: center;
+						display: flex;
+						justify-content: start;
+						align-items: center;
 						font-size: 32rpx;
-						.img{
-							display:block;
-						}
-					}
-
-					.allnumb-right {
-						font-size: 26rpx;
-						color: #f57f32;
-
-						.r-text {
-							color: #000;
-						}
-					}
-				}
-			}
-		}
-	}
-
-	.item-bottom {
-		width: 100%;
-		margin-top: 20rpx;
-
-		.btn {
-			height: 70rpx;
-			background-color: rgba(248, 213, 53, 0.8);
-			color: #4e5059;
-			font-size: 28rpx;
-			text-align: center;
-			line-height: 70rpx;
-			border-radius: 20rpx;
-		}
-	}
-
-	.gray-color {
-		color: #858797;
-	}
-
-	::deep .u-tabs__wrapper__nav__item__text {
-		font-size: 30px;
-	}
-</style>
+
+						.img {
+							display: block;
+						}
+					}
+
+					.allnumb-right {
+						font-size: 26rpx;
+						color: #f57f32;
+
+						.r-text {
+							color: #000;
+						}
+					}
+				}
+			}
+		}
+	}
+
+	.item-bottom {
+		width: 100%;
+		margin-top: 20rpx;
+
+		.btn {
+			height: 70rpx;
+			background-color: rgba(248, 213, 53, 0.8);
+			color: #4e5059;
+			font-size: 28rpx;
+			text-align: center;
+			line-height: 70rpx;
+			border-radius: 20rpx;
+		}
+	}
+
+	.gray-color {
+		color: #858797;
+	}
+
+	::deep .u-tabs__wrapper__nav__item__text {
+		font-size: 30px;
+	}
+</style>

+ 85 - 81
src/pageMerchant/storeModule/appointList.vue

@@ -32,26 +32,28 @@
     </view> -->
 
 		<view class="content">
-			<ren-calendar ref='ren' :markDays='markDays' :headerBar='true' :open="false" @onDayClick='onDayClick'></ren-calendar>
+			<ren-calendar ref='ren' :markDays='markDays' :headerBar='true' :open="false"
+				@onDayClick='onDayClick'></ren-calendar>
 		</view>
-		
+
 		<!-- 订单 -->
 		<view class="order">
 			<view class="order-box">
 				<view class="order-item" v-for="(item, index) of appointList" :key="index">
-					
+
 					<view class="item-allnumb-box">
-						<view class="allnumb-left"> 
-							<image class="img" :src="item.avatar || '@/tatic/logo.png' "  style="width: 50rpx; height: 50rpx"   />
-							<span>{{item.memberUsername || '用户名'}}</span>
+						<view class="allnumb-left">
+							<image class="img" :src="item.avatar  "
+								style="width: 50rpx; height: 50rpx" />
+							<span>{{item.memberUsername}}</span>
+						</view>
+						<view class="allnumb-right" :style="{color: getStatusColor(item.status)}">
+							{{ getStatusText(item.status) }}
 						</view>
-					 <view class="allnumb-right" :style="{color: getStatusColor(item.status)}">
-					    {{ getStatusText(item.status) }}
-					  </view>
 					</view>
-		
+
 					<u-line margin="20rpx 0"></u-line>
-		
+
 					<view class="item-center" :key="idx" v-for="(itm, idx) of item.goodsInfo">
 						<view class="center-left">
 							<image :src="itm.goodsPic" class="img"></image>
@@ -59,7 +61,7 @@
 						<view class="center-right">
 							<view class="r-l">
 								<view class="right-name"> {{ itm.goodsName }} </view>
-								<view class="right-descript"> 测试商品描述111 </view>
+								<!-- <view class="right-descript"> 测试商品描述111 </view> -->
 								<view class="l-box">
 									<view class="right-price"> ¥{{ itm.goodsPrice }} </view>
 									<view class="right-numb"> ×{{ itm.goodsQuantity }} </view>
@@ -67,34 +69,34 @@
 							</view>
 						</view>
 					</view>
-		
+
 					<view class="item-allnumb-box">
 						<view class="allnumb-left"></view>
 						<view class="allnumb-right">
 							<span class="r-text">实付款</span>¥{{ item.payAmount }}
 						</view>
 					</view>
-					
+
 					<u-line margin="20rpx 0" dashed="true"></u-line>
-		
+
 					<view class="item-top">
-						<view class="top-left gray-color">订单编号 : {{ item.orderSn }}</view>
+						<view class="top-left gray-color">订单编号 : {{ item.id }}</view>
 						<view class="top-right">{{ type_name }}</view>
 					</view>
 					<view class="item-top">
-						<view class="top-left gray-color">下单时间 : {{ formatTime1( item.createTime) }}</view>
+						<view class="top-left gray-color">下单时间 : {{formatTime1(item.createTime)  }}</view>
 						<view class="top-right"></view>
 					</view>
 					<view class="item-top">
-						 <view  class="top-left gray-color">预约时间: {{ formatTime1(item.createTime) }}</view>
-						   
+						<view class="top-left gray-color">预约时间: {{ formatTime1(item.appointTime) }}</view>
+
 					</view>
 				</view>
 			</view>
-			<view  style="margin-top: 40rpx" v-if="appointList.length === 0" >
+			<view style="margin-top: 40rpx" v-if="appointList.length === 0">
 				<u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
 			</view>
-			
+
 		</view>
 
 	</view>
@@ -136,7 +138,7 @@
 			this.getMerchantList();
 		},
 		onReady() {
-			 
+
 		},
 		methods: {
 			onDayClick(data) {
@@ -144,7 +146,9 @@
 				this.curDate = data.date;
 			},
 			async getMerchantList() {
-				let result = Object.assign({}, {paging: `${this.params.pageNum},${this.params.pageSize}`}, {
+				let result = Object.assign({}, {
+					paging: `${this.params.pageNum},${this.params.pageSize}`
+				}, {
 					merchantId: this.list.id,
 					status: 'PENDING',
 					date: this.curDate
@@ -155,42 +159,42 @@
 				console.log(res, "sdaasdsas")
 			},
 			getStatusColor(status) {
-			      switch (status) {
-			        case 1:
-			          return 'blue';
-			        case 2:
-			          return 'red';
-			        case 3:
-			          return 'orange';
-			        default:
-			          return 'black';
-			      }
-			    },
-			    getStatusText(status) {
-			      switch (status) {
-			        case 1:
-			          return '待处理';
-			        case 2:
-			          return '已取消';
-			        case 3:
-			          return '已完成';
-			        default:
-			          return '';
-			      }
-			    },
-				formatTime1(timestamp) {
-				  const date = new Date(timestamp * 1000); // 转换为毫秒
-				  const year = date.getFullYear();
-				  const month = ('0' + (date.getMonth() + 1)).slice(-2);
-				  const day = ('0' + date.getDate()).slice(-2);
-				  const hour = ('0' + date.getHours()).slice(-2);
-				  const minute = ('0' + date.getMinutes()).slice(-2);
-				  const second = ('0' + date.getSeconds()).slice(-2);
-				  
-				  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+				switch (status) {
+					case 1:
+						return 'blue';
+					case 2:
+						return 'red';
+					case 3:
+						return 'orange';
+					default:
+						return 'black';
+				}
+			},
+			getStatusText(status) {
+				switch (status) {
+					case 1:
+						return '待处理';
+					case 2:
+						return '已取消';
+					case 3:
+						return '已完成';
+					default:
+						return '';
 				}
-			
-			
+			},
+			formatTime1(timestamp) {
+				const date = new Date(timestamp ); // 转换为毫秒
+				const year = date.getFullYear();
+				const month = ('0' + (date.getMonth() + 1)).slice(-2);
+				const day = ('0' + date.getDate()).slice(-2);
+				const hour = ('0' + date.getHours()).slice(-2);
+				const minute = ('0' + date.getMinutes()).slice(-2);
+				const second = ('0' + date.getSeconds()).slice(-2);
+
+				return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+			}
+
+
 			// async getAppointList() {
 			//   let result = Object.assign({}, { ...this.params }, { merchantId: this.list.id });
 			//   let res = await getAppointListApi({ ...result });
@@ -208,7 +212,7 @@
 		margin-top: 10px;
 		padding: 10rpx 20rpx 20rpx;
 		box-sizing: border-box;
-	
+
 		.order-box {
 			.order-item {
 				margin-bottom: 20rpx;
@@ -216,70 +220,70 @@
 				border-radius: 20rpx;
 				padding: 20rpx;
 				box-shadow: 0 8rpx 15rpx 0 rgba(0, 0, 0, 0.08);
-	
+
 				.item-top {
 					display: flex;
 					justify-content: space-between;
 					margin-bottom: 10rpx;
 				}
-	
+
 				.item-center {
 					display: flex;
 					align-items: center;
 					margin-bottom: 10rpx;
-	
+
 					.center-left {
 						height: 160rpx;
-	
+
 						.img {
 							width: 160rpx;
 							height: 160rpx;
 						}
 					}
-	
+
 					.center-right {
 						width: 100%;
 						height: 160rpx;
 						display: flex;
 						justify-content: space-between;
 						margin-left: 20rpx;
-	
+
 						.r-l {
 							display: flex;
 							flex-direction: column;
 							justify-content: space-around;
-	
+
 							.right-name {
 								color: #4d5671;
 								font-size: 32rpx;
 								font-weight: bold;
 							}
-	
+
 							.right-descript {
 								font-size: 28rpx;
 								color: #858797;
 							}
-	
+
 							.l-box {
 								display: flex;
 								font-size: 24rpx;
 								align-items: center;
 								font-style: italic;
-	
+
 								.right-price {
 									margin-right: 20rpx;
 									font-weight: bold;
 									font-size: 28rpx;
 									color: #f57f32;
 								}
-	
+
 								.right-numb {
 									font-size: 24rpx;
 									color: #858797;
 								}
 							}
 						}
-	
+
 						.r-r {
 							.r-item {
 								align-items: center;
@@ -287,27 +291,28 @@
 						}
 					}
 				}
-	
+
 				.item-allnumb-box {
 					display: flex;
 					justify-content: space-between;
 					align-items: center;
 					font-weight: bold;
-	
+
 					.allnumb-left {
-						display:flex;
-						justify-content:start;
-						 align-items: center;
+						display: flex;
+						justify-content: start;
+						align-items: center;
 						font-size: 32rpx;
-						.img{
-							display:block;
+
+						.img {
+							display: block;
 						}
 					}
-	
+
 					.allnumb-right {
 						font-size: 26rpx;
 						color: #f57f32;
-	
+
 						.r-text {
 							color: #000;
 						}
@@ -316,5 +321,4 @@
 			}
 		}
 	}
-	
 </style>

+ 4 - 4
src/pageMerchant/tabbar/order.vue

@@ -56,10 +56,10 @@
 						id: '3',
 						name: '已退款'
 					},
-					{
-						id: '4',
-						name: '已过期'
-					},
+					// {
+					// 	id: '4',
+					// 	name: '已过期'
+					// },
 					// {
 					// 	id: '5',
 					// 	name: '预约列表'