From a799090531df5aa3e9409bf7cc7898bc0b9e763a Mon Sep 17 00:00:00 2001
From: meo <18801474720@163.com>
Date: Tue, 2 Apr 2019 18:43:47 +0800
Subject: [PATCH] =?UTF-8?q?[=E4=B8=93=E9=A2=98][=E5=A2=9E=E5=8A=A0]:[?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=93=E9=A2=98=E8=AF=A6=E6=83=85=E6=A8=A1?=
=?UTF-8?q?=E5=9D=97]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app.json | 1 +
pages/main/index.js | 15 ++++++++---
pages/main/index.wxml | 4 +--
pages/topicDetail/index.js | 48 +++++++++++++++++-------------------
pages/topicDetail/index.wxml | 24 ++++--------------
pages/topicDetail/index.wxss | 9 ++++---
6 files changed, 48 insertions(+), 53 deletions(-)
diff --git a/app.json b/app.json
index bc19844..8f5e5e4 100644
--- a/app.json
+++ b/app.json
@@ -7,6 +7,7 @@
"pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup",
"pages/complete/index",
+ "pages/topicDetail/index",
"pages/main/index",
"pages/index/searchbar/index",
"pages/bargain/bargainDatail/bargainDatail",
diff --git a/pages/main/index.js b/pages/main/index.js
index cb77c6c..7bb225d 100644
--- a/pages/main/index.js
+++ b/pages/main/index.js
@@ -35,6 +35,7 @@ Page({
desc: null,
scrollTop: 0,
showGame: false,
+ showTopic:false,
gamedata: {},
couponId: '', //游戏返回时传回的字段
played: false, //从游戏页面跳回首页返回true
@@ -475,14 +476,22 @@ Page({
token: app.globalData.token
}
}).then(res => {
- console.log(res);
- that.data.cover = res.data.list[0].cover
+ if (res&&res.data){
+ that.setData({
+ cover: res.data.cover,
+ showTopic: true
+ })
+ }
})
.catch(err => {
console.log(err);
})
},
-
+ gotoTopic(){
+ wx.navigateTo({
+ url: '/pages/topicDetail/index',
+ })
+ },
/**
* 检查用户是否有车
*/
diff --git a/pages/main/index.wxml b/pages/main/index.wxml
index 11e4f92..bb6fe66 100644
--- a/pages/main/index.wxml
+++ b/pages/main/index.wxml
@@ -53,8 +53,8 @@
-
-
+
+
diff --git a/pages/topicDetail/index.js b/pages/topicDetail/index.js
index 6f17dbe..067c8dc 100644
--- a/pages/topicDetail/index.js
+++ b/pages/topicDetail/index.js
@@ -12,39 +12,37 @@ Page({
minute: "",
nodes: ''
},
- onLoad(options) {
+ onShow() {
let that = this;
- if (options.id){
- Http.get({
- url: config.api.bannerDetail,
- data: {
- id: options.id
- }
- }).then(res => {
- if(res.data.type==2){
- console.log(res.data.html,33333333)
- // console.log(JSON.parse(res.data.html),222222222222)
- that.setData({
- nodes: res.data.html
- })
- }
+ that.topicShow();
+ },
+ topicShow(){
+ let that = this;
+ Http.get({
+ url: config.api.topicShow,
+ data: {
+ token: app.globalData.token
+ }
+ }).then(res => {
+ console.log(res)
+ if (res&&res.data) {
that.setData({
data: res.data
});
- }).catch(err => {
- wx.showToast({
- title: err.errMsg,
- icon: 'none',
- duration: 2000,
- mask: false
- });
- })
- }
+ console.log(that.data.data)
+ }
+ }).catch(err => {
+ wx.showToast({
+ title: err.errMsg,
+ icon: 'none',
+ duration: 2000,
+ mask: false
+ });
+ })
},
gotoactdetail:function(){
let that = this;
console.log(that.data.data.detail)
-
wx.navigateTo({
url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
})
diff --git a/pages/topicDetail/index.wxml b/pages/topicDetail/index.wxml
index 026d8a1..6cb0d6c 100644
--- a/pages/topicDetail/index.wxml
+++ b/pages/topicDetail/index.wxml
@@ -2,34 +2,20 @@
-
+
-
- {{data.title}}
- {{data.subTitle}}
+ {{data.name}}
+ {{data.title}}
- 活动说明
- {{data.detail}}
-
-
-
-
-
- 活动详情
-
-
- {{data.detail}}
+ {{data.content}}
-
-
+
diff --git a/pages/topicDetail/index.wxss b/pages/topicDetail/index.wxss
index acab8d0..aabb637 100644
--- a/pages/topicDetail/index.wxss
+++ b/pages/topicDetail/index.wxss
@@ -1,7 +1,7 @@
@import "../../app.wxss";
page {
- background: #eee;
+ background: #8A211B;
}
.coupons {
@@ -22,8 +22,8 @@ page {
}
.banner image {
+ display: block;
width: 750rpx;
- height: 280rpx;
}
.act {
@@ -32,13 +32,13 @@ page {
background: #fff;
border-radius: 12rpx;
width: 705rpx;
- /* height: 212rpx; */
- margin: 24rpx auto 0;
+ margin: -30rpx auto 0;
padding-bottom: 20rpx;
}
.act text {
display: block;
+ text-align: center;
padding-left: 4.8%;
padding-right: 4.8%;
}
@@ -74,6 +74,7 @@ page {
letter-spacing: 0;
line-height: 32rpx;
margin-bottom: 20rpx;
+ text-align: left!important;
/* width: 60rpx; */
/* height: 64rpx; */
}