Commit 8564c70f by 李嘉林

首页渲染优化

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