<template>
  <view class="body-background"></view>
  <u-navbar
      :title="title"
      :auto-back="true"
      left-icon-size="40rpx"
      :safe-area-inset-top="true"
      :placeholder="true"
      bgColor="transparent"
  ></u-navbar>
  <view class="fxx-container row">
    <view class="fxx-logo">
      <u-image
          mode="widthFix"
          width="400"
          height="161.37"
          :src="staticImage.fxxLogo"
      ></u-image>
    </view>
    <view class="fxx-content">
      <view class="content-title">
        风行侠认证流程
      </view>
      <view class="content-main">
        1.认证，是一种信用保证形式。
        <view class="br"></view>
        2.按照国际标准化组织（ISO）和国际电工委员会（IEC）的定义
       <view class="br"></view>
        3.是指由国家认可的认证机构证明一个组织的产品、服务、管理体系符合相关标准、技术规范（TS）或其强制性要求的合格评定活动。
       <view class="br"></view>
        <u-image
            mode="widthFix"
            width="100%"
            height="auto"
            :src="staticImage.fxx1"
        ></u-image>
        <u-button
            type="primary"
            text="立即认证"
            shape="circle"
            :custom-style="{
              color:'#020B18',
              backgroundColor:'#FF9545',
              border:'none',
              fontSize:'36',
              fontWeight:'400',
              marginTop:'106rpx'
            }"
            @click="goForm"
        ></u-button>
      </view>
    </view>
  </view>
  <u-modal :show="modalShow" content="您的资料还未完善,确认前往完善?" @confirm="navTo('/pages/User/edit')" @close="navTo('/pages/Index/edit')" @cancel="navTo('/pages/Index/edit')"></u-modal>
</template>

<script>
import {
  imghost
} from '@/config/host.js'
import MzSubsection from '@/components/MzSubsection/Index.vue';
import api from '@/utils/functions.js';
import {userExtends} from "@/api/user";

export default {
  components: {
    MzSubsection
  },
  data() {
    return {
      modalShow:false,
      list: [{
        name: '最新资讯'
      }, {
        name: '表彰评优'
      }, {
        name: '活动回顾'
      }],
      // 或者如下，也可以配置keyName参数修改对象键名
      // list: [{name: '未付款'}, {name: '待评价'}, {name: '已付款'}],
      current: 1,
      title: '丰行侠认证',
      loading: true,
      staticImage: {
        bg: imghost + '/BG.png',
        newIcon: imghost + '/new-icon.png',
        fxxLogo: imghost + '/fxx-logo.png',
        fxx1: imghost + '/fxx-1.png',
      },
      user: {
        avatar: imghost + '/banner.png',
        nickname: '清晨的风',
        coupons: 221,
        id: 88685,
      },
      isTop: false,
      lists: [
        {
          id: 1,
          thumb: imghost + '/new-1.png',
          title: '全市公安机关夏季治安打击整治“彭安行动”新闻发布会召开',
          desc: '需要您带一点猫砂上门，谢谢',
          time: '2023/06/16',
          is_new: true
        }, {
          id: 2,
          thumb: imghost + '/new-2.png',
          title: '全市公安机关夏季治安打击整治“彭安行动”新闻发布会召开',
          desc: '需要您带一点猫砂上门，谢谢',
          time: '2023/06/16',
          is_new: true
        }, {
          id: 3,
          thumb: imghost + '/new-3.png',
          title: '全市公安机关夏季治安打击整治“彭安行动”111开',
          desc: '需要您带一点猫砂上门，谢谢',
          time: '2023/06/16',
          is_new: false
        },
      ],
      size: {
        height: 500,
      },
      userInfo:{},
    }
  },
  onLoad() {

  },
  computed: {
    api() {
      return api
    },
    sectionStyle() {
      const style = {};
      style.padding = '0 26rpx';
      style.position = 'sticky';
      style.zIndex = '9999';
      style.top = api.navHeight().systemBarHeight + 'px'
      return style;
    },
  },
  methods: {
    chatDetail(item) {
      wx.navigateTo({
        url: '/pages/ChatDetail/index?id=' + item.id
      });
    },
    checkSection(index) {
      this.current = index;
    },
    scrollToLower() {

    },
    navTo(url) {
      wx.navigateTo({
        url: url
      })
    },
    goForm(){
      // if(!this.userInfo?.phone
      //     || !this.userInfo?.name
      //     || !this.userInfo?.community
      //     || !this.userInfo?.street
      //     || !this.userInfo?.company
      //     || !this.userInfo?.position
      //     || !this.userInfo?.id_card
      // ){
      //   this.modalShow = true;
      // }else{
        this.navTo('/pages/Authentication/form');
      // }
    },
    getUserExtend() {
      userExtends().then((res) => {
        if(res.code === 200) {
          this.userInfo = res.data;
          uni.setStorageSync('user', res.data);
          this.$store.commit('userInfo', res.data);
        }
        // this.modalShow = !this.userInfo?.phone
        //     || !this.userInfo?.name
        //     || !this.userInfo?.community
        //     || !this.userInfo?.street
        //     || !this.userInfo?.company
        //     || !this.userInfo?.position
        //     || !this.userInfo?.id_card;
      });
    }
  },
  onPageScroll(res) {
    if (res.scrollTop <= 20) {
      uni.$emit('isTop', true);
    } else {
      uni.$emit('isTop', false);
    }
  },
  onShow(){
    let token = uni.getStorageSync('token');
    if (token) {
      this.getUserExtend();
    }

  },
  created() {
    // this.pagePadding = (api.navHeight().navPaddingTop +
    // 	api.navHeight().navHeight + (api.navHeight().headerPadding * 2))
  }
}
</script>

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