xiaoxin 9 месяцев назад
Родитель
Сommit
80d230391c
6 измененных файлов с 1063 добавлено и 951 удалено
  1. 88 26
      my/address/add.vue
  2. 333 335
      my/address/index.vue
  3. 567 549
      pages/index/selectCampus.vue
  4. 45 21
      pages/index/shop/confirmOrder.vue
  5. 26 16
      pages/index/shop/payOrder.vue
  6. 4 4
      pages/order/takefood.vue

+ 88 - 26
my/address/add.vue

@@ -10,18 +10,13 @@
 				<input placeholder="请输入联系电话" name="input" v-model="form.userPhone" maxlength="11"></input>
 			</view>
 			
-			<view class="cu-form-group">
-				<view class="title">是否使用校内地址</view>
-				<switch :checked="form.isInner" @change="switchChange" />
-			</view>
-			
 			<view v-if="form.isInner">
 				<view class="cu-form-group">
 					<view class="title">选择骑手站点</view>
 					<view style="width: 50vw;text-align: end;">
-						<picker style="padding-right: 0;" @change="bindPickerChange_station" :value="stationIndex" :range="stationList">
+						<picker style="padding-right: 0;" @change="bindPickerChange_station" :value="stationIndex" range-key="stationName" :range="stationList">
 							<view :style="stationIndex==null?'color:#aaa':''">
-								{{stationIndex==null?"请选择骑手站点":stationList[stationIndex]}}
+								{{stationIndex==null?"请选择骑手站点":stationList[stationIndex].stationName}}
 							</view>
 						</picker>
 					</view>
@@ -30,23 +25,23 @@
 				<view class="cu-form-group">
 					<view class="title">选择地址</view>
 					<view style="width: 50vw;text-align: end;">
-						<picker style="padding-right: 0;" @change="bindPickerChange" :value="addressIndex" :range="addressList">
+						<picker style="padding-right: 0;" @change="bindPickerChange" :value="addressIndex" range-key="addressDetail" :range="addressList">
 							<view :style="addressIndex==null?'color:#aaa':''">
-								{{addressIndex==null?"请选择地址":addressList[addressIndex]}}
+								{{addressIndex==null?"请选择地址":addressList[addressIndex].addressDetail}}
 							</view>
 						</picker>
 					</view>
 				</view>
-				<view class="cu-form-group">
+				<view class="cu-form-group" v-if="form.insideDeliveryFee">
 					<view class="title">当前特殊地址跑腿费:</view>
 					<view style="color: #5E9289;">
-						¥1.00
+						¥{{form.insideDeliveryFee}}
 					</view>
 				</view>
 				<view class="cu-form-group">
 					<view class="title">备注信息</view>
 					<view style="width: 60vw;height: 200rpx;border-radius: 12rpx;background-color: #F5F5F5;">
-						<textarea style="margin: 0; padding: 12rpx;height: 200rpx;"/>
+						<textarea v-model="form.remark" style="margin: 0; padding: 12rpx;height: 200rpx;"/>
 					</view>
 				</view>
 			</view>
@@ -100,7 +95,10 @@
 					addressDefault: 0, //默认地址 0不默认 1默认
 					lng: '',
 					lat: '',
-					isInner:false
+					isInner:false,
+					insideAddressId:'',
+					insideDeliveryFee:0,
+					remark:""
 				},
 				region: '',
 
@@ -109,10 +107,12 @@
 				longitude: '',
 				XCXIsSelect: '是',
 				content: '',
-				addressList: ['中国', '美国美国美国美国美国美国美国美国美国美国美国美', '巴西', '日本'],
+				addressList: [],
 				addressIndex: null,
-				stationList: ['黄家湖', '墨轩湖'],
+				stationList: [],
 				stationIndex: null,
+				stationId:'',
+				deliveryFee:0
 			}
 		},
 		onLoad(option) {
@@ -127,6 +127,8 @@
 					title: '添加地址'
 				});
 			}
