| @@ -31,7 +31,7 @@ Component({ | |||||
| let type = (e.currentTarget.dataset.data.pagePath).substr(23,2) | let type = (e.currentTarget.dataset.data.pagePath).substr(23,2) | ||||
| console.log(indexOf, id, type); | console.log(indexOf, id, type); | ||||
| console.log(e.currentTarget.dataset.data.pagePath) | console.log(e.currentTarget.dataset.data.pagePath) | ||||
| if(type == 'cd'){ | |||||
| if(type == 'cd' || type == 'sd'){ | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/${e.currentTarget.dataset.data.pagePath}`, | url: `/${e.currentTarget.dataset.data.pagePath}`, | ||||
| }) | }) | ||||
| @@ -30,11 +30,42 @@ Component({ | |||||
| /** | /** | ||||
| * 显示分享海报 | * 显示分享海报 | ||||
| */ | */ | ||||
| showPoster: function() { | |||||
| /* showPoster: function() { | |||||
| //跳转到海报生成页 | //跳转到海报生成页 | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/canvas/index?merchantId=${this.data.id}` | 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` | |||||
| }) | |||||
| } | |||||
| }) | |||||
| }, | }, | ||||
| } | } | ||||
| }); | }); | ||||
| @@ -23,7 +23,7 @@ | |||||
| "ifHaveCarModular": "1" | "ifHaveCarModular": "1" | ||||
| }, | }, | ||||
| "name": "金泸商务", | "name": "金泸商务", | ||||
| "weappId": "wx9b0a894a3bbe9627", | |||||
| "weappId": "wx649b3be73c1afe47", | |||||
| "appVersion": "C.test.5.2.0" | "appVersion": "C.test.5.2.0" | ||||
| }, | }, | ||||
| "debug": false, | "debug": false, | ||||
| @@ -63,7 +63,7 @@ | |||||
| "navigationBarTitleText": "", | "navigationBarTitleText": "", | ||||
| "navigationBarBackgroundColor": "#FFFFFF" | "navigationBarBackgroundColor": "#FFFFFF" | ||||
| }, | }, | ||||
| "extAppid": "wx9b0a894a3bbe9627", | |||||
| "extAppid": "wx649b3be73c1afe47", | |||||
| "extEnable": true, | "extEnable": true, | ||||
| "permission": { | "permission": { | ||||
| "scope.userLocation": { | "scope.userLocation": { | ||||
| @@ -659,7 +659,7 @@ Page({ | |||||
| openId: that.data.openId | openId: that.data.openId | ||||
| } | } | ||||
| }).then(res => { | }).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}}') | |||||
| // 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) | console.log(res) | ||||
| if (res.data.id) { | if (res.data.id) { | ||||
| that.setData({ | that.setData({ | ||||
| @@ -104,11 +104,38 @@ Page({ | |||||
| /** | /** | ||||
| * 显示分享海报 | * 显示分享海报 | ||||
| */ | */ | ||||
| showPoster: function() { | |||||
| /* showPoster: function() { | |||||
| //跳转到海报生成页 | //跳转到海报生成页 | ||||
| console.log(this.data.canIUse) | |||||
| // return; | |||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` | 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) { | swiperChange: function (e) { | ||||
| this.setData({ | this.setData({ | ||||
| @@ -117,6 +117,14 @@ Page({ | |||||
| }) | }) | ||||
| .then( | .then( | ||||
| function (res) { | function (res) { | ||||
| // debugger; | |||||
| if (that.data.fromflag == 'poster') { | |||||
| wx.redirectTo({ | |||||
| url: `/pages/canvas/index?couponChannelId=${that.data.couponChannelId}` | |||||
| }) | |||||
| return; | |||||
| } | |||||
| // | |||||
| if (that.data.optionData.orderGroupId){ | if (that.data.optionData.orderGroupId){ | ||||
| wx.reLaunch({ | 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}` | 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 { | } 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({ | wx.navigateTo({ | ||||
| url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | url: `/pages/coupon/detail/index?couponChannelId=${that.data.couponChannelId}` | ||||
| @@ -130,6 +130,7 @@ Page({ | |||||
| }, | }, | ||||
| checkuserstatus(options) { | checkuserstatus(options) { | ||||
| let that = this; | let that = this; | ||||
| Http.get({ | Http.get({ | ||||
| url: config.api.checkUserStatus, | url: config.api.checkUserStatus, | ||||
| data: { | data: { | ||||
| @@ -137,6 +138,8 @@ Page({ | |||||
| } | } | ||||
| }) | }) | ||||
| .then(res => { | .then(res => { | ||||
| // res = JSON.parse('{"code":11004,"message":"用户昵称未授权,请跳转到用户昵称授权页!","data":{}}') | |||||
| //参与拼团 | //参与拼团 | ||||
| if (options && options.orderGroupId) { | if (options && options.orderGroupId) { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| @@ -160,7 +163,7 @@ Page({ | |||||
| }) | }) | ||||
| }) | }) | ||||
| } else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { | } else if (options && options.couponChannelId && !options.spellGroup && app.globalData.type != 'sd') { | ||||
| console.log(3333333333333333) | |||||
| // 转赠判断 | // 转赠判断 | ||||
| if (options.cuserId) { | if (options.cuserId) { | ||||
| wx.redirectTo({ | wx.redirectTo({ | ||||
| @@ -94,11 +94,35 @@ Page({ | |||||
| /** | /** | ||||
| * 显示分享海报 | * 显示分享海报 | ||||
| */ | */ | ||||
| showPoster: function() { | |||||
| /* showPoster: function() { | |||||
| //跳转到海报生成页 | //跳转到海报生成页 | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/canvas/index?merchantId=${this.data.id}` | 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) { | clickTab: function(e) { | ||||
| @@ -68,11 +68,37 @@ Page({ | |||||
| /** | /** | ||||
| * 显示分享海报 | * 显示分享海报 | ||||
| */ | */ | ||||
| showPoster: function() { | |||||
| /* showPoster: function() { | |||||
| //跳转到海报生成页 | //跳转到海报生成页 | ||||
| wx.navigateTo({ | wx.navigateTo({ | ||||
| url: `/pages/canvas/index?couponChannelId=${this.data.data.id}` | 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` | |||||
| }) | |||||
| } | |||||
| }) | |||||
| //跳转到海报生成页 | |||||
| }, | }, | ||||
| /** | /** | ||||
| * 显示分享弹框 | * 显示分享弹框 | ||||