|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div></div>
|
|
|
|
|
|
+ <view></view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -39,32 +39,31 @@
|
|
//获取微信jssdk配置信息
|
|
//获取微信jssdk配置信息
|
|
get_wx_config() {
|
|
get_wx_config() {
|
|
|
|
|
|
- this.isLoading = true;
|
|
|
|
|
|
+
|
|
API_WeiXin.getConfig(window.location.href.split("#")[0]).then(response => {
|
|
API_WeiXin.getConfig(window.location.href.split("#")[0]).then(response => {
|
|
- this.isLoading = false;
|
|
|
|
-
|
|
|
|
- var wxconfig = response.wxConfig;
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ var wxconfig = response.data.wxConfig;
|
|
|
|
+
|
|
console.log(wxconfig.nonceStr)
|
|
console.log(wxconfig.nonceStr)
|
|
- this.wxConfig = wxconfig;
|
|
|
|
|
|
+ //this.wxConfig = wxconfig;
|
|
|
|
+
|
|
wx.config({
|
|
wx.config({
|
|
- debug: true, // 开启调试模式,
|
|
|
|
|
|
+ debug: false, // 开启调试模式,
|
|
appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
|
|
appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
|
|
timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
|
|
timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
|
|
nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
|
|
nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
|
|
signature: wxconfig.signature, // 必填,签名,见附录1
|
|
signature: wxconfig.signature, // 必填,签名,见附录1
|
|
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage',
|
|
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage',
|
|
- 'onMenuShareQQ', 'onMenuShareQZone','updateAppMessageShareData','updateTimelineShareData'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
|
|
|
- });
|
|
|
|
- wx.error(function(res){
|
|
|
|
- console.log(res)
|
|
|
|
- console.log("error")
|
|
|
|
- // config信息验证失败会执行 error 函数,如签名过期导致验证失败,具体错误信息可以打开 config 的debug模式查看,也可以在返回的 res 参数中查看,对于 SPA 可以在这里更新签名。
|
|
|
|
|
|
+ 'onMenuShareQQ', 'onMenuShareQZone','updateAppMessageShareData','updateTimelineShareData'] ,// 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
|
|
|
+ //'checkJsApi',
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ console.log("aaa")
|
|
//this.wxShare()
|
|
//this.wxShare()
|
|
}).catch(error => {
|
|
}).catch(error => {
|
|
- this.isLoading = false;
|
|
|
|
-
|
|
|
|
|
|
+ console.log(error)
|
|
|
|
+ console.log("errorerror")
|
|
})
|
|
})
|
|
},
|
|
},
|
|
setUrl(url){
|
|
setUrl(url){
|
|
@@ -79,8 +78,8 @@
|
|
//微信分享自定义
|
|
//微信分享自定义
|
|
wxShare() {
|
|
wxShare() {
|
|
var userInfo=this.carhelp.getPersonInfo()
|
|
var userInfo=this.carhelp.getPersonInfo()
|
|
- //var img=require("@/assets/img/logo.png")
|
|
|
|
- var img=""
|
|
|
|
|
|
+ var img=require("@/assets/img/logo.png")
|
|
|
|
+
|
|
var title="[微官网]"+this.title
|
|
var title="[微官网]"+this.title
|
|
// var desc=
|
|
// var desc=
|
|
let joinUrl = this.url;
|
|
let joinUrl = this.url;
|
|
@@ -90,14 +89,7 @@
|
|
var _this = this;
|
|
var _this = this;
|
|
|
|
|
|
wx.ready(function() {
|
|
wx.ready(function() {
|
|
- wx.checkJsApi({
|
|
|
|
- jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage',
|
|
|
|
- 'onMenuShareQQ', 'onMenuShareQZone','updateAppMessageShareData','updateTimelineShareData'], // 需要检测的 JS 接口列表,所有 JS 接口列表见附录2,
|
|
|
|
- success: function(res) {
|
|
|
|
- console.log(res)
|
|
|
|
- console.log("1111")
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+
|
|
|
|
|
|
wx.updateTimelineShareData({
|
|
wx.updateTimelineShareData({
|
|
title: title,
|
|
title: title,
|
|
@@ -106,7 +98,7 @@
|
|
imgUrl: img,
|
|
imgUrl: img,
|
|
success: function() {
|
|
success: function() {
|
|
if(userInfo){
|
|
if(userInfo){
|
|
- //_this.addPoint()
|
|
|
|
|
|
+ _this.addPoint()
|
|
}
|
|
}
|
|
// 设置成功
|
|
// 设置成功
|
|
_this.$emit("wxShare",null);
|
|
_this.$emit("wxShare",null);
|
|
@@ -119,7 +111,7 @@
|
|
imgUrl: img,
|
|
imgUrl: img,
|
|
success: function() {
|
|
success: function() {
|
|
if(userInfo){
|
|
if(userInfo){
|
|
- //_this.addPoint()
|
|
|
|
|
|
+ _this.addPoint()
|
|
}
|
|
}
|
|
// 设置成功
|
|
// 设置成功
|
|
_this.$emit("wxShare",null);
|
|
_this.$emit("wxShare",null);
|
|
@@ -132,7 +124,7 @@
|
|
imgUrl: img,
|
|
imgUrl: img,
|
|
success: function() {
|
|
success: function() {
|
|
if(userInfo){
|
|
if(userInfo){
|
|
- //_this.addPoint()
|
|
|
|
|
|
+ _this.addPoint()
|
|
}
|
|
}
|
|
// 设置成功
|
|
// 设置成功
|
|
_this.$emit("wxShare",null);
|
|
_this.$emit("wxShare",null);
|
|
@@ -144,6 +136,9 @@
|
|
link: joinUrl,
|
|
link: joinUrl,
|
|
imgUrl: img,
|
|
imgUrl: img,
|
|
success: function() {
|
|
success: function() {
|
|
|
|
+ if(userInfo){
|
|
|
|
+ _this.addPoint()
|
|
|
|
+ }
|
|
// 设置成功
|
|
// 设置成功
|
|
_this.$emit("wxShare",null);
|
|
_this.$emit("wxShare",null);
|
|
}
|
|
}
|