From 1fb7a133acf7a074f9e9bb7c031b8df25b35d969 Mon Sep 17 00:00:00 2001 From: GL <954534408@qq.com> Date: Mon, 31 Aug 2020 17:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=AF=E5=88=86=E5=95=86?= =?UTF-8?q?=E5=9F=8E=20=E5=A4=9A=E4=BD=99=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + ext.json | 104 ++++--- index/index.js | 10 +- index/index.wxml | 4 +- index/index.wxss | 5 + index/user.js | 20 ++ pages/getphoneInfo/index.js | 250 +++++++++------- pages/getuserinfo/index.js | 532 ++++++++++++++++++---------------- pages/integralmall/index.wxml | 2 +- pages/topicDetail/index.js | 2 + project.config.json | 4 +- 11 files changed, 524 insertions(+), 410 deletions(-) diff --git a/app.js b/app.js index de9ee78..ad81791 100644 --- a/app.js +++ b/app.js @@ -45,6 +45,7 @@ App({ if (res.data.subMalls){ const squareList = JSON.parse(res.data.subMalls) wx.setStorageSync("squareList", squareList) + wx.setStorageSync("selectedMall", res.data.selectedMall) } if (res.data && res.data.score) { if (res.data.score != 0) { diff --git a/ext.json b/ext.json index c94ab09..83e3089 100644 --- a/ext.json +++ b/ext.json @@ -1,52 +1,74 @@ { "ext": { "attr": { - "imgProxy": [{ - "newUrl": "https://ctest.malls.iformall.com/img", - "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" - }, { - "newUrl": "https://ctest.malls.iformall.com/img1", - "orgUrl": "https://formall.oss-accelerate.aliyuncs.com" - }, { - "newUrl": "https://ctest.malls.iformall.com/img2", - "orgUrl": "https://wx.qlogo.cn" - }], - "configUrl": "https://ctest.malls.iformall.com/C/api", - "etcpAppId": "wx192b7d2e8dcbefd0", - "etcpVersion": "release", - "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", + "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" + }, + "imgProxy": [ + { + "newUrl": "https://c.malls.iformall.com/img", + "orgUrl": "https://iformall-net.formall.oss-accelerate.aliyuncs.com" + }, + { + "newUrl": "https://c.malls.iformall.com/img1", + "orgUrl": "https://formall.oss-accelerate.aliyuncs.com" + }, + { + "newUrl": "https://c.malls.iformall.com/img2", + "orgUrl": "https://wx.qlogo.cn" + } + ], + "configUrl": "https://c.malls.iformall.com/C/api", + "ifStoreApp": "0", "ifHaveWebSocket": "0", "ifHaveCarModular": "1" }, - "name": "金泸商务", - "weappId": "wx649b3be73c1afe47", - "appVersion": "C.test.5.2.0" + "name": "富茂链客生产版", + "weappId": "wx6a2524a8286d687f", + "appVersion": "C.5.1.1" }, "debug": false, "tabBar": { - "list": [{ - "text": "首页", - "iconPath": "assets/images/home.png", - "pagePath": "index/index", - "selectedIconPath": "assets/images/home-a.png" - }, { - "text": "门店", - "iconPath": "assets/images/mendian.png", - "pagePath": "index/searchbar", - "selectedIconPath": "assets/images/mendian-a.png" - }, { - "text": "停车", - "iconPath": "assets/images/park.png", - "pagePath": "index/passCar", - "selectedIconPath": "assets/images/park-a.png" - }, { - "text": "我的", - "iconPath": "assets/images/user.png", - "pagePath": "index/user", - "selectedIconPath": "assets/images/user-a.png" - }], - "color": "#abb1be", - "selectedColor": "#b2743d" + "list": [ + { + "text": "首页", + "iconPath": "assets/images/home.png", + "pagePath": "index/index", + "selectedIconPath": "assets/images/home-a.png" + }, + { + "text": "门店", + "iconPath": "assets/images/mendian.png", + "pagePath": "index/searchbar", + "selectedIconPath": "assets/images/mendian-a.png" + }, + { + "text": "停车", + "iconPath": "assets/images/park.png", + "pagePath": "index/passCar", + "selectedIconPath": "assets/images/park-a.png" + }, + { + "text": "我的", + "iconPath": "assets/images/user.png", + "pagePath": "index/user", + "selectedIconPath": "assets/images/user-a.png" + } + ], + "custom": true }, "window": { "backgroundTextStyle": "dark", @@ -60,7 +82,7 @@ "provider": "wx2b03c6e691cd7370" } }, - "extAppid": "wx649b3be73c1afe47", + "extAppid": "wx6a2524a8286d687f", "extEnable": true, "permission": { "scope.userLocation": { diff --git a/index/index.js b/index/index.js index 58b18ec..f77108d 100644 --- a/index/index.js +++ b/index/index.js @@ -86,9 +86,7 @@ Page({ isShowSqare:false, }, //获取当前广场名 - gitSuperiorName(){ - - }, + //跳转到其他广场列表 goSquareList(){ wx.navigateTo({ @@ -233,7 +231,6 @@ Page({ * 生命周期函数--监听页面初次渲染完成 */ onLoad: function(options) { - this.ifShowSqare(); this.getLocation(); let that = this; let optionss; @@ -293,6 +290,11 @@ Page({ wx.removeStorageSync('squareList') }, onShow: function() { + this.ifShowSqare(); + var temp = wx.getStorageSync("squareList").filter(item => item.tenantId == wx.getStorageSync("selectedMall"))[0].name + this.setData({ + squareName: temp + }) if (typeof this.getTabBar === 'function' && this.getTabBar()) { this.getTabBar().setData({ diff --git a/index/index.wxml b/index/index.wxml index 23e0314..ec4d4be 100644 --- a/index/index.wxml +++ b/index/index.wxml @@ -1,9 +1,9 @@ - + - {{"当前广场"}} ↓ + {{squareName}} ↓ diff --git a/index/index.wxss b/index/index.wxss index 33b2fd0..0db7380 100644 --- a/index/index.wxss +++ b/index/index.wxss @@ -8,10 +8,15 @@ page{ height: 60rpx; font-size: 30prx; float: left; + /* margin-top: 20rpx; */ } .underlingName{ float: left; line-height: 30rpx; + color: #A6A6A6; + /* margin-top: 20rpx; */ + margin-bottom: 20rpx; + margin-left: 5rpx; } .underling{ font-size: 30rpx; diff --git a/index/user.js b/index/user.js index edada71..c994aa7 100644 --- a/index/user.js +++ b/index/user.js @@ -72,6 +72,25 @@ Page({ url: `/pages/getphoneInfo/index?path=main` }); }, + + /* 判断是否授权*/ + userAuthorization() { + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + // this.getUserInfo() + }).catch(err => { + wx.navigateTo({ + url: `/pages/getuserinfo/index`, + }) + }) + }, + + + /** * 跳转到成长值的页面 */ @@ -175,6 +194,7 @@ Page({ */ onShow: function () { let that = this; + that.userAuthorization() if (typeof that.getTabBar === 'function' && that.getTabBar()) { if (ifStoreApp == 1) { diff --git a/pages/getphoneInfo/index.js b/pages/getphoneInfo/index.js index 879d2c3..a6a3e08 100755 --- a/pages/getphoneInfo/index.js +++ b/pages/getphoneInfo/index.js @@ -7,20 +7,26 @@ Page({ navigationBarHeight, canIUse: wx.canIUse("button.open-type.getPhoneNumber"), couponChannelId: "", - path:null, - paramData:null, - signActivity:"", - mineFlag:null + path: null, + paramData: null, + signActivity: "", + mineFlag: null, + skipUrl: 0, + // skip: app.globalData.skip }, - onLoad: function (options) { + onLoad: function(options) { var that = this; + console.log(options.skipUrl, "options.skipUrl") + that.setData({ + skipUrl: options.skipUrl + }) that.setData({ path: options.path }) that.setData({ paramData: options }) - if (options&&options.couponChannelId) { + if (options && options.couponChannelId) { that.setData({ couponChannelId: options.couponChannelId }); @@ -31,132 +37,156 @@ Page({ mineFlag: options.mineFlag }) } - if (options&&options.signActivity){ + if (options && options.signActivity) { that.setData({ signActivity: options.signActivity }); } Http.get({ - url: config.api.marketicon, - data: { - appId: config.weapp.AppId - } - }).then(res => { - that.setData({ - mallImgUrl: res.data.mallImgUrl - }); - wx.setNavigationBarTitle({ - title: res.data.mallName + url: config.api.marketicon, + data: { + appId: config.weapp.AppId + } + }).then(res => { + that.setData({ + mallImgUrl: res.data.mallImgUrl + }); + wx.setNavigationBarTitle({ + title: res.data.mallName + }) + }) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); }) - }) - .catch(err => { - wx.showToast({ - title: err.errMsg, - icon: 'none', - duration: 2000, - mask: false - }); - }) }, - backHome: function () { + backHome: function() { wx.switchTab({ url: '/index/index', }) }, - getPhoneNumber: function (e) { + getPhoneNumber: function(e) { var that = this; var iv = e.detail.iv; var encryptedData = e.detail.encryptedData; Http.post({ - url: config.api.getUserPhone, - data: { - encryptedData: encryptedData, - iv: iv - } - }).then(res=>{ - app.globalData.phone = res.data.phone; - /** - * 来自我的 - */ - if (that.data.path == 'main') { - wx.switchTab({ - url: `/index/user` - }) - return; - } - /** - * 来自积分兑换 - */ - if (that.data.path == 'jifen') { - wx.redirectTo({ - url: `/pages/integralmall/payIntegcoupondetail/index?couponChannelId=${that.data.paramData.couponChannelId}&couponId=${that.data.paramData.couponId}` - }) - return; - } - /** - * 来自拼团详情 - */ - if (that.data.path == 'spell') { - if (that.data.paramData.avatarUrl) { + url: config.api.getUserPhone, + data: { + encryptedData: encryptedData, + iv: iv + } + }).then(res => { + app.globalData.phone = res.data.phone; + if (that.data.skipUrl == '1') { + + if (app.globalData.skip == 'redirectTo') { + wx.redirectTo({ + url: app.globalData.skipUrl, + }) + return; + } else if (app.globalData.skip == 'navigateTo') { + wx.navigateTo({ + url: app.globalData.skipUrl, + }) + return; + } else if (app.globalData.skip == 'reLaunch') { + wx.reLaunch({ + url: app.globalData.skipUrl, + }) + return; + } else if (app.globalData.skip == 'switchTab') { + wx.switchTab({ + url: app.globalData.skipUrl, + }) + return; + } + } + /**a + * 来自我的 + */ + if (that.data.path == 'main') { + wx.switchTab({ + url: `/index/user` + }) + return; + } + /** + * 来自积分兑换 + */ + if (that.data.path == 'jifen') { wx.redirectTo({ - url: `/pages/joinFrDpell/index?couponId=${that.data.paramData.couponId}&orderGroupId=${that.data.paramData.orderGroupId}&couponChannelId=${that.data.paramData.couponChannelId}&orderId=${that.data.paramData.orderId}&avatarUrl=${that.data.paramData.avatarUrl}&nickName=${that.data.paramData.nickName}` + url: `/pages/integralmall/payIntegcoupondetail/index?couponChannelId=${that.data.paramData.couponChannelId}&couponId=${that.data.paramData.couponId}` }) - } else { + return; + } + /** + * 来自拼团详情 + */ + if (that.data.path == 'spell') { + if (that.data.paramData.avatarUrl) { + wx.redirectTo({ + url: `/pages/joinFrDpell/index?couponId=${that.data.paramData.couponId}&orderGroupId=${that.data.paramData.orderGroupId}&couponChannelId=${that.data.paramData.couponChannelId}&orderId=${that.data.paramData.orderId}&avatarUrl=${that.data.paramData.avatarUrl}&nickName=${that.data.paramData.nickName}` + }) + } else { + wx.redirectTo({ + url: `/pages/spellGroup/mySpellGroup/index?couponId=${that.data.paramData.couponId}&couponChannelId=${that.data.paramData.couponChannelId}` + }) + } + return; + } + /** + * fromId若存在来自卡转赠 + */ + if (that.data.path == 'index' && !that.data.paramData.cuserId) { wx.redirectTo({ - url: `/pages/spellGroup/mySpellGroup/index?couponId=${that.data.paramData.couponId}&couponChannelId=${that.data.paramData.couponChannelId}` + url: "/pages/game/index?url=" + that.data.paramData.url + "&id=" + that.data.paramData.id + "&gameId=" + that.data.paramData.gameId, + }) + } else if (that.data.path == 'index' && that.data.paramData.cuserId) { + wx.redirectTo({ + url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate }) } - return; - } - /** - * fromId若存在来自卡转赠 - */ - if (that.data.path == 'index' && !that.data.paramData.cuserId) { - wx.redirectTo({ - url: "/pages/game/index?url=" + that.data.paramData.url + "&id=" + that.data.paramData.id + "&gameId=" + that.data.paramData.gameId, - }) - } else if (that.data.path == 'index' && that.data.paramData.cuserId) { - wx.redirectTo({ - url: "/pages/coupon/detail/index?cuserId=" + that.data.paramData.cuserId + '&couponChannelId=' + that.data.paramData.couponChannelId + '&coverImg=' + that.data.paramData.coverImg + '&avatarUrl=' + that.data.paramData.avatarUrl + '&userName=' + that.data.paramData.userName + '&couponOrderId=' + that.data.paramData.couponOrderId + "&updateDate=" + that.data.paramData.updateDate - }) - } - /** - * 活动报名 - */ - else if (that.data.signActivity) { - wx.redirectTo({ - url: `/pages/radetail/joinActivity/edit?activityId=${that.data.signActivity}` - }) - } else if (that.data.mineFlag == 'mine'){ - wx.switchTab({ - url: '/index/user' - }); - } else { - wx.showToast({ - title: res.data.msg, - icon: "success", - success: function (res) { - if (that.data.couponChannelId) { - wx.redirectTo({ - url: "/pages/coupon/detail/index?couponChannelId=" + that.data.couponChannelId + "&flag=pay" - }) - } else { - wx.switchTab({ - url: '/index/passCar', - }) + /** + * 活动报名 + */ + else if (that.data.signActivity) { + wx.redirectTo({ + url: `/pages/radetail/joinActivity/edit?activityId=${that.data.signActivity}` + }) + } else if (that.data.mineFlag == 'mine') { + wx.switchTab({ + url: '/index/user' + }); + } else { + wx.showToast({ + title: res.data.msg, + icon: "success", + success: function(res) { + if (that.data.couponChannelId) { + wx.redirectTo({ + url: "/pages/coupon/detail/index?couponChannelId=" + that.data.couponChannelId + "&flag=pay" + }) + } else { + wx.switchTab({ + url: '/index/passCar', + }) + } } - } + }); + } + }) + .catch(err => { + wx.showToast({ + title: "请授权手机号", + icon: 'none', + duration: 2000, + mask: false }); - } - }) - .catch(err => { - wx.showToast({ - title: "请授权手机号", - icon: 'none', - duration: 2000, - mask: false - }); - }) + }) } }); \ No newline at end of file diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 5d683ba..12d8903 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -6,20 +6,53 @@ Page({ data: { navigationBarHeight, canIUse: wx.canIUse("button.open-type.getUserInfo"), - path:null, + path: null, couponChannelId: null, - cuserId:null, - coverImg:null, - couponOrderId:null, - optionData:null, - fromflag:'', - couponChannelIdflag:'' + cuserId: null, + coverImg: null, + couponOrderId: null, + optionData: null, + fromflag: '', + couponChannelIdflag: '' }, + judgePhonelngo() { + + Http.get({ + url: config.api.checkPhoneStatus, + data: {} + }).then(res => { + var tempSkip = app.globalData.skip + if (tempSkip =='redirectTo'){ + wx.redirectTo({ + url: app.globalData.skipUrl, + }) + } else if (tempSkip == 'navigateTo'){ + wx.navigateTo({ + url: app.globalData.skipUrl, + }) + } else if (tempSkip == 'reLaunch'){ + wx.reLaunch({ + url: app.globalData.skipUrl, + }) + } else if (tempSkip == 'switchTab') { + wx.switchTab({ + url: app.globalData.skipUrl, + }) + } + + }).catch(err => { + wx.redirectTo({ + url: `/pages/getphoneInfo/index?skipUrl=1` + }); + }) + }, + + onLoad: function(options) { var that = this; // options.fromflag == 'coupondetail'; // 来自优惠券详情页面 - if (options && options.fromflag){ + if (options && options.fromflag) { that.setData({ fromflag: options.fromflag }) @@ -30,22 +63,22 @@ Page({ couponChannelIdflag: options.couponChannelIdflag }) } - if (options && options.spellGroup){ + if (options && options.spellGroup) { that.setData({ spellGroup: options.spellGroup }) - }else{ + } else { that.setData({ spellGroup: null - }) + }) } - if (options.couponChannelId && !options.cuserId||options.orderId) { + if (options.couponChannelId && !options.cuserId || options.orderId) { that.setData({ couponChannelId: options.couponChannelId, - orderId:options.orderId + orderId: options.orderId }) } - if (options && options.frommd && options.id){ + if (options && options.frommd && options.id) { that.setData({ id: options.id, frommd: options.frommd @@ -54,11 +87,11 @@ Page({ // that.setData({ // optionData: null // }) - console.log(wx.getStorageSync('options'),6666) + console.log(wx.getStorageSync('options'), 6666) that.setData({ - optionData: wx.getStorageSync('options') ? JSON.parse(wx.getStorageSync('options')):null + optionData: wx.getStorageSync('options') ? JSON.parse(wx.getStorageSync('options')) : null }) - if (options&&options.path == 'index') { + if (options && options.path == 'index') { that.setData({ path: options.path }) @@ -66,7 +99,7 @@ Page({ /** * 来自转赠 */ - if (options.couponChannelId && options.cuserId){ + if (options.couponChannelId && options.cuserId) { that.setData({ couponChannelId: options.couponChannelId, cuserId: options.cuserId, @@ -99,257 +132,256 @@ Page({ }); }) }, - backHome: function () { + backHome: function() { wx.switchTab({ url: '/index/index', }) }, - bindGetUserInfo: function (e) { + bindGetUserInfo: function(e) { let that = this; var iv = e.detail.iv; var encryptedData = e.detail.encryptedData; wx.getUserInfo({ - success: function (res) { - Http.post({ - url: config.api.getUserInfo, - data: { - encryptedData: encryptedData, - iv: iv - } - }) - .then( - function (res) { - // debugger; - if (that.data.fromflag == 'poster') { - wx.redirectTo({ - url: `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` - }) - return; - } - // - if (that.data.optionData.orderGroupId){ - wx.reLaunch({ - url: `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` - }); - return; - } - if (that.data.path == 'index') { - wx.reLaunch({ - url: "/pages/game/index" - }); - } else { - //返回主页 - // if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { - if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') { - // 跳转普通券/消费卡/限时秒杀/砍价详情 - wx.navigateTo({ - url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` - }); - } else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') { - // 来自转赠 - wx.reLaunch({ - url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` - }); - } else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { - // 拼团详情页 - wx.redirectTo({ - url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}`, - }) - } else if (that.data.optionData.id && app.globalData.type == 'gm') { - // 游戏页面 - that.getGameOne(app.globalData.token, that.data.optionData.id) - } else if (that.data.optionData.id && app.globalData.type == 'td') { - wx.redirectTo({ - url: `/pages/topicDetail/index?id=${that.data.optionData.id}` - }); - } - // 报名活动 - else if (that.data.optionData.id && app.globalData.type == 'ra') { - wx.redirectTo({ - url: `/pages/radetail/index?id=${that.data.optionData.id}`, - }) - } - // 报名签到 - else if (that.data.optionData.id && app.globalData.type == 'si') { - wx.redirectTo({ - url: `/pages/acSignIn/index?id=${that.data.optionData.id}`, - }) - } - // 门店详情 - else if (that.data.optionData.id && app.globalData.type == 'md') { - wx.redirectTo({ - url: `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}` - }); - } - // 通过分享进入的门店详情页面 - else if (that.data.id && that.data.frommd == 'md') { - wx.redirectTo({ - url: `/pages/index/searchbar/detail/index?id=${that.data.id}` - }); - } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { - // 宣传页详情 - if (that.data.optionData.bt == '2') { - // 自由图文 - wx.redirectTo({ - url: `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, - }) + success: function(res) { + Http.post({ + url: config.api.getUserInfo, + data: { + encryptedData: encryptedData, + iv: iv + } + }).then( + function(res) { + if (that.data.fromflag == 'poster') { + app.globalData.skipUrl = `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + return; + } + // + if (that.data.optionData.orderGroupId) { + app.globalData.skipUrl = `/pages/joinFrDpell/index?couponId=${that.data.optionData.couponId}&orderGroupId=${that.data.optionData.orderGroupId}&couponChannelId=${that.data.optionData.couponChannelId}&orderId=${that.data.optionData.orderId}&avatarUrl=${that.data.optionData.avatarUrl}&nickName=${that.data.optionData.nickName}` + app.globalData.skip = 'reLaunch' + that.judgePhonelngo() + return; + } + if (that.data.path == 'index') { + app.globalData.skipUrl = "/pages/game/index" + app.globalData.skip = 'reLaunch' + that.judgePhonelngo() } else { - // 标准格式 - wx.redirectTo({ - url: `/pages/bannerdetail/index?id=${that.data.optionData.id}`, - }) + //返回主页 + // if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup||that.data.couponChannelId && !that.data.cuserId&&app.globalData.type == 'cd') { + if (that.data.couponChannelId && !that.data.cuserId && !that.data.spellGroup && app.globalData.type == 'cd') { + // 跳转普通券/消费卡/限时秒杀/砍价详情 + app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` + app.globalData.skip = 'navigateTo' + that.judgePhonelngo() + } else if (that.data.couponChannelId && that.data.cuserId && !that.data.spellGroup && app.globalData.type != 'sd') { + // 来自转赠 + app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}&cuserId=${that.data.cuserId}&coverImg=${that.data.coverImg}&userName=${that.data.userName}&avatarUrl=${that.data.avatarUrl}&couponOrderId=${that.data.couponOrderId}&updateDate=${that.data.updateDate}` + app.globalData.skip = 'reLaunch' + that.judgePhonelngo() + } else if (that.data.couponChannelId && app.globalData.type == 'sd' || that.data.couponChannelId && that.data.spellGroup) { + // 拼团详情页 + app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelId}` + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (that.data.optionData.id && app.globalData.type == 'gm') { + // 游戏页面 + that.getGameOne(app.globalData.token, that.data.optionData.id) + + } else if (that.data.optionData.id && app.globalData.type == 'td') { + app.globalData.skipUrl = `/pages/topicDetail/index?id=${that.data.optionData.id}` + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } + // 报名活动 + else if (that.data.optionData.id && app.globalData.type == 'ra') { + app.globalData.skipUrl = `/pages/radetail/index?id=${that.data.optionData.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } + // 报名签到 + else if (that.data.optionData.id && app.globalData.type == 'si') { + app.globalData.skipUrl = `/pages/acSignIn/index?id=${that.data.optionData.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } + // 门店详情 + else if (that.data.optionData.id && app.globalData.type == 'md') { + app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.optionData.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } + // 通过分享进入的门店详情页面 + else if (that.data.id && that.data.frommd == 'md') { + app.globalData.skipUrl = `/pages/index/searchbar/detail/index?id=${that.data.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (that.data.optionData.bt && that.data.optionData.id && app.globalData.type == 'bd') { + // 宣传页详情 + if (that.data.optionData.bt == '2') { + // 自由图文 + app.globalData.skipUrl = `/pages/freeBannerDetail/index?id=${that.data.optionData.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else { + // 标准格式 + app.globalData.skipUrl = `/pages/bannerdetail/index?id=${that.data.optionData.id}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } + } else if (that.data.orderId || that.data.orderId && app.globalData.type == 'bg') { + // 参与砍价 + app.globalData.skipUrl = `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}`, + app.globalData.skip = 'navigateTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'uc') { + // 我的 + app.globalData.skipUrl = '/index/user', + app.globalData.skip = 'switchTab' + that.judgePhonelngo() + } else if (app.globalData.type == 'in') { + // 首页 + app.globalData.skipUrl = '/index/index', + app.globalData.skip = 'switchTab' + that.judgePhonelngo() + } + // 积分 + else if (app.globalData.type == 'jf') { + app.globalData.skipUrl = '/pages/integralmall/index', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'pc') { + // 停车 + app.globalData.skipUrl = '/index/passCar', + app.globalData.skip = 'switchTab' + that.judgePhonelngo() + } else if (app.globalData.type == 'mc') { + // 我的券包 + app.globalData.skipUrl = '/pages/couponorder/index/index', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'mo') { + // 我的订单 + app.globalData.skipUrl = '/pages/order/index/index?id=all', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'ca') { + // 我的卡包 + app.globalData.skipUrl = '/pages/cardorder/index/index', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'sc') { + // 特享礼遇 + app.globalData.skipUrl = '/pages/specialcourtesy/specialcourtesy', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'rb') { + // 限时秒杀 + app.globalData.skipUrl = '/pages/rushToBuy/index', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'bl') { + // 砍价专场 + app.globalData.skipUrl = '/pages/bargain/bargain', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'mb') { + // 我的砍价 + app.globalData.skipUrl = '/pages/bargain/bargain?from=myhtml', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'sl') { + // 拼团专场 + app.globalData.skipUrl = '/pages/spellGroup/spellGroup', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'ms') { + // 我的拼团 + app.globalData.skipUrl = '/pages/spellGroup/spellGroup?from=myhtml', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'dc') { + // 消费卡 + app.globalData.skipUrl = '/pages/discountCardList/discountCardList', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'td') { + // 专题活动页 + app.globalData.skipUrl = '/pages/topicDetail/index', + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (app.globalData.type == 'ml') { + // 门店 + app.globalData.skipUrl = '/index/searchbar', + app.globalData.skip = 'switchTab' + that.judgePhonelngo() + } else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag) { + app.globalData.skipUrl = `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { + app.globalData.skipUrl = `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}`, + app.globalData.skip = 'redirectTo' + that.judgePhonelngo() + } else { + app.globalData.skipUrl = "/index/index", + app.globalData.skip = 'switchTab' + that.judgePhonelngo() + } } - } else if (that.data.orderId||that.data.orderId&&app.globalData.type=='bg') { - // 参与砍价 - wx.navigateTo({ - url: `/pages/bargain/bargainDatail/bargainDatail?orderId=${that.data.orderId}` - }); - } else if (app.globalData.type == 'uc') { - // 我的 - wx.switchTab({ - url: '/index/user' - }); - } else if (app.globalData.type == 'in') { - // 首页 - wx.switchTab({ - url: '/index/index' - }); - } - // 积分 - else if (app.globalData.type == 'jf') { - wx.redirectTo({ - url: '/pages/integralmall/index' - }); - }else if (app.globalData.type == 'pc') { - // 停车 - wx.switchTab({ - url: '/index/passCar' - }); - } else if (app.globalData.type == 'mc') { - // 我的券包 - wx.redirectTo({ - url: '/pages/couponorder/index/index' - }); - } else if (app.globalData.type == 'mo') { - // 我的订单 - wx.redirectTo({ - url: '/pages/order/index/index?id=all' - }); - } else if (app.globalData.type == 'ca') { - // 我的卡包 - wx.redirectTo({ - url: '/pages/cardorder/index/index' - }); - } else if (app.globalData.type == 'sc') { - // 特享礼遇 - wx.redirectTo({ - url: '/pages/specialcourtesy/specialcourtesy' - }); - } else if (app.globalData.type == 'rb') { - // 限时秒杀 - wx.redirectTo({ - url: '/pages/rushToBuy/index' - }); - } else if (app.globalData.type == 'bl') { - // 砍价专场 - wx.redirectTo({ - url: '/pages/bargain/bargain' - }); - } else if (app.globalData.type == 'mb') { - // 我的砍价 - wx.redirectTo({ - url: '/pages/bargain/bargain?from=myhtml' - }); - } else if (app.globalData.type == 'sl') { - // 拼团专场 - wx.redirectTo({ - url: '/pages/spellGroup/spellGroup' - }); - } else if (app.globalData.type == 'ms') { - // 我的拼团 - wx.redirectTo({ - url: '/pages/spellGroup/spellGroup?from=myhtml' - }); - } else if (app.globalData.type == 'dc') { - // 消费卡 - wx.redirectTo({ - url: '/pages/discountCardList/discountCardList' - }); - } else if (app.globalData.type == 'td') { - // 专题活动页 - wx.redirectTo({ - url: '/pages/topicDetail/index' - }); - } - else if (app.globalData.type == 'ml') { - // 门店 - wx.switchTab({ - url: '/index/searchbar' - }); - } else if (that.data.fromflag == 'coupondetail' && that.data.couponChannelIdflag){ - wx.redirectTo({ - url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelIdflag}` - }); - } else if (that.data.fromflag == 'spellcoupondetail' && that.data.couponChannelIdflag) { - wx.redirectTo({ - url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${that.data.couponChannelIdflag}` - }); - }else { - wx.switchTab({ - url: "/index/index" + + }, + function(error) { + console.log(error) + wx.showToast({ + title: "请授权个人信息", + icon: "none" }); } - } - }, - function (error) { - console.log(error) - wx.showToast({ - title: "请授权个人信息", - icon: "none" - }); - } - ) - .catch(err => { - wx.showToast({ - title: err.errMsg, - icon: 'none', - duration: 2000, - mask: false - }); - }) - + ) + .catch(err => { + wx.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000, + mask: false + }); + }) } }) }, - getGameOne: function (token, id) { + getGameOne: function(token, id) { let _this = this; Http.get({ - url: config.api.getOneGame, - data: { - token: token, - id: id - } - }).then(res => { - wx.redirectTo({ - url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId, + url: config.api.getOneGame, + data: { + token: token, + id: id + } + }).then(res => { + wx.redirectTo({ + url: '/pages/game/index?url=' + res.data.url + "&id=" + res.data.id + "&gameId=" + res.data.gameId, + }) }) - }) - .catch(err => { - wx.showModal({ - title: '提示', - content: err.message, - showCancel: false, - success: function (res) { - // 如果游戏下架或者找不到,重启首页 - if (res.confirm) { - wx.reLaunch({ - url: '/pages/index/index', - }) + .catch(err => { + wx.showModal({ + title: '提示', + content: err.message, + showCancel: false, + success: function(res) { + // 如果游戏下架或者找不到,重启首页 + if (res.confirm) { + wx.reLaunch({ + url: '/pages/index/index', + }) + } } - } + }) + this.alphaClick(); }) - this.alphaClick(); - }) }, -}); + +}); \ No newline at end of file diff --git a/pages/integralmall/index.wxml b/pages/integralmall/index.wxml index 97c0dff..90190d7 100644 --- a/pages/integralmall/index.wxml +++ b/pages/integralmall/index.wxml @@ -10,7 +10,7 @@ - squareList + {{levelName}} diff --git a/pages/topicDetail/index.js b/pages/topicDetail/index.js index cd778b6..57513c4 100644 --- a/pages/topicDetail/index.js +++ b/pages/topicDetail/index.js @@ -73,10 +73,12 @@ Page({ }, gotoDetail:function(e){ if (e.currentTarget.dataset.type == 9){ + console.log("平团") wx.navigateTo({ url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}`, }) }else{ + console.log("优惠卷") wx.navigateTo({ url: `/pages/coupon/detail/index?couponChannelId=${e.currentTarget.dataset.couponchannelid}&couponId=${e.currentTarget.dataset.couponid}`, }) diff --git a/project.config.json b/project.config.json index 378754f..37c20e3 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": false, + "urlCheck": true, "es6": true, "enhance": false, "postcss": true, @@ -32,7 +32,7 @@ }, "compileType": "miniprogram", "libVersion": "2.5.0", - "appid": "wxfa336cad86ed598d", + "appid": "wx453ae0d37f3550d0", "projectname": "oldC", "isGameTourist": false, "simulatorType": "wechat",