小程序首页第一次打开时图片不显示bug修复
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
</u-tabs>
|
||||
</view>
|
||||
<!-- 产品 -->
|
||||
<productsByTime v-if="tabCurrent==0" ref="productsByTime" @getTimeLength="getTimeLength">
|
||||
<productsByTime v-if="tabCurrent==0 && initStart" ref="productsByTime" @getTimeLength="getTimeLength">
|
||||
</productsByTime>
|
||||
<productsByThumb v-if="tabCurrent==1" ref="productsByThumb" @getThumbLength="getThumbLength">
|
||||
<productsByThumb v-if="tabCurrent==1 && initStart" ref="productsByThumb" @getThumbLength="getThumbLength">
|
||||
</productsByThumb>
|
||||
<view style="font-size: 24rpx;color: #A3A3A3;text-align: center;padding: 26rpx 0;"
|
||||
v-show="reachBottomLength===0">
|
||||
@@ -61,6 +61,7 @@
|
||||
},
|
||||
],
|
||||
imgUrl: '',
|
||||
initStart: false,
|
||||
swiperList: [],
|
||||
reachBottomLength: '',
|
||||
}
|
||||
@@ -75,18 +76,20 @@
|
||||
this.$refs.productsByThumb.getProductsByThumb()
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getCategories()
|
||||
this.getBanner()
|
||||
created() {
|
||||
this.getImgUrl()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
//设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
||||
menus: ["shareAppMessage", "shareTimeline"]
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getCategories()
|
||||
this.getBanner()
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
//设置下方的Menus菜单,才能够让发送给朋友与分享到朋友圈两个按钮可以点击
|
||||
menus: ["shareAppMessage", "shareTimeline"]
|
||||
})
|
||||
},
|
||||
//分享到微信好友
|
||||
onShareAppMessage(res) {
|
||||
return {
|
||||
@@ -158,10 +161,14 @@
|
||||
this.$apiServe.getImgUrl().then(res => {
|
||||
try {
|
||||
uni.setStorageSync('img_url', res.data.data.img_url);
|
||||
this.initStart = true
|
||||
this.init()
|
||||
} catch (e) {
|
||||
// error
|
||||
}
|
||||
}).finally(_ => {})
|
||||
}).finally(_ => {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user