|
@@ -186,31 +186,37 @@
|
|
computed: {
|
|
computed: {
|
|
...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
|
|
...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
|
|
},
|
|
},
|
|
|
|
+ watch:{
|
|
|
|
+ startPlace(){
|
|
|
|
+ console.log(this.startPlace)
|
|
|
|
+ this.upCallback();
|
|
|
|
+ },
|
|
|
|
+ },
|
|
onShow() {
|
|
onShow() {
|
|
//获取上一次点击起装卸地
|
|
//获取上一次点击起装卸地
|
|
if (uni.getStorageSync('fPlaceObj')) {
|
|
if (uni.getStorageSync('fPlaceObj')) {
|
|
this.startPlace = uni.getStorageSync('fPlaceObj');
|
|
this.startPlace = uni.getStorageSync('fPlaceObj');
|
|
|
|
+ this.upCallback({size:10,num:1})
|
|
} else {
|
|
} else {
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
var that=this
|
|
var that=this
|
|
|
|
+ console.log('good',1111)
|
|
// this.$nextTick(function(){
|
|
// this.$nextTick(function(){
|
|
this.getLngLat();
|
|
this.getLngLat();
|
|
// })
|
|
// })
|
|
|
|
|
|
// #endif
|
|
// #endif
|
|
- if(!this.startPlace.selected){
|
|
|
|
- this.startPlace.selected = ''
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
if (uni.getStorageSync('sPlaceObj')) {
|
|
if (uni.getStorageSync('sPlaceObj')) {
|
|
this.endPlace = uni.getStorageSync('sPlaceObj');
|
|
this.endPlace = uni.getStorageSync('sPlaceObj');
|
|
|
|
+ this.upCallback({size:10,num:1})
|
|
} else {
|
|
} else {
|
|
this.endPlace.selected = '全国'
|
|
this.endPlace.selected = '全国'
|
|
}
|
|
}
|
|
that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
|
|
that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
|
|
reCommonId: this.userInfo.id,
|
|
reCommonId: this.userInfo.id,
|
|
}).then(res3 => {
|
|
}).then(res3 => {
|
|
- if (res3.data) {
|
|
|
|
|
|
+ if (res3.data||res3.data==0) {
|
|
let name = 'myTip';
|
|
let name = 'myTip';
|
|
let value = res3.data
|
|
let value = res3.data
|
|
if (value == 0) {
|
|
if (value == 0) {
|
|
@@ -406,23 +412,61 @@
|
|
},
|
|
},
|
|
getLngLat() {
|
|
getLngLat() {
|
|
var that=this
|
|
var that=this
|
|
- uni.showLoading({
|
|
|
|
- title: '获取定位信息'
|
|
|
|
- })
|
|
|
|
|
|
+ // uni.showLoading({
|
|
|
|
+ // title: '获取定位信息'
|
|
|
|
+ // })
|
|
|
|
+
|
|
uni.getLocation({
|
|
uni.getLocation({
|
|
type: 'gcj02',
|
|
type: 'gcj02',
|
|
geocode: true,
|
|
geocode: true,
|
|
success: res => {
|
|
success: res => {
|
|
if (res.latitude) {
|
|
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.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.$set(that.startPlace,'selected',res.address.city)
|
|
that.lng = res.longitude;
|
|
that.lng = res.longitude;
|
|
that.lat = res.latitude;
|
|
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 {
|
|
} else {
|
|
if (uni.getSystemInfoSync().platform == 'android') {
|
|
if (uni.getSystemInfoSync().platform == 'android') {
|
|
var context = plus.android.importClass("android.content.Context");
|
|
var context = plus.android.importClass("android.content.Context");
|
|
@@ -462,22 +506,34 @@
|
|
});
|
|
});
|
|
},
|
|
},
|
|
toDetail(id) {
|
|
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 */
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
@@ -503,73 +559,86 @@
|
|
}
|
|
}
|
|
// if (this.tabIndex == 2) {
|
|
// if (this.tabIndex == 2) {
|
|
if(!this.startPlace.selected){
|
|
if(!this.startPlace.selected){
|
|
|
|
+ console.log(1)
|
|
this.getLngLat();
|
|
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) {
|
|
clickTab(val) {
|
|
this.tabIndex = val.index
|
|
this.tabIndex = val.index
|
|
@@ -582,7 +651,7 @@
|
|
if (this.endPlace.selected == '全国') {
|
|
if (this.endPlace.selected == '全国') {
|
|
this.$refs.uToast.show({
|
|
this.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
- message: "卸车地为全国不允许切换!",
|
|
|
|
|
|
+ message: "装车地不能为全国!",
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -777,6 +846,7 @@
|
|
|
|
|
|
.other-goods {
|
|
.other-goods {
|
|
// background: red;
|
|
// background: red;
|
|
|
|
+ color:#999999;
|
|
margin: 40rpx 0;
|
|
margin: 40rpx 0;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: center;
|
|
justify-content: center;
|