Commit 61883d3e by 李嘉林

首页优化暂存

parent b1620a23
......@@ -74,13 +74,11 @@ export default {
// 页面配置信息
this.getThemePage(extConfig);
// this.getThemePage(extConfig);
let mpApp = getApp();
console.log(mpApp, "this.mpApp");
mpApp.getShopInfo = this.getShopInfo
mpApp.getThemePage = this.getThemePage
setTimeout(() => {
},300)
},
async mounted() {
......@@ -301,7 +299,7 @@ export default {
},
//商城配置
async shopConfiguration(){
await shop.get_shop_configuration().then(res=>{
shop.get_shop_configuration().then(res=>{
if (res.data.code == 200) {
let mpApp = getApp();
mpApp.shop_configuration = res.data.data
......@@ -310,11 +308,12 @@ export default {
})
},
async getThemePage({ mixid, shopid }) {
console.log("getThemePage--App.vue")
let {offlineShopCode} = getStoreInfo();
await shop
.themePagesInfo({
shopMixId: offlineShopCode?offlineShopCode:mixid,
homePageFlag: false
homePageFlag: true
})
.then((response) => {
if (response.data.code == 200) {
......
......@@ -88,6 +88,10 @@ console.log(process.env,'-----------------config------')
outDataSourceData(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 {
},
data() {
return {
pageData: [],
contentList: [],
}
},
......@@ -56,11 +57,21 @@ export default {
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) : [];
console.log(this.contentList, '------------------------45')
this.pageData = res.data.data.pageData ? JSON.parse(res.data.data.pageData) : [];
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>
......
......@@ -40,6 +40,9 @@ export default {
},
async onLoad() {
try {
this.getLocationHandle(() => {
this.$emit("toUpdate");
});
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig")));
console.log(shopInfo,'-------------shopInfo')
if (shopInfo.data.code == 200) {
......@@ -47,14 +50,6 @@ export default {
this.logoUrl = DFSImg(shopInfo.data.data.logoUrl, 400, 400);
console.log(this.openThousandsStoresFlag,this.logoUrl,'-------------shopInfo')
}
if (this.openThousandsStoresFlag) {
this.getLocationHandle(() => {
this.$emit("toUpdate");
// this.getShopList();
});
} else {
this.$emit("toUpdate");
}
this.reloadName();
} catch (error) {
this.$emit("toUpdate");
......@@ -87,8 +82,8 @@ export default {
_this.offlineStoreReq.latitude = res.latitude;
_this.offlineStoreReq.longitude = res.longitude;
// 存缓存
wx.setStorageSync("locationObj", JSON.stringify(res));
callback(res);
wx.setStorageSync("locationObj", JSON.stringify(res));
},
fail: res => {
log.info("++++++++++2++++++", res);
......
......@@ -155,7 +155,8 @@ mpApp.themeColor = {}
mpApp.log = log
mpApp.tool = tool
function getThemePage({mixid,shopid}) {
function getThemePage({ mixid, shopid }) {
console.log("getThemePage--main.js")
let {offlineShopCode} = getStoreInfo();
shop
.themePagesInfo({
......
......@@ -9,118 +9,118 @@
<CustomNav :customBgOpacity="customBgOpacity"></CustomNav>
<StoreAddr @toUpdate="reloadEnterShopRule" @toPageLoading="toPageLoading" ref="StoreAddr"></StoreAddr>
<ThemeDataPlant></ThemeDataPlant>
<template v-if="!componentsLoading">
<div v-for="(item,index) in pageData" :key="index">
<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 v-if="item.componentCode == 'embed-module' && item.componentInfo.visible == 1">
<embedModule :datas="item" :componentIndex="index"></embedModule>
</div>
<div v-for="(item,index) in pageData" :key="index">
<div v-if="item.componentCode == 'embed-module' && item.componentInfo.visible == 1">
<embedModule :datas="item" :componentIndex="index"></embedModule>
</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>
<bottomCont v-if="showbottomCont"></bottomCont>
<template>
......@@ -233,7 +233,6 @@ export default {
showbottomCont: false, //展示底部logo
showSpe: false,
pageLoading: true,
componentsLoading: true,
firstOpenPage: true, //首次打开页面
h5Params: {}, //params
fromPage: "",
......@@ -484,11 +483,12 @@ export default {
}
// 获取页面数据
if (this.mpApp.globalData.pageList) {
console.log("获取页面数据-1")
that.init(this.mpApp.globalData.pageList);
} else {
this.mpApp.pageCallBack = function (params) {
console.log("获取页面数据-2")
that.init(params);
};
}
......@@ -557,16 +557,15 @@ export default {
methods: {
setPageLoading() {
this.componentsLoading = false;
setTimeout(() => {
this.pageLoading = false;
}, 3000);
}, 700);
},
reloadEnterShopRule() {
console.log('eloadEnterShopRule')
// 进店规则--首次进店调用
if (this.h5Params && this.h5Params.offlineShopCode) {
this.setPageLoading();
// this.setPageLoading();
return;
};
console.log('home-methods-reloadEnterShopRule')
......@@ -576,60 +575,55 @@ export default {
this.enterStoreRule();
} else {
console.log('reloadEnterShopRule-------2')
this.setPageLoading();
// this.setPageLoading();
}
},
async enterStoreRule() {
try {
let shopInfo = await shop.getShopInfo(JSON.parse(wx.getStorageSync("extConfig")));
let openThousandsStoresFlag = shopInfo.data.data.openThousandsStoresFlag == 1;
if (openThousandsStoresFlag); {
console.log(wx.getStorageSync("locationObj"),'--locationObj')
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
let query = {
channelType: 2, //设备类型(0:pc,1:app,2:小程序)
consumerLongitude: locationObj.longitude?locationObj.longitude.toString() : "", //经度,小程序和app可以获取到就要传,没有不传
consumerLatitude: locationObj.latitude?locationObj.latitude.toString() : "", //纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopCode: this.h5Params.offlineShopCode || "" //分销员门店id,没有不传
}
console.log(`%cgetEnterShopId---query${JSON.stringify(query)}`,'color:yellow;font-size:20px;')
let res = await shop.getEnterShopId(query);
console.log(`%cgetEnterShopId${JSON.stringify(res)}`,'color:yellow;font-size:20px;')
if (res.data.code == 200) {
let enterShopId = res.data.data;
console.log(enterShopId,'--enterShopId')
if (enterShopId) {
let storeDetail = await shop.getOfflineStoreDetail({
shopId: enterShopId,
console.log(wx.getStorageSync("locationObj"),'--locationObj')
let locationObj = wx.getStorageSync("locationObj") ? JSON.parse(wx.getStorageSync("locationObj")) : {};
let query = {
channelType: 2, //设备类型(0:pc,1:app,2:小程序)
consumerLongitude: locationObj.longitude?locationObj.longitude.toString() : "", //经度,小程序和app可以获取到就要传,没有不传
consumerLatitude: locationObj.latitude?locationObj.latitude.toString() : "", //纬度,小程序和app可以获取到就要传,没有不传
distributionOfficerShopCode: this.h5Params.offlineShopCode || "" //分销员门店id,没有不传
}
console.log(`%cgetEnterShopId---query${JSON.stringify(query)}`,'color:yellow;font-size:20px;')
let res = await shop.getEnterShopId(query);
console.log(`%cgetEnterShopId${JSON.stringify(res)}`,'color:yellow;font-size:20px;')
if (res.data.code == 200) {
let enterShopId = res.data.data;
console.log(enterShopId,'--enterShopId')
if (enterShopId) {
let storeDetail = await shop.getOfflineStoreDetail({
shopId: enterShopId,
});
if (storeDetail.data.code == 200) {
setStoreInfo({
offlineShopCode: storeDetail.data.data.shopCode,
offlineShopName: storeDetail.data.data.shopName,
});
if (storeDetail.data.code == 200) {
setStoreInfo({
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);
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);
}
}
} catch (error) {
}
this.setPageLoading();
// this.setPageLoading();
},
toPageLoading() {
// this.pageLoading = true;
},
async setVisible(pageList, cb) {
// 首页显示条件
......@@ -745,6 +739,7 @@ export default {
return JSON.stringify(pageData);
},
init(pageList) {
console.log("home-init");
this.getCartNum();
this.active=checkTabbarPage('/');
this.setVisible(this.mpApp.globalData.pageList,(res)=>{
......@@ -755,7 +750,7 @@ export default {
this.showbottomCont = true;
}, 100);
log.info("36----------------------559", this.pageData,this.pageInfo.pageSettingData);
this.setPageLoading();
log.info(app.globalData.shopInfo,'app')
wx.setNavigationBarTitle({title : app.globalData.shopInfo.shopName})
console.log(this.pageInfo.pageSettingData,'-this.pageInfo.pageSettingData')
......@@ -1110,13 +1105,11 @@ export default {
async getThemeList() {
console.log("getThemeList")
this.pageLoading = true;
this.componentsLoading = true;
try {
await app.getThemePage(this.$store.state.extConfig);
} catch (error) {
}
this.setPageLoading();
},
async refreshInit() {
log.info('onPullDownRefresh',this.$store.state.extConfig)
......
......@@ -2,7 +2,7 @@
<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 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 style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
......@@ -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 class="cube2 clearfix" style="overflow-x:auto;overflow-y:hidden" bindtouchmove="touchmove">
<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 class="item-img {{item.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item.imageUrl}}" src="{{item.imageUrl}}"></image>
......@@ -38,8 +38,8 @@
<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-item wx:for="{{swiperList}}" 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">
<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-index="index1" wx:for="{{item}}" data-item="{{item1}}" bindtap="onclickHandle">
<view style="padding-left:{{getImgSize}}%;padding-right:{{getImgSize}}%">
<view class="item-img {{item1.imageUrl == '' ? 'item-bg' : ''}}">
<image wx:if="{{item1.imageUrl}}" src="{{item1.imageUrl}}"></image>
......
const app = getApp();
const { log } = app;
const { goodsApi, DFSImg, $themeToLink } = app;
const { goodsApi, DFSImg, $themeToLink, processEnv } = app;
function random_string(len) {
len = len || 32;
var chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
......@@ -314,7 +314,7 @@ const componentOptions = {
query.minPrice = this.data.submitFliterVal.minPrice;
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 });
if (res.data.code == 200) {
let goodsLists = res.data.data.list;
......@@ -541,6 +541,7 @@ const componentOptions = {
let storageDatasList = this.getStorageSync('storageDatasList') || []
let { style } = storageDatasList[that.data.datasIndex];
if (!style) return;
let type = ''
if(style == 'list' || style == 'rowList'){
type = 'goods-item'
......
<!--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)}}">
<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}}">
<block wx:if="{{item.imageUrl||datas.componentData.singleImage}}">
<view wx:if="{{datas.componentData.styleType===1}}">
......
......@@ -34,7 +34,8 @@ Component({
imgArr : [],
lenI : 0,
WaterfallFlowListL : [],
WaterfallFlowListR : []
WaterfallFlowListR: [],
showImg: false,
},
ready(){
if (this.data.datas.componentData.paddingList){
......@@ -130,6 +131,9 @@ Component({
['imgArr[' + ii + '].height']: it.height /b
})
})
this.setData({
showImg: true,
})
}
}
......
......@@ -15,7 +15,7 @@
<view class="next-btn" wx:if="{{datas.componentData.style==='across'}}">
<i class="iconfont-common common-iconyoujiantou"></i>
</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">
<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>
......
......@@ -9,6 +9,12 @@
font-size: 32rpx;
box-sizing: border-box;
}
.photo-gallery .show{
opacity: 1;
}
.photo-gallery .hide{
opacity: 0;
}
.textH{
text-align: center;
font-weight: bold;
......
......@@ -44,7 +44,6 @@ Component({
console.log(app.globalData.footerVal.componentData,'-------app.globalData.footerVal.componentData')
componentData.list.forEach(item => {
item.isAntt = item.icon.includes('ant-')
console.log('isAntt', item.isAntt)
})
// 处理默认样式
// 未选中
......@@ -79,7 +78,6 @@ Component({
params.componentData.list.forEach(item => {
item.isAntt = item.icon.includes('ant-')
console.log('isAntt', item.isAntt)
})
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