|
|
@ -44,6 +44,40 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
onLoad(option) { |
|
|
|
|
|
|
|
let taht = this |
|
|
|
|
|
|
|
const updateManager = uni.getUpdateManager(); |
|
|
|
|
|
|
|
updateManager.onCheckForUpdate(function(res) { |
|
|
|
|
|
|
|
// 请求完新版本信息的回调 |
|
|
|
|
|
|
|
console.log('请求完新版本信息的回调', res.hasUpdate); |
|
|
|
|
|
|
|
if (!res.hasUpdate) { |
|
|
|
|
|
|
|
taht.initFn(option) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateManager.onUpdateReady(function(res) { |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: '更新提示', |
|
|
|
|
|
|
|
content: '新版本已经准备好,是否重启应用?', |
|
|
|
|
|
|
|
success(res) { |
|
|
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
|
|
console.log(res.confirm, 'res.confirm版本信息') |
|
|
|
|
|
|
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 |
|
|
|
|
|
|
|
updateManager.applyUpdate(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
taht.initFn(option) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateManager.onUpdateFailed(function(res) { |
|
|
|
|
|
|
|
console.log('新的版本下载失败') |
|
|
|
|
|
|
|
// 新的版本下载失败 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onReady(option) {}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
initFn(option) { |
|
|
|
const token = uni.getStorageSync('Authorization') |
|
|
|
const token = uni.getStorageSync('Authorization') |
|
|
|
const openid = uni.getStorageSync('openid') |
|
|
|
const openid = uni.getStorageSync('openid') |
|
|
|
let key = '' |
|
|
|
let key = '' |
|
|
@ -52,13 +86,6 @@ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
key = '离线' |
|
|
|
key = '离线' |
|
|
|
} |
|
|
|
} |
|
|
|
if (key == '在线') { |
|
|
|
|
|
|
|
// if (!uni.getStorageSync('filterData')) { |
|
|
|
|
|
|
|
// this.getFilterData() |
|
|
|
|
|
|
|
// } else if (uni.getStorageSync('filterData')[0].detailList.length < 2) { |
|
|
|
|
|
|
|
// this.getFilterData() |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 在页面中定义插屏广告 |
|
|
|
// 在页面中定义插屏广告 |
|
|
|
let interstitialAd = null |
|
|
|
let interstitialAd = null |
|
|
|
|
|
|
|
|
|
|
@ -113,34 +140,6 @@ |
|
|
|
}, 2000) |
|
|
|
}, 2000) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
onReady(option) { |
|
|
|
|
|
|
|
const updateManager = uni.getUpdateManager(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateManager.onCheckForUpdate(function(res) { |
|
|
|
|
|
|
|
// 请求完新版本信息的回调 |
|
|
|
|
|
|
|
console.log('请求完新版本信息的回调', res.hasUpdate); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateManager.onUpdateReady(function(res) { |
|
|
|
|
|
|
|
uni.showModal({ |
|
|
|
|
|
|
|
title: '更新提示', |
|
|
|
|
|
|
|
content: '新版本已经准备好,是否重启应用?', |
|
|
|
|
|
|
|
success(res) { |
|
|
|
|
|
|
|
if (res.confirm) { |
|
|
|
|
|
|
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 |
|
|
|
|
|
|
|
updateManager.applyUpdate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateManager.onUpdateFailed(function(res) { |
|
|
|
|
|
|
|
// 新的版本下载失败 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
getFilterData() { |
|
|
|
getFilterData() { |
|
|
|
console.log('在线') |
|
|
|
console.log('在线') |
|
|
|
oilSiteApi.getCheckInfo().then(res => { |
|
|
|
oilSiteApi.getCheckInfo().then(res => { |
|
|
@ -172,7 +171,7 @@ |
|
|
|
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes) |
|
|
|
this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes) |
|
|
|
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands) |
|
|
|
this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands) |
|
|
|
uni.setStorageSync('filterData', this.menuList); |
|
|
|
uni.setStorageSync('filterData', this.menuList); |
|
|
|
console.log('存入',this.menuList) |
|
|
|
console.log('存入', this.menuList) |
|
|
|
// this.$refs.slFilter.resetMenuList(this.menuList) |
|
|
|
// this.$refs.slFilter.resetMenuList(this.menuList) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|