Commit c748ee34 authored by jsz315's avatar jsz315

修改分享

parent d1b44182
...@@ -4,6 +4,7 @@ import { compileRender } from './js/template'; ...@@ -4,6 +4,7 @@ import { compileRender } from './js/template';
import { getUrlParameter } from "@js/tooler"; import { getUrlParameter } from "@js/tooler";
import { debounce } from './js/utils'; import { debounce } from './js/utils';
import { get, post } from "@js/request"; import { get, post } from "@js/request";
import { shareConfig, updateLink } from "@js/share";
const tplElement = { const tplElement = {
main: $('#tpl_main').html(), main: $('#tpl_main').html(),
...@@ -22,6 +23,16 @@ const FROM = getUrlParameter('from'); ...@@ -22,6 +23,16 @@ const FROM = getUrlParameter('from');
const currentView = getUrlParameter('currentView'); const currentView = getUrlParameter('currentView');
function wxInit(){ function wxInit(){
let sellerName = contentData.sellerCardVO.sellerName; let sellerName = contentData.sellerCardVO.sellerName;
shareConfig({
link: location.origin + location.pathname + location.search,
title: contentData.title,
desc: '来自' + sellerName + '的分享',
img: contentData.mainImgUrl,
debug: false
})
/*
get(API.getOaJssdk, { get(API.getOaJssdk, {
url: window.location.href url: window.location.href
}).then(res => { }).then(res => {
...@@ -48,28 +59,6 @@ function wxInit(){ ...@@ -48,28 +59,6 @@ function wxInit(){
var title = contentData.title; var title = contentData.title;
var desc = '来自' + sellerName + '的分享'; var desc = '来自' + sellerName + '的分享';
var img = contentData.mainImgUrl; var img = contentData.mainImgUrl;
/*
//分享朋友圈
wx.updateTimelineShareData({
title: contentData.title, // 分享标题
link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: contentData.mainImgUrl, // 分享图标
success: function () {
// 设置成功
}
})
//分享给好友
wx.updateAppMessageShareData({
title: contentData.title, // 分享标题
desc: '来源于销售' + sellerName, // 分享描述
link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: contentData.mainImgUrl, // 分享图标
success: function () {
// 设置成功
}
})
*/
//分享朋友圈 //分享朋友圈
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
...@@ -107,11 +96,8 @@ function wxInit(){ ...@@ -107,11 +96,8 @@ function wxInit(){
} }
}); });
// wx.error(function (res) {
// alert(res.errMsg);
// });
}); });
*/
} }
......
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