<script>
import StaticConstant from "@/common/StaticConstant";
import ApiConstant from "@/common/ApiConstant";
import Request from '@/common/request'
import ImagesConstant from "@/common/ImagesConstant";
import {arrayIsNotEmpty} from "@/common/util";

let request = new Request()
// 缓存每页最多
const MAX_CACHE_DATA = 100;
// 缓存页签数量
const MAX_CACHE_PAGE = 3;

export default {
  name: "模拟填报",
  computed: {
    StaticConstant() {
      return StaticConstant
    },
    ImagesConstant() {
      return ImagesConstant
    }
  },
  data() {
    return {
      ///
      num: {kcj: 0, jwt: 0, nlq: 0, kbd: 0,},
      circle: {kcj: 0, jwt: 0, nlq: 0, kbd: 0,},//百分比
      modelVale: 0,
      topFlag: false,//显示回到顶部
      selectForm: {
        province:'',
        schoolName: '',
        paneName: '全部',
        batch: '提前批',
        rulesEnrollProbability:'',//录取方式
        tagsList:[],//院校标签
        addressList:[],//地区
        schoolNatureList:[],//办学类型
      },
      userInfo: {
        vipFlag: true
      },
      scoreInfo: {
        province: null,//省份
        cognitioPolyclinic: null,//科类
        professionalCategory: null,//报考方向
        culturalScore: null,//文化分
        professionalScore: null,//统考分
      },
      /*筛选项 参数 start*/
      defaultSelected: [],
      menuList: StaticConstant.fillVolunteerMenuData,
      /*筛选项 参数 end*/
      tabIndex: 0,
      scrollInto: "",
      newsList: [],
      cacheTab: [],
      tabBars: [{name: '本科提前批', id: '提前批'}, {name: '本科A段', id: '本科A段'}, {
        name: '本科B段',
        id: '本科B段'
      }, {name: '高职高专', id: '高职高专'}],
      recommendVolunteerList: [],//推荐志愿列表
      page: {
        current: 1,
        pageSize: 5,
        total: 0,
      },//分页结果
      filledVolunteer: {
        volunteerId: '',
        volunteerName: '',
        volunteerEarlyAdmissionList: [],//本科提前批
        volunteerUndergraduateAList: [],//本科A段
        volunteerUndergraduateBList: [],//本科B段
        volunteerJuniorCollegeList: [],//高职高专
        volunteerUndergraduateList: [],//体育本科
        volunteerMap: new Map()
      },//已填志愿信息
      years: StaticConstant.years,
      //
      status: 'more',
      statusTypes: [
        {
          value: 'more',
          text: '加载前',
          checked: true
        }, {
          value: 'loading',
          text: '加载中',
          checked: false
        }, {
          value: 'noMore',
          text: '没有更多',
          checked: false
        }
      ],
      contentText: {
        contentdown: '查看更多',
        contentrefresh: '加载中',
        contentnomore: '没有更多'
      },
    }
  },
  onShow(e) {
    this.userInfo = uni.getStorageSync('userInfo')
    this.clearData()
    this.getUserScore()
  },
  onLoad(e) {
    if (e.batch && e.volunteerId) {
      //从我的志愿 点击跳转而来
      this.selectForm.batch = e.batch;
      this.filledVolunteer.volunteerId = e.volunteerId;
      console.log(e)
    }
    setTimeout(() => {
      this.tabBars.forEach((tabBar) => {
        this.newsList.push({
          data: [],
          isLoading: false,
          refreshText: "",
          loadingText: '加载更多...'
        });
      });
    }, 350)
  },
  onReachBottom() {
    if (this.userInfo.vipFlag) {
      this.loadMore()
    }
  },
  methods: {
    onConfirm(e) {
      console.log('onConfirm')
      if(e.type ==='filter'){
        if (e.children) {
          for (let i = 0; i < e.children.length; i++) {
            if (e.children[i].title === '录取方式') {
                this.selectForm.rulesEnrollProbability =e.children[i].value
              if (this.selectForm.rulesEnrollProbability === null) {
                this.selectForm.rulesEnrollProbability = ''
              }
            }else if (e.children[i].title === '院校标签') {
              this.selectForm.tagsList = e.children[i].value
              if (this.selectForm.tagsList === null) {
                this.selectForm.tagsList = []
              }
            }else if (e.children[i].title === '办学类型') {
              this.selectForm.schoolNatureList = e.children[i].value
              if (this.selectForm.schoolNatureList === null) {
                this.selectForm.schoolNatureList = []
              }
            } else if (e.children[i].title === '地区') {
              this.selectForm.addressList = e.children[i].value
            }
          }
        }
      }
      console.log(e)
      this.clearData()
      this.getRecommendVolunteerList()
    },
    onChange(e, index) {
      console.log('onChange')
      console.log(e, index)
    },
    loadMore() {
      if (this.status === 'noMore') {
        return;
      }
      console.log('加载中')
      this.page.current++;
      this.getRecommendVolunteerList()
    },
    search(res) {
      this.recommendVolunteerList = []
      this.selectForm.paneName = '全部'
      this.page.current = 1
      this.getRecommendVolunteerList()
    },
    goto(url) {
      uni.navigateTo({
        url: url
      })
    },
    topBack() {
      uni.pageScrollTo({
        scrollTop: 0,   // 滚动到页面的目标位置  这个是滚动到顶部, 0
        duration: 300  // 滚动动画的时长
      })
    },
    ontabtap(e) {
      //切换了 tabs
      console.log(e)
      let index = e.target.dataset.current || e.currentTarget.dataset.current;
      //判断 是否重复切换
      if (index === this.tabIndex) {
        return;
      }
      this.selectForm.batch = this.tabBars[index].id
      //清除页数
      this.clearData()
      this.getRecommendVolunteerList()
      this.switchTab(index);
    },
    switchTab(index) {
      if (this.newsList[index].data.length === 0) {
        //this.getList(index);
      }
      if (this.tabIndex === index) {
        return;
      }

      // 缓存 tabId
      if (this.newsList[this.tabIndex].data.length > MAX_CACHE_DATA) {
        let isExist = this.cacheTab.indexOf(this.tabIndex);
        if (isExist < 0) {
          this.cacheTab.push(this.tabIndex);
        }
      }

      this.tabIndex = index;
      this.scrollInto = this.tabBars[index].id;

      // 释放 tabId
      if (this.cacheTab.length > MAX_CACHE_PAGE) {
        let cacheIndex = this.cacheTab[0];
        this.clearTabData(cacheIndex);
        this.cacheTab.splice(0, 1);
      }
    },
    clearTabData(e) {
      this.newsList[e].data.length = 0;
      this.newsList[e].loadingText = "加载更多...";
    },
    /*填报志愿*/
    saveVolunteer(item) {
      let that = this
      let u = uni
      console.log('填报批次:')
      console.log(item.batch)
      console.log('填报专业,', item.schoolName + ";" + item.enrollmentCode + ";" + item.majorCode + ";" + item.majorName)
      uni.showModal({
        title: item.volunteerIndexs ? '移除志愿' : '确认志愿',
        content: '[' + item.schoolCode + ']' + item.schoolName + '-' + item.batch + '-[' + item.enrollmentCode + ']' + item.majorName,
        confirmText: '确定',
        cancelText: '取消',
        success: function (res) {
          if (res.confirm) {
            request.post(ApiConstant.Volunteer.volunteerSave, {
              volunteerId: that.filledVolunteer.volunteerId,
              schoolCode: item.schoolCode,
              majorCode: item.majorCode,
              enrollmentCode: item.enrollmentCode
            }).then(r => {
              if (r.success) {
                console.log(r)
                if (r.result) {
                  that.filledVolunteer.volunteerId = r.result
                }
                setTimeout(function () {
                  uni.showToast({title: '添加成功', icon: "none"});
                }, 500)
                that.getUserScore()
              } else {
                setTimeout(function () {
                  uni.showToast({title: r.message, icon: "none"});
                }, 500)
              }
            }).catch(err => {
            }).finally(() => {

            });
          }
        }
      });
    },
    /*获取其他专业*/
    showOtherMajor(majorCode) {
      console.log(majorCode)
      request.get('/test', {
        "name": "zs"
      }).then(res => {
        console.log('返回值')
        console.log(res)
      })
    },
    /*获取用户分数*/
    getUserScore() {
      request.get(ApiConstant.Volunteer.artVolunteerDetail, {id: this.filledVolunteer.volunteerId}).then(res => {
        if (res.success) {
          let dataResult = res.result
          //有数据情况下
          const volunteerMap = new Map();
          if (dataResult != null) {
            // 分数信息
            this.scoreInfo = res.result.userScoreInfo
            //拆分子级专业类别
            if (this.scoreInfo) {
            }

            if (this.scoreInfo.batch) {
              this.selectForm.batch = this.scoreInfo.batch
              if (this.scoreInfo.batch === '本科A段') {
                this.tabBars = [{name: '本科提前批', id: '提前批'}, {name: '本科A段', id: '本科A段'}, {
                  name: '本科B段',
                  id: '本科B段'
                }, {name: '高职高专', id: '高职高专'}]
              } else if (this.scoreInfo.batch === '本科B段') {
                this.tabBars = [{name: '本科B段', id: '本科B段'}, {name: '高职高专', id: '高职高专'}]
              } else if (this.scoreInfo.batch === '本科') {
                this.tabBars = [{name: '本科', id: '本科'}, {name: '高职高专', id: '高职高专'}]
              } else {
                this.tabBars = [{name: '高职高专', id: '高职高专'}]
              }

              /*调整默认选中的导航栏*/
              if (this.scoreInfo.batch === '本科A段') {
                this.selectForm.batch = '提前批'
                this.tabIndex = 0;
              } else {
                for (let i = 0; i < this.tabBars.length; i++) {
                  if (this.tabBars[i].id === this.selectForm.batch) {
                    //选中
                    this.tabIndex = i;
                    break;
                  }
                }
              }
            }
            // 处理 已填志愿信息
            this.filledVolunteer.volunteerId = dataResult.id
            this.filledVolunteer.volunteerName = dataResult.volunteerName
            if (true) {
              let key = ''
              let volunteer = {indexStr: 0}
              //==================================提前批 start
              let volunteerRecordEarlyAdmissionList = dataResult.volunteerRecordEarlyAdmissionList;
              for (let i = 0; i < volunteerRecordEarlyAdmissionList.length; i++) {
                key = volunteerRecordEarlyAdmissionList[i].majorCode + volunteerRecordEarlyAdmissionList[i].schoolCode
                volunteer = volunteerRecordEarlyAdmissionList[i]
                volunteerMap.set(key, volunteerRecordEarlyAdmissionList[i])
              }
              let indexs = 1;
              let volunteerRecordEarlyAdmissionList2 = [];
              while (indexs <= 2) {
                let record = {
                  actives: false,
                  indexs: indexs
                }
                for (let i = 0; i < volunteerRecordEarlyAdmissionList.length; i++) {
                  if (volunteerRecordEarlyAdmissionList[i].indexs === indexs) {
                    record = volunteerRecordEarlyAdmissionList[i]
                    record.actives = true
                  }
                }
                volunteerRecordEarlyAdmissionList2.push(record)
                indexs++;
              }
              this.filledVolunteer.volunteerEarlyAdmissionList = volunteerRecordEarlyAdmissionList2
              //==================================提前批 end
              //==================================本科A段 start
              let volunteerUndergraduateAList = dataResult.volunteerRecordUndergraduateAList;
              for (let i = 0; i < volunteerUndergraduateAList.length; i++) {
                key = volunteerUndergraduateAList[i].majorCode + volunteerUndergraduateAList[i].schoolCode
                volunteerMap.set(key, volunteerUndergraduateAList[i])
              }
              indexs = 1;
              let volunteerRecordUndergraduateAList2 = [];
              while (indexs <= 12) {
                let record = {actives: false, indexs: indexs}
                for (let i = 0; i < volunteerUndergraduateAList.length; i++) {
                  if (volunteerUndergraduateAList[i].indexs === indexs) {
                    record = volunteerUndergraduateAList[i]
                    record.actives = true
                  }
                }
                volunteerRecordUndergraduateAList2.push(record)
                indexs++;
              }
              this.filledVolunteer.volunteerUndergraduateAList = volunteerRecordUndergraduateAList2
              //==================================本科A段 end
              //==================================本科B段 start
              let volunteerUndergraduateBList = dataResult.volunteerRecordUndergraduateBList;
              for (let i = 0; i < volunteerUndergraduateBList.length; i++) {
                key = volunteerUndergraduateBList[i].majorCode + volunteerUndergraduateBList[i].schoolCode
                volunteerMap.set(key, volunteerUndergraduateBList[i])
              }
              indexs = 1;
              let volunteerUndergraduateBList2 = [];
              while (indexs <= 12) {
                let record = {actives: false, indexs: indexs}
                for (let i = 0; i < volunteerUndergraduateBList.length; i++) {
                  if (volunteerUndergraduateBList[i].indexs === indexs) {
                    record = volunteerUndergraduateBList[i]
                    record.actives = true
                  }
                }
                volunteerUndergraduateBList2.push(record)
                indexs++;
              }
              this.filledVolunteer.volunteerUndergraduateBList = volunteerUndergraduateBList2
              //==================================本科 start
              let volunteerUndergraduateList = dataResult.volunteerRecordUndergraduateList;
              for (let i = 0; i < volunteerUndergraduateList.length; i++) {
                key = volunteerUndergraduateList[i].majorCode + volunteerUndergraduateList[i].schoolCode
                volunteerMap.set(key, volunteerUndergraduateList[i])
              }
              indexs = 1;
              let volunteerUndergraduateList2 = [];
              while (indexs <= 12) {
                let record = {actives: false, indexs: indexs}
                for (let i = 0; i < volunteerUndergraduateList.length; i++) {
                  if (volunteerUndergraduateList[i].indexs === indexs) {
                    record = volunteerUndergraduateList[i]
                    record.actives = true
                  }
                }
                volunteerUndergraduateList2.push(record)
                indexs++;
              }
              this.filledVolunteer.volunteerUndergraduateList = volunteerUndergraduateList2
              //==================================本科 end
              //==================================高职高专 start
              let volunteerJuniorCollegeList = dataResult.volunteerRecordJuniorCollegeList;
              for (let i = 0; i < volunteerJuniorCollegeList.length; i++) {
                key = volunteerJuniorCollegeList[i].majorCode + volunteerJuniorCollegeList[i].schoolCode
                volunteerMap.set(key, volunteerJuniorCollegeList[i])
              }
              indexs = 1;
              let volunteerJuniorCollegeList2 = [];
              while (indexs <= 12) {
                let record = {
                  actives: false,
                  indexs: indexs
                }
                for (let i = 0; i < volunteerJuniorCollegeList.length; i++) {
                  if (volunteerJuniorCollegeList[i].indexs === indexs) {
                    record = volunteerJuniorCollegeList[i]
                    record.actives = true
                  }
                }
                volunteerJuniorCollegeList2.push(record)
                indexs++;
              }
              this.filledVolunteer.volunteerJuniorCollegeList = volunteerJuniorCollegeList2
            }
            //==================================高职高专 end
          } else {
            this.filledVolunteer.volunteerEarlyAdmissionList = []
            this.filledVolunteer.volunteerUndergraduateAList = []
            this.filledVolunteer.volunteerUndergraduateBList = []
            this.filledVolunteer.volunteerJuniorCollegeList = []
            this.filledVolunteer.volunteerUndergraduateList = []
            this.filledVolunteer.volunteerList = []
          }
          this.filledVolunteer.volunteerMap = volunteerMap
        }
      }).catch(err => {
      }).finally(() => {
        this.getRecommendVolunteerList()
      });
    },
    /*获取推荐志愿列表*/
    getRecommendVolunteerList() {
      console.log(this.selectForm.batch)
      this.status = 'loading'
      let tagsStrs=''
      if (this.selectForm.tagsList && this.selectForm.tagsList.length>0) {
        tagsStrs = this.selectForm.tagsList.join(",")
      }

      let schoolNatureStrs=''
      if (this.selectForm.schoolNatureList && this.selectForm.schoolNatureList.length>0) {
        schoolNatureStrs = this.selectForm.schoolNatureList.join(",")
      }
      //地区
      let province = ''
      if (arrayIsNotEmpty(this.selectForm.addressList)) {
        province = this.selectForm.addressList.join(",")
      }

      let params = {
        schoolName: this.selectForm.schoolName,//学校名称
        pageNum: this.page.current,
        pageSize: this.page.pageSize,
        paneName: this.selectForm.paneName,
        batch: this.selectForm.batch,
        province: province,
        rulesEnrollProbability :this.selectForm.rulesEnrollProbability,
        tagsStrs:tagsStrs,
        schoolNatureStrs:schoolNatureStrs,
        scoreId: this.scoreInfo.id,
      }
      request.get(ApiConstant.Major.recommendMajorPage, params).then(res => {
        console.log('返回值')
        console.log(res)
        if (res.success) {
          let result = res.result
          let allNumber = result.allNumber
          this.circle.kcj = this.toPercent(result.kcj, allNumber)//可冲击
          this.circle.jwt = this.toPercent(result.jwt, allNumber)//较稳妥
          this.circle.nlq = this.toPercent(result.nan, allNumber)//难录取
          this.circle.kbd = this.toPercent(result.kbd, allNumber)//可保底
          this.num.kcj = result.kcj//可冲击
          this.num.jwt = result.jwt//较稳妥
          this.num.nlq = result.nan//难录取
          this.num.kbd = result.kbd//可保底
          let records = result.pageList.records
          //判断专业是否已经填报过
          if (this.filledVolunteer.volunteerMap) {
            let key = ''
            let volunteer = {}
            if (result && records) {
              for (let i = 0; i < records.length; i++) {
                key = records[i].majorCode + records[i].schoolCode
                volunteer = this.filledVolunteer.volunteerMap.get(key)
                if (volunteer != null) {
                  //这个专业已填过
                  records[i].volunteerIndexs = volunteer.indexs
                } else {
                  records[i].volunteerIndexs = ''
                }
              }
            }
          }

          this.recommendVolunteerList = [...this.recommendVolunteerList, ...records]
          if (result.pageList.current >= result.pageList.pages) {
            this.status = 'noMore'
          } else{
            this.status = 'more'
          }

          //修改分页参数
          this.page.total = result.pageList.total
          this.page.current = result.pageList.current

        }
      }).catch(err => {
      }).finally(() => {
      });
    },
    /*计算百分比*/
    toPercent(num, total) {
      return (Math.round(num / total * 10000) / 100.00);// 小数点后两位百分比
    },
    /*悬浮按钮*/
    trigger(e) {
      console.log(e)
      if (e.item.text === '回到顶部') {
        this.topBack()
      }
    },
    clearInput() {
      this.selectForm.schoolName = ''
    },
    menuChange(e) {
      console.log('↓↓↓↓触发change事件↓↓↓↓')
      console.log(e)
      this.menuValue = e.value;
      console.log(this.menuValue)
      this.clearData()
      this.getRecommendVolunteerList()
    },
    switchPane(e) {
      if (this.selectForm.paneName !== e) {
        this.selectForm.paneName = e
      } else {
        this.selectForm.paneName = '全部'
      }
      this.clearData()
      this.getRecommendVolunteerList()
    },
    clearData() {
      this.recommendVolunteerList = []
      this.page.current = 1
    },
    checkBao(e) {
      if (e >= 93) {
        return ImagesConstant.bao.kebaodi;
      } else if (e < 92 && e >= 74) {
        return ImagesConstant.bao.jiaowentuo;
      } else if (e < 73 && e >= 60) {
        return ImagesConstant.bao.kechongji;
      }
      return ImagesConstant.bao.nanluqu;
    },
    checkColorText(e) {
      if (e >= 93) {
        return '#3e8e43';
      } else if (e < 92 && e >= 74) {
        return '#4975fd';
      } else if (e < 73 && e >= 60) {
        return '#F8880E';
      }
      return '#c83428';
    },
    top() { //回到顶部
      uni.pageScrollTo({
        scrollTop: 0,
        duration: 300
      });
    },
  },
  onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮
    //当距离大于600时显示回到顶部按钮，//当距离小于600时隐藏回到顶部按钮
    this.topFlag = e.scrollTop > 600;
  }
}
</script>

