Browse Source

增加 BANNER1

master
zhengshuiqi 3 years ago
parent
commit
3d3fb9435f
  1. 2
      App.vue
  2. 58
      common/common.scss
  3. 163
      pages/index/index.vue

2
App.vue

@ -89,7 +89,7 @@
onShow: function() { onShow: function() {
console.log('App Show') // console.log('App Show')
}, },
onHide: function() { onHide: function() {
// console.log('App Hide') // console.log('App Hide')

58
common/common.scss

@ -1112,3 +1112,61 @@
} }
} }
} }
.wishlist-modification{
padding: 0 2.67rpx 40rpx 10rpx;
display: flex;
// padding-top: 40rpx;
// justify-content: space-between;
flex-wrap: wrap;
.wishlist_item{
display: flex;
flex-direction: column;
font-size: 25.33rpx;
font-weight: 500;
width: 100%;
margin-top: 33.33rpx;
// margin-right: 18.67rpx;
box-sizing: border-box;
&:nth-child(2n+0){
padding-left: 10px;
}
.wishlist_item_img{
width: 100%;
height: 190px;
object-fit: cover;
margin-bottom: 20rpx;
background-color: #999999;
position: relative;
border-radius: 10rpx;
.wishlist_item_img_goods{
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.select{
position: absolute;
width: 28rpx;
height: 28rpx;
top: 8rpx;
right: 8rpx;
}
}
.wishlist_item_bottom{
display: flex;
align-items: center;
padding-right: 18.67rpx;
justify-content: space-between;
.wishlist_item_bottom_icon{
width: 30rpx;
height: 30rpx;
}
}
}
}
.uni-page-refresh {
background: #000 !important;
}

163
pages/index/index.vue

@ -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);
// wifi2g3g4gethernetunknownnone // wifi2g3g4gethernetunknownnone
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')
@ -240,13 +241,14 @@
} }
}) })
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>

Loading…
Cancel
Save