Bläddra i källkod

[专题][增加]:[增加专题详情模块]

tags/湖南版5.1.4
meo 6 år sedan
förälder
incheckning
a799090531
6 ändrade filer med 48 tillägg och 53 borttagningar
  1. +1
    -0
      app.json
  2. +12
    -3
      pages/main/index.js
  3. +2
    -2
      pages/main/index.wxml
  4. +23
    -25
      pages/topicDetail/index.js
  5. +5
    -19
      pages/topicDetail/index.wxml
  6. +5
    -4
      pages/topicDetail/index.wxss

+ 1
- 0
app.json Visa fil

@@ -7,6 +7,7 @@
"pages/spellGroup/mySpellGroup/index", "pages/spellGroup/mySpellGroup/index",
"pages/spellGroup/spellGroup", "pages/spellGroup/spellGroup",
"pages/complete/index", "pages/complete/index",
"pages/topicDetail/index",
"pages/main/index", "pages/main/index",
"pages/index/searchbar/index", "pages/index/searchbar/index",
"pages/bargain/bargainDatail/bargainDatail", "pages/bargain/bargainDatail/bargainDatail",


+ 12
- 3
pages/main/index.js Visa fil

@@ -35,6 +35,7 @@ Page({
desc: null, desc: null,
scrollTop: 0, scrollTop: 0,
showGame: false, showGame: false,
showTopic:false,
gamedata: {}, gamedata: {},
couponId: '', //游戏返回时传回的字段 couponId: '', //游戏返回时传回的字段
played: false, //从游戏页面跳回首页返回true played: false, //从游戏页面跳回首页返回true
@@ -475,14 +476,22 @@ Page({
token: app.globalData.token token: app.globalData.token
} }
}).then(res => { }).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 => { .catch(err => {
console.log(err); console.log(err);
}) })
}, },

gotoTopic(){
wx.navigateTo({
url: '/pages/topicDetail/index',
})
},
/** /**
* 检查用户是否有车 * 检查用户是否有车
*/ */


+ 2
- 2
pages/main/index.wxml Visa fil

@@ -53,8 +53,8 @@
<image src='{{newcard}}'></image> <image src='{{newcard}}'></image>
</view> </view>
</view> </view>
<view class='product'>
<image src='{{product}}'></image>
<view class='product' wx:if="{{showTopic}}">
<image src='{{cover}}' bindtap='gotoTopic' mode='aspectFill'></image>
</view> </view>
<!-- 砍价专场 --> <!-- 砍价专场 -->
<c-bargain id="bargain"/> <c-bargain id="bargain"/>


+ 23
- 25
pages/topicDetail/index.js Visa fil

@@ -12,39 +12,37 @@ Page({
minute: "", minute: "",
nodes: '' nodes: ''
}, },
onLoad(options) {
onShow() {
let that = this; 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({ that.setData({
data: res.data 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(){ gotoactdetail:function(){
let that = this; let that = this;
console.log(that.data.data.detail) console.log(that.data.data.detail)
wx.navigateTo({ wx.navigateTo({
url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`, url: `/pages/actdetail/actdetail?detail=${that.data.data.detail}`,
}) })


+ 5
- 19
pages/topicDetail/index.wxml Visa fil

@@ -2,34 +2,20 @@
<view class='coupons'> <view class='coupons'>
<view class="coupons-body"> <view class="coupons-body">
<view class='banner'> <view class='banner'>
<image src='{{data.coverImg}}'></image>
<image src='{{data.advert}}'></image>
</view> </view>
<!-- <image class="orbg" src='./../../assets/img/orbg.png' mode="widthFix"></image> -->
<view class='act'> <view class='act'>
<text class='txt001'>{{data.title}}</text>
<text class='txt002'>{{data.subTitle}}</text>
<text class='txt001'>{{data.name}}</text>
<text class='txt002'>{{data.title}}</text>
<view class="proct"> <view class="proct">
<text>活动说明</text>
<text>{{data.detail}}</text>
<!-- <image class="jian" src='../../assets/img/jian.png' mode="widthFix"></image> -->
</view>
</view>
<view class='notes' style='display:none;'>
<view>
<text>活动详情</text>
</view>
<view>
<text><text class='spot'></text>{{data.detail}}</text>
<text>{{data.content}}</text>
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="buy-view app-border-top">
<button bindtap='orderFunc' class='buy'>立即购买</button>
</view> -->


<view class='contain clearfix'> <view class='contain clearfix'>
<!-- 优惠券 --> <!-- 优惠券 -->
<navigator wx:for="{{data.coupons}}" wx:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId={{item.id}}&couponId={{item.couponId}}">
<navigator wx:for="{{data.couponList}}" wx:key="{{index}}" url="/pages/coupon/detail/index?couponChannelId={{item.id}}&couponId={{item.couponId}}">
<!-- 首页优惠券列表页面 --> <!-- 首页优惠券列表页面 -->
<view class="coupons1"> <view class="coupons1">
<view class="coupons1-img"> <view class="coupons1-img">


+ 5
- 4
pages/topicDetail/index.wxss Visa fil

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


page { page {
background: #eee;
background: #8A211B;
} }


.coupons { .coupons {
@@ -22,8 +22,8 @@ page {
} }


.banner image { .banner image {
display: block;
width: 750rpx; width: 750rpx;
height: 280rpx;
} }


.act { .act {
@@ -32,13 +32,13 @@ page {
background: #fff; background: #fff;
border-radius: 12rpx; border-radius: 12rpx;
width: 705rpx; width: 705rpx;
/* height: 212rpx; */
margin: 24rpx auto 0;
margin: -30rpx auto 0;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }


.act text { .act text {
display: block; display: block;
text-align: center;
padding-left: 4.8%; padding-left: 4.8%;
padding-right: 4.8%; padding-right: 4.8%;
} }
@@ -74,6 +74,7 @@ page {
letter-spacing: 0; letter-spacing: 0;
line-height: 32rpx; line-height: 32rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
text-align: left!important;
/* width: 60rpx; */ /* width: 60rpx; */
/* height: 64rpx; */ /* height: 64rpx; */
} }


Laddar…
Avbryt
Spara