<template>
  <view class="divider"/>
  <view class="backcolorwhite">
    <view class="header">
      <view class="search-view">
        <view style="display: flex;height: 100rpx;border-bottom: 1px solid #f5f5f5;">
          <view style="width: 90%">
            <uni-search-bar class="uni-mt-10" radius="100" placeholder="请输入院校" v-model="selectForm.schoolName" @clear="clearInput" cancelButton="none" @confirm="search"/>
          </view>
          <view style="width: 10%;line-height: 100rpx">
            <text @click="search">搜索</text>
          </view>
        </view>
        <le-dropdown
            v-model:menuList="menuList"
            themeColor="#3d76fd"
            :duration="200"
            :isCeiling="true"
            @onConfirm="onConfirm"
            @onChange="onChange"></le-dropdown>
      </view>
    </view>
    <view class="divider"/>
    <!--我的成绩 卡片-->
    <view class="uni-flex uni-row">
      <view class="score-card">
        <view class="uni-flex uni-row flex">
          <view class="flex-item-8">
            <text style="font-size: 50rpx">我的成绩</text>
          </view>
          <view class="flex-item-2" @click="goto('/pages/zyb/score/edit?scoreId='+this.scoreInfo.id)">
            <image :src="ImagesConstant.edit" class="icon50 float-right" style="line-height: 50rpx"/>
          </view>
        </view>

        <view class="text-list">
          <text class="t">省份：{{ scoreInfo.province }}</text>
          <text class="t">选科：{{ scoreInfo.cognitioPolyclinic }}</text>
          <text class="t">类别：{{ scoreInfo.professionalCategory }}</text>
        </view>
        <view class="text-list">
          <text class="t">文化成绩：{{ scoreInfo.culturalScore }}</text>
          <text class="t">统考成绩：{{ scoreInfo.professionalScore }}</text>
        </view>

        <view class="text-list" v-if="scoreInfo.professionalCategoryChildrenList">
          <text class="t" v-for="(item,index) in scoreInfo.professionalCategoryChildrenList" :key="index">
            {{item.categoryChildName}}：{{ item.categoryChildScore }}
          </text>
        </view>
      </view>
    </view>
    <!--通告栏-->
    <view style="padding: 0 10rpx">
      <uni-notice-bar show-icon text="有关2023年全国艺考省份政策及数据说明"
                      @click="goto('/pages/zyb/other/web-view?url=https://yitisheng.vip/wxSJIRHyQUBA/zkzc.html')"/>
    </view>
    <!--导航栏-->
    <view class="tabs">
      <scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false"
                   :scroll-into-view="scrollInto">
        <view v-for="(tab,index) in tabBars" :key="tab.id" class="uni-tab-item" :id="tab.id" :data-current="index"
              @click="ontabtap">
          <text class="uni-tab-item-title" :class="tabIndex===index ? 'uni-tab-item-title-active' : ''">{{ tab.name }}
          </text>
        </view>
      </scroll-view>
      <view class="uni-flex uni-row flex" style="padding: 30rpx">
        <view class="flex-item-25" v-if="num.nlq!==0" @click="switchPane('难录取')">
          <l-circle v-model:current="modelVale" :percent="circle.nlq" size="80px" strokeColor="#c83428">
            <view class="centerTxt">
              <view class="num">
                {{ num.nlq }}
              </view>
              <view class="txt" :class="selectForm.paneName==='难录取'?'red':''">难录取</view>
            </view>
          </l-circle>
        </view>
        <view class="flex-item-25" v-if="num.kcj!==0" @click="switchPane('可冲击')">
          <l-circle v-model:current="modelVale" :percent="circle.kcj" size="80px" strokeColor="#F8880E">
            <view class="centerTxt">
              <view class="num">
                {{ num.kcj }}
              </view>
              <view class="txt" :class="selectForm.paneName==='可冲击'?'redOrange':''">可冲击</view>
            </view>
          </l-circle>
        </view>
        <view class="flex-item-25" v-if="num.jwt!==0" @click="switchPane('较稳妥')">
          <l-circle v-model:current="modelVale" :percent="circle.jwt" size="80px" strokeColor="#4975fd">
            <view class="centerTxt">
              <view class="num">
                {{ num.jwt }}
              </view>
              <view class="txt" :class="selectForm.paneName==='较稳妥'?'blue':''">较稳妥</view>
            </view>
          </l-circle>
        </view>
        <view class="flex-item-25" v-if="num.kbd!==0" @click="switchPane('可保底')">
          <l-circle v-model:current="modelVale" :percent="circle.kbd" size="80px" strokeColor="#3e8e43">
            <view class="centerTxt">
              <view class="num">
                {{ num.kbd }}
              </view>
              <view class="txt" :class="selectForm.paneName==='可保底'?'green':''">可保底</view>
            </view>
          </l-circle>
        </view>


      </view>
    </view>
  </view>
  <!--推荐列表-->
  <view class="fillVolunteer">
    <page-head title="当前23年计划为系统模拟计划，请注意辨别"></page-head>
    <view class="volunteerItem radius8" v-for="(item,index) in recommendVolunteerList" :key="index">
      <!--院校信息-->
      <view class="flex" @click="goto('/pages/zyb/school/detail?schoolCode='+item.schoolCode)">
        <!--院校图片-->
        <view class="flex-item-22">
          <image :src="item.schoolIcon||ImagesConstant.defaultIcon" class="icon128"/>
        </view>
        <!--院校代码-->
        <view class="flex-item-77">
          <view class="flex slateGray">
            <text class="flex-item-4">院校代码[{{ item.schoolCode }}]</text>
            <text class="flex-item-25">{{ item.province }}</text>
            <view class="flex-item-35">
              <view style="float: right;line-height: 50rpx;" class="font-weight-600">
                <text class="font-size-mini" :style="'color:'+checkColorText(item.enrollProbability)">
                  {{ item.enrollProbability }}%
                </text>
                <image :src="checkBao(item.enrollProbability)" class="icon50"/>
              </view>
            </view>
          </view>
          <view class="flex">
            <text class="font-size-medium">{{ item.schoolName }}</text>
          </view>
          <view class="flex tags slateGray">
            <text class="tag" v-for="t in item.tagsList" :key="t">
              {{t}}
            </text>
          </view>
          <view class="flex">
            <view class="flex-item-65 slateGray" style="line-height: 50rpx">
              <text class="tag">[{{ item.enrollmentCode }}]{{ item.majorName }}</text>
            </view>
            <view class="flex-item-35">
              <view style="float: right;line-height: 50rpx;" class="font-weight-600">
                <text>
                  折合分:
                </text>
                <text class="font-size-mini" :style="'color:'+checkColorText(item.enrollProbability)">
                  {{item.studentConvertedScore}}
                </text>
                <text>
                  真实分:
                </text>
                <text class="font-size-mini" :style="'color:'+checkColorText(item.enrollProbability)">
                  {{item.studentScore}}
                </text>
              </view>
            </view>
          </view>
        </view>
        <!---->
      </view>
      <!--招录信息-->
      <view class="flex font-size-mini">
        <view class="flex-item-5" style="line-height: 40rpx">
          <view v-for="(history,h) in item.historyMajorEnrollList" :key="h">
            <text>{{ history.year }}年录取最低分：</text>
            <text class="red">{{ history.admissionLine }}分</text>
          </view>
        </view>
        <view class="flex-item-5" style="line-height: 40rpx">
          <view class="flex" style="float: right">
            <text>{{ StaticConstant.year }}省内计划录取：</text>
            <text v-if="item.planNum" class="green font-weight-600">{{ item.planNum }}人</text>
            <text v-else class="green">暂未发布</text>
          </view>
        </view>
      </view>
      <view class="flex" style="line-height: 50rpx">
        <view class="flex-item-7">
          <text>{{ StaticConstant.year }}录取方式:</text>
          <text v-if="item.rulesEnrollProbability" class="blue">{{ item.rulesEnrollProbability }}</text>
          <text v-else class="blue">暂未发布</text>
        </view>
        <view class="flex-item-3">
          <button v-if="item.volunteerIndexs" @click="saveVolunteer(item)" type="default"
                  style="background-color: #d73535;color:white;height: 50rpx;line-height: 50rpx;font-size: 15px">
            志愿{{ item.volunteerIndexs }}
          </button>
          <button v-else @click="saveVolunteer(item)" type="default"
                  style="background-color: #3666d1;color:white;height: 50rpx;line-height: 50rpx;font-size: 15px">填报
          </button>
        </view>


      </view>
    </view>
    <view class="container" @click="loadMore" v-if="userInfo.vipFlag">
      <uni-load-more :status="status" :content-text="contentText"/>
    </view>
  </view>
  <my-checkvip :vip-flag="(userInfo.vipFlag)"/>
  <view class="top" :style="{'display':(topFlag===true? 'block':'none')}">
    <uni-icons class="topc" type="arrowthinup" size="40" @click="top"></uni-icons>
  </view>
