فهرست منبع

Merge remote-tracking branch 'origin/tianyi' into clientDemo

忆雪 10 ماه پیش
والد
کامیت
47415fecbc

+ 293 - 0
src/pageMerchant/components/orderDetail.vue

@@ -0,0 +1,293 @@
+<template>
+	<view class="container">
+		<view style="font-size: 48rpx;margin: 10rpx 20rpx" :style="{color: getStatusColor(list.status)}">
+			{{ getStatusText(list.status) }}
+		</view>
+		<view style="margin: 10rpx 20rpx;"> 该订单服务{{ getStatusText(list.status) }}</view>
+		<!-- 订单 -->
+		<view class="order">
+			<view class="order-box">
+				<view class="order-item">
+					<view class="item-allnumb-box">
+						<view class="allnumb-left">
+							<image class="img" :src="list.avatar || '@/tatic/logo.png' "
+								style="width: 50rpx; height: 50rpx" />
+							<span style="margin-left:20rpx">{{list.memberUsername}}</span>
+						</view>
+						<view class="allnumb-right">
+							<u-icon name="phone" color="#2979ff" size="24" @click="handlerMakePhone(list.mobile)" />
+						</view>
+					</view>
+
+					<u-line margin="20rpx 0"></u-line>
+
+					<view class="item-center" :key="idx" v-for="(itm, idx) of list.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>¥{{ list.payAmount }}
+						</view>
+					</view>
+
+					<!-- <u-line margin="20rpx 0" dashed="true"></u-line> -->
+
+
+				</view>
+			</view>
+			<view class="order-item">
+				<view style="font-size: 48rpx;margin-bottom: 10rpx;">服务信息</view>
+				<view class="item-top">
+					<view class="top-left gray-color">订单编号 : {{ list.id }}</view>
+					<view class="top-right"></view>
+				</view>
+				<view class="item-top">
+					<view class="top-left gray-color">下单时间 : {{ formatTime1(list.createTime)  }}</view>
+					<view class="top-right"></view>
+				</view>
+				<view class="item-top">
+					<view class="top-left gray-color">备注 : {{ "--" }}</view>
+					<view class="top-right"></view>
+				</view>
+			</view>
+			<!-- 核销信息 -->
+			<view class="order-item" v-if="list.status == 1">
+				<view style="font-size: 48rpx;margin-bottom: 10rpx;">核销信息</view>
+				<view class="item-top">
+					<view class="top-left gray-color">核销人员 :--</view>
+					<!-- <view class="top-right">{{ type_name }}</view> -->
+				</view>
+				<view class="item-top">
+					<view class="top-left gray-color">核销编号 : --</view>
+					<view class="top-right"></view>
+				</view>
+				<view class="item-top">
+					<view class="top-left gray-color">核销时间:
+						{{ formatTime1(list.receive_time) }}
+					</view>
+					<view v-if="list.status == 3" class="top-left gray-color">核销门店:
+						{{ '--' }}
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				list: {}
+			};
+		},
+		mounted() {},
+		onLoad(options) {
+			console.log(options, "options");
+			// 在这里处理传递过来的参数
+
+			this.list = options.detailDate; // 尝试解析 JSON 字符串
+
+		},
+		onShow() {
+
+		},
+		methods: {
+			handlerMakePhone() {
+				console.log("打电话")
+			},
+			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 '';
+				}
+			},
+			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}`;
+			}
+		},
+	};
+</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;
+				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>

+ 7 - 1
src/pageMerchant/components/orderList.vue

@@ -3,7 +3,7 @@
 		<!-- 订单 -->
 		<view class="order">
 			<view class="order-box">
-				<view class="order-item" v-for="(item, index) of list" :key="index">
+				<view class="order-item" v-for="(item, index) of list" :key="index" @click="toDetail(item)">
 					<view class="item-allnumb-box">
 						<view class="allnumb-left">
 							<image class="img" :src="item.avatar || '@/tatic/logo.png' "
@@ -106,6 +106,12 @@
 
 		},
 		methods: {
+			toDetail(item){
+				console.log(item,"item")
+				uni.navigateTo({
+					url: `/pageMerchant/components/orderDetail?detailDate=${JSON.stringify(item)}`,
+				});
+			},
 			getStatusColor(status) {
 				switch (status) {
 					case 1:

+ 313 - 0
src/pageMerchant/components/toBeVerified.vue

@@ -0,0 +1,313 @@
+<template>
+	<view class="container">
+		<view class="order-item" style="padding: 200rpx 0; display: grid; place-items: center;">
+			<!-- 订单 -->
+			<view style="font-size: 48rpx; margin-bottom: 20rpx;">{{'1796545175311040513' }}</view>
+			<view :style="{color: getStatusColor(list.status)}"  style="font-size: 56rpx;">
+				{{ getStatusText(list.status) }}
+			</view>
+		</view>
+		<view class=" order-item">
+			<view class="item-allnumb-box">
+				<view class="allnumb-left">
+					<image class="img" :src="list.avatar || '@/tatic/logo.png' " style="width: 50rpx; height: 50rpx" />
+					<span style="margin-left:20rpx">{{list.memberUsername}}</span>
+				</view>
+				<view class="allnumb-right">
+					<u-icon name="phone" color="#2979ff" size="24" @click="handlerMakePhone(list.mobile)" />
+				</view>
+			</view>
+
+			<u-line margin="20rpx 0"></u-line>
+
+			<view class="item-center" :key="idx" v-for="(itm, idx) of list.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>¥{{ list.payAmount }}
+				</view>
+			</view>
+
+
+		</view>
+		<!-- 服务信息 -->
+		<view class="order-item">
+			<view style="font-size: 48rpx;margin-bottom: 10rpx;">服务信息</view>
+			<view class="item-top">
+				<view class="top-left gray-color">订单编号 : {{ list.id }}</view>
+				<view class="top-right">
+					<u-button type="primary" text="复制" size="mini" :plain="true" @click="ClipboardData"></u-button>
+				</view>
+			</view>
+			<view class="item-top">
+				<view class="top-left gray-color">下单时间 : {{ formatTime1(list.createTime)  }}</view>
+				<view class="top-right"></view>
+			</view>
+			<view class="item-top">
+				<view class="top-left gray-color">备注 : {{ "--" }}</view>
+				<view class="top-right"></view>
+			</view>
+		</view>
+
+		<view class="btn"><u-button @click="compileHalend" type="primary" shape="circle" size="large"
+				text="确认核销"></u-button></view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		getVerificationApi,
+	} from '@/api/merchant/order'
+	import {
+		mapGetters
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				list: {},
+			};
+		},
+		computed: {
+			...mapGetters(['merchantId']),
+		},
+		mounted() {},
+		onLoad(options) {
+			console.log(options, "options");
+			this.list = options.list[4]
+			
+		},
+		onShow() {
+		},
+		methods: {
+			ClipboardData(){
+				// 在需要触发复制操作的事件中调用该方法
+				uni.setClipboardData({
+				  data: this.list.id,
+				  success: function () {
+				    uni.showToast({
+				      title: '复制成功',
+				      icon: 'success'
+				    })
+				  }
+				})
+			},
+			compileHalend() {
+				console.log(this.list.id, this.merchantId,"this.list.id, this.merchantId")
+				getVerificationApi(this.list.id, this.merchantId)
+					.then(response => {
+						if (response.code == "OK") {
+							uni.showToast({
+								title: "核销成功",
+								icon: 'success',
+								dration: 2000,
+							});
+						}
+					})
+			},
+			handlerMakePhone() {
+				console.log("打电话")
+			},
+			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 '';
+				}
+			},
+			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}`;
+			}
+		},
+	};
+</script>
+
+<style lang="scss" scoped>
+	.container{
+		padding: 20rpx;
+	}
+	.order {
+		margin-top: 10px;
+		padding: 10rpx 20rpx 20rpx;
+		box-sizing: border-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;
+				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;
+	}
+
+	.btn {
+		margin-bottom: 50rpx;
+		padding: 0 20rpx;
+	}
+</style>

