小程序首页第一次打开时图片不显示bug修复

This commit is contained in:
邓洁
2023-02-05 17:59:47 +08:00
parent 8db95277dd
commit 0e6d4f02a2
12 changed files with 33 additions and 34 deletions

View File

@@ -124,10 +124,10 @@
}
},
onLoad(option) {
this.imgUrl = uni.getStorageSync('img_url')
this.id = option.id
this.getProductDetail()
this.getCsTel()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
//获取客服电话

View File

@@ -155,6 +155,7 @@
}
},
onTabItemTap() {
this.imgUrl = uni.getStorageSync('img_url')
console.log('----onShow')
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
console.log(uni.getStorageSync('loginToken'))
@@ -164,8 +165,6 @@
// })
return
}
this.imgUrl = uni.getStorageSync('img_url')
console.log(this.imgUrl)
this.isLoad = true
this.token = uni.getStorageSync('loginToken')
this.tabCurrent = 0
@@ -173,8 +172,6 @@
this.needsPublishForm = {}
},
onLoad(options) {
console.log('---onLoad')
console.log(options.item)
this.imgUrl = uni.getStorageSync('img_url')
//我的发布点击修改回显数据
if (options && options.item && uni.getStorageSync(options.item)) {

View File

@@ -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(_ => {
})
}
}
}