guhongwei 2 years ago
parent
commit
de44016e94
2 changed files with 482 additions and 514 deletions
  1. 337 224
      pagesMy/order/index.vue
  2. 145 290
      pagesMy/order/service.vue

+ 337 - 224
pagesMy/order/index.vue

@@ -9,83 +9,74 @@
 					<view class="tabsList">
 						<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 							<view class="list-scroll-view">
-								<view class="list_1" v-if="tabs.active=='-0'">
-									全部订单
-								</view>
-								<view class="list_2" v-for="(item,index) in list" :key="index" v-else-if="tabs.active=='0'" @tap="toInfo(item)">
-									<view class="status">
-										{{item.status=='0'?'待付款':item.status=='1'?'已支付':item.status=='-1'?'取消订单':item.status=='2'?'发货中':item.status=='-2'?'已退款':item.status=='3'?'已收货':item.status=='-3'?'申请售后':item.status=='-4'?'正在售后中':item.status=='-5'?'售后已结束':'未识别'}}
-									</view>
-									<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
-										<view class="goods_1">
-											<view class="shopname">
-												<text class="iconfont icon-shangdian"></text>
-												<text>{{tag.shop_name}}</text>
-											</view>
+								<view class="list" v-for="(item,index) in list" :key="index" @tap="toInfo(item)">
+									<view class="list_1" v-if="tabs.active=='0'">
+										<view class="status">
+											{{item.zhStatus}}
 										</view>
-										<view class="goods_2">
-											<view class="market" v-for="(tags,indexss) in tag.goods" :key="indexss">
-												<view class="url">
-													<image class="image" :src="tags.goods.file&&tags.goods.file.length>0?tags.goods.file[0].url:''" mode=""></image>
+										<view class="goods">
+											<view class="goodsList" v-for="(tag,indexs) in item.goods" :key="indexs">
+												<view class="shopname">
+													<text class="iconfont icon-shangdian"></text>
+													<text>{{tag.shop_name}}</text>
 												</view>
-												<view class="goodsname">
-													{{tags.goods.name}}
-													<view class="specs">
-														{{tags.name}}
-													</view>
-												</view>
-												<view class="goodsother">
-													<view v-if="item.type=='0'" class="price">
-														¥{{tags.sell_money}}
-													</view>
-													<view v-else class="price">
-														¥{{tags.group_config.money}}
-													</view>
-													<view class="num">
-														×{{tags.buy_num}}
+												<view class="goodsList_1">
+													<view class="market" v-for="(tags,indexss) in tag.goods" :key="indexss">
+														<view class="market_1">
+															<image class="image" :src="tags.goods.file&&tags.goods.file.length>0?tags.goods.file[0].url:''" mode=""></image>
+														</view>
+														<view class="market_2">
+															<view class="goodsname textOver">
+																{{tags.goods.name}}
+															</view>
+															<view class="specs">
+																{{tags.name}}
+															</view>
+														</view>
+														<view class="market_3">
+															<view v-if="item.type=='0'" class="price">
+																¥{{tags.sell_money}}
+															</view>
+															<view v-else class="price">
+																¥{{tags.group_config.money}}
+															</view>
+															<view class="num">
+																×{{tags.buy_num}}
+															</view>
+														</view>
 													</view>
 												</view>
 											</view>
 										</view>
+										<view class="other">
+											<text>共{{item.total_detail.freight_total}}件商品</text>
+											<text>总价¥{{item.total_detail.goods_total}}</text>
+										</view>
 									</view>
