py hai 1 ano
pai
achega
ef79ef3700

+ 1 - 1
api/shopping.js

@@ -21,4 +21,4 @@ export const setShopIngDel = (data) => request(newsUrl + 'del', 'post', { ...dat
 export const getShopIngList = (data) => request(newsUrl + 'list', 'post', { ...data },false)
 
 // 添加&更新购物车数量
-export const shoppingSave = (data) => request(newsUrl + 'save', 'post', { ...data },false)
+export const shoppingSave = (data) => request(newsUrl + 'save', 'post', { ...data },true)

BIN=BIN
pages-buy/static/jl.png


+ 10 - 7
pages-my/rule-info.vue

@@ -72,13 +72,16 @@
 				})
 			},
 			goToUrl(){
-				if(this.ticketData.scene == 1){
-					// 去外卖
-				}else{
-					uni.navigateTo({
-						url:'/pages-takeout/replace-take'
-					})
-				}
+					if (this.ticketData.scene == 1) {
+						// 去外卖
+						uni.navigateTo({
+							url: `/pages-my/search-list?ticketId=` + this.ticketData.id
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages-takeout/replace-take'
+						})
+					}
 			},
 			scrolltolower() {},
 		},

+ 11 - 3
pages-order/express-info.vue

@@ -167,13 +167,21 @@
 						预约配送
 					</view>
 				</view> -->
-				<view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26"
-					v-show="infoData.order_status == 3 || infoData.order_status == 4">
+				<view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26">
 					<view class="fs-28 fc-9">
 						骑手信息
 					</view>
 					<view class="fs-28 fc-3 w-480 text-align-right">
-						{{infoData.rider.rider_name}}{{infoData.rider.phone}}
+						{{infoData.rider.rider_name?infoData.rider.rider_name:'无'}}{{infoData.rider.phone}}
+					</view>
+				</view>
+				<view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26"
+					v-show="infoData.order_status == 5">
+					<view class="fs-28 fc-9">
+						退款原因
+					</view>
+					<view class="fs-28 fc-3 w-480 text-align-right">
+						{{infoData.refund_msg?infoData.refund_msg:'无'}}
 					</view>
 				</view>
 				<view class="display-flex flex-justify-space mb-26">

+ 2 - 2
pages-order/run-errands-info.vue

@@ -441,8 +441,8 @@
 	}
 
 	.images-img {
-		width: 30rpx;
-		height: 30rpx;
+		width: 50rpx;
+		height: 50rpx;
 		margin: 0 10rpx 10rpx 0;
 	}
 

+ 119 - 58
pages-order/takeout-info.vue

@@ -50,7 +50,7 @@
 							联系客服
 						</view>
 					</view>
-					<view class="w-33 flex-direction align-items-center" @click="contactShop(infoData.shop_phone)">
+					<view class="w-33 flex-direction align-items-center" @click="contactShop(infoData.shop.shop_phone)">
 						<image class="mb-4 icon" src="@/static/img/order/lxsj.png" mode=""></image>
 						<view class="fs-24 fc-3">
 							联系商家
@@ -159,8 +159,7 @@
 						{{infoData.time}}
 					</view>
 				</view>
-				<view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26"
-					v-show="infoData.order_status == 6 || infoData.order_status == 7">
+				<view class="display-flex flex-justify-space pb-20 b-b-F9F9F9 mb-26">
 					<view class="fs-28 fc-9">
 						骑手信息
 					</view>
@@ -222,10 +221,35 @@
 				</view>
 			</view>
 		</scroll-view>
+		<uni-popup ref="popupReason" type="bottom" :is-mask-click="false" background-color="#fff" border-radius="10px 10px 0 0">
+			<view class="popup-reason-box flex-direction">
+				<view class="text-align-center fs-38 fw-600 fc-3 mb-18">
+					选择取消原因
+				</view>
+				<picker-view @change="bindChange" class="picker-view flex-1" :immediate-change='true'>
+					<picker-view-column>
+						<view class="picker-view-item" v-for="(item,index) in refundReason" :key="index">
+							{{item.refund_msg}}
+						</view>
+					</picker-view-column>
+				</picker-view>
+				<view class="align-items-center flex-justify-space plr-24 box-border-box">
+					<view class="flex-1 mr-20 pop-b text-align-center fs-36 b-r-ccc" @click="popCancel">
+						取消
+					</view>
+					<view class="flex-1 pop-b text-align-center bgc-41ABF5 fc-f fs-36" @click="popSure">
+						确定
+					</view>
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
 <script>
