@@ -4,7 +4,9 @@ const Http = require("../../utils/HttpBasics"); | |||||
const util = require("../../utils/util"); | const util = require("../../utils/util"); | ||||
Page({ | Page({ | ||||
data: { | data: { | ||||
data: {}, | |||||
data: { | |||||
bgColor:"#fff" | |||||
}, | |||||
couponId: null, | couponId: null, | ||||
orderId: "", | orderId: "", | ||||
day: "", | day: "", | ||||
@@ -14,7 +16,7 @@ Page({ | |||||
}, | }, | ||||
onShow() { | onShow() { | ||||
let that = this; | let that = this; | ||||
that.topicShow(); | |||||
that.topicShow() | |||||
}, | }, | ||||
topicShow(){ | topicShow(){ | ||||
let that = this; | let that = this; | ||||
@@ -29,7 +31,22 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
data: res.data | data: res.data | ||||
}); | }); | ||||
console.log(that.data.data) | |||||
/** | |||||
* 获取屏幕的高度 | |||||
* | |||||
*/ | |||||
let query = wx.createSelectorQuery(); | |||||
query.select('.coupons').boundingClientRect(); | |||||
query.selectViewport().scrollOffset(); | |||||
query.exec((res) => { | |||||
let listHeight = res[0].height; // 获取list高度 | |||||
let windowHeight = wx.getSystemInfoSync().windowHeight; | |||||
if (windowHeight >= listHeight){ | |||||
that.setData({ | |||||
winHeight:'100%' | |||||
}) | |||||
} | |||||
}) | |||||
} | } | ||||
}).catch(err => { | }).catch(err => { | ||||
wx.showToast({ | wx.showToast({ | ||||
@@ -1,5 +1,5 @@ | |||||
<!-- banner活动详情页面 --> | <!-- banner活动详情页面 --> | ||||
<view class='coupons'> | |||||
<view class='coupons' style='background:{{data.bgColor}};height:{{winHeight}}'> | |||||
<view class="coupons-body"> | <view class="coupons-body"> | ||||
<view class='banner'> | <view class='banner'> | ||||
<image src='{{data.advert}}'></image> | <image src='{{data.advert}}'></image> | ||||
@@ -1,9 +1,4 @@ | |||||
@import "../../app.wxss"; | @import "../../app.wxss"; | ||||
page { | |||||
background: #8A211B; | |||||
} | |||||
.coupons { | .coupons { | ||||
width: 100%; | width: 100%; | ||||
position: relative; | position: relative; | ||||
@@ -70,9 +65,8 @@ page { | |||||
.proct text:nth-of-type(1) { | .proct text:nth-of-type(1) { | ||||
display: block; | display: block; | ||||
font-size: 30rpx; | font-size: 30rpx; | ||||
color: #ff4949; | |||||
letter-spacing: 0; | letter-spacing: 0; | ||||
line-height: 32rpx; | |||||
line-height: 42rpx; | |||||
margin-bottom: 20rpx; | margin-bottom: 20rpx; | ||||
text-align: left!important; | text-align: left!important; | ||||
/* width: 60rpx; */ | /* width: 60rpx; */ | ||||