Zory 3 semanas atrás
pai
commit
59226e663e

+ 6 - 0
奥莱优品/api/model/order.js

@@ -42,5 +42,11 @@ export default {
 		post: async function(data={}) {
 			return await request.request(this.url,"POST",data,false,true,true)
 		}
+	},
+	keeps: {
+		url: `/order/keeps`,
+		post: async function(data={}) {
+			return await request.request(this.url,"POST",data,false,true,true)
+		}
 	}
 }

+ 8 - 0
奥莱优品/pages.json

@@ -115,6 +115,14 @@
 				"navigationBarBackgroundColor": "#ffffff",
 				"navigationBarTextStyle": "black"
 			}
+		},
+		{
+			"path": "pages/order/keeps",
+			"style": {
+				"navigationBarTitleText": "申请退款",
+				"navigationBarBackgroundColor": "#ffffff",
+				"navigationBarTextStyle": "black"
+			}
 		}
 	],
 	"globalStyle": {

+ 35 - 2
奥莱优品/pages/goods/detail.vue

@@ -60,6 +60,26 @@
 						</view>
 					</view>
 
+					<view class="goods-store" v-if="specs.length > 0 && goodsData.product_type !== 11">
+						<view class="title">团购套餐</view>
+						<div class="group-body" v-for="(item,indx) in specs" :key="indx">
+							<div class="body-title">
+								{{item.name}}
+								<span v-if="item.num == 0">全部可选</span>
+								<span v-else>{{item.list.length}}选{{item.num}}</span>
+							</div>
+							<div class="body-item">
+								<div class="body-item-li" v-for="(its,idx) in item.list" :key="idx">
+									{{its.name}}
+									<div class="item-right">
+										<span class="desc">({{its.number}}份)</span>
+										<span>¥ {{ its.price }}</span>
+									</div>
+								</div>
+							</div>
+						</div>
+					</view>
+
 					<view class="buy-rule">
 						<view class="title">购买须知</view>
 						<view class="rule-list">
@@ -254,7 +274,10 @@ export default {
 			currIndex:0,
 			swiperHeight:240,
 			userState:0,
-			isBuy:1
+			isBuy:1,
+			specs:[],
+			skuSpecs:[],
+			otherImg:[],
 		}
 	},
 	onLoad(options) {
@@ -283,7 +306,8 @@ export default {
 			return new Promise(resolve => {
 				resolve({
 					minLimits: 1,
-					maxLimits: app.goodsData.limit_rule_type==1?99:app.goodsData.limit_rule,
+					maxLimits: 1,
+					// maxLimits: app.goodsData.limit_rule_type==1?99:app.goodsData.limit_rule,
 					dateRule: '周一至周日可用',
 					relationType: 1,
 					goodsLabels:[
@@ -385,6 +409,9 @@ export default {
 			uni.setStorageSync("poiId",res.data.poi.poi_id);
 			app.goodsData = res.data;
 			app.bannerData = res.data.image_list
+			app.specs = res.data.specs;
+			app.skuSpecs = res.data.skuSpecs;
+			app.otherImg = res.data.otherImg;
 			if (res.data.skuSpecs.length > 0) {
 				var skuSpecs = app.skuSpecs[0]
 				var buyGoods = {
@@ -743,4 +770,10 @@ export default {
 		}
 	}
 }
+.group-body{padding: 20upx;}
+.group-body .body-title{display: flex;align-items: center;line-height: 48upx;font-size: 28upx;color: #333;font-weight: bold;gap: 20upx;justify-content: space-between;}
+.group-body .body-title span{font-size: 24upx;font-weight: normal;color: #666;}
+.group-body .body-item-li{display: flex;align-items: center;justify-content: space-between;line-height: 48upx;font-size: 24upx;color: #333;font-weight: bold;}
+.group-body .body-item-li .item-right{display: flex;align-items: center;gap: 20upx;width: 40%;justify-content: end;}
+.group-body .body-item-li .item-right .desc{color: #999;font-weight: normal;}
 </style>

+ 18 - 7
奥莱优品/pages/order/detail.vue

@@ -47,7 +47,7 @@
 										<image src="/static/image/order/refund.svg"></image>
 										退款成功
 									</view>
-									<view class="status-desc">{{ $dialog.formatMoney(orderData.pay_money,true) }} 已原路退回</view>
+									<view class="status-desc">{{ $dialog.formatMoney(orderData.pay_money,true) }} 已完成退款</view>
 								</template>
 								<template v-if="orderData && orderData.status == 4">
 									<view class="status-name">
@@ -73,6 +73,11 @@
 										<image src="/static/image/order/refund.svg"></image>退款审核中</view>
 									<view class="status-desc">已申请退款,商家预计1-3个工作日完成审核</view>
 								</template>
+								<template v-if="orderData && orderData.status == 9">
+									<view class="status-name">
+										<image src="/static/image/order/refund.svg"></image>退款审核中</view>
+									<view class="status-desc">已申请退款,商家预计1-3个工作日完成审核</view>
+								</template>
 							</view>
 						</view>
 						<view class="item-goods">
@@ -265,7 +270,7 @@ export default {
 				url:"/pages/goods/detail?goods="+app.orderData.product_id
 			})
 		},
-		toAfterRefund(){
+		toAfterRefund(){ // 履约中申请退款
 			uni.showModal({
 				title: "提示",
 				content: "当前阶段退款需商家进行审核,如有疑问,请联系商家咨询",
@@ -273,10 +278,11 @@ export default {
 				success(res) {
 					if (res.confirm) {
 						uni.navigateTo({
-							url:'/pages/order/refund?order='+app.order,
+							url:'/pages/order/keeps?order='+app.order,
 							events:{
-								acceptData: (data) => {
-									this.getOrder()
+								acceptKeepData: (data) => {
+									console.log("返回了",data)
+									app.getOrder()
 								}
 							}
 						})
@@ -284,7 +290,7 @@ export default {
 				}
 			});
 		},
-		toAfter(){
+		toAfter(){ // 已核销申请退款
 			uni.showModal({
 				title: "提示",
 				content: "当前阶段暂不支持退款,如遇特殊情况,请联系商家协商退款",
@@ -292,7 +298,12 @@ export default {
 				success(res) {
 					if (res.confirm) {
 						uni.navigateTo({
-							url:'/pages/service/chat?poi='+app.storeData.poi_id+'&source=detail&order='+app.orderData.order_sn
+							url:'/pages/order/refund?order='+app.order,
+							events:{
+								acceptData: (data) => {
+									this.getOrder()
+								}
+							}
 						})
 					}
 				}

+ 6 - 4
奥莱优品/pages/order/done.vue

@@ -144,7 +144,6 @@ export default {
 	},
 	data() {
 		return {
-			eventChannel:null,
 			optionData:null,
 			orderData:null,
 			loading:false,
@@ -177,7 +176,7 @@ export default {
 	onLoad(options) {
 		app = this;
 		app.optionData = options;
-		app.eventChannel = this.getOpenerEventChannel();
+		const eventChannel = this.getOpenerEventChannel();
 		this.getOrder();
 	},
 	methods: {
@@ -202,8 +201,11 @@ export default {
 			app.isSubmit = false;
 			if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg);
 			app.$dialog.showSuccess(resp.msg);
-			app.eventChannel.emit('acceptData', { msg: '会员信息已完善' });
-			uni.navigateBack();
+			setTimeout(function(){
+				const eventChannel = app.getOpenerEventChannel();
+				eventChannel.emit('acceptKeepData', { msg: '会员信息已完善' });
+				uni.navigateBack();
+			},900)
 		},
 		chooseGoods(){
 			this.$nextTick(()=>{

+ 294 - 0
奥莱优品/pages/order/keeps.vue

@@ -0,0 +1,294 @@
+<template>
+	<view class="content">
+		<template v-if="loading">
+			<view class="skeleton">
+				<view class="skeleton-line max animate" style="height: 200upx;"></view>
+				<view class="skeleton-line animate"></view>
+				<view class="skeleton-line min animate"></view>
+				<view class="skeleton-line min animate"></view>
+				<view class="skeleton-line max animate" style="height: 200upx;"></view>
+				<view class="skeleton-line max animate" style="height: 200upx;"></view>
+			</view>
+		</template>
+		<template v-else>
+		<scroll-view class="goods-body" scroll-y scroll-with-animation>
+			<view class="order-body">
+				<view class="item-goods">
+					<view class="item-goods-body">
+						<view class="image">
+							<image :src="orderData.img"></image>
+						</view>
+						<view class="info">
+							<view class="title">
+								<view class="name" v-if="goodsData.is_new == 1">{{goodsData.price}}元代{{goodsData.line_price}}元商场权益券{{ goodsData.product_name }}</view>
+								<view class="name" v-else>{{ goodsData.product_name }}</view>
+								<view class="num">x{{ orderData.number }}</view>
+							</view>
+							<view class="tags">
+								{{orderData.sku_name?orderData.sku_name:'默认'}}
+								<view class="price">{{ $dialog.formatMoney(orderData.price,true) }}</view>
+							</view>
+							<view class="price-right">实付 <text>{{ $dialog.formatMoney(orderData.pay_money,true) }}</text></view>
+						</view>
+					</view>
+				</view>
+				<view class="order-info">
+					<view class="info-item">
+						<view class="name">订单编号</view>
+						<view class="right">{{ orderData.out_order_no }}</view>
+					</view>
+					<view class="info-item" @click="refundMsg">
+						<view class="name">退款原因<text class="red">*</text></view>
+						<view class="right">
+							{{refundMsgText?refundMsgText:'请至少选择1项'}}
+							<view class="icon"><image src="/static/image/right.svg"></image></view>
+						</view>
+					</view>
+					<view class="info-item">
+						<view class="name">退款金额</view>
+						<view class="right red">{{ $dialog.formatMoney(orderData.pay_money,true) }}</view>
+					</view>
+				</view>
+
+			</view>
+			<view class="line-height"></view>
+		</scroll-view>
+		<view class="footer">
+			<view class="tips">申请退款后需商家审核,审核时间预计1-3个工作日</view>
+			<view class="footer-op">
+				<button :loading="isSubmit" :disabled="isSubmit" class="btn full" @click="submitForm">提交申请</button>
+			</view>
+			<view class="footer-safe"></view>
+		</view>
+		</template>
+		<refundMain ref="refundMain" @success="refundHandle"></refundMain>
+	</view>
+</template>
+
+<script>
+var app;
+import refundMain from "@/components/kfService/refund";
+export default {
+	components: {
+		refundMain
+	},
+	data() {
+		return {
+			orderId:0,
+			current: 0,
+			goodsData:null,
+			orderData:null,
+			loading:true,
+			refundMsgText:null,
+			isSubmit:false
+		}
+	},
+	onLoad({order}) {
+		app = this;
+		app.orderId = order;
+		const eventChannel = this.getOpenerEventChannel();
+		app.getOrder();
+	},
+	methods: {
+		async submitForm(){
+			var formData = {};
+			if (!app.refundMsgText) return app.$dialog.showSuccess("请至少选择1项")
+			formData.order = app.orderId;
+			formData.msg = app.refundMsgText;
+			app.isSubmit = true;
+			var resp = await app.$api.order.keeps.post(formData);
+			app.isSubmit = false;
+			if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg)
+			app.$dialog.showSuccess(resp.msg)
+			setTimeout(function(){
+				const eventChannel = app.getOpenerEventChannel();
+				eventChannel.emit('acceptKeepData', { msg: '会员信息已完善' });
+				uni.navigateBack();
+			},900)
+		},
+		refundMsg(){
+			this.$refs.refundMain.open();
+		},
+		refundHandle(data){
+			app.refundMsgText = data;
+		},
+		async getOrder(){
+			app.loading = true;
+			var res = await app.$api.order.detail.get({"order":app.orderId});
+			app.loading = false;
+			if (res.code && res.code == 0) {
+				app.$dialog.showSuccess(res.msg);
+				uni.navigateBack()
+				return ;
+			}
+			app.goodsData = res.data.product;
+			app.orderData = res.data;
+		},
+	}
+}
+</script>
+
+<style lang="scss" scoped>
+.content{
+    position: fixed;
+    z-index: 1;
+    top: 0;
+    left: 0;
+    bottom: 0;
+    right: 0;
+    background-color: #f1f1f1;
+	display: flex;
+	flex-direction: column;
+	.line-height{
+		height: 40rpx;
+		width: 100%;
+	}
+}
+.right-input{
+	border: 0;
+	box-shadow: none;
+	text-align: right;
+	width: 100%;
+}
+.flex-radio{
+	display: flex;
+	align-items: center;
+	gap: 20rpx;
+	.uni-list-cell{
+		display: flex;
+		align-items: center;
+	}
+}
+.goods-body{
+	height: 0;
+	flex: 1;
+}
+.footer{
+	background-color: #fff;
+	padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;
+	.footer-safe {
+		height: env(safe-area-inset-bottom);width: 100%;
+	}
+	.tips{
+		font-size: 24rpx;
+		color: #999;
+		margin-bottom: 20rpx;
+	}
+	.btn{
+		font-size: 32rpx;
+		height: 100upx;
+		border-radius: 10upx;
+		line-height: 100upx;
+		text-align: center;
+		min-width: 200rpx;
+		color: #333;
+		border: 2rpx solid #ccc;
+		&.full{
+			background-color: $main-color;
+			color: #fff;
+			border: 2rpx solid $main-color;
+		}
+	}
+}
+.order-body {
+	width: 95%;
+	margin: 20rpx auto;
+	.order-info{
+		border-radius: 20rpx;
+		background-color: #fff;padding: 20upx;margin-top: 20upx;
+		.title{font-size: 32upx;color: #333;font-weight: bold;margin-bottom: 20upx;}
+		.info-item{
+			font-size: 28upx;display: flex;align-items: center;
+			padding: 30rpx 0;
+			.name{
+				text {
+					color: $main-color;
+					margin-left: 10rpx;
+				}
+			}
+			.right{
+				&.red{
+					color: $main-color;
+					font-size: 32rpx;
+				}
+				display: flex;
+				align-items: center;
+				color: #666;margin-left: auto;margin-right: 0;
+				flex: 1;
+				justify-content: right;
+				image {
+					width: 40rpx;
+					height: 40rpx;
+				}
+				text{border: 2upx solid #ccc;color: #333;font-size: 24upx;padding: 0 15upx;margin-left: 20upx;border-radius: 5upx;}
+			}
+		}
+	}
+	.item-goods{
+		background-color: #fff;
+		margin-top: 20rpx;
+		border-radius: 20rpx;
+		padding: 20rpx;
+		.item-goods-body{
+			display: flex;
+			align-items: center;
+			gap: 20rpx;
+		}
+		.stock{
+			text-align: right;
+		}
+		.image {
+			height: 140rpx;
+			overflow: hidden;display: flex;align-items: center;min-width: 140rpx;
+			position: relative;
+			image {
+				width: 140rpx;
+				border-radius: 10upx;
+				height: 100%;
+			}
+		}
+		.info{
+			flex: 1 1 0%;
+			overflow: hidden;
+			.title{
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.name {
+					overflow: hidden;
+					text-overflow: ellipsis;
+					font-size: 32rpx;
+					display: -webkit-box;
+					-webkit-line-clamp: 2;
+					 -webkit-box-orient: vertical;
+					color: #333;
+					font-weight: 900;
+				}
+			}
+			.price-right{
+				text-align: right;
+				color: $main-color;
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				text {
+					font-size: 30rpx;
+					font-weight: 800;
+				}
+			}
+			.tags {
+				color: #94a3b8;
+				font-size: 24rpx;
+				margin: 10rpx 0;
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.price {
+					font-size: 28rpx;
+					color: $main-text-color;
+					font-weight: 600;
+				}
+			}
+		}
+	}
+}
+</style>

+ 3 - 2
奥莱优品/pages/order/order.vue

@@ -64,6 +64,7 @@
 						<view class="item-status warn" v-if="item.status == 6">部分退款</view>
 						<view class="item-status success" v-if="item.status == 7">履约中</view>
 						<view class="item-status warn" v-if="item.status == 8">退款审核中</view>
+						<view class="item-status warn" v-if="item.status == 9">退款审核中</view>
 					</view>
 					<view class="item-goods" @click="toDetail(item.out_order_no)">
 						<view class="image">
@@ -89,12 +90,12 @@
 						<view class="footer-left">实付 <text>{{ $dialog.formatMoney(item.pay_money,true) }}</text></view>
 						<view class="footer-group-btn">
 							<view v-if="item.status == 0" class="button warn">继续支付</view>
-							<view v-if="item.status == 1" class="button border">立即预约</view>
+							<view v-if="item.status == 1" class="button success">立即预约</view>
 							<view v-if="item.status == 1" class="button border">申请退款</view>
 							<view v-if="item.status == 2" class="button warn">再来一单</view>
 							<view v-if="item.status == 7" class="button warn">申请退款</view>
 							<view v-if="item.status == 4||item.status == 3" class="button border">再次购买</view>
-							<view v-if="item.status == 5||item.status == 6||item.status == 7||item.status == 8" class="button warn">查看详情</view>
+							<view v-if="item.status == 5||item.status == 6||item.status == 7||item.status == 8 ||item.status == 9" class="button fail">查看详情</view>
 						</view>
 					</view>
 				</view>

+ 8 - 2
奥莱优品/pages/order/refund.vue

@@ -149,6 +149,7 @@ export default {
 	onLoad({order}) {
 		app = this;
 		app.orderId = order;
+		const eventChannel = this.getOpenerEventChannel();
 		app.getOrder();
 	},
 	methods: {
@@ -163,11 +164,16 @@ export default {
 			} else {
 				formData.content = JSON.stringify(app.bankData);
 			}
+			app.isSubmit = true;
 			var resp = await app.$api.order.refund.post(formData);
+			app.isSubmit = false;
 			if (resp.code !== 1) return app.$dialog.showSuccess(resp.msg)
 			app.$dialog.showSuccess(resp.msg)
-			app.eventChannel.emit('acceptData', { msg: '会员信息已完善' });
-			uni.navigateBack();
+			setTimeout(function(){
+				const eventChannel = app.getOpenerEventChannel();
+				eventChannel.emit('acceptKeepData', { msg: '会员信息已完善' });
+				uni.navigateBack();
+			},900)
 		},
 		refundMsg(){
 			this.$refs.refundMain.open();