Browse Source

2023-11-02订单加所属者

zhiquz 1 year ago
parent
commit
adfacdf634

+ 3 - 1
apis/address.js

@@ -11,4 +11,6 @@ export const _API_AddressGet = data => request.get('/user/show_address', data) /
 
 export const _API_AddressSearch = data => request.get('/user/search_address', data) // 查
 
-export const discernAdress = data => request.get('/discernAdress', data) // 地址识别
+export const discernAdress = data => request.get('/discernAdress', data) // 地址识别
+
+export const _API_MemberAddress = data => request.get('/inventory/get_user', data) // 客户地址

+ 1 - 1
filters/index.js

@@ -110,7 +110,7 @@ export const getOrderStatus = val => {
 }
 
 export const getAddressString = val => {
-	return val ? `${val.provice}-${val.city}-${val.area}-${val.address}` : ''
+	return val ? `${val.province ? val.province : val.provice}-${val.city}-${val.area}-${val.address}` : ''
 }
 
 export const DistanceNow = t => { // 计算动态距离现在的发布时间

+ 2 - 1
pages.json

@@ -186,7 +186,8 @@
 			"style": {
 				"navigationBarTitleText": "填写订单"
 			}
-		}, {
+		},
+		{
 			"path": "pages/comfirm-order-success/comfirm-order-success",
 			"style": {
 				"navigationBarTitleText": "订单提交成功"

+ 11 - 11
pages/add-address/add-address.vue

@@ -109,7 +109,7 @@
 					name: '',
 					phone: '',
 					local: '',
-					provice: '',
+					province: '',
 					city: '',
 					area: '',
 					detail: '',
@@ -173,7 +173,7 @@
 					name: arr.name.replace(/[0-9]/g, ''),
 					phone: mobile,
 					local: type === 0 ? `${arr.province}-${arr.city}-${arr.area}` : `${arr.province}-${arr.city}`,
-					provice: arr.province,
+					province: arr.province,
 					city: arr.city,
 					area: arr.area,
 					detail: arr.details,
@@ -205,11 +205,11 @@
 							// this.address.name = arr.name;
 							// this.address.phone = arr.mobile;
 							// this.address.detail = arr.details;
-							// this.address.provice = arr.province;
+							// this.address.province = arr.province;
 							// this.address.city = arr.city;
 							this.address.area = res.data.area;
 							this.address.local = `${arr.province}-${arr.city}-${res.data.area}`;
-							this.pickerDefaultVal = [this.address.provice, this.address.city, this.address.area];
+							this.pickerDefaultVal = [this.address.province, this.address.city, this.address.area];
 						} else {
 							uni.toast('识别失败,请手动填写');
 						}
@@ -218,11 +218,11 @@
 					this.address.name = arr.name;
 					this.address.phone = arr.mobile;
 					this.address.detail = arr.details;
-					this.address.provice = arr.province;
+					this.address.province = arr.province;
 					this.address.city = arr.city;
 					this.address.area = arr.area;
 					this.address.local = `${arr.province}-${arr.city}-${arr.area}`;
-					this.pickerDefaultVal = [this.address.provice, this.address.city, this.address.area];
+					this.pickerDefaultVal = [this.address.province, this.address.city, this.address.area];
 					this.address.areaCode = '+86'
 				}
 			},