+	import {
+		commonRefundReason
+	} from "@/api/common.js"
 	import {
 		orderInfo,
 		orderCancel,
@@ -250,7 +274,9 @@
 					s: '',
 				},
 				isAJAX: false,
-				address_id: ''
+				address_id: '',
+				refund_msg: '', // 退款理由
+				refundReason: [] //退款原因
 			};
 		},
 		onLoad(data) {
@@ -332,69 +358,78 @@
 				this.orderPay(this.infoData.id)
 			},
 			orderPay(id) {
-				// 票务支付
+				// 外卖支付
+				uni.redirectTo({
+					url: `/pages-takeout/pay-page?orderId=${id}`
+				});
+				// if (this.isAJAX) {
+				// 	return
+				// }
+				// this.isAJAX = true;
+				// orderPay({
+				// 	order_id: id
+				// }).then((ret) => {
+				// 	if (ret.code === 1) {
+				// 		uni.requestPayment({
+				// 			provider: "wxpay", //支付类型-固定值
+				// 			timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
+				// 			nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
+				// 			package: ret.data.wx_pay.package, // 固定值
+				// 			signType: ret.data.wx_pay.signType, //固定值
+				// 			paySign: ret.data.wx_pay.paySign, //签名
+				// 			success: (ren) => {
+				// 				tools.success("支付成功");
+				// 				this.isAJAX = false;
+				// 				this.orderInfo(this.infoData.id)
+				// 			},
+				// 			fail: (err) => {
+				// 				this.isAJAX = false;
+				// 				tools.error("支付失败");
+				// 			},
+				// 		});
+				// 	} else {
+				// 		this.isAJAX = false;
+				// 		tools.error("支付失败");
+				// 	}
+				// })
+			},
+			cancelOrder() {
+				// 外卖取消订单
+				commonRefundReason().then((res) => {
+					if (res.code === 1) {
+						this.refundReason = res.data
+						this.refund_msg = res.data[0].refund_msg
+					}
+				})
+				this.$refs.popupReason.open()
+			},
+			popCancel() {
+				// 退款取消
+				this.$refs.popupReason.close()
+			},
+			popSure() {
+				// 退款确认
 				if (this.isAJAX) {
 					return
 				}
 				this.isAJAX = true;
-				orderPay({
-					order_id: id
-				}).then((ret) => {
-					if (ret.code === 1) {
-						uni.requestPayment({
-							provider: "wxpay", //支付类型-固定值
-							timeStamp: ret.data.wx_pay.timeStamp + "", // 时间戳(单位:秒)
-							nonceStr: ret.data.wx_pay.nonceStr, // 随机字符串
-							package: ret.data.wx_pay.package, // 固定值
-							signType: ret.data.wx_pay.signType, //固定值
-							paySign: ret.data.wx_pay.paySign, //签名
-							success: (ren) => {
-								tools.success("支付成功");
-								this.isAJAX = false;
-								this.orderInfo(this.infoData.id)
-							},
-							fail: (err) => {
-								this.isAJAX = false;
-								tools.error("支付失败");
-							},
-						});
+				orderCancel({
+					order_id: this.infoData.id,
+					refund_msg: this.refund_msg
+				}).then((res) => {
+					if (res.code == 1) {
+						tools.success(res.msg)
+						this.$refs.popupReason.close()
+						setTimeout(() => {
+							this.orderInfo(this.infoData.id)
+						}, 1500)
+						this.isAJAX = false;
 					} else {
+						tools.error(res.msg)
 						this.isAJAX = false;
-						tools.error("支付失败");
 					}
 				})
 			},
-			cancelOrder() {
-				// 外卖取消订单
-				uni.showModal({
-					title: '提示',
-					content: '是否取消订单?',
-					confirmText: '确定',
-					confirmColor: '#FB3D03',
-					success: (res) => {
-						if (res.confirm === true) {
-							if (this.isAJAX) {
-								return
-							}
-							this.isAJAX = true;
-							orderCancel({
-								order_id: this.infoData.id
-							}).then((res) => {
-								if (res.code == 1) {
-									tools.success(res.msg, 3000)
-									setTimeout(() => {
-										this.orderInfo(this.infoData.id)
-									}, 3000)
-									this.isAJAX = false;
-								} else {
-									tools.error(res.msg)
-									this.isAJAX = false;
-								}
-							})
-						}
-					}
-				});
-			},
 			openGoods() {
 				this.goodsShow = !this.goodsShow
 			},
@@ -528,4 +563,30 @@
 		height: auto;
 		transition: all .5s linear;
 	}
+	.popup-reason-box {
+		width: 100%;
+		height: 45vh;
+		overflow: auto;
+		border-radius: 20rpx 20rpx 0 0;
+		background: #fff;
+		padding: 24rpx 0 0;
+		box-sizing: border-box;
+	}
+	
+	.picker-view {
+		width: 100%;
+		// height: 70%;
+	}
+	
+	.picker-view-item {
+		// height: 90rpx;
+		line-height: 68rpx;
+		text-align: center;
+		background: #F5F5F5;
+	}
+	.pop-b {
+		height: 80rpx;
+		line-height: 80rpx;
+		border-radius: 20rpx;
+	}
 </style>

+ 2 - 0
pages-takeout/run-errands.vue

@@ -291,6 +291,8 @@
 						uni.redirectTo({
 							url: `/pages-takeout/run-errands-mod/pay-page?orderId=${res.data.order_id}`
 						});
+					} else {
+						tools.error(res.msg)
 					}
 				})
 			},