-									<view class="other">
-										<text>共{{item.total_detail.freight_total}}件商品</text>
-										<text>总价¥{{item.total_detail.goods_total}}</text>
-									</view>
-									<view class="btn">
-										<button v-if="item.status=='0'" type="default" size="mini" @tap.stop="toCancel(item)">取消订单</button>
-										<button class="toPay" v-if="item.status=='0'" type="default" size="mini" @tap.stop="toPay(item)">付款</button>
-										<button v-if="item.status=='2'" type="default" size="mini" @tap.stop="toConfirm(item)">确认收货</button>
-										<button v-if="item.status!='0'" type="default" size="mini" @tap.stop="toAfter(item)">申请售后</button>
-										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">立即评价</button>
-										<button v-if="item.status=='3'&&item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">追加评价</button>
-									</view>
-								</view>
-								<view class="list_2 list_3" v-for="(item,index) in list" :key="index" @tap="toInfo(item)" v-else>
-									<view class="list_3_1">
-										<view class="goods_1">
+									<view class="list_2" v-else>
+										<view class="list_2_1">
 											<view class="shopname">
 												<text class="iconfont icon-shangdian"></text>
 												<text>{{item.shop.name}}</text>
 											</view>
+											<view class="status">
+												{{item.zhStatus}}
+											</view>
 										</view>
-										<view class="status">
-											{{item.status=='0'?'待付款':item.status=='1'?'已支付':item.status=='-1'?'取消订单':item.status=='2'?'发货中':item.status=='-2'?'已退款':item.status=='3'?'已收货':item.status=='-3'?'申请售后':item.status=='-4'?'正在售后中':item.status=='-5'?'售后已结束':'未识别'}}
-										</view>
-									</view>
-									<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
-										<view class="goods_2">
-											<view class="market">
-												<view class="url">
+										<view class="list_2_2">
+											<view class="goods" v-for="(tag,indexs) in item.goods" :key="indexs">
+												<view class="goods_1">
 													<image class="image" :src="tag.url" mode=""></image>
 												</view>
-												<view class="goodsname">
-													{{tag.goods.name}}
+												<view class="goods_2">
+													<view class="goodsname textOver">
+														{{tag.goods.name}}
+													</view>
 													<view class="specs">
 														{{tag.name}}
 													</view>
 												</view>
-												<view class="goodsother">
+												<view class="goods_3">
 													<view v-if="item.type=='0'" class="price">
 														¥{{tag.sell_money}}
 													</view>
@@ -98,19 +89,15 @@
 												</view>
 											</view>
 										</view>
-									</view>
-									<view class="other">
-										<text>共{{item.buy_num_total||0}}件商品</text>
-										<text>总价¥{{item.real_pay}}</text>
+										<view class="other">
+											<text>共{{item.buy_num_total||0}}件商品</text>
+											<text>总价¥{{item.real_pay}}</text>
+										</view>
 									</view>
 									<view class="btn">
-										<button v-if="item.status=='2'||item.status=='3'" type="default" size="mini" @tap.stop="toLogi(item)">查看物流</button>
-										<button v-if="item.status=='0'" type="default" size="mini" @tap.stop="toCancel(item)">取消订单</button>
-										<button class="toPay" v-if="item.status=='0'" type="default" size="mini" @tap.stop="toPay(item)">付款</button>
-										<button v-if="item.status=='2'" type="default" size="mini" @tap.stop="toConfirm(item)">确认收货</button>
-										<button v-if="item.status!='0'" type="default" size="mini" @tap.stop="toAfter(item)">申请售后</button>
-										<button v-if="item.status=='3'&&!item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">立即评价</button>
-										<button v-if="item.status=='3'&&item.rate" type="default" size="mini" @tap.stop="toAppraise(item)">追加评价</button>
+										<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=='2'||item.status=='3'" size="mini" @tap.stop="toLogi(item)">查看物流</button>
 									</view>
 								</view>
 								<view class="is_bottom" v-if="is_bottom">
