瀏覽代碼

司机端

achao 3 年之前
父節點
當前提交
d3f41fbdc6

+ 74 - 2
common/helper.js

@@ -98,7 +98,78 @@ const contactCustomerService = (item) => {
 	uni.makePhoneCall({
 		phoneNumber: '114' //仅为示例
 	});
-
+}
+//获取省份简称
+const getProvinceAbbreviation = (province) => {
+	    if(province == "北京市"||province == "北京")
+	        return "京";
+	    else if(province == "天津市"||province == "天津")
+	        return "津";
+	    else if(province == "重庆市"||province == "重庆")
+	        return "渝";
+	    else if(province == "上海市"||province == "上海")
+	        return "沪";
+	    else if(province == "河北省"||province == "河北")
+	        return "冀";
+	    else if(province == "山西省"||province == "山西")
+	        return "晋";
+	    else if(province == "辽宁省"||province == "辽宁")
+	        return "辽";
+	    else if(province == "吉林省"||province == "吉林")
+	        return "吉";
+	    else if(province == "黑龙江省"||province == "黑龙江")
+	        return "黑";
+	    else if(province == "江苏省"||province == "江苏")
+	        return "苏";
+	    else if(province == "浙江省"||province == "浙江")
+	        return "浙";
+	    else if(province == "安徽省"||province == "安徽")
+	        return "皖";
+	    else if(province == "福建省"||province == "福建")
+	        return "闽";
+	    else if(province == "江西省"||province == "江西")
+	        return "赣";
+	    else if(province == "山东省"||province == "山东")
+	        return "鲁";
+	    else if(province == "河南省"||province == "河南")
+	        return "豫";
+	    else if(province == "湖北省"||province == "湖北")
+	        return "鄂";
+	    else if(province == "湖南省"||province == "湖南")
+	        return "湘";
+	    else if(province == "广东省"||province == "广东")
+	        return "粤";
+	    else if(province == "海南省"||province == "海南")
+	        return "琼";
+	    else if(province == "四川省"||province == "四川")
+	        return "川";
+	    else if(province == "贵州省"||province == "贵州")
+	        return "贵";
+	    else if(province == "云南省"||province == "云南")
+	        return "云";
+	    else if(province == "陕西省"||province == "陕西")
+	        return "陕";
+	    else if(province == "甘肃省"||province == "甘肃")
+	        return "甘";
+	    else if(province == "青海省"||province == "青海")
+	        return "青";
+	    else if(province == "台湾省"||province == "台湾")
+	        return "台";
+	    else if(province == "内蒙古自治区"||province == "内蒙古")
+	        return "蒙";
+	    else if(province == "广西壮族自治区"||province == "广西")
+	        return "桂";
+	    else if(province == "宁夏回族自治区"||province == "宁夏")
+	        return "宁";
+	    else if(province == "新疆维吾尔自治区"||province == "新疆")
+	        return "新";
+	    else if(province == "西藏自治区"||province == "西藏")
+	        return "藏";
+	    else if(province == "香港特别行政区"||province == "香港")
+	        return "港";
+	    else if(province == "澳门特别行政区"||province == "澳门")
+	        return "澳";
+	
 }
 export default {
 	getListByUserId,
@@ -108,5 +179,6 @@ export default {
 	chooseImage,
 	imgType,
 	imgTypeList,
-	makeValidityPeriod
+	makeValidityPeriod,
+	getProvinceAbbreviation
 }

+ 1 - 1
config/index.js

@@ -1,5 +1,5 @@
 const dev = {
-	baseUrlNew: 'http://192.168.0.17:8090',
+	baseUrlNew: 'http://192.168.0.17:8091',
 	h5Appid: 'wxb66b599f7f61b46f',
 	debug: false
 }

+ 3 - 0
demo.vue

@@ -20,6 +20,7 @@
 		17、数组删除指定元素
 		18、缓存
 		19、主动刷新滚动数据
+		20、helper
 	</view>
 </template>
 
@@ -124,6 +125,8 @@
 				 // 	size: 10,
 				 // 	num: 1
 				 // })
+				 // 20、
+				 // import helper from '@/common/helper.js';
 			}
 		}
 	}

+ 251 - 112
pages/goodSource/index.vue

@@ -38,25 +38,22 @@
 		<u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @close='selectTypeClose'
 			@cancel='selectTypeClose' @confirm='confirmSelectType'></u-picker>
 		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
-			<view :id="'good'+good.id" class="good-list" v-for="good in goods" :key="good.id"
-				@click="toDetail(good.id)">
+			<view class="good-list" v-for="(good,index) in goods" :key="index" @click="toDetail(good.id)">
 				<view style="padding: 0 35rpx 20rpx 35rpx;">
 					<view class="flex flex-space-between">
 						<view class="item1">
-							<view class="ssx"></view>
+							<view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
 							<view class="level2-title">{{good.sendCity}} {{good.sendArea}}</view>
 						</view>
 
 						<image class="jt-icon item2" src="@/static/images/goodSource/jt.png" mode='widthFix'></image>
 						<view class="item3">
-							<view class="ssx"></view>
+							<view class="ssx">{{$helper.getProvinceAbbreviation(good.unloadPrivate)}}</view>
 							<view class="level2-title">{{good.unloadCity}} {{good.unloadArea}}</view>
 						</view>
-
-
 					</view>
 					<view class="right gray">
-						01.10
+						{{good.updateDate}}
 					</view>
 					<view class="flex flex-space-between">
 						<view class="left">
@@ -82,8 +79,7 @@
 				</view>
 				<view class="flex flex-space-between item-bottom">
 					<view class="left flex row">
-						<u--image :showLoading="true" :src="good.cargoOwnerPortrait" width="70rpx" height="70rpx"
-							shape="circle">
+						<u--image :src="good.cargoOwnerPortrait" width='122rpx' height='122rpx' shape="circle">
 						</u--image>
 						<view class="name">{{good.cargoOwnerName}}</view>
 						<!-- <view class="hp flex fontsize-24">
@@ -100,11 +96,76 @@
 					</view>
 				</view>
 			</view>
