|
|
|
@ -370,6 +370,9 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pages:[{ |
|
|
|
name:'商家订单详情111', |
|
|
|
url:'/package2/shop/orderDetail' |
|
|
|
},{ |
|
|
|
name:'发布订单评价111', |
|
|
|
url:'/package1/order/orderEvaluate' |
|
|
|
},{ |
|
|
|
@ -567,59 +570,7 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
let that = this |
|
|
|
uni.getSystemInfo({ |
|
|
|
success: function(info) { |
|
|
|
that.width = info.screenWidth * 2; |
|
|
|
} |
|
|
|
}); |
|
|
|
let worker = uni.getStorageSync('worker') |
|
|
|
if(worker != '' && worker != undefined && worker != null){ |
|
|
|
this.worker = worker |
|
|
|
} |
|
|
|
// 获取用户当前位置 |
|
|
|
this.getUserLocation(); |
|
|
|
// 建立WebSocket连接或定时请求获取配送员位置 |
|
|
|
this.getDeliveryLocation(); |
|
|
|
if(!uni.getStorageSync('area')){ |
|
|
|
this.checkArea() |
|
|
|
}else{ |
|
|
|
if(uni.getStorageSync('area')){ |
|
|
|
this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id; |
|
|
|
} |
|
|
|
let area = JSON.parse(uni.getStorageSync('area')) |
|
|
|
this.areaName = area.title |
|
|
|
if(uni.getStorageSync('waimaiData')){ |
|
|
|
let waimailist = uni.getStorageSync('waimaiData') |
|
|
|
if(waimailist.length > 0){ |
|
|
|
for(let a = 0;a<waimailist.length;a++){ |
|
|
|
let waimai = { |
|
|
|
getAreaId:waimailist[a].getAreaId, |
|
|
|
putAreaId:waimailist[a].putAreaId |
|
|
|
} |
|
|
|
this.searchForm.waimaiData.push(waimai) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(uni.getStorageSync('kuaidiData')){ |
|
|
|
let waimailist = uni.getStorageSync('kuaidiData') |
|
|
|
if(waimailist.length > 0){ |
|
|
|
for(let a = 0;a<waimailist.length;a++){ |
|
|
|
let waimai = { |
|
|
|
getAreaId:waimailist[a].getAreaId, |
|
|
|
putAreaId:waimailist[a].putAreaId |
|
|
|
} |
|
|
|
this.searchForm.kuaidiData.push(waimai) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.getDelivery(); |
|
|
|
this.getShopArea(); |
|
|
|
this.$refs.tabBar.getWorkerCounts() |
|
|
|
} |
|
|
|
// 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 |
|
|
|
const info = uni.getSystemInfoSync(); |
|
|
|
this.navBarHeight = info.statusBarHeight; |
|
|
|
this.indexInit() |
|
|
|
}, |
|
|
|
onReady() { |
|
|
|
// 记录分类栏相对页面的偏移量,用于上滑检测 |
|
|
|
@ -631,6 +582,61 @@ |
|
|
|
}, 500); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
indexInit(){ |
|
|
|
let that = this |
|
|
|
uni.getSystemInfo({ |
|
|
|
success: function(info) { |
|
|
|
that.width = info.screenWidth * 2; |
|
|
|
} |
|
|
|
}); |
|
|
|
let worker = uni.getStorageSync('worker') |
|
|
|
if(worker != '' && worker != undefined && worker != null){ |
|
|
|
this.worker = worker |
|
|
|
} |
|
|
|
// 获取用户当前位置 |
|
|
|
this.getUserLocation(); |
|
|
|
// 建立WebSocket连接或定时请求获取配送员位置 |
|
|
|
this.getDeliveryLocation(); |
|
|
|
if(!uni.getStorageSync('area')){ |
|
|
|
this.checkArea() |
|
|
|
}else{ |
|
|
|
if(uni.getStorageSync('area')){ |
|
|
|
this.searchForm.regionId = JSON.parse(uni.getStorageSync('area')).id; |
|
|
|
} |
|
|
|
let area = JSON.parse(uni.getStorageSync('area')) |
|
|
|
this.areaName = area.title |
|
|
|
if(uni.getStorageSync('waimaiData')){ |
|
|
|
let waimailist = uni.getStorageSync('waimaiData') |
|
|
|
if(waimailist.length > 0){ |
|
|
|
for(let a = 0;a<waimailist.length;a++){ |
|
|
|
let waimai = { |
|
|
|
getAreaId:waimailist[a].getAreaId, |
|
|
|
putAreaId:waimailist[a].putAreaId |
|
|
|
} |
|
|
|
this.searchForm.waimaiData.push(waimai) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(uni.getStorageSync('kuaidiData')){ |
|
|
|
let waimailist = uni.getStorageSync('kuaidiData') |
|
|
|
if(waimailist.length > 0){ |
|
|
|
for(let a = 0;a<waimailist.length;a++){ |
|
|
|
let waimai = { |
|
|
|
getAreaId:waimailist[a].getAreaId, |
|
|
|
putAreaId:waimailist[a].putAreaId |
|
|
|
} |
|
|
|
this.searchForm.kuaidiData.push(waimai) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.getDelivery(); |
|
|
|
this.getShopArea(); |
|
|
|
this.$refs.tabBar.getWorkerCounts() |
|
|
|
} |
|
|
|
// 计算导航栏高度用于sticky offset:statusBarHeight + 40px内容区 |
|
|
|
const info = uni.getSystemInfoSync(); |
|
|
|
this.navBarHeight = info.statusBarHeight; |
|
|
|
}, |
|
|
|
// 内部切换方法:带isSwitching保护,防止程序化滚动期间闪回 |
|
|
|
_switchCategory(index) { |
|
|
|
if (this.isSwitching) return; |
|
|
|
@ -925,6 +931,9 @@ |
|
|
|
this.lastIndex = this.currentIndex |
|
|
|
this.currentIndex = index |
|
|
|
switch (index) { |
|
|
|
case 0: |
|
|
|
this.indexInit() |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
let worker = uni.getStorageSync('worker') |
|
|
|
if(worker == '' || worker == undefined || worker == null){ |
|
|
|
|