Parcourir la source

常用联系人修改

mym il y a 1 an
Parent
commit
ba702beadf

+ 24 - 2
pages.json

@@ -331,9 +331,31 @@
 			}
 
 		}, {
-			"path": "pages/market/one/merchant/address/address",
+			"path": "pages/market/one/merchant/contacts/contacts",
 			"style": {
-				"navigationBarTitleText": "选择地址",
+				"navigationBarTitleText": "选择常用联系人",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/market/one/merchant/contacts/list",
+			"style": {
+				"navigationBarTitleText": "地址管理",
+				"enablePullDownRefresh": true,
+				"app-plus": {
+					"titleNView": {
+						"buttons": [{
+							"text": "新增",
+							"fontSize": "14px"
+						}]
+					}
+				}
+			}
+
+		}, {
+			"path": "pages/market/one/merchant/contacts/add",
+			"style": {
+				"navigationBarTitleText": "新增地址",
 				"enablePullDownRefresh": false
 			}
 

+ 33 - 20
pages/market/one/leader/detail.vue

@@ -5,71 +5,71 @@
 				<u-divider text="订单信息"></u-divider>
 				<view class="item" style="padding-top: 0px">
 					<text class="label">订单编号</text>
-					<text class="desc">13454334567</text>
+					<text class="desc">{{param.orderId}}</text>
 				</view>
-				<view class="item">
+			<!-- 	<view class="item">
 					<text class="label">申报单号</text>
 					<text class="desc">13454334567</text>
-				</view>
+				</view> -->
 				<view class="item">
 					<text class="label">商家名称</text>
-					<text class="desc">胡椒粉</text>
+					<text class="desc">{{item.enterpriseName}}</text>
 				</view>
 				<view class="item">
 					<text class="label">联系号码</text>
-					<text class="desc">元/kg</text>
+					<text class="desc">{{item.concat}}</text>
 				</view>
 				<view class="item">
 					<text class="label">商品名称</text>
-					<text class="desc">元/kg</text>
+					<text class="desc">{{item.goodsTransitName}}</text>
 				</view>
 				<view class="item">
 					<text class="label">计价单位</text>
-					<text class="desc">元/kg</text>
+					<text class="desc">{{item.goodsUnit}}</text>
 				</view>
 				<view class="item">
 					<text class="label">净重</text>
-					<text class="desc">34吨</text>
+					<text class="desc">{{item.netWeight}}</text>
 				</view>
 				<view class="item">
 					<text class="label">毛重</text>
-					<text class="desc">35吨</text>
+					<text class="desc">{{item.grossWeight}}</text>
 				</view>
 				<view class="item">
 					<text class="label">价格</text>
-					<text class="desc">400000元</text>
+					<text class="desc">{{item.totalPrice}}</text>
 				</view>
 				<view class="item">
 					<text class="label">边民</text>
-					<text class="desc" @click="members()">查看</text>
+					<text class="desc" style="color: blue;" @click="members()">查看</text>
 				</view>
 				<view class="item">
 					<text class="label">发布时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.goodsTransitCreateTime}}</text>
 				</view>
 				<view class="item">
 					<text class="label">下单时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.orderCreateTime}}</text>
 				</view>
 				<view class="item">
 					<text class="label">购买边民组</text>
-					<text class="desc">貔貅互助组</text>
+					<text class="desc">{{item.groupName}}</text>
 				</view>
 				<view class="item">
 					<text class="label">确认时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.enterpriseConfirmTime}}</text>
 				</view>
 				<view class="item">
 					<text class="label">进境时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.entrantTime}}</text>
 				</view>
 				<view class="item">
 					<text class="label">进口时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.importTime}}</text>
 				</view>
 				<view class="item">
 					<text class="label">出互市区时间</text>
-					<text class="desc">2023-07-20 11:38</text>
+					<text class="desc">{{item.outFrontierTradeTime}}</text>
 				</view>
 			</view>
 		</view>
