调用第三方微信登录
appLogin: function (
var t=this;
uni.get提供程序({ (
服务: ' Oauth ',
success(RES )是
if (RES.provider.index of (' weixin ' ) ) }
uni.login({
提供商: ' weixin ',
success(RES )是
uni.getUserInfo({ (
提供商: ' weixin ',
success (信息) {
控制台. log (info ) )。
}
() )
}
}
() )
(,
注意:
1. Hbuilder调试选择基于自定义
2.[ endif ]微信开放平台的APP应用程序签名
3 .获取APP应用程序签名
uni.requestPayment({ (
提供商: ' wx pay ',
订单信息: {
appid: res.data.data.appId,
partner id : RES.data.data.mch _ id,
prepay id : RES.data.data.prepay _ id,
package: 'Sign=WXPay ',
nonce str : RES.data.data.nonce str,
timestamp 3360 RES.data.data.timestamp,
sign: res.data.data.sign,
(,
UC cess :功能(t ) },
完成(err ) {
控制台. log (err )
}
();
微信分享
分享朋友圈
shareFriendcricle (
uni.share({ (
提供商: ' weixin ',
scene: 'WXSenceTimeline ',
类型:0,
href: '/pages/course/detail? id=' this.id,
title: this.detail.title,
summary : this.detail.subject,
imageurl : this.detail.images [0],
success :功能(RES ) {
console.log(success: ) JSON.stringify(RES );
(,
故障:功能(err ) {
控制台. log (故障: ) JSON.stringify(err );
}
);
(,
分享朋友
sharefriend(}
uni.share({ (
提供商: ' weixin ',
scene: 'WXSceneSession ',
类型:0,
href: '/pages/course/detail? id=' this.id,
title: this.detail.title,
summary : this.detail.subject,
imageurl : this.detail.images [0],
success :功能(RES ) {
console.log(success: ) JSON.stringify(RES );
(,
故障:功能(err ) {
控制台. log (故障: ) JSON.stringify(err );
}
);
(,