From f8ca66f3e82546c85cc0afcc1f21c845eda71706 Mon Sep 17 00:00:00 2001 From: gou_le <954534408@qq.com> Date: Thu, 22 Jul 2021 18:09:08 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=88=B8=E8=AF=A6=E6=83=85=20?= =?UTF-8?q?=E8=B4=AD=E4=B9=B0=E8=AF=B4=E6=98=8E=E6=B7=BB=E5=8A=A0=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E5=B1=95=E7=A4=BA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 98 +++++++++++--------- ext.json | 44 ++++----- index/index.js | 18 +++- index/index.wxml | 2 +- index/user.js | 2 +- pages/couponorder/detail/index.wxml | 4 +- pages/couponorder/detail/index.wxss | 3 + pages/passCar/couponDetail/couponDetail.js | 19 +++- pages/passCar/couponDetail/couponDetail.wxml | 46 ++++++--- pages/passCar/couponDetail/couponDetail.wxss | 12 ++- project.config.json | 11 ++- 11 files changed, 161 insertions(+), 98 deletions(-) diff --git a/app.js b/app.js index aa83b93..7b70793 100644 --- a/app.js +++ b/app.js @@ -2,18 +2,18 @@ let config = require("./config/config.js"); const Http = require("./utils/HttpBasics"); 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({ data: { - newArr:[],//存放分享二维进入消息信息 - businessSwitch: businessSwitch,//判断是否开启商圈自助积分 + newArr: [], //存放分享二维进入消息信息 + businessSwitch: businessSwitch, //判断是否开启商圈自助积分 }, - + onLaunch: function(options) { // wx.hideTabBar() var that = this; - if (that.globalData.previewFlag) {//解决微信图片预览重复进入app.js onshow + if (that.globalData.previewFlag) { //解决微信图片预览重复进入app.js onshow that.globalData.previewFlag = false return } @@ -34,33 +34,40 @@ App({ 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, @@ -79,20 +86,19 @@ App({ code: code, 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] - } 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] } - console.log(usrdata,"?????usrdata") Http.post({ url: config.api.login, data: usrdata }) .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) wx.setStorageSync("squareList", squareList) wx.setStorageSync("selectedMall", res.data.selectedMall) @@ -142,7 +148,7 @@ App({ wx.showModal({ title: '更新提示', content: '检测到新版本,是否下载新版本并重启小程序?', - success: function (res) { + success: function(res) { if (res.confirm) { //2. 用户确定下载更新小程序,小程序下载及更新静默进行 that.downLoadAndUpdate(updateManager) @@ -151,9 +157,9 @@ App({ wx.showModal({ title: '温馨提示~', content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~', - showCancel: false,//隐藏取消按钮 - confirmText: "确定更新",//只保留确定更新按钮 - success: function (res) { + showCancel: false, //隐藏取消按钮 + confirmText: "确定更新", //只保留确定更新按钮 + success: function(res) { if (res.confirm) { //下载新版本,并重新应用 that.downLoadAndUpdate(updateManager) @@ -173,7 +179,7 @@ App({ }) } }, - + /** * 下载小程序新版本并重启应用 */ @@ -195,10 +201,10 @@ App({ }) }, globalData: { - styleLsit:{}, - previewFlag:false,//解决图片预览调用noshow - activityId:'',//活动id方便授权数据回传 - typeLsit: [],//初始哈样式 + styleLsit: {}, + previewFlag: false, //解决图片预览调用noshow + activityId: '', //活动id方便授权数据回传 + typeLsit: [], //初始哈样式 scene: "", // token token: null, @@ -224,7 +230,7 @@ App({ // websocket socketClient: null, socketReceiver: function(e) {}, //收到消息回调 - curHtml: '',//富文本相关,由于浏览器传参长度有限制 + curHtml: '', //富文本相关,由于浏览器传参长度有限制 }, // 初始化websocket diff --git a/ext.json b/ext.json index 0b255d7..248639b 100644 --- a/ext.json +++ b/ext.json @@ -2,44 +2,35 @@ "ext": { "attr": { "car": { - "tjd": { - "payPath": "", - "tjdAppId": "wx6945d1bda68d7993" - }, "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", "imgProxy": [ { - "newUrl": "https://c.malls.iformall.com/img", + "newUrl": "https://ctest.malls.iformall.com/img", "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" }, { - "newUrl": "https://c.malls.iformall.com/img2", + "newUrl": "https://ctest.malls.iformall.com/img2", "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", - "ifHaveCarModular": "0" + "ifHaveCarModular": "1" }, - "name": "富茂链客生产版", - "weappId": "wx6a2524a8286d687f", - "appVersion": "C.5.1.1" + "name": "金泸商务", + "weappId": "wx649b3be73c1afe47", + "appVersion": "C.test.5.2.0" }, "debug": false, "tabBar": { @@ -69,7 +60,8 @@ "selectedIconPath": "assets/images/user-a.png" } ], - "custom": true + "color": "#abb1be", + "selectedColor": "#b2743d" }, "window": { "backgroundTextStyle": "dark", @@ -78,12 +70,16 @@ "navigationBarBackgroundColor": "#FFFFFF" }, "plugins": { + "auto-points-plugin": { + "version": "1.3.0", + "provider": "wxfab2bf944bfc4da6" + }, "live-player-plugin": { "version": "1.2.5", "provider": "wx2b03c6e691cd7370" } }, - "extAppid": "wx6a2524a8286d687f", + "extAppid": "wx649b3be73c1afe47", "extEnable": true, "permission": { "scope.userLocation": { diff --git a/index/index.js b/index/index.js index d246903..3dcfbd2 100644 --- a/index/index.js +++ b/index/index.js @@ -309,8 +309,8 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onLoad: function(options) { - this.getType() - this.getLocation(); + + let that = this; let optionss; @@ -398,13 +398,14 @@ Page({ }, onShow: function() { + this.uesrInfo() if (businessSwitch) { - let openId = wx.getStorageSync("0") + let openId = wx.getStorageSync("openId") this.setData({ goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` }) } - this.uesrInfo() + if(JSON.stringify(app.globalData.styleLsit)!="{}"){ this.setTabStyle() } @@ -537,6 +538,9 @@ Page({ that.getBannerlist(); that.topicShow(); that.getxsList(); + that.getType() + // that.uesrInfo() + that.getLocation(); that.getMallInfo(app.globalData.token); if (app.couponChannelListCallback) { @@ -587,6 +591,9 @@ Page({ that.getBannerlist(); that.topicShow(); that.getxsList(); + that.getType() + // that.uesrInfo() + that.getLocation(); that.getMallInfo(app.globalData.token); if (app.couponChannelListCallback) { @@ -872,13 +879,14 @@ Page({ }, //浮层广告 getGg: function(token) { + let that = this Http.get({ url: config.api.getGg, data: { token: token, appId: config.weapp.AppId, - openId: that.data.openId + openId: "" // wx.getStorageSync('openId') } }).then(res => { console.log(res) diff --git a/index/index.wxml b/index/index.wxml index f1b8cab..4d1b6ba 100644 --- a/index/index.wxml +++ b/index/index.wxml @@ -13,7 +13,7 @@ - + diff --git a/index/user.js b/index/user.js index 43d0f25..9f90791 100644 --- a/index/user.js +++ b/index/user.js @@ -224,7 +224,7 @@ Page({ onShow: function() { if (businessSwitch){ - let openId = wx.getStorageSync("0") + let openId = wx.getStorageSync("openId") this.setData({ goUrl: `plugin://auto-points-plugin/index?openid=${openId}&mch_id=${this.data.mch_id}` }) diff --git a/pages/couponorder/detail/index.wxml b/pages/couponorder/detail/index.wxml index 73188f6..ce564f1 100644 --- a/pages/couponorder/detail/index.wxml +++ b/pages/couponorder/detail/index.wxml @@ -106,10 +106,10 @@ 购买须知 - + {{data.remark}} - + diff --git a/pages/couponorder/detail/index.wxss b/pages/couponorder/detail/index.wxss index c0cbfde..677d4ec 100644 --- a/pages/couponorder/detail/index.wxss +++ b/pages/couponorder/detail/index.wxss @@ -299,3 +299,6 @@ page { border: 1px solid red; padding: 3rpx; } +rich-text img{ + max-width: 100%; +} \ No newline at end of file diff --git a/pages/passCar/couponDetail/couponDetail.js b/pages/passCar/couponDetail/couponDetail.js index e45d684..4b92dff 100644 --- a/pages/passCar/couponDetail/couponDetail.js +++ b/pages/passCar/couponDetail/couponDetail.js @@ -13,7 +13,8 @@ Page({ updateDate: "", //存储计时器 setInter: "", - showPage:false + showPage:false, + curHtml:"", }, onUnload: function () { let that = this; @@ -26,6 +27,7 @@ Page({ onLoad: function (options) { let that = this; console.log(options.quancode) + this.getHtml(options.quancode) Http.get({ url: config.api.couponOrderDetail, 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 () { let that = this; if (that.data.data.merchantLinkPhone) { diff --git a/pages/passCar/couponDetail/couponDetail.wxml b/pages/passCar/couponDetail/couponDetail.wxml index d1f94be..38044db 100644 --- a/pages/passCar/couponDetail/couponDetail.wxml +++ b/pages/passCar/couponDetail/couponDetail.wxml @@ -1,9 +1,9 @@ - + - + {{data.title}} @@ -17,22 +17,46 @@ - + - 下单时间{{createDate}} - 核销时间{{updateDate}} - 过期时间{{updateDate}} - 退款时间{{updateDate}} - 有效期至:{{expiredTime}} - 订单编号{{data.orderId}} - 实付金额{{data.couponPrice/100}}元 + + 下单时间 + {{createDate}} + + + 核销时间 + {{updateDate}} + + + 过期时间 + {{updateDate}} + + + 退款时间 + {{updateDate}} + + + 有效期至: + {{expiredTime}} + + + 订单编号 + {{data.orderId}} + + + 实付金额 + {{data.couponPrice/100}}元 + 购买须知 - {{data.remark}} + {{data.remark}} + + + \ No newline at end of file diff --git a/pages/passCar/couponDetail/couponDetail.wxss b/pages/passCar/couponDetail/couponDetail.wxss index fd45037..c5dd46a 100644 --- a/pages/passCar/couponDetail/couponDetail.wxss +++ b/pages/passCar/couponDetail/couponDetail.wxss @@ -266,19 +266,18 @@ border-bottom: 1rpx solid #f5f5f5; } -.notes view:nth-child(1) text { +/* .notes view:nth-child(1) text { font-size: 28rpx; font-weight: bold; -} +} */ -.notes view:nth-child(2) { +/* .notes view:nth-child(2) { width: 92%; padding: 0 4%; background: #fff; display: flex; flex-direction: column; - padding-top: 2%; -} +} */ .notes view:nth-child(2) > text { font-size: 28rpx; @@ -317,3 +316,6 @@ color: #666 !important; font-size: 26rpx !important; } +rich-text{ + max-width: 100%; +} \ No newline at end of file diff --git a/project.config.json b/project.config.json index fde5a61..c577d93 100644 --- a/project.config.json +++ b/project.config.json @@ -31,8 +31,8 @@ "userConfirmedUseCompilerModuleSwitch": false }, "compileType": "miniprogram", - "libVersion": "2.14.4", - "appid": "wx453ae0d37f3550d0", + "libVersion": "2.16.0", + "appid": "wxfa336cad86ed598d", "projectname": "oldC", "isGameTourist": false, "simulatorType": "wechat", @@ -123,6 +123,13 @@ "pathName": "pages/questionnaire/questionnaireLsit/questionnaireLsit", "query": "", "scene": null + }, + { + "id": -1, + "name": "index/index", + "pathName": "index/index", + "scene": 1036, + "referrerInfo": {} } ] }