|
@@ -9,7 +9,6 @@ class WechatShare
|
|
|
{
|
|
|
constructor(data,surl)
|
|
|
{
|
|
|
- //let sign_url = encodeURIComponent(window.location.href.split('#')[0]);
|
|
|
let sign_url = encodeURIComponent(surl.split('#')[0]);
|
|
|
let host = window.location.protocol + '//' + window.location.host;
|
|
|
let url = host + "/mobile/index.php?act=mshop&op=signurl&client_type=ajax&sign_url="+sign_url+"&callback=";
|
|
@@ -46,7 +45,7 @@ class WechatShare
|
|
|
'chooseWXPay'
|
|
|
]
|
|
|
});
|
|
|
- pThis.ready(data);
|
|
|
+ pThis.register(data);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -82,7 +81,7 @@ class WechatShare
|
|
|
}, 0);
|
|
|
}
|
|
|
|
|
|
- ready(data)
|
|
|
+ register(data)
|
|
|
{
|
|
|
Vue.wechat.ready(function ()
|
|
|
{
|
|
@@ -97,10 +96,8 @@ class WechatShare
|
|
|
success: function (res) {
|
|
|
},
|
|
|
cancel: function (res) {
|
|
|
- //alert('已取消'+res);
|
|
|
},
|
|
|
fail: function (res) {
|
|
|
- //alert(JSON.stringify(res));
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -111,7 +108,6 @@ class WechatShare
|
|
|
link: data.link, //cookie读取
|
|
|
imgUrl: data.img_url,// 分享图标
|
|
|
trigger: function (res) {
|
|
|
- // 不要尝试在trigger中使用ajax异步请求修改本次分享的内容,因为客户端分享操作是一个同步操作,这时候使用ajax的回包会还没有返回
|
|
|
},
|
|
|
success: function (res) {
|
|
|
}
|