diff --git a/components/certifiedCj/certifiedCj.vue b/components/certifiedCj/certifiedCj.vue index 32222b6..af123df 100644 --- a/components/certifiedCj/certifiedCj.vue +++ b/components/certifiedCj/certifiedCj.vue @@ -27,8 +27,8 @@ } }, created() { + this.imgUrl = uni.getStorageSync('img_url') this.getCertifiedCj() - this.imgUrl = uni.getStorageSync('img_url') }, methods: { // 获取认证厂家列表 diff --git a/components/news/news.vue b/components/news/news.vue index af550a8..e95a466 100644 --- a/components/news/news.vue +++ b/components/news/news.vue @@ -32,8 +32,8 @@ } }, created() { + this.imgUrl = uni.getStorageSync('img_url') this.getNews() - this.imgUrl = uni.getStorageSync('img_url') }, methods: { getNews() { diff --git a/components/productsBtn/productsBtn.vue b/components/productsBtn/productsBtn.vue index 4b531e3..3ae1745 100644 --- a/components/productsBtn/productsBtn.vue +++ b/components/productsBtn/productsBtn.vue @@ -66,8 +66,8 @@ styleIsolation: 'shared', // 解除样式隔离 }, created() { + this.imgUrl = uni.getStorageSync('img_url') this.getHistoryOrCollection() - this.imgUrl = uni.getStorageSync('img_url') }, methods: { //获取历史记录 diff --git a/components/productsByThumb/productsByThumb.vue b/components/productsByThumb/productsByThumb.vue index 5d92239..f6cfd7b 100644 --- a/components/productsByThumb/productsByThumb.vue +++ b/components/productsByThumb/productsByThumb.vue @@ -53,8 +53,8 @@ // this.sortType = 2 // } // }) + this.imgUrl = uni.getStorageSync('img_url') this.getProductsByThumb() - this.imgUrl = uni.getStorageSync('img_url') }, methods: { //获取按点赞量排列的产品列表 diff --git a/components/productsByTime/productsByTime.vue b/components/productsByTime/productsByTime.vue index 827eaea..3a72f3f 100644 --- a/components/productsByTime/productsByTime.vue +++ b/components/productsByTime/productsByTime.vue @@ -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: { //获取按上架时间排列的产品列表 diff --git a/packageReport/certifiedCj/certifiedCj.vue b/packageReport/certifiedCj/certifiedCj.vue index bd0de80..77b7c17 100644 --- a/packageReport/certifiedCj/certifiedCj.vue +++ b/packageReport/certifiedCj/certifiedCj.vue @@ -31,8 +31,8 @@ } }, onLoad() { + this.imgUrl = uni.getStorageSync('img_url') this.getCertifiedCj() - this.imgUrl = uni.getStorageSync('img_url') }, onReachBottom() { this.pageNum++ diff --git a/packageReport/certifiedCjDetail/certifiedCjDetail.vue b/packageReport/certifiedCjDetail/certifiedCjDetail.vue index 9402ad6..e33c8f0 100644 --- a/packageReport/certifiedCjDetail/certifiedCjDetail.vue +++ b/packageReport/certifiedCjDetail/certifiedCjDetail.vue @@ -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 diff --git a/packageReport/newsList/newsList.vue b/packageReport/newsList/newsList.vue index 4538176..3f058c2 100644 --- a/packageReport/newsList/newsList.vue +++ b/packageReport/newsList/newsList.vue @@ -36,8 +36,8 @@ } }, onLoad() { + this.imgUrl = uni.getStorageSync('img_url') this.getNews() - this.imgUrl = uni.getStorageSync('img_url') }, onReachBottom() { this.pageNum++ diff --git a/packageSearch/search-products/search-products.vue b/packageSearch/search-products/search-products.vue index 9d9b39b..3ac453d 100644 --- a/packageSearch/search-products/search-products.vue +++ b/packageSearch/search-products/search-products.vue @@ -7,7 +7,7 @@ - + {{item.cate_name}} @@ -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() }, diff --git a/pages/detail/productsDetail/productsDetail.vue b/pages/detail/productsDetail/productsDetail.vue index b808501..7204415 100644 --- a/pages/detail/productsDetail/productsDetail.vue +++ b/pages/detail/productsDetail/productsDetail.vue @@ -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: { //获取客服电话 diff --git a/pages/ideasAndNeeds/ideasAndNeeds.vue b/pages/ideasAndNeeds/ideasAndNeeds.vue index a5d40c9..16ffe3b 100644 --- a/pages/ideasAndNeeds/ideasAndNeeds.vue +++ b/pages/ideasAndNeeds/ideasAndNeeds.vue @@ -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)) { diff --git a/pages/index/index.vue b/pages/index/index.vue index a9dad45..55a7f6b 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -34,9 +34,9 @@ - + - + @@ -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(_ => { + + }) } } }