+ 19 - 6
src/pageMerchant/storeModule/appointList.vue

@@ -124,7 +124,23 @@
 				},
 			};
 		},
-		created() {
+		// created() {
+		// 	let {
+		// 		merchant
+		// 	} = this.$store.state.data.merchantInfo;
+		// 	this.list = merchant;
+		// 	let today = this.$refs.ren.getToday().date;
+		// 	this.curDate = today;
+		// 	this.markDays.push(today);
+		// 	console.log(this.curDate)
+		// },
+		// mounted() {
+		// 	this.getMerchantList();
+		// },
+		onReady() {
+
+		},
+		onShow() {
 			let {
 				merchant
 			} = this.$store.state.data.merchantInfo;
@@ -133,12 +149,9 @@
 			this.curDate = today;
 			this.markDays.push(today);
 			console.log(this.curDate)
-		},
-		mounted() {
+			
 			this.getMerchantList();
-		},
-		onReady() {
-
+			
 		},
 		methods: {
 			onDayClick(data) {

+ 47 - 18
src/pageMerchant/storeModule/commodityWriteOff.vue

@@ -23,18 +23,18 @@
 	import {
 		getVerificationApi
 	} from '@/api/merchant/order'
-	import {
-		mapGetters
-	} from 'vuex';
+	// import {
+	// 	mapGetters
+	// } from 'vuex';
 	export default {
 		data() {
 			return {
 
 			}
 		},
-		computed: {
-			...mapGetters(['userId']),
-		},
+		// computed: {
+		// 	...mapGetters(['userId']),
+		// },
 		methods: {
 			toUrl(){
 				console.log("sadas")
@@ -47,20 +47,50 @@
 					url: '/pageMerchant/storeModule/components/verificationList',
 				});
 			},
+			async getOrderList(id) {
+				let result = Object.assign({}, {
+					paging: `${this.params.pageNum},${this.params.pageSize}`,
+					status: 0,
+					orderSn: id
+				}, );
+				let res = await getOrderListApi({
+					...result
+				});
+				if (res.code === 'OK' && res.data.records) {
+					uni.navigateTo({
+						url: `/pageMerchant/components/toBeVerified?list=${JSON.stringify(res.data.records)}`
+					})
+				} else {
+					uni.showToast({
+						title: "没有该订单信息",
+						dration: 2000,
+					});
+				}
+			},
 			scanCode() {
-				const userId = this.userId;
+				const this1 = this;
 				uni.scanCode({
 					success: function(res) {
-						getVerificationApi(res.result, userId)
-							.then(response => {
-								if(response.code == "OK"){
-									uni.showToast({
-									  title: "核销成功",
-									  icon: 'success',
-									  dration: 2000,
-									});
-								}
-							})
+						this1.getOrderList(res.result)
+						// uni.navigateTo({
+						// 	url:`/pageMerchant/components/toBeVerified?id=${res.result}`
+						// })
+						
+						// getVerificationApi(res.result, )
+						// 	.then(response => {
+						// 		if(response.code == "OK"){
+									
+						// 			uni.navigateTo({
+						// 				url:`/pageMerchant/components/orderDetail?id=${}`
+						// 			})
+									
+						// 			uni.showToast({
+						// 			  title: "核销成功",
+						// 			  icon: 'success',
+						// 			  dration: 2000,
+						// 			});
+						// 		}
+						// 	})
 						console.log(res, "res")
 					}
 				});
@@ -72,7 +102,6 @@
 <style lang="scss" scoped>
 	.img {
 		margin-top: 100rpx;
-
 		image {
 			display: block;
 			margin: 0 auto;

+ 35 - 18
src/pageMerchant/storeModule/components/queryWriteOff.vue

@@ -4,7 +4,7 @@
 			<image slot="icon" src="@/static/order/搜索@2x.png" style="width: 250rpx; height: 200rpx" />
 		</view>
 		<view class="queryWriteOff">
-			<input type="text" :value="vakue" placeholder="请输入订单号查询" />
+			<input type="text" v-model="value" placeholder="请输入订单号查询" />
 			<button @click='verification()'>查询核销</button>
 		</view>
 
@@ -13,33 +13,50 @@
 
 <script>
 	import {
+		getOrderListApi,
 		getVerificationApi
 	} from '@/api/merchant/order'
-	import {
-		mapGetters
-	} from 'vuex';
+	// import {
+	// 	mapGetters
+	// } from 'vuex';
 	export default {
 		data() {
 			return {
-				value: ''
+				value: '',
+				params: {
+					pageNum: 1,
+					pageSize: 10,
+				}
 			}
 		},
-		computed: {
-			...mapGetters(['userId']),
-		},
+		// computed: {
+		// 	...mapGetters(['userId']),
+		// },
 		methods: {
 			verification() {
-				getVerificationApi(this.value, this.userId)
-					.then(response => {
-						if (response.code == "OK") {
-							uni.showToast({
-								title: "核销成功",
-								icon: 'success',
-								dration: 2000,
-							});
-						}
+				this.getOrderList()
+			},
+			async getOrderList() {
+				console.log(this.value,"输入的")
+				let result = Object.assign({}, {
+					paging: `${this.params.pageNum},${this.params.pageSize}`,
+					status: 0,
+					orderSn: this.value
+				}, );
+				let res = await getOrderListApi({
+					...result
+				});
+				if (res.code === 'OK' && res.data.records) {
+					uni.navigateTo({
+						url: `/pageMerchant/components/toBeVerified?list=${JSON.stringify(res.data.records)}`
 					})
-			}
+				} else {
+					uni.showToast({
+						title: "没有该订单信息",
+						dration: 2000,
+					});
+				}
+			},
 		}
 	}
 </script>

+ 14 - 0
src/pages.json

@@ -405,6 +405,20 @@
 					"style": {
 						"navigationBarTitleText": "核销记录"
 					}
+				},
+				{
+					"path" : "components/orderDetail",
+					"style" : 
+					{
+						"navigationBarTitleText" : "订单详情"
+					}
+				},
+				{
+					"path" : "components/toBeVerified",
+					"style" : 
+					{
+						"navigationBarTitleText" : "待核销"
+					}
 				}
 			]
 		}