|
@@ -14,19 +14,17 @@
|
|
|
</button>
|
|
|
<view class="authorize-info">{{wxPhoneData? '****************' : ''}}</view> -->
|
|
|
<!-- <view class="authorize-login" @click="getUserInfo">登录</view> -->
|
|
|
- <button
|
|
|
- class="authorize-login"
|
|
|
- open-type="getUserInfo"
|
|
|
- @getuserinfo="getUserinfoWechat" withCredentials="true" >
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <button class="authorize-login" open-type="getUserInfo" @getuserinfo="getUserinfoWechat" withCredentials="true">
|
|
|
登录
|
|
|
</button>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef APP-PLUS -->
|
|
|
+ <button class="authorize-login" @click="getUserinfoApp">
|
|
|
+ 登录5
|
|
|
+ </button>
|
|
|
+ <!-- #endif -->
|
|
|
<view @click="showAgreement = true" class="agreement">点击登录视为同意<text class="underline">平台服务协议</text></view>
|
|
|
- <!-- <button
|
|
|
- class="authorize-login"
|
|
|
- open-type="getUserInfo"
|
|
|
- @click="getUserinfoApp">
|
|
|
- 登录
|
|
|
- </button> -->
|
|
|
</view>
|
|
|
{{tipxx}}
|
|
|
<u-top-tips ref="uTips"></u-top-tips>
|
|
@@ -46,7 +44,8 @@
|
|
|
<script>
|
|
|
const NET = require('@/utils/request')
|
|
|
const API = require('@/config/api')
|
|
|
- const html = `
|
|
|
+ const html =
|
|
|
+ `
|
|
|
<h4>用户服务协议</h4>
|
|
|
特别提示:
|
|
|
欢迎您来到千家地!
|
|
@@ -140,7 +139,8 @@
|
|
|
14.1. 条款的独立性。如果根据适用的法律认定本协议中的任何条款或者任何条款中的任何部分无效、违法或者不具有可执行性,这种无效、违法或者不具有可执行性不影响本协议中的任何其它条款或者这些条款中的任何其它部分的效力。
|
|
|
14.2. 平台权利的保留。本协议未明示授权的其他权利仍由千家地保留,用户未经千家地书 面许可不得行使,且千家地未行使前述任何权利并不构成放弃权利。
|
|
|
14.3. 条标的作用。本协议条款的标题仅作参考使用,不界定、影响或限制本协议条款的含义、描述及解释。
|
|
|
-`.split('\n').map(v=>v+'<br/>').join('\n')
|
|
|
+`
|
|
|
+ .split('\n').map(v => v + '<br/>').join('\n')
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
@@ -183,6 +183,7 @@
|
|
|
// })
|
|
|
// }
|
|
|
// },
|
|
|
+ // #ifdef MP-WEIXIN
|
|
|
getUserinfoWechat(data) {
|
|
|
uni.getProvider({
|
|
|
service: 'oauth',
|
|
@@ -222,63 +223,77 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- // 获取登录权限
|
|
|
- // getUserinfoApp() {
|
|
|
- // uni.getProvider({
|
|
|
- // service: 'oauth',
|
|
|
- // success: (res) => {
|
|
|
- // if (~res.provider.indexOf('weixin')) {
|
|
|
- // uni.login({
|
|
|
- // provider: 'weixin',
|
|
|
- // success: (res2) => {
|
|
|
- // uni.getUserInfo({
|
|
|
- // provider: 'weixin',
|
|
|
- // success: (info) => {
|
|
|
- // uni.setStorage({
|
|
|
- // key: 'wxLoginData',
|
|
|
- // data: {
|
|
|
- // code: res2.code,
|
|
|
- // encryptedData: info.encryptedData,
|
|
|
- // iv: info.iv,
|
|
|
- // rawData: info.rawData,
|
|
|
- // signature: info.signature,
|
|
|
- // }
|
|
|
- // })
|
|
|
- // this.wxLoginData = uni.getStorageSync("wxLoginData")
|
|
|
- // console.log(1111111,this.wxLoginData&&this.wxLoginData.rawData)
|
|
|
- // this.userNmae = JSON.parse(this.wxLoginData.rawData).nickName
|
|
|
- // this.getUserInfo()
|
|
|
- // // this.$refs.uTips.show({
|
|
|
- // // title: '获取角色信息成功',
|
|
|
- // // type: 'success',
|
|
|
- // // })
|
|
|
- // },
|
|
|
- // fail: (error) => {
|
|
|
- // console.log(2222, error)
|
|
|
- // this.$refs.uTips.show({
|
|
|
- // title: '微信登录授权失败',
|
|
|
- // type: 'warning',
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // },
|
|
|
- // fail: () => {
|
|
|
- // console.log(33333, error)
|
|
|
- // this.$refs.uTips.show({
|
|
|
- // title: '微信登录授权失败',
|
|
|
- // type: 'warning',
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // this.$refs.uTips.show({
|
|
|
- // title: '请先安装微信或升级版本',
|
|
|
- // type: 'warning',
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
+ //#endif
|
|
|
+
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ // 获取app登录权限
|
|
|
+ getUserinfoApp() {
|
|
|
+ let that = this
|
|
|
+ console.log('app enter')
|
|
|
+ uni.login({
|
|
|
+ // provider: 'weixin',
|
|
|
+ success: (res2) => {
|
|
|
+ console.log('res2', res2)
|
|
|
+ uni.getUserInfo({
|
|
|
+ provider: 'weixin',
|
|
|
+ success: (info) => {
|
|
|
+ console.log('info')
|
|
|
+ // uni.setStorage({
|
|
|
+ // key: 'wxLoginData',
|
|
|
+ // data: {
|
|
|
+ // code: res2.code,
|
|
|
+ // encryptedData: info.encryptedData,
|
|
|
+ // iv: info.iv,
|
|
|
+ // rawData: info.rawData,
|
|
|
+ // signature: info.signature,
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // that.wxLoginData = uni.getStorageSync("wxLoginData")
|
|
|
+ // console.log(1111111, that.wxLoginData && that.wxLoginData.rawData)
|
|
|
+ // that.userNmae = JSON.parse(that.wxLoginData.rawData).nickName
|
|
|
+ // that.getUserInfo()
|
|
|
+ // this.$refs.uTips.show({
|
|
|
+ // title: '获取角色信息成功',
|
|
|
+ // type: 'success',
|
|
|
+ // })
|
|
|
+ },
|
|
|
+ fail: (error) => {
|
|
|
+ console.log(2222, error)
|
|
|
+ // that.$refs.uTips.show({
|
|
|
+ // title: '微信登录授权失败',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ console.log(33333, error)
|
|
|
+ // that.$refs.uTips.show({
|
|
|
+ // title: '微信登录授权失败',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // uni.getProvider({
|
|
|
+ // service: 'oauth',
|
|
|
+ // success: (res) => {
|
|
|
+ // console.log('success', res, res.provider)
|
|
|
+ // if (~res.provider.indexOf('weixin')) {
|
|
|
+ // console.log('res.provider',~res.provider, ~res.provider.indexOf('weixin'))
|
|
|
+ // console.log('2333')
|
|
|
+ // } else {
|
|
|
+ // console.log('请先安装微信或升级版本')
|
|
|
+ // that.$refs.uTips.show({
|
|
|
+ // title: '请先安装微信或升级版本',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ console.log('app end')
|
|
|
+ },
|
|
|
+ //#endif
|
|
|
+
|
|
|
// 发请求获取个人数据
|
|
|
getUserInfo() {
|
|
|
NET.request(API.WxLogin, {
|
|
@@ -405,6 +420,7 @@
|
|
|
line-height: 36px;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+
|
|
|
.authorize-tip {
|
|
|
width: 220px;
|
|
|
height: 20px;
|
|
@@ -424,6 +440,7 @@
|
|
|
font-size: 12px;
|
|
|
font-family: PingFang SC;
|
|
|
color: #FEFEFE;
|
|
|
+
|
|
|
.underline {
|
|
|
text-decoration: underline;
|
|
|
}
|
|
@@ -434,7 +451,7 @@
|
|
|
padding: 12px;
|
|
|
|
|
|
.scroll {
|
|
|
- height: calc( 100% - 40px - 16px );
|
|
|
+ height: calc(100% - 40px - 16px);
|
|
|
}
|
|
|
|
|
|
.confrim-btn {
|