guhongwei há 2 anos atrás
pai
commit
d9067383a5
2 ficheiros alterados com 68 adições e 265 exclusões
  1. 1 1
      pages/index/index.vue
  2. 67 264
      pagesMy/order/index.vue

+ 1 - 1
pages/index/index.vue

@@ -37,7 +37,7 @@
 								path: '/pages/index/index',
 								imageUrl: config.config.share[0].url
 							}
-							let url = `/pagesMy/order/service`;
+							let url = `/pages/home/index`;
 							uni.redirectTo({
 								url
 							})

+ 67 - 264
pagesMy/order/index.vue

@@ -97,7 +97,10 @@
 									<view class="btn">
 										<button v-if="item.status=='0'" size="mini" @tap.stop="toCancel(item)">取消订单</button>
 										<button v-if="item.status=='0'" size="mini" @tap.stop="toPay(item)">支付</button>
+										<button v-if="item.status=='1'" size="mini" @tap.stop="toCancels(item)">取消订单</button>
 										<button v-if="item.status=='2'||item.status=='3'" size="mini" @tap.stop="toLogi(item)">查看物流</button>
+										<button v-if="item.status=='2'" size="mini" @tap.stop="toConfirm(item)">确认收货</button>
+										<button v-if="item.status=='3'" size="mini" @tap.stop="toAfter(item)">申请售后</button>
 									</view>
 								</view>
 								<view class="is_bottom" v-if="is_bottom">
@@ -247,7 +250,6 @@
 					for (let val of list) {
 						val.zhStatus = that.searchStatus(val.status)
 					}
-					console.log(list);
 					that.$set(that, `list`, list);
 					that.$set(that, `total`, res.total)
 				} else {
@@ -388,12 +390,71 @@
 					})
 				}
 			},
+			// 取消订单-已支付
+			toCancels(e) {
+				const that = this;
+				uni.showModal({
+					title: '提示',
+					content: '确定取消订单吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							let arr = that.$api(`/afterSale`, 'POST', {
+								order_detail: e._id,
+								type: '4'
+							})
+							if (res.errcode == '0') {
+								console.log(res);
+							} else {
+								uni.showToast({
+									title: res.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					}
+				});
+			},
 			// 查看物流
 			toLogi(e) {
 				uni.navigateTo({
 					url: `/pagesMy/logistics/index?id=${e._id}`
 				})
 			},
+			// 确认收货
+			async toConfirm(e) {
+				const that = this;
+				uni.showModal({
+					title: '提示',
+					content: '确定确认收货吗?',
+					success: async function(res) {
+						if (res.confirm) {
+							const arr = await that.$api(`/orderDetail/${e._id}`, 'POST', {
+								status: '3'
+							});
+							if (arr.errcode == '0') {
+								uni.showToast({
+									title: '确认收货成功',
+									icon: 'none'
+								})
+								that.clearPage();
+								that.search();
+							} else {
+								uni.showToast({
+									title: arr.errmsg,
+									icon: 'none'
+								})
+							}
+						}
+					}
+				});
+
+			},
+			// 申请售后
+			toAfter(e) {
+				uni.navigateTo({
+					url: `/pagesMy/order/service?id=${e._id}&&status=${e.status}`
+				})
+			},
 			// 查询其他信息
 			async searchOther() {
 				const that = this;
@@ -606,276 +667,18 @@
 
 					.btn {
 						text-align: right;
+
+						button {
+							margin: 0 2vw 0 0;
+						}
 					}
 				}
 
