<template>
  <view>
    <view class="mine" v-if="token">
      <image class="bg" src="/static/pic-wd-bg@2x.png" />
      <view class="content">
        <view class="content_detail">
          <!-- 头像信息 -->
          <view class="head_box">
            <view class="head">
              <image mode="aspectFill" class="head_img" :src="userDetail.avatarUrl" />
            </view>
            <view class="name">{{ userDetail.nickName }}</view>
            <view class="integral_msg" bindtap="myIntegral">
              <view class="msg_left">
                <image mode="aspectFill" class="integral_icon" src="/static/icon/ic_jifen1@2x.png" />
                <view class="number">{{ userDetail.integral }}</view>
              </view>
              <view class="msg_right">
                <view class="withdrawal">提现</view>
                <image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right@2x.png" />
              </view>
            </view>
          </view>

          <view class="my_item_box">
            <!-- 我的随手拍 -->
            <view class="my_items" bindtap="myPhoto">
              <view class="my_item_left">
                <image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_ssp@2x.png" />
                <view class="item_name">我的随手拍</view>
              </view>
              <image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right1@2x.png" />
            </view>
            <!-- 关于我们 -->
            <view class="my_items" bindtap="about">
              <view class="my_item_left">
                <image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_gy@2x.png" />
                <view class="item_name">关于我们</view>
              </view>
              <image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right1@2x.png" />
            </view>
            <!-- 注销登录 -->
            <view class="my_items" bindtap="tailor">
              <view class="my_item_left">
                <image mode="aspectFill" class="task_icon" src="/static/icon/ic_wd_srdz@2x.png" />
                <view class="item_name">注销登录</view>
              </view>
              <image mode="aspectFill" class="arrow_right" src="/static/icon/arrow_right1@2x.png" />
            </view>
          </view>
        </view>
      </view>
    </view>

    <view class="unauthorized" v-else>
      <view class="unauthorized_box" v-if="canIUseGetUserProfile">
        <view class="unauthorized_tip">未授权登录</view>
        <button class="unauthorized_btn" bindtap="getUserProfile">去授权</button>
      </view>
      <view class="unauthorized_box" v-else>
        <view class="unauthorized_tip">未授权登录</view>
        <button class="unauthorized_btn" bindtap="getUserProfile">去授权</button>
      </view>
    </view>
  </view>
</template>

<script>
import { userDetail } from '@/pages/mine/mock';

export default {
  data() {
    return {
      token: null,
      canIUseGetUserProfile: false,
      userDetail,
    };
  },
  methods: {},
};
</script>

<style scoped lang="scss">
@import 'index.scss';
</style>
