zory 6 روز پیش
والد
کامیت
a3963dffbc

+ 55 - 13
pages/index/index.vue

@@ -7,20 +7,25 @@
 			<view class="coupon-item" v-for="(item,indx) in coupon" :key="indx">
 				<view class="header">订单编号 {{item.order_id}}</view>
 				<view class="body">
-					<view class="img"><image :src="item.product_img"></image></view>
 					<view class="info">
 						<view class="name">{{item.product_name}}</view>
 						<view class="desc">x {{item.count}}张</view>
-						<view class="desc">有效期至{{item.end_at}}</view>
+						<view class="desc">有效期至{{item.expire_at}}</view>
+					</view>
+					<view class="right">
+						<button class="btn" type="primary" @click="toDetail(item.order_id)" v-if="item.status==1">去使用</button>
 					</view>
 				</view>
-				<view class="footer">
+				<!-- <view class="footer">
 					<view class="state"></view>
 					<button class="btn" type="primary" @click="toDetail(item.order_id)">立即使用</button>
-				</view>
-				<view class="state-img"><image src="/static/image/no.png" mode="widthFix"></image></view>
+				</view> -->
+				<view class="state-img" v-if="item.status==1"><image src="/static/image/order-dot.png" mode="widthFix"></image></view>
+				<view class="state-img" v-if="item.status==4"><image src="/static/image/ex.png" mode="widthFix"></image></view>
 			</view>
+			<navigator hover-class="none" url="/pages/user/license" class="tips">小程序资质亮照</navigator>
 		</view>
+		<!-- <view class="kf-service" @click="getData"><image src="/static/image/refrsh.png"></image></view> -->
 	</view>
 </template>
 
