Commit 34903bae by 李嘉林

分享

parent e0bf26c9
...@@ -648,7 +648,7 @@ export default { ...@@ -648,7 +648,7 @@ export default {
useCoupon(val) { useCoupon(val) {
coupon.receive_coupon(this.couponCode).then(res => { coupon.receive_coupon(this.couponCode).then(res => {
console.log(res, "cou137"); console.log(res, "cou137");
if (res.data.data == 'true') { if (res.data.code == 200) {
this.couItem.receiveStatus = 1; this.couItem.receiveStatus = 1;
if (val == 1) { if (val == 1) {
wx.showToast({ wx.showToast({
......
...@@ -535,6 +535,8 @@ export default { ...@@ -535,6 +535,8 @@ export default {
this.withoutScene = true; this.withoutScene = true;
console.log(this.withoutScene,this.newPageUrl,'index页面------onShow') console.log(this.withoutScene,this.newPageUrl,'index页面------onShow')
log.info('index页面------onShow') log.info('index页面------onShow')
// 提前获取分销员信息,供 onShareAppMessage 使用
this.getSpokesman();
}, },
methods: { methods: {
init() { init() {
...@@ -577,7 +579,8 @@ export default { ...@@ -577,7 +579,8 @@ export default {
}, },
async getSpokesman() { async getSpokesman() {
await spokesman.getSpokesmanidByShare().then(res => { await spokesman.getSpokesmanidByShare().then(res => {
log.info('onShareAppMessage-getSpokesmanidByShare',res) log.info('onShareAppMessage-getSpokesmanidByShare', res)
console.log('onShareAppMessage-getSpokesmanidByShare', res.data.data)
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data.data.hasInvitationStatus == 1) { if (res.data.data.hasInvitationStatus == 1) {
this.hasInvitationStatus = 1; this.hasInvitationStatus = 1;
...@@ -616,7 +619,7 @@ export default { ...@@ -616,7 +619,7 @@ export default {
//分享内容中有订单信息为送礼活动 //分享内容中有订单信息为送礼活动
this.shareOrderSn = res.target.data[len].orderSn; this.shareOrderSn = res.target.data[len].orderSn;
this.shareTid = res.target.data[len].shareTid; this.shareTid = res.target.data[len].shareTid;
this.newWindowHref = res.target.data[len].shareImgUrl + '&verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid") this.newWindowHref = res.target.data[len].shareImgUrl + '&\verifyShare=1';// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
log.info("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref); log.info("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
console.log("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref); console.log("getMessage-分享信息:", this.shareLogoUrl, this.shareShopName,1111111,this.newWindowHref);
//文章详情分享埋点 //文章详情分享埋点
...@@ -771,9 +774,8 @@ export default { ...@@ -771,9 +774,8 @@ export default {
onUnload() { onUnload() {
log.info("卸载----------------", this.options); log.info("卸载----------------", this.options);
}, },
async onShareAppMessage(res) { onShareAppMessage(res) {
log.info('onShareAppMessage',res) log.info('onShareAppMessage',res)
await this.getSpokesman();
let url = '' let url = ''
log.info(this.newWindowHref + 'this.newWindowHref') log.info(this.newWindowHref + 'this.newWindowHref')
//分享路径 //分享路径
...@@ -794,9 +796,6 @@ export default { ...@@ -794,9 +796,6 @@ export default {
this.shopId this.shopId
}`; }`;
} }
log.info('shareUrl---------------' + url)
console.log('shareUrl---------------' + url)
//增加分销员信息 //增加分销员信息
if(this.hasInvitationStatus == 1 && url.indexOf('spokesmanGroupId')==-1){ if(this.hasInvitationStatus == 1 && url.indexOf('spokesmanGroupId')==-1){
this.shareUrl = url+ this.newHref this.shareUrl = url+ this.newHref
...@@ -805,31 +804,13 @@ export default { ...@@ -805,31 +804,13 @@ export default {
} }
log.info('onShareAppMessage-shareUrl',this.shareUrl,); console.log('onShareAppMessage-shareShopName',this.shareShopName);
console.log('onShareAppMessage-shareUrl',this.shareUrl,); console.log('onShareAppMessage-shareUrl', `/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`);
log.info(`/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, '测试直播分享相关') console.log('onShareAppMessage-shareLogoUrl', this.shareLogoUrl);
return { return {
title: this.shareShopName, // 默认是小程序的名称 title: this.shareShopName, // 默认是小程序的名称
path: `/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面 path: `/pages/index/main?share=${encodeURIComponent(this.shareUrl)}`, // 默认是当前页面
imageUrl: this.shareLogoUrl, imageUrl: this.shareLogoUrl,
success: function(res) {
// 转发成功之后的回调
if (res.errMsg == "shareAppMessage:ok") {
log.info(res, "分享成功");
}
},
fail: function() {
// 转发失败之后的回调
if (res.errMsg == "shareAppMessage:fail cancel") {
// 用户取消转发
log.info(res, "分享失败");
} else if (res.errMsg == "shareAppMessage:fail") {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function() {
// 转发结束之后的回调(转发成不成功都会执行)
}
}; };
} }
}; };
......
...@@ -342,7 +342,7 @@ export function getCoupon(code, item) { ...@@ -342,7 +342,7 @@ export function getCoupon(code, item) {
function useCoupon(val, couponCode, usingIntegrals) { function useCoupon(val, couponCode, usingIntegrals) {
coupon.receive_coupon(couponCode).then(res => { coupon.receive_coupon(couponCode).then(res => {
console.log(res, "cou137"); console.log(res, "cou137");
if (res.data.data == "true") { if (res.data.code == 200) {
if (val == 1) { if (val == 1) {
wx.showToast({ title: "领取成功", icon: "success" }); wx.showToast({ title: "领取成功", icon: "success" });
} else { } else {
......
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