@@ -80,21 +80,34 @@
 export default {
 	data() {
 		return {
-			item: {}
+			item: {},
+			param: {},
 		};
 	},
 	onLoad(e) {
 		if (e.id) {
+			this.param.orderId = e.id
 			this.http.request({
 				url: '/level-one-server/app/TbOrder/getById?id=' + e.id,
 				success: res => {
-					this.item = res.data.data;
+					// this.item = res.data.data;
 					console.log('asd:' + JSON.stringify(res));
 				}
 			});
 		}
+		this.orderDetail()
 	},
 	methods: {
+		orderDetail() {
+			this.http.request({
+				url: '/level-one-server/app/TbOrder/orderDetail',
+				data: this.param,
+				success: res => {
+					this.item = res.data.data;
+					// console.log('asd:' + JSON.stringify(res));
+				}
+			});
+		},
 		//查看边民
 		members() {
 			uni.navigateTo({

+ 1 - 1
pages/market/one/leader/order.vue

@@ -36,7 +36,7 @@
 					<template v-if="item.enterpriseConfirm == 0">
 						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="confirm(item.id)">取消订单</view>
 					</template>
-					<template v-if="item.enterpriseConfirm == 3">
+					<template v-if="item.enterpriseConfirm == 3 || item.enterpriseConfirm == 2">
 						<view class="an" style="color: #f44336" v-if="user.userType == 2" @click.stop="del(item.id)">删除订单</view>
 					</template>
 				</view>

+ 117 - 0
pages/market/one/merchant/contacts/add.vue

@@ -0,0 +1,117 @@
+<template>
+	<view>
+		<view class="forms">
+			<view class="form_group pt0">
+				<view class="lable re">收件人</view>
+				<input placeholder="请输入" v-model="item.name" />
+			</view>
+			<view class="form_group">
+				<view class="lable re">联系电话</view>
+				<input type="number" maxlength="11" placeholder="请输入" v-model="item.phone" />
+			</view>
+			<view class="form_group">
+				<view class="lable re">省市区</view>
+				<uni-data-picker :localdata="cityData" v-model="item.area" :map="{ text: 'name', value: 'name' }" popup-title="选择省市区" @change="change"></uni-data-picker>
+			</view>
+			<view class="form_group">
+				<view class="lable re">详细地址</view>
+				<textarea v-model="item.street" placeholder="请输入"></textarea>
+			</view>
+		</view>
+		<view class="mfooter">
+			<view class="flex">
+				<view class="f" v-if="item.id">
+					<button class="save btn" @click="del()">删除</button>
+				</view>
+				<view class="f">
+					<button class="btn" @click="save()">保存</button>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+import city from '../../../../../common/data.js';
+export default {
+	data() {
+		return {
+			cityData: city.data.data,
+			item: {}
+		};
+	},
+	onLoad(e) {
+		if (e.id) {
+			this.http.request({
+				url: '/level-two-server/app/address/getById/' + e.id,
+				success: res => {
+					this.item = res.data.data;
+					uni.setNavigationBarTitle({ title: '编辑地址' });
+				}
+			});
+		}
+	},
+	methods: {
+		change(e) {
+			if (e.detail.value.length > 0) {
+				this.item.province = e.detail.value[0].value; //省
+				this.item.city = e.detail.value[1].value; //市
+				this.item.area = e.detail.value[e.detail.value.length - 1].value; //区
+			}
+			this.$forceUpdate();
+		},
+		save() {
+			let rule = [
+				{ name: 'name', checkType: 'notnull', errorMsg: '请输入收件人姓名' },
+				{ name: 'phone', checkType: 'notnull', errorMsg: '请输入联系电话' },
+				{ name: 'phone', checkType: 'phoneno', errorMsg: '手机号格式不对' },
+				{ name: 'area', checkType: 'notnull', errorMsg: '请选择省市区' },
+				{ name: 'street', checkType: 'notnull', errorMsg: '请输入详细地址' }
+			];
+			if (!this.verify.check(this.item, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
+			this.http.request({
+				url: '/level-two-server/app/address/saveOrUpdate',
+				method: 'POST',
+				data: this.item,
+				success: res => {
+					uni.showToast({ title: '操作成功' });
+					setTimeout(() => {
+						uni.$emit('address');
+						uni.navigateBack();
+					}, 1000);
+				}
+			});
+		},
+		del(id) {
+			uni.showModal({
+				title: '提示',
+				content: '确定删除该地址?',
+				success: res => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/level-two-server/app/address/delete/' + this.item.id,
+							success: res => {
+								uni.showToast({ title: '删除成功' });
+								setTimeout(() => {
+									uni.$emit('address');
+									uni.navigateBack();
+								}, 1000);
+							}
+						});
+					}
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.btn {
+	border-radius: 5px;
+	width: 100%;
+}
+</style>

+ 96 - 0
pages/market/one/merchant/contacts/contacts.vue

@@ -0,0 +1,96 @@
+<template>
+	<view class="list">
+		<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+			<view class="address">
+				<view class="con">
+					<view class="title omit">{{ item.address }} </view>
+					<view class="desc">
+						<text>{{item.name}}</text>
+						<text>{{item.phone}}</text>
+					</view>
+				</view>
+				<view class="icon">&#xe8f2;</view>
+				<view class="clear"></view>
+			</view>
+		</view>
+		<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+		<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			select: false,
+			list: [],
+			param: { pageNo: 1, pageSize: 10 },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.select = e.select || false;
+		this.getData();
+		uni.$on('address', res => {
+			this.refresh();
+		});
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/transport-server/app/TbFavoriteContacts/getAppList',
+				data: this.param,
+				loading: 'false',
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					this.list.push(...res.data.data);
+				}
+			});
+		},
+		detail(item) {
+			uni.$emit('one-address', item);
+			uni.navigateBack();
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNo = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNo++;
+			this.getData();
+		}
+	},
+	onNavigationBarButtonTap() {
+		uni.navigateTo({ url: 'add' });
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+.list {
+	padding: 12px;
+	.item {
+		padding: 5px;
+		color: $font-c;
+		background-color: white;
+		border-radius: 10px;
+		margin-bottom: 10px;
+	}
+}
+</style>

+ 100 - 0
pages/market/one/merchant/contacts/list.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="list">
+		<view class="item" v-for="(item, index) in list" :key="index" @click="detail(item)">
+			<view class="address">
+				<view class="con">
+					<view class="title omit">{{item.province}} {{item.city}} {{item.area}} {{item.street}}</view>
+					<view class="desc">
+						<text>{{item.name}}</text>
+						<text>{{item.phone}}</text>
+					</view>
+				</view>
+				<view class="icon">&#xe8f2;</view>
+				<view class="clear"></view>
+			</view>
+		</view>
+		<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+		<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			select: false,
+			list: [],
+			param: { pageNo: 1, pageSize: 10 },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.select = e.select || false;
+		this.getData();
+		uni.$on('address', res => {
+			this.refresh();
+		});
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/level-two-server/app/address/getList',
+				data: this.param,
+				loading: 'false',
+				success: res => {
+					this.loadMore = parseInt(res.data.pageCount) > this.param.pageNo;
+					this.list.push(...res.data.data);
+				}
+			});
+		},
+		detail(item) {
+			if (this.select) {
+				uni.$emit('selectAddress', item);
+				uni.navigateBack();
+			} else {
+				uni.navigateTo({ url: '/pages/market/two/purchaser/address/add?id=' + item.id });
+			}
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNo = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNo++;
+			this.getData();
+		}
+	},
+	onNavigationBarButtonTap() {
+		uni.navigateTo({ url: 'add' });
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background-color: $pg;
+}
+.list {
+	padding: 12px;
+	.item {
+		padding: 5px;
+		color: $font-c;
+		background-color: white;
+		border-radius: 10px;
+		margin-bottom: 10px;
+	}
+}
+</style>

+ 2 - 2
pages/market/one/merchant/order/vehice.vue

@@ -61,7 +61,7 @@
 			// 车牌查询 
 			getByVehiclePlate() {
 				// this.vehiceList = []
-				this.param.vehiclePlate = ''
+				// this.param.vehiclePlate = ''
 				this.http.request({
 					url: '/transport-server/app/TbVehicle/getByVehiclePlate',
 					loading: 'false',
@@ -80,7 +80,7 @@
 				this.vehice.driverId = item.driverId
 				this.vehice.vehicleId = item.id
 				uni.navigateTo({
-					url: '/pages/market/one/merchant/address/address'
+					url: '/pages/market/one/merchant/contacts/contacts'
 				})
 			},
 			// 通知司机