+ 38 - 30
pages-takeout/shop-mod/menu.vue

@@ -242,7 +242,7 @@
 
 			},
 			getShopGoodsSpec(item) {
-				console.log(item, 'item');
+				console.log(item,this.cartData, 'item');
 				shopGoodsSpec({
 					'goods_id': item.goods_id
 				}).then(res => {
@@ -257,14 +257,19 @@
 						this.popData.spec_key = ''
 						this.popData.num = 1
 						this.popData.spec_ids = []
+						console.log(this.popData, '走if');
+						this.$forceUpdate()
 					} else {
-						console.log('无');
+						console.log(this.popData,'无');
 						this.popData.num = 1;
 						// this.popData.price = item.price
 						if (this.cartData.goods_list.length > 0) {
 							this.cartData.goods_list.forEach(item => {
 								if (item.goods_spec_id === this.popData.spec_key) {
-									this.popData.num = this.selectedSpecification.goods_number
+									// this.popData.num = this.selectedSpecification.goods_number
+									this.popData.num = this.popData.payNum
+									console.log(this.popData, '走else');
+									this.$forceUpdate()
 								}
 							})
 						}
@@ -465,14 +470,15 @@
 				this.isAjax = true
 				if (type === 1) {
 					// 减
-					if (item.num > 0) {
-						// --item.num;
-						this.setSub(item, type);
+					--item.num;
+					if (item.num >= 0) {
+						this.addShoppingSave(item, item.num, type)
 					} else {
 						this.isAjax = false
 					}
 				} else if (type === 2) {
 					// 加
+					++item.num;
 					if (item.is_infinite === 0 && item.num >= item.stock) {
 						tools.error('商品库存' + item.stock + '件')
 						this.isAjax = false
@@ -480,7 +486,7 @@
 						tools.error('限购' + item.quota_num + '件')
 						this.isAjax = false
 					} else {
-						this.setSub(item, type);
+						this.addShoppingSave(item, item.num, type)
 					}
 
 				} else if (type === 3) {
@@ -507,31 +513,32 @@
 					console.log('1', this.popData.goods_id, this.shop_id, this.popData.goodsItem.category_id, this.popData
 						.spec_key, this.popData.num);
 					this.setShoppingSave()
-					// if (this.popData.goods_spec_id) {
-					// 	if (this.popData.is_infinite === 0 && this.popData.payNum > this.popData.stock) {
-					// 		tools.error('商品库存' + this.popData.stock + '件')
-					// 		this.popData.num = this.popData.stock
-					// 	} else if (this.popData.is_quota > 0 && this.popData.payNum > this.popData.quota_num) {
-					// 		tools.error('限购' + this.popData.quota_num + '件')
-					// 		this.popData.num = this.popData.quota_num
-					// 	} else {
-					// 		let cartKey = this.cartData.goods_list.findIndex(row => this.popData.goods_spec_id === row.goods_spec_id)
-					// 		console.log(cartKey)
-					// 		let addType = this.popData.num > 0 ? 2 : 1
-					// 		console.log('addType:' + addType)
-					// 		if (addType === 2 && cartKey < 0) {
-					// 			this.setShopIngAdd(this.popData.goods_id, this.popData.goodsItem.category_id, this.popData
-					// 				.goods_spec_id, this.popData.num)
-					// 		} else {
-					// 			this.setShopIngNumber(this.popData.goods_id, this.popData.goodsItem.category_id, type, this.popData.goods_spec_id, this.popData.num)
-					// 		}
-					// 	}
-					// } else {
-					// 	console.log('无规格信息')
-					// }
 					this.isAjax = false
 				}
 			},
+			addShoppingSave(item, num, type) {
+				shoppingSave({
+					type: 1,
+					goods_id: item.goods_id,
+					shop_id: this.shop_id,
+					category_id: item.category_id,
+					goods_spec_id: '',
+					number: num
+				}).then((res) => {
+					if (res.code === 1) {
+						if (type === 1) {
+							tools.success('操作成功')
+						} else {
+							tools.success(res.msg)
+						}
+						this.isAjax = false
+						this.getShopIngList()
+					} else {
+						this.isAjax = false
+						tools.error(res.msg)
+					}
+				})
+			},
 			gbPop() {
 				this.$refs.popupGG.close();
 			},
@@ -652,7 +659,8 @@
 							if (oldKey >= 0) {
 								this.popData.spec_ids.splice(oldKey, 1)
 								this.popData.spec_name.splice(oldKey, 1)
-								this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[groupKey].spec_list[attrKey].spec_price)
+								this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[groupKey]
+									.spec_list[attrKey].spec_price)
 								// if ( Number(info.spec_price) > 0 ) {
 								// 	this.popData.price = Number(this.popData.price) - Number(this.popData.spec_attr[groupKey].spec_list[attrKey].spec_price)
 								// }

+ 6 - 11
pages-takeout/shop.vue

@@ -255,6 +255,9 @@
 				isAjax: false
 			}
 		},
