<template>
    <div class="app-container">
      <van-row style="background: url('../../../static/images/onlineHome/bg1.jpg') 50% ;height: 220px;border-radius:0 0 50px 50px;">
        <van-cell center  style="padding-top: 50px;background: none">
          <template #title>
            <p style="color: #fff;margin-left: 10px;font-size: 20px">{{nickName}}</p>
          </template>
          <template #label>
            <p style="color:#fff;margin-left: 10px">{{deptName}}</p>
          </template>
          <template  #right-icon>
            <van-image width="62"
                       height="62"
                       style="border-radius: 10px;overflow: hidden;margin-right: 8px"
                       :src="avatar">

            </van-image>
          </template>
        </van-cell>
      </van-row>
      <van-cell-group style="width: 96%;margin:-50px 2% 2% 2%;border-radius: 6px;overflow: hidden;padding-top: 20px;padding-bottom: 20px;box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);">
<!--        <van-cell title="画像（个人/农户）" is-link :to="{path:'personalPicture',params:{id:'1'}}">-->
<!--          <template #icon>-->
<!--            <van-image-->
<!--              fit="contain"-->
<!--              height="22"-->
<!--              style="margin-right: 15px"-->
<!--              src="../../../static/images/onlineHome/myIcon1.png"-->
<!--            />-->
<!--          </template>-->
<!--        </van-cell>-->
        <van-cell title="我的业务" is-link to="done">
          <template #icon>
            <van-image
              fit="contain"
              height="22"
              style="margin-right: 15px"
              src="../../../static/images/onlineHome/myIcon2.png"
            />
          </template>
        </van-cell>
<!--        <van-cell title="通讯录" is-link to="mailList">-->
<!--          <template #icon>-->
<!--            <van-image-->
<!--              fit="contain"-->
<!--              height="22"-->
<!--              style="margin-right: 15px"-->
<!--              src="../../../static/images/onlineHome/myIcon5.png"-->
<!--            />-->
<!--          </template>-->
<!--        </van-cell>-->
<!--        <van-cell title="生活缴费" is-link to="livePay">-->
<!--          <template #icon>-->
<!--            <van-image-->
<!--              fit="contain"-->
<!--              height="22"-->
<!--              style="margin-right: 15px"-->
<!--              src="../../../static/images/onlineHome/myIcon4.png"-->
<!--            />-->
<!--          </template>-->
<!--        </van-cell>-->
<!--        <van-cell title="投诉" is-link to="advice">-->
<!--          <template #icon>-->
<!--            <van-image-->
<!--              fit="contain"-->
<!--              height="22"-->
<!--              style="margin-right: 15px"-->
<!--              src="../../../static/images/onlineHome/myIcon6.png"-->
<!--            />-->
<!--          </template>-->
<!--        </van-cell>-->
        <van-cell title="修改密码" is-link to="password">
          <template #icon>
            <van-image
              fit="contain"
              height="22"
              style="margin-right: 15px"
              src="../../../static/images/onlineHome/myIcon7.png"
            />
          </template>
        </van-cell>
        <van-cell title="退出登录" is-link @click="logout">
          <template #icon>
            <van-image
              fit="contain"
              height="22"
              style="margin-right: 15px"
              src="../../../static/images/onlineHome/myIcon8.png"
            />
          </template>
        </van-cell>
      </van-cell-group>
      <onlineHomeIndex></onlineHomeIndex>
    </div>
</template>

<script>
  import onlineHomeIndex from "../onlineHomeIndex";
  import {getInfo, logout} from "../../api/login";
  export default {
      components: {
        onlineHomeIndex
      },
        name: "my",
      data() {
        return {
          list: [],
          loading: false,
          finished: false,
          nickName:"",
          deptName:"",
          userId:"",
          avatar:"",
        };
      },
      created() {
        getInfo().then(response => {
          this.nickName = response.user.nickName
          this.deptName = response.user.dept.deptName
          this.userId = response.user.userId
          this.avatar = this.$store.getters.baseRoutingUrl + response.user.avatar
        });
      },
      methods: {
        logout(){
          /*logout().then(res => {
            this.$router.push({path:"../onlineHomeLogin"})
          })*/
          this.$store.dispatch('LogOut').then(() => {
            this.$router.push({path:"../zjdLogin"})
          });
        }
      },
    }
</script>

<style scoped>
>>>  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 22px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }
</style>
