diff --git a/app.js b/app.js index 8c8db90..0ef7245 100644 --- a/app.js +++ b/app.js @@ -165,6 +165,7 @@ App({ // websocket socketClient: null, socketReceiver: function(e) {}, //收到消息回调 + curHtml: '',//富文本相关,由于浏览器传参长度有限制 }, // 初始化websocket diff --git a/app.json b/app.json index 01f58d2..1894c8e 100644 --- a/app.json +++ b/app.json @@ -66,7 +66,7 @@ ], "plugins": { "live-player-plugin": { - "version": "1.0.13", + "version": "1.0.16", "provider": "wx2b03c6e691cd7370" } }, diff --git a/config/config.js b/config/config.js index 64390b5..68bb1a0 100755 --- a/config/config.js +++ b/config/config.js @@ -36,6 +36,11 @@ var config = { * 优惠券详情 */ couponDetail: "/wxCoupon/detail", + /** + * 优惠券图文混排详情 + */ + couponHtmlDetail: "/wxCoupon/html", + couponHtmlDetailForPkg: "/couponOrder/html", /** * 业态查询 diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 9e5e6fb..3295d25 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -83,7 +83,11 @@ Page({ maxLimit:0, dispressEndDate:false, barTitle:"", - activityStatus:"" + activityStatus:"", + //图文混排 + curHtml: '', + contentType: 0, + }, /** * 显示分享弹框 @@ -443,6 +447,23 @@ Page({ }) } }, + getHtml(couponChannelId) { + Http.get({ + url: config.api.couponHtmlDetail, + data: { + couponChannelId: couponChannelId + } + }).then(res => { + console.log(res) + if (res.code == 200 && res.data.html) { + this.setData({ + curHtml: decodeURI(res.data.html) + }) + app.globalData.curHtml = this.data.curHtml; + console.log(app.globalData.curHtml) + } + }) + }, getDetail: function(couponChannelId, flag) { let that = this; var parmer = { @@ -453,6 +474,14 @@ Page({ }; Http.get(parmer) .then(res => { + //aaa + if (res.data.contentType != undefined && res.data.contentType == 1) { + //获取图文展示详情html + this.setData({ + contentType: res.data.contentType + }) + this.getHtml(couponChannelId); + } that.setData({ couponId: res.data.couponId }) @@ -600,13 +629,13 @@ Page({ wx.navigateTo({ url: `/pages/order/detail/index?orderId=${ orderId - }&cardIf=true` + }&cardIf=true&contentType=${_this.data.contentType}` }); } else if (type == 'free') { wx.navigateTo({ url: `/pages/order/detail/index?orderId=${ orderId - }` + }&contentType=${_this.data.contentType}` }); } }) @@ -867,7 +896,7 @@ Page({ }) } else { // 免费券 - that.payOrderUpdate(orderId, "0", 1, '', 'free'); + that.payOrderUpdate(orderId, "0", 1, '', 'free',that); if (that.data.cardType == 100) { wx.setStorage({ key: 'couponNum2', @@ -946,7 +975,7 @@ Page({ success: function (res) { if (res.confirm) { wx.navigateTo({ - url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, + url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&contentType=${that.data.contentType}`, }) } } diff --git a/pages/coupon/detail/index.wxml b/pages/coupon/detail/index.wxml index baab053..9ec125d 100644 --- a/pages/coupon/detail/index.wxml +++ b/pages/coupon/detail/index.wxml @@ -98,9 +98,12 @@ 购买须知 - + {{data.remark}} + + + diff --git a/pages/couponorder/detail/index.js b/pages/couponorder/detail/index.js index ffcd3c6..1759325 100644 --- a/pages/couponorder/detail/index.js +++ b/pages/couponorder/detail/index.js @@ -33,6 +33,7 @@ Page({ setInter: "", staticGamedata: {}, showIf: false, + curHtml: '', }, onUnload:function(){ let that = this; @@ -88,12 +89,20 @@ Page({ code: options.quancode, couponorderstatus: options.couponorderstatus }); + if ( + options.quancode && + that.data.couponorderstatus == 0 + ) { + //aaa + that.getHtml(options.quancode); + } //获得优惠券的详情 that.data.setInter = setInterval(function () { if ( options.quancode && that.data.couponorderstatus == 0 ) { + Http.get({ url: config.api.couponOrderDetail, data: { @@ -128,6 +137,7 @@ Page({ validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") }) } + }) .catch(err => { wx.showToast({ @@ -181,6 +191,21 @@ Page({ }); }) }, + getHtml(couponChannelId) { + Http.get({ + url: config.api.couponHtmlDetailForPkg, + data: { + // couponChannelId: '433119630735183872' + couponOrderId: couponChannelId + } + }).then(res => { + if (res.code == 200 && res.data.html) { + this.setData({ + curHtml: decodeURI(res.data.html) + }) + } + }) + }, createQrCode: function (url, canvasId, cavW, cavH) { //调用插件中的draw方法,绘制二维码图片 let that = this; diff --git a/pages/couponorder/detail/index.wxml b/pages/couponorder/detail/index.wxml index a415a0f..01883a6 100644 --- a/pages/couponorder/detail/index.wxml +++ b/pages/couponorder/detail/index.wxml @@ -104,9 +104,12 @@ 购买须知 - + {{data.remark}} + + + diff --git a/pages/order/detail/index.js b/pages/order/detail/index.js index a0839d7..9784169 100644 --- a/pages/order/detail/index.js +++ b/pages/order/detail/index.js @@ -29,7 +29,8 @@ Page({ showButton:false, cardDetail:null, supportTransfer:'', - cardIf:false + cardIf:false, + contentType: 0, }, phone: function (e) { @@ -99,7 +100,8 @@ Page({ }&title=${e.currentTarget.dataset.title}&subtitle=${ e.currentTarget.dataset.subtitle }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ - e.currentTarget.dataset.couponorderstatus}&validstatus=${e.currentTarget.dataset.validstatus}` + e.currentTarget.dataset.couponorderstatus}&validstatus=${e.currentTarget.dataset.validstatus} + &contentType=${that.data.contentType}` }); } else { wx.navigateTo({ @@ -108,7 +110,8 @@ Page({ }&title=${e.currentTarget.dataset.title}&subtitle=${ e.currentTarget.dataset.subtitle }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ - that.data.mystatus}&validstatus=${e.currentTarget.dataset.validstatus}` + that.data.mystatus}&validstatus=${e.currentTarget.dataset.validstatus} + &contentType=${that.data.contentType}` }); } }, @@ -150,9 +153,11 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + console.log(options.html) let that = this; that.setData({ - orderId: options.orderId + orderId: options.orderId, + contentType: options.contentType, }); wx.hideShareMenu() if(options.cardIf){ diff --git a/pages/orderquanma/index.js b/pages/orderquanma/index.js index 748cdb5..7f36447 100644 --- a/pages/orderquanma/index.js +++ b/pages/orderquanma/index.js @@ -20,6 +20,8 @@ Page({ setInter: "", staticGamedata: {}, showIf: false, + curHtml: '', + contentType: 0, }, gotogame: function () { let that = this; @@ -55,6 +57,8 @@ Page({ }) }, onLoad: function (options) { + console.log(options) + console.log(app.globalData.curHtml) let that = this; let value = JSON.stringify({ END: "C", TYPE: "couponorder", ID: options.quancode}) that.createQrCode(value, "qrcode", 350, 350); @@ -64,8 +68,14 @@ Page({ subtitle: options.subtitle, remark: options.remark, couponorderstatus: options.couponorderstatus, - validStatus: options.validstatus + validStatus: options.validstatus, + contentType: options.contentType }); + if (options.contentType != undefined && options.contentType==1) { + this.setData({ + curHtml: app.globalData.curHtml + }) + } /** * 如果没有核销 */ diff --git a/pages/orderquanma/index.wxml b/pages/orderquanma/index.wxml index f4ccf83..805c0e8 100644 --- a/pages/orderquanma/index.wxml +++ b/pages/orderquanma/index.wxml @@ -35,8 +35,11 @@ 购买须知: - - {{remark}} + + {{data.remark}} + + + diff --git a/project.config.json b/project.config.json index 7b80f69..417b568 100644 --- a/project.config.json +++ b/project.config.json @@ -22,13 +22,13 @@ "disablePlugins": [], "outputPath": "" }, - "useCompilerModule": false, + "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false }, "compileType": "miniprogram", "libVersion": "2.5.0", "appid": "wxfa336cad86ed598d", - "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", + "projectname": "oldC", "isGameTourist": false, "simulatorType": "wechat", "simulatorPluginLibVersion": {},