@@ -1,25 +1,27 @@
|
||||
<template>
|
||||
<view
|
||||
style="height: 100vh;display: flex;flex-direction: column;align-items: center;justify-content: center;box-sizing: border-box;">
|
||||
<button class="avatar-wrapper" open-type="chooseAvatar" @tap="onChooseAvatar">
|
||||
<image class="avatar" :src="avatarUrl"></image>
|
||||
</button>
|
||||
<input type="nickname" class="weui-input" placeholder="请输入昵称" />
|
||||
|
||||
<button type="primary" block open-type="getUserInfo" @getuserinfo="appLoginWx">
|
||||
微信一键登录
|
||||
</button>
|
||||
<button v-show="showPhone" type="primary" block open-type="getPhoneNumber" @getphonenumber="getPhone">
|
||||
授权电话
|
||||
</button>
|
||||
style="height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;box-sizing:border-box;">
|
||||
<ywx-auth-model></ywx-auth-model>
|
||||
|
||||
<view style="padding: 35rpx;">
|
||||
<button type="primary" block open-type="getUserInfo" @getuserinfo="appLoginWx">
|
||||
微信一键登录
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//1.导入组件(这步属于传统vue规范,但在uni-app的easycom下可以省略这步)
|
||||
import ywxAuthModel from "@/components/ywx-auth-model/ywx-auth-model.vue";
|
||||
|
||||
export default {
|
||||
//2.注册组件(这步属于传统vue规范,但在uni-app的easycom下可以省略这步)
|
||||
components: {
|
||||
ywxAuthModel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
avatarUrl: 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0',
|
||||
openid: "",
|
||||
loginstate: "0",
|
||||
openid: "",
|
||||
@@ -32,13 +34,6 @@
|
||||
},
|
||||
onLoad: function() {},
|
||||
methods: {
|
||||
onChooseAvatar(e) {
|
||||
console.log(e)
|
||||
const {
|
||||
avatarUrl
|
||||
} = e.detail
|
||||
this.avatarUrl = avatarUrl
|
||||
},
|
||||
// 授权获取微信用户信息
|
||||
appLoginWx(res) {
|
||||
console.log(res)
|
||||
|
||||
Reference in New Issue
Block a user