wangfukang 13 hours ago
parent
commit
53b078d826
  1. 26
      pages/index/index.vue

26
pages/index/index.vue

@ -552,6 +552,8 @@
const HOME_AD_IMAGE_CACHE_TTL = 30 * 24 * 60 * 60 * 1000
const HOME_AD_IMAGE_CACHE_LIMIT = 40
const homeAdImageDownloading = {}
let groupBuySubPackagePreloaded = false
let groupBuySubPackagePreloading = false
const HOME_MENU_ICON_URLS = {
food: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/553230c20dea4e5c85f1e396058a7493.png',
store: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/28b5cfec79d74871b0ce67743fb7619c.png',
@ -953,8 +955,31 @@
this.indexInit()
this.$nextTick(() => {
this.refreshDaimaiStickyPosition()
this.scheduleGroupBuyListPreload()
})
},
scheduleGroupBuyListPreload() {
clearTimeout(this._groupBuyPreloadTimer)
this._groupBuyPreloadTimer = setTimeout(() => {
this.preloadGroupBuyListPage()
}, 300)
},
preloadGroupBuyListPage() {
if (groupBuySubPackagePreloaded || groupBuySubPackagePreloading) return
// #ifdef MP-WEIXIN
if (typeof wx === 'undefined' || !wx.loadSubpackage) return
groupBuySubPackagePreloading = true
wx.loadSubpackage({
root: 'package2',
success: () => {
groupBuySubPackagePreloaded = true
},
complete: () => {
groupBuySubPackagePreloading = false
}
})
// #endif
},
normalizeShareTargetPath(value) {
return normalizeShareTargetPath(value)
},
@ -1718,6 +1743,7 @@
url = '/package1/runErrand/runErrand'
break;
case '2':
this.preloadGroupBuyListPage()
url = '/package2/group/groupBuyList'
break;
case '3':

Loading…
Cancel
Save