|
|
|
@ -174,12 +174,18 @@ |
|
|
|
|
// #ifdef H5 |
|
|
|
|
var arr1 = window.location.href; |
|
|
|
|
var arr2 = arr1.split('='); |
|
|
|
|
if (!app.globalData.userInfo && arr2[1] !=undefined) { |
|
|
|
|
console.log(arr2); |
|
|
|
|
if (!app.globalData.userInfo && arr2[1] != undefined) { |
|
|
|
|
this.getH5UserInfo(arr2[1]); |
|
|
|
|
} |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
if (this.isWeiXinLogin()) { |
|
|
|
|
//微信内核支付 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 1.wx获取登录用户code |
|
|
|
|
// #ifdef MP |
|
|
|
|
uni.login({ |
|
|
|
@ -252,6 +258,15 @@ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
//微信内核浏览器 |
|
|
|
|
isWeiXinLogin() { |
|
|
|
|
var ua = navigator.userAgent.toLowerCase(); |
|
|
|
|
if (ua.search(/MicroMessenger/i) > -1) { |
|
|
|
|
return true; |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
//获取H5用户信息 |
|
|
|
|
getH5UserInfo(item) { |
|
|
|
|
let params = { |
|
|
|
@ -263,7 +278,6 @@ |
|
|
|
|
.object |
|
|
|
|
.highUser; |
|
|
|
|
app.globalData.token = res.return_data.uniqueCode; |
|
|
|
|
that.isShowAuth = false |
|
|
|
|
uni.setStorage({ |
|
|
|
|
key: "user", |
|
|
|
|
data: res.return_data |
|
|
|
@ -274,7 +288,9 @@ |
|
|
|
|
key: "token", |
|
|
|
|
data: res.return_data.uniqueCode |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
app.globalData.openId = res.return_data |
|
|
|
|
.object |
|
|
|
|
.highUser.openIdH5; |
|
|
|
|
} else { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: res.return_msg |
|
|
|
|