zs 2 tahun lalu
induk
melakukan
e96b817fc0

+ 10 - 1
pagesHome/order/order.vue

@@ -206,6 +206,7 @@
 </template>
 
 <script>
+	const _ = require('lodash');
 	import discount from '@/components/discount/index.vue';
 	export default {
 		components: {
@@ -482,9 +483,17 @@
 				if (that.disabled) return;
 				that.$set(that, `disabled`, true);
 				if (that.address) {
+					// 过滤图片
+					let order = _.cloneDeep(that.orderList);
+					for (let val of order) {
+						val.goods = val.goods.map(i => {
+							delete i.file
+							return i
+						})
+					}
 					let obj = {
 						address: that.address,
-						goods: that.orderList,
+						goods: order,
 						total_detail: that.total_detail,
 						coupon: that.coupon,
 						type: that.type,

+ 1 - 1
pagesMy/logistics/index.vue

@@ -125,8 +125,8 @@
 							that.$set(that.goodstabs, `menu`, res.data.goods)
 						}
 						that.$set(that, `info`, res.data);
-						if (that.type == 'order') that.goodstabsChange(res.data.goods[0].goods._id, '1')
 						if (that.type != 'order') that.search();
+						if (that.type == 'order') that.goodstabsChange(res.data.goods[0].goods._id, '1')
 					} else {
 						uni.showToast({
 							title: res.errmsg,

+ 1 - 1
pagesMy/order/after.vue

@@ -254,7 +254,7 @@
 			// 维护单号
 			toMaintain(item) {
 				uni.navigateTo({
-					url: `/pagesMy/order/detail?id=${item._id}$status=${'0'}`
+					url: `/pagesMy/order/detail?id=${item._id}&status=${'0'}`
 				})
 			},
 			// 确认收货

+ 133 - 22
pagesMy/order/appraise.vue

@@ -6,42 +6,81 @@
 					<text>评论商品</text>
 				</view>
 				<view class="one_2" v-if="status=='0'">
-					<view class="list" v-for="(item,index) in goodsList" :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 v-for="(item,index) in goodsList" :key="index">
+						<view class="set_name" v-if="item.is_set=='0'">
+							<text class="set">套装</text> {{item.name}}
 						</view>
-						<view class="list_2">
-							<view class="name">
-								{{item.goods_name}}
+						<view class="list" v-if="item.is_set=='0'" v-for="(tag,indexx) in item.goods" :key="indexx">
+							<view class="list_1">
+								<image class="image"
+									:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''" mode="">
+								</image>
 							</view>
-							<view class="other_1">
-								<text>规格:</text>
-								<text>{{item.name}}</text>
+							<view class="list_2">
+								<view class="name">
+									{{tag.goods_name}}
+								</view>
+								<view class="other_1">
+									<text>规格:</text>
+									<text>{{tag.spec_name}}</text>
+								</view>
+								<view class="other_1">
+									<text>数量:</text>
+									<text>×{{tag.set_num}}</text>
+								</view>
 							</view>
-							<view class="other_1">
-								<text>金额:</text>
-								<text
-									class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
+						</view>
+						<view class="set" v-if="item.is_set=='0'">
+							<view class="set_1">套装价:¥{{item.sell_money}}</view>
+							<view class="set_2">数量:×{{item.buy_num}}</view>
+						</view>
+						<view class="list" v-else>
+							<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="other_1">
-								<text>数量:</text>
-								<text>×{{item.buy_num}}</text>
+							<view class="list_2">
+								<view class="name">
+									{{item.goods_name}}
+								</view>
+								<view class="other_1">
+									<text>规格:</text>
+									<text>{{item.name}}</text>
+								</view>
+								<view class="other_1">
+									<text>金额:</text>
+									<text
+										class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
+								</view>
+								<view class="other_1">
+									<text>数量:</text>
+									<text>×{{item.buy_num}}</text>
+								</view>
 							</view>
-
 						</view>
 					</view>
 				</view>
 			</view>
 			<view class="two">
 				<uni-forms ref="form" :modelValue="form" :rules="rules" label-width="auto">
-					<uni-forms-item label="评论商品" name="goods" v-if="status=='0'">
-						<picker class="picker" mode="selector" :range="goodsList" @change="goodsChange"
+					<uni-forms-item label="评论商品" name="goods" v-if="status=='0'&&goodssList.length>0&&!form.set">
+						<picker class="picker" mode="selector" :range="goodssList" @change="goodsChange"
 							range-key="goods_name">
 							<view>{{form.goods_name||'请选择评论商品'}}</view>
 						</picker>
 					</uni-forms-item>
+					<uni-forms-item label="评论套装" name="set" v-if="status=='0'&&!form.goods_name&&setList.length>0">
+						<picker class="picker" mode="selector" :range="setList" @change="setChange" range-key="name">
+							<view>{{form.set_name||'请选择评论套装'}}</view>
+						</picker>
+					</uni-forms-item>
+					<uni-forms-item label="评论套装商品" name="goods" v-if="status=='0'&&form.set">
+						<picker class="picker" mode="selector" :range="setgoodsList" @change="setgoodsChange"
+							range-key="goods_name">
+							<view>{{form.goods_name||'请选择评论套装商品'}}</view>
+						</picker>
+					</uni-forms-item>
 					<uni-forms-item label="评论内容" name="content">
 						<uni-easyinput maxlength=-1 type="textarea" v-model="form.content" placeholder="请输入评论内容" />
 					</uni-forms-item>
@@ -106,6 +145,12 @@
 					},
 				},
 				readonly: false,
+				// 正常商品
+				goodssList: [],
+				// 套装
+				setList: [],
+				// 套装商品
+				setgoodsList: [],
 			};
 		},
 		onLoad: function(e) {
@@ -145,6 +190,10 @@
 							that.$set(that, `info`, res.data.order);
 							for (let val of res.data.goods) val.goods_name = val.goods.name
 							that.$set(that, `goodsList`, res.data.goods);
+							let goodssList = res.data.goods.filter(i => i.is_set != '0')
+							that.$set(that, `goodssList`, goodssList)
+							let setList = res.data.goods.filter(i => i.is_set == '0')
+							that.$set(that, `setList`, setList)
 							uni.hideLoading();
 						}
 					} else {
@@ -170,7 +219,7 @@
 			},
 			async goodsChange(e) {
 				const that = this;
-				let data = that.goodsList[e.detail.value];
+				let data = that.goodssList[e.detail.value];
 				if (data) that.$set(that, `goodsList`, [data])
 				if (data.rate) {
 					that.$set(that, `rate_id`, data.rate);
@@ -186,6 +235,35 @@
 					that.$set(that.form, `goodsSpec`, data._id);
 				}
 			},
