瀏覽代碼

【券详情 购买说明添加富文本展示】

release
gou_le 3 年之前
父節點
當前提交
f8ca66f3e8
共有 11 個文件被更改,包括 161 次插入98 次删除
  1. +52
    -46
      app.js
  2. +20
    -24
      ext.json
  3. +13
    -5
      index/index.js
  4. +1
    -1
      index/index.wxml
  5. +1
    -1
      index/user.js
  6. +2
    -2
      pages/couponorder/detail/index.wxml
  7. +3
    -0
      pages/couponorder/detail/index.wxss
  8. +18
    -1
      pages/passCar/couponDetail/couponDetail.js
  9. +35
    -11
      pages/passCar/couponDetail/couponDetail.wxml
  10. +7
    -5
      pages/passCar/couponDetail/couponDetail.wxss
  11. +9
    -2
      project.config.json

+ 52
- 46
app.js 查看文件

@@ -2,18 +2,18 @@ let config = require("./config/config.js");
const Http = require("./utils/HttpBasics"); const Http = require("./utils/HttpBasics");
const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {} const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}


var myPluginInterface = extConfig.attr.businessSwitch?requirePlugin('auto-points-plugin'):null;
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch:false
var myPluginInterface = extConfig.attr.businessSwitch ? requirePlugin('auto-points-plugin') : null;
let businessSwitch = extConfig.attr.businessSwitch ? extConfig.attr.businessSwitch : false
App({ App({
data: { data: {
newArr:[],//存放分享二维进入消息信息
businessSwitch: businessSwitch,//判断是否开启商圈自助积分
newArr: [], //存放分享二维进入消息信息
businessSwitch: businessSwitch, //判断是否开启商圈自助积分
}, },
onLaunch: function(options) { onLaunch: function(options) {
// wx.hideTabBar() // wx.hideTabBar()
var that = this; var that = this;
if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow
if (that.globalData.previewFlag) { //解决微信图片预览重复进入app.js onshow
that.globalData.previewFlag = false that.globalData.previewFlag = false
return return
} }
@@ -34,33 +34,40 @@ App({
that.statusBarHeight = res.statusBarHeight that.statusBarHeight = res.statusBarHeight
} }
}) })
}, },
onShow:function(options){
//自助积分 需要openId 且必须写在onshow里面
let _this = this
wx.login({
success:(res)=>{
console.log('我是onshow')
if (res.code){
let usrdata = {
appId: config.weapp.AppId,
code: res.code,
}
Http.post({
url: config.api.login,
data: usrdata
}).then(res=>{
if (_this.data.businessSwitch) {
myPluginInterface.getLocation(res.data.openId).then(res => {
console.log(res, "我是地理位置")
})

onShow: function(options) {
//自助积分 需要openId 且必须写在onshow里面
let _this = this
if (businessSwitch) {
wx.login({
success: (res) => {
if (wx.getStorageSync('openId')) {
myPluginInterface.getLocation(wx.getStorageSync('openId')).then(res => {})
} else {
if (res.code) {
let usrdata = {
appId: config.weapp.AppId,
code: res.code,
}
Http.post({
url: config.api.login,
data: usrdata
}).then(res => {
if (_this.data.businessSwitch) {
myPluginInterface.getLocation(res.data.openId).then(res => {
console.log(res, "我是地理位置")
})
}
})
}
} }
})
}

}
})
} }
})


}, },
statusBarHeight: 0, statusBarHeight: 0,
@@ -79,20 +86,19 @@ App({
code: code, code: code,
sceneAddress: sceneAddress sceneAddress: sceneAddress
} }
if (that.globalData.newArr&&that.globalData.newArr[1]=='in_u'){
if (that.globalData.newArr && that.globalData.newArr[1] == 'in_u') {
usrdata.UId = that.globalData.newArr[2] usrdata.UId = that.globalData.newArr[2]
} else if(that.globalData.newArr && that.globalData.newArr[1] == 'md'){
} else if (that.globalData.newArr && that.globalData.newArr[1] == 'md') {
usrdata.MId = that.globalData.newArr[2] usrdata.MId = that.globalData.newArr[2]
} }
console.log(usrdata,"?????usrdata")
Http.post({ Http.post({
url: config.api.login, url: config.api.login,
data: usrdata data: usrdata
}) })
.then(res => { .then(res => {
wx.setStorageSync('0',res.data.openId)
if (res.data.subMalls){
wx.setStorageSync('openId', res.data.openId)
if (res.data.subMalls) {
const squareList = JSON.parse(res.data.subMalls) const squareList = JSON.parse(res.data.subMalls)
wx.setStorageSync("squareList", squareList) wx.setStorageSync("squareList", squareList)
wx.setStorageSync("selectedMall", res.data.selectedMall) wx.setStorageSync("selectedMall", res.data.selectedMall)
@@ -142,7 +148,7 @@ App({
wx.showModal({ wx.showModal({
title: '更新提示', title: '更新提示',
content: '检测到新版本,是否下载新版本并重启小程序?', content: '检测到新版本,是否下载新版本并重启小程序?',
success: function (res) {
success: function(res) {
if (res.confirm) { if (res.confirm) {
//2. 用户确定下载更新小程序,小程序下载及更新静默进行 //2. 用户确定下载更新小程序,小程序下载及更新静默进行
that.downLoadAndUpdate(updateManager) that.downLoadAndUpdate(updateManager)
@@ -151,9 +157,9 @@ App({
wx.showModal({ wx.showModal({
title: '温馨提示~', title: '温馨提示~',
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
showCancel: false,//隐藏取消按钮
confirmText: "确定更新",//只保留确定更新按钮
success: function (res) {
showCancel: false, //隐藏取消按钮
confirmText: "确定更新", //只保留确定更新按钮
success: function(res) {
if (res.confirm) { if (res.confirm) {
//下载新版本,并重新应用 //下载新版本,并重新应用
that.downLoadAndUpdate(updateManager) that.downLoadAndUpdate(updateManager)
@@ -173,7 +179,7 @@ App({
}) })
} }
}, },
/** /**
* 下载小程序新版本并重启应用 * 下载小程序新版本并重启应用
*/ */
@@ -195,10 +201,10 @@ App({
}) })
}, },
globalData: { globalData: {
styleLsit:{},
previewFlag:false,//解决图片预览调用noshow
activityId:'',//活动id方便授权数据回传
typeLsit: [],//初始哈样式
styleLsit: {},
previewFlag: false, //解决图片预览调用noshow
activityId: '', //活动id方便授权数据回传
typeLsit: [], //初始哈样式
scene: "", scene: "",
// token // token
token: null, token: null,
@@ -224,7 +230,7 @@ App({
// websocket // websocket
socketClient: null, socketClient: null,
socketReceiver: function(e) {}, //收到消息回调 socketReceiver: function(e) {}, //收到消息回调
curHtml: '',//富文本相关,由于浏览器传参长度有限制
curHtml: '', //富文本相关,由于浏览器传参长度有限制
}, },


// 初始化websocket // 初始化websocket


+ 20
- 24
ext.json 查看文件

@@ -2,44 +2,35 @@
"ext": { "ext": {
"attr": { "attr": {
"car": { "car": {
"tjd": {
"payPath": "",
"tjdAppId": "wx6945d1bda68d7993"
},
"etcp": { "etcp": {
"payPath": "pages/pay/order-pay-open/main",
"etcpAppId": "wxc07f9d67923d676d",
"etcpCallbackUrl": "https://admin.malls.iformall.com/api/carCallback/etcpPaidCallback"
},
"bolink": {
"payPath": "pages/park/park",
"bolinkAppId": "wxbd08b4baa10fcc1d"
},
"version": "release"
"etcpAppId": "wx192b7d2e8dcbefd0",
"etcpVersion": "release",
"etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback"
}
}, },
"mchId": "1604439800", "mchId": "1604439800",
"imgProxy": [ "imgProxy": [
{ {
"newUrl": "https://c.malls.iformall.com/img",
"newUrl": "https://ctest.malls.iformall.com/img",
"orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com"
}, },
{ {
"newUrl": "https://c.malls.iformall.com/img1",
"newUrl": "https://ctest.malls.iformall.com/img1",
"orgUrl": "https://formall.oss-accelerate.aliyuncs.com" "orgUrl": "https://formall.oss-accelerate.aliyuncs.com"
}, },
{ {
"newUrl": "https://c.malls.iformall.com/img2",
"newUrl": "https://ctest.malls.iformall.com/img2",
"orgUrl": "https://wx.qlogo.cn" "orgUrl": "https://wx.qlogo.cn"
} }
], ],
"configUrl": "https://c.malls.iformall.com/C/api",
"ifStoreApp": "0",
"configUrl": "https://ctest.malls.iformall.com/C/api",
"businessSwitch": "1",
"ifHaveWebSocket": "0", "ifHaveWebSocket": "0",
"ifHaveCarModular": "0"
"ifHaveCarModular": "1"
}, },
"name": "富茂链客生产版",
"weappId": "wx6a2524a8286d687f",
"appVersion": "C.5.1.1"
"name": "金泸商务",
"weappId": "wx649b3be73c1afe47",
"appVersion": "C.test.5.2.0"
}, },
"debug": false, "debug": false,
"tabBar": { "tabBar": {
@@ -69,7 +60,8 @@
"selectedIconPath": "assets/images/user-a.png" "selectedIconPath": "assets/images/user-a.png"
} }
], ],
"custom": true
"color": "#abb1be",
"selectedColor": "#b2743d"
}, },
"window": { "window": {
"backgroundTextStyle": "dark", "backgroundTextStyle": "dark",
@@ -78,12 +70,16 @@
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF"
}, },
"plugins": { "plugins": {
"auto-points-plugin": {
"version": "1.3.0",
"provider": "wxfab2bf944bfc4da6"
},
"live-player-plugin": { "live-player-plugin": {
"version": "1.2.5", "version": "1.2.5",
"provider": "wx2b03c6e691cd7370" "provider": "wx2b03c6e691cd7370"
} }
}, },
"extAppid": "wx6a2524a8286d687f",
"extAppid": "wx649b3be73c1afe47",
"extEnable": true, "extEnable": true,
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {


+ 13
- 5
index/index.js 查看文件

@@ -309,8 +309,8 @@ Page({
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onLoad: function(options) { onLoad: function(options) {
this.getType()
this.getLocation();
let that = this; let that = this;
let optionss; let optionss;


@@ -398,13 +398,14 @@ Page({
}, },


onShow: function() { onShow: function() {
this.uesrInfo()
if (businessSwitch) { if (businessSwitch) {
let openId = wx.getStorageSync("0")
let openId = wx.getStorageSync("openId")
this.setData({ this.setData({
goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}`
}) })
} }
this.uesrInfo()
if(JSON.stringify(app.globalData.styleLsit)!="{}"){ if(JSON.stringify(app.globalData.styleLsit)!="{}"){
this.setTabStyle() this.setTabStyle()
} }
@@ -537,6 +538,9 @@ Page({
that.getBannerlist(); that.getBannerlist();
that.topicShow(); that.topicShow();
that.getxsList(); that.getxsList();
that.getType()
// that.uesrInfo()
that.getLocation();
that.getMallInfo(app.globalData.token); that.getMallInfo(app.globalData.token);


if (app.couponChannelListCallback) { if (app.couponChannelListCallback) {
@@ -587,6 +591,9 @@ Page({
that.getBannerlist(); that.getBannerlist();
that.topicShow(); that.topicShow();
that.getxsList(); that.getxsList();
that.getType()
// that.uesrInfo()
that.getLocation();
that.getMallInfo(app.globalData.token); that.getMallInfo(app.globalData.token);


if (app.couponChannelListCallback) { if (app.couponChannelListCallback) {
@@ -872,13 +879,14 @@ Page({
}, },
//浮层广告 //浮层广告
getGg: function(token) { getGg: function(token) {
let that = this let that = this
Http.get({ Http.get({
url: config.api.getGg, url: config.api.getGg,
data: { data: {
token: token, token: token,
appId: config.weapp.AppId, appId: config.weapp.AppId,
openId: that.data.openId
openId: "" // wx.getStorageSync('openId')
} }
}).then(res => { }).then(res => {
console.log(res) console.log(res)


+ 1
- 1
index/index.wxml 查看文件

@@ -13,7 +13,7 @@
<!-- 头像 --> <!-- 头像 -->
<view class='infoLeft' style="{{typeLsit.sy_xxb.styleClass}}"> <view class='infoLeft' style="{{typeLsit.sy_xxb.styleClass}}">
<view class="user-avatar"> <view class="user-avatar">
<open-data class="open" type="userAvatarUrl"></open-data>
<open-data class="open" type="userAvatarUrl"></open-data>
</view> </view>
<!-- 成长值 --> <!-- 成长值 -->
<view class="user-data fl" bindtap='gotoChengzhangzhi' style="{{typeLsit.sy_xxb.styleClass}}"> <view class="user-data fl" bindtap='gotoChengzhangzhi' style="{{typeLsit.sy_xxb.styleClass}}">


+ 1
- 1
index/user.js 查看文件

@@ -224,7 +224,7 @@ Page({
onShow: function() { onShow: function() {
if (businessSwitch){ if (businessSwitch){
let openId = wx.getStorageSync("0")
let openId = wx.getStorageSync("openId")
this.setData({ this.setData({
goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}`
}) })


+ 2
- 2
pages/couponorder/detail/index.wxml 查看文件

@@ -106,10 +106,10 @@
<view> <view>
<text>购买须知</text> <text>购买须知</text>
</view> </view>
<view wx:if="{{curHtml==''}}">
<view wx:if="{{data.contentType==0}}">
<text><text class='spot'></text>{{data.remark}}</text> <text><text class='spot'></text>{{data.remark}}</text>
</view> </view>
<view wx:if="{{curHtml!=''}}">
<view wx:if="{{data.contentType!=0}}">
<rich-text nodes="{{curHtml}}"></rich-text> <rich-text nodes="{{curHtml}}"></rich-text>
</view> </view>
</view> </view>


+ 3
- 0
pages/couponorder/detail/index.wxss 查看文件

@@ -299,3 +299,6 @@ page {
border: 1px solid red; border: 1px solid red;
padding: 3rpx; padding: 3rpx;
} }
rich-text img{
max-width: 100%;
}

+ 18
- 1
pages/passCar/couponDetail/couponDetail.js 查看文件

@@ -13,7 +13,8 @@ Page({
updateDate: "", updateDate: "",
//存储计时器 //存储计时器
setInter: "", setInter: "",
showPage:false
showPage:false,
curHtml:"",
}, },
onUnload: function () { onUnload: function () {
let that = this; let that = this;
@@ -26,6 +27,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
let that = this; let that = this;
console.log(options.quancode) console.log(options.quancode)
this.getHtml(options.quancode)
Http.get({ Http.get({
url: config.api.couponOrderDetail, url: config.api.couponOrderDetail,
data: { data: {
@@ -53,6 +55,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)
})
}
})
},
phone: function () { phone: function () {
let that = this; let that = this;
if (that.data.data.merchantLinkPhone) { if (that.data.data.merchantLinkPhone) {


+ 35
- 11
pages/passCar/couponDetail/couponDetail.wxml 查看文件

@@ -1,9 +1,9 @@
<navbar back home background="#fff" text="停车券详情"></navbar> <navbar back home background="#fff" text="停车券详情"></navbar>
<view style="height:{{navigationBarHeight}} "></view> <view style="height:{{navigationBarHeight}} "></view>
<view class="container page" wx:if="{{showPage}}" >
<view class="container page" wx:if="{{showPage}}">
<view class="coupon_detail clearfix"> <view class="coupon_detail clearfix">
<view class="fl wmfl"> <view class="fl wmfl">
<image src="{{data.coverImg}}"/>
<image src="{{data.coverImg}}" />
</view> </view>
<view class="fl right"> <view class="fl right">
<text class="title">{{data.title}}</text> <text class="title">{{data.title}}</text>
@@ -17,22 +17,46 @@
</view> </view>
</view> </view>
</view> </view>
<view class='note'> <view class='note'>
<view wx:if="{{data.couponOrderStatus==0}}"><text>下单时间</text><text>{{createDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==1}}"><text>核销时间</text><text>{{updateDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==2}}"><text>过期时间</text><text>{{updateDate}}</text></view>
<view wx:if="{{data.couponOrderStatus==3}}"><text>退款时间</text><text>{{updateDate}}</text></view>
<view><text>有效期至:</text><text>{{expiredTime}}</text></view>
<view><text>订单编号</text><text>{{data.orderId}}</text></view>
<view><text>实付金额</text><text style='color:#ff4949;font-size:32rpx;'>{{data.couponPrice/100}}元</text></view>
<view wx:if="{{data.couponOrderStatus==0}}">
<text>下单时间</text>
<text>{{createDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==1}}">
<text>核销时间</text>
<text>{{updateDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==2}}">
<text>过期时间</text>
<text>{{updateDate}}</text>
</view>
<view wx:if="{{data.couponOrderStatus==3}}">
<text>退款时间</text>
<text>{{updateDate}}</text>
</view>
<view>
<text>有效期至:</text>
<text>{{expiredTime}}</text>
</view>
<view>
<text>订单编号</text>
<text>{{data.orderId}}</text>
</view>
<view>
<text>实付金额</text>
<text style='color:#ff4949;font-size:32rpx;'>{{data.couponPrice/100}}元</text>
</view>
</view> </view>
<view class='notes' style="border-bottom:0"> <view class='notes' style="border-bottom:0">
<view> <view>
<text>购买须知</text> <text>购买须知</text>
</view> </view>
<view> <view>
<text><text class='spot'></text>{{data.remark}}</text>
<text wx:if="{{data.contentType==0}}" style="width: 92%;padding: 0 4%;background: #fff;display: flex;flex-direction: column;font-size: 26rpx;"> {{data.remark}}</text>
<rich-text nodes="{{curHtml}}" wx:if="{{data.contentType!=0}}" style="width: 92%;padding: 0 4%;background: #fff;display: flex;flex-direction: column;"></rich-text>
</view> </view>
</view> </view>
</view> </view>

+ 7
- 5
pages/passCar/couponDetail/couponDetail.wxss 查看文件

@@ -266,19 +266,18 @@
border-bottom: 1rpx solid #f5f5f5; border-bottom: 1rpx solid #f5f5f5;
} }
.notes view:nth-child(1) text {
/* .notes view:nth-child(1) text {
font-size: 28rpx; font-size: 28rpx;
font-weight: bold; font-weight: bold;
}
} */
.notes view:nth-child(2) {
/* .notes view:nth-child(2) {
width: 92%; width: 92%;
padding: 0 4%; padding: 0 4%;
background: #fff; background: #fff;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-top: 2%;
}
} */
.notes view:nth-child(2) > text { .notes view:nth-child(2) > text {
font-size: 28rpx; font-size: 28rpx;
@@ -317,3 +316,6 @@
color: #666 !important; color: #666 !important;
font-size: 26rpx !important; font-size: 26rpx !important;
} }
rich-text{
max-width: 100%;
}

+ 9
- 2
project.config.json 查看文件

@@ -31,8 +31,8 @@
"userConfirmedUseCompilerModuleSwitch": false "userConfirmedUseCompilerModuleSwitch": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.14.4",
"appid": "wx453ae0d37f3550d0",
"libVersion": "2.16.0",
"appid": "wxfa336cad86ed598d",
"projectname": "oldC", "projectname": "oldC",
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
@@ -123,6 +123,13 @@
"pathName": "pages/questionnaire/questionnaireLsit/questionnaireLsit", "pathName": "pages/questionnaire/questionnaireLsit/questionnaireLsit",
"query": "", "query": "",
"scene": null "scene": null
},
{
"id": -1,
"name": "index/index",
"pathName": "index/index",
"scene": 1036,
"referrerInfo": {}
} }
] ]
} }


Loading…
取消
儲存