</template>

<style scoped lang="scss">
.uni-mt-10 {
  margin-top: 10px;
}

.divider {
  background: #f5f5f5;
  width: 100%;
  height: 3rpx;
}

.backcolorwhite {
  background-color: white !important;
}

/*重置 uni-data-picker样式*/
:deep(.uni-data-tree) {
  .placeholder {
    color: black !important;
    font-size: 14px !important;
  }

  .selected-item .text-color {
    color: black !important;
    font-size: 14px !important;
  }

  .input-value-border {
    border: none !important;
  }
}

/*成绩卡片*/
.score-card {
  background-color: #5478fb;
  color: white;
  width: 100%;
  border-radius: 20rpx;
  padding: 30rpx;
  margin: 10rpx;
}


.text-list {
  margin-top: 30rpx;
  margin-bottom: 10rpx;

  .t {
    line-height: 20rpx;
    margin-right: 15rpx;
  }
}


/*导航栏部分 start*/
.tabs {
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  background-color: #ffffff;
  /* #ifndef APP-PLUS */
  /*height: 100vh;*/
  /* #endif */

  .scroll-h {
    /*width: 750rpx;*/
    /* #ifdef H5 */
    width: 100%;
    /* #endif */
    height: 80rpx;
    flex-direction: row;
    /* #ifndef APP-PLUS */
    white-space: nowrap;
    /* #endif */
    /* flex-wrap: nowrap; */
    /* border-color: #cccccc;
  border-bottom-style: solid;
  border-bottom-width: 1px; */
  }

  .line-h {
    height: 1rpx;
    background-color: #cccccc;
  }

  .uni-tab-item {
    /* #ifndef APP-PLUS */
    display: inline-block;
    /* #endif */
    flex-wrap: nowrap;
    padding-left: 34rpx;
    padding-right: 34rpx;
  }

  .uni-tab-item-title {
    color: #555;
    font-size: 30rpx;
    height: 80rpx;
    line-height: 80rpx;
    flex-wrap: nowrap;
    /* #ifndef APP-PLUS */
    white-space: nowrap;
    /* #endif */
  }

  .uni-tab-item-title-active {
    color: #007AFF;
  }

  .swiper-box {
    flex: 1;
  }

  .swiper-item {
    flex: 1;
    flex-direction: row;
  }

  .scroll-v {
    flex: 1;
    /* #ifndef MP-ALIPAY */
    flex-direction: column;
    /* #endif */
    /*width: 750rpx;*/
    width: 100%;
  }

  .update-tips {
    position: absolute;
    left: 0;
    top: 41px;
    right: 0;
    padding-top: 5px;
    padding-bottom: 5px;
    background-color: #FDDD9B;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .update-tips-text {
    font-size: 14px;
    color: #ffffff;
  }

  .refresh {
    /*width: 750rpx;*/
    width: 100%;
    height: 64px;
    justify-content: center;
  }

  .refresh-view {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
  }

  .refresh-icon {
    width: 30px;
    height: 30px;
    transition-duration: .5s;
    transition-property: transform;
    transform: rotate(0deg);
    transform-origin: 15px 15px;
  }

  .refresh-icon-active {
    transform: rotate(180deg);
  }

  .loading-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    color: #999999;
  }

  .loading-text {
    margin-left: 2px;
    font-size: 16px;
    color: #999999;
  }

  .loading-more {
    align-items: center;
    justify-content: center;
    padding-top: 10px;
    padding-bottom: 10px;
    text-align: center;
  }

  .loading-more-text {
    font-size: 28rpx;
    color: #999;
  }
}

