Commit 5ea3c458 by 李嘉林

优化

parent aee5135c
<template>
<div class="storeAddr flex">
<div class="left flex">
<div class="left flex" v-if="openThousandsStoresFlag">
<div class="logo">
<image :src="logoUrl" alt=""></image>
</div>
......@@ -46,15 +46,20 @@ export default {
}
if (this.openThousandsStoresFlag) {
this.getLocationHandle(() => {
this.getShopList();
this.$emit("toUpdate");
// this.getShopList();
});
}
let { offlineShopName } = getStoreInfo();
this.name = offlineShopName || "";
this.reloadName();
},
computed: {
},
methods: {
reloadName() {
let { offlineShopName } = getStoreInfo();
this.name = offlineShopName || "";
console.log(this.name,'----name')
},
getLocationHandle(callback) {
let _this = this;
wx.getLocation({
......
......@@ -5,8 +5,7 @@
<div v-if="showSpokesManHome">
<get-index-homepage class="getIndexHomePage"></get-index-homepage>
</div>
<template v-if="!pageLoading">
<StoreAddr @toUpdate="toUpdate" @toPageLoading="toPageLoading"></StoreAddr>
<StoreAddr @toUpdate="reloadEnterShopRule" @toPageLoading="toPageLoading" ref="StoreAddr"></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1">
......@@ -111,6 +110,7 @@
</div>
<bottomCont v-if="showbottomCont"></bottomCont>
<template>
</template>
</div>
<share-popup></share-popup>
......@@ -174,7 +174,7 @@ import memberInfo from "../../components/basicTool/member-info";
import GoodsFliters from "../../components/common/GoodsFliters";
import SelectGoods from "../../components/common/SelectGoods";
import TwoBAddCart from "../../components/common/TwoBAddCart";
import { setTabBarActive, checkTabbarPage,themeColor, checkShowConditionIds, setStoreInfo } from "../../utils/mayi.js";
import { setTabBarActive, checkTabbarPage,themeColor, checkShowConditionIds, setStoreInfo, getStoreInfo } from "../../utils/mayi.js";
import indexApi from "@/api/index.js";
import { throttle, concatUrl } from "../../utils/index.js"
import mpvueCropper from '@/components/mpvue-cropper'
......@@ -332,19 +332,15 @@ export default {
console.log(new Date().getTime(),'load-----home-onLoad')
console.log(options,this.firstOpenPage,'---------home----options')
log.info(options, '---------home----options')
let h5Params = options && options.params ? JSON.parse(decodeURIComponent(options.params)) : "";
let h5Params = options && options.params ? JSON.parse(decodeURIComponent(options.params)) : {};
console.log(h5Params,'--h5Params')
if (h5Params) {
if (Object.keys(h5Params).length>0) {
// 存储h5url门店信息
setStoreInfo({
offlineShopCode:h5Params.offlineShopCode,
offlineShopName:h5Params.offlineShopName,
});
}
// 进店规则--首次进店调用
if (wx.getStorageSync("firstView")) {
this.enterStoreRule(h5Params.offlineShopCode);
}
//进页面存储需要绑定的信息
if(options.userId||options.spokesmanRelId) {
wx.setStorage({
......@@ -479,11 +475,8 @@ export default {
}
}
})
this.pageLoading = false;
wx.removeStorageSync("firstView");
},
onShow() {
// this.pageLoading = false;
console.log(new Date().getTime(),'load-----home-onShow')
// 设置显示条件
console.log(new Date().getTime(),'--------on--------------show')
......@@ -513,14 +506,29 @@ export default {
},200),
methods: {
async enterStoreRule(offlineShopCode) {
reloadEnterShopRule() {
// 进店规则--首次进店调用
if (wx.getStorageSync("firstView")) {
console.log('reloadEnterShopRule-------1')
wx.removeStorageSync("firstView");
this.enterStoreRule();
} else {
console.log('reloadEnterShopRule-------2')
this.pageLoading = false;
}
},
async enterStoreRule() {
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig")));
let openThousandsStoresFlag = shopInfo.data.data.openThousandsStoresFlag == 1;
if (!openThousandsStoresFlag) return;
console.log(wx.getStorageSync("locationObj"),'--locationObj')
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
let { offlineShopCode } = getStoreInfo();
let query = {
channelType: 2, //设备类型(0:pc,1:app,2:小程序)
consumerLongitude: locationObj.longitude?locationObj.longitude.toString() : "", //经度,小程序和app可以获取到就要传,没有不传
consumerLatitude: locationObj.latitude?locationObj.latitude.toString() : "", //纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopCode: offlineShopCode || "" //分销员门店id,没有不传
distributionOfficerShopCode: offlineShopCode|| "" //分销员门店id,没有不传
}
let res = await shop.getEnterShopId(query);
if (res.data.code == 200) {
......@@ -535,10 +543,12 @@ export default {
offlineShopCode: storeDetail.data.data.shopCode,
offlineShopName: storeDetail.data.data.shopName,
});
this.$refs.StoreAddr.reloadName();
}
console.log(storeDetail, '-------storeDetail');
}
}
// this.pageLoading = false;
},
toUpdate() {
// 切换门店重新加载
......@@ -1023,7 +1033,7 @@ export default {
await app.getThemePage(this.$store.state.extConfig);
setTimeout(() => {
this.pageLoading = false;
}, 100);
}, 500);
}
},
async onShareAppMessage(res){
......@@ -1100,8 +1110,10 @@ export default {
log.info(res,'-----onShareTimeline')
},
onPullDownRefresh(){
this.pageLoading = true;
setTimeout(() => {
wx.stopPullDownRefresh();
this.pageLoading = false;
}, 1500);
log.info('onPullDownRefresh',this.$store.state.extConfig)
app.getShopInfo(this.$store.state.extConfig);
......
......@@ -81,10 +81,11 @@ Component({
if(res.data.code == '200'){
let list = res.data.data
if(list == null || list.length == 0){
if(this.query.pageNum == 1){
if(this.data.query.pageNum == 1){
this.setData({
showList: false
})
console.log('------change1')
}
}else{
list.forEach((item,index) => {
......@@ -140,7 +141,10 @@ Component({
}
if (this.data.WaterfallFlowList.length <= 0) {
this.showList = false;
this.setData({
showList : false
})
console.log('------change2')
}
}
if (list == null || list.length < 10) {
......@@ -159,6 +163,7 @@ Component({
finished : true,
showList : false
})
console.log('------change3')
}
})
......
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