فهرست منبع

添加领取优惠券页面

xiaoxin 9 ماه پیش
والد
کامیت
0e2c7a2315
9فایلهای تغییر یافته به همراه266 افزوده شده و 242 حذف شده
  1. 8 8
      common/config.js
  2. 104 0
      my/index/coupon/index.vue
  3. 5 4
      my/index/shop/index2.vue
  4. 7 0
      pages.json
  5. 14 18
      pages/index/index.vue
  6. 66 112
      pages/index/shop/confirmOrder.vue
  7. 3 3
      pages/index/shop/index.vue
  8. 55 93
      pages/index/shop/payOrder.vue
  9. 4 4
      pages/order/takefood.vue

+ 8 - 8
common/config.js

@@ -1,12 +1,12 @@
-const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
-const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
-const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
-const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
+// const ROOTPATH = "https://mxys.chuanghai-tech.com/sqx_fast";
+// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/sqx_fast";
+// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss/websocket/"
+// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss/ordersChat/"
 
-// const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
-// const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
-// const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
-// const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
+const ROOTPATH = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+const ROOTPATH1 = "https://mxys.chuanghai-tech.com/wm-test/wm-api/sqx_fast";
+const ROOTPATH2 = "wss://mxys.chuanghai-tech.com/wss-test/websocket/"
+const ROOTPATH3 = "wss://mxys.chuanghai-tech.com/wss-test/ordersChat/"
 
 // const ROOTPATH = "http://192.168.161.190:8171/sqx_fast";
 // const ROOTPATH1 = "http://192.168.161.190:8171/sqx_fast";

+ 104 - 0
my/index/coupon/index.vue

@@ -0,0 +1,104 @@
+<template>
+	<view class="container">
+		<!-- 优惠券信息 -->
+		<view class="info">
+			<view class="info_name">外卖满减券</view>
+			<view class="info_term">满25可用</view>
+			<view class="info_box">
+				<text class="text">¥</text>
+				5
+			</view>
+			<view class="info_btn">立即领取</view>
+			<view class="info_time">2025.09.22 23:59 到期</view>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			imgtype1: ''
+		}
+	},
+	onLoad(option) {
+		if (option.scene) {
+			const scene = decodeURIComponent(option.scene)
+
+			let params = {}
+			// 分割成键值对数组
+			let pairs = scene.split('&')
+			// 遍历并解析每个键值对
+			pairs.forEach((pair) => {
+				const [key, value] = pair.split('=')
+				params[key] = value
+			})
+
+			let shopId = params.shopId
+			let couponId = params.couponId
+
+			console.log(shopId)
+			console.log(couponId)
+		}
+	},
+	methods: {}
+}
+</script>
+
+<style lang="scss" scoped>
+.container {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 100vw;
+	height: 100vh;
+	background-image: url('https://mxys.chuanghai-tech.com/wmfile/20250926/a27624ab752f4623ab069c555e497531.png');
+	background-size: 100% 100%;
+
+	.info {
+		margin-top: 4vh;
+		width: 42vw;
+		height: 30vh;
+		color: #fd322e;
+
+		.info_name {
+			font-size: 36rpx;
+		}
+
+		.info_term {
+			margin-top: 10rpx;
+			font-size: 32rpx;
+		}
+
+		.info_box {
+			margin-left: 90rpx;
+			font-size: 150rpx;
+
+			.text {
+				margin-right: 35rpx;
+				font-size: 60rpx;
+			}
+		}
+
+		.info_btn {
+			display: flex;
+			align-items: center;
+			justify-content: center;
+			margin: 10rpx 0 20rpx 35rpx;
+			width: 262rpx;
+			height: 74rpx;
+			font-size: 40rpx;
+			color: #fff;
+			border-radius: 32rpx;
+			background-color: #fd322e;
+		}
+
+		.info_time {
+			width: 100%;
+			text-align: center;
+			color: #000;
+			font-size: 24rpx;
+		}
+	}
+}
+</style>

+ 5 - 4
my/index/shop/index2.vue

