Commit b0d62b68 by sunerhu

1.回滚提交

parent e8f9a1c5
......@@ -18,7 +18,6 @@
},
"dependencies": {
"nanoid": "^4.0.0",
"vue-signature-pad": "^3.0.2",
"weixin-js-sdk": "^1.6.0"
"vue-signature-pad": "^3.0.2"
}
}
......@@ -122,9 +122,9 @@
import BootPage from "@/components/bootpage/bootpage.vue";
import UniShareWx from "@/uni_modules/uni-share-wx/index.vue";
import dataHandling from "@/util/dataHandling";
import {
hshare
} from '@/util/fiveshare'
// import {
// hshare
// } from '@/util/fiveshare'
import {
nanoid
} from 'nanoid';
......@@ -463,16 +463,16 @@
})
},
// H5 自定义分享
getshareData(){
let data = {
title:this.courseInfo.fileTitle,
desc:'加入我们开启学习之旅',
link: window.location.href,//分享链接
imgUrl: this.courseInfo.displayImage, //图片
}
var url = window.location.href.split('#')[0]
hshare(data,url)
},
// getshareData(){
// let data = {
// title:this.courseInfo.fileTitle,
// desc:'加入我们开启学习之旅',
// link: window.location.href,//分享链接
// imgUrl: this.courseInfo.displayImage, //图片
// }
// var url = window.location.href.split('#')[0]
// hshare(data,url)
// },
},
onLoad(option) {
this.fileId = option.fileId;
......@@ -483,7 +483,7 @@
this.shareCode = option.shareCode
this.shareUserId = option.shareUserId
this.getuserRead()
this.getshareData()
// this.getshareData()
}
let dataForm = uni.getStorageSync('userinfodataForm')
......
// var wx = require("weixin-js-sdk/index.js") //引入刚下载的js文件
// import $H from '@/api/request.js' //封装好的接口请求
import wx from 'weixin-js-sdk'
import api from "../api/api";
//初始化
export function initJssdkShare(callback, url) {
console.log(callback,url, '第二步');
var url = url
//这一步需要调用后台接口,返回需要的签名 签名时间戳 随机串 和公众号appid
//注意url:window.location.href.split('#')[0] //
// request.post("", {
// url // url是当前页面的url
// },
let WxConfigRequestVO = {
url:url,
systemType:'1'
}
// @ts-ignore
api.Wxshare(WxConfigRequestVO).then(res => {
console.log(res, '第三步');
wx.config({
debug: true,//调试的时候需要 在app上回弹出errmg:config ok 的时候就证明没问题了 这时候就可以改为false
appId: res.data.appId,//appid
timestamp: res.data.timestamp,//时间戳
nonceStr: res.data.nonceStr,//随机串
signature: res.data.signature,//签名
jsApiList: res.data.jsApiList//必填 是下面需要用到的方法集合
})
if(callback){
callback()
}
})
}
// data是穿的参数 url是当前页面的链接
export function hshare(data,url){
console.log(data, url, '第一步')
// initJssdkShare(data, url)
initJssdkShare(function(){
wx.ready(function(){
console.log(data);
var sharedata={
title: data.title, //标题
desc: data.desc, //描述
link: data.link ,//分享链接
imgUrl:data.imgUrl, //图片
success:(res=>{
})
};
wx.updateAppMessageShareData(sharedata)//自定义微信分享给朋友
wx.updateTimelineShareData(sharedata);//自定义微信分享给朋友
wx.onMenuShareAppMessage(sharedata);//获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)
})
},url)
}
\ No newline at end of file
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