@@ -274,7 +274,7 @@
 				const address = {
 					con_name: this.address.name,
 					con_mobile: this.address.phone,
-					provice: this.address.provice,
+					province: this.address.province,
 					city: this.address.city,
 					area: this.address.area,
 					address: this.address.detail,
@@ -323,7 +323,7 @@
 			onConfirm(e) {
 				// 选择地址选择器
 				this.address.local = `${e.checkArr[0]}-${e.checkArr[1]}-${e.checkArr[2]}`;
-				this.address.provice = e.checkArr[0];
+				this.address.province = e.checkArr[0];
 				this.address.city = e.checkArr[1];
 				this.address.area = e.checkArr[2];
 			}
@@ -339,13 +339,13 @@
 				this.id = address.id; // 获取地址 id
 				this.address.name = address.con_name;
 				this.address.phone = address.con_mobile;
-				this.address.provice = address.provice;
+				this.address.province = address.province;
 				this.address.city = address.city;
 				this.address.area = address.area;
 				this.address.type = address.type ? 1 : 0;
-				this.address.local = `${address.provice}-${address.city}-${address.area}`;
+				this.address.local = `${address.province}-${address.city}-${address.area}`;
 				this.address.detail = address.address;
-				this.pickerDefaultVal = [address.provice, address.city, address.area];
+				this.pickerDefaultVal = [address.province, address.city, address.area];
 				this.address.areaCode = address.area_code ? address.area_code : '+86'
 				if (this.address.areaCode) {
 					let index = this.address.areaCode.indexOf('+')

+ 2 - 2
pages/address-manage/address-manage.vue

@@ -77,7 +77,7 @@
 						let list = res.data.list.map(item => ({
 							con_name: item.username,
 							con_mobile: item.mobile,
-							provice: item.province,
+							province: item.province,
 							city: item.city,
 							area: item.town,
 							address: item.address,
@@ -114,7 +114,7 @@
 					id: item.id,
 					con_name: item.con_name,
 					con_mobile: item.con_mobile,
-					provice: item.provice,
+					province: item.province,
 					city: item.city,
 					area: item.area,
 					address: item.address,

+ 22 - 3
pages/confirm-order1/confirm-order1.vue

@@ -77,8 +77,26 @@
 					</view>
 				</view>
 			</view>
-			<view v-if="address && address.id" class="choose-item">
+			<view v-if="address" class="choose-item">
 				<view class="icons icon-belong"></view>
+				<view class="choose-belong">
+					<view class="belong-header">
+						<text class="text">哪位客户的货</text>
+					</view>
+					<view class="belong-info">
+						<template v-if="address && address.uid">
+							<template>
+								<view class="belong-avatar"
+									:style="{ backgroundImage: `url(${address.avatar})` }" />
+								<view class="belong-user">
+									<view class="top">
+										<text class="text">{{ address.user_nickname.slice(0,4) }}</text>
+									</view>
+								</view>
+							</template>
+						</template>
+					</view>
+				</view>
 			</view>
 		</view>
 		<view class="choose-user" @click="showRemark = true">
@@ -98,7 +116,6 @@
 			<view class="left"><text class="basecolor">¥{{ choosedPrice | numDot }}</text></view>
 			<view class="right" @tap="sumbit">提交订单</view>
 		</view>
-
 		
 	</view>
 </template>
@@ -129,6 +146,7 @@
 		},
 		computed: {
 			address() {
+				console.log(this.$store.state.address.list[this.$store.getters['address/usingAddressIndex']])
 				return this.$store.state.address.list[this.$store.getters['address/usingAddressIndex']]
 			}, // 用户选择的地址
 			list() {
@@ -206,6 +224,7 @@
 									size_id,
 									money: this.choosedPrice, // 订单总金额
 									address_id: this.address.id, // 地址,
+									belong_id: this.address.uid // 所属者
 								}).then(res => {
 									if (res.code === 200) {
 										this.requesting = false
@@ -600,7 +619,7 @@
 							display: block;
 							width: 30rpx;
 							height: 30rpx;
-							background-image: url(../../static/icon/arrow.png);
+							// background-image: url(../../static/icon/arrow.png);
 							background-position: center;
 							background-repeat: no-repeat;
 							background-size: 100%;

+ 15 - 6
pages/index-my/index-my.vue

@@ -83,18 +83,18 @@
 		// 	icon: '10.png',
 		// 	url: 'auth-card/auth-card'
 		// },
+		// {
+		// 	name: '收货地址',
+		// 	remark: '添加、修改',
+		// 	icon: '1.png',
+		// 	url: 'address-manage/address-manage'
+		// },
 		{
 			name: '线上实战营',
 			icon: '8.png',
 			url: 'payment/payment'
 		},
 		{
-			name: '收货地址',
-			remark: '添加、修改',
-			icon: '1.png',
-			url: 'address-manage/address-manage'
-		},
-		{
 			name: '安全管理',
 			remark: '退出、修改手机号',
 			icon: '2.png',
@@ -188,6 +188,15 @@
 				}
 				setListArr.push(data)
 			}
+			if (this.userinfo.level == 3) {
+				const data ={
+					name: '收货地址',
+					remark: '添加、修改',
+					icon: '1.png',
+					url: 'address-manage/address-manage'
+				}
+				setListArr.push(data)
+			}
 			this.showShop(); //判断是否显示店铺
 		},
 		computed: {

BIN
static/icon/arrow2.png


BIN
static/icon/logo.png


+ 1 - 1
store/modules/app.js

@@ -7,7 +7,7 @@ export default {
 		navtabbarHeight: uni.upx2px(128), // 自定义导航栏高
 		indextabbarHeight: uni.upx2px(98), // 首页 tabbar 高
 		token: uni.getStorageSync('token'),
-		// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkuYXBwLmNsaXUuY2NcL2FwaVwvbG9naW5cL2dldF91c2VyX29wZW5pZCIsImlhdCI6MTY5ODIwMTcyOSwiZXhwIjoxNjk5MDY1NzI5LCJuYmYiOjE2OTgyMDE3MjksImp0aSI6IlpZOXNtNlNsT1MxTTQ2a24iLCJzdWIiOjc1NjYwLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.0eOmW_IikojvgGglYZLPLQegg1Yo4LxoXSHlgawnuAM',
+		// token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9hcGkuYXBwLmNsaXUuY2NcL2FwaVwvbG9naW5cL2dldF91c2VyX29wZW5pZCIsImlhdCI6MTY5ODgxNTc0O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