<template>
  <u-navbar
      :title="title"
      :auto-back="true"
      left-icon-size="40rpx"
      :safe-area-inset-top="true"
      :placeholder="true"
      bgColor="#fff"
      fixed
  ></u-navbar>
  <u-image :src="staticImage.fxxGuide1" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="checkLogin" :src="staticImage.fxxGuide2" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image :src="staticImage.fxxGuide3" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="navTo('/pages/Line/index',true,true)" :src="staticImage.fxxGuide4" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image :src="staticImage.fxxGuide5" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="navTo('/pages/Pages/plan?scroll=#cron')" :src="staticImage.fxxGuide6" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image :src="staticImage.fxxGuide7" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="redirtTo('/pages/Index/index?footCheck=shop&tabCheck=room',true,true)" :src="staticImage.fxxGuide8" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="navTo('/pages/Service/index',true)" :src="staticImage.fxxGuide9" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="redirtTo('/pages/Index/index?footCheck=shop&tabCheck=item',true)" :src="staticImage.fxxGuide10" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image @click="showNotDone()" :src="staticImage.fxxGuide11" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <u-image :src="staticImage.fxxGuide12" :lazy-load="true" width="100%" height="auto" mode="widthFix"></u-image>
  <uv-popup ref="notDone" round="20" :safeAreaInsetBottom="false">
    <view class="not-done-container" style="padding:0 100rpx;">
      <view class="not-done-icon">
        <u-image mode="widthFix" height="400" width="400" :src="staticImage.popIcon"></u-image>
      </view>
      <view class="not-done-title" style="margin-bottom:74rpx;">
        <u-text :text="notDoneContent" align="center" color="#020B18" size="28"></u-text>
      </view>
      <view class="not-done-btn" style="margin-bottom:60rpx;">
        <u-button
            text="确定"
            color="#FF9545"
            shape="circle"
            custom-style="color:#020B18;font-size:36rpx;height:80rpx;max-width:320rpx;"
            @click="this.$refs.notDone.close();"
        ></u-button>
      </view>
    </view>
  </uv-popup>
</template>

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

export default {
  components: {
    MzSubsection
  },
  data() {
    return {
      notDoneContent:'暂未开启，敬请期待',
      // 或者如下，也可以配置keyName参数修改对象键名
      // list: [{name: '未付款'}, {name: '待评价'}, {name: '已付款'}],
      current: 1,
      title: '顾问认证',
      loading: true,
      staticImage: {
        popIcon:imghost+ '/not-done-icon.png',
        bg: imghost + '/BG.png',
        newIcon: imghost + '/new-icon.png',
        fxxLogo: imghost + '/fxx-logo.png',
        fxxDone: imghost + '/fxx-done.png',
        fxx1: imghost + '/fxx-1.png',
        fxxGuide: imghost + '/fxx-guide.png',
        fxxGuide1: imghost + '/fxx-bk1.png',
        fxxGuide2: imghost + '/fxx-bk2.png',
        fxxGuide3: imghost + '/fxx-bk3.png',
        fxxGuide4: imghost + '/fxx-bk4.png',
        fxxGuide5: imghost + '/fxx-bk5.png',
        fxxGuide6: imghost + '/fxx-bk6.png',
        fxxGuide7: imghost + '/fxx-bk7.png',
        fxxGuide8: imghost + '/fxx-bk8.png',
        fxxGuide9: imghost + '/fxx-bk9.png',
        fxxGuide10: imghost + '/fxx-bk10.png',
        fxxGuide11: imghost + '/fxx-bk11.png',
        fxxGuide12: imghost + '/fxx-bk12.png',
      },
      isTop: false,
      size: {
        height: 500,
      }
    }
  },
  onLoad() {

  },
  computed: {},
  methods: {
    showNotDone(){
      this.notDoneContent = '暂未开启，敬请期待';
      this.$refs.notDone.open('center');
    },
    checkLogin(){
      if(uni.getStorageSync('user')){
        this.notDoneContent = '您已登录,无需再次登录';
        this.$refs.notDone.open('center');
        // uni.showToast({'title':'您已登录,无需再次登录'})
      }else{
        this.navTo('/pages/Login/index');
      }
    },
    navTo(url,token = false,fxx = false) {
      if(token){
        if(uni.getStorageSync('token')){
          let user = uni.getStorageSync('user');

          if(user.fxx.length === 0 && fxx){
            uni.navigateTo({
              url: '/pages/Authentication/index'
            })
          }else{
            uni.navigateTo({
              url: url
            })
          }
        }else{
          uni.navigateTo({
            url: '/pages/Login/index'
          })
        }
      }else{
        uni.navigateTo({
          url: url
        })
      }
    },
    redirtTo(url,token = false,fxx = false) {
      if(token){
        if(uni.getStorageSync('token')){
          let user = uni.getStorageSync('user');
          if(user.fxx.length === 0 && fxx){
            uni.navigateTo({
              url: '/pages/Authentication/index'
            })
          }else {
            uni.redirectTo({
              url: url
            })
          }
        }else{
          uni.navigateTo({
            url: '/pages/Login/index'
          })
        }
      }else{
        uni.redirectTo({
          url: url
        })
      }
    },
  },
  onPageScroll(res) {
    if (res.scrollTop <= 20) {
      uni.$emit('isTop', true);
    } else {
      uni.$emit('isTop', false);
    }
  },
  created() {
    // this.listHeight();
    // this.pagePadding = (api.navHeight().navPaddingTop +
    // 	api.navHeight().navHeight + (api.navHeight().headerPadding * 2))
  }
}
</script>

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