@@ -31,12 +36,18 @@ export default {
 	data() {
 		return {
 			user:{},
-			coupon:[]
+			coupon:[],
+			account:"",
+			option:{}
 		}
 	},
-	onLoad() {
+	onShow() {
+		this.getData()
+	},
+	onLoad(option) {
 		app = this;
-		app.getData()
+		app.option = option;
+		// app.getData()
 	},
 	onShareAppMessage(res) {
 	    if (res.from === 'button') {// 来自页面内分享按钮
@@ -48,15 +59,29 @@ export default {
 	    }
 	},
 	methods: {
+		toService(){
+			
+		},
 		toDetail(order){
-			uni.navigateTo({
-				url:"/pages/order/store?type=1&order="+order
+			Api.orderDetail({"order":order}).then((res)=>{
+				if (res.code ==0) {
+					return app.$dialog.showSuccess(res.msg)
+				}
+				if (res.data.status > 1) {
+					return app.$dialog.showSuccess("该订单已完成预约","none",function(){
+						app.getData()
+					})
+				}
+				uni.navigateTo({
+					url:"/pages/order/store?type=1&order="+order
+				})
 			})
 		},
 		getData(){
 			uni.login({
 				success(lres){
-					Api.data({"code":lres.code}).then((res)=>{
+					app.option.auth = lres.code
+					Api.data(app.option).then((res)=>{
 						uni.hideLoading();
 						if (res.code == 0) {
 							return app.$dialog.showSuccess(res.msg);
@@ -79,12 +104,28 @@ export default {
 page{
 	background-color: #f8f8f8;
 }
+.kf-service{
+	position: fixed;
+	right: 20upx;
+	bottom: 20%;
+	width: 80upx;
+	height: 80upx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.kf-service image{
+	width: 60upx;
+	height: 60upx;
+	vertical-align: middle;
+}
 .empty-data{
 	height: 100vh;
 	display: flex;
 	align-items: center;
 	justify-content: center;
 }
+.tips{text-align: center;line-height: 80upx;color: #666;font-size: 28upx;}
 .coupon-item{background-color: #fff;border-radius: 10upx;width: calc(95% - 40upx);margin: 20upx auto;border: 2upx solid #fff;border-radius: 10upx;position: relative;}
 .coupon-item .state-img{position: absolute;right: 0;top: 0;}
 .coupon-item .state-img image{width: 100upx;height: 100upx;}
@@ -92,9 +133,10 @@ page{
 .coupon-item .footer{padding: 20upx;border-top: 2upx solid #f8f8f8;display: flex;justify-content: space-between;}
 .coupon-item .footer .state{flex: 1;}
 .coupon-item .footer .btn{width: 50%;font-size: 28upx;}
-.coupon-item .body{display: flex;align-items: center;margin: 20upx 0;}
+.coupon-item .body{display: flex;align-items: center;margin: 20upx 0;justify-content: space-between;}
 .coupon-item .img image{width: 160upx;height: 160upx;}
-.coupon-item .info{margin-left: 20upx;}
+.coupon-item .info{padding: 0 20upx;}
+.coupon-item .btn{font-size: 28upx;margin-right: 20upx;}
 .coupon-item .name{font-size: 32upx;color: #333;line-height: 46upx;}
 .coupon-item .desc{color: #666;font-size: 28upx;line-height: 48upx;}
 </style>

+ 22 - 10
pages/order/confirm.vue

@@ -1,6 +1,10 @@
 <template>
 	<view>
-		<view class="address" v-if="storeInfo && storeInfo.service_type==2">
+		<view class="order-type">
+			<view :class="service_type==2?'type-item active':'type-item'" @click="service_type=2">代提</view>
+			<view :class="service_type==1?'type-item active':'type-item'" @click="service_type=1">自提</view>
+		</view>
+		<view class="address" v-if="storeInfo && service_type==2">
 			<view class="addressInfo" v-if="addressInfo" @click="toAddress">
 				<view class="empty-data">
 					<view class="left">
@@ -28,10 +32,11 @@
 		
 		<view class="goods" v-if="goodsInfo">
 			<view class="goods-info">
-				<view class="image"><image :src="goodsInfo.product_img"></image></view>
+				<view class="image"><image :src="goodsInfo.goods.product_img"></image></view>
 				<view class="info">
 					<view class="name">{{ goodsInfo.product_name }}</view>
 					<view class="desc">x {{goodsInfo.count}}</view>
+					<view class="desc">有效期至{{goodsInfo.expire_at}}</view>
 				</view>
 			</view>
 			<view class="goods-item">
@@ -63,8 +68,8 @@
 			</view>
 		</view>
 		
-		<view class="order-time" v-if="storeInfo && storeInfo.service_type==1">
-			<view class="title">期望时间</view>
+		<view class="order-time" v-if="storeInfo && service_type==1">
+			<view class="title">预约到店时间</view>
 			<view class="msg" @click="selectTime(1)">
 				{{timeStr?timeStr:'请选择'}}
 				<view class="right"><image src="/static/image/right.png"></image></view>
@@ -130,7 +135,8 @@ export default {
 			addressInfo:null,
 			msg:"",
 			totalData:[],
-			goodsSku:[]
+			goodsSku:[],
+			service_type:2
 		}
 	},
 	onLoad({order,poi_id,poi_name,juli}) {
@@ -146,12 +152,13 @@ export default {
 			var formData = {};
 			formData.order = app.order;
 			formData.poi_id = app.poi_id;
-			if (app.storeInfo.service_type==2 && app.addressInfo == null) {
+			if (app.service_type==2 && app.addressInfo == null) {
 				return app.$dialog.showSuccess("请选择会员地址");
 			}
-			if (app.storeInfo.service_type==1 && app.timeStr == null) {
+			if (app.service_type==1 && app.timeStr == null) {
 				return app.$dialog.showSuccess("请选择预约时间");
-			}
+			}
+			formData.service_type = app.service_type;
 			var skuInfo = "",skuState = true;
 			if (app.goodsSku.length > 0) {
 				app.goodsSku.forEach((item,index)=>{
@@ -297,7 +304,12 @@ export default {
 </script>
 
 <style>
-.addressInfo{border-top: 16upx solid #224d7a;}
+page{height: 100vh;overflow: auto;}
+.order-type{height: 80upx;display: flex;align-items: center;line-height: 80upx;background-color: #fff;gap: 20upx;}
+.order-type .type-item{text-align: center;width: 50%;font-size: 32upx;color: #333;position: relative;border-left: 2upx solid #f8f8f8;}
+.order-type .type-item.active{color: #224d7a;font-weight: bold;}
+.order-type .type-item.active::after{content: "";position: absolute;left: 40%;width: 20%;bottom: -5upx;height: 10upx;background-color: #224d7a;}
+.addressInfo{border-top: 8upx solid #224d7a;}
 .addressInfo .empty-data{display: flex;align-items: center;font-size: 28upx;width: 100%;}
 .addressInfo .empty-data .contact-name{display: flex;align-items: center;font-size: 30upx;color: #333;margin-bottom: 20upx;}
 .addressInfo .empty-data .contact-name .mobile{margin-left: 20upx;}
@@ -334,7 +346,7 @@ export default {
 .goods .goods-info .image image{width: 160upx;height: 160upx;}
 .goods .goods-info .name{font-size: 32upx;color: #333;line-height: 46upx;font-weight: bold;margin-bottom: 20upx;}
 .goods .goods-info .desc{color: #666;font-size: 28upx;line-height: 48upx;}
-.goods .goods-item{display: flex;align-items: center;border-top: 2upx solid #f8f8f8;line-height: 80upx;justify-content: space-between;font-size: 28upx;color: #333;}
+.goods .goods-item{display: flex;align-items: center;line-height: 80upx;justify-content: space-between;font-size: 28upx;color: #333;}
 .goods .goods-item .right.red{color: #f00;}
 
 .order-time .title{font-size: 28upx;}

+ 57 - 23
pages/order/detail.vue

@@ -4,18 +4,20 @@
 			<view class="coupon-item">
 				<view class="header">订单编号 {{orderData.order_id}}</view>
 				<view class="body">
-					<view class="img"><image :src="orderData.product_img"></image></view>
 					<view class="info">
 						<view class="name">{{orderData.product_name}}</view>
 						<view class="desc">x {{orderData.count}}张</view>
-						<view class="desc">有效期至{{orderData.end_at}}</view>
+						<view class="desc">有效期至{{orderData.expire_at}}</view>
+					</view>
+					<view class="right">
+						<button class="btn" type="primary" @click="toDetail(orderData.order_id)" v-if="orderData.status==1">去使用</button>
+						<button class="btn" type="default" @click="toView(orderData.order.order_sn)" v-if="orderData.status==2 && orderData.order">查看预约</button>
 					</view>
 				</view>
-				<view class="footer">
-					<view class="state"></view>
-					<button class="btn" type="primary" @click="toDetail(orderData.order_id)">立即使用</button>
-				</view>
-				<view class="state-img"><image src="/static/image/no.png" mode="widthFix"></image></view>
+				<view class="state-img" v-if="orderData.status==1"><image src="/static/image/order-dot.png" mode="widthFix"></image></view>
+				<view class="state-img" v-if="orderData.status==2"><image src="/static/image/fwz.png" mode="widthFix"></image></view>
+				<view class="state-img" v-if="orderData.status==3"><image src="/static/image/end.png" mode="widthFix"></image></view>
+				<view class="state-img" v-if="orderData.status==4"><image src="/static/image/ex.png" mode="widthFix"></image></view>
 			</view>
 			<navigator hover-class="none" url="/pages/user/license" class="tips">小程序资质亮照</navigator>
 		</view>
@@ -32,7 +34,8 @@
 				<view class="title">第三方服务声明<image src="/static/image/round_close.png" @click="msgDialog=false"></image></view>
 				<view class="desc">本商品信息、交易以及售后服务由第三方提供,如由问题请联系在线客服或电话客服</view>
 			</view>
-		</view>
+		</view>
+		<view class="kf-service" @click="toService"><image src="/static/image/kefu.png"></image></view>
 	</view>
 </template>
 
@@ -43,24 +46,32 @@ export default {
 	data() {
 		return {
 			order:"",
-			msgDialog:true,
-			orderData:null
+			msgDialog:false,
+			orderData:null,
+			option:{}
 		}
 	},
-	onLoad({order}) {
+	onLoad(option) {
 		app = this;
-		if (!order) {
-			return app.$dialog.showSuccess("参数错误","none",function(){
-				uni.navigateBack()
-			})
-		}
-		app.order = order;
-		setTimeout(function(){
-			app.msgDialog = false;
-		},3000)
+		app.option = option;
 		app.getData();
 	},
 	methods: {
+		toView(orderSn){
+			if (!orderSn) return ;
+			uni.navigateTo({
+				url:"/pages/order/info?order="+orderSn
+			})
+		},
+		toService(){
+			if (!app.orderData.store.service_mobile) return false;
+			uni.makePhoneCall({
+				phoneNumber:app.orderData.store.service_mobile,
+				fail() {
+					app.$dialog.showSuccess("联系失败")
+				}
+			})
+		},
 		toDetail(order){
 			uni.navigateTo({
 				url:"/pages/order/store?type=1&order="+order
@@ -69,7 +80,8 @@ export default {
 		getData(){
 			uni.login({
 				success(lres){
-					Api.detail({"code":lres.code,"order":app.order}).then((res)=>{
+					app.option.auth = lres.code
+					Api.detail(app.option).then((res)=>{
 						uni.hideLoading();
 						if (res.code == 0) {
 							return app.$dialog.showSuccess(res.msg);
@@ -77,6 +89,10 @@ export default {
 						uni.setStorageSync("user_data", res.data.user)
 						uni.setStorageSync("user_token", res.data.user.access_token)
 						app.orderData = res.data.order;
+						app.msgDialog = true;
+						setTimeout(function(){
+							app.msgDialog = false;
+						},3000)
 					})
 				},fail(res){
 					app.$dialog.showSuccess("登录失败,请重启小程序")
@@ -89,6 +105,23 @@ export default {
 
 <style>
 page{background-color: #f8f8f8;}
+.kf-service{
+	position: fixed;
+	right: 20upx;
+	bottom: 20%;
+	background-color: #fff;
+	width: 80upx;
+	height: 80upx;
+	border-radius: 80upx;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+}
+.kf-service image{
+	width: 60upx;
+	height: 60upx;
+	vertical-align: middle;
+}
 .dialog-msg .mark{position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 90;background-color: rgba(0, 0,0, 0.3);}
 .dialog-msg .msg-body{position: fixed;background-color: #fff;z-index: 99;left: 5%;right: 5%;top: 50%;transform: translateY(-50%);border-radius: 10upx;padding: 40upx;}
 .dialog-msg .msg-body .title{text-align: center;line-height: 48upx;color: #333;font-weight: bold;margin-bottom: 20upx;position: relative;padding: 20upx 0;}
@@ -102,9 +135,10 @@ page{background-color: #f8f8f8;}
 .coupon-item .footer{padding: 20upx;border-top: 2upx solid #f8f8f8;display: flex;justify-content: space-between;}
 .coupon-item .footer .state{flex: 1;}
 .coupon-item .footer .btn{width: 50%;font-size: 28upx;}
-.coupon-item .body{display: flex;align-items: center;margin: 20upx 0;}
+.coupon-item .body{display: flex;align-items: center;margin: 20upx 0;justify-content: space-between;}
 .coupon-item .img image{width: 160upx;height: 160upx;}
-.coupon-item .info{margin-left: 20upx;}
+.coupon-item .info{padding: 0 20upx;}
+.coupon-item .btn{font-size: 28upx;margin-right: 20upx;}
 .coupon-item .name{font-size: 32upx;color: #333;line-height: 46upx;}
 .coupon-item .desc{color: #666;font-size: 28upx;line-height: 48upx;}
 .tips{text-align: center;line-height: 80upx;color: #666;font-size: 28upx;}

+ 94 - 41
pages/order/info.vue

@@ -12,13 +12,13 @@
 		</block>
 		<block v-else>
 			<view class="order-status">
-				<view class="status-name" v-if="orderData.status == 1">已核销</view>
-				<view class="status-name success" v-if="orderData.status == 2">预约中</view>
+				<view class="status-name" v-if="orderData.status == 1">预约中</view>
+				<view class="status-name success" v-if="orderData.status == 2">服务中</view>
 				<view class="status-name" v-if="orderData.status == 3">已撤销</view>
 				<view class="status-name" v-if="orderData.status == 4">已完成</view>
 				
-				<view class="status-desc" v-if="orderData.status == 1">团购券已完成核销</view>
-				<view class="status-desc success" v-if="orderData.status == 2">预约中,如有问题可以联系客服</view>
+				<view class="status-desc" v-if="orderData.status == 1">预约中,如有问题可以联系客服</view>
+				<view class="status-desc success" v-if="orderData.status == 2">服务中,如有问题可以联系客服</view>
 				<view class="status-desc" v-if="orderData.status == 3">已撤销,可在团购订单中申请退款</view>
 				<view class="status-desc" v-if="orderData.status == 4">服务已完成,欢迎您再次使用</view>
 				
@@ -28,12 +28,20 @@
 				<view class="goods-info">
 					<view class="name">{{ orderData.goods.product_name }}</view>
 					<view class="desc">
-						<view class="time" v-if="orderData.end_at">有效期至:{{ orderData.end_at }} </view>
-						<view class="num">x {{ orderData.number?orderData.number:1 }}</view>
+						<view class="time" v-if="orderData.parent.expire_at">有效期至:{{ orderData.parent.expire_at }} </view>
 					</view>
-					<view class="total">合计:¥ {{orderData.goods.product_price}}</view>
+					<view class="desc">x {{ orderData.number?orderData.number:1 }} <text>{{ orderData.sku }}</text></view>
+					<!-- <view class="total">合计:¥ {{orderData.goods.product_price}}</view> -->
 				</view>
 			</view>
+			<view class="goods-item">
+				<view class="left">商品总额</view>
+				<view class="right">¥{{orderData.parent.order_amount}}</view>
+			</view>
+			<view class="goods-item">
+				<view class="left">商品优惠</view>
+				<view class="right red">¥{{orderData.parent.order_amount}}</view>
+			</view>
 			<view class="goods-store" v-if="poiData">
 				<view class="title">预约门店</view>
 				<view class="store-info">
@@ -42,7 +50,7 @@
 						<view class="address">{{poiData.poi_address}}</view>
 					</view>
 					<view class="store-right">
-						<view class="right-item">
+						<view class="right-item" @click="openLocation">
 							<image src="/static/image/map.png"></image>
 							<view class="desc">导航</view>
 						</view>
@@ -81,26 +89,22 @@
 			<view class="line-footer"></view>
 			<view class="footer">
 				<view class="footer-op" v-if="orderData.status == 1">
+					<view class="footer-left" @click="cancelOrder(1)"><text class="red">取消预约</text></view>
 					<view class="footer-right">
-						<view class="btn">已核销</view>
+						<view class="btn">预约中</view>
+						<view class="btn full" @click="callMobile">联系商家</view>
 					</view>
 				</view>
 				<view class="footer-op" v-if="orderData.status == 2">
-					<view class="footer-left" @click="cancelOrder"><text>取消预约</text></view>
-					<view class="footer-right">
-						<pay-button-sdk
-							:mode="1"
-						  :goods-id="orderData.goods.out_id"
-						  :order-id="orderData.order_sn"
-						  :order-status="1"
-						  :refund-total-amount="orderData.goods.product_price*100"
-						  :apply-refund-params="applyRefundParams"
-						/>
-						<view class="btn">服务进行中</view>
+					<view class="footer-left" @click="cancelOrder(2)"><text class="red">取消服务</text></view>
+					<view class="footer-right">
+						<view class="btn">服务中</view>
+						<view class="btn full" @click="callMobile">联系商家</view>
 					</view>
 				</view>
 				<view class="footer-op" v-if="orderData.status == 3">
-					<view class="footer-right" @click="toGoods">
+					<view class="footer-left" @click="delOrder()"><text class="red">删除订单?</text></view>
+					<view class="footer-right">
 						<view class="btn">已撤销</view>
 					</view>
 				</view>
@@ -126,6 +130,7 @@ export default {
 			poiData:null,
 			goodsData:null,
 			orderData:null,
+			goodsPrice:0,
 			storeData:null,
 			orderIdForRefundAmount:"",
 			applyRefundParams:{
@@ -139,23 +144,65 @@ export default {
 		app.order = order;
 		app.getOrder()
 	},
-	methods: {
-		toRefund(){
-			
-		},
-		applyrefund(event) { 
-			console.log('退款申请',event);
-			const { orderId } = event.detail; 
-			console.log('退款申请-02',orderId);
-			const extra = { orderId }; // 开发者需要透传的参数,可自定义内容 
-			return new Promise(resolve => { 
-				resolve(extra); 
-			}); 
+	methods: {
+		copyOrder(order){
+			setTimeout(function(){
+				uni.setClipboardData({
+					data:order,
+					success() {
+						app.$dialog.showSuccess("复制成功")
+					},
+					fail() {
+						app.$dialog.showSuccess("复制失败")
+					}
+				})
+			},300)
+		},
+		openLocation(){
+			uni.openLocation({
+				latitude:app.poiData.latitude,
+				longitude:app.poiData.longitude,
+				name:app.poiData.poi_name,
+				address:app.poiData.poi_address,
+				fail() {
+					app.$dialog.showSuccess("打开地图失败");
+				}
+			})
+		},
+		callMobile(){
+			if (!app.storeData.service_mobile) return ;
+			uni.makePhoneCall({
+				phoneNumber:app.storeData.service_mobile,
+				fail() {
+					app.$dialog.showSuccess("联系失败")
+				}
+			})
+		},
+		delOrder(){
+			app.$dialog.showError("确定要删除该笔预约订单吗",function(res){
+				if (res.confirm) {
+					Api.del({"order":app.order}).then((res)=>{
+						if (res.code == 0) {
+							return app.$dialog.showSuccess(res.msg)
+						}
+						app.$dialog.showSuccess(res.msg,"none",function(){
+							uni.switchTab({
+								url:"/pages/order/order"
+							})
+						})
+					})
+				}
+			},"删除提示")
 		},
-		cancelOrder(){
-			app.$dialog.showError("确定要取消该预约吗?",function(res){
+		cancelOrder(type){
+			if (type == 1) {
+				var msg = "确定要取消该预约或服务吗?";
+			} else {
+				var msg = "该订单已在服务中,如需取消服务需联系商家审核,审核通过后即可申请退款!";
+			}
+			app.$dialog.showError(msg,function(res){
 				if (res.confirm) {
-					Api.cancel({"order":app.order}).then((res)=>{
+					Api.cancel({"order":app.order,"type":type}).then((res)=>{
 						if (res.code == 0) {
 							return app.$dialog.showSuccess(res.msg)
 						}
@@ -164,7 +211,7 @@ export default {
 						})
 					})
 				}
-			},"取消预约")
+			},"取消预约/服务")
 		},
 		getOrder(){
 			Api.orderDetail({"order":app.order}).then((res)=>{
@@ -174,10 +221,12 @@ export default {
 						uni.navigateBack()
 					});
 					return ;
-				}
+				}
+				app.goodsPrice = res.data.parent.pay_amount * 100;
 				app.applyRefundParams.orderId = res.data.order_id;
 				app.orderData = res.data
 				app.poiData = res.data.poi;
+				app.storeData = res.data.store;
 			})
 		}
 	}
@@ -194,14 +243,15 @@ page{background-color: #f8f8f8;}
 .footer{position: fixed;bottom: 0;background-color: #fff;padding: 20upx 20upx 0 20upx;border-top: 2upx solid #f8f8f8;left: 0;right: 0;}
 .footer .footer-op{display: flex;align-items: center;}
 .footer .footer-op .footer-left{display: flex;align-items: center;gap: 10upx;justify-content: center;font-size: 32upx;color: #f00;font-weight: bold;}
-.footer .footer-op .footer-left text{color: #666;font-size: 24upx;font-weight: normal;}
+.footer .footer-op .footer-left text{color: #333;font-size: 28upx;font-weight: normal;}
+.footer .footer-op .footer-left text.red{color: #f56c6c;font-weight: bold;}
 .footer .footer-op .footer-left .item{flex-direction: column;display: flex;font-size: 24rpx;color: #333;align-items: center;}
 .footer .footer-op .footer-left image{width: 40upx;height: 40upx;}
 
 .footer .footer-op .footer-right{margin-left: auto;margin-right: 0;display: flex;align-items: center;gap: 20upx;}
 .footer .footer-op .footer-right .btn{font-size: 28rpx;height: 80upx;border-radius: 10upx;line-height: 80upx;text-align: center;width: 200upx;color: #333;border: 2upx solid #ccc;}
 .footer .footer-op .footer-right .btn.danger{border:2upx solid #f00;color: #f00;}
-.footer .footer-op .footer-right .btn.full{background-color: #007aff;color: #fff;border:2upx solid #007aff;}
+.footer .footer-op .footer-right .btn.full{background-color: #224d7a;color: #fff;border:2upx solid #224d7a;}
 .footer .footer-safe {height: env(safe-area-inset-bottom);width: 100%;}
 
 .order-status{padding: 40upx 20upx;text-align: center;}
@@ -222,8 +272,11 @@ page{background-color: #f8f8f8;}
 .order-goods image{width: 140upx;height: 140upx;}
 .goods-info{margin-left: 20upx;font-size: 28upx;flex: 1;padding: 20upx 0;}
 .goods-info .name{font-size: 30upx;color: #333;}
-.goods-info .desc{font-size: 24upx;color: #999;display: flex;align-items: center;justify-content: space-between;margin: 20upx 0;}
+.goods-info .desc{font-size: 24upx;color: #999;margin: 20upx 0;}
+.goods-info .desc text{margin-left: 20upx;}
 .goods-info .total{font-size: 30upx;color: #333;text-align: right;font-weight: bold;}
+.goods-item{display: flex;align-items: center;line-height: 80upx;justify-content: space-between;font-size: 28upx;color: #333;background-color: #fff;padding: 0 20upx;border-top: 2upx solid #f8f8f8;}
+.goods-item .right.red{color: #f00;}
 
 .home-store{margin: 20upx auto;display: flex;align-items: center;background-color: #fff;border-radius: 10upx;display: flex;align-items: center;padding: 30upx;}
 .home-store .store-right{width: 120upx;height: 120upx;background-color: #fff;text-align: center;display: flex;align-items: center;justify-content: center;margin-left: auto;margin-right: 0;border-radius: 10upx;}

+ 13 - 11
pages/order/order.vue

@@ -3,8 +3,8 @@
 		<view class="header">
 			<view class="header-tabs">
 				<view @click="checkType(0)" :class="tabType==0?'tab-item active':'tab-item'">全部</view>
-				<view @click="checkType(1)" :class="tabType==1?'tab-item active':'tab-item'">已核销</view>
-				<view @click="checkType(2)" :class="tabType==2?'tab-item active':'tab-item'">预约中</view>
+				<view @click="checkType(1)" :class="tabType==1?'tab-item active':'tab-item'">预约中</view>
+				<view @click="checkType(2)" :class="tabType==2?'tab-item active':'tab-item'">服务中</view>
 				<view @click="checkType(3)" :class="tabType==3?'tab-item active':'tab-item'">已撤销</view>
 				<view @click="checkType(4)" :class="tabType==4?'tab-item active':'tab-item'">已完成</view>
 			</view>
@@ -13,10 +13,10 @@
 			<z-paging ref="paging" show-refresher-update-time v-model="dataList" @query="queryList" :fixed="false">
 				<view class="order-item" v-for="(item,indx) in dataList" :key="indx">
 					<view class="item-header" @click="toDetail(item.order_sn)">
-						<view class="order-status" v-if="item.status == 1">已核销</view>
-						<view class="order-status success" v-if="item.status == 2">预约中</view>
+						<view class="order-status success" v-if="item.status == 1">预约中</view>
+						<view class="order-status success" v-if="item.status == 2">服务中</view>
 						<view class="order-status" v-if="item.status == 3">已撤销</view>
-						<view class="order-status" v-if="item.status == 4">已完成</view>
+						<view class="order-status success" v-if="item.status == 4">已完成</view>
 						<view class="order-time">订单号 :{{ item.order_id }}</view>
 					</view>
 					<view class="order-goods" @click="toDetail(item.order_sn)">
@@ -27,14 +27,16 @@
 								<view class="time" v-if="item.end_at">有效期至:{{ item.end_at }} </view>
 								<view class="num">x {{ item.number?item.number:1 }}</view>
 							</view>
-							<view class="total">合计:¥ {{ item.goods.product_price }}</view>
+							<view class="desc">{{item.sku}}</view>
+							<view class="total">¥ {{ item.goods.product_price }}</view>
 						</view>
 					</view>
 					<view class="order-footer">
 						<view class="footer-l">{{item.create_at}}</view>
 						<view class="footer-r">
-							<view class="btn blue" v-if="item.status == 2" @click="toDetail(item.order_sn)">取消预约</view>
-							<view class="btn danger" v-else @click="toDetail(item.order_sn)">详情</view>
+							<view class="btn blue" v-if="item.status == 1" @click="toDetail(item.order_sn)">取消预约</view>
+							<view class="btn blue" v-if="item.status == 2" @click="toDetail(item.order_sn)">取消服务</view>
+							<view class="btn danger" @click="toDetail(item.order_sn)">详情</view>
 						</view>
 					</view>
 				</view>
@@ -139,7 +141,7 @@ page{
 .order-footer{display: flex;text-align: right;padding: 20upx 0;border-top: 2upx solid #f8f8f8;align-items: center;}
 .order-footer .footer-l{font-size: 28upx;color: #666;}
 .order-footer .footer-r{display: flex;margin-left: auto;margin-right: 0;flex: 1;justify-content: end;gap: 20upx;}
-.order-footer .btn{width: 160upx;height: 60upx;line-height: 60upx;text-align: center;border: 2upx solid #ccc;color: #333;font-size: 28upx;border-radius: 10upx;}
+.order-footer .btn{height: 50upx;line-height: 50upx;text-align: center;border: 2upx solid #ccc;color: #333;font-size: 28upx;border-radius: 10upx;padding: 0 25upx;}
 .order-footer .btn.danger{border:2upx solid #f00;color: #f00;}
 .order-footer .btn.blue{border:2upx solid #007aff;color: #007aff;}
 
@@ -150,8 +152,8 @@ page{
 .order-item .item-header .order-time{font-size: 24upx;color: #999;margin-left: auto;margin-right: 0;}
 .order-item .order-goods{display: flex;align-items: center;}
 .order-item .order-goods image{width: 140upx;height: 140upx;}
-.order-item .goods-info{margin-left: 20upx;font-size: 28upx;flex: 1;padding: 20upx 0;}
+.order-item .goods-info{margin-left: 20upx;font-size: 28upx;flex: 1;padding: 20upx 0;position: relative;}
 .order-item .goods-info .name{font-size: 30upx;color: #333;}
 .order-item .goods-info .desc{font-size: 24upx;color: #999;display: flex;align-items: center;justify-content: space-between;margin: 20upx 0;}
-.order-item .goods-info .total{font-size: 30upx;color: #333;text-align: right;font-weight: bold;}
+.order-item .goods-info .total{font-size: 30upx;color: #333;text-align: right;font-weight: bold;position: absolute;right: 20upx;bottom: 40upx;}
 </style>

+ 1 - 2
pages/order/store.vue

@@ -101,7 +101,6 @@ export default {
 				fail() {
 					app.location = "117.172398,34.226209";
 					app.getStore();
-					app.$dialog.showSuccess("获取定位信息失败");
 				}
 			})
 		},
@@ -133,7 +132,7 @@ export default {
 .store-item .item-left{flex: 1;}
 .store-item .name{font-size: 32upx;color: #333;line-height: 48upx;font-weight: bold;}
 .store-item .desc{font-size: 24upx;color: #666;line-height: 36upx;margin-top: 10upx;}
-.store-item .item-right{text-align: center;}
+.store-item .item-right{text-align: center;margin-left: 20upx;border-left: 2upx solid #f8f8f8;padding-left: 20upx;}
 .store-item .item-right .footer{font-size: 24upx;color: #666;}
 .store-item .item-right .top{display: flex;align-items: center;gap: 20upx;margin-bottom: 20upx;}
 .store-item .item-right .top .icon-img{width: 60upx;height: 60upx;background-color: #f8f8f8;border-radius: 60upx;display: flex;align-items: center;justify-content: center;}

+ 13 - 4
pages/user/address.vue

@@ -133,9 +133,17 @@ export default {
 		close(){
 			app.$refs.popup.close()
 		},
-		add(){
-			app.mode = "add";
-			app.$refs.popup.open()
+		add(){
+			uni.getLocation({
+				type:"gcj02",
+				success(res) {
+					console.log(res)
+				},
+				complete() {
+					app.mode = "add";
+					app.$refs.popup.open()
+				}
+			})
 		},
 		submit(){
 			var {formData} = this;
@@ -169,7 +177,8 @@ export default {
 .address-list .list-item .title{font-size: 24upx;color: #666;margin-bottom: 20upx;}
 .address-list .list-item .name{font-size: 28upx;color: #333;margin-bottom: 20upx;}
 .address-list .list-item .mobile{font-size: 28upx;color: #666;margin-bottom: 20upx;}
-.address-list .list-item .mobile text{margin-left: 20upx;}
+.address-list .list-item .mobile text{margin-left: 20upx;}
+.address-list .list-item .item-left{flex: 1;}
 .address-list .list-item .item-right{display: flex;align-items: center;gap: 20upx;}
 .address-list .list-item .item-right .icon{width: 60upx;height: 60upx;background-color: #f8f8f8;border-radius: 30upx;text-align: center;justify-content: center;align-items: center;display: flex;}
 .address-list .list-item .item-right image{width: 40upx;height: 40upx;}

+ 32 - 5
pages/user/user.vue

@@ -1,11 +1,11 @@
 <template>
 	<view>
-		<view class="user-header" v-if="userInfo">
+		<view class="user-header" v-if="userInfo" @click="toLogin">
 			<view class="avatar-btn">
 				<image :src="userInfo?userInfo.avatar:'https://inmei-print.oss-cn-guangzhou.aliyuncs.com/logo.png'"></image>
 			</view>
 			<view class="user-info">
-				<view class="name">{{userInfo.nickname}}</view>
+				<view class="name">{{userInfo.nickname?userInfo.nickname:'请先登录'}}</view>
 			</view>
 		</view>
 		<view class="user-header" v-else>
@@ -55,11 +55,30 @@ export default {
 			userInfo:null
 		}
 	},
+	onShow() {
+		this.getData()
+	},
 	onLoad() {
 		app = this;
 		app.getData()
 	},
-	methods: {
+	methods: {
+		toLogin(){
+			uni.getUserProfile({
+				success(res) {
+					var userInfo = res.userInfo;
+					Api.save({"nickName":userInfo.nickName,"avatarUrl":userInfo.avatarUrl}).then((res)=>{
+						if (res.code == 0) {
+							return app.$dialog.showSuccess("登录失败")
+						}
+						app.userInfo = res.data;
+					})
+				},
+				fail() {
+					app.$dialog.showSuccess("登录失败")
+				}
+			})
+		},
 		getData(){
 			Api.info({}).then((res)=>{
 				if (res.code == 0) {
@@ -71,8 +90,16 @@ export default {
 		outLogin(order){
 			app.$dialog.showError("确定要退出登录吗",function(res){
 				if (res.confirm) {
-					app.userInfo = null;
-					uni.clearStorageSync();
+					Api.save({"nickName":"","avatarUrl":""}).then((res)=>{
+						if (res.code == 0) {
+							return app.$dialog.showSuccess("登录失败")
+						}
+						app.userInfo = null;
+						uni.clearStorageSync();
+						uni.switchTab({
+							url:"/pages/index/index"
+						})
+					})
 				}
 			})
 		},

+ 5 - 0
static/api/home.js

@@ -3,9 +3,14 @@ import request from '@/static/js/request.js'
 const apiUri = {
 	data: '/home/login',
 	detail: '/order/life',
+	orderDetail: '/order/life/detail',
 	license: '/home/license'
 }
 
+export function orderDetail(param) {
+	return request.request(apiUri.orderDetail,'GET', param,false,true,false)
+}
+
 export function data(param) {
 	return request.request(apiUri.data,'POST', param,false,true,false)
 }

+ 6 - 1
static/api/order.js

@@ -6,11 +6,16 @@ const apiUri = {
 	submit: '/confirm/submit',
 	order: '/order/data',
 	orderDetail: '/order/detail',
-	cancel: '/order/cancel',
+	cancel: '/order/cancel',
+	del: '/order/del',
 }
 
 export function cancel(param) {
 	return request.request(apiUri.cancel,'POST', param,false,true,false)
+}
+
+export function del(param) {
+	return request.request(apiUri.del,'POST', param,false,true,false)
 }
 
 export function store(param) {

+ 5 - 1
static/api/user.js

@@ -2,13 +2,17 @@ import request from '@/static/js/request.js'
 
 const apiUri = {
 	info: '/user/info',
-	order: '/order/data'
+	save: '/user/save'
 }
 
 export function info(param) {
 	return request.request(apiUri.info,'GET', param,false,true,false)
 }
 
+export function save(param) {
+	return request.request(apiUri.save,'POST', param,false,true,false)
+}
+
 export function order(param) {
 	return request.request(apiUri.order,'GET', param,false,true,false)
 }

BIN
static/image/end.png


BIN
static/image/ex.png


BIN
static/image/fwz.png


BIN
static/image/kefu.png


BIN
static/image/order-dot.png


BIN
static/image/refrsh.png


BIN
static/image/type_tag.png