Commit 42033a6b by 赵雅纹

触点参数

parent c1a75a4b
......@@ -25,6 +25,10 @@ Component({
type: String,
value: ''
},
scene: {
type: String,
value: ''
}
},
/**
......@@ -53,9 +57,10 @@ Component({
let data = {
"autoColor": true,
"page": this.data.pagePath,
"scene": '123',
"scene": this.data.scene,
"width": 100
}
console.log(this.data.pagePath)
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
const { result, data } = res.data
if (result == 0) {
......@@ -63,6 +68,7 @@ Component({
codeImg: app.globalData.imageUrl + data
// codeImg: "https://hwimagecdn.ihotwind.cn/usr/201908/miniQrCode-f00c5051fef7479395efb193431762c4.jpg"
})
console.log(this.data.codeImg)
if (this.data.codeImg) {
this.selectComponent('#getPoster').getAvaterInfo()
}
......
......@@ -104,6 +104,7 @@ Component({
success: function (res) {
wx.hideLoading();
if (res.statusCode === 200) {
console.log('000',res.tempFilePath)
var codeSrc = res.tempFilePath;
that.sharePosteCanvas(productSrc, codeSrc, imgInfo);
} else {
......@@ -128,6 +129,7 @@ Component({
//canvas绘制分享海报
sharePosteCanvas: function (avaterSrc, codeSrc, imgInfo) {
console.log('----', this.data.productDesc)
wx.showLoading({
title: '生成中...',
......@@ -168,6 +170,7 @@ Component({
// ctx.fillText(that.data.userAvatar, left - 15, imgheght + 110); //电话
}
// title
console.log('productDesc', that.data.productDesc)
if (that.data.productDesc){
ctx.setFontSize(12);
ctx.setFillStyle('#333333');
......
......@@ -26,6 +26,7 @@ wxService.page({
myExtendList:[],
myShareCount:'',
extendProBanner: '',
scene: '', //触点参数
proData : []
},
......@@ -176,23 +177,25 @@ wxService.page({
wxService.getTentacleContent(tentacleInfo).then(res => {
if (res && res.id) {
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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){
this.setData({
showCardModal: true,
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl,
pagePath: path
pagePath: path,
scene: scene
});
}else{
this.setData({
cardTitle: this.data.proData[0].productName,
cardUrl: this.data.proData[0].productImgUrl,
pagePath: path
pagePath: path,
scene: scene
});
this.getMiniCode()
}
......@@ -211,7 +214,7 @@ wxService.page({
let data = {
"autoColor": true,
"page": this.data.pagePath,
"scene": '123',
"scene": this.data.scene,
"width": 100
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
......
......@@ -157,6 +157,7 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
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>
<!--goHome-->
......
......@@ -24,7 +24,8 @@ wxService.page({
pagePath:'',
contentList:[],
currentShareContent: null,
contentPermission: false
contentPermission: false,
scene: ''
},
// 点击切换
......@@ -226,12 +227,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url,
pagePath: path
pagePath: path,
scene: scene
});
let params = {
contentId: e.detail.id,
......
......@@ -49,6 +49,7 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
scene="{{scene}}"
/>
<!--goHome-->
......
......@@ -24,6 +24,7 @@ wxService.page({
showCardModal: false,
currentShareContent: null,
fromZc: false,
scene:'', //触点参数
},
/**
......@@ -130,12 +131,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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({
showCardModal: true,
cardTitle: this.data.productInfo.productName,
cardUrl: this.data.productInfo.indexUrl,
pagePath: path
pagePath: path,
scene: scene
});
}
})
......
......@@ -176,6 +176,7 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
scene="{{scene}}"
/>
<!-- <sku-popup
......
......@@ -19,8 +19,8 @@ wxService.page({
showCardModal: false,
currentShareContent: null,
pagePath:'',
loadingTime:''
loadingTime:'',
scene: ''
},
/**
......@@ -153,12 +153,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.shareShowPictureRESDTOList[0].url,
pagePath: path
pagePath: path,
scene: scene
});
let params = {
contentId: this.data.contentInfo.id,
......
......@@ -44,6 +44,7 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
scene="{{scene}}"
/>
<!--goHome-->
......
......@@ -25,7 +25,8 @@ wxService.page({
pagePath:'',
contentList: [],
contentPermission: false,
currentShareContent: null
currentShareContent: null,
scene:''
},
/**
......@@ -230,12 +231,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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({
showCardModal: true,
cardTitle: e.detail.title,
cardUrl: e.detail.url,
pagePath: path
pagePath: path,
scene: scene
});
let params = {
......
......@@ -41,5 +41,6 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
scene="{{scene}}"
/>
......@@ -20,7 +20,8 @@ wxService.page({
loadingTime: '',
proList:[],
pageNo: 1,
pageSize: 10
pageSize: 10,
scene: ''
},
/**
......@@ -86,12 +87,14 @@ wxService.page({
this.data.currentShareContent.tentacleId = res.id;
let id = Integer.digit(this.data.currentShareContent.id, 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({
showCardModal: true,
cardTitle: this.data.contentInfo.headline,
cardUrl: this.data.contentInfo.sspList[0].url,
pagePath:path
pagePath:path,
scene: scene
});
let params = {
contentId: this.data.contentInfo.id,
......
......@@ -78,5 +78,6 @@
card-title="{{cardTitle}}"
card-url="{{cardUrl}}"
page-path="{{pagePath}}"
scene="{{scene}}"
/>
......@@ -93,8 +93,8 @@ wxService.page({
let data = {
"autoColor": true,
"page": 'pages/userCenter/userCenter?type={{app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS}}',
"scene": '123',
"page": 'pages/userCenter/userCenter',
"scene": 'type=' + app.globalData.contants.SHARE_TYPE.INVITE_FRIENDS,
"width": 100
}
wxService.post(`/marketing/quickMark/getAppQrCodePicture`, data).then(res => {
......
......@@ -552,6 +552,7 @@ class WXService extends Http {
watch.setWatcher(page);
//修改参数
let pageIsFromShare = false, id = null;
console.log('args',args)
args.forEach(item => {
if (item['t']) {
pageIsFromShare = true;
......@@ -566,6 +567,15 @@ class WXService extends Http {
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中
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