<template>
  <div>
    <van-popup v-model="show" get-container="body" position="right" style="height:100%; width:100%;">
      <van-nav-bar title="评分标准" left-text="返回" @click-left="goback" left-arrow right-arrow @click-right="confirm" right-text="保存"></van-nav-bar>
      <van-cell-group>
        <div class="point_popup_tip" slot="title">系统为您推荐了各标准的积分，可点击修改积分</div>
        <van-field type="number" v-model="obj.super_satisfied " placeholder="请输入积分" label="超预期" />
        <van-field type="number" v-model="obj.satisfied" placeholder="请输入积分" label="满意" />
        <van-field type="number" v-model="obj.qualified" placeholder="请输入积分" label="合格" />
        <van-field type="number" v-model="obj.unqualified" placeholder="请输入积分" label="不合格" />
      </van-cell-group>
      <div class="point_popup_tip" style="padding: 0 0.32rem; padding-top:0.16rem;">如需调整系统推荐的标准积分比例，
        <span @click="$router.push({name:'TaskPointRatingSet'})">点击设置</span></div>
    </van-popup>
  </div>
</template>
<script>
  import Vue from 'vue'
  export default {
    props:{
      visible:{
        type: Boolean,
        default: false
      },
      integral:{
        type: Number,
        default: null
      },
      pointLevel: {
        type: Object,
        default: () => {
          return {}
        }
      }
    },
    name: 'integral_standard',
    data(){
      let visible = this.visible,integral = this.integral,pointLevel = this.pointLevel
      return {
        show: visible,
        num: integral,
        obj: pointLevel,
      }
    },
    components: {},
    watch:{
    },
    methods:{
      // 评分标准返回
      goback() {
        this.show = false;
        this.$emit('update:visible', this.show)
      },
      // 评分标准确认
      confirm(){
        this.show = false
        this.$emit('pointLevel', this.obj)
        this.$emit('update:visible', this.show)
      },
      showLoading () {
        this.$toast.loading({
          loadingType: "spinner",
          message: '正在处理'
        })
      },
    },
    created() {
      if(JSON.stringify(this.obj) === '{}'){
        if (window.localStorage.getItem('pointLevel')) {
          this.obj = JSON.parse(window.localStorage.getItem('pointLevel'))
        }
      }
    }
  };
</script>
<style rel="stylesheet/less" lang="less" scoped>
  .body_com{height: calc(100% - 0.92rem); position: relative;}
  .point_popup_tip{
    font-size: .24rem;
    color: #909399;
    line-height: .34rem;
    background-color: rgb(245, 245, 245);
    span{
      color: #26a2ff;
    }
  }
</style>