@@ -731,6 +731,7 @@ export default {
 		}
 	},
 	onLoad(option) {
+		// console.log(option)
 		this.XCXIsSelect = this.$queue.getData('XCXIsSelect')
 		if (this.XCXIsSelect == '否') {
 			// this.getGuize()
@@ -789,7 +790,7 @@ export default {
 			uni.getLocation({
 				type: 'gcj02', //返回可以用于uni.openLocation的经纬度
 				success: (res) => {
-					console.log(res, '经纬度')
+					// console.log(res, '经纬度')
 					this.lat = res.latitude
 					this.lng = res.longitude
 					this.getData()
@@ -823,7 +824,7 @@ export default {
 		//发送给朋友
 		return {
 			title: this.shopDet.shopName,
-			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId + '&shopTypeId=' + this.shopDet.shopTypeId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -831,7 +832,7 @@ export default {
 		//分享到朋友圈
 		return {
 			title: this.shopDet.shopName,
-			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId + '&shopTypeId=' + this.shopDet.shopTypeId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -1018,7 +1019,7 @@ export default {
 					uni.setNavigationBarTitle({
 						title: this.shopDet.shopName
 					})
-					if ((urlreq = '/app/goods/selectGoodsClassifyList')) {
+					if (urlreq == '/app/goods/selectGoodsClassifyList') {
 						this.getSupermarketGoodsList(this.dataList[0].classifyId)
 					}
 				}

+ 7 - 0
pages.json

@@ -177,6 +177,13 @@
 					}
 				},
 				{
+					"path": "index/coupon/index",
+					"style": {
+						"navigationBarTitleText": "",
+						"navigationStyle": "custom"
+					}
+				},
+				{
 					"path": "address/add",
 					"style": {
 						"navigationBarTitleText": "添加地址"

+ 14 - 18
pages/index/index.vue

@@ -1201,14 +1201,14 @@
 				let openTime1 = this.shop.businessHours.split(':')[1] //开始分钟
 				let closeTime = this.shop.lockHours.split(':')[0] //结束小时
 				let closeTime1 = this.shop.lockHours.split(':')[1] //结束分钟.
-				console.log(hours)
-				console.log(minute)
-				console.log(openTime)
-				console.log(openTime1)
-
-				console.log(closeTime)
-				console.log(closeTime1)
-				console.log(minute >= closeTime1)
+				// console.log(hours)
+				// console.log(minute)
+				// console.log(openTime)
+				// console.log(openTime1)
+
+				// console.log(closeTime)
+				// console.log(closeTime1)
+				// console.log(minute >= closeTime1)
 				if (hours < openTime) {
 					this.hintShow = true
 					return
@@ -1223,17 +1223,13 @@
 					return
 				}
 
-				console.log(url)
+				// console.log(url)
 				let items = encodeURIComponent(JSON.stringify(shuzu));
-				// if (this.userId) {
-					uni.navigateTo({
-						url:'/pages/index/shop/index?shopId='+url+'&huoListss='+items+'&shopTypeId='+e.shopTypeId
-					})
-				// } else {
-				// 	uni.navigateTo({
-				// 		url: '/pages/public/login'
-				// 	})
-				// }
+				
+				uni.navigateTo({
+					url:'/pages/index/shop/index?shopId='+url+'&huoListss='+items+'&shopTypeId='+e.shopTypeId
+				})
+				
 			},
 			defaultAddress() {
 				if (uni.getStorageSync('city')) {

+ 66 - 112
pages/index/shop/confirmOrder.vue

@@ -323,7 +323,23 @@ export default {
 			shopDet: '',
 			isThrottle: true, //防抖,待支付结果返回后继续
 			storeCommodityId: 0,
-			openLists: [],
+			openLists: [
+				{
+					image: '../../../static/images/my/weixin.png',
+					text: '微信',
+					id: 2
+				}
+				// {
+				// 	image: '../../../static/images/my/zhifubao.png',
+				// 	text: '支付宝',
+				// 	id: 3
+				// },
+				// {
+				// 	image: '../../../static/images/my/jinbi.png',
+				// 	text: '零钱',
+				// 	id: 1
+				// }
+			],
 			openWay: 2,
 			orderId: '',
 			page: 1,
@@ -399,60 +415,9 @@ export default {
 		if (option.showReach) {
 			this.showReach = option.showReach
 		}
-		// #ifdef APP
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/zhifubao.png',
-			// 	text: '支付宝',
-			// 	id: 3
-			// },
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
-		// #endif
 
 		// #ifdef MP-WEIXIN
 		this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
-		// #endif
-
-		// #ifdef H5
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/zhifubao.png',
-			// 	text: '支付宝',
-			// 	id: 3
-			// },
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
 		// #endif
 
 		this.shopId = option.shopId
@@ -469,33 +434,18 @@ export default {
 			this.status = option.status
 		}
 
-		// #ifndef H5
-		uni.getLocation({
-			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: function (res) {
-				this.lat = res.latitude
-				this.lng = res.longitude
-			}
+		uni.showLoading({
+			title: '加载中...',
+			mask: true // 是否显示透明蒙层,防止触摸穿透
 		})
-		this.getShopDet(this.shopId)
-		// #endif
-		// #ifdef H5
+
 		uni.getLocation({
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: function (res) {
+			success: (res) => {
 				this.lat = res.latitude
 				this.lng = res.longitude
 			}
 		})
-
-		this.getShopDet(this.shopId)
-		// #endif
-
-		uni.showLoading({
-			title: '加载中...',
-			mask: true // 是否显示透明蒙层,防止触摸穿透
-		})
-		// this.getOrderList();
 		this.getAddressList()
 	},
 	onUnload() {
@@ -506,13 +456,16 @@ export default {
 	},
 	onShow() {
 		this.getMsgData()
-		console.log(uni.getStorageSync('addressId'), '地址id')
 		this.addressId = this.addressId ? this.addressId : uni.getStorageSync('addressId')
 		if (this.addressId) {
 			console.log(this.addressId, '地址id')
 			this.address = {}
 			this.getAddressDet(this.addressId)
 		}
+
+		// console.log(this.shopId, 'this.shopId')
+		this.getShopDet(this.shopId)
+
 		// 设置定时器
 		this.timer = setInterval(() => {
 			// 定时器执行的操作
@@ -612,7 +565,7 @@ export default {
 						uni.showModal({
 							title: '提示',
 							content: '当前时间段无骑手配送,现在下单,最早将于明日' + teshu + ':00' + '送达',
-							success: function (res) {
+							success: (res) => {
 								if (res.confirm) {
 								} else if (res.cancel) {
 								}
@@ -637,7 +590,7 @@ export default {
 						uni.showModal({
 							title: '提示',
 							content: '当前时间段无骑手配送,现在下单,最早将于今日' + teshu + ':00' + '送达',
-							success: function (res) {
+							success: (res) => {
 								if (res.confirm) {
 								} else if (res.cancel) {
 								}
@@ -959,7 +912,7 @@ export default {
 							uni.showModal({
 								title: '提示',
 								content: '当前选择的优惠券已过期,请重新选择',
-								success: function (res) {
+								success: (res) => {
 									if (res.confirm) {
 										this.coupon = ''
 									} else if (res.cancel) {
@@ -1004,7 +957,7 @@ export default {
 							uni.showModal({
 								title: '提示',
 								content: '当前选择的优惠活动已过期,请重新选择',
-								success: function (res) {
+								success: (res) => {
 									if (res.confirm) {
 										this.huodong = ''
 									} else if (res.cancel) {
@@ -1038,12 +991,11 @@ export default {
 		//拼单支付成功取消订单
 
 		cancelPinDan() {
-			let that = this
-			// if (that.orderId) {
+			// if (this.orderId) {
 			// 	let data = {
-			// 		orderId: that.orderId
+			// 		orderId: this.orderId
 			// 	};
-			// 	that.$Request.post('/app/order/deleteOrder', data).then(res => {
+			// 	this.$Request.post('/app/order/deleteOrder', data).then(res => {
 			// 		if (res.code == 0) {
 			// 			uni.removeStorageSync('orderId');
 			// 		}
@@ -1081,6 +1033,7 @@ export default {
 					this.dataList = res.data.pageUtils.list[0]
 
 					if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
+						this.dabaoMoney = 0
 						this.dataList.orderGoodsList[0].forEach((res) => {
 							res.goodsPicture = res.goodsPicture.split(',')
 							this.dabaoMoney += res.goodsPack * res.goodsNum
@@ -1104,6 +1057,12 @@ export default {
 					}
 
 					this.totalPrice = res.data.money
+
+					console.log(this.totalPrice)
+					console.log(this.paotuiMoney)
+					console.log(this.dabaoMoney)
+					console.log(this.address.insideDeliveryFee)
+
 					if (this.orderType == 2) {
 						this.totalPrice1 = parseFloat(
 							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
@@ -1204,7 +1163,6 @@ export default {
 			if (this.isThrottle == false) {
 				return
 			}
-			let that = this
 
 			if (this.isTrue && this.orderType == 2) {
 				uni.showToast({
@@ -1246,17 +1204,17 @@ export default {
 					console.log(res, '结果')
 					if (res.code == 0) {
 						uni.hideLoading()
-						that.$queue.showToast('支付成功')
-						that.cancelPinDan()
-						setTimeout(function () {
-							that.isThrottle = true
+						this.$queue.showToast('支付成功')
+						this.cancelPinDan()
+						setTimeout(() => {
+							this.isThrottle = true
 							uni.switchTab({
 								url: '/pages/order/index'
 							})
 						}, 1000)
 					} else {
-						that.$queue.showToast(res.msg)
-						that.isThrottle = true
+						this.$queue.showToast(res.msg)
+						this.isThrottle = true
 					}
 				})
 			} else if (this.openWay == 2) {
@@ -1335,7 +1293,7 @@ export default {
 					if (res.code == 0) {
 						this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
 					} else {
-						that.isThrottle = true
+						this.isThrottle = true
 					}
 				})
 				// #endif
@@ -1529,30 +1487,28 @@ export default {
 			}
 		},
 		setPayment(name, order) {
-			let that = this
-
 			console.log(777777777, name, order)
 			uni.requestPayment({
 				provider: name,
 				orderInfo: order, //微信、支付宝订单数据
-				success: function (res) {
+				success: (res) => {
 					uni.hideLoading()
-					that.cancelPinDan()
+					this.cancelPinDan()
 					uni.showLoading({
 						title: '支付成功',
 						icon: 'none'
 					})
-					setTimeout(function () {
-						that.isThrottle = true
+					setTimeout(() => {
+						this.isThrottle = true
 						uni.navigateBack()
 					}, 1000)
 				},
-				fail: function (err) {
+				fail: (err) => {
 					uni.hideLoading()
-					that.isThrottle = true
+					this.isThrottle = true
 				},
-				complete() {
-					that.isThrottle = true
+				complete: () => {
+					this.isThrottle = true
 					uni.hideLoading()
 				}
 			})
@@ -1581,22 +1537,21 @@ export default {
 		},
 		// 获取地址列表
 		getAddressList() {
-			let that = this
 			let data = {
 				page: 1,
 				limit: 100
 			}
-			that.$Request.get('/app/address/selectAddressList', data).then((res) => {
+			this.$Request.get('/app/address/selectAddressList', data).then((res) => {
 				console.log(res, 741852)
-				if (res.code == 0) {
-					that.address = res.data.list[0] ? res.data.list[0] : {}
+				if (res.code == 0 && res.data.list.length) {
+					this.address = res.data.list[0]
 					res.data.list.forEach((ret) => {
 						if (ret.addressDefault == 1) {
-							that.address = ret
+							this.address = ret
 						}
 					})
 
-					console.log(that.address, '我的地址列表460777')
+					console.log(this.address, '我的地址列表460777')
 
 					if (this.address.insideAddressId) {
 						this.getInsideDeliveryFee(this.address.insideAddressId)
@@ -1638,20 +1593,19 @@ export default {
 			// 	url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
 			// });
 
-			let that = this
-			let lati = parseFloat(that.dataList.shopLat)
-			let longi = parseFloat(that.dataList.shopLng)
+			let lati = parseFloat(this.dataList.shopLat)
+			let longi = parseFloat(this.dataList.shopLng)
 			uni.authorize({
 				scope: 'scope.userLocation',
-				success(res) {
+				success: (res) => {
 					uni.openLocation({
-						name: that.dataList.shopName,
+						name: this.dataList.shopName,
 						latitude: lati,
 						longitude: longi,
-						success: function () {}
+						success: () => {}
 					})
 				},
-				fail(err) {}
+				fail: (err) => {}
 			})
 		},
 		// 打电话

+ 3 - 3
pages/index/shop/index.vue

@@ -796,7 +796,7 @@ export default {
 		//发送给朋友
 		return {
 			title: this.shopDet.shopName,
-			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId + '&shopTypeId=' + this.shopDet.shopTypeId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -804,7 +804,7 @@ export default {
 		//分享到朋友圈
 		return {
 			title: this.shopDet.shopName,
-			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId,
+			path: '/my/index/shop/index2?shopId=' + this.shopDet.shopId + '&shopTypeId=' + this.shopDet.shopTypeId,
 			imageUrl: this.shopDet.shopCover
 		}
 	},
@@ -995,7 +995,7 @@ export default {
 					})
 					uni.hideLoading()
 
-					if ((urlreq = '/app/goods/selectGoodsClassifyList')) {
+					if (urlreq == '/app/goods/selectGoodsClassifyList') {
 						this.getSupermarketGoodsList(this.dataList[0].classifyId)
 					}
 				}

+ 55 - 93
pages/index/shop/payOrder.vue

@@ -305,7 +305,23 @@ export default {
 		return {
 			userMoney: 0,
 			storeCommodityId: 0,
-			openLists: [],
+			openLists: [
+				{
+					image: '../../../static/images/my/weixin.png',
+					text: '微信',
+					id: 2
+				}
+				// {
+				// 	image: '../../../static/images/my/zhifubao.png',
+				// 	text: '支付宝',
+				// 	id: 3
+				// },
+				// {
+				// 	image: '../../../static/images/my/jinbi.png',
+				// 	text: '零钱',
+				// 	id: 1
+				// }
+			],
 			openWay: 2,
 			hintShow: true,
 			page: 1,
@@ -374,61 +390,10 @@ export default {
 		}
 	},
 	onLoad(option) {
-		// #ifdef APP
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/zhifubao.png',
-			// 	text: '支付宝',
-			// 	id: 3
-			// },
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
-		// #endif
-
 		// #ifdef MP-WEIXIN
 		this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
 		// #endif
 
-		// #ifdef H5
-		this.openLists = [
-			{
-				image: '../../../static/images/my/weixin.png',
-				text: '微信',
-				id: 2
-			}
-			// {
-			// 	image: '../../../static/images/my/zhifubao.png',
-			// 	text: '支付宝',
-			// 	id: 3
-			// },
-			// {
-			// 	image: '../../../static/images/my/jinbi.png',
-			// 	text: '零钱',
-			// 	id: 1
-			// }
-		]
-		// #endif
 		this.orderId = option.orderId
 		this.orderType = option.orderType
 		if (option.shopId) {
@@ -440,21 +405,18 @@ export default {
 			mask: true // 是否显示透明蒙层,防止触摸穿透
 		})
 
-		this.getShopDet(this.shopId)
-
-		// this.getOrderList()
-		this.getAddressList()
-		// this.getQishou()
-		let that = this
 		//获取店铺信息
 		uni.getLocation({
 			type: 'gcj02', //返回可以用于uni.openLocation的经纬度
-			success: function (res) {
-				console.log(res, '经纬度')
-				that.lat = res.latitude
-				that.lng = res.longitude
+			success: (res) => {
+				// console.log(res, '经纬度')
+				this.lat = res.latitude
+				this.lng = res.longitude
 			}
 		})
+
+		this.getAddressList()
+		// this.getQishou()
 	},
 	onUnload() {
 		// 页面销毁时清除定时器
@@ -468,6 +430,8 @@ export default {
 		if (this.addressId) {
 			this.getAddressDet(this.addressId)
 		}
+
+		this.getShopDet(this.shopId)
 		// 设置定时器
 		this.timer = setInterval(() => {
 			// 定时器执行的操作
@@ -1003,6 +967,7 @@ export default {
 					// this.dataList.orderGoodsList[0].goodsPicture = this.dataList.orderGoodsList[0].goodsPicture.split(',')
 					// console.log(this.dataList.orderGoodsList)
 					if (this.dataList) {
+						this.dabaoMoney = 0
 						this.dataList.orderGoodsList.forEach((res) => {
 							res.goodsPicture = res.goodsPicture.split(',')
 							this.dabaoMoney += res.goodsPack * res.goodsNum
@@ -1066,7 +1031,7 @@ export default {
 			if (this.isThrottle == false) {
 				return
 			}
-			let that = this
+
 			if (this.isTrue && this.orderType == 2) {
 				uni.showToast({
 					title: '超出配送范围',
@@ -1104,16 +1069,16 @@ export default {
 				this.$Request.post('/app/wxPay/balanceOrder', data).then((res) => {
 					if (res.code == 0) {
 						uni.hideLoading()
-						that.$queue.showToast('支付成功')
-						setTimeout(function () {
-							that.isThrottle = true
+						this.$queue.showToast('支付成功')
+						setTimeout(() => {
+							this.isThrottle = true
 							uni.switchTab({
 								url: '/pages/order/index'
 							})
 						}, 1000)
 					} else {
-						that.isThrottle = true
-						that.$queue.showToast(res.msg)
+						this.isThrottle = true
+						this.$queue.showToast(res.msg)
 					}
 				})
 			} else if (this.openWay == 2) {
@@ -1134,7 +1099,7 @@ export default {
 					if (res.code == 0) {
 						this.callPay(res.data)
 					} else {
-						that.isThrottle = true
+						this.isThrottle = true
 						uni.showToast({
 							title: res.msg,
 							icon: 'none'
@@ -1189,7 +1154,7 @@ export default {
 					if (res.code == 0) {
 						this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
 					} else {
-						that.isThrottle = true
+						this.isThrottle = true
 					}
 				})
 				// #endif
@@ -1204,7 +1169,7 @@ export default {
 				}
 				this.$Request.post('/app/wxPay/wxPayJsApiOrder', data).then((res) => {
 					this.showpay = false
-					that.isThrottle = true
+					this.isThrottle = true
 					const div = document.createElement('div')
 					div.innerHTML = res.data //此处form就是后台返回接收到的数据
 					document.body.appendChild(div)
@@ -1373,7 +1338,6 @@ export default {
 			)
 		},
 		isCheckPay(code, name, order) {
-			let that = this
 			if (code == 0) {
 				console.log('999999999999')
 				this.setPayment(name, order)
@@ -1382,32 +1346,32 @@ export default {
 				uni.showToast({
 					title: '支付信息有误'
 				})
-				that.isThrottle = true
+				this.isThrottle = true
 			}
 		},
 		setPayment(name, order) {
 			console.log(777777777, name, order)
-			let that = this
+
 			uni.requestPayment({
 				provider: name,
 				orderInfo: order, //微信、支付宝订单数据
-				success: function (res) {
+				success: (res) => {
 					uni.hideLoading()
 					uni.showLoading({
 						title: '支付成功',
 						icon: 'none'
 					})
-					setTimeout(function () {
-						that.isThrottle = true
+					setTimeout(() => {
+						this.isThrottle = true
 						uni.navigateBack()
 					}, 1000)
 				},
-				fail: function (err) {
-					that.isThrottle = true
+				fail: (err) => {
+					this.isThrottle = true
 					uni.hideLoading()
 				},
-				complete() {
-					that.isThrottle = true
+				complete: () => {
+					this.isThrottle = true
 					uni.hideLoading()
 				}
 			})
@@ -1437,17 +1401,16 @@ export default {
 		},
 		// 获取地址列表
 		getAddressList() {
-			let that = this
 			let data = {
 				page: 1,
 				limit: 100
 			}
-			that.$Request.get('/app/address/selectAddressList', data).then((res) => {
-				if (res.code == 0) {
-					that.address = res.data.list[0] ? res.data.list[0] : {}
+			this.$Request.get('/app/address/selectAddressList', data).then((res) => {
+				if (res.code == 0 && res.data.list.length) {
+					this.address = res.data.list[0]
 					res.data.list.forEach((ret) => {
 						if (ret.addressDefault == 1) {
-							that.address = ret
+							this.address = ret
 						}
 					})
 					if (this.address.insideAddressId) {
@@ -1455,7 +1418,7 @@ export default {
 					} else {
 						this.getInsideDeliveryFee(0)
 					}
-					// console.log(that.address, '我的地址列表460777')
+					// console.log(this.address, '我的地址列表460777')
 					if (JSON.stringify(this.address) != '{}') {
 						this.getDistance()
 					}
@@ -1477,17 +1440,16 @@ export default {
 		},
 		// 点击调起地图查看位置
 		goMap() {
-			let that = this
-			let lati = parseFloat(that.dataList.shopLat)
-			let longi = parseFloat(that.dataList.shopLng)
+			let lati = parseFloat(this.dataList.shopLat)
+			let longi = parseFloat(this.dataList.shopLng)
 			uni.authorize({
 				scope: 'scope.userLocation',
-				success(res) {
+				success: (res) => {
 					uni.openLocation({
-						name: that.dataList.shopName,
+						name: this.dataList.shopName,
 						latitude: lati,
 						longitude: longi,
-						success: function () {}
+						success: () => {}
 					})
 				},
 				fail(err) {}

+ 4 - 4
pages/order/takefood.vue

@@ -4,15 +4,15 @@
 		<view class="tosend" v-if="dataDet">
 			<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 1">待取餐</view>
 			<view class="tosend_text" v-if="dataDet.status == 3 && dataDet.orderType == 2">配送中</view>
-			<view class="order_name" v-if="dataDet.status == 3 && dataDet.indentState == 2">待骑手接单</view>
+			<view class="order_name" v-if="dataDet.status == 3 && dataDet.indentState == 2 && dataDet.orderType == 2">待骑手接单</view>
 			<view class="order_name" v-if="dataDet.status == 6 && dataDet.indentState == 2">制作中</view>
-			<view class="order_name" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 3">骑手已接单</view>
-			<view class="order_name" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 4">骑手配送中</view>
+			<view class="order_name" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 3 && dataDet.orderType == 2">骑手已接单</view>
+			<view class="order_name" v-if="(dataDet.status == 3 || dataDet.status == 6) && dataDet.indentState == 4 && dataDet.orderType == 2">骑手配送中</view>
 			<view class="tosend_text" v-if="dataDet.status == 4">已完成</view>
 			<view class="tosend_text" v-if="dataDet.status == 5">已取消</view>
 			<view class="tosend_text" v-if="dataDet.status == 7">待接单</view>
 			<view class="tosend_text" v-if="dataDet.status == 8">已退款</view>
-			<view class="tosend_text" v-if="dataDet.status == 13">待骑手接单</view>
+			<!-- <view class="tosend_text" v-if="dataDet.status == 13">待骑手接单</view> -->
 			<view class="tosend_text" v-if="dataDet.status == 0">待结算</view>
 
 			<view v-if="dataDet.status == 0" style="font-size: 40rpx; font-weight: bold; padding-left: 3%">