|
@@ -186,32 +186,33 @@
|
|
...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
|
|
...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
|
|
},
|
|
},
|
|
watch:{
|
|
watch:{
|
|
- startPlace(){
|
|
|
|
- console.log(this.startPlace)
|
|
|
|
- this.upCallback();
|
|
|
|
- },
|
|
|
|
|
|
+ // startPlace(){
|
|
|
|
+ // console.log(this.startPlace)
|
|
|
|
+ // this.upCallback({page});
|
|
|
|
+ // },
|
|
},
|
|
},
|
|
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)
|
|
console.log('good',1111)
|
|
// this.$nextTick(function(){
|
|
// this.$nextTick(function(){
|
|
this.getLngLat();
|
|
this.getLngLat();
|
|
- // })
|
|
|
|
-
|
|
|
|
|
|
+ // })
|
|
// #endif
|
|
// #endif
|
|
}
|
|
}
|
|
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 = '全国'
|
|
}
|
|
}
|
|
|
|
+ this.upCallback({size:10,num:1})
|
|
|
|
+ var that= this
|
|
that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
|
|
that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
|
|
reCommonId: this.userInfo.id,
|
|
reCommonId: this.userInfo.id,
|
|
}).then(res3 => {
|
|
}).then(res3 => {
|
|
@@ -288,32 +289,37 @@
|
|
},
|
|
},
|
|
confirmClick() {
|
|
confirmClick() {
|
|
let item = this.ObjSelect
|
|
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,
|
|
|
|
- id:item.id,
|
|
|
|
- billingMethod:item.billingMethod,
|
|
|
|
- freightAdvance:item.freightAdvance
|
|
|
|
- }
|
|
|
|
- this.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
|
|
|
|
|
|
+ var that=this
|
|
|
|
+ console.log(this.userInfo.phone)
|
|
|
|
+ this.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
|
|
|
|
+ driverPhone: this.userInfo.phone,
|
|
|
|
+ }).then(res2 => {
|
|
|
|
+ let _obj = {
|
|
|
|
+ driverCommonId: res2.data.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: res2.data.driverName,
|
|
|
|
+ driverPhone: res2.data.driverPhone,
|
|
|
|
+ cargoOwnerPhone: item.cargoOwnerPhone,
|
|
|
|
+ id:item.id,
|
|
|
|
+ billingMethod:item.billingMethod,
|
|
|
|
+ freightAdvance:item.freightAdvance
|
|
|
|
+ }
|
|
|
|
+ that.$request.baseRequest('post', '/publishTaskInfo/api/addOrder', _obj).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.$refs.uToast.show({
|
|
|
|
|
|
+ that.$refs.uToast.show({
|
|
type: 'success',
|
|
type: 'success',
|
|
message: "抢单成功!",
|
|
message: "抢单成功!",
|
|
complete() {
|
|
complete() {
|
|
@@ -323,7 +329,8 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.$refs.uToast.show({
|
|
|
|
|
|
+ console.log(res)
|
|
|
|
+ that.$refs.uToast.show({
|
|
type: 'error',
|
|
type: 'error',
|
|
message: res.message,
|
|
message: res.message,
|
|
})
|
|
})
|
|
@@ -332,6 +339,8 @@
|
|
.catch(res => {
|
|
.catch(res => {
|
|
uni.$u.toast(res.message);
|
|
uni.$u.toast(res.message);
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ });
|
|
this.isShowAlert = false
|
|
this.isShowAlert = false
|
|
},
|
|
},
|
|
cancelClick() {
|
|
cancelClick() {
|
|
@@ -470,13 +479,18 @@
|
|
console.log(res.data.records)
|
|
console.log(res.data.records)
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
that.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
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
|
|
|
|
|
|
+ if(res.data.records){
|
|
|
|
+ that.goods = res.data.records
|
|
|
|
+ for (let i = 0; i < that.goods.length; i++) {
|
|
|
|
+ if (that.goods[i].peripheralInfo == 1) {
|
|
|
|
+ that.isFirstIndex = i
|
|
|
|
+ return
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ }else{
|
|
|
|
+ that.goods=[]
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
})
|
|
})
|
|
@@ -551,6 +565,7 @@
|
|
},
|
|
},
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
|
|
upCallback(page) {
|
|
upCallback(page) {
|
|
|
|
+ var that =this
|
|
let _pickerSelect;
|
|
let _pickerSelect;
|
|
if (this.pickerSelect == '运费先付') {
|
|
if (this.pickerSelect == '运费先付') {
|
|
_pickerSelect = 1
|
|
_pickerSelect = 1
|
|
@@ -628,45 +643,49 @@
|
|
console.log(_data)
|
|
console.log(_data)
|
|
this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
|
|
this.$request.baseRequest('get', '/publishTaskInfo/selectGoodsSource', _data).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- console.log(res.data.records)
|
|
|
|
- // if(res.data.records){
|
|
|
|
-
|
|
|
|
- // }
|
|
|
|
- for(var i=0;i<res.data.records.length;i++){
|
|
|
|
- if(res.data.records[i].cargoDistance){
|
|
|
|
- if(res.data.records[i].cargoDistance>10){
|
|
|
|
- res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(0)
|
|
|
|
- }else{
|
|
|
|
- res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(1)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if(res.data.records[i].distance){
|
|
|
|
- if(res.data.records[i].distance>10){
|
|
|
|
- res.data.records[i].distance=res.data.records[i].distance.toFixed(0)
|
|
|
|
- }else{
|
|
|
|
- res.data.records[i].distance=res.data.records[i].distance.toFixed(1)
|
|
|
|
|
|
+ uni.hideLoading()
|
|
|
|
+ if (page.num == 1) {
|
|
|
|
+ this.goods = [];
|
|
|
|
+ // this.otherGoods = []
|
|
|
|
+ };
|
|
|
|
+ console.log(res.data.records,1111111)
|
|
|
|
+ if(res.data.records){
|
|
|
|
+ for(var i=0;i<res.data.records.length;i++){
|
|
|
|
+ if(res.data.records[i].cargoDistance){
|
|
|
|
+ if(res.data.records[i].cargoDistance>10){
|
|
|
|
+ res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(0)
|
|
|
|
+ }else{
|
|
|
|
+ res.data.records[i].cargoDistance=res.data.records[i].cargoDistance.toFixed(1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(res.data.records[i].distance){
|
|
|
|
+ if(res.data.records[i].distance>10){
|
|
|
|
+ res.data.records[i].distance=res.data.records[i].distance.toFixed(0)
|
|
|
|
+ }else{
|
|
|
|
+ res.data.records[i].distance=res.data.records[i].distance.toFixed(1)
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- uni.hideLoading()
|
|
|
|
this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
this.mescroll.endBySize(res.data.records.length, res.data.total);
|
|
// for (var i = 0; i < res.data.records.length; i++) {
|
|
// for (var i = 0; i < res.data.records.length; i++) {
|
|
// res.data.records[i].cargoOwnerName1=
|
|
// 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
|
|
|
|
|
|
+ //如果是第一页需手动制空列表
|
|
|
|
+ if(res.data.records){
|
|
|
|
+ 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{
|
|
|
|
+ that.goods=[]
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
- uni.hideLoading()
|
|
|
|
})
|
|
})
|
|
.catch(res => {
|
|
.catch(res => {
|
|
uni.$u.toast(res.message);
|
|
uni.$u.toast(res.message);
|