<template>
    <view class="container">
        <view class="userinfo">
            <navigator class target url="../changeAvatar/index" hover-class="hcb" open-type="navigate">
                <view class="useravatar" style="height: unset; padding: 20px 0px">
                    <view class="fw500">头像</view>
                    <view>
                        <!-- <view>
            <image class src='{{userInfo.imgSrc}}' mode='aspectFit|aspectFill|widthFix' lazy-load='false' binderror bindload style='border-radius:999px'></image>
          </view> -->
                        <block v-if="userInfo.imgSrc != '' && userInfo.imgSrc != null && userInfo.imgSrc != 'null'">
                            <image :src="userInfo.imgSrc" style="border-radius: 999px" class="show-image" mode="aspectFill"></image>
                        </block>
                        <block v-else>
                            <image
                                style="border-radius: 999px"
                                src="https://matripe-cms.oss-cn-beijing.aliyuncs.com/1shoudan/defaultAva.svg"
                                class="show-image"
                                mode="aspectFill"
                            ></image>
                        </block>
                        <view class="iconfont icon-gengduo11"></view>
                    </view>
                </view>
            </navigator>

            <navigator class target url="../userName/index" hover-class="hcb" open-type="navigate">
                <view class="userName">
                    <view class="fw500">用户名</view>
                    <view>
                        <view>{{ userInfo.userName || '暂无' }}</view>
                        <view class="iconfont icon-gengduo11"></view>
                    </view>
                </view>
            </navigator>

            <navigator class target url="../changeGender/index" hover-class="hcb" open-type="navigate">
                <view class="gender">
                    <view class="fw500">性别</view>
                    <view>
                        <view v-if="userInfo.sex == 1">男</view>
                        <view v-if="userInfo.sex == 2">女</view>
                        <view v-if="userInfo.sex == 0">未知</view>
                        <view class="iconfont icon-gengduo11"></view>
                    </view>
                </view>
            </navigator>

            <navigator class target :url="'../userTel/index?tel=' + userInfo.tel" hover-class="hcb" open-type="navigate">
                <view class="phone" style="border-bottom: 0">
                    <view class="fw500">手机号</view>
                    <view>
                        <view class="c9">{{ userInfo.tel || '暂无' }}</view>
                        <view class="iconfont icon-gengduo11"></view>
                    </view>
                </view>
            </navigator>
        </view>
        <!-- <navigator class='bgf br8' url='/pages/wxNickname/index?nickName={{userInfo.nickName}}' hover-class='hcb' open-type='navigate'>
    <view class='wxnickname mt_10 br_8'>
      <view class="fw500">绑定微信</view>
      <view>
        <view class='c9'>{{userInfo.nickName}}</view>
        <view class='iconfont icon-gengduo11'></view>
      </view>
    </view>
  </navigator> -->
        <!-- wx:if='{{userInfo.idauth == 0}}' -->
        <navigator class="bgf br8" url="../realName1/index" hover-class="hcb" open-type="navigate" v-if="userInfo.idauth == 0">
            <view class="realname mt_10 br_8">
                <view class="fw500">实名认证</view>
                <view>
                    <view class="c9">去认证</view>
                    <view class="iconfont icon-gengduo11"></view>
                </view>
            </view>
        </navigator>
        <navigator class="bgf br8" :url="'../trueName/index?realName=' + userInfo.realName" open-type="navigate" v-else>
            <view class="realname mt_10 br_8 bgf" hover-class="hcb">
                <view class="fw500">
                    实名认证
                    <view class="iconfont icon-yirenzheng color-f40 fw400 f18 ml4" style="line-height: 1"></view>
                </view>
                <view>
                    <view class="display-flex c9" style="align-items: center">{{ userInfo.realName }}</view>
                    <view class="iconfont icon-gengduo11 c9"></view>
                </view>
            </view>
        </navigator>
    </view>
</template>

<script>
// pages/userdetail/index.js
let app = getApp();
export default {
    data() {
        return {
            userInfo: {
                imgSrc: '',
                userName: '',
                sex: 0,
                tel: '',
                idauth: 0,
                realName: ''
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {},
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {
        this.setData({
            userInfo: app.globalData.loginUserInfo.user
        });
    },
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    methods: {
        /**
         * 用户点击右上角分享
         */
        onShareAppMessage1: function () {}
    }
};
</script>
<style>
@import './index.css';
</style>