/*导航栏部分 end*/

/*分页按钮*/
:deep(.uni-pagination__num) {
  flex: none !important;
}


.btn-flex {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.button {
  margin: 20px;
  width: 150px;
  font-size: 14px;
  color: #333;
}


/*顶部*/
.header {
  border-top: 3rpx solid #f6f6f6;
  background-color: white;
  //min-height: 500rpx;
  //搜索栏
  .search-view {
    width: 95%;
    margin: 0 auto;
    border-bottom: 3rpx solid #f6f6f6;
  }
}

/*搜索栏*/
:deep(.uni-searchbar) {
  padding: 15rpx 10rpx !important;
}

:deep(.wei-dropdown-menu-bar) {
  box-shadow: none !important;
}


/*圆环进度条内字体 start*/
.progressBox {
  position: relative;
  width: 168rpx;
  height: 168rpx;
  margin-top: 33rpx;
}

.centerTxt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100rpx;
  height: 80rpx;
  margin: 10rpx auto 0 auto;
  text-align: center;

  .num {
    font-size: 30rpx;
    font-family: Arial, serif;
    font-weight: bold;
    color: #38393A;
  }

  .txt {
    font-size: 22rpx;
    font-family: PingFang SC;
    font-weight: 400;
    color: #8A8B8B;
  }

}