+			this.getSetData()
+			this.getStationData()
 			this.id = option.id
 			if (option.id) {
 				this.getAddressDet(option.id)
@@ -136,15 +138,54 @@
 			}
 		},
 		methods: {
+			getSetData(){
+				this.$Request.get("/app/common/type/442").then(res => {
+					if(res.code == 0){
+						if(res.data.value == '1'){
+							this.form.isInner = true
+						}else{
+							this.form.isInner = false
+						}
+					}
+				});
+			},
+			getStationData(){
+				this.$Request.get("/app/riderStation/stationList").then(res => {
+					// console.log(res);
+					if(res.code == 0){
+						this.stationList = res.data
+					}
+				});
+			},
 			bindPickerChange_station(e){
 				this.stationIndex = e.detail.value
+				this.stationId = this.stationList[this.stationIndex].id
+			    this.form.address =this.stationList[this.stationIndex].stationName
+				this.getAddress(this.stationId ,false)
+			},
+			getAddress(stationId ,type){
+				this.$Request.get(`/app/inside-address/list/${stationId}`).then(res => {
+					// console.log(res);
+					if(res.code == 0){
+						this.addressList = res.data
+						
+						if(type){
+							this.addressIndex = this.addressList.findIndex((ele)=>ele.id == this.form.insideAddressId)
+						}
+					}
+				});
 			},
 			bindPickerChange(e){
 				this.addressIndex = e.detail.value
-				this.form.address = this.addressList[this.addressIndex]
-			},
-			switchChange(e){
-				this.form.isInner = e.detail.value
+				this.form.lng = this.addressList[this.addressIndex].lng
+				this.form.lat = this.addressList[this.addressIndex].lat
+				
+				this.form.province = this.addressList[this.addressIndex].province
+				this.form.city = this.addressList[this.addressIndex].city
+				this.form.district = this.addressList[this.addressIndex].district
+				this.form.addressDetail = this.form.province + this.form.city + this.form.district + this.addressList[this.addressIndex].addressDetail
+				this.form.insideAddressId =  this.addressList[this.addressIndex].id
+				this.form.insideDeliveryFee = this.addressList[this.addressIndex].deliveryFee
 			},
 			getGuize() {
 				this.$Request.getT('/app/common/type/237').then(res => {
@@ -180,8 +221,7 @@
 								that.form.province = res.data.province
 								that.form.city = res.data.city
 								that.form.district = res.data.district
-								that.form.address = res.data.province + res.data.city + res.data
-									.district
+								that.form.address = res.data.province + res.data.city + res.data.district
 							}
 						});
 					},fail(e) {
@@ -239,7 +279,9 @@
 					})
 					return
 				}
