Browse Source

banner富文本页面增加

tags/广东版3.2.1
刘晖 6 years ago
parent
commit
9daeb3e504
11 changed files with 115 additions and 7 deletions
  1. +2
    -1
      app.json
  2. BIN
      assets/img/discountcard.png
  3. +10
    -3
      components/banner/index.js
  4. +1
    -1
      components/banner/index.wxml
  5. +1
    -0
      config/config.js
  6. +9
    -1
      pages/bannerdetail/index.js
  7. +81
    -0
      pages/freeBannerDetail/index.js
  8. +3
    -0
      pages/freeBannerDetail/index.json
  9. +1
    -0
      pages/freeBannerDetail/index.wxml
  10. +5
    -0
      pages/freeBannerDetail/index.wxss
  11. +2
    -1
      pages/game/index.wxml

+ 2
- 1
app.json View File

@@ -37,7 +37,8 @@
"pages/index/gameentry/gentry", "pages/index/gameentry/gentry",
"pages/specialcourtesy/specialcourtesy", "pages/specialcourtesy/specialcourtesy",
"pages/discountCardList/discountCardList", "pages/discountCardList/discountCardList",
"pages/cardListDetail/cardListDetail"
"pages/cardListDetail/cardListDetail",
"pages/freeBannerDetail/index"
], ],
"navigateToMiniProgramAppIdList": [ "navigateToMiniProgramAppIdList": [
"wx192b7d2e8dcbefd0", "wx192b7d2e8dcbefd0",


BIN
assets/img/discountcard.png View File

Before After
Width: 391  |  Height: 205  |  Size: 104 KiB

+ 10
- 3
components/banner/index.js View File

@@ -28,9 +28,16 @@ Component({
}); });
}, },
gotobannerdetail: function(e) { gotobannerdetail: function(e) {
wx.navigateTo({
url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`
});
console.log(e)
if(e.currentTarget.dataset.data.type==2){
wx.navigateTo({
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}`
});
}else{
wx.navigateTo({
url: `/pages/bannerdetail/index?id=${e.currentTarget.dataset.id}`
});
}
} }
} }
}); });

+ 1
- 1
components/banner/index.wxml View File

@@ -5,7 +5,7 @@
<swiper class="index-slide" bindchange="swiperChange" autoplay="true" circular="false"> <swiper class="index-slide" bindchange="swiperChange" autoplay="true" circular="false">
<block wx:for="{{list}}" wx:key="unique"> <block wx:for="{{list}}" wx:key="unique">
<swiper-item> <swiper-item>
<image data-id="{{item.id}}" bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" />
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" />
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>


+ 1
- 0
config/config.js View File

@@ -3,6 +3,7 @@ var config = {
// url:"https://c.malls.iformall.com/C/api", // url:"https://c.malls.iformall.com/C/api",
// url:'https://ctest.malls.iformall.com/C/api', // url:'https://ctest.malls.iformall.com/C/api',
// url:'http://10.100.33.66:7000/C/api', // url:'http://10.100.33.66:7000/C/api',
// url: 'http://10.100.35.203:7000/C/api',
api: { api: {
/** /**
* 接口用途:login * 接口用途:login


+ 9
- 1
pages/bannerdetail/index.js View File

@@ -9,7 +9,8 @@ Page({
orderId: "", orderId: "",
day: "", day: "",
hour: "", hour: "",
minute: ""
minute: "",
nodes: ''
}, },
onLoad(options) { onLoad(options) {
let that = this; let that = this;
@@ -20,6 +21,13 @@ Page({
id: options.id id: options.id
} }
}).then(res => { }).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.setData({ that.setData({
data: res.data data: res.data
}); });


+ 81
- 0
pages/freeBannerDetail/index.js View File

@@ -0,0 +1,81 @@
// pages/freeBannerDetail/index.js
let app = getApp();
const config = require("../../config/config");
Page({

/**
* 页面的初始数据
*/
data: {
url: config.url,
token: app.globalData.token,
id:'',
date:new Date()
},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(config.url)
this.setData({
url: config.url,
id:options.id,
token: app.globalData.token
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},
bindLad: function(){
console.log(11212122)
debugger
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
date:new Date()
})
},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})

+ 3
- 0
pages/freeBannerDetail/index.json View File

@@ -0,0 +1,3 @@
{
"navigationBarTitleText": "卡详情"
}

+ 1
- 0
pages/freeBannerDetail/index.wxml View File

@@ -0,0 +1 @@
<web-view src="{{url+'/wxCampaign/printHtmlById?token='+token+'&id='+id+'&date='+date}}" bindmessage="bindGetMsg" bindload="bindLad"></web-view>

+ 5
- 0
pages/freeBannerDetail/index.wxss View File

@@ -0,0 +1,5 @@
/* pages/freeBannerDetail/index.wxss */
img{
width: 100%!important;
height: auto;
}

+ 2
- 1
pages/game/index.wxml View File

@@ -1 +1,2 @@
<web-view src="{{url}}" bindmessage="bindGetMsg"></web-view>
<web-view src="http://10.100.35.203:7000/C/api/wxCampaign/test?token=0ac7f4f5-7969-443b-b0f6-ab8ab1e6fdc7" bindmessage="bindGetMsg"></web-view>
<!-- <web-view src="{{url}}" bindmessage="bindGetMsg"></web-view> -->

Loading…
Cancel
Save