Procházet zdrojové kódy

[专题][修改]:[动态专题的背景颜色修改]

tags/湖南版5.1.4
meo před 6 roky
rodič
revize
fd55f6b2a6
3 změnil soubory, kde provedl 22 přidání a 11 odebrání
  1. +20
    -3
      pages/topicDetail/index.js
  2. +1
    -1
      pages/topicDetail/index.wxml
  3. +1
    -7
      pages/topicDetail/index.wxss

+ 20
- 3
pages/topicDetail/index.js Zobrazit soubor

@@ -4,7 +4,9 @@ const Http = require("../../utils/HttpBasics");
const util = require("../../utils/util");
Page({
data: {
data: {},
data: {
bgColor:"#fff"
},
couponId: null,
orderId: "",
day: "",
@@ -14,7 +16,7 @@ Page({
},
onShow() {
let that = this;
that.topicShow();
that.topicShow()
},
topicShow(){
let that = this;
@@ -29,7 +31,22 @@ Page({
that.setData({
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 => {
wx.showToast({


+ 1
- 1
pages/topicDetail/index.wxml Zobrazit soubor

@@ -1,5 +1,5 @@
<!-- banner活动详情页面 -->
<view class='coupons'>
<view class='coupons' style='background:{{data.bgColor}};height:{{winHeight}}'>
<view class="coupons-body">
<view class='banner'>
<image src='{{data.advert}}'></image>


+ 1
- 7
pages/topicDetail/index.wxss Zobrazit soubor

@@ -1,9 +1,4 @@
@import "../../app.wxss";

page {
background: #8A211B;
}

.coupons {
width: 100%;
position: relative;
@@ -70,9 +65,8 @@ page {
.proct text:nth-of-type(1) {
display: block;
font-size: 30rpx;
color: #ff4949;
letter-spacing: 0;
line-height: 32rpx;
line-height: 42rpx;
margin-bottom: 20rpx;
text-align: left!important;
/* width: 60rpx; */


Načítá se…
Zrušit
Uložit