|
|
|
@ -215,7 +215,8 @@ |
|
|
|
if (res.networkType !== 'none') { |
|
|
|
that.typee = 2; |
|
|
|
clearInterval(time); |
|
|
|
console.log('清楚网络..') |
|
|
|
console.log('清除网络..') |
|
|
|
console.log('轮询结束...'); |
|
|
|
let home = 'HOME' |
|
|
|
this.getIndex(home) |
|
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
|
@ -240,13 +241,14 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
s++; |
|
|
|
},5000); |
|
|
|
}, 1); |
|
|
|
// 轮询时间 |
|
|
|
}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.getimgheight() |
|
|
|
this.getimgheight1() |
|
|
|
this.getimgheight2() |
|
|
|
console.log(this.open_img) |
|
|
|
if (this.open_img) { |
|
|
|
setTimeout(() => { |
|
|
|
@ -261,7 +263,7 @@ |
|
|
|
created() { |
|
|
|
this.getPullMes() |
|
|
|
this.getimgheight() |
|
|
|
|
|
|
|
this.getimgheight2() |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
|
@ -530,12 +532,12 @@ |
|
|
|
|
|
|
|
if (res.error == 0) { |
|
|
|
this.indexDate = res.data |
|
|
|
// console.log(this.indexDate,'首页配置') |
|
|
|
console.log(this.indexDate,'首页配置') |
|
|
|
this.len = 0 |
|
|
|
let height = 0 |
|
|
|
this.indexDate.zones.map(item => { |
|
|
|
item.blocks.map(item1 => { |
|
|
|
console.log(item.zone_code, item) |
|
|
|
console.log(item.zone_code, item + '11111111111111') |
|
|
|
uni.getImageInfo({ |
|
|
|
src: item1.block_pic, |
|
|
|
success: (image) => { |
|
|
|
@ -565,6 +567,12 @@ |
|
|
|
// console.log(this.Swiper_H) |
|
|
|
}) |
|
|
|
} |
|
|
|
if (item.zone_code == 'BANNER1') { |
|
|
|
item.blocks.map(item1 => { |
|
|
|
this.getimgheight2(item1.block_pic) |
|
|
|
// console.log(this.Swiper_H) |
|
|
|
}) |
|
|
|
} |
|
|
|
if (item.zone_code == 'HONLIST3') { |
|
|
|
item.blocks.map(item1 => { |
|
|
|
// console.log('HONLIST3',item1) |
|
|
|
@ -1013,6 +1021,24 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
getimgheight2(item) { |
|
|
|
const that = this |
|
|
|
|
|
|
|
// 获取图片宽高 |
|
|
|
uni.getImageInfo({ |
|
|
|
src: item, |
|
|
|
success: (image) => { |
|
|
|
// //console.log(image) |
|
|
|
// this.Swiper_H = 0 |
|
|
|
this.Swiper_Hb = image.height |
|
|
|
// 计算图片渲染高度 |
|
|
|
let showH = (50 * image.height) / image.width |
|
|
|
// //console.log(showH) |
|
|
|
return this.Swiper_Hb |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取的推荐商品数据 |
|
|
|
@ -1277,13 +1303,32 @@ |
|
|
|
</swiper> |
|
|
|
</uni-swiper-dot> |
|
|
|
|
|
|
|
<!-- BANNER1 测试 --> |
|
|
|
<!-- class="discount page_padding" --> |
|
|
|
<!-- <view class="BANNER1" v-if="item.zone_code=='BANNER1' && item.zone_status=='NORMAL'"> |
|
|
|
<image :src="item.blocks[0].block_pic" |
|
|
|
:style="{height:(item.zone_code=='BANNER1')?item.zone_column+'rpx':''}" mode="" |
|
|
|
@click="imgTo(item.blocks[0])"></image> |
|
|
|
</view> --> |
|
|
|
<!-- ONEPIC --> |
|
|
|
<view class="ONEPIC" v-if="item.zone_code=='ONEPIC' && item.zone_status=='NORMAL'"> |
|
|
|
<!-- class="discount page_padding" --> |
|
|
|
<image :src="item.blocks[0].block_pic" |
|
|
|
:style="{height:(item.zone_code=='ONEPIC')?item.zone_column+'rpx':''}" mode="" |
|
|
|
@click="imgTo(item.blocks[0])"></image> |
|
|
|
</view> |
|
|
|
<!-- 轮播图 BANNER1 --> |
|
|
|
<view class="uni-margin-wrap page_padding_left1" style="padding-left: 0; padding-right: 0;" |
|
|
|
v-if="item.zone_code=='BANNER1' && item.zone_status=='NORMAL'"> |
|
|
|
<swiper class="swiper" circular :indicator-dots="true" :autoplay="true" |
|
|
|
style="display: block !important;" :style="{ height:Swiper_Hb +'rpx'}"> |
|
|
|
<swiper-item v-for="(item1,index1) in item.blocks" :key="item1.block_id"> |
|
|
|
<view class="swiper-item " v-if="item1.block_status=='NORMAL'" |
|
|
|
:style="{width:(item.zone_code=='BANNER1')?item.zone_colum+'rpx':'',heigth:'auto'}"> |
|
|
|
<image :src="item1.block_pic" mode="" @click="imgTo(item1)"></image> |
|
|
|
</view> |
|
|
|
</swiper-item> |
|
|
|
</swiper> |
|
|
|
</view> |
|
|
|
<!-- TWOPIC --> |
|
|
|
<view class="TWOPIC" v-if="item.zone_code=='TWOPIC' && item.zone_status=='NORMAL'"> |
|
|
|
<image :src="item1.block_pic" :style="{height:(item.zone_code=='TWOPIC')?item.zone_column+'rpx':''}" |
|
|
|
@ -2623,4 +2668,14 @@ |
|
|
|
font-weight: bold; |
|
|
|
font-size: 26.67rpx; |
|
|
|
} |
|
|
|
|
|
|
|
// .BANNER1 { |
|
|
|
// width: 100%; |
|
|
|
// height: 100%; |
|
|
|
// margin: -6px 0; |
|
|
|
|
|
|
|
// image { |
|
|
|
// width: 100%; |
|
|
|
// } |
|
|
|
// } |
|
|
|
</style> |
|
|
|
|