小程序首页第一次打开时图片不显示bug修复
This commit is contained in:
@@ -27,8 +27,8 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getCertifiedCj()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
methods: {
|
||||
// 获取认证厂家列表
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getNews()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
methods: {
|
||||
getNews() {
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
styleIsolation: 'shared', // 解除样式隔离
|
||||
},
|
||||
created() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getHistoryOrCollection()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
methods: {
|
||||
//获取历史记录
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
// this.sortType = 2
|
||||
// }
|
||||
// })
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getProductsByThumb()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
methods: {
|
||||
//获取按点赞量排列的产品列表
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
imgUrl: '',
|
||||
imgUrl: null,
|
||||
tagsArray: [],
|
||||
productList: [],
|
||||
pageNum: 1, // 当前页
|
||||
@@ -47,15 +47,8 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// uni.$on("getCurrent", data => {
|
||||
// if (data == 0) {
|
||||
// this.sortType = 1
|
||||
// } else if (data == 1) {
|
||||
// this.sortType = 2
|
||||
// }
|
||||
// })
|
||||
this.getProductsByTime()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getProductsByTime()
|
||||
},
|
||||
methods: {
|
||||
//获取按上架时间排列的产品列表
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getCertifiedCj()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pageNum++
|
||||
|
||||
@@ -57,10 +57,10 @@
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.id = option.id
|
||||
this.getCertifiedCjDetail()
|
||||
this.getCsTel()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
if (!uni.getStorageSync('loginToken') || uni.getStorageSync('loginToken').length === 0) {
|
||||
this.isLoad = false
|
||||
return
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.getNews()
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
},
|
||||
onReachBottom() {
|
||||
this.pageNum++
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</u-image>
|
||||
<view class="bgContent">
|
||||
<view>
|
||||
<u-image :src="item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
||||
<u-image :src="imgUrl+item.cover" width="346rpx" height="320rpx" :lazy-load="true">
|
||||
</u-image>
|
||||
<view class="img_tag">{{item.cate_name}}</view>
|
||||
</view>
|
||||
@@ -43,10 +43,12 @@
|
||||
pageNum: 1
|
||||
},
|
||||
queryTitle: null,
|
||||
imgUrl: null,
|
||||
productList: []
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.imgUrl = uni.getStorageSync('img_url')
|
||||
this.queryTitle = options.title
|
||||
this.goSearch()
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
//获取客服电话
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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