diff --git a/app.wxss b/app.wxss index 2ab9d45..5f45f48 100644 --- a/app.wxss +++ b/app.wxss @@ -9,6 +9,7 @@ url("//at.alicdn.com/t/font_777313_jq7td4d3uab.ttf") format("truetype"), url("//at.alicdn.com/t/font_777313_jq7td4d3uab.svg#iconfont") format("svg"); } + .iconfont { font-family: "iconfont" !important; font-size: 36rpx; diff --git a/components/advertisement/advertisement.js b/components/advertisement/advertisement.js index 473a67d..fa81a54 100644 --- a/components/advertisement/advertisement.js +++ b/components/advertisement/advertisement.js @@ -14,9 +14,13 @@ Component({ }, methods: { gotoGg: function (e) { + console.log(this.data.ggdata) let that = this; - wx.navigateTo({ + /* wx.navigateTo({ url: '/pages/coupon/detail/index?couponChannelId=' + e.currentTarget.dataset.data.produceId+'&g=1', + }) */ + wx.navigateTo({ + url: `/${that.data.ggdata.pagePath}&g=1`, }) }, a: function () { diff --git a/components/banner/index.js b/components/banner/index.js index 98b1996..92081ff 100644 --- a/components/banner/index.js +++ b/components/banner/index.js @@ -30,7 +30,8 @@ Component({ let id = (e.currentTarget.dataset.data.pagePath).substring(indexOf); let type = (e.currentTarget.dataset.data.pagePath).substr(23,2) console.log(indexOf, id, type); - if(type == 'cd'){ + console.log(e.currentTarget.dataset.data.pagePath) + if(type == 'cd' || type == 'sd'){ wx.navigateTo({ url: `/${e.currentTarget.dataset.data.pagePath}`, }) diff --git a/components/shareposter/index.js b/components/shareposter/index.js index 77a308f..b92594d 100644 --- a/components/shareposter/index.js +++ b/components/shareposter/index.js @@ -30,11 +30,42 @@ Component({ /** * 显示分享海报 */ - showPoster: function() { + /* showPoster: function() { //跳转到海报生成页 wx.navigateTo({ url: `/pages/canvas/index?merchantId=${this.data.id}` }) + }, */ + showPoster: function() { + //跳转到海报生成页 + console.log(this.data.fromflag) + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${that.data.id}` + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + // 用户昵称未授权 + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster` + }) + + } + }) + + + }, + + + + } }); \ No newline at end of file diff --git a/ext.json b/ext.json index 131cf40..83739a3 100644 --- a/ext.json +++ b/ext.json @@ -23,7 +23,7 @@ "ifHaveCarModular": "1" }, "name": "金泸商务", - "weappId": "wx9b0a894a3bbe9627", + "weappId": "wx649b3be73c1afe47", "appVersion": "C.test.5.2.0" }, "debug": false, @@ -63,7 +63,7 @@ "navigationBarTitleText": "", "navigationBarBackgroundColor": "#FFFFFF" }, - "extAppid": "wx9b0a894a3bbe9627", + "extAppid": "wx649b3be73c1afe47", "extEnable": true, "permission": { "scope.userLocation": { diff --git a/index/index.js b/index/index.js index 3937e07..4d5d8a3 100644 --- a/index/index.js +++ b/index/index.js @@ -659,6 +659,7 @@ Page({ openId: that.data.openId } }).then(res => { + // res = JSON.parse('{"code":200,"message":"查询成功","data":{"tenantId":"789","id":"418717151530979328","coverImg":"https://iformall-net.s3.cn-northwest-1.amazonaws.com.cn/789/0296235f-39ef-4968-b076-cd76211fcf2d.jfif","produceId":"418715528452771840","pagePath":"pages/index/index?type=sd&couponChannelId=418715528452771840","status":0,"createTime":1588941559000,"updateTime":1588941559000}}') console.log(res) if (res.data.id) { that.setData({ diff --git a/pages/coupon/detail/index.js b/pages/coupon/detail/index.js index 482b204..9e5e6fb 100644 --- a/pages/coupon/detail/index.js +++ b/pages/coupon/detail/index.js @@ -104,11 +104,38 @@ Page({ /** * 显示分享海报 */ - showPoster: function() { + /* showPoster: function() { //跳转到海报生成页 + console.log(this.data.canIUse) + + // return; wx.navigateTo({ url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` }) + }, */ + showPoster: function() { + //跳转到海报生成页 + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${that.data.data.id}` + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + // 用户昵称未授权 + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${that.data.data.id}&fromflag=poster` + }) + + } + }) + }, swiperChange: function (e) { this.setData({ diff --git a/pages/getuserinfo/index.js b/pages/getuserinfo/index.js index 3e2ffd1..235992c 100755 --- a/pages/getuserinfo/index.js +++ b/pages/getuserinfo/index.js @@ -117,6 +117,14 @@ Page({ }) .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}` @@ -129,7 +137,8 @@ Page({ }); } 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||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}` diff --git a/pages/index/index.js b/pages/index/index.js index fe1f296..1350bb3 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -130,6 +130,7 @@ Page({ }, checkuserstatus(options) { let that = this; + Http.get({ url: config.api.checkUserStatus, data: { @@ -137,6 +138,8 @@ Page({ } }) .then(res => { + // res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}') + //参与拼团 if (options && options.orderGroupId) { wx.redirectTo({ @@ -160,7 +163,7 @@ Page({ }) }) } else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { - + console.log(3333333333333333) // 转赠判断 if (options.cuserId) { wx.redirectTo({ diff --git a/pages/index/searchbar/detail/index.js b/pages/index/searchbar/detail/index.js index cc956da..54e918e 100644 --- a/pages/index/searchbar/detail/index.js +++ b/pages/index/searchbar/detail/index.js @@ -94,11 +94,35 @@ Page({ /** * 显示分享海报 */ - showPoster: function() { + /* showPoster: function() { //跳转到海报生成页 wx.navigateTo({ url: `/pages/canvas/index?merchantId=${this.data.id}` }) + }, */ + showPoster: function() { + //跳转到海报生成页 + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${that.data.id}` + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + // 用户昵称未授权 + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${that.data.id}&fromflag=poster` + }) + + } + }) + }, //点击切换 clickTab: function(e) { diff --git a/pages/spellGroup/mySpellGroup/index.js b/pages/spellGroup/mySpellGroup/index.js index 393fdb0..73d7b4d 100644 --- a/pages/spellGroup/mySpellGroup/index.js +++ b/pages/spellGroup/mySpellGroup/index.js @@ -68,11 +68,37 @@ Page({ /** * 显示分享海报 */ - showPoster: function() { + /* showPoster: function() { //跳转到海报生成页 wx.navigateTo({ url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` }) + }, */ + showPoster: function() { + console.log(this.data.data) + let that = this; + Http.get({ + url: config.api.checkUserStatus, + data: { + token: app.globalData.token + } + }).then(res => { + wx.navigateTo({ + url: `/pages/canvas/index?couponChannelId=${that.data.data.id}` + }) + }).catch(err => { + console.log(err) + if (err.code == 11004) { + // 用户昵称未授权 + wx.redirectTo({ + url: `/pages/getuserinfo/index?couponChannelId=${that.data.data.id}&fromflag=poster` + }) + + } + }) + + //跳转到海报生成页 + }, /** * 显示分享弹框