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