-				if (this.form.userPhone.length<=10) {
+				
+				let phonereg = /^1[3-9]\d{9}$/
+				if (!phonereg.test(this.form.userPhone)) {
 					uni.showToast({
 						title: '请输入正确联系电话',
 						icon: 'none'
@@ -250,7 +292,14 @@
 				if(this.form.isInner){
 					if (!this.form.address) {
 						uni.showToast({
-							title: '请选择地址',
+							title: '请选择骑手站点',
+							icon: 'none'
+						})
+						return
+					}
+					if (!this.form.addressDetail) {
+						uni.showToast({
+							title: '请选择详细地址',
 							icon: 'none'
 						})
 						return
@@ -273,6 +322,7 @@
 				}
 				
 				this.form.addressDefault = this.form.addressDefault ? 1 : 0
+				console.log(this.form);
 				this.$Request.postJson("/app/address/insertAddress", this.form).then(res => {
 					console.log(res,'地址')
 					if (res.code == 0) {
@@ -329,8 +379,11 @@
 					addressDefault: this.form.addressDefault ? 1 : 0,
 					lng: this.form.lng,
 					lat: this.form.lat,
+					insideAddressId:this.form.insideAddressId
 				}
+				console.log(data);
 				this.$Request.postJson("/app/address/updateAddress", data).then(res => {
+					console.log(res);
 					if (res.code == 0) {
 						uni.showToast({
 							title: '修改成功',
@@ -348,6 +401,7 @@
 					addressId: e,
 				}
 				this.$Request.get("/app/address/selectAddressById",data).then(res => {
+					console.log(res);
 					if (res.code == 0) {
 						this.form.addressId = res.data.addressId
 						this.form.userName = res.data.userName
@@ -357,9 +411,17 @@
 						this.form.lng = res.data.lng
 						this.form.lat = res.data.lat
 						this.form.addressDefault = res.data.addressDefault
-						that.form.province = res.data.province
-						that.form.city = res.data.v
-						that.form.district = res.data.district
+						this.form.province = res.data.province
+						this.form.city = res.data.city
+						this.form.district = res.data.district
+						this.form.insideAddressId = res.data.insideAddressId
+						this.form.insideDeliveryFee = res.data.insideDeliveryFee
+						this.form.remark = res.data.remark
+						
+						this.stationIndex = this.stationList.findIndex((ele)=>ele.id == res.data.stationId)
+						if(this.stationIndex){
+							this.getAddress(res.data.stationId ,true)
+						}
 					}
 				});
 			}

+ 333 - 335
my/address/index.vue

@@ -1,335 +1,333 @@
-<template>
-	<view class="address" v-if="XCXIsSelect=='是'">
-		<view class="bg-white radius margin-sm" v-for="(item, index) in list" :key="index">
-			<view class="content_top" @click="goBack(item)">
-				<view class="content_part1">
-					<view class="content_name">{{item.userName}}</view>
-					<view class="content_number">
-						{{item.userPhone}}
-					</view>
-					<view class="content_btn" v-if="item.addressDefault">默认</view>
-				</view>
-				<view class="content_part2">
-					{{item.province}}{{item.city}}{{item.district}}{{item.addressDetail}}
-				</view>
-			</view>
-			<!-- 线条 -->
-			<!-- <u-line color="#c1c1c1" border-style="solid" direction="row"></u-line> -->
-			<view class="content_bottom">
-				<view class="bottom_right">
-					<view class="write" @click.stop="update(item)">
-						<image src="../static/address/write.png"></image>
-					</view>
-					<view class="dete" @click.stop="del(item)">
-						<image src="../static/address/dete.png"></image>
-					</view>
-				</view>
-			</view>
-		</view>
-		<empty v-if="list.length == 0"></empty>
-
-		<view style="height: 100rpx;"></view>
-		<!-- 添加收货地址 -->
-		<view class="btn">
-			<view class="address_push" @click="addAddress">添加收货地址</view>
-		</view>
-
-	</view>
-</template>
-
-<script>
-	import empty from '@/components/empty.vue'
-	export default {
-		components: {
-			empty
-		},
-		data() {
-			return {
-				list: [],
-				checked: false,
-				page: 1,
-				limit: 10,
-				add: 0,
-				addressType: '',
-				totalCount: 0,
-				XCXIsSelect: '是',
-			}
-		},
-		onLoad(option) {
-			this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是';
-			if (this.XCXIsSelect == '否') {
-				this.getGuize()
-				uni.setNavigationBarTitle({
-					title: '隐私政策'
-				});
-			} else {
-				uni.setNavigationBarTitle({
-					title: '地址管理'
-				});
-			}
-			this.add = option.add ? option.add : 0
-			
-			if (option.addressType) {
-				this.addressType = option.addressType
-			}
-		},
-		onShow() {
-			this.page = 1
-			this.getAddressList()
-		},
-		methods: {
-			bindOrdersure() {
-				uni.navigateTo({
-					url: '/pages/order_sure/order_sure'
-				})
-			},
-			// 添加地址
-			addAddress() {
-				uni.navigateTo({
-					url: '/my/address/add?page=2'
-				})
-			},
-			// 获取地址列表
-			getAddressList() {
-				let data = {
-					page: this.page,
-					limit: this.limit
-				}
-				this.$Request.get("/app/address/selectAddressList", data).then(res => {
-					if (res.code == 0) {
-						this.totalCount = res.data.totalCount
-						if (this.page == 1) {
-							this.list = res.data.list
-						} else {
-							this.list = [...this.list, ...res.data.list]
-						}
-					}
-					uni.stopPullDownRefresh();
-					uni.hideLoading();
-				});
-			},
-			// 设为默认地址
-			checkboxChange(e) {
-				console.log(e)
-				// this.list.forEach(res => {
-				// if (res.addressId == e.addressId) {
-				let data = {
-					addressId: e.addressId,
-					userName: e.userName,
-					userPhone: e.userPhone,
-					address: e.address,
-					addressDetail: e.addressDetail,
-					addressDefault: e.addressDefault ? 0 : 1
-				}
-				this.$Request.postJson("/app/address/updateAddress", data).then(res => {
-					if (res.code == 0) {
-						this.getAddressList()
-					}
-				});
-				// } else {
-				// res.addressDefault = 0
-				// }
-				// })
-			},
-			// 跳转修改
-			update(e) {
-				uni.navigateTo({
-					url: '/my/address/add?id=' + e.addressId
-				})
-			},
-			// 删除地址
-			del(e) {
-				let that = this
-				uni.showModal({
-					title: '提示',
-					content: '确认删除吗',
-					success: function(res) {
-						if (res.confirm) {
-							console.log('用户点击确定');
-							that.$Request.post("/app/address/deleteAddress", {
-								addressId: e.addressId
-							}).then(res => {
-								if (res.code == 0) {
-									uni.showToast({
-										title: '删除成功',
-										icon: 'none'
-									})
-									that.page = 1
-									that.getAddressList()
-								}
-							});
-						} else if (res.cancel) {
-							console.log('用户点击取消');
-						}
-					}
-				});
-			},
-			// 点击地址返回上一页
-			goBack(e) {
-				console.log(e)
-				if (this.add) {
-					let pages = getCurrentPages();
-					let prevPage = pages[pages.length - 2];
-					// 修改上一页面的addressId
-					// #ifdef MP-WEIXIN
-					prevPage.$vm._data.addressId = e.addressId
-					prevPage.$vm._data.addressType = this.addressType
-					uni.navigateBack()
-					// #endif
-					// #ifdef H5
-					prevPage._data.addressId = e.addressId
-					prevPage._data.addressType = this.addressType
-					uni.navigateBack()
-					// #endif
-					
-					
-					// #ifdef APP-PLUS
-					uni.setStorageSync('addressId',e.addressId)
-					uni.setStorageSync('addressType',this.addressType)
-					setTimeout(function(){
-						uni.navigateBack()
-					},10)
-					// #endif
-				}
-				
-			}
-		},
-		onReachBottom: function() {
-			if(this.list.length<this.totalCount) {
-				this.page = this.page + 1;
-				this.getAddressList()
-			} else {
-				uni.showToast({
-					title: '已经到底了',
-					icon: 'none'
-				})
-			}
-		},
-		onPullDownRefresh: function() {
-			this.page = 1;
-			this.getAddressList();
-		},
-	}
-</script>
-
-<style>
-	body {
-		background-color: #eeeeee;
-		background-size: cover;
-		box-sizing: border-box;
-	}
-
-	.address {
-		width: 100%;
-	}
-
-	.address_content {
-		width: 100%;
-		background: #FFFFFF;
-		margin-top: 20rpx;
-	}
-
-	.content_top {
-		width: 90%;
-		margin: 0 auto;
-	}
-
-	.content_part1 {
-		font-size: 32rpx;
-		color: #333333;
-		display: flex;
-		align-items: center;
-		padding-top: 30rpx;
-	}
-
-	.content_name {
-		font-size: 36rpx;
-		font-weight: bold;
-	}
-
-	.content_number {
-		margin-left: 20rpx;
-	}
-
-	.content_btn {
-		padding: 4rpx 10rpx;
-		border-radius: 10rpx;
-		border: 1rpx solid #FCD202;
-		color: #FCD202;
-		margin-left: 20rpx;
-		font-size: 22rpx;
-		text-align: center;
-	}
-
-	.content_part2 {
-		color: #999999;
-		font-size: 28rpx;
-		margin-top: 20rpx;
-		margin-bottom: 30rpx;
-	}
-
-	.content_bottom {
-		display: flex;
-		width: 90%;
-		margin: 0 auto;
-		height: 60rpx;
-	}
-
-	.bottom_left {
-		flex: 1;
-		display: flex;
-		justify-content: left;
-		align-items: center;
-	}
-
-	.bottom_right {
-		flex: 1;
-		position: relative;
-		display: flex;
-		justify-content: center;
-		align-items: center;
-	}
-
-	.write image {
-		width: 35rpx;
-		height: 35rpx;
-	}
-
-	.dete image {
-		width: 35rpx;
-		height: 35rpx;
-	}
-
-	.write {
-		position: absolute;
-		right: 75rpx;
-	}
-
-	.dete {
-		position: absolute;
-		right: 0rpx;
-	}
-
-	/* 添加收货地址 */
-	.btn {
-		position: fixed;
-		bottom: 0rpx;
-		width: 100%;
-		height: 100rpx;
-		line-height: 100rpx;
-		background-color: white;
-		padding-top: 10rpx;
-	}
-
-	.address_push {
-		width: 90%;
-		height: 80rpx;
-		margin: 0 auto;
-		background: #FCD202;
-		border-radius: 20rpx;
-		color: white;
-		text-align: center;
-		line-height: 80rpx;
-		font-size: 35rpx;
-	}
-</style>
+<template>
+	<view class="address" v-if="XCXIsSelect == '是'">
+		<view class="bg-white radius margin-sm" v-for="(item, index) in list" :key="index">
+			<view class="content_top" @click="goBack(item)">
+				<view class="content_part1">
+					<view class="content_name">{{ item.userName }}</view>
+					<view class="content_number">
+						{{ item.userPhone }}
+					</view>
+					<view class="content_btn" v-if="item.addressDefault">默认</view>
+				</view>
+				<view class="content_part2">{{ item.province }}{{ item.city }}{{ item.district }}{{ item.addressDetail }}</view>
+			</view>
+			<!-- 线条 -->
+			<!-- <u-line color="#c1c1c1" border-style="solid" direction="row"></u-line> -->
+			<view class="content_bottom">
+				<view class="bottom_right">
+					<view class="write" @click.stop="update(item)">
+						<image src="../static/address/write.png"></image>
+					</view>
+					<view class="dete" @click.stop="del(item)">
+						<image src="../static/address/dete.png"></image>
+					</view>
+				</view>
+			</view>
+		</view>
+		<empty v-if="list.length == 0"></empty>
+
+		<view style="height: 100rpx"></view>
+		<!-- 添加收货地址 -->
+		<view class="btn">
+			<view class="address_push" @click="addAddress">添加收货地址</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import empty from '@/components/empty.vue'
+export default {
+	components: {
+		empty
+	},
+	data() {
+		return {
+			list: [],
+			checked: false,
+			page: 1,
+			limit: 10,
+			add: 0,
+			addressType: '',
+			totalCount: 0,
+			XCXIsSelect: '是'
+		}
+	},
+	onLoad(option) {
+		this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
+		if (this.XCXIsSelect == '否') {
+			this.getGuize()
+			uni.setNavigationBarTitle({
+				title: '隐私政策'
+			})
+		} else {
+			uni.setNavigationBarTitle({
+				title: '地址管理'
+			})
+		}
+		this.add = option.add ? option.add : 0
+
+		if (option.addressType) {
+			this.addressType = option.addressType
+		}
+	},
+	onShow() {
+		this.page = 1
+		this.getAddressList()
+	},
+	methods: {
+		bindOrdersure() {
+			uni.navigateTo({
+				url: '/pages/order_sure/order_sure'
+			})
+		},
+		// 添加地址
+		addAddress() {
+			uni.navigateTo({
+				url: '/my/address/add?page=2'
+			})
+		},
+		// 获取地址列表
+		getAddressList() {
+			let data = {
+				page: this.page,
+				limit: this.limit
+			}
+			this.$Request.get('/app/address/selectAddressList', data).then((res) => {
+				console.log(res)
+				if (res.code == 0) {
+					this.totalCount = res.data.totalCount
+					if (this.page == 1) {
+						this.list = res.data.list
+					} else {
+						this.list = [...this.list, ...res.data.list]
+					}
+				}
+				uni.stopPullDownRefresh()
+				uni.hideLoading()
+			})
+		},
+		// 设为默认地址
+		checkboxChange(e) {
+			console.log(e)
+			// this.list.forEach(res => {
+			// if (res.addressId == e.addressId) {
+			let data = {
+				addressId: e.addressId,
+				userName: e.userName,
+				userPhone: e.userPhone,
+				address: e.address,
+				addressDetail: e.addressDetail,
+				addressDefault: e.addressDefault ? 0 : 1
+			}
+			this.$Request.postJson('/app/address/updateAddress', data).then((res) => {
+				if (res.code == 0) {
+					this.getAddressList()
+				}
+			})
+			// } else {
+			// res.addressDefault = 0
+			// }
+			// })
+		},
+		// 跳转修改
+		update(e) {
+			uni.navigateTo({
+				url: '/my/address/add?id=' + e.addressId
+			})
+		},
+		// 删除地址
+		del(e) {
+			let that = this
+			uni.showModal({
+				title: '提示',
+				content: '确认删除吗',
+				success: function (res) {
+					if (res.confirm) {
+						console.log('用户点击确定')
+						that.$Request
+							.post('/app/address/deleteAddress', {
+								addressId: e.addressId
+							})
+							.then((res) => {
+								if (res.code == 0) {
+									uni.showToast({
+										title: '删除成功',
+										icon: 'none'
+									})
+									that.page = 1
+									that.getAddressList()
+								}
+							})
+					} else if (res.cancel) {
+						console.log('用户点击取消')
+					}
+				}
+			})
+		},
+		// 点击地址返回上一页
+		goBack(e) {
+			console.log(e)
+			if (this.add) {
+				let pages = getCurrentPages()
+				let prevPage = pages[pages.length - 2]
+				// 修改上一页面的addressId
+				// #ifdef MP-WEIXIN
+				prevPage.$vm._data.addressId = e.addressId
+				prevPage.$vm._data.addressType = this.addressType
+				uni.navigateBack()
+				// #endif
+				// #ifdef H5
+				prevPage._data.addressId = e.addressId
+				prevPage._data.addressType = this.addressType
+				uni.navigateBack()
+				// #endif
+
+				// #ifdef APP-PLUS
+				uni.setStorageSync('addressId', e.addressId)
+				uni.setStorageSync('addressType', this.addressType)
+				setTimeout(function () {
+					uni.navigateBack()
+				}, 10)
+				// #endif
+			}
+		}
+	},
+	onReachBottom: function () {
+		if (this.list.length < this.totalCount) {
+			this.page = this.page + 1
+			this.getAddressList()
+		} else {
+			uni.showToast({
+				title: '已经到底了',
+				icon: 'none'
+			})
+		}
+	},
+	onPullDownRefresh: function () {
+		this.page = 1
+		this.getAddressList()
+	}
+}
+</script>
+
+<style>
+body {
+	background-color: #eeeeee;
+	background-size: cover;
+	box-sizing: border-box;
+}
+
+.address {
+	width: 100%;
+}
+
+.address_content {
+	width: 100%;
+	background: #ffffff;
+	margin-top: 20rpx;
+}
+
+.content_top {
+	width: 90%;
+	margin: 0 auto;
+}
+
+.content_part1 {
+	font-size: 32rpx;
+	color: #333333;
+	display: flex;
+	align-items: center;
+	padding-top: 30rpx;
+}
+
+.content_name {
+	font-size: 36rpx;
+	font-weight: bold;
+}
+
+.content_number {
+	margin-left: 20rpx;
+}
+
+.content_btn {
+	padding: 4rpx 10rpx;
+	border-radius: 10rpx;
+	border: 1rpx solid #fcd202;
+	color: #fcd202;
+	margin-left: 20rpx;
+	font-size: 22rpx;
+	text-align: center;
+}
+
+.content_part2 {
+	color: #999999;
+	font-size: 28rpx;
+	margin-top: 20rpx;
+	margin-bottom: 30rpx;
+}
+
+.content_bottom {
+	display: flex;
+	width: 90%;
+	margin: 0 auto;
+	height: 60rpx;
+}
+
+.bottom_left {
+	flex: 1;
+	display: flex;
+	justify-content: left;
+	align-items: center;
+}
+
+.bottom_right {
+	flex: 1;
+	position: relative;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.write image {
+	width: 35rpx;
+	height: 35rpx;
+}
+
+.dete image {
+	width: 35rpx;
+	height: 35rpx;
+}
+
+.write {
+	position: absolute;
+	right: 75rpx;
+}
+
+.dete {
+	position: absolute;
+	right: 0rpx;
+}
+
+/* 添加收货地址 */
+.btn {
+	position: fixed;
+	bottom: 0rpx;
+	width: 100%;
+	height: 100rpx;
+	line-height: 100rpx;
+	background-color: white;
+	padding-top: 10rpx;
+}
+
+.address_push {
+	width: 90%;
+	height: 80rpx;
+	margin: 0 auto;
+	background: #fcd202;
+	border-radius: 20rpx;
+	color: white;
+	text-align: center;
+	line-height: 80rpx;
+	font-size: 35rpx;
+}
+</style>

Разница между файлами не показана из-за своего большого размера
+ 567 - 549
pages/index/selectCampus.vue


+ 45 - 21
pages/index/shop/confirmOrder.vue

@@ -4,7 +4,7 @@
 		<view class="text-center text-red" v-if="isTrue && orderType == 2">超出配送距离</view>
 		<view class="food">
 			<view class="flex bg justify-between padding-lr-xl">
-				<view @click="switchTab(2)" :class="orderType == 2 ? 'select' : ''" class="tabBtn" v-if="XCXIsSelect == '是' && showReach != 1 && shopTypeName!='三大运营商'">
+				<view @click="switchTab(2)" :class="orderType == 2 ? 'select' : ''" class="tabBtn" v-if="XCXIsSelect == '是' && showReach != 1 && shopTypeName != '三大运营商'">
 					<view class="title">外卖配送</view>
 					<view :class="orderType == 2 ? 'active' : ''"></view>
 				</view>
@@ -27,9 +27,9 @@
 						</view>
 					</view>
 				</view>
-				<view class="flex margin-top" style="align-items: center;" v-if="shopTypeName=='三大运营商'">
+				<view class="flex margin-top" style="align-items: center" v-if="shopTypeName == '三大运营商'">
 					<view>请填写身份证号:</view>
-					<input type="idcard" v-model="idcard1" style="border: 1px solid;"/>
+					<input type="idcard" v-model="idcard1" style="border: 1px solid" />
 				</view>
 				<!-- 预约送达时间 -->
 				<!-- <view class="goods_address" v-if="reservationOpenFlag==1">
@@ -112,6 +112,10 @@
 				<view>跑腿费</view>
 				<view class="tosend_header_do_ri">¥{{ paotuiMoney }}</view>
 			</view>
+			<view class="tosend_header_do justify-between" v-if="address.insideDeliveryFee && orderType == 2">
+				<view>特殊地址跑腿费</view>
+				<view class="tosend_header_do_ri">¥{{ address.insideDeliveryFee }}</view>
+			</view>
 			<view class="tosend_header_do justify-between do_bot" @click="isShow">
 				<view>优惠券</view>
 				<view class="tosend_header_do_ri" v-if="coupon">- ¥{{ coupon.money }}</view>
@@ -328,7 +332,9 @@ export default {
 			packMoney: 0, //打包费
 			totalPrice: 0,
 			totalPrice1: 0,
-			address: {}, //地址
+			address: {
+				insideDeliveryFee: 0
+			}, //地址
 			addressId: '',
 			parentId: '',
 			shopId: '',
@@ -383,13 +389,13 @@ export default {
 			intergral: 0,
 			// 是否显示积分模块
 			isIntegral: false,
-			shopTypeName:'',//店铺类型
-			idcard1:'',//身份证号
+			shopTypeName: '', //店铺类型
+			idcard1: '' //身份证号
 		}
 	},
 	onLoad(option) {
 		console.log(option, '256')
-		this.shopTypeName=option.shopTypeName
+		this.shopTypeName = option.shopTypeName
 		if (option.showReach) {
 			this.showReach = option.showReach
 		}
@@ -450,9 +456,9 @@ export default {
 		// #endif
 
 		this.shopId = option.shopId
-		if(option.shopTypeName=='三大运营商'){
-			this.orderType =1
-		}else{
+		if (option.shopTypeName == '三大运营商') {
+			this.orderType = 1
+		} else {
 			this.orderType = option.orderType
 		}
 		if (option.orderId) {
@@ -832,7 +838,7 @@ export default {
 				this.getDistance()
 			}
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
+				this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 			}
@@ -872,7 +878,7 @@ export default {
 		selCoupon(item) {
 			this.coupon = item
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
@@ -899,7 +905,7 @@ export default {
 		selctHuo(item) {
 			this.huodong = item
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
@@ -934,7 +940,7 @@ export default {
 						if (!activityExists) {
 							this.coupon = ''
 							if (this.orderType == 2) {
-								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 							} else {
 								this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 							}
@@ -979,7 +985,7 @@ export default {
 						if (!activityExists) {
 							this.huodong = ''
 							if (this.orderType == 2) {
-								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 							} else {
 								this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 							}
@@ -1064,9 +1070,9 @@ export default {
 				limit: 1000
 				// orderType: this.orderType
 			}
-			console.log(data)
+			// console.log(data)
 			this.$Request.get('/app/order/selectAllOrderList', data).then((res) => {
-				console.log(res)
+				// console.log(res)
 				uni.hideLoading()
 				if (res.code == 0 && res.data.pageUtils.list.length) {
 					this.GoodsorderId = res.data.pageUtils.list[0].orderId
@@ -1097,7 +1103,9 @@ export default {
 
 					this.totalPrice = res.data.money
 					if (this.orderType == 2) {
-						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
+						this.totalPrice1 = parseFloat(
+							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee
+						).toFixed(2)
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 					}
@@ -1151,7 +1159,9 @@ export default {
 
 					this.totalPrice = res.data.money
 					if (this.orderType == 2) {
-						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney)).toFixed(2)
+						this.totalPrice1 = parseFloat(
+							parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + this.address.insideDeliveryFee
+						).toFixed(2)
 					} else {
 						this.totalPrice1 = parseFloat(parseFloat(this.totalPrice) + parseFloat(this.dabaoMoney)).toFixed(2)
 					}
@@ -1293,9 +1303,9 @@ export default {
 							addressId: this.address.addressId ? this.address.addressId : '',
 							orderType: this.orderType,
 							type: res.enable ? 1 : 3,
-							idCard:this.idcard1
+							idCard: this.idcard1
 						}
-						
+
 						console.log(data)
 						if (res.enable) {
 							console.log('xin')
@@ -1553,6 +1563,8 @@ export default {
 			this.$Request.get('/app/address/selectAddressById', data).then((res) => {
 				if (res.code == 0) {
 					this.address = res.data
+
+					this.getInsideDeliveryFee(this.address.insideAddressId)
 					if (JSON.stringify(this.address) != '{}') {
 						this.getDistance()
 					}
@@ -1576,12 +1588,24 @@ export default {
 						}
 					})
 
+					// console.log(that.address, '我的地址列表460777')
+
+					this.getInsideDeliveryFee(this.address.insideAddressId)
+
 					if (JSON.stringify(this.address) != '{}') {
 						this.getDistance()
 					}
 				}
 			})
 		},
+		getInsideDeliveryFee(insideAddressId) {
+			this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
+				// console.log(res, 987456)
+				if (res.code == 0) {
+					this.address.insideDeliveryFee = res.data.deliveryFee
+				}
+			})
+		},
 		goAddress() {
 			uni.navigateTo({
 				url: '/my/address/index?add=1'

+ 26 - 16
pages/index/shop/payOrder.vue

@@ -100,9 +100,9 @@
 				<view>跑腿费</view>
 				<view class="tosend_header_do_ri">¥{{ paotuiMoney }}</view>
 			</view>
-			<view class="tosend_header_do justify-between" v-if="paotuiMoney > 0 && orderType == 2">
+			<view class="tosend_header_do justify-between" v-if="address.insideDeliveryFee && orderType == 2">
 				<view>特殊地址跑腿费</view>
-				<view class="tosend_header_do_ri">¥0</view>
+				<view class="tosend_header_do_ri">¥{{ address.insideDeliveryFee }}</view>
 			</view>
 			<view class="tosend_header_do justify-between do_bot" @click="isShow">
 				<view>优惠券</view>
@@ -314,7 +314,9 @@ export default {
 			packMoney: 0, //打包费
 			totalPrice: 0,
 			totalPrice1: 0,
-			address: {}, //地址
+			address: {
+				insideDeliveryFee: 0
+			}, //地址
 			addressId: '',
 			parentId: '',
 			orderId: '',
@@ -769,6 +771,7 @@ export default {
 					dd: this.dataList.shopLat
 				}
 				this.$Request.post('/app/tbindent/distance', data).then((res) => {
+					// console.log(res, '963')
 					if (res.code == 0) {
 						this.distance = res.data
 						if (this.distance > Number(this.dataList.distributionDistance)) {
@@ -798,13 +801,9 @@ export default {
 			if (JSON.stringify(this.address) != '{}') {
 				this.getDistance()
 			}
-			// if (this.orderType == 2) {
-			// 	this.totalPrice1 = this.totalPrice + this.paotuiMoney + this.dabaoMoney
-			// } else {
-			// 	this.totalPrice1 = this.totalPrice + this.dabaoMoney
-			// }
+
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
@@ -844,7 +843,7 @@ export default {
 		selCoupon(item) {
 			this.coupon = item
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
@@ -873,7 +872,7 @@ export default {
 		selctHuo(item) {
 			this.huodong = item
 			if (this.orderType == 2) {
-				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+				this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 			} else {
 				this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 			}
@@ -906,7 +905,7 @@ export default {
 						if (!activityExists) {
 							this.coupon = ''
 							if (this.orderType == 2) {
-								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 							} else {
 								this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 							}
@@ -950,7 +949,7 @@ export default {
 						if (!activityExists) {
 							this.huodong = ''
 							if (this.orderType == 2) {
-								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney).toFixed(2)
+								this.totalPrice1 = parseFloat(this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee).toFixed(2)
 							} else {
 								this.totalPrice1 = parseFloat(this.totalPrice + this.dabaoMoney).toFixed(2)
 							}
@@ -1029,7 +1028,7 @@ export default {
 					console.log(this.dabaoMoney, '打包')
 					console.log(this.paotuiMoney, '跑腿')
 					if (this.orderType == 2) {
-						this.totalPrice1 = this.totalPrice + this.paotuiMoney + this.dabaoMoney
+						this.totalPrice1 = this.totalPrice + this.paotuiMoney + this.dabaoMoney + this.address.insideDeliveryFee
 					} else {
 						this.totalPrice1 = this.totalPrice + this.dabaoMoney
 					}
@@ -1419,8 +1418,10 @@ export default {
 				addressId: e
 			}
 			this.$Request.get('/app/address/selectAddressById', data).then((res) => {
+				console.log(res, 741258)
 				if (res.code == 0) {
 					this.address = res.data
+					this.getInsideDeliveryFee(this.address.insideAddressId)
 
 					if (JSON.stringify(this.address) != '{}') {
 						this.getDistance()
@@ -1444,13 +1445,22 @@ export default {
 							that.address = ret
 						}
 					})
-					console.log(that.address, '我的地址列表460')
+					this.getInsideDeliveryFee(this.address.insideAddressId)
+					// console.log(that.address, '我的地址列表460777')
 					if (JSON.stringify(this.address) != '{}') {
 						this.getDistance()
 					}
 				}
 			})
 		},
+		getInsideDeliveryFee(insideAddressId) {
+			this.$Request.get(`/app/inside-address/${insideAddressId}`).then((res) => {
+				// console.log(res, 987456)
+				if (res.code == 0) {
+					this.address.insideDeliveryFee = res.data.deliveryFee
+				}
+			})
+		},
 		goAddress() {
 			uni.navigateTo({
 				url: '/my/address/index?add=1'
@@ -1798,4 +1808,4 @@ export default {
 		top: -20rpx; */
 	z-index: 9;
 }
-</style>
+</style>

+ 4 - 4
pages/order/takefood.vue

@@ -100,9 +100,9 @@
 					<view>跑腿费</view>
 					<view class="tosend_header_do_ri">¥{{ dataDet.errandMoney }}</view>
 				</view>
-				<view class="tosend_header_do do_bot">
+				<view class="tosend_header_do do_bot" v-if="dataDet.insideDeliveryFee && dataDet.orderType == 2">
 					<view>特殊地址跑腿费</view>
-					<view class="tosend_header_do_ri">¥0</view>
+					<view class="tosend_header_do_ri">¥{{ dataDet.insideDeliveryFee }}</view>
 				</view>
 				<view class="tosend_header_do">
 					<view class="tosend_header_do_le2">实付</view>
@@ -357,10 +357,10 @@ export default {
 				orderId: this.orderId
 			}
 
-			console.log(data)
+			// console.log(data)
 
 			this.$Request.get('/app/order/selectOrderById', data).then((res) => {
-				console.log(res)
+				// console.log(res)
 				uni.hideLoading()
 				if (res.code == 0) {
 					this.dataDet = res.data