-				// .list_2 {
-				// 	background-color: #fff;
-				// 	margin: 0 2vw 2vw 2vw;
-				// 	padding: 2vw;
-
-				// 	.status {
-				// 		color: var(--ff0Color);
-				// 		text-align: right;
-				// 		margin: 0 0 1vw 0;
-				// 	}
-
-				// 	.goods {
-				// 		margin: 0 0 1vw 0;
-				// 		padding: 2vw;
-				// 		border-bottom: 1px solid #f5f5f5;
-
-				// 		.goods_1 {
-				// 			margin: 0 0 2vw 0;
-
-				// 			.shopname {
-				// 				text:last-child {
-				// 					padding: 0 0 0 2vw;
-				// 				}
-				// 			}
-				// 		}
-
-				// 		.goods_2 {
-				// 			margin: 0 0 1vw 0;
-
-				// 			.market {
-				// 				display: flex;
-
-				// 				.url {
-				// 					width: 20vw;
-
-				// 					.image {
-				// 						width: 100%;
-				// 						height: 20vw;
-				// 						border-radius: 5px;
-
-				// 					}
-				// 				}
-
-				// 				.goodsname {
-				// 					display: flex;
-				// 					flex-direction: column;
-				// 					width: 60vw;
-				// 					padding: 0 2vw;
-
-				// 					.specs {
-				// 						color: var(--f85Color);
-				// 						font-size: var(--font12Size);
-				// 					}
-				// 				}
-
-
-
-				// 				.goodsother {
-				// 					width: 15vw;
-				// 					text-align: right;
-				// 				}
-				// 			}
-				// 		}
-				// 	}
-
-				// 	.other {
-				// 		margin: 0 0 2vw 0;
-				// 		text-align: right;
-
-				// 		text {
-				// 			font-size: 14px;
-
-				// 			padding: 0 0 0 2vw;
-				// 		}
-				// 	}
-
-				// 	.btn {
-				// 		text-align: right;
-				// 		margin: 2vw 0 0 0;
-				// 		border-top: 1px solid #f1fff1;
-
-				// 		button {
-				// 			margin: 2vw 0 0 2vw;
-				// 		}
-
-				// 		.toPay {
-				// 			border: 1px solid #ff0000;
-				// 			color: #ff0000;
-				// 		}
-				// 	}
-				// }
-
-				// .list_3 {
-				// 	.list_3_1 {
-				// 		display: flex;
-				// 		justify-content: space-between;
-				// 	}
-				// }
-
-				// .list {
-				// 	background-color: #fff;
-				// 	margin: 0 2vw 2vw 2vw;
-				// 	padding: 2vw;
-
-				// 	.list_1 {
-				// 		margin: 0 0 1vw 0;
-				// 		display: flex;
-				// 		flex-direction: row;
-				// 		justify-content: space-between;
-				// 	}
-
-				// 	.list_2 {
-				// 		margin: 0 0 1vw 0;
-				// 		display: flex;
-
-				// 		.l {
-				// 			width: 20vw;
-
-				// 			.image {
-				// 				width: 100%;
-				// 				height: 20vw;
-				// 				border-radius: 5px;
-
-				// 			}
-				// 		}
-
-				// 		.c {
-				// 			width: 60vw;
-				// 			padding: 0 2vw;
-				// 		}
-
-				// 		.r {
-				// 			width: 15vw;
-				// 			text-align: right;
-				// 		}
-				// 	}
-
-				// 	.other {
-				// 		margin: 0 0 2vw 0;
-				// 		text-align: right;
-
-				// 		text {
-				// 			font-size: 14px;
-
-				// 			padding: 0 0 0 2vw;
-				// 		}
-				// 	}
-
-				// 	.btn {
-				// 		text-align: right;
-				// 		margin: 2vw 0 0 0;
-				// 		border-top: 1px solid #f1fff1;
-
-				// 		button {
-				// 			margin: 2vw 0 0 2vw;
-				// 		}
-				// 	}
-				// }
+
 			}
 		}
 	}
 
-	// 	.two {
-	// 		position: relative;
-	// 		flex-grow: 1;
-	// 		background-color: var(--f9Color);
-
-	// 		.two_1 {
-	// 			background-color: var(--fffColor);
-	// 			padding: 2vw;
-	// 			display: flex;
-	// 			flex-direction: row;
-	// 		}
-
-	// 		.two_2 {
-	// 			display: flex;
-	// 			flex-direction: column;
-
-	// 			.list {
-	// 				width: 100vw;
-	// 				margin: 2vw 0 0 0;
-	// 				background-color: var(--mainColor);
-
-	// 				.list_1 {
-	// 					display: flex;
-	// 					flex-direction: row;
-	// 					justify-content: space-between;
-	// 					padding: 2vw;
-
-	// 					.name {
-	// 						font-size: var(--font14Size);
-
-	// 						text {
-	// 							margin: 0 1vw 0 0;
-	// 						}
-	// 					}
-
-	// 					.status {
-	// 						font-size: var(--font14Size);
-	// 						color: var(--ff0Color);
-	// 					}
-	// 				}
-
-	// 				.list_2 {
-	// 					display: flex;
-	// 					flex-direction: row;
-	// 					justify-content: space-between;
-	// 					padding: 2vw;
-	// 					background-color: var(--f8Color);
-
-	// 					.image {
-	// 						width: 20vw;
-	// 						height: 20vw;
-	// 						margin: 0 2vw 0 0;
-	// 					}
-
-	// 					.other {
-	// 						display: flex;
-	// 						flex-direction: column;
-	// 						flex-grow: 1;
-
-	// 						.name {
-	// 							font-size: var(--font14Size);
-	// 							font-weight: bold;
-	// 							margin: 0 0 2vw 0;
-	// 						}
-
-	// 						.other_1 {
-	// 							font-size: var(--font12Size);
-	// 							color: var(--f85Color);
-	// 						}
-	// 					}
-
-	// 					.money {
-	// 						font-size: var(--font12Size);
-
-	// 						.num {
-	// 							text-align: right;
-	// 						}
-	// 					}
-	// 				}
-
-	// 				.list_3 {
-	// 					display: flex;
-	// 					justify-content: flex-end;
-	// 					padding: 2vw;
-	// 					border-bottom: 0.5vw solid var(--f9Color);
-	// 					font-size: var(--font12Size);
-
-	// 					text {
-	// 						margin: 0 1vw;
-	// 					}
-	// 				}
-
-	// 				.list_4 {
-	// 					padding: 2vw;
-	// 					text-align: right;
-
-	// 					button {
-	// 						margin: 0 1vw 0 2vw;
-	// 					}
-	// 				}
-	// 			}
-	// 		}
-	// 	}
-	// }
-
 	.scroll-view {
 		position: absolute;
 		top: 0;