@@ -143,20 +130,16 @@
 				tabs: {
 					active: '0',
 					menu: [ //菜单列表
-						// {
-						// 	title: '全部订单',
-						// 	active: '-0'
-						// },
 						{
-							title: '待付款',
+							title: '未支付',
 							active: '0'
 						},
 						{
-							title: '待发货',
+							title: '已支付',
 							active: '1'
 						},
 						{
-							title: '待收货',
+							title: '发货中',
 							active: '2'
 						},
 						{
@@ -166,6 +149,18 @@
 						{
 							title: '取消订单',
 							active: '-1'
+						},
+						{
+							title: '申请售后',
+							active: '-2'
+						},
+						{
+							title: '售后处理中',
+							active: '-3'
+						},
+						{
+							title: '售后结束',
+							active: '-4'
 						}
 					]
 				},
@@ -177,15 +172,16 @@
 				// 数据是否触底
 				is_bottom: false,
 				scrollTop: 0,
+				// 字典表
+				statusList: []
 			};
 		},
 		onLoad: function(e) {
 			const that = this;
-			that.$set(that, `status`, e.status);
+			that.$set(that, `status`, e.status || '0');
 			that.searchConfig();
-			// 监听用户是否登录
-			that.watchLogin();
-
+			that.searchOther();
+			that.watchlogin();
 		},
 		onPullDownRefresh: async function() {
 			const that = this;
@@ -211,60 +207,63 @@
 				})
 			},
 			// 监听用户是否登录
-			watchLogin() {
+			watchlogin() {
 				const that = this;
 				uni.getStorage({
 					key: 'token',
 					success: function(res) {
 						let user = that.$jwt(res.data);
-						if (user) that.$set(that, `user`, user);
-						that.$set(that.tabs, `active`, that.status);
-						that.search();
-					},
-					fail: function(err) {
-						uni.navigateTo({
-							url: `/pages/login/index`
-						})
+						if (user) {
+							that.$set(that, `user`, user)
+							that.search();
+						}
 					}
-				});
+				})
 			},
-			// 查询列表
 			async search() {
 				const that = this;
 				let user = that.user;
 				let status = that.status;
-				if (status == '-0') {
-
-				} else if (status == '0') {
-					const res = await that.$api(`/order`, 'GET', {
-						status: '0',
-						customer: user._id
+				let info = {
+					skip: that.skip,
+					limit: that.limit,
+					customer: user._id,
+					status: status
+				}
+				let res;
+				if (status == '0') {
+					res = await that.$api(`/order`, 'GET', {
+						...info,
+						...that.searchInfo
 					});
-					if (res.errcode == '0') {
-						let list = [...that.list, ...res.data];
-						that.$set(that, `list`, list)
-						that.$set(that, `total`, res.total)
-					} else {
-						uni.showToast({
-							title: res.errmsg,
-						});
-					}
 				} else {
-					const res = await that.$api(`/orderDetail`, 'GET', {
-						status: that.status,
-						customer: user._id
+					res = await that.$api(`/orderDetail`, 'GET', {
+						...info,
+						...that.searchInfo
 					});
-					if (res.errcode == '0') {
-						let list = [...that.list, ...res.data];
-						that.$set(that, `list`, list)
-						that.$set(that, `total`, res.total)
-					} else {
-						uni.showToast({
-							title: res.errmsg,
-						});
+				}
+				if (res.errcode == '0') {
+					let list = [...that.list, ...res.data];
+					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 {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none'
+					})
 				}
 			},
+			// 查询状态
+			searchStatus(e) {
+				const that = this;
+				let data = that.statusList.find((i) => i.value == e);
+				if (data) return data.label
+				else return '暂无'
+			},
 			// 分页
 			toPage(e) {
 				const that = this;
@@ -295,13 +294,13 @@
 				const that = this;
 				that.$set(that.searchInfo, `name`, e.detail.value)
 			},
-			// 订单详细
+			// 订单详细信息
 			toInfo(item) {
 				uni.navigateTo({
 					url: `/pagesMy/order/info?id=${item._id}&status=${item.status}`
 				})
 			},
-			// 取消订单
+			// 取消订单-未支付
 			toCancel(e) {
 				const that = this;
 				uni.showModal({
@@ -329,7 +328,7 @@
 					}
 				});
 			},
-			// 付
+			// 
 			async toPay(e) {
 				const that = this;
 				let system = that.system;
@@ -389,62 +388,22 @@
 					})
 				}
 			},
-			// 确认收货
-			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) {
-				if (e.status == '3') {
-					uni.navigateTo({
-						url: `/pagesMy/order/service?id=${e._id}`
-					})
-				} else {
-					uni.navigateTo({
-						url: `/pagesMy/order/noService?id=${e._id}`
-					})
-				}
-			},
 			// 查看物流
 			toLogi(e) {
 				uni.navigateTo({
 					url: `/pagesMy/logistics/index?id=${e._id}`
 				})
 			},