+			// 套装
+			setChange(e) {
+				const that = this;
+				let data = that.setList[e.detail.value];
+				if (data) {
+					that.$set(that, `setgoodsList`, data.goods)
+					that.$set(that, `goodsList`, [data])
+				}
+				that.$set(that.form, `set`, data._id);
+				that.$set(that.form, `set_name`, data.name);
+			},
+			// 套装商品
+			async setgoodsChange(e) {
+				const that = this;
+				let data = that.setgoodsList[e.detail.value];
+				if (data.rate) {
+					that.$set(that, `rate_id`, data.rate);
+					let res = await that.$api(`/goodsRate/${data.rate}`);
+					if (res.errcode == '0') {
+						that.$set(that, `form`, res.data);
+						that.$set(that.form, `goods_name`, data.goods_name);
+						that.$set(that, `readonly`, true)
+					}
+				} else {
+					that.$set(that.form, `goods`, data.goods._id);
+					that.$set(that.form, `goods_name`, data.goods_name);
+					that.$set(that.form, `goodsSpec`, data.spec._id);
+				}
+			},
 			// 图片上传
 			uplSuc(e) {
 				const that = this;
@@ -231,6 +309,7 @@
 							content: params.content,
 							time: moment().format('YYYY-MM-DD HH:mm:ss')
 						}];
+						if (that.form.set) params.set_id = that.form.set
 						params.orderDetail = that.id
 						params.reply = reply;
 						params.customer = that.user?._id;
@@ -330,6 +409,38 @@
 				.list:last-child {
 					margin: 0;
 				}
+
+				.set_name {
+					display: flex;
+					padding: 2vw 0;
+
+					.set {
+						margin: 0 1vw 0 0;
+						font-size: 12px;
+						border-radius: 5px;
+						padding: 0 1vw;
+						color: #ffffff;
+						background-color: #FF6347;
+						border: 1px solid #FFA500;
+					}
+				}
+
+				.set {
+					display: flex;
+					justify-content: space-between;
+					margin: 0 0 2vw 0;
+					padding: 2vw 0;
+
+					.set_1 {
+						font-size: var(--font16Size);
+						color: var(--f85Color);
+					}
+
+					text {
+						padding: 0 1vw 0 0;
+						font-size: var(--font20Szie);
+					}
+				}
 			}
 		}
 

+ 13 - 0
pagesMy/order/index.vue

@@ -108,6 +108,10 @@
 														</view>
 													</view>
 												</view>
