<template>
  <view class="nine-content-001">
    <!-- 功能列表 -->
    <view class="nine-nav-001">
      <view class="nine-nav-001-item mt10">
        <view class="nine-nav-001-item-left">
          <text class="nine-nav-001-item-left-text">公告中心</text>
        </view>
        <view class="nine-nav-001-item-right">      
          <image class="nine-nav-001-item-right-image" mode="scaleToFill" src="/static/image/user/cc.png">
          </image>
        </view>
      </view>
      <view v-if="userInfo.userId" class="nine-nav-001-item mt10">
        <view class="nine-nav-001-item-left">
          <text class="nine-nav-001-item-left-text">修改密码</text>
        </view>
        <view class="nine-nav-001-item-right">      
          <image class="nine-nav-001-item-right-image" mode="scaleToFill" src="/static/image/user/cc.png">
          </image>
        </view>
      </view>
      <view class="nine-nav-001-item mt10" @click="openUrl('/pages/setting/contact')">
        <view class="nine-nav-001-item-left">
          <text class="nine-nav-001-item-left-text">联系我们</text>
        </view>
        <view class="nine-nav-001-item-right">      
          <image class="nine-nav-001-item-right-image" mode="scaleToFill" src="/static/image/user/cc.png">
          </image>
        </view>
      </view>
      <view class="nine-nav-001-item">
        <view class="nine-nav-001-item-left">
          <text class="nine-nav-001-item-left-text">清空缓存</text>
        </view>
        <view class="nine-nav-001-item-right">      
          <image class="nine-nav-001-item-right-image" mode="scaleToFill" src="/static/image/user/cc.png">
          </image>
        </view>
      </view>
      <view class="nine-nav-001-item" @click="openUrl('/pages/setting/about')">
        <view class="nine-nav-001-item-left">
          <text class="nine-nav-001-item-left-text">关于</text>
        </view>
        <view class="nine-nav-001-item-right">      
          <image class="nine-nav-001-item-right-image" mode="scaleToFill" src="/static/image/user/cc.png">
          </image>
        </view>
      </view>
      <view v-if="userInfo.userId" class="nine-btn-login-out-001 mt50" @click="logoutClick">
        退出登录
      </view>
    </view>
  </view>
</template>

<script>
  import store from '@/store'
  export default {
    data() {
      return {
        userInfo: {},
      };
    },  
    onShow(){
      this.userInfo = this.$store.state.user.userInfo;
    },
    methods: {
      logoutClick() {
        this.$store.dispatch('LogOut').then(res => {
          this.reLaunchLogin();
        })
      }
    }
  };
</script>
