<script>
import Request from '@/common/request'
import ImagesConstant from "@/common/ImagesConstant";

let request = new Request()
export default {
  name: "settings",
  computed: {
    ImagesConstant() {
      return ImagesConstant
    }
  },
  data() {
    return {
      itemList: [
        {
          title: '志愿卡说明',
          url: '/pages/zyb/other/volunteerCardDesc'
        },
        /*{
          title: '隐私声明',
          url: ''
        },*/
        {
          title: '免责声明',
          url: '/pages/zyb/other/disclaimer'
        },
        {
          title: '用户协议',
          url: '/pages/zyb/other/userAgreement'
        },
        // #ifdef MP-WEIXIN
        {
          title: '联系我们',
          url: '/pages/zyb/other/web-view'
        },
        // #endif

        /*{
          title: '注销账号',
          method:''
        },*/
      ]
    }
  },
  onShow(){
  },
  onLoad() {
  },
  methods: {
    goto(e) {
      uni.navigateTo({
        url: e
      })
    },
    /*退出*/
    logOut(){
      uni.showModal({
        title:'提示',
        content: '确认要退出已登录账号吗?',
        confirmText: '确定',
        cancelText: '取消',
        success:function (res){
          if (res.confirm) {
            uni.clearStorageSync()
            uni.reLaunch({
              url: '/pages/zyb/home'
            })
          }
        }
      });
    },
  }
}
</script>

<template>
  <!--头部-->
  <view class="body">
    <!--剩余选项-->
    <view class="trow1">
      <view class="uni-flex flex" v-for="(item,index) in itemList" :key="index">
        <view class="flex-item-10" @click="item.url?goto(item.url):null">
          <view style="height: 50rpx" :class="index===itemList.length-1?'uni-flex flex trow1-child-last':'uni-flex flex trow1-child'">
            <view class="flex-item-9" style="margin-left: 50rpx;line-height: 50rpx">
              <text>{{ item.title }}</text>
            </view>
            <view class="flex-item-1">
              <image :src="ImagesConstant.keyboard.arrowRight" style="margin-top: 5rpx;width: 40rpx;height: 40rpx"/>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!---->
    <view class="uni-flex flex">
      <view class="flex-item-10" style="text-align: center;padding: 30rpx">
        <button type="primary" class="redBtn" plain="true" @click="logOut">退出登录</button>
      </view>
    </view>
  </view>
</template>

<style scoped lang="scss">

.body {
  border-top:3rpx solid #f6f6f6;
  background-color: #f4f5f7;
  min-height: 880rpx;
  /*单行*/
  .trow1 {
    background-color: #ffffff;
    border-radius: 15rpx;

    .trow1-center {
      font-size: 24rpx;
      margin: 10rpx 0 0 20rpx;
      border-left: 5rpx solid #f1b481;
    }

    .trow1-child {
      margin-top: 20rpx;
      padding-bottom: 20rpx;
      border-bottom: 2rpx solid #f8f8f8;
    }

    .trow1-child-last {
      margin-top: 20rpx;
      padding-bottom: 20rpx;
      border-bottom: none;
    }
  }
}

.redBtn{
  transition: 0.3s;
  background-color: #fdf0f0 !important;
  border: 3rpx solid #f99393 !important;
  color:red !important;
}
.redBtn:active{
  transition: 0.3s;
  background-color: #d86162 !important;
  color:white !important;
}
</style>
