Commit 42033a6b by 赵雅纹

触点参数

parent c1a75a4b
...@@ -25,6 +25,10 @@ Component({ ...@@ -25,6 +25,10 @@ Component({
type: String, type: String,
value: '' value: ''
}, },
scene: {
type: String,
value: ''
}
}, },
/** /**
...@@ -53,9 +57,10 @@ Component({ ...@@ -53,9 +57,10 @@ Component({
let data = { let data = {
"autoColor": true, "autoColor": true,
"page": this.data.pagePath, "page": this.data.pagePath,
"scene": '123', "scene": this.data.scene,
"width": 100 "width": 100
} }
console.log(this.data.pagePath)
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => { wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
const { result, data } = res.data const { result, data } = res.data
if (result == 0) { if (result == 0) {
...@@ -63,6 +68,7 @@ Component({ ...@@ -63,6 +68,7 @@ Component({
codeImg: app.globalData.imageUrl + data codeImg: app.globalData.imageUrl + data
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg" // codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
}) })
console.log(this.data.codeImg)
if (this.data.codeImg) { if (this.data.codeImg) {
this.selectComponent('#getPoster').getAvaterInfo() this.selectComponent('#getPoster').getAvaterInfo()
} }
......
...@@ -104,6 +104,7 @@ Component({ ...@@ -104,6 +104,7 @@ Component({
success: function (res) { success: function (res) {
wx.hideLoading(); wx.hideLoading();
if (res.statusCode === 200) { if (res.statusCode === 200) {
console.log('000',res.tempFilePath)
var codeSrc = res.tempFilePath; var codeSrc = res.tempFilePath;
that.sharePosteCanvas(productSrc, codeSrc, imgInfo); that.sharePosteCanvas(productSrc, codeSrc, imgInfo);
} else { } else {
...@@ -128,6 +129,7 @@ Component({ ...@@ -128,6 +129,7 @@ Component({
//canvas绘制分享海报 //canvas绘制分享海报
sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) { sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) {
console.log('----', this.data.productDesc)
wx.showLoading({ wx.showLoading({
title: '生成中...', title: '生成中...',
...@@ -168,6 +170,7 @@ Component({ ...@@ -168,6 +170,7 @@ Component({
// ctx.fillText(that.data.userAvatar, left - 15, imgheght + 110); //电话 // ctx.fillText(that.data.userAvatar, left - 15, imgheght + 110); //电话
} }
// title // title
console.log('productDesc', that.data.productDesc)
if (that.data.productDesc){ if (that.data.productDesc){
ctx.setFontSize(12); ctx.setFontSize(12);
ctx.setFillStyle('#333333'); ctx.setFillStyle('#333333');
......
...@@ -26,6 +26,7 @@ wxService.page({ ...@@ -26,6 +26,7 @@ wxService.page({
myExtendList:[], myExtendList:[],
myShareCount:'', myShareCount:'',
extendProBanner: '', extendProBanner: '',
scene: '', //触点参数
proData : [] proData : []
}, },
...@@ -176,23 +177,25 @@ wxService.page({ ...@@ -176,23 +177,25 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => { wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) { if (res && res.id) {
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'subPackage/page/pages/friendShareList/friendShareList?i=' + id + '&t=' + tentacleId; var path = 'subPackage/page/pages/friendShareList/friendShareList';
var scene = 'i=' + id + '&t=' + tentacleId
if(type == 1){ if(type == 1){
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.proData[0].productName, cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl, cardUrl: this.data.proData[0].productImgUrl,
pagePath: path pagePath: path,
scene: scene
}); });
}else{ }else{
this.setData({ this.setData({
cardTitle: this.data.proData[0].productName, cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl, cardUrl: this.data.proData[0].productImgUrl,
pagePath: path pagePath: path,
scene: scene
}); });
this.getMiniCode() this.getMiniCode()
} }
...@@ -211,7 +214,7 @@ wxService.page({ ...@@ -211,7 +214,7 @@ wxService.page({
let data = { let data = {
"autoColor": true, "autoColor": true,
"page": this.data.pagePath, "page": this.data.pagePath,
"scene": '123', "scene": this.data.scene,
"width": 100 "width": 100
} }
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => { wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
......
...@@ -157,6 +157,7 @@ ...@@ -157,6 +157,7 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
<share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" productDesc="{{cardTitle}}" userAvatar="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster> <share-poster id="getPoster" bindmyevent="myEventListener" avater="{{cardUrl}}" productDesc="{{cardTitle}}" userAvatar="http://t2.hddhhn.com/uploads/tu/201806/9999/91480c0c87.jpg" bind:showMiniCard="_showMiniCard" pagePath="{{pagePath}}" code-img="{{codeImg}}"></share-poster>
<!--goHome--> <!--goHome-->
......
...@@ -24,7 +24,8 @@ wxService.page({ ...@@ -24,7 +24,8 @@ wxService.page({
pagePath:'', pagePath:'',
contentList:[], contentList:[],
currentShareContent: null, currentShareContent: null,
contentPermission: false contentPermission: false,
scene: ''
}, },
// 点击切换 // 点击切换
...@@ -226,12 +227,14 @@ wxService.page({ ...@@ -226,12 +227,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail';
let scene = 'i=' + id + '&t=' + tentacleId
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: e.detail.title, cardTitle: e.detail.title,
cardUrl: e.detail.url, cardUrl: e.detail.url,
pagePath: path pagePath: path,
scene: scene
}); });
let params = { let params = {
contentId: e.detail.id, contentId: e.detail.id,
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
<!--goHome--> <!--goHome-->
......
...@@ -24,6 +24,7 @@ wxService.page({ ...@@ -24,6 +24,7 @@ wxService.page({
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
fromZc: false, fromZc: false,
scene:'', //触点参数
}, },
/** /**
...@@ -130,12 +131,14 @@ wxService.page({ ...@@ -130,12 +131,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/productDetail/productDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/productDetail/productDetail';
var scene = 'i=' + id + '&t=' + tentacleId
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.productInfo.productName, cardTitle: this.data.productInfo.productName,
cardUrl: this.data.productInfo.indexUrl, cardUrl: this.data.productInfo.indexUrl,
pagePath: path pagePath: path,
scene: scene
}); });
} }
}) })
......
...@@ -176,6 +176,7 @@ ...@@ -176,6 +176,7 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
<!-- <sku-popup <!-- <sku-popup
......
...@@ -19,8 +19,8 @@ wxService.page({ ...@@ -19,8 +19,8 @@ wxService.page({
showCardModal: false, showCardModal: false,
currentShareContent: null, currentShareContent: null,
pagePath:'', pagePath:'',
loadingTime:'' loadingTime:'',
scene: ''
}, },
/** /**
...@@ -153,12 +153,14 @@ wxService.page({ ...@@ -153,12 +153,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail';
let scene = 'i=' + id + '&t=' + tentacleId
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.contentInfo.headline, cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url, cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url,
pagePath: path pagePath: path,
scene: scene
}); });
let params = { let params = {
contentId: this.data.contentInfo.id, contentId: this.data.contentInfo.id,
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
<!--goHome--> <!--goHome-->
......
...@@ -25,7 +25,8 @@ wxService.page({ ...@@ -25,7 +25,8 @@ wxService.page({
pagePath:'', pagePath:'',
contentList: [], contentList: [],
contentPermission: false, contentPermission: false,
currentShareContent: null currentShareContent: null,
scene:''
}, },
/** /**
...@@ -230,12 +231,14 @@ wxService.page({ ...@@ -230,12 +231,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail';
let scene = 'i=' + id + '&t=' + tentacleId
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: e.detail.title, cardTitle: e.detail.title,
cardUrl: e.detail.url, cardUrl: e.detail.url,
pagePath: path pagePath: path,
scene: scene
}); });
let params = { let params = {
......
...@@ -41,5 +41,6 @@ ...@@ -41,5 +41,6 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
...@@ -20,7 +20,8 @@ wxService.page({ ...@@ -20,7 +20,8 @@ wxService.page({
loadingTime: '', loadingTime: '',
proList:[], proList:[],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
scene: ''
}, },
/** /**
...@@ -86,12 +87,14 @@ wxService.page({ ...@@ -86,12 +87,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id; this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 10, 64); let id = Integer.digit(this.data.currentShareContent.id, 10, 64);
let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64); let tentacleId = Integer.digit(this.data.currentShareContent.tentacleId, 10, 64);
var path = 'pages/wantToBuyDetail/wantToBuyDetail?i=' + id + '&t=' + tentacleId; var path = 'pages/wantToBuyDetail/wantToBuyDetail';
let scene = 'i=' + id + '&t=' + tentacleId
this.setData({ this.setData({
showCardModal: true, showCardModal: true,
cardTitle: this.data.contentInfo.headline, cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.sspList[0].url, cardUrl: this.data.contentInfo.sspList[0].url,
pagePath:path pagePath:path,
scene: scene
}); });
let params = { let params = {
contentId: this.data.contentInfo.id, contentId: this.data.contentInfo.id,
......
...@@ -78,5 +78,6 @@ ...@@ -78,5 +78,6 @@
card-title="{{cardTitle}}" card-title="{{cardTitle}}"
card-url="{{cardUrl}}" card-url="{{cardUrl}}"
page-path="{{pagePath}}" page-path="{{pagePath}}"
scene="{{scene}}"
/> />
...@@ -93,8 +93,8 @@ wxService.page({ ...@@ -93,8 +93,8 @@ wxService.page({
let data = { let data = {
"autoColor": true, "autoColor": true,
"page": 'pages/userCenter/userCenter?type={{app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS}}', "page": 'pages/userCenter/userCenter',
"scene": '123', "scene": 'type=' + app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS,
"width": 100 "width": 100
} }
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => { wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
......
...@@ -552,6 +552,7 @@ class WXService extends Http { ...@@ -552,6 +552,7 @@ class WXService extends Http {
watch.setWatcher(page); watch.setWatcher(page);
//修改参数 //修改参数
let pageIsFromShare = false, id = null; let pageIsFromShare = false, id = null;
console.log('args',args)
args.forEach(item => { args.forEach(item => {
if (item['t']) { if (item['t']) {
pageIsFromShare = true; pageIsFromShare = true;
...@@ -566,6 +567,15 @@ class WXService extends Http { ...@@ -566,6 +567,15 @@ class WXService extends Http {
item['id'] = Integer.digit(item['i'], 64, 10); item['id'] = Integer.digit(item['i'], 64, 10);
} }
} }
if(item['scene']){
let idParam = decodeURIComponent(item['scene']).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
item['id'] = Integer.digit(shareId, 64, 10)
console.log('idParam', idParam)
console.log('shareId', shareId)
console.log('id', item['id'])
}
}); });
//如果打开的是分享界面则进行触点对象信息请求并存储到本地 放到后续的header中 //如果打开的是分享界面则进行触点对象信息请求并存储到本地 放到后续的header中
if (pageIsFromShare) { if (pageIsFromShare) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment