diff --git a/app.json b/app.json index 7c05f8f..ff51ba3 100644 --- a/app.json +++ b/app.json @@ -21,6 +21,7 @@ "pages/scanPay/scanPay", "pages/edit/edit", "pages/actdetail/actdetail", + "pages/radetail/index", "pages/bannerdetail/index", "pages/getuserinfo/index", "pages/phoneinput/phoneinput", diff --git a/components/banner/index.js b/components/banner/index.js index ab82593..9dae2c7 100644 --- a/components/banner/index.js +++ b/components/banner/index.js @@ -21,17 +21,14 @@ Component({ /** * 组件的方法列表 */ - ready() {}, methods: { gotobannerdetail: function(e) { - console.log(e) if (e.currentTarget.dataset.data.type == 3) { // 小程序路径 wx.navigateTo({ url: `/${e.currentTarget.dataset.data.pagePath}` - }); - } - else if(e.currentTarget.dataset.data.type==2){ + }) + }else if(e.currentTarget.dataset.data.type==2){ // 自由图文 wx.navigateTo({ url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` diff --git a/config/config.js b/config/config.js index 81d718a..c537836 100755 --- a/config/config.js +++ b/config/config.js @@ -297,7 +297,9 @@ var config = { /** * 富文本详情 */ - printHtmlById:"/wxCampaign/printHtmlById" + printHtmlById:"/wxCampaign/printHtmlById", + acfindById:"/wxActivity/findById", + acPrintHtmlById:"/wxActivity/printHtmlById" }, weapp: { AppId: weappId diff --git a/pages/bannerdetail/index.js b/pages/bannerdetail/index.js index 6f3dda9..077b1e9 100644 --- a/pages/bannerdetail/index.js +++ b/pages/bannerdetail/index.js @@ -24,8 +24,6 @@ Page({ } }).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 }) diff --git a/pages/bannerdetail/index.wxml b/pages/bannerdetail/index.wxml index b25aded..ebec148 100644 --- a/pages/bannerdetail/index.wxml +++ b/pages/bannerdetail/index.wxml @@ -5,14 +5,12 @@ - {{data.title}} {{data.subTitle}} 活动说明 {{data.detail}} - - diff --git a/pages/freeBannerDetail/index.js b/pages/freeBannerDetail/index.js index ae1d1f7..e4b74f8 100644 --- a/pages/freeBannerDetail/index.js +++ b/pages/freeBannerDetail/index.js @@ -24,15 +24,6 @@ Page({ id:options.id, token: app.globalData.token }) - - /*** WxParse.wxParse(bindName , type, data, target,imagePadding) - * 1.bindName绑定的数据名(必填) - * 2.type可以为html或者md(必填) - * 3.data为传入的具体数据(必填) - * 4.target为Page对象,一般为this(必填) - * 5.imagePadding为当图片自适应是左右的单一padding(默认为0,可选)*/ - // that.getWord(options.id) - wx.request({ url: 'https://ciformall.youlane.cn/C/api' + config.api.printHtmlById, data: { @@ -48,29 +39,6 @@ Page({ } }) }, - - /** - * 获得宣传页富文本详情 - */ - getWord(id){ - let that = this; - wx.request({ - url: 'https://ciformall.youlane.cn/C/api'+config.api.printHtmlById, - data: { - token: app.globalData.token, - id: id, - date: new Date() - }, - header: { - 'content-type': 'application/html' - }, - success:function(res){ - that.setData({ - wordHtml:res.data - }) - } - }) - }, /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/index/index.js b/pages/index/index.js index de20a23..2986528 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -13,7 +13,6 @@ Page({ */ onLoad: function(options) { let that = this; - console.log(options) wx.showToast({ title: '加载中', icon: "loading", @@ -66,6 +65,9 @@ Page({ } else if (options.type == 'md') { // 门店详情 options.id = this.data.newArr[2]; + } else if (options.type == 'ra') { + //活动详情 + options.id = this.data.newArr[2]; } } } @@ -159,6 +161,12 @@ Page({ else if (options && options.id && app.globalData.type == 'gm') { that.getGameOne(app.globalData.token, options.id) } + // 报名活动页面 + else if (options && options.id && app.globalData.type == 'ra') { + wx.redirectTo({ + url: `/pages/radetail/index?id=${options.id}`, + }) + } // 宣传页详情 else if (options && options.bt && options.id && app.globalData.type == 'bd') { if (options.bt == '2') { diff --git a/pages/radetail/index.js b/pages/radetail/index.js new file mode 100644 index 0000000..7114015 --- /dev/null +++ b/pages/radetail/index.js @@ -0,0 +1,70 @@ +let config = require("../../config/config.js"); +let app = getApp(); +const Http = require("../../utils/HttpBasics"); +const util = require("../../utils/util"); +var WxParse = require('../../wxParse/wxParse.js'); +const imgurl = require("../../utils/imgurl"); +Page({ + data: { + data: {}, + couponId: null, + orderId: "", + day: "", + hour: "", + wmhome: imgurl.wmhome.url, + minute: "", + nodes: '' + }, + onLoad(options) { + let that = this; + console.log(options) + if (options.id){ + Http.get({ + url: config.api.acfindById, + data: { + id: options.id + } + }).then(res => { + that.setData({ + data: res.data.activity + }); + if (res.data.activity.type == 2 ){ + wx.request({ + url: 'https://ciformall.youlane.cn/C/api' + config.api.acPrintHtmlById, + data: { + id: options.id, + date: new Date(), + token: app.globalData.token, + }, + header: { + 'content-type': 'application/html' + }, + success: function (res) { + var temp = WxParse.wxParse('article', 'html', res.data, that, 5); + } + }) + } + }).catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }) + }) + } + }, + goback: function () { + wx.switchTab({ + url: '/pages/main/index', + }) + }, + 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/radetail/index.json b/pages/radetail/index.json new file mode 100644 index 0000000..9fabb8c --- /dev/null +++ b/pages/radetail/index.json @@ -0,0 +1,3 @@ +{ + "navigationBarTitleText": "活动详情" +} \ No newline at end of file diff --git a/pages/radetail/index.wxml b/pages/radetail/index.wxml new file mode 100644 index 0000000..8f8081a --- /dev/null +++ b/pages/radetail/index.wxml @@ -0,0 +1,59 @@ + + + + + + + {{data.title}} + {{data.subTitle}} + + 活动说明 + {{data.detail}} + + + + + + + + + + + + + + {{item.title}} + {{item.subTitle}} + + {{item.salePriceStr}} + + 满¥{{item.usePriceStr}}可用 + + + 仅限本店使用 + + + + + + + + 免费领 + 马上购 + + + + + + + + + + +