|
|
@ -1,13 +1,14 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<image mode="widthFix" class="width90 mart20" src="../../static/img/login.png"></image> |
|
|
|
<image mode="widthFix" class="width90 mart20" v-if="!user" :src="imagewxUrl+imgadres"></image> |
|
|
|
|
|
|
|
<image mode="widthFix" class="width90 mart20" v-if="!user.phone && user" :src="imagewxUrl+imgadres1"></image> |
|
|
|
<!-- #ifdef MP --> |
|
|
|
<!-- #ifdef MP --> |
|
|
|
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user" @click="getuserinfo"> |
|
|
|
<view class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user" @click="getuserinfo"> |
|
|
|
授权并登录</view> |
|
|
|
授权并登录</view> |
|
|
|
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="!user.phone && user" |
|
|
|
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone && user" |
|
|
|
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button> |
|
|
|
open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button> |
|
|
|
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user" |
|
|
|
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" v-if="user.phone && user" |
|
|
|
@click="reqmessage">授权获取消息通知</button> |
|
|
|
@click="reqmessage">授权获取消息通知</button> --> |
|
|
|
<!-- #endif --> |
|
|
|
<!-- #endif --> |
|
|
|
<!-- #ifdef H5 --> |
|
|
|
<!-- #ifdef H5 --> |
|
|
|
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" |
|
|
|
<button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16" |
|
|
@ -25,9 +26,15 @@ |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
user: '' |
|
|
|
user: '', |
|
|
|
|
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
|
|
|
|
imgadres: 'login.png', |
|
|
|
|
|
|
|
imgadres1: 'loginphone.png', |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad() { |
|
|
|
|
|
|
|
this.user = app.globalData.userInfo; |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getuserinfo() { |
|
|
|
getuserinfo() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
@ -57,7 +64,10 @@ |
|
|
|
key: "token", |
|
|
|
key: "token", |
|
|
|
data: res.return_data.uniqueCode |
|
|
|
data: res.return_data.uniqueCode |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (res.return_data.object.highUser.phone) {} |
|
|
|
if (res.return_data.object.highUser.phone) { |
|
|
|
|
|
|
|
uni.navigateBack({ |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg |
|
|
|
title: res.return_msg |
|
|
@ -75,17 +85,17 @@ |
|
|
|
that.isShowAuth = false |
|
|
|
that.isShowAuth = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
//获取订阅号授权 |
|
|
|
//获取订阅号授权 |
|
|
|
reqmessage() { |
|
|
|
// reqmessage() { |
|
|
|
uni.requestSubscribeMessage({ |
|
|
|
// uni.requestSubscribeMessage({ |
|
|
|
tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'], |
|
|
|
// tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'], |
|
|
|
success(res) { |
|
|
|
// success(res) { |
|
|
|
uni.navigateBack({}) |
|
|
|
// uni.navigateBack({}) |
|
|
|
}, |
|
|
|
// }, |
|
|
|
fail: (res) => { |
|
|
|
// fail: (res) => { |
|
|
|
uni.navigateBack({}) |
|
|
|
// uni.navigateBack({}) |
|
|
|
} |
|
|
|
// } |
|
|
|
}) |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// }, |
|
|
|
// 微信获取手机号 |
|
|
|
// 微信获取手机号 |
|
|
|
getPhoneNumber(PhoneNumber) { |
|
|
|
getPhoneNumber(PhoneNumber) { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
@ -100,6 +110,8 @@ |
|
|
|
icon: 'none', |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
uni.navigateBack({ |
|
|
|
|
|
|
|
}) |
|
|
|
this.user = res.return_data.object.highUser; |
|
|
|
this.user = res.return_data.object.highUser; |
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
app.globalData.userInfo = res.return_data |
|
|
|
.object |
|
|
|
.object |
|
|
|