Commit 8564c70f by 李嘉林

首页渲染优化

parent 824b5d99
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
mounted() { }, mounted() { },
methods: { methods: {
init() { init() {
if (!this.microPageId) return;
shop.singlePageInfo({ id: this.microPageId }).then(res => { shop.singlePageInfo({ id: this.microPageId }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.contentList = res.data.data.pageData ? JSON.parse(res.data.data.pageData) : []; this.contentList = res.data.data.pageData ? JSON.parse(res.data.data.pageData) : [];
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
}; };
}, },
async onLoad() { async onLoad() {
try {
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig"))); let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig")));
console.log(shopInfo,'-------------shopInfo') console.log(shopInfo,'-------------shopInfo')
if (shopInfo.data.code == 200) { if (shopInfo.data.code == 200) {
...@@ -51,8 +52,13 @@ export default { ...@@ -51,8 +52,13 @@ export default {
this.$emit("toUpdate"); this.$emit("toUpdate");
// this.getShopList(); // this.getShopList();
}); });
} else {
this.$emit("toUpdate");
} }
this.reloadName(); this.reloadName();
} catch (error) {
this.$emit("toUpdate");
}
}, },
filters: { filters: {
formatDistance(val) { formatDistance(val) {
......
<template> <template>
<div class="loadings" v-if="shopLogo"> <div class="loadings">
<div class="img flex"> <div class="img flex">
<image :src="shopLogo" alt="" mode="aspectFill"></image> <image :src="shopLogo" alt="" mode="aspectFill"></image>
<van-loading color="black" size="60px" /> <van-loading color="#333" size="60px" />
</div> </div>
</div> </div>
</template> </template>
...@@ -22,12 +22,20 @@ export default { ...@@ -22,12 +22,20 @@ export default {
}, },
computed: { computed: {
shopLogo() { shopLogo() {
let logoUrl = app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.logoUrl; let logoUrl = "";
if (wx.getStorageSync("logoUrl")) {
logoUrl = wx.getStorageSync("logoUrl");
} else {
logoUrl = app.globalData && app.globalData.shopInfo && app.globalData.shopInfo.logoUrl;
}
return logoUrl?DFSImg(logoUrl):""; return logoUrl?DFSImg(logoUrl):"";
}, },
}, },
created() { }, created() { },
mounted() { } mounted() { },
methods: {
}
}; };
</script> </script>
...@@ -39,13 +47,13 @@ export default { ...@@ -39,13 +47,13 @@ export default {
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 3000; z-index: 9999;
.img{ .img{
width: 50px; width: 50px;
height: 50px; height: 50px;
position: relative; position: relative;
padding: 2px; padding: 2px;
margin: 60% auto 0; margin: 40vh auto 0;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
image{ image{
......
...@@ -78,7 +78,6 @@ export default { ...@@ -78,7 +78,6 @@ export default {
}, },
onLoad(){ onLoad(){
console.log(this.datas,'iu')
}, },
computed: { computed: {
getPaddingList() { getPaddingList() {
......
...@@ -521,7 +521,6 @@ export default { ...@@ -521,7 +521,6 @@ export default {
}, },
onShow() { onShow() {
console.log(new Date().getTime(),'load-----home-onShow') console.log(new Date().getTime(),'load-----home-onShow')
this.pageLoading = false;
console.log(this.reloadPage,'-reloadPage2') console.log(this.reloadPage,'-reloadPage2')
if (this.reloadPage) { if (this.reloadPage) {
this.refreshInit(); this.refreshInit();
...@@ -555,8 +554,12 @@ export default { ...@@ -555,8 +554,12 @@ export default {
methods: { methods: {
reloadEnterShopRule() { reloadEnterShopRule() {
console.log('eloadEnterShopRule')
// 进店规则--首次进店调用 // 进店规则--首次进店调用
if (this.h5Params && this.h5Params.offlineShopCode) return; if (this.h5Params && this.h5Params.offlineShopCode) {
this.pageLoading = false;
return;
};
console.log('home-methods-reloadEnterShopRule') console.log('home-methods-reloadEnterShopRule')
if (wx.getStorageSync("firstView")) { if (wx.getStorageSync("firstView")) {
console.log('reloadEnterShopRule-------1') console.log('reloadEnterShopRule-------1')
...@@ -568,9 +571,10 @@ export default { ...@@ -568,9 +571,10 @@ export default {
} }
}, },
async enterStoreRule() { async enterStoreRule() {
try {
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig"))); let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig")));
let openThousandsStoresFlag = shopInfo.data.data.openThousandsStoresFlag == 1; let openThousandsStoresFlag = shopInfo.data.data.openThousandsStoresFlag == 1;
if (!openThousandsStoresFlag) return; if (openThousandsStoresFlag); {
console.log(wx.getStorageSync("locationObj"),'--locationObj') console.log(wx.getStorageSync("locationObj"),'--locationObj')
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {}; let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
let query = { let query = {
...@@ -609,7 +613,11 @@ export default { ...@@ -609,7 +613,11 @@ export default {
shop.saveEnterShopRecord(query2); shop.saveEnterShopRecord(query2);
} }
} }
// this.pageLoading = false; }
} catch (error) {
}
this.pageLoading = false;
}, },
toPageLoading() { toPageLoading() {
// this.pageLoading = true; // this.pageLoading = true;
...@@ -895,7 +903,6 @@ export default { ...@@ -895,7 +903,6 @@ export default {
} }
if(this.$mp.page && this.$mp.page.selectAllComponents(".transverse-label-goodsListItem")){ if(this.$mp.page && this.$mp.page.selectAllComponents(".transverse-label-goodsListItem")){
this.$mp.page.selectAllComponents(".transverse-label-goodsListItem").forEach(item=>{ this.$mp.page.selectAllComponents(".transverse-label-goodsListItem").forEach(item=>{
console.log(item,'-this.$mp.page.selectComponent(".goodsListItem")')
item.getScroll(el) item.getScroll(el)
}) })
} }
...@@ -1094,20 +1101,29 @@ export default { ...@@ -1094,20 +1101,29 @@ export default {
async getThemeList() { async getThemeList() {
console.log("getThemeList") console.log("getThemeList")
this.pageLoading = true; this.pageLoading = true;
try {
await app.getThemePage(this.$store.state.extConfig); await app.getThemePage(this.$store.state.extConfig);
} catch (error) {
}
setTimeout(() => { setTimeout(() => {
this.pageLoading = false; this.pageLoading = false;
}, 500); console.log("加载完成了");
},
refreshInit() {
this.pageLoading = true;
setTimeout(() => {
wx.stopPullDownRefresh();
this.pageLoading = false;
}, 1500); }, 1500);
},
async refreshInit() {
// this.pageLoading = true;
// setTimeout(() => {
// this.pageLoading = false;
// }, 1500);
log.info('onPullDownRefresh',this.$store.state.extConfig) log.info('onPullDownRefresh',this.$store.state.extConfig)
app.getShopInfo(this.$store.state.extConfig); app.getShopInfo(this.$store.state.extConfig);
this.getThemeList(); try {
await this.getThemeList();
} catch (error) {
}
wx.stopPullDownRefresh();
} }
}, },
async onShareAppMessage(res){ async onShareAppMessage(res){
......
...@@ -284,7 +284,6 @@ export default { ...@@ -284,7 +284,6 @@ export default {
} }
if(this.$mp.page && this.$mp.page.selectAllComponents(".transverse-label-goodsListItem")){ if(this.$mp.page && this.$mp.page.selectAllComponents(".transverse-label-goodsListItem")){
this.$mp.page.selectAllComponents(".transverse-label-goodsListItem").forEach(item=>{ this.$mp.page.selectAllComponents(".transverse-label-goodsListItem").forEach(item=>{
console.log(item,'-this.$mp.page.selectComponent(".goodsListItem")')
item.getScroll(el) item.getScroll(el)
}) })
} }
......
...@@ -8,7 +8,6 @@ module.exports = { ...@@ -8,7 +8,6 @@ module.exports = {
log.debug.apply(log, arguments) log.debug.apply(log, arguments)
}, },
info() { info() {
console.log('日志log级别');
if (!log) return if (!log) return
log.info.apply(log, arguments) log.info.apply(log, arguments)
}, },
......
...@@ -27,14 +27,12 @@ Component({ ...@@ -27,14 +27,12 @@ Component({
newArr: [] newArr: []
}, },
ready() { ready() {
console.log(app.setHomeBgImg, "----------------------30");
this.setData({ newArr: this.newList() }); this.setData({ newArr: this.newList() });
this.bannerChange({ this.bannerChange({
detail: { detail: {
current: 0 current: 0
} }
}); });
console.log(this.data.newArr, this.newList(), "--------32");
}, },
methods: { methods: {
newList() { newList() {
......
...@@ -43,7 +43,6 @@ Component({ ...@@ -43,7 +43,6 @@ Component({
let columnWidthArr = ['100%', '50%', '33.3%', '25%', '20%', '16.6%'] let columnWidthArr = ['100%', '50%', '33.3%', '25%', '20%', '16.6%']
this.data.datas.componentData.imgList.forEach(item => { this.data.datas.componentData.imgList.forEach(item => {
console.log(item,'---------------44')
item.imageUrl = item.imageUrl ? app.DFSImg(item.imageUrl,400,400) : '' item.imageUrl = item.imageUrl ? app.DFSImg(item.imageUrl,400,400) : ''
}) })
this.setData({ this.setData({
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<view <view
class="moreBottom" class="moreBottom"
bindtap="viewMore" bindtap="viewMore"
wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec'}}" wx:if="{{datas.componentData['moreShow'] && datas.componentData.moreButtonSite=='bottom' && datas.componentData['goodsSource']!='assign' && datas.componentData['goodsSource']!='intelligenceRec' && !loading}}"
> >
查看更多 查看更多
<text class="jt"></text> <text class="jt"></text>
......
...@@ -44,8 +44,8 @@ image{ ...@@ -44,8 +44,8 @@ image{
display: inline-block; display: inline-block;
border-top: 1px solid; border-top: 1px solid;
border-right: 1px solid; border-right: 1px solid;
width: 10px; width: 8px;
height: 10px; height: 8px;
-webkit-transform: rotate(-135deg); -webkit-transform: rotate(-135deg);
transform: rotate(405deg); transform: rotate(405deg);
margin-left: 0px; margin-left: 0px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment