| @@ -165,6 +165,7 @@ App({ | |||||
| // websocket | // websocket | ||||
| socketClient: null, | socketClient: null, | ||||
| socketReceiver: function(e) {}, //收到消息回调 | socketReceiver: function(e) {}, //收到消息回调 | ||||
| curHtml: '',//富文本相关,由于浏览器传参长度有限制 | |||||
| }, | }, | ||||
| // 初始化websocket | // 初始化websocket | ||||
| @@ -66,7 +66,7 @@ | |||||
| ], | ], | ||||
| "plugins": { | "plugins": { | ||||
| "live-player-plugin": { | "live-player-plugin": { | ||||
| "version": "1.0.13", | |||||
| "version": "1.0.16", | |||||
| "provider": "wx2b03c6e691cd7370" | "provider": "wx2b03c6e691cd7370" | ||||
| } | } | ||||
| }, | }, | ||||
| @@ -36,6 +36,11 @@ var config = { | |||||
| * 优惠券详情 | * 优惠券详情 | ||||
| */ | */ | ||||
| couponDetail: "/wxCoupon/detail", | couponDetail: "/wxCoupon/detail", | ||||
| /** | |||||
| * 优惠券图文混排详情 | |||||
| */ | |||||
| couponHtmlDetail: "/wxCoupon/html", | |||||
| couponHtmlDetailForPkg: "/couponOrder/html", | |||||
| /** | /** | ||||
| * 业态查询 | * 业态查询 | ||||
| @@ -83,7 +83,11 @@ Page({ | |||||
| maxLimit:0, | maxLimit:0, | ||||
| dispressEndDate:false, | dispressEndDate:false, | ||||
| barTitle:"", | 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) { | getDetail: function(couponChannelId, flag) { | ||||
| let that = this; | let that = this; | ||||
| var parmer = { | var parmer = { | ||||
| @@ -453,6 +474,14 @@ Page({ | |||||
| }; | }; | ||||
| Http.get(parmer) | Http.get(parmer) | ||||
| .then(res => { | .then(res => { | ||||
| //aaa | |||||
| if (res.data.contentType != undefined && res.data.contentType == 1) { | |||||
| //获取图文展示详情html | |||||
| this.setData({ | |||||
| contentType: res.data.contentType | |||||
| }) | |||||
| this.getHtml(couponChannelId); | |||||
| } | |||||
| that.setData({ | that.setData({ | ||||
| couponId: res.data.couponId | couponId: res.data.couponId | ||||
| }) | }) | ||||
| @@ -600,13 +629,13 @@ Page({ | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/order/detail/index?orderId=${ | url: `/pages/order/detail/index?orderId=${ | ||||
| orderId | orderId | ||||
| }&cardIf=true` | |||||
| }&cardIf=true&contentType=${_this.data.contentType}` | |||||
| }); | }); | ||||
| } else if (type == 'free') { | } else if (type == 'free') { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/order/detail/index?orderId=${ | url: `/pages/order/detail/index?orderId=${ | ||||
| orderId | orderId | ||||
| }` | |||||
| }&contentType=${_this.data.contentType}` | |||||
| }); | }); | ||||
| } | } | ||||
| }) | }) | ||||
| @@ -867,7 +896,7 @@ Page({ | |||||
| }) | }) | ||||
| } else { | } else { | ||||
| // 免费券 | // 免费券 | ||||
| that.payOrderUpdate(orderId, "0", 1, '', 'free'); | |||||
| that.payOrderUpdate(orderId, "0", 1, '', 'free',that); | |||||
| if (that.data.cardType == 100) { | if (that.data.cardType == 100) { | ||||
| wx.setStorage({ | wx.setStorage({ | ||||
| key: 'couponNum2', | key: 'couponNum2', | ||||
| @@ -946,7 +975,7 @@ Page({ | |||||
| success: function (res) { | success: function (res) { | ||||
| if (res.confirm) { | if (res.confirm) { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}`, | |||||
| url: `/pages/order/detail/index?orderId=${that.data.disOrderNumber}&contentType=${that.data.contentType}`, | |||||
| }) | }) | ||||
| } | } | ||||
| } | } | ||||
| @@ -98,9 +98,12 @@ | |||||
| <view> | <view> | ||||
| <text>购买须知</text> | <text>购买须知</text> | ||||
| </view> | </view> | ||||
| <view> | |||||
| <view wx:if="{{curHtml==''}}"> | |||||
| <text><text class='spot'></text>{{data.remark}}</text> | <text><text class='spot'></text>{{data.remark}}</text> | ||||
| </view> | </view> | ||||
| <view wx:if="{{curHtml!=''}}"> | |||||
| <rich-text nodes="{{curHtml}}"></rich-text> | |||||
| </view> | |||||
| </view> | </view> | ||||
| <view class='detailImg' wx:if="{{detailPicture.length>0}}"> | <view class='detailImg' wx:if="{{detailPicture.length>0}}"> | ||||
| <image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image> | <image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image> | ||||
| @@ -33,6 +33,7 @@ Page({ | |||||
| setInter: "", | setInter: "", | ||||
| staticGamedata: {}, | staticGamedata: {}, | ||||
| showIf: false, | showIf: false, | ||||
| curHtml: '', | |||||
| }, | }, | ||||
| onUnload:function(){ | onUnload:function(){ | ||||
| let that = this; | let that = this; | ||||
| @@ -88,12 +89,20 @@ Page({ | |||||
| code: options.quancode, | code: options.quancode, | ||||
| couponorderstatus: options.couponorderstatus | couponorderstatus: options.couponorderstatus | ||||
| }); | }); | ||||
| if ( | |||||
| options.quancode && | |||||
| that.data.couponorderstatus == 0 | |||||
| ) { | |||||
| //aaa | |||||
| that.getHtml(options.quancode); | |||||
| } | |||||
| //获得优惠券的详情 | //获得优惠券的详情 | ||||
| that.data.setInter = setInterval(function () { | that.data.setInter = setInterval(function () { | ||||
| if ( | if ( | ||||
| options.quancode && | options.quancode && | ||||
| that.data.couponorderstatus == 0 | that.data.couponorderstatus == 0 | ||||
| ) { | ) { | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.couponOrderDetail, | url: config.api.couponOrderDetail, | ||||
| data: { | data: { | ||||
| @@ -128,6 +137,7 @@ Page({ | |||||
| validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") | validEndDate: util.formatTime(that.data.data.validEndDate, "yyyy-MM-dd hh:mm:ss") | ||||
| }) | }) | ||||
| } | } | ||||
| }) | }) | ||||
| .catch(err => { | .catch(err => { | ||||
| wx.showToast({ | 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) { | createQrCode: function (url, canvasId, cavW, cavH) { | ||||
| //调用插件中的draw方法,绘制二维码图片 | //调用插件中的draw方法,绘制二维码图片 | ||||
| let that = this; | let that = this; | ||||
| @@ -104,9 +104,12 @@ | |||||
| <view> | <view> | ||||
| <text>购买须知</text> | <text>购买须知</text> | ||||
| </view> | </view> | ||||
| <view> | |||||
| <view wx:if="{{curHtml==''}}"> | |||||
| <text><text class='spot'></text>{{data.remark}}</text> | <text><text class='spot'></text>{{data.remark}}</text> | ||||
| </view> | </view> | ||||
| <view wx:if="{{curHtml!=''}}"> | |||||
| <rich-text nodes="{{curHtml}}"></rich-text> | |||||
| </view> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| <view class='game' bindtap="gotogame" wx-if="{{showIf}}"> | <view class='game' bindtap="gotogame" wx-if="{{showIf}}"> | ||||
| @@ -29,7 +29,8 @@ Page({ | |||||
| showButton:false, | showButton:false, | ||||
| cardDetail:null, | cardDetail:null, | ||||
| supportTransfer:'', | supportTransfer:'', | ||||
| cardIf:false | |||||
| cardIf:false, | |||||
| contentType: 0, | |||||
| }, | }, | ||||
| phone: function (e) { | phone: function (e) { | ||||
| @@ -99,7 +100,8 @@ Page({ | |||||
| }&title=${e.currentTarget.dataset.title}&subtitle=${ | }&title=${e.currentTarget.dataset.title}&subtitle=${ | ||||
| e.currentTarget.dataset.subtitle | e.currentTarget.dataset.subtitle | ||||
| }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | }&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 { | } else { | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| @@ -108,7 +110,8 @@ Page({ | |||||
| }&title=${e.currentTarget.dataset.title}&subtitle=${ | }&title=${e.currentTarget.dataset.title}&subtitle=${ | ||||
| e.currentTarget.dataset.subtitle | e.currentTarget.dataset.subtitle | ||||
| }&remark=${e.currentTarget.dataset.remark}&couponorderstatus=${ | }&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) { | onLoad: function (options) { | ||||
| console.log(options.html) | |||||
| let that = this; | let that = this; | ||||
| that.setData({ | that.setData({ | ||||
| orderId: options.orderId | |||||
| orderId: options.orderId, | |||||
| contentType: options.contentType, | |||||
| }); | }); | ||||
| wx.hideShareMenu() | wx.hideShareMenu() | ||||
| if(options.cardIf){ | if(options.cardIf){ | ||||
| @@ -20,6 +20,8 @@ Page({ | |||||
| setInter: "", | setInter: "", | ||||
| staticGamedata: {}, | staticGamedata: {}, | ||||
| showIf: false, | showIf: false, | ||||
| curHtml: '', | |||||
| contentType: 0, | |||||
| }, | }, | ||||
| gotogame: function () { | gotogame: function () { | ||||
| let that = this; | let that = this; | ||||
| @@ -55,6 +57,8 @@ Page({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| onLoad: function (options) { | onLoad: function (options) { | ||||
| console.log(options) | |||||
| console.log(app.globalData.curHtml) | |||||
| let that = this; | let that = this; | ||||
| let value = JSON.stringify({ END: "C", TYPE: "couponorder", ID: options.quancode}) | let value = JSON.stringify({ END: "C", TYPE: "couponorder", ID: options.quancode}) | ||||
| that.createQrCode(value, "qrcode", 350, 350); | that.createQrCode(value, "qrcode", 350, 350); | ||||
| @@ -64,8 +68,14 @@ Page({ | |||||
| subtitle: options.subtitle, | subtitle: options.subtitle, | ||||
| remark: options.remark, | remark: options.remark, | ||||
| couponorderstatus: options.couponorderstatus, | 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 | |||||
| }) | |||||
| } | |||||
| /** | /** | ||||
| * 如果没有核销 | * 如果没有核销 | ||||
| */ | */ | ||||
| @@ -35,8 +35,11 @@ | |||||
| <view> | <view> | ||||
| <text>购买须知:</text> | <text>购买须知:</text> | ||||
| </view> | </view> | ||||
| <view> | |||||
| <text><text class='spot'></text>{{remark}}</text> | |||||
| <view wx:if="{{curHtml==''}}"> | |||||
| <text><text class='spot'></text>{{data.remark}}</text> | |||||
| </view> | |||||
| <view wx:if="{{curHtml!=''}}"> | |||||
| <rich-text nodes="{{curHtml}}"></rich-text> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| @@ -22,13 +22,13 @@ | |||||
| "disablePlugins": [], | "disablePlugins": [], | ||||
| "outputPath": "" | "outputPath": "" | ||||
| }, | }, | ||||
| "useCompilerModule": false, | |||||
| "useCompilerModule": true, | |||||
| "userConfirmedUseCompilerModuleSwitch": false | "userConfirmedUseCompilerModuleSwitch": false | ||||
| }, | }, | ||||
| "compileType": "miniprogram", | "compileType": "miniprogram", | ||||
| "libVersion": "2.5.0", | "libVersion": "2.5.0", | ||||
| "appid": "wxfa336cad86ed598d", | "appid": "wxfa336cad86ed598d", | ||||
| "projectname": "C%E7%AB%AF%E5%B0%8F%E7%A8%8B%E5%BA%8F", | |||||
| "projectname": "oldC", | |||||
| "isGameTourist": false, | "isGameTourist": false, | ||||
| "simulatorType": "wechat", | "simulatorType": "wechat", | ||||
| "simulatorPluginLibVersion": {}, | "simulatorPluginLibVersion": {}, | ||||