Commit 61883d3e by 李嘉林

首页优化暂存

parent b1620a23
...@@ -74,13 +74,11 @@ export default { ...@@ -74,13 +74,11 @@ export default {
// 页面配置信息 // 页面配置信息
this.getThemePage(extConfig); // this.getThemePage(extConfig);
let mpApp = getApp(); let mpApp = getApp();
console.log(mpApp, "this.mpApp"); console.log(mpApp, "this.mpApp");
mpApp.getShopInfo = this.getShopInfo mpApp.getShopInfo = this.getShopInfo
mpApp.getThemePage = this.getThemePage mpApp.getThemePage = this.getThemePage
setTimeout(() => {
},300)
}, },
async mounted() { async mounted() {
...@@ -301,7 +299,7 @@ export default { ...@@ -301,7 +299,7 @@ export default {
}, },
//商城配置 //商城配置
async shopConfiguration(){ async shopConfiguration(){
await shop.get_shop_configuration().then(res=>{ shop.get_shop_configuration().then(res=>{
if (res.data.code == 200) { if (res.data.code == 200) {
let mpApp = getApp(); let mpApp = getApp();
mpApp.shop_configuration = res.data.data mpApp.shop_configuration = res.data.data
...@@ -310,11 +308,12 @@ export default { ...@@ -310,11 +308,12 @@ export default {
}) })
}, },
async getThemePage({ mixid, shopid }) { async getThemePage({ mixid, shopid }) {
console.log("getThemePage--App.vue")
let {offlineShopCode} = getStoreInfo(); let {offlineShopCode} = getStoreInfo();
await shop await shop
.themePagesInfo({ .themePagesInfo({
shopMixId: offlineShopCode?offlineShopCode:mixid, shopMixId: offlineShopCode?offlineShopCode:mixid,
homePageFlag: false homePageFlag: true
}) })
.then((response) => { .then((response) => {
if (response.data.code == 200) { if (response.data.code == 200) {
......
...@@ -88,6 +88,10 @@ console.log(process.env,'-----------------config------') ...@@ -88,6 +88,10 @@ console.log(process.env,'-----------------config------')
outDataSourceData(data) { outDataSourceData(data) {
return requestPOST(`${process.env.OLSHOP_URL}/outDataSource/api`,data) return requestPOST(`${process.env.OLSHOP_URL}/outDataSource/api`,data)
}, },
// 上传文件
uploadFile(data) {
return requestPOST(`${process.env.OLSHOP_URL}/common/uploadFile`,data)
},
} }
\ No newline at end of file
...@@ -36,6 +36,7 @@ export default { ...@@ -36,6 +36,7 @@ export default {
}, },
data() { data() {
return { return {
pageData: [],
contentList: [], contentList: [],
} }
}, },
...@@ -56,11 +57,21 @@ export default { ...@@ -56,11 +57,21 @@ export default {
if (!this.microPageId) return; 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.pageData = res.data.data.pageData ? JSON.parse(res.data.data.pageData) : [];
console.log(this.contentList, '------------------------45') this.contentList.push(this.pageData[0]);
let i = 1;
this.loadComponents(i);
} }
}) })
} },
loadComponents(index) {
this.contentList.push(this.pageData[index]);
index++;
if (index > this.pageData.length) return console.log("-微页面渲染结束-");
setTimeout(() => {
this.loadComponents(index);
}, 30);
},
} }
} }
</script> </script>
......
...@@ -40,6 +40,9 @@ export default { ...@@ -40,6 +40,9 @@ export default {
}, },
async onLoad() { async onLoad() {
try { try {
this.getLocationHandle(() => {
this.$emit("toUpdate");
});
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) {
...@@ -47,14 +50,6 @@ export default { ...@@ -47,14 +50,6 @@ export default {
this.logoUrl = DFSImg(shopInfo.data.data.logoUrl, 400, 400); this.logoUrl = DFSImg(shopInfo.data.data.logoUrl, 400, 400);
console.log(this.openThousandsStoresFlag,this.logoUrl,'-------------shopInfo') console.log(this.openThousandsStoresFlag,this.logoUrl,'-------------shopInfo')
} }
if (this.openThousandsStoresFlag) {
this.getLocationHandle(() => {
this.$emit("toUpdate");
// this.getShopList();
});
} else {
this.$emit("toUpdate");
}
this.reloadName(); this.reloadName();
} catch (error) { } catch (error) {
this.$emit("toUpdate"); this.$emit("toUpdate");
...@@ -87,8 +82,8 @@ export default { ...@@ -87,8 +82,8 @@ export default {
_this.offlineStoreReq.latitude = res.latitude; _this.offlineStoreReq.latitude = res.latitude;
_this.offlineStoreReq.longitude = res.longitude; _this.offlineStoreReq.longitude = res.longitude;
// 存缓存 // 存缓存
wx.setStorageSync("locationObj", JSON.stringify(res));
callback(res); callback(res);
wx.setStorageSync("locationObj", JSON.stringify(res));
}, },
fail: res => { fail: res => {
log.info("++++++++++2++++++", res); log.info("++++++++++2++++++", res);
......
...@@ -155,7 +155,8 @@ mpApp.themeColor = {} ...@@ -155,7 +155,8 @@ mpApp.themeColor = {}
mpApp.log = log mpApp.log = log
mpApp.tool = tool mpApp.tool = tool
function getThemePage({mixid,shopid}) { function getThemePage({ mixid, shopid }) {
console.log("getThemePage--main.js")
let {offlineShopCode} = getStoreInfo(); let {offlineShopCode} = getStoreInfo();
shop shop
.themePagesInfo({ .themePagesInfo({
......
...@@ -9,118 +9,118 @@ ...@@ -9,118 +9,118 @@
<CustomNav :customBgOpacity="customBgOpacity"></CustomNav> <CustomNav :customBgOpacity="customBgOpacity"></CustomNav>
<StoreAddr @toUpdate="reloadEnterShopRule" @toPageLoading="toPageLoading" ref="StoreAddr"></StoreAddr> <StoreAddr @toUpdate="reloadEnterShopRule" @toPageLoading="toPageLoading" ref="StoreAddr"></StoreAddr>
<ThemeDataPlant></ThemeDataPlant> <ThemeDataPlant></ThemeDataPlant>
<template v-if="!componentsLoading"> <div v-for="(item,index) in pageData" :key="index">
<div v-for="(item,index) in pageData" :key="index"> <div v-if="item.componentCode == 'embed-module' && item.componentInfo.visible == 1">
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1"> <embedModule :datas="item" :componentIndex="index"></embedModule>
<banner :datas="item"></banner>
</div>
<div v-else-if="item.componentCode=='goods-list' && item.componentInfo.visible == 1" style="height:100%;">
<!-- ***这个商品列表组件中需要对数据做缓存,可能有多个地方同时引用此组件
必须在缓存前加个唯一标识不然所有组件全部操作同一个缓存
-->
<goods-list :storageKey="'home'+index" :class="['goodsListItem' + index,'goodsListItemIndex0']" :datas="item" :datasIndex="0" :goodsListIndex="0"></goods-list>
</div>
<div v-else-if="item.componentCode == 'ranking-list' && item.componentInfo.visible == 1">
<ranking-list :datas="item"></ranking-list>
</div>
<div v-else-if="item.componentCode == 'area-navigation' && item.componentInfo.visible == 1">
<area-navigation :datas="item" :changeLocation="changeLocation"></area-navigation>
</div>
<div v-else-if="item.componentCode == 'cube-nav' && item.componentInfo.visible == 1">
<cube-nav :datas="item"></cube-nav>
</div>
<!-- 五粮液的餐厅推荐 -->
<div v-else-if="item.componentCode == 'restaurant-list' && item.componentInfo.visible == 1">
<restaurant-list :datas="item"></restaurant-list>
</div>
<div v-else-if="item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1">
<time-limited-discount :class="'time-limited-discount'+index" :datas="item" :k="index"></time-limited-discount>
</div>
<div v-if="item.componentCode == 'links' && item.componentInfo.visible == 1">
<links :datas="item"></links>
</div>
<div v-if="item.componentCode == 'interval' && item.componentInfo.visible == 1">
<interval :datas="item"></interval>
</div>
<div v-if="item.componentCode == 'partition' && item.componentInfo.visible == 1">
<partition :datas="item"></partition>
</div>
<div v-if="item.componentCode == 'shop-popup' && item.componentInfo.visible == 1">
<shop-popup :datas="item"></shop-popup>
</div>
<div v-if="item.componentCode == 'float-button' && item.componentInfo.visible == 1">
<float-button :datas="item"></float-button>
</div>
<div v-if="item.componentCode == 'text-text' && item.componentInfo.visible == 1">
<text-text :datas="item"></text-text>
</div>
<div v-if="item.componentCode == 'img-text' && item.componentInfo.visible == 1">
<img-text :datas="item"></img-text>
</div>
<div v-if="item.componentCode == 'goods-search' && item.componentInfo.visible == 1">
<goods-search :datas="item"></goods-search>
</div>
<div v-if="item.componentCode == 'notice' && item.componentInfo.visible == 1">
<notice :datas="item"></notice>
</div>
<div v-if="item.componentCode == 'pop-up' && item.componentInfo.visible == 1">
<pop-up :datas="item"></pop-up>
</div>
<div v-if="item.componentCode == 'coupon' && item.componentInfo.visible == 1">
<coupon :datas="item"></coupon>
</div>
<div v-if="item.componentCode == 'integral-turntable' && item.componentInfo.visible == 1">
<integralTurntable :datas="item"></integralTurntable>
</div>
<div v-if="item.componentCode == 'speedy-nav' && item.componentInfo.visible == 1">
<speedy-nav :datas="item"></speedy-nav>
</div>
<div v-if="item.componentCode == 'video-player' && item.componentInfo.visible == 1" >
<video-player :class="'VideoPlayer' + index" :datas="item" :indexs="index"></video-player>
</div>
<div v-if="item.componentCode == 'official-account' && item.componentInfo.visible == 1">
<official-account></official-account>
</div>
<div v-if="item.componentCode == 'transverse-label' && item.componentInfo.visible == 1">
<transverse-label :datas="item" :componentIndex="index"></transverse-label>
</div>
<div v-if="item.componentCode == 'photo-gallery' && item.componentInfo.visible == 1">
<photo-gallery :datas="item"></photo-gallery>
</div>
<div v-if="item.componentCode == 'live-broadcast' && item.componentInfo.visible == 1">
<live-broadcast :datas="item"></live-broadcast>
</div>
<div v-if="item.componentCode == 'information' && item.componentInfo.visible == 1">
<information :datas="item"></information>
</div>
<div v-if="item.componentCode == 'share-picture' && item.componentInfo.visible == 1">
<share-picture :datas="item"></share-picture>
</div>
<div v-if="item.componentCode == 'merchants-list' && item.componentInfo.visible == 1">
<merchants-list :class="'merchants-list' +index" :datas="item"></merchants-list>
</div>
<div v-if="item.componentCode == 'spell-group' && item.componentInfo.visible == 1">
<spell-group :datas="item"></spell-group>
</div>
<div v-if="item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1">
<wo-timeout :datas="item"></wo-timeout>
</div>
<div v-if="item.componentCode == 'custom-list' && item.componentInfo.visible == 1">
<custom-list :datas="item"></custom-list>
</div>
<div v-if="item.componentCode == 'rich-text' && item.componentInfo.visible == 1">
<rich-text :datas="item"></rich-text>
</div>
<div v-if="item.componentCode == 'member-info' && item.componentInfo.visible == 1">
<member-info :datas="item"></member-info>
</div>
<div v-if="item.componentCode == 'brand-list' && item.componentInfo.visible == 1">
<brandList :datas="item"></brandList>
</div>
<div v-if="item.componentCode == 'embed-module' && item.componentInfo.visible == 1">
<embedModule :datas="item" :componentIndex="index"></embedModule>
</div>
</div> </div>
<div v-if="item.componentCode=='banner' && item.componentInfo.visible == 1">
<banner :datas="item"></banner>
</div>
<div v-else-if="item.componentCode=='goods-list' && item.componentInfo.visible == 1" style="height:100%;">
<!-- ***这个商品列表组件中需要对数据做缓存,可能有多个地方同时引用此组件
必须在缓存前加个唯一标识不然所有组件全部操作同一个缓存
-->
<goods-list :storageKey="'home'+index" :class="['goodsListItem' + index,'goodsListItemIndex0']" :datas="item" :datasIndex="0" :goodsListIndex="0"></goods-list>
</div>
<div v-else-if="item.componentCode == 'ranking-list' && item.componentInfo.visible == 1">
<ranking-list :datas="item"></ranking-list>
</div>
<div v-else-if="item.componentCode == 'area-navigation' && item.componentInfo.visible == 1">
<area-navigation :datas="item" :changeLocation="changeLocation"></area-navigation>
</div>
<div v-else-if="item.componentCode == 'cube-nav' && item.componentInfo.visible == 1">
<cube-nav :datas="item"></cube-nav>
</div>
<!-- 五粮液的餐厅推荐 -->
<div v-else-if="item.componentCode == 'restaurant-list' && item.componentInfo.visible == 1">
<restaurant-list :datas="item"></restaurant-list>
</div>
<div v-else-if="item.componentCode == 'time-limited-discount' && item.componentInfo.visible == 1">
<time-limited-discount :class="'time-limited-discount'+index" :datas="item" :k="index"></time-limited-discount>
</div>
<div v-if="item.componentCode == 'links' && item.componentInfo.visible == 1">
<links :datas="item"></links>
</div>
<div v-if="item.componentCode == 'interval' && item.componentInfo.visible == 1">
<interval :datas="item"></interval>
</div>
<div v-if="item.componentCode == 'partition' && item.componentInfo.visible == 1">
<partition :datas="item"></partition>
</div>
<div v-if="item.componentCode == 'shop-popup' && item.componentInfo.visible == 1">
<shop-popup :datas="item"></shop-popup>
</div>
<div v-if="item.componentCode == 'float-button' && item.componentInfo.visible == 1">
<float-button :datas="item"></float-button>
</div>
<div v-if="item.componentCode == 'text-text' && item.componentInfo.visible == 1">
<text-text :datas="item"></text-text>
</div>
<div v-if="item.componentCode == 'img-text' && item.componentInfo.visible == 1">
<img-text :datas="item"></img-text>
</div>
<div v-if="item.componentCode == 'goods-search' && item.componentInfo.visible == 1">
<goods-search :datas="item"></goods-search>
</div>
<div v-if="item.componentCode == 'notice' && item.componentInfo.visible == 1">
<notice :datas="item"></notice>
</div>
<div v-if="item.componentCode == 'pop-up' && item.componentInfo.visible == 1">
<pop-up :datas="item"></pop-up>
</div>
<div v-if="item.componentCode == 'coupon' && item.componentInfo.visible == 1">
<coupon :datas="item"></coupon>
</div>
<div v-if="item.componentCode == 'integral-turntable' && item.componentInfo.visible == 1">
<integralTurntable :datas="item"></integralTurntable>
</div>
<div v-if="item.componentCode == 'speedy-nav' && item.componentInfo.visible == 1">
<speedy-nav :datas="item"></speedy-nav>
</div>
<div v-if="item.componentCode == 'video-player' && item.componentInfo.visible == 1" >
<video-player :class="'VideoPlayer' + index" :datas="item" :indexs="index"></video-player>
</div>
<div v-if="item.componentCode == 'official-account' && item.componentInfo.visible == 1">
<official-account></official-account>
</div>
<div v-if="item.componentCode == 'transverse-label' && item.componentInfo.visible == 1">
<transverse-label :datas="item" :componentIndex="index"></transverse-label>
</div>
<div v-if="item.componentCode == 'photo-gallery' && item.componentInfo.visible == 1">
<photo-gallery :datas="item"></photo-gallery>
</div>
<div v-if="item.componentCode == 'live-broadcast' && item.componentInfo.visible == 1">
<live-broadcast :datas="item"></live-broadcast>
</div>
<div v-if="item.componentCode == 'information' && item.componentInfo.visible == 1">
<information :datas="item"></information>
</div>
<div v-if="item.componentCode == 'share-picture' && item.componentInfo.visible == 1">
<share-picture :datas="item"></share-picture>
</div>
<div v-if="item.componentCode == 'merchants-list' && item.componentInfo.visible == 1">
<merchants-list :class="'merchants-list' +index" :datas="item"></merchants-list>
</div>
<div v-if="item.componentCode == 'spell-group' && item.componentInfo.visible == 1">
<spell-group :datas="item"></spell-group>
</div>
<div v-if="item.componentCode == 'wo-timeout' && item.componentInfo.visible == 1">
<wo-timeout :datas="item"></wo-timeout>
</div>
<div v-if="item.componentCode == 'custom-list' && item.componentInfo.visible == 1">
<custom-list :datas="item"></custom-list>
</div>
<div v-if="item.componentCode == 'rich-text' && item.componentInfo.visible == 1">
<rich-text :datas="item"></rich-text>
</div>
<div v-if="item.componentCode == 'member-info' && item.componentInfo.visible == 1">
<member-info :datas="item"></member-info>
</div>
<div v-if="item.componentCode == 'brand-list' && item.componentInfo.visible == 1">
<brandList :datas="item"></brandList>
</div>
</div>
<template>
</template> </template>
<bottomCont v-if="showbottomCont"></bottomCont> <bottomCont v-if="showbottomCont"></bottomCont>
<template> <template>
...@@ -233,7 +233,6 @@ export default { ...@@ -233,7 +233,6 @@ export default {
showbottomCont: false, //展示底部logo showbottomCont: false, //展示底部logo
showSpe: false, showSpe: false,
pageLoading: true, pageLoading: true,
componentsLoading: true,
firstOpenPage: true, //首次打开页面 firstOpenPage: true, //首次打开页面
h5Params: {}, //params h5Params: {}, //params
fromPage: "", fromPage: "",
...@@ -484,11 +483,12 @@ export default { ...@@ -484,11 +483,12 @@ export default {
} }
// 获取页面数据 // 获取页面数据
if (this.mpApp.globalData.pageList) { if (this.mpApp.globalData.pageList) {
console.log("获取页面数据-1")
that.init(this.mpApp.globalData.pageList); that.init(this.mpApp.globalData.pageList);
} else { } else {
this.mpApp.pageCallBack = function (params) { this.mpApp.pageCallBack = function (params) {
console.log("获取页面数据-2")
that.init(params); that.init(params);
}; };
} }
...@@ -557,16 +557,15 @@ export default { ...@@ -557,16 +557,15 @@ export default {
methods: { methods: {
setPageLoading() { setPageLoading() {
this.componentsLoading = false;
setTimeout(() => { setTimeout(() => {
this.pageLoading = false; this.pageLoading = false;
}, 3000); }, 700);
}, },
reloadEnterShopRule() { reloadEnterShopRule() {
console.log('eloadEnterShopRule') console.log('eloadEnterShopRule')
// 进店规则--首次进店调用 // 进店规则--首次进店调用
if (this.h5Params && this.h5Params.offlineShopCode) { if (this.h5Params && this.h5Params.offlineShopCode) {
this.setPageLoading(); // this.setPageLoading();
return; return;
}; };
console.log('home-methods-reloadEnterShopRule') console.log('home-methods-reloadEnterShopRule')
...@@ -576,60 +575,55 @@ export default { ...@@ -576,60 +575,55 @@ export default {
this.enterStoreRule(); this.enterStoreRule();
} else { } else {
console.log('reloadEnterShopRule-------2') console.log('reloadEnterShopRule-------2')
this.setPageLoading(); // this.setPageLoading();
} }
}, },
async enterStoreRule() { async enterStoreRule() {
try { try {
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig"))); console.log(wx.getStorageSync("locationObj"),'--locationObj')
let openThousandsStoresFlag = shopInfo.data.data.openThousandsStoresFlag == 1; let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
if (openThousandsStoresFlag); { let query = {
console.log(wx.getStorageSync("locationObj"),'--locationObj') channelType: 2, //设备类型(0:pc,1:app,2:小程序)
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {}; consumerLongitude: locationObj.longitude?locationObj.longitude.toString() : "", //经度,小程序和app可以获取到就要传,没有不传
let query = { consumerLatitude: locationObj.latitude?locationObj.latitude.toString() : "", //纬度,小程序和app可以获取到就要传,没有不传
channelType: 2, //设备类型(0:pc,1:app,2:小程序) distributionOfficerShopCode: this.h5Params.offlineShopCode || "" //分销员门店id,没有不传
consumerLongitude: locationObj.longitude?locationObj.longitude.toString() : "", //经度,小程序和app可以获取到就要传,没有不传 }
consumerLatitude: locationObj.latitude?locationObj.latitude.toString() : "", //纬度,小程序和app可以获取到就要传,没有不传 console.log(`%cgetEnterShopId---query${JSON.stringify(query)}`,'color:yellow;font-size:20px;')
distributionOfficerShopCode: this.h5Params.offlineShopCode || "" //分销员门店id,没有不传 let res = await shop.getEnterShopId(query);
} console.log(`%cgetEnterShopId${JSON.stringify(res)}`,'color:yellow;font-size:20px;')
console.log(`%cgetEnterShopId---query${JSON.stringify(query)}`,'color:yellow;font-size:20px;') if (res.data.code == 200) {
let res = await shop.getEnterShopId(query); let enterShopId = res.data.data;
console.log(`%cgetEnterShopId${JSON.stringify(res)}`,'color:yellow;font-size:20px;') console.log(enterShopId,'--enterShopId')
if (res.data.code == 200) { if (enterShopId) {
let enterShopId = res.data.data; let storeDetail = await shop.getOfflineStoreDetail({
console.log(enterShopId,'--enterShopId') shopId: enterShopId,
if (enterShopId) { });
let storeDetail = await shop.getOfflineStoreDetail({ if (storeDetail.data.code == 200) {
shopId: enterShopId, setStoreInfo({
offlineShopCode: storeDetail.data.data.shopCode,
offlineShopName: storeDetail.data.data.shopName,
}); });
if (storeDetail.data.code == 200) { this.$refs.StoreAddr.reloadName();
setStoreInfo({ this.refreshInit();
offlineShopCode: storeDetail.data.data.shopCode,
offlineShopName: storeDetail.data.data.shopName,
});
this.$refs.StoreAddr.reloadName();
this.refreshInit();
}
console.log(storeDetail, '-------storeDetail');
let loginUserInfo = wx.getStorageSync("loginUserInfo") || null;
let query2 = {
telephoneNum: loginUserInfo && loginUserInfo.mobilephone,
enterShopSource: "买家直接进入",
hitRule: "首页进入",
shopName: storeDetail.data.data.shopName,
}
log.info("进店规则-----",query2)
shop.saveEnterShopRecord(query2);
} }
} console.log(storeDetail, '-------storeDetail');
} let loginUserInfo = wx.getStorageSync("loginUserInfo") || null;
let query2 = {
telephoneNum: loginUserInfo && loginUserInfo.mobilephone,
enterShopSource: "买家直接进入",
hitRule: "首页进入",
shopName: storeDetail.data.data.shopName,
}
log.info("进店规则-----",query2)
shop.saveEnterShopRecord(query2);
}
}
} catch (error) { } catch (error) {
} }
this.setPageLoading(); // this.setPageLoading();
}, },
toPageLoading() { toPageLoading() {
// this.pageLoading = true;
}, },
async setVisible(pageList, cb) { async setVisible(pageList, cb) {
// 首页显示条件 // 首页显示条件
...@@ -745,6 +739,7 @@ export default { ...@@ -745,6 +739,7 @@ export default {
return JSON.stringify(pageData); return JSON.stringify(pageData);
}, },
init(pageList) { init(pageList) {
console.log("home-init");
this.getCartNum(); this.getCartNum();
this.active=checkTabbarPage('/'); this.active=checkTabbarPage('/');
this.setVisible(this.mpApp.globalData.pageList,(res)=>{ this.setVisible(this.mpApp.globalData.pageList,(res)=>{
...@@ -755,7 +750,7 @@ export default { ...@@ -755,7 +750,7 @@ export default {
this.showbottomCont = true; this.showbottomCont = true;
}, 100); }, 100);
log.info("36----------------------559", this.pageData,this.pageInfo.pageSettingData); log.info("36----------------------559", this.pageData,this.pageInfo.pageSettingData);
this.setPageLoading();
log.info(app.globalData.shopInfo,'app') log.info(app.globalData.shopInfo,'app')
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName}) wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
console.log(this.pageInfo.pageSettingData,'-this.pageInfo.pageSettingData') console.log(this.pageInfo.pageSettingData,'-this.pageInfo.pageSettingData')
...@@ -1110,13 +1105,11 @@ export default { ...@@ -1110,13 +1105,11 @@ export default {
async getThemeList() { async getThemeList() {
console.log("getThemeList") console.log("getThemeList")
this.pageLoading = true; this.pageLoading = true;
this.componentsLoading = true;
try { try {
await app.getThemePage(this.$store.state.extConfig); await app.getThemePage(this.$store.state.extConfig);
} catch (error) { } catch (error) {
} }
this.setPageLoading();
}, },
async refreshInit() { async refreshInit() {
log.info('onPullDownRefresh',this.$store.state.extConfig) log.info('onPullDownRefresh',this.$store.state.extConfig)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view style="overflow: hidden;" class="cubeNav"> <view style="overflow: hidden;" class="cubeNav">
<view wx:if="{{datas.componentData.styleType == 0}}" class="cube-nav" style="margin-top:{{datas.componentData.verticalMargin * 2}}rpx;margin-bottom:{{datas.componentData.verticalMargin * 2}}rpx;margin-left:{{datas.componentData.levelMargin * 2}}rpx;margin-right:{{datas.componentData.levelMargin * 2}}rpx;border-radius:{{datas.componentData.moduleRadius * 2}}rpx"> <view wx:if="{{datas.componentData.styleType == 0}}" class="cube-nav" style="margin-top:{{datas.componentData.verticalMargin * 2}}rpx;margin-bottom:{{datas.componentData.verticalMargin * 2}}rpx;margin-left:{{datas.componentData.levelMargin * 2}}rpx;margin-right:{{datas.componentData.levelMargin * 2}}rpx;border-radius:{{datas.componentData.moduleRadius * 2}}rpx">
<view class="cube1 clearfix" wx:if="{{datas.componentData.layoutType == 0}}" style="margin-left:{{-datas.componentData.singleVerticalMargin*2}}rpx;background-color:{{datas.componentData.backgroundColor || ''}};"> <view class="cube1 clearfix" wx:if="{{datas.componentData.layoutType == 0}}" style="margin-left:{{-datas.componentData.singleVerticalMargin*2}}rpx;background-color:{{datas.componentData.backgroundColor || ''}};">
<view class="cube-bg" wx:for="{{imgList}}" data-item="{{item}}" bindtap="onclickHandle" style="padding-left:{{datas.componentData.singleVerticalMargin*2}}rpx;width:{{getColumnWidth}};"> <view class="cube-bg" wx:for="{{imgList}}" wx:key="index" data-item="{{item}}" bindtap="onclickHandle" style="padding-left:{{datas.componentData.singleVerticalMargin*2}}rpx;width:{{getColumnWidth}};">
<view class="cube-item" style="padding-top:{{datas.componentData.singleLevelMargin * 2}}rpx;padding-bottom:{{datas.componentData.singleLevelMargin * 2}}rpx;position:relative;background:{{datas.componentData.singleBackground}};border-radius:{{datas.componentData.singleRadius*2}}rpx;margin-top:{{datas.componentData.lineHeight*2}}rpx"> <view class="cube-item" style="padding-top:{{datas.componentData.singleLevelMargin * 2}}rpx;padding-bottom:{{datas.componentData.singleLevelMargin * 2}}rpx;position:relative;background:{{datas.componentData.singleBackground}};border-radius:{{datas.componentData.singleRadius*2}}rpx;margin-top:{{datas.componentData.lineHeight*2}}rpx">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%"> <view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}"> <view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<view wx:if="{{datas.componentData.layoutType == 1}}" style="position:relative;background-color:{{datas.componentData.backgroundColor || ''}};padding-bottom:{{navShow ? '10px' : '0'}}"> <view wx:if="{{datas.componentData.layoutType == 1}}" style="position:relative;background-color:{{datas.componentData.backgroundColor || ''}};padding-bottom:{{navShow ? '10px' : '0'}}">
<view class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove"> <view class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove">
<view class="clearfix" style="width:{{wrapW}}px" id="wrapW"> <view class="clearfix" style="width:{{wrapW}}px" id="wrapW">
<view class="cube-item" wx:for="{{imgList}}" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{w}}px;position:relative" bindtap="onclickHandle" data-item="{{item}}"> <view class="cube-item" wx:for="{{imgList}}" wx:key="index" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{w}}px;position:relative" bindtap="onclickHandle" data-item="{{item}}">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%"> <view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}"> <view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image> <image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image>
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
<view class="cube3 clearfix" wx:if="{{datas.componentData.layoutType == 2}}" style="background-color:{{datas.componentData.backgroundColor || ''}};"> <view class="cube3 clearfix" wx:if="{{datas.componentData.layoutType == 2}}" style="background-color:{{datas.componentData.backgroundColor || ''}};">
<swiper indicator-dots="{{true}}" indicator-active-color="var(--main-color)" style="height:{{cube3H}}px"> <swiper indicator-dots="{{true}}" indicator-active-color="var(--main-color)" style="height:{{cube3H}}px">
<swiper-item wx:for="{{swiperList}}" style="width:{{swiperItemW}}px"> <swiper-item wx:for="{{swiperList}}" wx:key="index" style="width:{{swiperItemW}}px">
<view class="cube-item" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle"> <view class="cube-item" style="padding-top:{{datas.componentData.lineHeight}}px;padding-bottom:{{datas.componentData.lineHeight}}px;width:{{getColumnWidth}};position:relative" wx:for-item="item1" wx:for-index="index1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%"> <view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}"> <view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image> <image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image>
......
const app = getApp(); const app = getApp();
const { log } = app; const { log } = app;
const { goodsApi, DFSImg, $themeToLink } = app; const { goodsApi, DFSImg, $themeToLink, processEnv } = app;
function random_string(len) { function random_string(len) {
len = len || 32; len = len || 32;
var chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678"; var chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
...@@ -314,7 +314,7 @@ const componentOptions = { ...@@ -314,7 +314,7 @@ const componentOptions = {
query.minPrice = this.data.submitFliterVal.minPrice; query.minPrice = this.data.submitFliterVal.minPrice;
query.maxPrice = this.data.submitFliterVal.maxPrice; query.maxPrice = this.data.submitFliterVal.maxPrice;
} }
goodsApi.queryProductInfo(query).then(res => { goodsApi[processEnv.NODE_ENV == 'xhyx_prod'?'selectProductInfoOnEs':'queryProductInfo'](query).then(res => {
this.setData({ loading: false, queryProductInfoLoading: false }); this.setData({ loading: false, queryProductInfoLoading: false });
if (res.data.code == 200) { if (res.data.code == 200) {
let goodsLists = res.data.data.list; let goodsLists = res.data.data.list;
...@@ -541,6 +541,7 @@ const componentOptions = { ...@@ -541,6 +541,7 @@ const componentOptions = {
let storageDatasList = this.getStorageSync('storageDatasList') || [] let storageDatasList = this.getStorageSync('storageDatasList') || []
let { style } = storageDatasList[that.data.datasIndex]; let { style } = storageDatasList[that.data.datasIndex];
if (!style) return;
let type = '' let type = ''
if(style == 'list' || style == 'rowList'){ if(style == 'list' || style == 'rowList'){
type = 'goods-item' type = 'goods-item'
......
<!--static/nativeComponents/Notice/index.wxml--> <!--static/nativeComponents/Notice/index.wxml-->
<view class="notice" style="border-radius:{{datas.componentData.borderRadius}}px;background-color:{{datas.componentData.backgroundColor}};margin:{{NoticeMargin}};padding:{{NoticePadding}};height:{{(CommonHeight)}}"> <view class="notice" style="border-radius:{{datas.componentData.borderRadius}}px;background-color:{{datas.componentData.backgroundColor}};margin:{{NoticeMargin}};padding:{{NoticePadding}};height:{{(CommonHeight)}}">
<swiper autoplay interval="3000" vertical style="height:{{CommonHeight}}" circular> <swiper autoplay interval="3000" vertical style="height:{{CommonHeight}}" circular>
<swiper-item wx:for="{{datas.componentData.noticeList}}" wx:key="{{index}}"> <swiper-item wx:for="{{datas.componentData.noticeList}}" wx:key="index">
<view class="container" bindtap="onclickHandle" data-index="{{index}}" style="width: 100%;height:{{CommonHeight}}"> <view class="container" bindtap="onclickHandle" data-index="{{index}}" style="width: 100%;height:{{CommonHeight}}">
<block wx:if="{{item.imageUrl||datas.componentData.singleImage}}"> <block wx:if="{{item.imageUrl||datas.componentData.singleImage}}">
<view wx:if="{{datas.componentData.styleType===1}}"> <view wx:if="{{datas.componentData.styleType===1}}">
......
...@@ -34,7 +34,8 @@ Component({ ...@@ -34,7 +34,8 @@ Component({
imgArr : [], imgArr : [],
lenI : 0, lenI : 0,
WaterfallFlowListL : [], WaterfallFlowListL : [],
WaterfallFlowListR : [] WaterfallFlowListR: [],
showImg: false,
}, },
ready(){ ready(){
if (this.data.datas.componentData.paddingList){ if (this.data.datas.componentData.paddingList){
...@@ -130,6 +131,9 @@ Component({ ...@@ -130,6 +131,9 @@ Component({
['imgArr[' + ii + '].height']: it.height /b ['imgArr[' + ii + '].height']: it.height /b
}) })
}) })
this.setData({
showImg: true,
})
} }
} }
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="next-btn" wx:if="{{datas.componentData.style==='across'}}"> <view class="next-btn" wx:if="{{datas.componentData.style==='across'}}">
<i class="iconfont-common common-iconyoujiantou"></i> <i class="iconfont-common common-iconyoujiantou"></i>
</view> </view>
<view style="display:{{datas.componentData.style==='tiled' ? 'flex' : ''}}" class="ul {{datas.componentData.style==='tiled'?'isTiled':''}}"> <view style="display:{{datas.componentData.style==='tiled' ? 'flex' : ''}}" class="ul {{datas.componentData.style==='tiled'?'isTiled':''}} {{showImg ? 'show': 'hide'}}">
<view bindtap="itemClick" data-item="{{item}}" wx:for="{{datas.componentData.imgList}}" wx:key="index" style="margin-right:{{index===(datas.componentData.imgList.length-1)? '' : datas.componentData.imgPadding * 2 + 'rpx'}};width:{{datas.componentData.style==='across' ? datas.componentData.acrossPer+'%' : ''}}" class="li"> <view bindtap="itemClick" data-item="{{item}}" wx:for="{{datas.componentData.imgList}}" wx:key="index" style="margin-right:{{index===(datas.componentData.imgList.length-1)? '' : datas.componentData.imgPadding * 2 + 'rpx'}};width:{{datas.componentData.style==='across' ? datas.componentData.acrossPer+'%' : ''}}" class="li">
<image src="{{item.imageUrl}}" style="border-radius:{{2*(datas.componentData['radius']/100)}}em;width:{{datas.componentData.style==='tiled' ? imgArr[index].width : ''}}px;height:{{ datas.componentData.style==='tiled' ? imgArr[index].height : ''}}px" bindload="bindload" data-index="{{index}}" mode="{{datas.componentData.style==='across' ? 'widthFix' : ''}}"></image> <image src="{{item.imageUrl}}" style="border-radius:{{2*(datas.componentData['radius']/100)}}em;width:{{datas.componentData.style==='tiled' ? imgArr[index].width : ''}}px;height:{{ datas.componentData.style==='tiled' ? imgArr[index].height : ''}}px" bindload="bindload" data-index="{{index}}" mode="{{datas.componentData.style==='across' ? 'widthFix' : ''}}"></image>
</view> </view>
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
font-size: 32rpx; font-size: 32rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.photo-gallery .show{
opacity: 1;
}
.photo-gallery .hide{
opacity: 0;
}
.textH{ .textH{
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
......
...@@ -44,7 +44,6 @@ Component({ ...@@ -44,7 +44,6 @@ Component({
console.log(app.globalData.footerVal.componentData,'-------app.globalData.footerVal.componentData') console.log(app.globalData.footerVal.componentData,'-------app.globalData.footerVal.componentData')
componentData.list.forEach(item => { componentData.list.forEach(item => {
item.isAntt = item.icon.includes('ant-') item.isAntt = item.icon.includes('ant-')
console.log('isAntt', item.isAntt)
}) })
// 处理默认样式 // 处理默认样式
// 未选中 // 未选中
...@@ -79,7 +78,6 @@ Component({ ...@@ -79,7 +78,6 @@ Component({
params.componentData.list.forEach(item => { params.componentData.list.forEach(item => {
item.isAntt = item.icon.includes('ant-') item.isAntt = item.icon.includes('ant-')
console.log('isAntt', item.isAntt)
}) })
console.log(params.componentData.list,'app.globalData.footerVal.componentData.list') console.log(params.componentData.list,'app.globalData.footerVal.componentData.list')
......
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