瀏覽代碼

'0821-c01'

zory 4 周之前
父節點
當前提交
f298105154

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

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

+ 5 - 0
奥莱优品/components/kfService/complaint.vue

@@ -60,6 +60,11 @@ export default {
 			this.$nextTick(()=>{
 				this.$refs.servicePop.open()
 			})
+		},
+		toTs(name){
+			uni.navigateTo({
+				url:"/pages/complaint/form?name="+name+"&order="+this.orderSn
+			})
 		}
 	}
 }

+ 10 - 1
奥莱优品/pages.json

@@ -80,7 +80,9 @@
 		{
 			"path": "pages/goods/list",
 			"style": {
-				"navigationBarTitleText": ""
+				"navigationBarTitleText": "商品列表",
+				"navigationBarBackgroundColor": "#ffffff",
+				"navigationBarTextStyle": "black"
 			}
 		},
 		{
@@ -90,6 +92,13 @@
 				"navigationBarBackgroundColor": "#ffffff",
 				"navigationBarTextStyle": "black"
 			}
+		},
+		{
+			"path": "pages/complaint/form",
+			"style": {
+				"navigationBarTitleText": "交易投诉",
+				"navigationBarBackgroundColor": "#ffffff"
+			}
 		}
 	],
 	"globalStyle": {

+ 151 - 0
奥莱优品/pages/complaint/form.vue

@@ -0,0 +1,151 @@
+<template>
+	<view>
+		<view class="ts-header" v-if="poiData">
+			<view class="ts-h-title">投诉门店</view>
+			<view class="store-info">
+				<view class="store-left">
+					<view class="name">{{poiData.poi_name}}</view>
+					<view class="address">{{poiData.poi_address}}</view>
+				</view>
+			</view>
+		</view>
+		<view class="ts-body">
+			<view class="ts-form">
+				<view class="ts-form-item">
+					<view class="form-title">具体问题 <text>*</text></view>
+					<view class="form-input">
+						{{options.name}}
+					</view>
+				</view>
+				<view class="ts-form-item">
+					<view class="form-title">问题订单 <text>*</text></view>
+					<view class="form-input">
+						{{options.order}}
+					</view>
+				</view>
+				<view class="ts-form-item">
+					<view class="form-title">联系方式</view>
+					<view class="form-input">
+						<input type="number" v-model="formData.mobile" class="ts-input" placeholder="请输入手机号" />
+					</view>
+				</view>
+				<view class="ts-form-item">
+					<view class="form-title">详细补充 <text>*</text></view>
+					<view class="form-input-textarea">
+						<textarea class="ts-input" v-model="formData.content" placeholder="请详细描述该笔订单中您遇到的问题,描述内容不能为空" rows="10"></textarea>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="footer">
+			<view class="footer-btn">
+				<button class="btn" :disabled="disabled" @click="submitTs">提交</button>
+			</view>
+			<view class="footer-safe"></view>
+		</view>
+		<uni-popup ref="tspopup" type="center" border-radius="10px 10px 0 0" background-color="#f8f8f8">
+			<view class="ts-popup">
+				<view class="title">我要投诉门店</view>
+				<view class="sub-title">请仔细阅读投诉说明</view>
+				<view class="sub-title">受理时间1个工作日</view>
+				<view class="tips-body">
+					<view class="item-title">【退款/退货纠纷】</view>
+					<view class="item-desc">在订单页-申请退款,门店需在24小时处理,否则平台将自动退款,如门店拒绝退款可在此投诉;</view>
+					<view class="item-title">【质量/涉假问题】</view>
+					<view class="item-desc">为避免恶意投诉,请上传包含单位公章及证书编号检测报告, 请往下滑动查看《检测报告案例》</view>
+				</view>
+				<view class="pup-close">
+					<button class="pop-btn" @click="tipsPop">我已阅读并确认</button>
+				</view>
+			</view>
+		</uni-popup>
+	</view>
+</template>
+
+<script>
+var app;
+import form from "@/static/js/form.js"
+export default {
+	data() {
+		return {
+			options:null,
+			disabled:false,
+			poiData:null,
+			order:0,
+			formData:{}
+		}
+	},
+	onLoad(options) {
+		app = this;
+		app.options = options;
+		app.$nextTick(()=>{
+			app.$refs.tspopup.open()
+		})
+		this.order = options.order?options.order:''
+		this.getOrder();
+	},
+	methods: {
+		tipsPop(){
+			app.$refs.tspopup.close()
+		},
+		async getOrder(){
+			var res = await app.$api.order.detail.get({"order":app.order});
+			app.loading = false;
+			if (res.code && res.code == 0) {
+				app.$dialog.showSuccess(res.msg);
+				uni.navigateBack()
+				return ;
+			}
+			app.poiData = res.data.poi;
+		},
+		async submitTs(){
+			var validation = form.validation(app.formData,[
+				{name:"content",rule:["required"],msg:["请输入描述内容"]}
+			]);
+			if(validation){
+				app.$dialog.showSuccess(validation);
+				return false;
+			}
+			app.formData.text = app.options.name;
+			app.formData.order = app.options.order;
+			var res = await this.$api.order.complaint.post(app.formData);
+			if (res.code == 0) {
+				return app.$dialog.showSuccess(res.msg);
+			}
+			app.$dialog.showSuccess(res.msg,"none",function(){
+				uni.navigateBack()
+			});
+		}
+	}
+}
+</script>
+
+<style>
+page{background-color: #f8f8f8;}
+.ts-popup{background-color: #fff;width: 90vw;border-radius: 20upx;}
+.ts-popup .title{font-size: 32upx;color: #333;font-weight: bold;padding: 30upx 0;text-align: center;}
+.ts-popup .sub-title{color: #f00;padding: 20upx 0;text-align: center;font-size: 28upx;}
+.ts-popup .tips-body{width: 90%;margin: 0 auto;}
+.ts-popup .tips-body .item-title{font-size: 28upx;color: #333;padding: 15upx 0;}
+.ts-popup .tips-body .item-desc{font-size: 28upx;color: #333;line-height: 46upx;margin-bottom: 20upx;}
+.ts-popup .pup-close{padding-top: 40upx;}
+.ts-popup .pup-close .pop-btn{border: 0;background-color: #f00;font-size: 32upx;color: #fff;border-radius: 0 0 20upx 20upx;padding: 15upx 0;cursor: pointer;}
+
+.ts-header{padding: 20upx 0;margin-bottom: 20upx;}
+.ts-header .ts-h-title{font-size: 28upx;color: #666;padding: 20upx;}
+.ts-header .store-info{background-color: #fff;padding: 20upx;}
+.ts-header .store-info .store-left .name{font-size: 30rpx;color: #333;font-weight: bold;line-height: 80upx;}
+.ts-header .store-info .store-left .address{font-size: 24rpx;color: #999;}
+.ts-body{background-color: #fff;padding: 20upx;}
+.ts-form .ts-form-item{border-bottom: 2upx solid #f8f8f8;padding-bottom: 10upx;}
+.ts-form .ts-form-item:last-child{border-bottom: 0;}
+.ts-form .ts-form-item .form-title{color: #333;font-size: 28upx;padding: 20upx 0;}
+.ts-form .ts-form-item .form-title text{color: #f00;margin-left: 10upx;}
+.ts-form .ts-form-item .form-input{font-size: 28upx;color: #333;height: 80upx;display: flex;align-items: center;}
+.ts-form .ts-form-item .ts-input{height: 100%;border: 0;box-shadow: none;width: 100%;}
+.ts-form .form-input-textarea{height: 200upx;font-size: 28upx;color: #333;}
+.footer{position: fixed;bottom: 0;background-color: #fff;padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;left: 0;right: 0;}
+.footer .footer-safe {height: env(safe-area-inset-bottom);width: 100%;}
+.footer .footer-btn{padding: 20upx 0;}
+.footer .footer-btn .btn{color: #fff;background-color: #f00;border-radius: 10upx;}
+</style>

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

@@ -27,7 +27,8 @@
 						<view class="desc-num">已售{{goodsData.sale_stock}}</view>
 					</view>
 					<view class="goods-info">
-						<view class="title">{{goodsData.product_name}}</view>
+						<view class="title" v-if="goodsData.is_new == 1">{{goodsData.price}}元代{{goodsData.line_price}}元商场权益券{{goodsData.product_name}}</view>
+						<view class="title" v-else>{{goodsData.product_name}}</view>
 						<view class="goods-rule" @click="openRule(1)">
 							购买须知<view class="right">
 							<span class="mix-item" v-if="goodsData.use_date_type==1">

+ 163 - 4
奥莱优品/pages/goods/list.vue

@@ -1,22 +1,181 @@
 <template>
 	<view>
-
+		<scroll-view class="home-goods" scroll-y scroll-with-animation @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower" upper-threshold="80">
+			<view class="goods-list">
+				<view class="list-item" v-for="(item,index) in goodsData" :key="index" @click="toDetail(item.goods_id)">
+					<view class="image">
+						<image :src="item.image_list[0].url"></image>
+						<text>{{$dialog.disFormat(item.price,item.line_price)}}折</text>
+					</view>
+					<view class="info">
+						<view class="title" v-if="item.is_new==1">{{item.price}}元代{{item.line_price}}元商场权益券{{item.product_name}}</view>
+						<view class="title" v-else>{{item.product_name}}</view>
+						<view class="tags"></view>
+						<view class="tags">已售{{item.sale_stock}}</view>
+						<view class="price-btn">
+							<view class="price">{{$dialog.formatMoney(item.price)}}</view>
+							<view class="price-line">{{$dialog.formatMoney(item.line_price)}}</view>
+							<view class="buy-btn">立即抢购</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</scroll-view>
 	</view>
 </template>
 
 <script>
+var app;
 export default {
 	data() {
 		return {
-
+			storeId:"",
+			goodsData:[],
+			orderData:{
+				size:10,
+				page:1,
+				loading:false,
+				isDone:false
+			},
 		}
 	},
+	onLoad() {
+		app = this;
+		app.getGoods()
+	},
 	methods: {
-
+		scrolltoupper(){},
+		scrolltolower(e){
+			if (app.orderData.isDone || app.goodsData.length == 0) return ;
+			app.getGoods()
+		},
+		toDetail(id){
+			uni.navigateTo({
+				url:`/pages/goods/detail?goods=${id}`
+			})
+		},
+		async getGoods(){
+			var formData = {};
+			const tokenPoi = uni.getStorageSync("contact");
+			formData.store = tokenPoi.poi_id;
+			formData.page = app.orderData.page;
+			formData.size = app.orderData.size;
+			var resp = await app.$api.home.goods.get(formData);
+			if (resp.code !== 200) {
+				return app.$dialog.showSuccess(resp.msg)
+			}
+			app.isLogin = true;
+			if (resp.data.rows.length > 0) {
+				app.orderData.page ++;
+				app.goodsData = [...app.goodsData,...resp.data.rows];
+			} else {
+				app.orderData.isDone = true;
+			}
+		},
 	}
 }
 </script>
 
-<style>
+<style lang="scss" scoped>
 
+.home-goods{
+	width: 95%;
+	margin: 20rpx auto;
+	.list-item{
+		display: flex;
+		align-items: center;
+		gap: 20rpx;
+		background-color: #fff;
+		padding: 20rpx;
+		margin-top: 20rpx;
+		border-radius: 20rpx;
+		.info{
+			flex: 1 1 0%;
+			overflow: hidden;
+			.title{
+				overflow: hidden;
+				text-overflow: ellipsis;
+				white-space: nowrap;
+				font-size: 32rpx;
+				color: #333;
+				font-weight: 900;
+			}
+			.tags {
+				color: #94a3b8;
+				font-size: 24rpx;
+				margin: 10rpx 0;
+			}
+			.price-btn{
+				display: flex;
+				align-items: center;
+				gap: 20rpx;
+				align-items: flex-end;
+				.price{
+					font-size: 30rpx;
+					color: $main-color;
+					font-weight: 900;
+				}
+				.price-line {
+					color: #999999;font-size: 24rpx;text-decoration-line: line-through;
+				}
+				.buy-btn{
+					margin-left: auto;
+					margin-right: 0;
+					background-color: $main-color;
+					color: #fff;
+					border-radius: 30rpx;
+					font-size: 28rpx;
+					padding: 10rpx 20rpx;
+				}
+			}
+		}
+		.image {
+			height: 180rpx;
+			overflow: hidden;display: flex;align-items: center;min-width: 180rpx;
+			position: relative;
+			text {
+				background-color: $main-color;
+				color: #fff;
+				position: absolute;
+				top: 10rpx;
+				left: 10rpx;
+				font-size: 24rpx;
+				border-radius: 30rpx;
+				padding: 10rpx 15rpx;
+			}
+			image {
+				width: 180rpx;
+				border-radius: 10upx;
+				height: 100%;
+			}
+		}
+	}
+	.goods-title{
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		.title-left{
+			.name {
+				font-size: 34rpx;
+				color: #333;
+				font-weight: 900;
+			}
+			text {
+				color: $main-color;
+				font-weight: 700;
+				font-size: 24rpx;
+			}
+		}
+		.title-more{
+			display: flex;
+			align-items: center;
+			color: #94a3b8;
+			font-size: 28rpx;
+			image {
+				width: 28rpx;
+				height: 28rpx;
+			}
+		}
+	}
+}
 </style>

+ 2 - 1
奥莱优品/pages/index/index.vue

@@ -70,7 +70,8 @@
 							<text>{{$dialog.disFormat(item.price,item.line_price)}}折</text>
 						</view>
 						<view class="info">
-							<view class="title">{{item.product_name}}</view>
+							<view class="title" v-if="item.is_new==1">{{item.price}}元代{{item.line_price}}元商场权益券{{item.product_name}}</view>
+							<view class="title" v-else>{{item.product_name}}</view>
 							<view class="tags"></view>
 							<view class="tags">已售{{item.sale_stock}}</view>
 							<view class="price-btn">

+ 48 - 5
奥莱优品/pages/order/detail.vue

@@ -77,7 +77,8 @@
 								</view>
 								<view class="info">
 									<view class="title">
-										<view class="name">{{ goodsData.product_name }}</view>
+										<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">
@@ -320,10 +321,52 @@ export default {
 				}
 			})
 		},
-		applyRefund(){},
-		onPay(){},
-		handleRefund(){},
-		onErrors(){},
+		applyRefund(event){
+			console.log("applyRefund",event)
+			const { orderId } = event.detail;
+			const goodsDetail = [
+				{
+					refundRelatedItemType: 2,
+					itemOrderId:app.orderData.item_order_id //商品单,可在预下单回调itemOrderlist里获取,或通过查询券状态接口获取
+				}
+			];
+			const extra = { orderId , goodsDetail};
+			 // 开发者需要透传的参数,可自定义内容
+			console.log(extra,"退款参数打印");
+			return new Promise(resolve => {
+				resolve(extra);
+			});
+		},
+		onPay(event){
+			console.log("event",event)
+			const { status, outOrderNo, result } = event.detail;
+			console.log(status, outOrderNo, result)
+			if (status === 'success') {
+				const { code } = result;
+				if (code === 0) { // 支付成功
+					app.$dialog.showSuccess("支付成功","none",function(){
+						app.getOrder()
+					})
+				} else {
+					app.$dialog.showSuccess("支付失败","none",function(){
+						app.getOrder()
+					})
+					// 继续支付失败(超时、取消、关闭)
+				}
+			} else {}
+		},
+		handleRefund(event){
+			const { status, result } = event.detail;
+			console.log("退款",event.detail)
+			if (status === 'success') {
+				const { refundId, outRefundNo } = result;
+			} else {
+				const { errMsg } = result;
+			}
+		},
+		onErrors(e){
+			console.log("错误",e)
+		},
 	}
 }
 </script>

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

@@ -70,7 +70,8 @@
 						</view>
 						<view class="info">
 							<view class="title">
-								<view class="name">{{ item.product.product_name }}</view>
+								<view class="name" v-if="item.product.is_new == 1">{{item.product.price}}元代{{item.product.line_price}}元商场权益券{{ item.product.product_name }}</view>
+								<view class="name" v-else>{{ item.product.product_name }}</view>
 								<view class="num">x{{ item.number }}</view>
 							</view>
 							<view class="tags">

+ 2 - 1
奥莱优品/static/js/request.js

@@ -16,7 +16,8 @@ const axg = {
 		// #endif
 		// #ifdef MP
 		// return 'https://tran.jsshuita.cn/v2'
-		return 'http://192.168.3.16:9881/v2'
+		// return 'http://192.168.3.16:9881/v2'
+		return 'http://192.168.2.142:9881/v2'
 		// #endif
 	},
 	toast: function(text, duration, success) {