+		onShow() {
+			this.getShopIngList()
+		},
 		onLoad(e) {
 			if (e) {
 				console.log(e, '^^^^^^^');
@@ -313,6 +316,9 @@
 					item.goods_number = item.goods_number + 1
 				}else{
 					// 减
+					if(item.goods_number<0) {
+						return
+					}
 					item.goods_number = item.goods_number - 1
 				}
 				if (this.isAjax) {
@@ -331,17 +337,6 @@
 						this.isAjax = false
 						this.getShopIngList()
 					} 
-					// else if (res.code === 2) {
-					// 	tools.error(res.msg)
-					// 	this.isAjax = false
-					// 	this.getShopIngList()
-					// } else {
-					// 	tools.error(res.msg)
-					// 	this.isAjax = false
-					// 	setTimeout(() => {
-					// 		this.getShopIngList()
-					// 	}, 1400)
-					// }
 				}).catch(() => {
 					this.isAjax = false
 				})

+ 6 - 0
pages-takeout/takeout.vue

@@ -232,6 +232,12 @@
 			this.getTakeaway()
 		},
 		methods: {
+			goFeedback() {
+				// 问题反馈
+				uni.navigateTo({
+					url: '/pages-my/feedback'
+				})
+			},
 			searchClick() {
 				console.log("898989898998");
 				this.listData = []

+ 27 - 17
pages/index/index.vue

@@ -54,7 +54,8 @@
 			<view class="box-border-box plrb-24">
 				<view class="msg-box align-items-center box-border-box">
 					<image class="rb-bg" src="@/static/img/index/rb-bg.png" mode=""></image>
-					<image @click="toUrl(7)" class="xyrb-img mr-30 z-2" src="@/static/img/index/xyrb.png" mode=""></image>
+					<image @click="toUrl(7)" class="xyrb-img mr-30 z-2" src="@/static/img/index/xyrb.png" mode="">
+					</image>
 					<view class="flex-direction flex-justify-space z-2 h-100">
 						<view class="align-items-center" v-for="(item,i) in noticeList" :key="i"
 							@click="toNoticeDet(item)">
@@ -187,7 +188,8 @@
 				</view>
 			</view>
 			<!-- 类型选择 -->
-			<view class="type-list-box box-border-box display-flex" :style="{'top': (BarH+indexSearchHeight) + 'px'}">
+			<view class="type-list-box box-border-box display-flex"
+				:style="{'top': (BarH+indexSearchHeight) + 'px','background':bgckgroundType}">
 				<view class="type-item-box view-nowrap" v-for="(item,i) in typeList" :key="i"
 					@click="selectType(item.id)">
 					<view class="" :class="category_id==item.id?'fs-32 fc-3BB5FE fw-b':'fc-94969A fs-28'">
@@ -240,7 +242,8 @@
 								折扣</view>
 							<view v-show="info2.label === 4" class="label-box text-align-center bgc-4db8ff fs-24 fc-f">
 								招牌</view>
-							<image class="mb-18" :src="info2.goods_image" mode="aspectFill"></image>
+							<image class="mb-18 goods-items-img b-rad-20" :src="info2.goods_image" mode="">
+							</image>
 							<view class="mb-12 fw-600 text-overflow-ellipsis-one fs-24">{{info2.goods_name}}</view>
 							<view class="">
 								<span class="fs-24 fc-FD5D05 fw-b">¥</span>
@@ -510,15 +513,20 @@
 			if (e.scrollTop > 1) {
 				this.bgckgroundBox = '#fff';
 				this.bgckgroundSearch = '#fff';
-				if (e.scrollTop > 500) {
-					this.bgckgroundType = '#fff';
-				} else {
-					this.bgckgroundType = '';
-				}
+				// if (e.scrollTop > 500) {
+				// 	this.bgckgroundType = '#fff';
+				// } else {
+				// 	this.bgckgroundType = '';
+				// }
 			} else {
 				this.bgckgroundBox = 'transparent';
 				this.bgckgroundSearch = '';
-				this.bgckgroundType = '';
+				// this.bgckgroundType = '';
+			}
+			if (e.scrollTop > 1180) {
+				this.bgckgroundType = '#fff';
+			} else {
+				this.bgckgroundType = 'transparent';
 			}
 		},
 		onReachBottom() {
@@ -563,11 +571,11 @@
 					if (res.code === 1) {
 						if (res.data.msg_count > 0) {
 							uni.showTabBarRedDot({
-								index: 2
+								index: 3
 							})
 						} else {
 							uni.hideTabBarRedDot({
-								index: 2
+								index: 3
 							})
 						}
 						setInterval(() => {
@@ -1122,11 +1130,14 @@
 	.roll-pop {
 		position: relative;
 		width: 100vw;
+		z-index: 999999;
 		// height: 1000rpx;
 
 		.tc-top {
 			width: 100%;
 			height: 202rpx;
+			position: relative;
+			z-index: 999999;
 		}
 
 		.tc-bot {
@@ -1210,7 +1221,7 @@
 						height: 100%;
 						top: 0;
 						left: 0;
-						z-index: 100;
+						z-index: 0;
 						background: transparent;
 						border-width: 0;
 					}
@@ -1300,7 +1311,7 @@
 			}
 
 			.type-list-box {
-				width: calc(100% - 24rpx);
+				// width: calc(100% - 24rpx);
 				position: sticky;
 				left: 0;
 				// top: calc(var(BarH)px + 93rpx);
@@ -1344,7 +1355,7 @@
 					overflow-y: scroll;
 
 					.goods-items-list-box {
-						width: 33.3%;
+						width: 208rpx;
 						margin-right: 13rpx;
 						position: relative;
 
@@ -1358,10 +1369,9 @@
 							border-radius: 10rpx 2rpx 10rpx 2rpx;
 						}
 
-						image {
-							width: 201rpx;
+						.goods-items-img {
+							width: 208rpx;
 							height: 200rpx;
-							border-radius: 10rpx
 						}
 					}
 				}

+ 2 - 2
pages/me/index.vue

@@ -215,11 +215,11 @@
 					if (res.code === 1) {
 						if (res.data.msg_count > 0) {
 							uni.showTabBarRedDot({
-								index: 2
+								index: 3
 							})
 						} else {
 							uni.hideTabBarRedDot({
-								index: 2
+								index: 3
 							})
 						}
 					}