增加缓存代客下单商品以及布局信息
This commit is contained in:
@@ -198,9 +198,9 @@
|
||||
menuHeight: 0, // 左边菜单的高度
|
||||
menuItemHeight: 0, // 左边菜单item的高度
|
||||
itemId: '', // 栏目右边scroll-view用于滚动的id
|
||||
tabbar: [],
|
||||
tabbar: storageManage.cacheGoods()||[],
|
||||
menuItemPos: [],
|
||||
arr: [],
|
||||
arr: storageManage.cacheGoodsNode()||[],//左右联动布局节点信息
|
||||
scrollRightTop: 0, // 右边栏目scroll-view的滚动条高度
|
||||
timer: null, // 定时器
|
||||
topZhanwei: 136 + 24,
|
||||
@@ -288,6 +288,7 @@
|
||||
})
|
||||
data.tabbar = tabbar
|
||||
storageManage.cacheGoods(data.tabbar)
|
||||
getMenuItemTop()
|
||||
}
|
||||
|
||||
|
||||
@@ -302,10 +303,10 @@
|
||||
//获取商品列表
|
||||
function getGoods(par = {
|
||||
page: 0,
|
||||
size: 300,
|
||||
showLoading:data.tabbar.length<=0?true:false
|
||||
size: 300
|
||||
}) {
|
||||
return Api.getGoodsLists(par)
|
||||
const showLoading=data.tabbar.length<=0?true:false
|
||||
return Api.getGoodsLists(par,showLoading)
|
||||
}
|
||||
//获取购物车数据
|
||||
async function getCart(par = {
|
||||
@@ -399,12 +400,14 @@
|
||||
|
||||
//获取桌台信息
|
||||
async function getTableInfo() {
|
||||
const res = await $table.get({
|
||||
qrcode: data.table.tableId
|
||||
})
|
||||
console.log(res);
|
||||
if (res && res.content[0]) {
|
||||
// data.table=res.content[0]
|
||||
if(data.table.tableId){
|
||||
const res = await $table.get({
|
||||
qrcode: data.table.tableId
|
||||
})
|
||||
console.log(res);
|
||||
if (res && res.content[0]) {
|
||||
// data.table=res.content[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
let $originGoods = []
|
||||
@@ -965,6 +968,7 @@
|
||||
rects.forEach((rect) => {
|
||||
// 这里减去rects[0].top,是因为第一项顶部可能不是贴到导航栏(比如有个搜索框的情况)
|
||||
data.arr.push(rect.top - rects[0].top);
|
||||
storageManage.cacheGoodsNode(data.arr)
|
||||
resolve();
|
||||
})
|
||||
}).exec()
|
||||
@@ -1089,7 +1093,6 @@
|
||||
// go.back()
|
||||
// }, 1500)
|
||||
// }
|
||||
data.tabbar=storageManage.cacheGoods()
|
||||
init()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user