123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view class="container">
- <u-navbar title="个人中心" @rightClick="rightClick" :autoBack="true">
- </u-navbar>
- <view class="box" v-if="userInfo">
- <view class="">
- 手机号:{{userInfo.mobile}}
- </view>
- <view class="">
- 唯一身份标识:{{userInfo.yige_open_id}}
- </view>
- <view class="">
- 姓名:{{userInfo.real_name}}
- </view>
- <view class="">
- 身份证号:{{userInfo.identity_card}}
- </view>
- <view class="">
- 昵称:{{userInfo.nickname}}
- </view>
- <view class="">
- 头像{{userInfo.head_photo}}
- </view>
- </view>
- </view>
- </template>
- <script>
- import uniWeb from '../static/uni.webview.1.5.4.js'
- export default {
- data() {
- return {
- deviceType: "phone",
- loginType: 'account', //qywx account,
- form: {
- username: "",
- password: ""
- },
- yigeauth: false,
- userInfo: null
- }
- },
- onLoad(options) {
- this.yigeauth = options.yigeauth === 'true' ? true : false
- /**
- * 判断是否需要授权
- */
- if (this.yigeauth) {
- // 需要授权
- this.getYigeauth()
- } else if (options.yigeopenid) {
- // 如果已经授权,并且返回了 openid,则通过 openid 去获取用户信息
- this.getUerByOpenId(options.yigeopenid)
- }
- },
- methods: {
- /*
- *
- * yigeauth
- *
- */
- getYigeauth() {
- this.$http.get('/auth/build_auth').then(res => {
- try {
- uniWeb.webView.postMessage({
- data: res.data
- })
- } catch (err) {
- console.log('err==>', err)
- }
- })
- },
- getUerByOpenId(yigeopenid) {
- this.$http.post('/auth/getUserByOpenId', {
- yigeOpenId: yigeopenid
- }).then(res => {
- if (res.code == 200) {
- // 获取用户信息
- this.userInfo = res.data
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .container {
- width: 100vw;
- height: 100vh;
- overflow: hidden;
- // background: url('../static/img/loginBg.png');
- background-size: contain;
- position: relative;
- .box {
- padding: 30rpx;
- padding-top: 200rpx;
- word-break: break-all;
- }
- }
- </style>
|