Merge pull request '小程序首页第一次打开时图片不显示bug修复' (#93) from dengjie into dev

Reviewed-on: http://git.hchyun.com/feashow/pupil/pulls/93
This commit is contained in:
odjbin
2023-02-05 10:01:01 +00:00
12 changed files with 33 additions and 34 deletions

View File

@@ -27,8 +27,8 @@
}
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
// 获取认证厂家列表

View File

@@ -32,8 +32,8 @@
}
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
getNews() {

View File

@@ -66,8 +66,8 @@
styleIsolation: 'shared', // 解除样式隔离
},
created() {
this.imgUrl = uni.getStorageSync('img_url')
this.getHistoryOrCollection()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
//获取历史记录

View File

@@ -53,8 +53,8 @@
// this.sortType = 2
// }
// })
this.imgUrl = uni.getStorageSync('img_url')
this.getProductsByThumb()
this.imgUrl = uni.getStorageSync('img_url')
},
methods: {
//获取按点赞量排列的产品列表

View File

@@ -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: {
//获取按上架时间排列的产品列表

View File

@@ -31,8 +31,8 @@
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getCertifiedCj()
this.imgUrl = uni.getStorageSync('img_url')
},
onReachBottom() {
this.pageNum++

View File

@@ -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

View File

@@ -36,8 +36,8 @@
}
},
onLoad() {
this.imgUrl = uni.getStorageSync('img_url')
this.getNews()
this.imgUrl = uni.getStorageSync('img_url')
},
onReachBottom() {
this.pageNum++

View File

@@ -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()
},

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