gjy 2 years ago
parent
commit
e853d9e9c6

+ 1 - 1
common/helper.js

@@ -210,7 +210,7 @@ function isToday(str,type) {
 	}
 }
 const changeTime = (t1) => {
-	console.log(t1)
+	// console.log(t1)
 	// t1截止时间  t2当前时间
 	// 调用getDtes函数把当前时间传过去,获取本周一和本周日时间戳
 	// var weeks = getDates(t2)

+ 162 - 92
pages/goodSource/index.vue

@@ -186,31 +186,37 @@
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
 		},
+		watch:{
+			startPlace(){
+				console.log(this.startPlace)
+                this.upCallback();
+            },
+		},
 		onShow() {
 			//获取上一次点击起装卸地
 			if (uni.getStorageSync('fPlaceObj')) {
 				this.startPlace = uni.getStorageSync('fPlaceObj');
+				this.upCallback({size:10,num:1})
 			} else {
 				// #ifdef APP-PLUS
 				var that=this
+				console.log('good',1111)
 				// this.$nextTick(function(){
 					this.getLngLat();
 				// })
 				
 				// #endif
-				if(!this.startPlace.selected){
-					this.startPlace.selected = ''
-				}
 			}
 			if (uni.getStorageSync('sPlaceObj')) {
 				this.endPlace = uni.getStorageSync('sPlaceObj');
+				this.upCallback({size:10,num:1})
 			} else {
 				this.endPlace.selected = '全国'
 			}
 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 				reCommonId: this.userInfo.id,
 			}).then(res3 => {
-				if (res3.data) {
+				if (res3.data||res3.data==0) {
 					let name = 'myTip';
 					let value = res3.data
 					if (value == 0) {
@@ -406,23 +412,61 @@
 			},
 			getLngLat() {
 				var that=this
-				uni.showLoading({
-					title: '获取定位信息'
-				})
+				// uni.showLoading({
+				// 	title: '获取定位信息'
+				// })
+				
 				uni.getLocation({
 					type: 'gcj02',
 					geocode: true,
 					success: res => {
 						if (res.latitude) {
-							// console.log(that.startPlace)
-							// if(res.address.city.indexOf('市')!=-1){
-							// 	res.address.city=res.address.city.substring(0,res.address.city.length-1)
-							// }
+							// console.log(res,333333)
+							if(res.address.city){
+								if(res.address.city.indexOf('市')!=-1){
+									res.address.city=res.address.city.substring(0,res.address.city.length-1)
+								}
+							}
+							let _pickerSelect;
+							if (that.pickerSelect == '运费先付') {
+								_pickerSelect = 1
+							} else {
+								_pickerSelect = 0
+							}
 							that.startPlace.selected=res.address.city
+							that.startPlace.fchoosecity=res.address.city
+							let _data = {
+								searchKeyWord: this.tabIndex + 1,
+								searchType: _pickerSelect,
+							
+								pageSize: 10,
+								currentPage: 1,
+								loadingPlaceCity: that.startPlace.fchoosecity,
+								// unLoadingPlaceCity: this.endPlace.schoosecity
+							
+							}
+							that.$forceUpdate()
 							// that.$set(that.startPlace,'selected',res.address.city)
 							that.lng = res.longitude;
 							that.lat = res.latitude;
-							uni.hideLoading()
+							that.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
+									if (res.code == 200) {
+										uni.hideLoading()
+										that.mescroll.endBySize(res.data.records.length, res.data.total);
+										that.goods = res.data.records
+										for (let i = 0; i < that.goods.length; i++) {
+											if (that.goods[i].peripheralInfo == 1) {
+												that.isFirstIndex = i
+												return
+											}
+										}
+									}
+									uni.hideLoading()
+								})
+								.catch(res => {
+									uni.$u.toast(res.message);
+									that.mescroll.endErr();
+								});
 						} else {
 							if (uni.getSystemInfoSync().platform == 'android') {
 								var context = plus.android.importClass("android.content.Context");
@@ -462,22 +506,34 @@
 				});
 			},
 			toDetail(id) {
-				//司机是否认证身份
-				if (this.firstAuthentication.authenticationStatus == '已认证') {
-					uni.$u.route('/pages/goodSource/shippingDetails', {
-						id: id,
-					});
-				} else if (this.firstAuthentication.authenticationStatus == '已过期') {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "证件已过期,请上传新证件!",
-					})
-				} else {
-					this.$refs.uToast.show({
-						type: 'error',
-						message: "请先完成司机认证!",
-					})
-				}
+				var that=this
+				that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
+					driverPhone: this.userInfo.phone,
+				}).then(res2 => {
+					// console.log('跳转',1111111)
+					uni.setStorageSync('firstAuthentication', res2.data)
+					that.firstAuthentication=uni.getStorageSync('firstAuthentication')
+					// console.log(that.firstAuthentication)
+					//司机是否认证身份
+					if (that.firstAuthentication.authenticationStatus == '已认证') {
+						uni.$u.route('/pages/goodSource/shippingDetails', {
+							id: id,
+						});
+					} else if (that.firstAuthentication.authenticationStatus == '已过期') {
+						that.$refs.uToast.show({
+							type: 'error',
+							message: "证件已过期,请上传新证件!",
+						})
+					} else {
+						that.$refs.uToast.show({
+							type: 'error',
+							message: "请先完成司机认证!",
+						})
+					}
+				
+				})
+				
+				
 
 			},
 			/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
@@ -503,73 +559,86 @@
 				}
 				// if (this.tabIndex == 2) {
 					if(!this.startPlace.selected){
+						console.log(1)
 						this.getLngLat();
-					}
-					_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
-				}
-				if (this.lng) {
-					_data.longitude = this.lng
-					_data.latitude = this.lat
-				}
-				uni.showLoading({
-					mask: true,
-					title: '加载中'
-				})
-				this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
-						if (res.code == 200) {
-							uni.hideLoading()
-							this.mescroll.endBySize(res.data.records.length, res.data.total);
-							// for (var i = 0; i < res.data.records.length; i++) {
-							// 	res.data.records[i].cargoOwnerName1=
-							// }
-							if (page.num == 1) {
-								this.goods = [];
-								// this.otherGoods = []
-							}; //如果是第一页需手动制空列表
-							that.goods = that.goods.concat(res.data.records);
-							for (let i = 0; i < that.goods.length; i++) {
-								if (that.goods[i].peripheralInfo == 1) {
-									that.isFirstIndex = i
-									return
+					}else{
+						
+						_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
+								if(this.startPlace.fchoosecity=='市辖区'){
+									_data.loadingPlaceCity = this.startPlace.fchooseprovince
+								}else{
+									_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
 						}
-						uni.hideLoading()
-					})
-					.catch(res => {
-						uni.$u.toast(res.message);
-						this.mescroll.endErr();
-					});
+						if (uni.getStorageSync('sPlaceObj')) {
+							if (this.endPlace.schoosearea && this.endPlace.schoosearea == '全部' && this.endPlace.schoosearea !=
+								'请选择区') {
+									if(this.endPlace.schoosecity=='市辖区'){
+										_data.unLoadingPlaceCity = this.endPlace.schooseprovince
+									}else{
+										_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
+						}
+						if (this.lng) {
+							_data.longitude = this.lng
+							_data.latitude = this.lat
+						}
+						uni.showLoading({
+							mask: true,
+							title: '加载中'
+						})
+						this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
+								if (res.code == 200) {
+									uni.hideLoading()
+									this.mescroll.endBySize(res.data.records.length, res.data.total);
+									// for (var i = 0; i < res.data.records.length; i++) {
+									// 	res.data.records[i].cargoOwnerName1=
+									// }
+									if (page.num == 1) {
+										this.goods = [];
+										// this.otherGoods = []
+									}; //如果是第一页需手动制空列表
+									that.goods = that.goods.concat(res.data.records);
+									for (let i = 0; i < that.goods.length; i++) {
+										if (that.goods[i].peripheralInfo == 1) {
+											that.isFirstIndex = i
+											return
+										}
+									}
+								}
+								uni.hideLoading()
+							})
+							.catch(res => {
+								uni.$u.toast(res.message);
+								this.mescroll.endErr();
+							});
+					}
+					
 			},
 			clickTab(val) {
 				this.tabIndex = val.index
@@ -582,7 +651,7 @@
 				if (this.endPlace.selected == '全国') {
 					this.$refs.uToast.show({
 						type: 'error',
-						message: "卸车地为全国不允许切换!",
+						message: "装车地不能为全国!",
 					})
 					return
 				}
@@ -777,6 +846,7 @@
 
 	.other-goods {
 		// background: red;
+		color:#999999;
 		margin: 40rpx 0;
 		display: flex;
 		justify-content: center;

+ 2 - 2
pages/goodSource/selectCity.vue

@@ -225,14 +225,14 @@
 			},
 			confirmBtn() {
 				//设置地区 0发货地 1收货地
-				if (this.type == 0) {
+				// if (this.type == 0||this.type == 1) {
 					if (this.fchooseprovince == '选择' ||(this.fchoosearea == '请选择区'&&this.fchoosecity!='全部')|| (this.fchoosecity == '请选择市' && this.fchooseprovince != '全国')) {
 						this.$refs.uToast.show({
 							type: 'error',
 							message: "请选择区域!",
 						})
 						return
-					}
+					// }
 					console.log("省", this.fchooseprovince)
 					console.log("市", this.fchoosecity)
 					console.log("区", this.fchoosearea)

+ 7 - 6
pages/mine/driverCertificationNext.vue

@@ -368,12 +368,12 @@
 			},
 			// 上传图片
 			imgTypeSelect(val) {
-				console.log(val)
+				// console.log(val)
 				console.log(this.uploadType)
-				if (val.name == '相册') {
+				// if (val.name == '相册') {
 					uni.chooseImage({
 						count: 1,
-						sourceType: this.$helper.chooseImage.sourceType,
+						// sourceType: this.$helper.chooseImage.sourceType,
 						success: function(res) {
 							console.log(JSON.stringify(res.tempFilePaths));
 							uploadImage("images",res.tempFilePaths[0], 'appData/',
@@ -449,13 +449,14 @@
 						}
 					});
 
-				} else {
+				// } else {
 
-				}
+				// }
 			},
 			uploadImg(type) {
 				this.uploadType = type
-				this.isShowimgType = true
+				this.imgTypeSelect()
+				// this.isShowimgType = true
 			},
 			validate() {
 				// true 为校验不通过

+ 3 - 3
pages/mine/index.vue

@@ -11,9 +11,9 @@
 				<u--image class="flex-end" :showLoading="true" :src="headUrl" width="60px" height="60px" shape='circle'>
 				</u--image>
 				<view class="right-text">
-					<view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }} 
+					<!-- <view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }} -->
 					<!-- {{hasLogin?driverSex:""}} -->
