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({
......
...@@ -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