+												<view class="set">
+													<view class="set_1">套装价:¥{{tag.sell_money}}</view>
+													<view class="set_2">数量:×{{tag.buy_num}}</view>
+												</view>
 											</view>
 											<view v-else>
 												<view class="goods">
@@ -751,6 +755,7 @@
 
 						.list_2_2 {
 							border-bottom: 1px solid #f1f1f1;
+							padding-top: 1vw;
 
 							.goods {
 								display: flex;
@@ -808,8 +813,16 @@
 									}
 								}
 							}
+
+							.set {
+								display: flex;
+								padding: 2vw 0;
+								justify-content: space-between;
+								color: #ff0000;
+							}
 						}
 
+
 						.other {
 							padding: 0 0 2vw 0;
 							margin: 2vw 0;

+ 132 - 26
pagesMy/order/service.vue

@@ -6,30 +6,58 @@
 					<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 v-for="(item,index) in info.goods" :key="index">
+						<view class="set_name" v-if="item.is_set=='0'">
+							<text class="set">套装</text> {{item.name}}
 						</view>
-						<view class="list_2">
-							<view class="name">
-								{{item.goods_name}}
+						<view class="list" v-if="item.is_set=='0'" v-for="(tag,indexx) in item.goods" :key="indexx">
+							<view class="list_1">
+								<image class="image"
+									:src="tag.goods.file&&tag.goods.file.length>0?tag.goods.file[0].url:''" mode="">
+								</image>
 							</view>
-							<view class="other_1">
-								<text>规格:</text>
-								<text>{{item.name}}</text>
+							<view class="list_2">
+								<view class="name">
+									{{tag.goods_name}}
+								</view>
+								<view class="other_1">
+									<text>规格:</text>
+									<text>{{tag.spec_name}}</text>
+								</view>
+								<view class="other_1">
+									<text>数量:</text>
+									<text>×{{tag.set_num}}</text>
+								</view>
 							</view>
-							<view class="other_1">
-								<text>金额:</text>
-								<text
-									class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
+						</view>
+						<view class="set" v-if="item.is_set=='0'">
+							<view class="set_1">套装价:¥{{item.sell_money}}</view>
+							<view class="set_2">数量:×{{item.buy_num}}</view>
+						</view>
+						<view class="list" v-else>
+							<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="other_1">
-								<text>数量:</text>
-								<text>×{{item.buy_num}}</text>
+							<view class="list_2">
+								<view class="name">
+									{{item.goods_name}}
+								</view>
+								<view class="other_1">
+									<text>规格:</text>
+									<text>{{item.name}}</text>
+								</view>
+								<view class="other_1">
+									<text>金额:</text>
+									<text
+										class="money">¥{{info.type=='0'?item.price||item.sell_money:item.group_config.money}}</text>
+								</view>
+								<view class="other_1">
+									<text>数量:</text>
+									<text>×{{item.buy_num}}</text>
+								</view>
 							</view>
-
 						</view>
 					</view>
 				</view>
@@ -37,12 +65,26 @@
 			<view class="two">
 				<view class="two_1" v-if="status=='3'||status=='-3'">
 					<uni-forms ref="thrform" :rules="thrrules" :model="thrform" label-width="auto">
-						<uni-forms-item label="售后商品" name="goods" v-if="status!='-3'">
-							<picker class="picker" mode="selector" :range="info.goods" @change="goodsChange"
+						<uni-forms-item label="售后商品" name="goods"
+							v-if="status!='-3'&&goodsList.length>0&&!thrform.set_id">
+							<picker class="picker" mode="selector" :range="goodsList" @change="goodsChange"
 								range-key="goods_name">
 								<view>{{thrform.goods_name||'请选择退款商品'}}</view>
 							</picker>
 						</uni-forms-item>
+						<uni-forms-item label="售后套装" name="set_id"
+							v-if="status!='-3'&&!thrform.goods_name&&setList.length>0">
+							<picker class="picker" mode="selector" :range="setList" @change="setChange"
+								range-key="name">
+								<view>{{thrform.set_name||'请选择退款套装'}}</view>
+							</picker>
+						</uni-forms-item>
+						<uni-forms-item label="售后套装商品" name="goods" v-if="status!='-3'&&thrform.set_name">
+							<picker class="picker" mode="selector" :range="setgoodsList" @change="setgoodsChange"
+								range-key="goods_name">
+								<view>{{thrform.goods_name||'请选择退款套装商品'}}</view>
+							</picker>
+						</uni-forms-item>
 						<uni-forms-item label="售后类型" name="type">
 							<picker class="picker" mode="selector" :range="typeList" @change="typeChange"
 								range-key="label">
@@ -53,7 +95,7 @@
 							<uni-easyinput type="digit" v-model="thrform.money" @input="toMoney"
 								placeholder="请输入退款金额" />
 							<view class="money">
-								最大退款金额不能超过 <text>{{moneyInfo.payTotal||0}}</text>,<text @tap="toAll">全部提现</text>
+								最大退款金额不能超过 <text>{{moneyInfo.payTotal||0}}</text>,<text @tap="toAll">全部退款</text>
 							</view>
 						</uni-forms-item>
 						<uni-forms-item label="申请理由" name="reason">
@@ -143,6 +185,12 @@
 				typeList: [],
 				// 申请理由
 				reasonList: [],
+				// 正常商品
+				goodsList: [],
+				// 套装
+				setList: [],
+				// 套装商品
+				setgoodsList: [],
 			};
 		},
 		onLoad: async function(e) {
@@ -181,6 +229,10 @@
 					if (res.errcode == '0') {
 						for (let val of res.data.goods) val.goods_name = val.goods.name;
 						that.$set(that, `info`, res.data)
+						let goodsList = res.data.goods.filter(i => i.is_set != '0')
+						that.$set(that, `goodsList`, goodsList)
+						let setList = res.data.goods.filter(i => i.is_set == '0')
+						that.$set(that, `setList`, setList)
 					} else {
 						uni.showToast({
 							title: res.errmsg,
@@ -204,11 +256,29 @@
 			// 已收到货
 			goodsChange(e) {
 				const that = this;
-				let data = that.info.goods[e.detail.value];
+				let data = that.goodsList[e.detail.value];
 				if (data) that.$set(that.info, `goods`, [data])
 				that.$set(that.thrform, `goods`, data._id);
 				that.$set(that.thrform, `goods_name`, data.goods_name);
 			},
+			// 套装
+			setChange(e) {
+				const that = this;
+				let data = that.setList[e.detail.value];
+				if (data) {
+					that.$set(that, `setgoodsList`, data.goods)
+					that.$set(that.info, `goods`, [data])
+				}
+				that.$set(that.thrform, `set_id`, data._id);
+				that.$set(that.thrform, `set_name`, data.name);
+			},
+			// 套装商品
+			setgoodsChange(e) {
+				const that = this;
+				let data = that.setgoodsList[e.detail.value];
+				that.$set(that.thrform, `goods`, data.spec._id);
+				that.$set(that.thrform, `goods_name`, data.goods_name);
+			},
 			// 选择售后类型
 			async typeChange(e) {
 				const that = this;
@@ -221,10 +291,12 @@
 				if (that.status != '-3') {
 					if (data.value != '3') {
 						if (thrform.goods) {
-							const arr = await that.$api(`/afterSale/cgfr`, 'POST', {
+							let obj = {
 								order_detail: that.id,
-								goods_id: thrform.goods
-							});
+							}
+							if (thrform.set_id) obj.goods_id = thrform.set_id;
+							else obj.goods_id = thrform.goods;
+							const arr = await that.$api(`/afterSale/cgfr`, 'POST', obj);
 							if (arr.errcode == '0') {
 								that.$set(that, `moneyInfo`, arr.data);
 							} else {
@@ -287,6 +359,7 @@
 				let status = that.status;
 				that.$refs[ref].validate().then(async params => {
 					// 判断是否团长提现完成 如果提现成功不能退款 过了规定日期
+					if (that.thrform.set_id) params.set_id = that.thrform.set_id;
 					let arr;
 					if (that.status != '-3') arr = await that.$api(`/afterSale/canRefund/${that.id}`,
 						'GET');
@@ -298,6 +371,7 @@
 								that.Receip(params)
 							} else {
 								that.orderCancel(params)
+								console.log(params);
 							}
 						} else {
 							uni.showToast({
@@ -483,6 +557,38 @@
 				.list:last-child {
 					margin: 0;
 				}
+
+				.set_name {
+					display: flex;
+					padding: 2vw 0;
+
+					.set {
+						margin: 0 1vw 0 0;
+						font-size: 12px;
+						border-radius: 5px;
+						padding: 0 1vw;
+						color: #ffffff;
+						background-color: #FF6347;
+						border: 1px solid #FFA500;
+					}
+				}
+
+				.set {
+					display: flex;
+					justify-content: space-between;
+					margin: 0 0 2vw 0;
+					padding: 2vw 0;
+
+					.set_1 {
+						font-size: var(--font16Size);
+						color: var(--f85Color);
+					}
+
+					text {
+						padding: 0 1vw 0 0;
+						font-size: var(--font20Szie);
+					}
+				}
 			}
 		}