-					<!-- <view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }} {{hasLogin?driverSex:""}} -->
+					<view @click="toLogin" class="name">{{hasLogin? userName : '立即登录' }} {{hasLogin?driverSex:""}}
 					</view>
 					<view @click="toLogin" class="phone" v-if="hasLogin">{{starUserphone}}</view>
 				</view>
@@ -160,7 +160,7 @@
 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 				reCommonId: this.userInfo.id,
 			}).then(res3 => {
-				if (res3.data) {
+				if (res3.data||res3.data==0) {
 					let name = 'myTip';
 					let value = res3.data
 					if (value == 0) {

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

@@ -1383,4 +1383,7 @@
 		height: 80rpx;
 		z-index: 9;
 	}
+	/deep/.uni-input-input:disabled{
+		background:#fff;
+	}
 </style>

+ 3 - 1
pages/news/index.vue

@@ -110,7 +110,7 @@
 				that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 					reCommonId: this.userInfo.id,
 				}).then(res3 => {
-					if (res3.data) {
+					if (res3.data||res3.data==0) {
 						let name = 'myTip';
 						let value = res3.data
 						if (value == 0) {
@@ -249,7 +249,9 @@
 						pageSize: page.size,
 						currentPage: page.num,
 					}).then(res => {
+						if(page.num==1){this.news=[]}
 						this.news = this.news.concat(res.data.records); //追加新数据
+						this.$forceUpdate()
 						this.mescroll.endBySize(res.data.records.length, res.data.total);
 					})
 					.catch(res => {

+ 1 - 1
pages/order/index.vue

@@ -305,7 +305,7 @@
 			that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
 				reCommonId: this.userInfo.id,
 			}).then(res3 => {
-				if (res3.data) {
+				if (res3.data||res3.data==0) {
 					let name = 'myTip';
 					let value = res3.data
 					if (value == 0) {