|
|
@ -157,65 +157,66 @@ |
|
|
}, 2000) |
|
|
}, 2000) |
|
|
}, |
|
|
}, |
|
|
// onReady() { |
|
|
// onReady() { |
|
|
// 轮询判断 |
|
|
// 轮询判断 |
|
|
// typee = 2 有网络 |
|
|
// typee = 2 有网络 |
|
|
//判断是否有网络(尝试解决IOS白屏) |
|
|
//判断是否有网络(尝试解决IOS白屏) |
|
|
// let that = this; |
|
|
// let that = this; |
|
|
// let s = 0; |
|
|
// let s = 0; |
|
|
// let time = setInterval(()=>{ |
|
|
// let time = setInterval(()=>{ |
|
|
// console.log('6666') |
|
|
// console.log('6666') |
|
|
// uni.getNetworkType({ |
|
|
// uni.getNetworkType({ |
|
|
// success:(res)=>{ |
|
|
// success:(res)=>{ |
|
|
// console.log(res.networkType,s); |
|
|
// console.log(res.networkType,s); |
|
|
// if(res.networkType !== 'none'){ |
|
|
// if(res.networkType !== 'none'){ |
|
|
// that.typee = 2; |
|
|
// that.typee = 2; |
|
|
// clearInterval(time); |
|
|
// clearInterval(time); |
|
|
// console.log('清楚网络..') |
|
|
// console.log('清楚网络..') |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// }) |
|
|
// }) |
|
|
// s++; |
|
|
// s++; |
|
|
// },1000); |
|
|
// },1000); |
|
|
/* uni.getNetworkType({ |
|
|
/* uni.getNetworkType({ |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
console.log(res.networkType); |
|
|
console.log(res.networkType); |
|
|
//网络类型 wifi、2g、3g、4g、ethernet、unknown、none |
|
|
//网络类型 wifi、2g、3g、4g、ethernet、unknown、none |
|
|
setTimeout(function() { |
|
|
setTimeout(function() { |
|
|
if (res.networkType === "none") { |
|
|
if (res.networkType === "none") { |
|
|
that.typee = 1; |
|
|
that.typee = 1; |
|
|
console.log("当前无网络", that.typee); |
|
|
console.log("当前无网络", that.typee); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '网络不佳,请重新打开........', |
|
|
title: '网络不佳,请重新打开........', |
|
|
duration: 20000 |
|
|
duration: 20000 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
that.typee = 2 |
|
|
that.typee = 2 |
|
|
console.log("有网络", that.typee); |
|
|
console.log("有网络", that.typee); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '网络不佳,请重新打开........', |
|
|
title: '网络不佳,请重新打开........', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, 3000) |
|
|
}, 3000) |
|
|
} |
|
|
} |
|
|
}); */ |
|
|
}); */ |
|
|
// }, |
|
|
// }, |
|
|
|
|
|
|
|
|
onLoad() { |
|
|
onLoad() { |
|
|
let that = this; // 作用域 |
|
|
let that = this; // 作用域 |
|
|
let s = 0; |
|
|
let s = 0; |
|
|
// 定时轮询网络 (IOS网络判断) |
|
|
// 定时轮询网络 (IOS网络判断) |
|
|
let time = setInterval(()=>{ |
|
|
let time = setInterval(() => { |
|
|
console.log('6666') |
|
|
console.log('6666') |
|
|
uni.getNetworkType({ |
|
|
uni.getNetworkType({ |
|
|
success:(res)=>{ |
|
|
success: (res) => { |
|
|
console.log(res.networkType,s); |
|
|
console.log(res.networkType, s); |
|
|
if(res.networkType !== 'none'){ |
|
|
if (res.networkType !== 'none') { |
|
|
that.typee = 2; |
|
|
that.typee = 2; |
|
|
clearInterval(time); |
|
|
clearInterval(time); |
|
|
console.log('清楚网络..') |
|
|
console.log('清除网络..') |
|
|
|
|
|
console.log('轮询结束...'); |
|
|
let home = 'HOME' |
|
|
let home = 'HOME' |
|
|
this.getIndex(home) |
|
|
this.getIndex(home) |
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
@ -235,18 +236,19 @@ |
|
|
// color: "#999", |
|
|
// color: "#999", |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
s++; |
|
|
s++; |
|
|
},5000); |
|
|
}, 1); |
|
|
// 轮询时间 |
|
|
// 轮询时间 |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
mounted() { |
|
|
mounted() { |
|
|
this.getimgheight() |
|
|
this.getimgheight() |
|
|
this.getimgheight1() |
|
|
this.getimgheight1() |
|
|
|
|
|
this.getimgheight2() |
|
|
console.log(this.open_img) |
|
|
console.log(this.open_img) |
|
|
if (this.open_img) { |
|
|
if (this.open_img) { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
@ -261,7 +263,7 @@ |
|
|
created() { |
|
|
created() { |
|
|
this.getPullMes() |
|
|
this.getPullMes() |
|
|
this.getimgheight() |
|
|
this.getimgheight() |
|
|
|
|
|
this.getimgheight2() |
|
|
}, |
|
|
}, |
|
|
onShow() { |
|
|
onShow() { |
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
this.isLogin = uni.getStorageSync('isLogin') |
|
|
@ -530,12 +532,12 @@ |
|
|
|
|
|
|
|
|
if (res.error == 0) { |
|
|
if (res.error == 0) { |
|
|
this.indexDate = res.data |
|
|
this.indexDate = res.data |
|
|
// console.log(this.indexDate,'首页配置') |
|
|
console.log(this.indexDate,'首页配置') |
|
|
this.len = 0 |
|
|
this.len = 0 |
|
|
let height = 0 |
|
|
let height = 0 |
|
|
this.indexDate.zones.map(item => { |
|
|
this.indexDate.zones.map(item => { |
|
|
item.blocks.map(item1 => { |
|
|
item.blocks.map(item1 => { |
|
|
console.log(item.zone_code, item) |
|
|
console.log(item.zone_code, item + '11111111111111') |
|
|
uni.getImageInfo({ |
|
|
uni.getImageInfo({ |
|
|
src: item1.block_pic, |
|
|
src: item1.block_pic, |
|
|
success: (image) => { |
|
|
success: (image) => { |
|
|
@ -565,6 +567,12 @@ |
|
|
// console.log(this.Swiper_H) |
|
|
// 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') { |
|
|
if (item.zone_code == 'HONLIST3') { |
|
|
item.blocks.map(item1 => { |
|
|
item.blocks.map(item1 => { |
|
|
// console.log('HONLIST3',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> |
|
|
</swiper> |
|
|
</uni-swiper-dot> |
|
|
</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 --> |
|
|
<!-- ONEPIC --> |
|
|
<view class="ONEPIC" v-if="item.zone_code=='ONEPIC' && item.zone_status=='NORMAL'"> |
|
|
<view class="ONEPIC" v-if="item.zone_code=='ONEPIC' && item.zone_status=='NORMAL'"> |
|
|
<!-- class="discount page_padding" --> |
|
|
|
|
|
<image :src="item.blocks[0].block_pic" |
|
|
<image :src="item.blocks[0].block_pic" |
|
|
:style="{height:(item.zone_code=='ONEPIC')?item.zone_column+'rpx':''}" mode="" |
|
|
:style="{height:(item.zone_code=='ONEPIC')?item.zone_column+'rpx':''}" mode="" |
|
|
@click="imgTo(item.blocks[0])"></image> |
|
|
@click="imgTo(item.blocks[0])"></image> |
|
|
</view> |
|
|
</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 --> |
|
|
<!-- TWOPIC --> |
|
|
<view class="TWOPIC" v-if="item.zone_code=='TWOPIC' && item.zone_status=='NORMAL'"> |
|
|
<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':''}" |
|
|
<image :src="item1.block_pic" :style="{height:(item.zone_code=='TWOPIC')?item.zone_column+'rpx':''}" |
|
|
@ -2623,4 +2668,14 @@ |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
font-size: 26.67rpx; |
|
|
font-size: 26.67rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// .BANNER1 { |
|
|
|
|
|
// width: 100%; |
|
|
|
|
|
// height: 100%; |
|
|
|
|
|
// margin: -6px 0; |
|
|
|
|
|
|
|
|
|
|
|
// image { |
|
|
|
|
|
// width: 100%; |
|
|
|
|
|
// } |
|
|
|
|
|
// } |
|
|
</style> |
|
|
</style> |
|
|
|