-			// 立即评价
-			toAppraise(e) {
-				if (e.rate) {
-					uni.navigateTo({
-						url: `/pagesMy/order/appraise?id=${e._id}&rate_id=${e.rate}`
-					})
-				} else {
-					uni.navigateTo({
-						url: `/pagesMy/order/appraise?id=${e._id}`
-					})
+			// 查询其他信息
+			async searchOther() {
+				const that = this;
+				let res;
+				// 查询状态
+				res = await that.$api(`/dictData`, 'GET', {
+					code: 'order_process'
+				})
+				if (res.errcode == '0') {
+					that.$set(that, `statusList`, res.data);
 				}
 			},
 			// 选择选项卡
@@ -496,23 +455,89 @@
 				width: 100vw;
 				height: 82vh;
 
-				.list_2 {
+				.list {
 					background-color: #fff;
-					margin: 0 2vw 2vw 2vw;
+					border: 1px solid #ff0000;
 					padding: 2vw;
+					margin: 0 2vw 2vw 2vw;
+					border-radius: 5px;
 
-					.status {
-						color: var(--ff0Color);
-						text-align: right;
-						margin: 0 0 1vw 0;
-					}
+					.list_1 {
+						.status {
+							text-align: right;
+							color: var(--ff0Color);
+							margin: 0 0 1vw 0;
+						}
+
+						.goods {
+							.goodsList {
+								border-bottom: 1px solid #f1f1f1;
+
+								.shopname {
+									margin: 0 0 2vw 0;
+
+									text:last-child {
+										padding: 0 0 0 2vw;
+									}
+								}
+
+								.goodsList_1 {
+									.market {
+										display: flex;
+										padding: 0 0 2vw 0;
+
+										.market_1 {
+											width: 20vw;
+											height: 20vw;
+
+											.image {
+												width: 100%;
+												height: 100%;
+												border-radius: 5px;
+											}
+										}
+
+										.market_2 {
+											width: 55vw;
+											padding: 0 0 0 2vw;
+
+											.goodsname {
+												font-size: 16px;
+												margin: 0 0 1vw 0;
+											}
+
+											.specs {
+												font-size: 14px;
+												color: #858585;
+											}
+										}
+
+										.market_3 {
+											width: 15vw;
+											text-align: right;
+										}
+									}
+								}
+							}
+						}
 
-					.goods {
-						margin: 0 0 1vw 0;
-						padding: 2vw;
-						border-bottom: 1px solid #f5f5f5;
+						.other {
+							padding: 0 0 2vw 0;
+							margin: 2vw 0;
+							text-align: right;
+							border-bottom: 1px solid #f1f1f1;
 
-						.goods_1 {
+							text {
+								font-size: 14px;
+								padding: 0 0 0 2vw;
+							}
+						}
+					}
+
+					.list_2 {
+						.list_2_1 {
+							display: flex;
+							justify-content: space-between;
 							margin: 0 0 2vw 0;
 
 							.shopname {
@@ -520,80 +545,168 @@
 									padding: 0 0 0 2vw;
 								}
 							}
+
+							.status {
+								color: var(--ff0Color);
+							}
 						}
 
-						.goods_2 {
-							margin: 0 0 1vw 0;
+						.list_2_2 {
+							border-bottom: 1px solid #f1f1f1;
 
-							.market {
+							.goods {
 								display: flex;
+								padding: 0 0 2vw 0;
 
-								.url {
+								.goods_1 {
 									width: 20vw;
+									height: 20vw;
 
 									.image {
 										width: 100%;
-										height: 20vw;
+										height: 100%;
 										border-radius: 5px;
-
 									}
 								}
 
-								.goodsname {
-									display: flex;
-									flex-direction: column;
-									width: 60vw;
-									padding: 0 2vw;
+								.goods_2 {
+									width: 55vw;
+									padding: 0 0 0 2vw;
+
+									.goodsname {
+										font-size: 16px;
+										margin: 0 0 1vw 0;
+									}
 
 									.specs {
-										color: var(--f85Color);
-										font-size: var(--font12Size);
+										font-size: 14px;
+										color: #858585;
 									}
 								}
 
-
-
-								.goodsother {
+								.goods_3 {
 									width: 15vw;
 									text-align: right;
 								}
 							}
 						}
-					}
 
-					.other {
-						margin: 0 0 2vw 0;
-						text-align: right;
-
-						text {
-							font-size: 14px;
+						.other {
+							padding: 0 0 2vw 0;
+							margin: 2vw 0;
+							text-align: right;
+							border-bottom: 1px solid #f1f1f1;
 
-							padding: 0 0 0 2vw;
+							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_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;

+ 145 - 290
pagesMy/order/service.vue

@@ -2,295 +2,161 @@
 	<mobile-frame>
 		<view class="main">
 			<view class="one">
-				<view class="list" v-if="info._id">
-					<view class="list_1">
-						<text>退款商品</text>
-					</view>
-					<view class="list_2">
-						<view class="l">
-							<image class="image" :src="info.goods.file&&info.goods.file.length>0?info.goods.file[0].url:''" mode="">
+				<view class="one_1">
+					<text>售后商品</text>
+				</view>
+				<view class="one_2">
+					<view class="list" v-for="(item,index) in info.goods" :key="index">
+						<view class="list_1">
+							<image class="image" :src="item.goods.file&&item.goods.file.length>0?item.goods.file[0].url:''" mode="">
 							</image>
 						</view>
-						<view class="c">
+						<view class="list_2">
 							<view class="name">
-								{{info.goods.name}}
-							</view>
-							<view class="specs">
-								{{info.name}}
+								{{item.goods_name}}
 							</view>
-						</view>
-						<view class="r">
-							<view v-if="type=='0'" class="price">
-								¥{{info.sell_money}}
-							</view>
-							<view v-else class="price">
-								¥{{info.group_config.money}}
+							<view class="other_1">
+								<text>规格:</text>
+								<text>{{item.name}}</text>
 							</view>
-							<view class="num">
-								×{{info.buy_num}}
+							<view class="other_1">
+								<text>金额:</text>
+								<text>¥{{info.type=='0'?item.sell_money:item.group_config.money}}</text>
 							</view>
-							<view class="money" v-if="moneyInfo.payTotal">
-								<view class="">商品总价:{{moneyInfo.goodsTotal}}</view>
-								<view class="">优惠减免:{{moneyInfo.discountTotal}}</view>
-								<view class="">运费总价:{{moneyInfo.freightTotal}}</view>
+							<view class="other_1">
+								<text>数量:</text>
+								<text>×{{item.buy_num}}</text>
 							</view>
+
 						</view>
 					</view>
 				</view>
 			</view>
 			<view class="two">
-				<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
-					<uni-forms-item label="退款商品" name="goods_id">
-						<picker class="picker" mode="selector" :range="goodsList" @change="goodsChange" range-key="name">
-							<view>{{form.goods_name||'请选择退款商品'}}</view>
-						</picker>
-					</uni-forms-item>
-					<uni-forms-item label="售后类型" name="type" v-if="info._id">
-						<picker class="picker" mode="selector" :range="typeList" @change="typeChange" range-key="label">
-							<view>{{form.type_name||'请选择售后类型'}}</view>
-						</picker>
-					</uni-forms-item>
-					<uni-forms-item label="退款金额" name="money" v-if="form.type=='0'||form.type=='1'">
-						<uni-easyinput type="digit" v-model="form.money" @input="toMoney" placeholder="请输入退款金额" />
-						<view>
-							最大退款金额不能超过{{moneyInfo.payTotal||'暂无'}}
+				<view class="two_1" v-if="status=='3'">
+					<uni-forms ref="thrform" :rules="thrrules" :model="thrform" label-width="auto">
+						<uni-forms-item label="售后商品" name="goods_id">
+							<picker class="picker" mode="selector" :range="info.goods" @change="goodsChange" range-key="goods_name">
+								<view>{{thrform.goods_name||'请选择退款商品'}}</view>
+							</picker>
+						</uni-forms-item>
+					</uni-forms>
+				</view>
+				<view class="two_2" v-else>
+					<uni-forms ref="form" :rules="rules" :model="form" label-width="auto">
+						<uni-forms-item label="申请描述" name="desc">
+							<uni-easyinput type="textarea" autoHeight v-model="form.desc" placeholder="请输入申请描述" />
+						</uni-forms-item>
+						<view class="btn">
+							<button type="default" size="mini" @click="onSubmit('form')">提交保存</button>
 						</view>
-					</uni-forms-item>
-					<uni-forms-item label="申请理由" name="reason">
-						<picker class="picker" mode="selector" :range="reasonList" @change="reasonChange" range-key="label">
-							<view>{{form.reason_name||'请选择申请理由'}}</view>
-						</picker>
-					</uni-forms-item>
-					<uni-forms-item label="申请售后描述" name="desc">
-						<uni-easyinput type="textarea" v-model="form.desc" placeholder="请输入申请售后描述" />
-					</uni-forms-item>
-					<uni-forms-item label="附件" name="icon">
-						<upload :list="icon" name="icon" :count="1" @uplSuc="uplSuc" @uplDel="uplDel"></upload>
-					</uni-forms-item>
-					<view class="btn">
-						<button v-if="money_num=='0'" type="primary" size="mini" @click="onSubmit('form')">提交保存</button>
-					</view>
-				</uni-forms>
+					</uni-forms>
+				</view>
 			</view>
 		</view>
 	</mobile-frame>
 </template>
 
 <script>
-	import upload from '@/components/upload/index.vue';
 	export default {
-		components: {
-			upload
-		},
+		components: {},
 		data() {
 			return {
 				id: '',
-				// 订单类型
-				type: '',
+				status: '',
+				// 用户信息
 				user: {},
-				// 商品详情
+				// 信息详情
 				info: {},
+				// 仅退款
 				form: {},
-				moneyInfo: {},
-				// 退货商品
-				goodsList: [],
-				icon: [],
 				rules: {
-					type: {
-						rules: [{
-							required: true,
-							errorMessage: '请选择售后类型',
-						}]
-					},
-					goods_id: {
+					desc: {
 						rules: [{
 							required: true,
-							errorMessage: '请选择退款商品',
-						}]
-					},
-					reason: {
-						rules: [{
-							required: true,
-							errorMessage: '请选择申请理由',
+							errorMessage: '请输入申请描述',
 						}]
 					},
 				},
-				// 售后类型
-				typeList: [],
-				// 申请理由
-				reasonList: [],
-				money_num: '0'
+				// 已收到货
+				thrform: {},
+				thrrules: {}
 			};
 		},
 		onLoad: async function(e) {
 			const that = this;
-			that.$set(that, `id`, e && e.id || '');
-			// 查询其他信息
-			await that.searchOther();
-			// 监听用户登录
-			await that.watchLogin();
+			that.$set(that, `id`, e && e.id || '6361ceb683473c0322151aa8');
+			that.$set(that, `status`, e && e.status || '3');
+			console.log(e);
+			that.watchLogin();
 		},
 		methods: {
-			// 监听用户是否登录
 			watchLogin() {
 				const that = this;
 				uni.getStorage({
 					key: 'token',
-					success: async function(res) {
+					success: function(res) {
 						let user = that.$jwt(res.data);
 						if (user) {
 							that.$set(that, `user`, user);
-							if (that.id) {
-								let arr = await that.$api(`/orderDetail/${that.id}`, 'GET')
-								if (arr.errcode == '0') {
-									that.$set(that, `goodsList`, arr.data.goods)
-									that.$set(that, `type`, arr.data.type)
-								}
-							}
+							that.search();
 						}
-					},
-					fail: function(err) {
-						uni.reLaunch({
-							url: '/pages/login/index'
-						})
 					}
 				})
 			},
-			// 查询其他信息
-			async searchOther() {
+			async search() {
 				const that = this;
-				let res;
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "afterSale_type"
-				});
-				if (res.errcode == '0') {
-					that.$set(that, `typeList`, res.data)
-				}
-				res = await that.$api(`/dictData`, 'GET', {
-					code: "afterSale_reason"
-				});
+				let id = that.id;
+				let res = await that.$api(`/orderDetail/${id}`, 'GET')
 				if (res.errcode == '0') {
-					that.$set(that, `reasonList`, res.data)
-				}
-			},
-			// 退款金额
-			toMoney(value) {
-				const that = this;
-				let money = that.moneyInfo.payTotal;
-				if (parseFloat(value) > parseFloat(money)) {
+					for (let val of res.data.goods) val.goods_name = val.goods.name;
+					that.$set(that, `info`, res.data)
+				} else {
 					uni.showToast({
-						title: '输入金额不能超过实际支付金额',
+						title: res.errmsg,
 						icon: 'none'
 					})
-					that.$set(that, `money_num`, '1');
-				} else {
-					that.$set(that, `money_num`, '0');
-				}
-			},
-			// 选择售后类型
-			async typeChange(e) {
-				const that = this;
-				let data = that.typeList[e.detail.value];
-				if (data) {
-					that.$set(that.form, `type`, data.value);
-					that.$set(that.form, `type_name`, data.label);
-				}
-				if (data.value != '2') {
-					const arr = await that.$api(`/afterSale/cgfr`, 'POST', {
-						order_detail: that.id,
-						goods_id: that.info._id
-					});
-					if (arr.errcode == '0') {
-						that.$set(that, `moneyInfo`, arr.data);
-					} else {
-						uni.showToast({
-							title: arr.errmsg,
-							icon: 'none',
-						})
-					}
 				}
-
 			},
-			// 退款商品
+			// 售后请求
+			// 已收到货
 			goodsChange(e) {
 				const that = this;
-				let data = that.goodsList[e.detail.value];
-				if (data) {
-					that.$set(that, `info`, data);
-					that.$set(that.form, `goods_id`, data._id);
-					that.$set(that.form, `goods_name`, data.name);
-				}
-			},
-			// 选择申请理由
-			reasonChange(e) {
-				const that = this;
-				let data = that.reasonList[e.detail.value];
-				if (data) {
-					that.$set(that.form, `reason`, data.value);
-					that.$set(that.form, `reason_name`, data.label);
-				}
-			},
-			// 图片上传
-			uplSuc(e) {
-				const that = this;
-				that.$set(that, `${e.name}`, [...that[e.name], e.data]);
-			},
-			// 图片删除
-			uplDel(e) {
-				const that = this;
-				let data = that[e.name];
-				let arr = data.filter((i, index) => index != e.data.index);
-				that.$set(that, `${e.name}`, arr)
+				let data = that.info.goods[e.detail.value];
+				console.log(data);
 			},
 			// 提交保存
 			async onSubmit(ref) {
 				const that = this;
-				that.$refs[ref].validate().then(async params => {
-					if (params.type != '2') {
-						if (params.money) {
-							params.file = that.icon;
-							params.order_detail = that.id;
-							const arr = await that.$api(`/afterSale`, 'POST', params);
-							if (arr.errcode == '0') {
-								uni.showToast({
-									title: `申请售后成功`,
-									icon: 'success',
-								});
-								uni.navigateBack({
-									detail: 1
-								})
-							} else {
-								uni.showToast({
-									title: arr.errmsg,
-									icon: 'none',
-								})
-							}
-						} else {
-							uni.showToast({
-								title: `请输入退款金额`,
-								icon: 'none',
-							});
-						}
+				let status = that.status;
+				that.$refs[ref].validate().then(params => {
+					if (status == '3') {
+						console.log('1');
 					} else {
-						params.file = that.icon;
-						params.order_detail = that.id;
-						const arr = await that.$api(`/afterSale`, 'POST', params);
-						if (arr.errcode == '0') {
-							uni.showToast({
-								title: `申请售后成功`,
-								icon: 'success',
-							});
-							uni.navigateBack({
-								detail: 1
-							})
-						} else {
-							uni.showToast({
-								title: arr.errmsg,
-								icon: 'none',
-							})
-						}
+						that.orderCancel(params)
 					}
+
 				})
+			},
+			// 未收到货
+			async orderCancel(e) {
+				const that = this;
+				e.order_detail = that.id;
+				const res = await that.$api(`/afterSale/orderCancel`, 'POST', e);
+				if (res.errcode == '0') {
+					uni.showToast({
+						title: `申请售后成功`,
+						icon: 'success',
+					});
+					uni.navigateBack({
+						detail: 1
+					})
+				} else {
+					uni.showToast({
+						title: res.errmsg,
+						icon: 'none',
+					})
+				}
 			}
 		}
 	}
@@ -298,105 +164,94 @@
 
 <style lang="scss">
 	.main {
+		display: flex;
+		flex-direction: column;
+		width: 100vw;
+		height: 100vh;
+
 		.one {
-			.list {
-				margin: 2vw;
-				padding: 2vw;
-				border-radius: 2vw;
-				border: 1px solid #3333;
+			margin: 2vw;
+			border: 1px solid #f1f1f1;
+			border-radius: 5px;
+			padding: 2vw;
 
-				.list_1 {
-					margin: 0 0 1vw 0;
-					display: flex;
-					flex-direction: row;
-					justify-content: space-between;
-					font-size: var(--font14Size);
+			.one_1 {
+				margin: 0 0 2vw 0;
+
+				text {
+					font-size: 16px;
 					font-weight: bold;
 				}
+			}
 
-				.list_2 {
-					margin: 0 0 1vw 0;
+			.one_2 {
+				.list {
 					display: flex;
+					background-color: #f1f1f1;
+					padding: 2vw;
+					margin: 0 0 2vw 0;
+					border-radius: 5px;
 
-					.l {
-						width: 20vw;
+					.list_1 {
+						width: 22vw;
+						height: 22vw;
+						border-radius: 5px;
 
 						.image {
 							width: 100%;
-							height: 20vw;
+							height: 100%;
 							border-radius: 5px;
-
-						}
-					}
-
-					.c {
-						width: 50vw;
-						padding: 0 2vw;
-
-						.specs {
-							color: var(--f85Color);
-							font-size: var(--font12Size);
 						}
 					}
 
-					.r {
-						width: 25vw;
-						text-align: right;
+					.list_2 {
+						width: 63vw;
+						padding: 0 0 0 2vw;
 
-						.money {
-							color: var(--f85Color);
-							font-size: var(--font12Size);
+						.name {
+							font-size: 16px;
+							font-weight: bold;
+							margin: 0 0 0.5vw 0;
 						}
-					}
-				}
 
-				.other {
-					margin: 0 0 2vw 0;
-					text-align: right;
+						.other_1 {
 
-					text {
-						font-size: 14px;
+							text {
+								font-size: 13px;
+								color: #858585;
+							}
 
-						padding: 0 0 0 2vw;
+							text:last-child {
+								color: #000000;
+							}
+						}
 					}
 				}
 
-				.btn {
-					text-align: right;
-					margin: 2vw 0 0 0;
-					border-top: 1px solid #f1fff1;
-
-					button {
-						margin: 2vw 0 0 2vw;
-					}
+				.list:last-child {
+					margin: 0;
 				}
 			}
 		}
 
 		.two {
+			margin: 2vw;
+			border: 1px solid #ff0000;
+			border-radius: 5px;
 			padding: 2vw;
 
-			.picker {
-				border: 1px solid #3333;
-				border-radius: 5px;
-				padding: 2vw;
-			}
+			.two_1 {}
 
-			.btn {
-				text-align: center;
+			.two_2 {
+				.btn {
+					text-align: center;
 
-				button {
-					width: 30%;
-					font-size: 14px;
-					background-color: var(--f35BColor);
+					button {
+						background-color: var(--f35BColor);
+						color: #fff;
+					}
 				}
 			}
 		}
 	}
-
-	.uni-forms-item {
-		margin-bottom: 6vw !important;
-		display: flex;
-		flex-direction: row;
-	}
 </style>