<template>
  <view class="container">
    <view class="main-out-box">
      <view class="main-inner-box">
        <u-cell-group :border="false">
          <u-cell size="large" :border="false" icon="account-fill" title="个人信息" isLink
            url="/PageMine/setting/personInformation" />
          <!-- <u-cell size="large" :border="false" icon="fingerprint" title="安全中心" isLink
            url="/pages/client/clientUser/mine/setting/personInfo" /> -->
          <u-cell size="large" :border="false" icon="github-circle-fill" title="关于我们" isLink
            url="/PageMine/setting/aboutUs" />
          <u-cell size="large" :border="false" icon="file-text-fill" title="用户协议" isLink
            url="/pages/webview/index?target=http://8.137.122.65:88/用户协议.html" />
          <u-cell size="large" :border="false" icon="file-text" title="隐私政策" isLink
            url="/pages/webview/index?target=http://8.137.122.65:88/隐私政策.html" />
          <u-cell icon="integral-fill" title="版本信息" value="V0.0.1" />
        </u-cell-group>
      </view>
    </view>

    <!-- <view class="policy-out-box">
      <view class="policy-inner-box">
        <u-cell-group :border="false">
          <u-cell size="large" :border="false" icon="level" title="切换身份" isLink @click="showSwitchDialog = true" />
        </u-cell-group>
      </view>
    </view> -->

    <u-modal :show="showSwitchDialog" :title="title" :content="content" @confirm="confirmSwitch"
      @cancel="showSwitchDialog = false" :showCancelButton="true"></u-modal>

    <view class="exit">
      <u-button type="info" shape="circle" text="注销账号" class="button" />
      <u-button type="primary" shape="circle" text="退出登录" @tap="logout" class="button" />
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        showSwitchDialog: false,
        title: '提醒',
        content: '您确定要从用户端切换到商家端吗?',
      };
    },

    methods: {
      confirmSwitch() {
        // this.showSwitchDialog = false;
        // this.$store.dispatch('SwitchIdentity','MERCHANT')
        // uni.navigateTo({
        //   url: '/pages/merchant/mine/index',
        // });
      },
      logout(){
        this.$store.dispatch('Logout').then(()=>{
          uni.navigateTo({
            url: `pages/login/login`,
          });
        })
      }
    },
  };
</script>

<style lang="scss" scoped>
  .container {
    min-height: 100vh;
    background-color: #efefef;

    .main-out-box {
      padding: 20rpx 16rpx;
      box-sizing: border-box;

      .main-inner-box {
        background-color: $uni-bg-color;
        border-radius: 20rpx;
      }
    }

    .policy-out-box {
      padding: 50rpx 16rpx;
      box-sizing: border-box;

      .policy-inner-box {
        background-color: $uni-bg-color;
        border-radius: 20rpx;
      }
    }
  }

  .exit {
    // display: flex;
    // justify-content: space-around;
    margin-top: 100rpx;
  }

  .button {
    width: 500rpx;
    margin-top: 45rpx;
  }

  ::v-deep .u-modal__title {
    padding-top: 15px;
  }
</style>
