Browse Source

图文混排

livetest
[caserKing] 5 years ago
parent
commit
8e96faabb1
11 changed files with 101 additions and 17 deletions
  1. +1
    -0
      app.js
  2. +1
    -1
      app.json
  3. +5
    -0
      config/config.js
  4. +34
    -5
      pages/coupon/detail/index.js
  5. +4
    -1
      pages/coupon/detail/index.wxml
  6. +25
    -0
      pages/couponorder/detail/index.js
  7. +4
    -1
      pages/couponorder/detail/index.wxml
  8. +9
    -4
      pages/order/detail/index.js
  9. +11
    -1
      pages/orderquanma/index.js
  10. +5
    -2
      pages/orderquanma/index.wxml
  11. +2
    -2
      project.config.json

+ 1
- 0
app.js View File

@@ -165,6 +165,7 @@ App({
// websocket
socketClient: null,
socketReceiver: function(e) {}, //收到消息回调
curHtml: '',//富文本相关,由于浏览器传参长度有限制
},

// 初始化websocket


+ 1
- 1
app.json View File

@@ -66,7 +66,7 @@
],
"plugins": {
"live-player-plugin": {
"version": "1.0.13",
"version": "1.0.16",
"provider": "wx2b03c6e691cd7370"
}
},


+ 5
- 0
config/config.js View File

@@ -36,6 +36,11 @@ var config = {
* 优惠券详情
*/
couponDetail: "/wxCoupon/detail",
/**
* 优惠券图文混排详情
*/
couponHtmlDetail: "/wxCoupon/html",
couponHtmlDetailForPkg: "/couponOrder/html",

/**
* 业态查询


+ 34
- 5
pages/coupon/detail/index.js View File

@@ -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}`,
})
}
}


+ 4
- 1
pages/coupon/detail/index.wxml View File

@@ -98,9 +98,12 @@
<view>
<text>购买须知</text>
</view>
<view>
<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 class='detailImg' wx:if="{{detailPicture.length>0}}">
<image wx:for="{{detailPicture}}" wx:key="{{index}}" wx:for-item="item" src='{{item}}' mode='widthFix'></image>


+ 25
- 0
pages/couponorder/detail/index.js View File

@@ -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;


+ 4
- 1
pages/couponorder/detail/index.wxml View File

@@ -104,9 +104,12 @@
<view>
<text>购买须知</text>
</view>
<view>
<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 class='game' bindtap="gotogame" wx-if="{{showIf}}">


+ 9
- 4
pages/order/detail/index.js View File

@@ -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){


+ 11
- 1
pages/orderquanma/index.js View File

@@ -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
})
}
/**
* 如果没有核销
*/


+ 5
- 2
pages/orderquanma/index.wxml View File

@@ -35,8 +35,11 @@
<view>
<text>购买须知:</text>
</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>


+ 2
- 2
project.config.json View File

@@ -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": {},


Loading…
Cancel
Save