/*圆环进度条内字体 end*/

.tcenter {
  text-align: center;
}

.circle-active {
  /*border-bottom: 1rpx solid #3d76fd;*/
  color: #3d76fd !important;
}


/*推荐志愿列表 start*/

.fillVolunteer {
  /*padding:0 30rpx 10rpx 30rpx;*/
  .volunteerItem {
    background-color: white;
    padding: 30rpx;
    margin: 10rpx 0;
    /*院校标签*/
    .tags{
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
    }
    .tags .tag {
      margin-top: 10rpx;
      margin-right: 10px;
      font-size: 13px;
      line-height: 30rpx;
      color: #acadba;
      border: 3rpx solid #acadba;
      border-radius: 8rpx;
      padding: 5rpx;
    }
  }
}

/*推荐志愿列表 end*/

:deep(.uni-noticebar) {
  margin-top: 10rpx;
}

/* 回到顶部 start*/
.top {
  position: relative;
  display: none; /* 先将元素隐藏 */
  transition: 0.5s;
}
.topc {
  position: fixed;
  right: 10rpx;
  //background: #F0F0F0;
  background: #e1e1e1;
  border-radius: 50%;
  top: 80%;
  height: 40px;
  line-height: 40px;
}
/* 回到顶部 end*/
</style>