+			<view class="">
+				周边货源
+				<view class="good-list" v-for="(good,index) in otherGoods" :key="index" @click="toDetail(good.id)">
+					<view style="padding: 0 35rpx 20rpx 35rpx;">
+						<view class="flex flex-space-between">
+							<view class="item1">
+								<view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
+								<view class="level2-title">{{good.sendCity}} {{good.sendArea}}</view>
+							</view>
+
+							<image class="jt-icon item2" src="@/static/images/goodSource/jt.png" mode='widthFix'>
+							</image>
+							<view class="item3">
+								<view class="ssx">{{$helper.getProvinceAbbreviation(good.unloadPrivate)}}</view>
+								<view class="level2-title">{{good.unloadCity}} {{good.unloadArea}}</view>
+							</view>
+						</view>
+						<view class="right gray">
+							{{good.updateDate}}
+						</view>
+						<view class="flex flex-space-between">
+							<view class="left">
+								<view class="flex">
+									<view class="fontsize-25 gray mr20">货距 {{good.cargoDistance}}km</view>
+									<view class="fontsize-25 gray ">运距 {{good.distance}}km</view>
+								</view>
+								<view class="flex fontsize-25 gray row">
+									<view>{{good.goodsName}} | </view>
+									<view>{{carLength(good)}} | {{carType(good)}} | {{carWeight(good)}}</view>
+								</view>
+								<view class="flex row">
+									<view class="row-tips">{{good.taskDescription}}</view>
+								</view>
+							</view>
+							<view class="right flex h-color">
+								<view class="fontsize-46">
+									{{good.freightPrice}}
+								</view>
+								<view class="flex dw">元/吨</view>
+							</view>
+						</view>
+					</view>
+					<view class="flex flex-space-between item-bottom">
+						<view class="left flex row">
+							<u--image :src="good.cargoOwnerPortrait" width='122rpx' height='122rpx' shape="circle">
+							</u--image>
+							<view class="name">{{good.cargoOwnerName}}</view>
+							<!-- <view class="hp flex fontsize-24">
+								<view class="gray">评分</view>
+								<view class="number-color">99%</view>
+							</view>
+							<view class="sum flex fontsize-24">
+								<view class="gray">发运次数</view>
+								<view class="number-color">106</view>
+							</view> -->
+						</view>
+						<view class="right">
+							<view @click.stop="grabOrders(good)" class="qd">抢单</view>
+						</view>
+					</view>
+				</view>
+			</view>
 		</mescroll-body>
 		<u-toast ref="uToast"></u-toast>
+		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
+			confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
 	</view>
 </template>
 <script>
+	var that
 	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
 	import {
 		mapState
@@ -116,12 +177,16 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				ObjSelect: {},
+				isShowAlert: false,
+				alertTitle: '确定抢单?',
 				show: false,
 				columns: [
 					['全部类型', '运费先付']
 				],
-				startPlace: '1',
-				endPlace: '2',
+				startPlace: {},
+				endPlace: {},
+				otherGoods: [], // 数据列表
 				goods: [], // 数据列表
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				height: "", // 需要固定swiper的高度
@@ -143,7 +208,9 @@
 				pickerSelect: '全部类型',
 				tabIndex: 0,
 				scrollTop: 0,
-				count: 0
+				count: 0,
+				lng: '',
+				lat: ''
 			}
 		},
 		onTabItemTap(e) {
@@ -152,7 +219,6 @@
 				scrollTop: 0,
 				duration: 300
 			});
-			console.log(e)
 		},
 		created() {
 
@@ -160,34 +226,28 @@
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
 		},
-		onShow() {
+		onShow() {debugger
 			//获取上一次点击起装卸地
-			console.log(uni.getStorageSync('fPlaceObj'))
 			if (uni.getStorageSync('fPlaceObj')) {
 				this.startPlace = uni.getStorageSync('fPlaceObj');
 			} else {
-				console.log(123)
-				// this.getLngLat();
+				// #ifdef APP-PLUS
+				this.getLngLat();
+				// #endif
 			}
-			console.log(uni.getStorageSync('sPlaceObj'))
 			if (uni.getStorageSync('sPlaceObj')) {
 				this.endPlace = uni.getStorageSync('sPlaceObj');
+			} else {
+				this.endPlace.selected = '全国'
 			}
-
+// this.mescroll.resetUpScroll()
 
 		},
 		onLoad() {
 			//#ifdef APP-PLUS
 			// this.getLngLat();
 			//#endif
-			// let _isHave = this.$utils.getRoles('aaa')
-			// console.log(_isHave)
-			// var Ip=returnCitySN['cip']
-			//     var cityname=returnCitySN['cname']
-			//     localStorage.setItem('Ip', Ip)
-			//     console.log(localStorage.getItem('Ip', Ip))
-			//     localStorage.setItem('cityname', cityname)
-			//     console.log(localStorage.getItem('cityname', cityname))
+			that = this
 		},
 		onPageScroll(res) {
 			this.scrollTop = res.scrollTop
@@ -210,6 +270,56 @@
 
 		},
 		methods: {
+			mescrollInit(mescroll) {debugger
+				this.mescroll = mescroll;
+			},
+			confirmClick() {
+				let item = this.ObjSelect
+				let _obj = {
+					driverCommonId: this.firstAuthentication.commonId,
+					commonId: item.commonId,
+					cargoOwnerName: item.cargoOwnerName,
+					cargoOwner: item.cargoOwner,
+					sendPrivate: item.sendPrivate,
+					sendCity: item.sendCity,
+					sendArea: item.sendArea,
+					sendDetailedAddress: item.sendDetailedAddress,
+					unloadPrivate: item.unloadPrivate,
+					unloadCity: item.unloadCity,
+					unloadArea: item.unloadArea,
+					unloadDetailedAddress: item.unloadDetailedAddress,
+					goodsName: item.goodsName,
+					distance: item.distance,
+					freightPrice: item.freightPrice,
+					driverName: this.firstAuthentication.driverName,
+					driverPhone: this.firstAuthentication.driverPhone,
+					cargoOwnerPhone: item.cargoOwnerPhone
+				}
+
+				this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
+						if (res.code == 200) {
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "抢单成功!",
+								complete() {
+									uni.switchTab({
+										url: "/pages/order/index"
+									})
+								}
+							})
+
+						}
+
+
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
+				this.isShowAlert = false
+			},
+			cancelClick() {
+				this.isShowAlert = false
+			},
 			carLength(good) {
 				let length = ''
 				if (good.carLengthSmall && good.carLength) {
@@ -222,21 +332,21 @@
 				return length
 			},
 			carType(good) {
-				let _val = '';
-				if (good.carModel == 1) {
-					_val = '不限'
-				} else {
-					if (good.carModel.includes(2)) {
-						_val += '高栏/'
-					}
-					if (good.carModel.includes(3)) {
-						_val += '集装箱/'
-					}
-					if (good.carModel.includes(4)) {
-						_val += '自卸车'
-					}
-				}
-				return _val
+				// let _val = '';
+				// if (good.carModel == 1) {
+				// 	_val = '不限'
+				// } else {
+				// 	if (good.carModel.includes(2)) {
+				// 		_val += '高栏/'
+				// 	}
+				// 	if (good.carModel.includes(3)) {
+				// 		_val += '集装箱/'
+				// 	}
+				// 	if (good.carModel.includes(4)) {
+				// 		_val += '自卸车'
+				// 	}
+				// }
+				// return _val
 			},
 			carWeight(good) {
 				good.loadWeightSmall
@@ -265,50 +375,11 @@
 				return String(year) + String(mouth) + String(datetime)
 			},
 			grabOrders(item) {
-				let _obj = {
-					driverCommonId: this.firstAuthentication.commonId,
-					commonId: item.commonId,
-					cargoOwnerName: item.cargoOwnerName,
-					cargoOwner: item.cargoOwner,
-					sendPrivate: item.sendPrivate,
-					sendCity: item.sendCity,
-					sendArea: item.sendArea,
-					sendDetailedAddress: item.sendDetailedAddress,
-					unloadPrivate: item.unloadPrivate,
-					unloadCity: item.unloadCity,
-					unloadArea: item.unloadArea,
-					unloadDetailedAddress: item.unloadDetailedAddress,
-					goodsName: item.goodsName,
-					distance: item.distance,
-					freightPrice: item.freightPrice,
-					driverName: this.firstAuthentication.driverName,
-					driverPhone: this.firstAuthentication.driverPhone,
-					cargoOwnerPhone: item.cargoOwnerPhone
-				}
-				this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
-						debugger
-						if (res.code == 200) {
-							this.$refs.uToast.show({
-								type: 'success',
-								message: "抢单成功!",
-								complete() {
-									uni.switchTab({
-										url: "/pages/order/index"
-									})
-								}
-							})
-
-						}
-
+				this.isShowAlert = true
+				this.ObjSelect = item
 
-					})
-					.catch(res => {
-						uni.$u.toast(res.message);
-					});
 			},
 			confirmSelectType(val) {
-				debugger
-				console.log(val)
 				this.pickerSelect = val.value[0]
 				this.show = false
 			},
@@ -319,19 +390,15 @@
 				this.show = true
 			},
 			getLngLat() {
-				console.log(11111111111111111111111111111111111111111111111111111)
 				uni.getLocation({
 					type: 'gcj02',
 					geocode: true,
 					success: res => {
-						console.log('--------------------------------')
-						console.log(res)
 						if (res.latitude) {
-							this.lat = res.latitude + ',' + res.longitude;
-							this.startPlace = res.address.city
-							// this.lng = res.longitude;
+							that.startPlace.selected = res.address.city
+							this.lng = res.longitude;
+							this.lat = res.latitude;
 						} else {
-							console.log(uni.getSystemInfoSync().platform)
 							if (uni.getSystemInfoSync().platform == 'android') {
 								var context = plus.android.importClass("android.content.Context");
 								var locationManager = plus.android.importClass(
@@ -368,35 +435,92 @@
 				});
 			},
 			toDetail(id) {
-				uni.$u.route('/pages/goodSource/shippingDetails', {
-					id: id,
-				});
+				//司机是否认证身份
+				if (this.firstAuthentication.authenticationStatus == '已认证') {
+					uni.$u.route('/pages/goodSource/shippingDetails', {
+						id: id,
+					});
+				} else {
+					this.$refs.uToast.show({
+						type: 'error',
+						message: "请先完成司机认证!",
+					})
+				}
+
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
+				debugger
 				let _pickerSelect;
 				if (this.pickerSelect == '运费先付') {
 					_pickerSelect = 1
 				} else {
 					_pickerSelect = 0
 				}
+				//选择省市区
+				let _data = {
+					searchKeyWord: this.tabIndex + 1,
+					searchType: _pickerSelect,
+					// loadingPlace: this.startPlace.selected,
+					// unLoadingPlace: this.endPlace.selected=="全国"?'':this.endPlace.selected,
+					pageSize: page.size,
+					currentPage: page.num,
+
+					// loadingPlaceCity: this.startPlace.fchoosecity,
+					// unLoadingPlaceCity: this.endPlace.schoosecity
 
-				this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', {
-						// searchKeyWord: this.tabIndex + 1,
-						// searchType: _pickerSelect,
-						loadingPlace: this.startPlace.selected,
-						unLoadingPlace: this.endPlace.selected,
-						pageSize: page.size,
-						currentPage: page.num,
-						// loadingPlaceCity: this.startPlace.fchoosecity,
-						// unLoadingPlaceCity: this.endPlace.schoosecity
-
-					}).then(res => {
-						if (res.code == 200) {
-							this.goods = res.data.records
+				}
+				if (this.tabIndex == 2) {
+					// #ifdef APP-PLUS
+					this.getLngLat();
+					// #endif
+					_data.driverLongitude = this.lng
+					_data.driverLatitude = this.lat
+				}
+				console.log('------')
+				console.log(_data)
+				if (uni.getStorageSync('fPlaceObj')) {
+					if (this.startPlace.fchoosearea && this.startPlace.fchoosearea == '全部' && this.startPlace
+						.fchoosearea != '请选择区') {
+						_data.loadingPlaceCity = this.startPlace.fchoosecity
+					} else if (this.startPlace.fchoosecity == '全部') {
+						_data.loadingPlace = this.startPlace.selected
+					} else {
+						_data.loadingPlaceCity = this.startPlace.fchoosecity
+						_data.loadingPlace = this.startPlace.fchoosearea
+					}
+
+				} else {
+					_data.loadingPlaceCity = this.startPlace.fchoosecity
+				}
+				if (uni.getStorageSync('sPlaceObj')) {
+					if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
+						'请选择区') {
+						_data.unLoadingPlaceCity = this.endPlace.schoosecity
+					} else if (this.endPlace.schoosearea) {
+						_data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
+					} else {
+						_data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
+						_data.unLoadingPlaceCity = this.endPlace.schoosecity
+					}
+				} else {
+					_data.unLoadingPlace = this.endPlace.selected == "全国" ? '' : this.endPlace.selected
+				}
+
+
+
+				this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
+						if (res.code == 200) {debugger
 							this.mescroll.endBySize(res.data.records.length, res.data.total);
+							if (page.num == 1) {
+								this.goods = [];
+								// this.otherGoods = []
+							}; //如果是第一页需手动制空列表
+							// if(!res.data.records[0].publishTaskInfoList) res.data.records[0].publishTaskInfoList = []
+							// if(!res.data.records[0].publishTaskInfoLists) res.data.records[0].publishTaskInfoLists = []
+							this.goods = this.goods.concat(res.data.records); //追加新数据
+							// this.otherGoods = this.otherGoods.concat(res.data.records[0].publishTaskInfoLists);
 						}
-
 					})
 					.catch(res => {
 						uni.$u.toast(res.message);
@@ -449,9 +573,14 @@
 				// })
 			},
 			clickTab(val) {
-				console.log(val)
+				this.tabIndex = val.index
+				this.upCallback({
+					size: 10,
+					num: 1,
+				})
 			},
 			changeCity() {
+				debugger
 				if (this.endPlace == '全国') {
 					this.$refs.uToast.show({
 						type: 'error',
@@ -459,15 +588,25 @@
 					})
 					return
 				}
-				[this.startPlace, this.endPlace] = [this.endPlace, this.startPlace];
+
+				[this.startPlace.fchooseprovince, this.endPlace.schooseprovince] = [this.endPlace.schooseprovince, this
+					.startPlace.fchooseprovince
+				];
+				[this.startPlace.fchoosecity, this.endPlace.schoosecity] = [this.endPlace.schoosecity, this.startPlace
+					.fchoosecity
+				];
+				[this.startPlace.fchoosearea, this.endPlace.schoosearea] = [this.endPlace.schoosearea, this.startPlace
+					.fchoosearea
+				];
+				[this.startPlace.selected, this.endPlace.selected] = [this.endPlace.selected, this.startPlace.selected];
+				// [this.startPlace, this.endPlace] = [this.endPlace, this.startPlace];
 			},
 			goCity(type) {
 				uni.$u.route('/pages/goodSource/selectCity', {
-					startPlace: this.startPlace,
-					endPlace: this.endPlace,
+					startPlace: JSON.stringify(this.startPlace),
+					endPlace: JSON.stringify(this.endPlace),
 					type: type
 				});
-				console.log(type)
 			},
 			swiperChange(e) {
 				this.tabIndex = e.detail.current

+ 25 - 6
pages/goodSource/selectCity.vue

@@ -11,7 +11,7 @@
 				<view class="content1" v-if="type==0">
 					<view class="history-city-title">历史发货地</view>
 					<view class="city-list">
-						<view class="city" v-for="(item,index) in historyFcityList" :key='index'>
+						<view class="city" v-for="(item,index) in historyFcityList" :key='index' @click="historyClick(0,item)">
 							{{item.selected}}
 						</view>
 					</view>
@@ -19,7 +19,7 @@
 				<view class="content2" v-if="type==1">
 					<view class="history-city-title">历史收货地</view>
 					<view class="city-list">
-						<view class="city" v-for="(item,index) in historyScityList" :key='index'>
+						<view class="city" v-for="(item,index) in historyScityList" :key='index' @click="historyClick(1,item)">
 							{{item.selected}}
 						</view>
 					</view>
@@ -130,10 +130,10 @@
 			console.log('---------------------------------')
 			console.log(this.type)
 		},
-		onLoad(options) {
+		onLoad(options) {debugger
 			console.log(options)
 			this.type = options.type
-			this.title = options.startPlace + '→' + options.endPlace
+			this.title = JSON.parse(options.startPlace).selected + '→' + JSON.parse(options.endPlace).selected
 			//获取缓存收发地
 
 			if (uni.getStorageSync('fPlaceList')) {
@@ -151,6 +151,25 @@
 			//赋值地区
 		},
 		methods: {
+			historyClick(type,val){
+				debugger
+				console.log(type)
+				if(type==0){
+					this.historyFcityList.unshift(val)
+					let _newList = this.makeHistoryList(val)
+					uni.setStorageSync('fPlaceList', _newList);
+					uni.setStorageSync('fPlaceObj', val);
+				}else{
+					this.historyScityList.unshift(val)
+					let _newList = this.makeHistoryList(val)
+					uni.setStorageSync('sPlaceList', _newList);
+					uni.setStorageSync('sPlaceObj',val )
+			
+				}
+				uni.switchTab({
+					url: '/pages/goodSource/index'
+				});
+			},
 			// 历史收发地去重
 			makeHistoryList(val) {
 				if (this.type == 0) {
@@ -208,7 +227,7 @@
 			confirmBtn() {
 				//设置地区 0发货地 1收货地
 				if (this.type == 0) {
-					if (this.fchooseprovince == '选择' || (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
+					if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
 						this.$refs.uToast.show({
 							type: 'error',
 							message: "请选择区域!",
@@ -275,7 +294,7 @@
 					});
 				} else {
 					//收货地
-					if (this.schooseprovince == '选择' || (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
+					if (this.schooseprovince == '选择' ||(this.schoosearea == '请选择区'&&this.schoosecity!='全部')|| (this.schoosecity == '请选择市' && this.schooseprovince != '全国')) {
 						this.$refs.uToast.show({
 							type: 'error',
 							message: "请选择区域!",

+ 90 - 17
pages/goodSource/shippingDetails.vue

@@ -1,8 +1,8 @@
 <!-- 发运详情 -->
 <template>
 	<view class="content">
-		<!-- 	<u-navbar title="发运详情" :bgColor="bgColor" @leftClick='back' :placeholder='true' leftIconColor="#fff" titleStyle='color:#fff'
-			rightText='已关注'>
+		<!-- <u-navbar title="发运详情" :bgColor="bgColor" @leftClick='back' :placeholder='true' leftIconColor="#fff" titleStyle='color:#fff'
+			:rightText='caseText' @rightClick="rightClick">
 		</u-navbar> -->
 		<u-navbar title="发运详情" :bgColor="bgColor" @leftClick='back' :placeholder='true' leftIconColor="#fff"
 			titleStyle='color:#fff'>
@@ -26,24 +26,24 @@
 				</view>
 				<view class="row">
 					<view class="flex">
-						黑龙江中天贸易有限公司
+						{{detailData.cargoOwner}}
 					</view>
 				</view>
 				<!-- 当前版本不做 -->
-				<!-- 		<view class="row3 flex fontsize-24">
-					<view class="item flex">
+				<view class="row3 flex fontsize-24">
+					<!-- <view class="item flex">
 						<view class="gray">好评率</view>
 						<view class="number-color">99%</view>
-					</view>
-					<view class="item flex">
+					</view> -->
+					<!-- 	<view class="item flex">
 						<view class="gray">发运次数</view>
 						<view class="number-color">106</view>
-					</view>
-					<view class="item flex">
+					</view> -->
+					<!-- <view class="item flex">
 						<view class="gray">评价</view>
 						<view class="number-color">10</view>
-					</view>
-				</view> -->
+					</view> -->
+				</view>
 				<view class="row4">
 					<view class="flex fontsize-26">
 						<view class="left">装</view>
@@ -109,13 +109,15 @@
 				<view class="left">运费<view class="text">{{detailData.freightPrice}}元/吨</view>
 				</view>
 				<view class="right">
-					<view class="btn">立即抢单</view>
+					<view class="btn" @click.stop="grabOrders()">立即抢单</view>
 				</view>
 				<!-- <view class="right">
 					<u-button type="error" text="已抢单" disabled></u-button>
 				</view> -->
 			</view>
-
+			 <u-toast ref="uToast"></u-toast>
+			<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
+				confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
 		</view>
 	</view>
 </template>
@@ -127,6 +129,9 @@
 	export default {
 		data() {
 			return {
+				isShowAlert: false,
+				alertTitle: '确定抢单?',
+				caseText: '关注',
 				bgColor: '#317AFE',
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				id: '',
@@ -134,14 +139,16 @@
 			};
 		},
 		onLoad(options) {
+			debugger
 			console.log(options)
 			this.id = options.id
 			this.init()
 
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo']),
+			...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
 			carLength() {
+				debugger
 				let length = ''
 				if (this.detailData.carLengthSmall && this.detailData.carLength) {
 					length = this.detailData.carLengthSmall + '~' + this.detailData.carLength + '米'
@@ -154,6 +161,7 @@
 			},
 			carType() {
 				let _val = '';
+				if (!this.detailData.carModel) this.detailData.carModel = ''
 				if (this.detailData.carModel == 1) {
 					_val = '不限'
 				} else {
@@ -184,9 +192,22 @@
 			},
 		},
 		methods: {
-			init() {
-				this.$request.baseRequest('get', '/publishTaskInfo/seeTask', {
-						id:this.id,
+			rightClick() {
+				uni.$u.toast('后台接口未写');
+				// 关注
+				// console.log(123)
+				// this.$request.baseRequest('get', '/publishTaskInfo/seeTask', {
+				// 		reCommonId: this.userInfo.id,
+				// 	}).then(res => {
+				// 		this.mescroll.resetUpScroll()
+				// 	})
+				// 	.catch(res => {
+				// 		uni.$u.toast(res.message);
+				// 	});
+			},
+			async init() {
+				await this.$request.baseRequest('get', '/publishTaskInfo/seeTask', {
+						id: this.id,
 						// id: '8f1f3c624d7946d79a9d44a4057d9623',
 					}).then(res => {
 						debugger
@@ -213,6 +234,58 @@
 					phoneNumber: '114' //仅为示例
 				});
 			},
+			grabOrders() {
+				this.isShowAlert = true
+
+			},
+			confirmClick() {
+				let item = this.detailData
+				let _obj = {
+					driverCommonId: this.firstAuthentication.commonId,
+					commonId: item.commonId,
+					cargoOwnerName: item.cargoOwnerName,
+					cargoOwner: item.cargoOwner,
+					sendPrivate: item.sendPrivate,
+					sendCity: item.sendCity,
+					sendArea: item.sendArea,
+					sendDetailedAddress: item.sendDetailedAddress,
+					unloadPrivate: item.unloadPrivate,
+					unloadCity: item.unloadCity,
+					unloadArea: item.unloadArea,
+					unloadDetailedAddress: item.unloadDetailedAddress,
+					goodsName: item.goodsName,
+					distance: item.distance,
+					freightPrice: item.freightPrice,
+					driverName: this.firstAuthentication.driverName,
+					driverPhone: this.firstAuthentication.driverPhone,
+					cargoOwnerPhone: item.cargoOwnerPhone
+				}
+
+				this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
+						debugger
+						if (res.code == 200) {
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "抢单成功!",
+								complete() {
+									uni.switchTab({
+										url: "/pages/order/index"
+									})
+								}
+							})
+
+						}
+
+
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
+				this.isShowAlert = false
+			},
+			cancelClick() {
+				this.isShowAlert = false
+			},
 		}
 	}
 </script>

+ 22 - 8
pages/mine/editDriverCertificationNext.vue

@@ -222,7 +222,7 @@
 				:closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
 			</u-picker>
 		</view>
- <!-- <u-modal :show="isShowAlert" :title="" :content='修改认证信息需要重新登录!' :closeOnClickOverlay='true' :showCancelButton='true' confirmColor='#22C572'  @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal> -->
+		<!-- <u-modal :show="isShowAlert" :title="" :content='修改认证信息需要重新登录!' :closeOnClickOverlay='true' :showCancelButton='true' confirmColor='#22C572'  @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal> -->
 	</view>
 </template>
 
@@ -233,7 +233,7 @@
 		components: {},
 		data() {
 			return {
-				isShowAlert:false,
+				isShowAlert: false,
 				consentStatus: false,
 				isGCar: true,
 				ValidityPeriodType: '',
@@ -543,17 +543,31 @@
 
 			},
 			submit() {
-
+				if (!this.consentStatus) {
+					uni.showToast({
+						title: '请勾选协议',
+						icon: 'none',
+						duration: 2000
+					})
+					return
+				}
 				// 校验
 				if (this.validate()) return
 				this.delSubmitObj()
 
 				this.$request.baseRequest('post', '/driverInfo/api/editInfo', this.dataDetails).then(res => {
-						if (res.code == 200) {debugger
-							
-							// uni.switchTab({
-							// 	url: '/pages/mine/index'
-							// })
+						if (res.code == 200) {
+							debugger
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "提交成功!",
+								complete() {
+									uni.switchTab({
+										url: '/pages/mine/index'
+									})
+								}
+							})
+
 						}
 
 

+ 52 - 38
pages/mine/index.vue

@@ -36,7 +36,7 @@
 					<image class="sfrz-icon" src="@/static/images/mine/pingjia@2x.png" mode='widthFix'>
 					</image>
 				</view>
-				<view class="right-text" @click="goDetailPage('/pages/mine/driverCertification')">
+				<view class="right-text">
 					<view class="top">货主评价</view>
 					<view class="bottom">看看货主对你的评价吧</view>
 				</view>
@@ -88,7 +88,7 @@
 		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
 			:showCancelButton='true' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
 			@cancel="cancelClick"></u-modal>
-			<u-toast ref="uToast"></u-toast>
+		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
 
@@ -109,39 +109,15 @@
 				statusVal: '',
 				isFirstRZ: null,
 				driverCall: '',
-				isFirstSH:false
+				isFirstSH: false
 
 			};
 		},
 		onShow() {
-			console.log("111111111111111111111111111", this.firstAuthentication)
-			if (this.firstAuthentication) {
-				this.userName = this.firstAuthentication.driverCall
-				if (this.firstAuthentication.authenticationStatus == '审核中') {
-					this.statusVal = '身份认证审核中'
-				} else if (this.firstAuthentication.authenticationStatus == '未通过') {
-					this.statusVal = '身份认证未通过'
-				} else {
-					this.statusVal = '已认证'
-				}
-			} else {
-				this.statusVal = '你还没有完成身份认证'
-				this.userName = this.userInfo.userName
-				this.isFirstSH = true
-			}
-			this.phone = this.userInfo.phone
-			if (this.userInfo) {
-				if (!this.userInfo.avatarUrl) {
-					this.headUrl = "../../static/images/myimg/YongHu@3x.png"
-				} else {
-					this.headUrl = this.userInfo.avatarUrl
-				}
-				this.userphone = this.userInfo.phone
-
-			} else {
-				this.headUrl = "../../static/images/myimg/YongHu@3x.png"
-				this.username = "立即登录"
-			}
+			debugger
+			// console.log("111111111111111111111111111", this.firstAuthentication)
+			//获取认证状态
+			this.getAuthenticationStatus()
 
 
 
@@ -150,7 +126,7 @@
 			that = this
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo', 'firstAuthentication']),
+			...mapState(['hasLogin', 'userInfo']),
 			// 手机号中间4位加*
 			// starUserphone() {
 			// 	let reg = /^(\d{3})\d{4}(\d{4})$/;
@@ -160,7 +136,45 @@
 			// }
 		},
 		methods: {
+			async getAuthenticationStatus() {
+
+				await this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
+						driverPhone: this.userInfo.phone,
+					}).then(res => {
+						debugger
+						this.firstAuthentication = res.data
+						if (this.firstAuthentication) {
+							this.userName = this.firstAuthentication.driverCall
+							if (this.firstAuthentication.authenticationStatus == '审核中') {
+								this.statusVal = '身份认证审核中'
+							} else if (this.firstAuthentication.authenticationStatus == '未通过') {
+								this.statusVal = '身份认证未通过'
+							} else {
+								this.statusVal = '已认证'
+							}
+						} else {
+							this.statusVal = '你还没有完成身份认证'
+							this.userName = this.userInfo.userName
+							this.isFirstSH = true
+						}
+						this.phone = this.userInfo.phone
+						if (this.userInfo) {
+							if (!this.userInfo.avatarUrl) {
+								this.headUrl = "../../static/images/myimg/YongHu@3x.png"
+							} else {
+								this.headUrl = this.userInfo.avatarUrl
+							}
+							this.userphone = this.userInfo.phone
 
+						} else {
+							this.headUrl = "../../static/images/myimg/YongHu@3x.png"
+							this.username = "立即登录"
+						}
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
+			},
 			confirmClick() {
 				this.isShowAlert = false
 				uni.$u.route('/pages/public/login');
@@ -168,22 +182,22 @@
 			cancelClick() {
 				this.isShowAlert = false
 			},
-			goDetailPage(src,type) {
+			goDetailPage(src, type) {
 				if (!this.hasLogin) {
 					this.isShowAlert = true;
 				} else {
-					if(type==1&&this.statusVal == '已认证'){
-						src='/pages/mine/editDriverCertification'
+					if (type == 1 && this.statusVal == '已认证') {
+						src = '/pages/mine/editDriverCertification'
 					}
-					if((type==2||type==3)&&this.isFirstSH){
+					if ((type == 2 || type == 3) && this.isFirstSH) {
 						this.$refs.uToast.show({
 							type: 'error',
 							message: "请先完成司机身份认证",
 						})
-					}else{
+					} else {
 						uni.$u.route(src);
 					}
-					
+
 				}
 
 			},

+ 2 - 3
pages/mine/manageVehicles/addVehicle.vue

@@ -119,11 +119,10 @@
 			};
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo']),
+			...mapState(['hasLogin', 'userInfo','firstAuthentication']),
 		},
-		onLoad(options) {
+		onLoad(options) {debugger
 			_this = this;
-			console.log(options)
 			this.dataDetails.driverId = this.userInfo.driverId
 		},
 		methods: {

+ 4 - 2
pages/mine/manageVehicles/index.vue

@@ -46,9 +46,10 @@
 			};
 		},
 		computed: {
-			...mapState(['hasLogin', 'userInfo']),
+			...mapState(['hasLogin', 'userInfo','firstAuthentication']),
 		},
 		onLoad(options) {
+			console.log(this.firstAuthentication.id)
 			_this = this;
 			if (!this.hasLogin) {
 				uni.$u.route('/pages/public/login');
@@ -58,8 +59,9 @@
 		},
 		methods: {
 			init() {
-				this.$request.baseRequest('post', '/driverCarInfo/selectCar', {
+				this.$request.baseRequest('get', '/driverCarInfo/selectDriverCar', {
 						driverId: this.userInfo.driverId,
+						// driverId:this.firstAuthentication.id
 					}).then(res => {
 						if (res.code == '200') {
 							this.carList = res.data

+ 52 - 19
pages/news/index.vue

@@ -2,28 +2,32 @@
 	<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
 		style="background-color: #F5F6FA;">
 		<u-navbar title="消息中心" leftIconSize='0' :bgColor="bgColor" :placeholder='true' leftIconColor="#fff"
-			titleStyle='color:#fff' rightText='一键已读'>
+			titleStyle='color:#fff' rightText='一键已读' @rightClick="rightClick">
 		</u-navbar>
 		<view class="top-bgc"></view>
 		<view class="content">
-			<view class="info-item flex" v-for="good in goods" :key="good.id">
+			<view class="info-item flex" v-for="(item,index) in news" :key="index" @click="read(item)">
 				<view class="left">
-					<u--image :showLoading="true" src="@/static/images/news/xt.png" width="80rpx" height="80rpx"></u--image>
+					<image src="@/static/images/news/cy.png" class="img" v-if="item.newsType=='承运通知'">
+					</image>
+					<image src="@/static/images/news/xt.png" class="img" v-else>
+					</image>
+
 				</view>
 				<view class="right">
 					<view class="row1 flex flex-space-between">
 						<view class="title">
-							系统消息
+							{{item.newsType}}
 						</view>
 						<view class="time">
-							11:00
+							{{item.updateDate}}
 						</view>
 					</view>
 					<view class="row2 flex flex-space-between align-center">
 						<view class="text point">
-							您的驾驶证即将到期,请尽快到“我的…您的驾驶证即将到期,请尽快到“我的…您的驾驶证即将到期,请尽快到“我的…您的驾驶证即将到期,请尽快到“我的…
+							{{item.newsContent}}
 						</view>
-						<view class="red-point"></view>
+						<view class="red-point" v-if="item.newsFlag==0"></view>
 					</view>
 				</view>
 				<!-- 	<view class="flex flex-space-between">
@@ -56,7 +60,7 @@
 				src: 'https://cdn.uviewui.com/uview/album/1.jpg',
 				bgColor: '#317AFE',
 				value: 100,
-				goods: [], // 数据列表
+				news: [], // 数据列表
 				badgeOffset: [0, -5]
 			}
 		},
@@ -64,11 +68,35 @@
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
 		},
 		methods: {
+			rightClick() {
+				console.log(123)
+				this.$request.baseRequest('post', '/newsInfo/api/editAllNewsInfo', {
+						reCommonId: this.userInfo.id,
+					}).then(res => {
+						this.mescroll.resetUpScroll()
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
+			},
+			read(val) {
+				this.$request.baseRequest('post', '/newsInfo/api/editNewsInfo', {
+						id: val.id,
+					}).then(res => {
+						this.mescroll.resetUpScroll()
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
+			},
 			back() {
 				uni.navigateBack({
 
 				})
 			},
+			mescrollInit(mescroll) {
+				this.mescroll = mescroll;
+			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
 			upCallback(page) {
 				// 此处可以继续请求其他接口
@@ -88,17 +116,17 @@
 				// }
 
 				//联网加载数据
-			this.$request.baseRequest('get', '/newsInfo/selectNewsInfo', {
-					commonId:  this.userInfo.id,
-					pageSize: page.size,
-					currentPage: page.num,
-				}).then(res => {
-						this.goods = res.data.records
+				this.$request.baseRequest('get', '/newsInfo/selectNewsInfo', {
+						reCommonId: this.userInfo.id,
+						pageSize: page.size,
+						currentPage: page.num,
+					}).then(res => {
+						this.news = res.data.records
 						this.mescroll.endBySize(res.data.records.length, res.data.total);
-				})
-				.catch(res => {
-				uni.$u.toast( res.message);
-				});
+					})
+					.catch(res => {
+						uni.$u.toast(res.message);
+					});
 			}
 		}
 	}
@@ -130,7 +158,12 @@
 	}
 
 	.info-item {
-		padding: 30rpx 0;
+		padding: 30rpx;
+
+		.img {
+			width: 80rpx;
+			height: 80rpx;
+		}
 
 		.left {
 			margin-right: 20rpx;

+ 5 - 3
pages/order/confirmLoading.vue

@@ -114,12 +114,14 @@
 			console.log(options)
 			this.detailData = options;
 			this.detailData.contractNo = 'CYHT20220317000001'
+			this.detailData.id = this.detailData.carrierId
 			this.detailData.carrierInfo = {
+				id:this.detailData.carrierId,
 				carNo: '123',
 				loadingDate: '2022-03-17',
 				estimatedFreight: '100',
-				loadingAreaLongitude: '',
-				loadingAreaLatitude: '',
+				loadingAreaLongitude: '123.123',
+				loadingAreaLatitude: '321.321',
 				sendCity: '营口',
 				sendArea: '鲅鱼圈',
 				loadingImg: ''
@@ -184,7 +186,7 @@
 				// })
 			},
 			confirmClick() {
-				this.$request.baseRequest('post', '/carrierInfo/loadingAdd', this.detailData).then(res => {
+				this.$request.baseRequest('post', '/carrierInfo/loadingAdd', this.detailData.carrierInfo).then(res => {
 						if (res.code == 200) {
 							this.$refs.uToast.show({
 								type: 'success',

+ 14 - 9
pages/order/index.vue

@@ -29,14 +29,14 @@
 						</view>
 						<view class="flex row2">
 							<view class="left flex flex-space-between">
-								<view class="ssx"></view>
+								<view class="ssx">{{$helper.getProvinceAbbreviation(good.sendPrivate)}}</view>
 								<view class="level2-title">{{good.sendCity}} {{good.sendArea}}</view>
 								<view>
 									<image class="jt-icon" src="@/static/images/goodSource/jt.png" mode='widthFix'>
 									</image>
 								</view>
 								<view class="ssx">
-									
+									{{$helper.getProvinceAbbreviation(good.unloadPrivate)}}
 								</view>
 								<view class="level2-title">{{good.unloadCity}} {{good.unloadArea}}</view>
 							</view>
@@ -61,13 +61,13 @@
 							<view class="car">{{good.freight}}{{good.illingMethod==0?'元/吨':'元/车'}}</view>
 						</view>
 						<view class="row5 flex flex-end">
-							<!-- <view class="stop active" @click.stop="stop(good)">终止</view> -->
-							<view class="start normal" @click.stop="confirmLoading(good)">确认装车</view>
-							<!-- <view class="start">联系客服</view> -->
-							<!-- <view class="start normal" @click.stop="confirmUnLoading(good)">确认卸车</view> -->
+							<view class="stop active" @click.stop="stop(good)" v-if="good.orderStatus=='待货主确认'||good.orderStatus=='未装车'">终止</view>
+							<view class="start normal" @click.stop="confirmLoading(good)" v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">确认装车</view>
+							<view class="start normal" v-if="good.orderStatus!='未装车'&&good.orderStatus!='待货主确认'">联系客服</view>
+							<view class="start normal" @click.stop="confirmUnLoading(good)" v-if="good.orderStatus=='运输中'||good.orderStatus=='货主驳回卸车信息'||good.orderStatus=='平台驳回卸车信息'">确认卸车</view>
 							<!-- 				<view class="start">评价</view>
 							-->
-							<!-- <view class="start normal" @click.stop="closed(good)">完结</view> -->
+							<view class="start normal" @click.stop="closed(good)" v-if="good.orderStatus=='结算中'">完结</view>
 						</view>
 					</view>
 				</view>
@@ -122,6 +122,11 @@
 		mixins: [MescrollMixin], // 使用mixin
 		data() {
 			return {
+				// isShowStopBtn: false,
+				// isConfirmLoadingBtn:false,
+				// isShowCustomerServiceBtn:false,
+				// isConfirmUnLoadingBtn:false,
+				// isClosedBtn:false,
 				searchKeyWord: '',
 				useSearchList: [],
 				mescroll: null,
@@ -189,7 +194,6 @@
 				scrollTop: 0,
 				duration: 300
 			});
-			console.log(e)
 		},
 		created() {
 			//#ifdef APP-PLUS
@@ -305,7 +309,7 @@
 				}
 				this.$request.baseRequest('post', '/orderInfo/api/end', {
 						id: this.id,
-						terminator:1,
+						terminator: 1,
 						terminationReason: _terminationReason,
 						terminationReasonDescription: this.value2
 					}).then(res => {
@@ -369,6 +373,7 @@
 						if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
 						this.goods = this.goods.concat(res.data.records); //追加新数据
 						this.mescroll.endBySize(res.data.records.length, res.data.total);
+						
 					})
 					.catch(res => {
 						uni.$u.toast(res.message);

+ 9 - 23
pages/order/orderDetails.vue

@@ -6,37 +6,23 @@
 			<view class='title flex flex-center'>
 				<u-icon class="back" name="arrow-left" color="" size="20" @click="back"></u-icon>
 				<view class="nav-title">订单</view>
-				<u-icon class="search" name="search" color="" size="28" @click="search"></u-icon>
+				<u-icon class="search" name="server-fill" color="" size="28" @click="$helper.contactCustomerService"></u-icon>
 			</view>
 		</view>
 		<view class="content1">
 			<view class="item1">
 				<view class="status">{{dataObj.orderStatus}}</view>
-<!-- 				<view class="status">未装车</view>
-				<view class="status">待货主确认装车</view>
-				<view class="status">货主驳回装车信息</view>
-				<view class="status">待平台确认装车</view>
-				<view class="status">平台驳回装车信息</view>
-				<view class="status">运输中</view>
-				<view class="status">待货主确认卸车</view>
-				<view class="status">货主驳回卸车信息</view>
-				<view class="status">待平台确认卸车</view>
-				<view class="status">平台驳回卸车信息</view>
-				<view class="status">待结算</view>
-				<view class="status">已结算</view>
-				<view class="status">已终止</view>
-				<view class="status">结算中</view>
-				<view class="status">已完结</view> -->
+
 			</view>
 			<!-- flex flex-space-between -->
 			<view class="item2">
-				<u-button class="btn" text="终止" @click="stop"></u-button>
-				<!-- <u-button class="btn" text="联系客服" @click="$helper.contactCustomerService"></u-button> -->
-				<!-- <u-button class="btn" text="确认装车" @click="confirmLoading()"></u-button> -->
-				<!-- <u-button class="btn" text="修改装车信息"  @click="confirmLoading()></u-button> -->
-				<!-- <u-button class="btn" text="确认卸车" @click="confirmUnLoading"></u-button> -->
-				<!-- <u-button class="btn" text="修改卸车信息" @click="confirmUnLoading"></u-button> -->
-				<!-- <u-button class="btn" text="完结" @click="closed"></u-button> -->
+				<u-button class="btn" text="终止" @click="stop"  v-if="dataObj.orderStatus=='待货主确认'||dataObj.orderStatus=='未装车'"></u-button>
+				<!-- <u-button class="btn" text="联系客服"  @click="$helper.contactCustomerService"></u-button> -->
+				<u-button class="btn" text="确认装车" @click="confirmLoading" v-if="dataObj.orderStatus=='未装车'"></u-button>
+				<u-button class="btn" text="修改装车信息"  @click="confirmLoading" v-if="dataObj.orderStatus=='货主驳回装车信息'||dataObj.orderStatus=='平台驳回装车信息'"></u-button>
+				<u-button class="btn" text="确认卸车" @click="confirmUnLoading" v-if="dataObj.orderStatus=='运输中'"></u-button>
+				<u-button class="btn" text="修改卸车信息" @click="confirmUnLoading" v-if="dataObj.orderStatus=='货主驳回卸车信息'||dataObj.orderStatus=='平台驳回卸车信息'"></u-button>
+				<u-button class="btn" text="完结" @click="closed" v-if="dataObj.orderStatus=='结算中'"></u-button>
 			</view>
 			<view class="item3 flex flex-space-between align-center">
 				<view class="left flex align-center">

+ 15 - 2
pages/public/lginOther.vue

@@ -36,7 +36,7 @@
 				dataDetails: {
 					phone: '',
 					password: '',
-					 loginFlag :2
+					loginFlag: 2
 				},
 				rules: {
 					phone: [{
@@ -109,9 +109,22 @@
 				this.$refs.loginForm.validate().then(res => {
 					uni.showLoading({
 						title: '登录中',
-						mask:true
+						mask: true
 					})
 					_this.$request.baseRequest('get', '/commonUser/login', _this.dataDetails).then(res => {
+							if (res.data.code == '11002') {
+								uni.$u.toast('验证码错误或过期,请重新获取')
+
+								return
+							} else if (res.data.code == '11004') {
+								uni.$u.toast('该手机号已注册,可直接登录')
+
+								return
+							} else if (res.data.code == '11006') {
+								uni.$u.toast('手机号或密码错误!')
+
+								return
+							}
 							_this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
 									driverPhone: _this.dataDetails.phone,
 								}).then(res1 => {

+ 16 - 2
pages/public/login.vue

@@ -10,7 +10,7 @@
 				</u-form-item>
 
 				<u-form-item label="验证码" prop="code" labelWidth="80" borderBottom>
-					<u--input v-model="dataDetails.code" border="none" placeholder="请填写验证码"></u--input>
+					<input v-model="dataDetails.code" border="none" placeholder="请填写验证码"></input>
 					<u-button slot="right" @tap="getCode" :text="tips" class="code-style" size="mini"
 						:disabled="disabled1">
 					</u-button>
@@ -19,7 +19,7 @@
 					@end="disabled1 = false">
 				</u-code>
 			</u--form>
-			<u-button @tap="login" class="code-style submit">登录</u-button>
+			<button @tap="login" class="code-style submit">登录</button>
 			<view @click='gonumber' class="use-password" style='text-align:center;color:#6A6A6A;'>使用账号密码登录</view>
 			<!-- <u-button type="primary" text="登录" customStyle="margin-top: 50px" @click="login()"></u-button>
 			<u-button type="primary" @click='goregister'>手机号一键注册</u-button> -->
@@ -133,6 +133,20 @@
 							verifyCode: _this.dataDetails.code,
 							loginFlag: 2
 						}).then(res => {
+							if (res.data.code == '11002') {
+								uni.$u.toast('验证码错误或过期,请重新获取')
+
+								return
+							} else if (res.data.code == '11004') {
+								uni.$u.toast('该手机号已注册,可直接登录')
+
+								return
+							} else if (res.data.code == '11006') {
+								uni.$u.toast('手机号或密码错误!')
+
+								return
+							}
+
 							_this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
 									driverPhone: _this.dataDetails.phone,
 								}).then(res1 => {

+ 32 - 27
pages/public/register.vue

@@ -7,17 +7,19 @@
 				<u-form-item label="电话" prop="phone" borderBottom>
 					<u--input v-model="registerData.phone" border="none" placeholder="请输入手机号码"></u--input>
 				</u-form-item>
-			
+
 				<u-form-item label="验证码" prop="verifyCode" labelWidth="80" borderBottom>
 					<u--input v-model="registerData.verifyCode" border="none" placeholder="请填写验证码"></u--input>
-					<u-button slot="right" @tap="getCode" :text="tips"  size="mini" :disabled="disabled1" class="code-style">
+					<u-button slot="right" @tap="getCode" :text="tips" size="mini" :disabled="disabled1"
+						class="code-style">
 					</u-button>
 				</u-form-item>
 				<u-form-item label="密码" prop="password" borderBottom>
 					<u--input v-model="registerData.password" border="none" placeholder="请输入密码,6-16位字符"></u--input>
 				</u-form-item>
-			
-				<u-code ref="uCode" @change="codeChange" seconds="20" @start="disabled1 = true" @end="disabled1 = false">
+
+				<u-code ref="uCode" @change="codeChange" seconds="20" @start="disabled1 = true"
+					@end="disabled1 = false">
 				</u-code>
 			</u--form>
 			<u-button class="code-style register" @click='register'>注册</u-button>
@@ -33,7 +35,7 @@
 					class="path" hover-class="navigator-hover">《隐私政策》</navigator>
 			</view>
 		</view>
-	
+
 	</view>
 </template>
 
@@ -53,8 +55,7 @@
 					verifyCode: '',
 				},
 				rules: {
-					phone: [
-						{
+					phone: [{
 							required: true,
 							message: '请输入手机号',
 							trigger: ['change', 'blur'],
@@ -68,7 +69,7 @@
 							},
 							message: '手机号码不正确',
 							// 触发器可以同时用blur和change
-							trigger: [ 'blur'],
+							trigger: ['blur'],
 						}
 					],
 					verifyCode: {
@@ -191,30 +192,30 @@
 								uni.$u.toast('该手机号已注册,可直接登录')
 
 								return
-							} 
+							}
 							uni.showLoading({
 								title: '登录中',
 								mask: true
 							})
 							_this.$request.baseRequest('get', '/commonUser/login', {
-								phone: _this.registerData.phone,
-								password: _this.registerData.password,
-								cid: uni.getStorageSync("clientId")
-							}).then(res => {
-								uni.hideLoading()
-								uni.setStorageSync('userInfo', res.data)
-								_this.$store.commit('login', res.data)
-								uni.switchTab({
-									url: '/pages/goodSource/index'
-								});
-									
+									phone: _this.registerData.phone,
+									password: _this.registerData.password,
+									cid: uni.getStorageSync("clientId")
+								}).then(res => {
+									uni.hideLoading()
+									uni.setStorageSync('userInfo', res.data)
+									_this.$store.commit('login', res.data)
+									uni.switchTab({
+										url: '/pages/goodSource/index'
+									});
+
 								})
 								.catch(res => {
 									uni.$u.toast(res.message)
 								});
-							
-							
-							
+
+
+
 						})
 						.catch(res => {
 							uni.$u.toast(res.message)
@@ -258,22 +259,26 @@
 		background: #2772FB;
 		color: white;
 	}
-	.register{
+
+	.register {
 		margin-top: 50rpx;
 	}
+
 	.service {
 		font-size: 24rpx;
 		margin: 20rpx;
 		justify-content: center;
-	
+
 		/deep/.u-image {
 			margin: 0 20rpx;
 		}
 	}
-	.path{
+
+	.path {
 		color: #2772FB;
 	}
-	.Semibold{
+
+	.Semibold {
 		margin-bottom: 50rpx;
 	}
 </style>

File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


File diff suppressed because it is too large
+ 131 - 761
unpackage/dist/dev/app-plus/app-view.js


+ 1 - 1
util/request.js

@@ -20,7 +20,7 @@ const baseRequest = (method, url, data,header) => {
 		let promise = new Promise(function(resolve, reject) {
 			uni.request(baseDefaultOpts).then(
 				(res) => {
-					console.log(JSON.stringify(res[1].data))
+					// console.log(JSON.stringify(res[1].data))
 						resolve(res[1].data)
 					// if(res[1].data.code == '200' || res[1].data.code == 200){
 					// 	// 后端返回的状态码100为成功状态,成功则返回请求结果,在app调试时可以通过console.log(JSON.stringify(res[1].data))来查看返回值(以项目实际情况为准)

Some files were not shown because too many files changed in this diff