<template>
  <div>
    <!--        顶部条-->
    <div class="navBarTOP">
      <van-nav-bar class="navBar" title="半月报详情" left-arrow @click-left="onClickLeft" />
      <!--      <p style="margin-left: 16px;    font-size: 14px;">{{title}}</p>-->
    </div>
    <div class="lineGrey"></div>
    <div class="lineGrey"></div>
    <div class="lineGrey"></div>
    <div class="lineGrey"></div>
    <div class="lineGrey"></div>
    <!--        主体内容-->
    <div class="container linep">
      <p style="font-size: 16px; margin: 10px 0">{{ title }}</p>
      <van-collapse v-model="activeNames">
        <van-collapse-item title="建店布机" name="2">
          <createStoreBJ :reportTargetAll="reportTargetAll"></createStoreBJ>
        </van-collapse-item>
        <van-collapse-item name="16" title="专业时时丽分销店下单">
          <ZYPlaceOrder :reportTargetAll="reportTargetAll"></ZYPlaceOrder>
        </van-collapse-item>
        <van-collapse-item title="业绩目标SAP(千元)" name="1" v-if="type != 3 && type != 4">
          <performanceSAP :reportTargetAll="reportTargetAll" :JZQuota="JZQuota"></performanceSAP>
        </van-collapse-item>
        <van-collapse-item name="27" title="内墙中高端(千元)">
          <van-row>
            <van-col span="12"><span class="leftTitle">本月业绩</span></van-col>
            <van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.rjqSapMonthAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.rjqSapQuarterAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.rjqSapMonthSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck"
                  >{{ reportTargetAll.rjqSapQuarterSuccessRate }}%</span
                >
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.rjqSapMonthGrowRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.rjqSapQuarterGrowRate }}%</span>
              </p></van-col
            >
          </van-row>
        </van-collapse-item>
        <!-- 内外墙平涂SAP -->
        <van-collapse-item name="2" title="内外墙平涂SAP(千元)">
          <neiwaiqiangpingtu :reportTargetAll="reportTargetAll"></neiwaiqiangpingtu>
        </van-collapse-item>
        <van-collapse-item name="11" title="专业时时丽SAP(千元)">
          <ZYSAP :reportTargetAll="reportTargetAll"></ZYSAP>
        </van-collapse-item>
        <van-collapse-item name="28" title="防水+背胶SAP(千元)">
          <van-row>
            <van-col span="12"><span class="leftTitle">本月业绩</span></van-col
            ><van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.fsbjSapMonthAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.fsbjSapQuarterAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck"
                  >{{ reportTargetAll.fsbjSapMonthSuccessRate }}%</span
                >
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck"
                  >{{ reportTargetAll.fsbjSapQuarterSuccessRate }}%</span
                >
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.fsbjSapMonthGrowRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.fsbjSapQuarterGrowRate }}%</span>
              </p></van-col
            >
          </van-row>
        </van-collapse-item>
        <van-collapse-item name="29" title="瓷砖胶SAP(千元)">
          <van-row>
            <van-col span="12"><span class="leftTitle">本月业绩</span></van-col
            ><van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.czjSapMonthAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.czjSapQuarterAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.czjSapMonthSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck"
                  >{{ reportTargetAll.czjSapQuarterSuccessRate }}%</span
                >
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.czjSapMonthGrowRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.czjSapQuarterGrowRate }}%</span>
              </p></van-col
            >
          </van-row>
        </van-collapse-item>
        <van-collapse-item title="魔术漆SAP(千元)" name="3">
          <van-row>
            <van-col span="12"><span class="leftTitle">本月业绩</span></van-col>
            <van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{ Micrometer(reportTargetAll.ysqMonthAct) }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{ Micrometer(reportTargetAll.ysqQuarterAct) }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.ysqMonthSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.ysqQuarterSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.ysqMonthGrowRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.ysqQuarterGrowRate }}%</span>
              </p></van-col
            >
          </van-row>
        </van-collapse-item>
        <van-collapse-item title="质感外墙SAP(千元)" name="4">
          <van-row>
            <van-col span="12"><span class="leftTitle">本月业绩</span></van-col
            ><van-col span="12"><span class="rightTitle">本季业绩</span></van-col>
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{ Micrometer(reportTargetAll.zgwqMonthAct) }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                实际:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.zgwqQuarterAct)
                }}</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.zgwqMonthSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                达成率:<span class="colorbalck">{{ reportTargetAll.zgwqQuarterSuccessRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.zgwqMonthGrowRate }}%</span>
              </p></van-col
            >
            <van-col span="12"
              ><p>
                成长率:<span class="colorbalck">{{ reportTargetAll.zgwqQuarterGrowRate }}%</span>
              </p></van-col
            >
          </van-row>
        </van-collapse-item>
        <van-collapse-item name="17" title="超好贴分销店下单">
          <veryGoodPlaceOrder :reportTargetAll="reportTargetAll"></veryGoodPlaceOrder>
        </van-collapse-item>
        <van-collapse-item title="客户开拓" name="6">
          <van-row>
            <!--            <van-col span="12" v-if="powerGrade>=3"><span class="leftTitle">非片区经销商</span></van-col>-->
            <!--            v-if="powerGrade==2"-->
            <van-col span="24"><span class="leftTitle">非片客户开发</span></van-col>
            <!--            <van-col span="12" v-if="powerGrade>=3"><span class="rightTitle" >TOP70直营家装</span></van-col>-->
            <van-col span="24"
              ><p>
                全年开发数:<span class="colorbalck">{{
                  Micrometer(reportTargetAll.customerAct)
                }}</span>
              </p></van-col
            >
            <!--            <van-col span="12" v-if="powerGrade>=3"><p>全年目标:<span class="colorbalck">{{reportTargetAll.directCustomerYearTarget}}</span></p></van-col>-->
            <!--            <van-col span="24"><p>实际:<span class="colorbalck">{{ Micrometer(reportTargetAll.customerAct) }}</span></p></van-col>-->
            <!--            <van-col span="12" v-if="powerGrade>=3"><p>实际:<span class="colorbalck">{{reportTargetAll.directCustomerAct}}</span></p></van-col>-->
            <van-col span="24"
              ><p>
                全年进度率:<span class="colorbalck">{{ reportTargetAll.customerYearRate }}%</span>
              </p></van-col
            >
            <!--            <van-col span="12" v-if="powerGrade>=3"><p>全年进度率:<span class="colorbalck">{{reportTargetAll.directCustomerYearRate}}%</span></p></van-col>-->
          </van-row>
        </van-collapse-item>
        <van-collapse-item title="上期工作成果" name="7">
          <div style="margin-top: -10px">
            <div v-for="(item, index) in reportContentsList2" :key="index">
              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item.doubleWeekType)}}</span></p>-->
              <p class="texttitle texttitle2">计划工作进度</p>
              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
                <van-field
                  v-model="reportContentsList1[index].doubleWeekContent"
                  rows="4"
                  autosize
                  readonly
                  type="textarea" />
              </div>
              <p class="texttitle texttitle2">实际工作进度</p>
              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
                <van-field
                  v-model="item.doubleWeekContent"
                  rows="4"
                  autosize
                  readonly
                  type="textarea" />
              </div>
            </div>
          </div>
        </van-collapse-item>
        <van-collapse-item title="本期工作规划" name="8">
          <div style="margin-top: -10px">
            <div v-for="(item2, index2) in reportContentsList3" :key="index2">
              <!--              <p class="texttitle"><span class="opint"></span><span>{{selectDictLabel(weekType,item2.doubleWeekType)}}</span></p>-->
              <div style="padding: 10px 0; min-height: 32px" class="contentContainer">
                <van-field
                  v-model="item2.doubleWeekContent"
                  rows="4"
                  autosize
                  readonly
                  type="textarea" />
              </div>
            </div>
          </div>
        </van-collapse-item>
      </van-collapse>
      <div
        class="contentContainer"
        v-if="reportTarget.status > 1 || reportTarget.reportRemarks != null">
        <p class="texttitle texttitledaily">
          <span class="opint"></span>
          <span v-if="reportTarget.status == 1">待审批</span>
          <span v-if="reportTarget.status == 3">审批完成</span>
          <span v-if="reportTarget.status == 2">退回重写</span>
          <span v-if="reportTarget.status == -1">过期未汇报</span>
          <span v-if="reportTarget.status > 1"><{{ ptitle }}审批></span>
        </p>
        <div style="padding: 10px 0" v-if="reportTarget.status > 1">
          <van-rate
            v-model="reportTarget.number"
            :size="25"
            readonly
            color="#ffd21e"
            void-icon="star"
            void-color="#eee" /><span class="rateText"
            >&nbsp;&nbsp;&nbsp;&nbsp;{{ reportTarget.number }}分</span
          >
        </div>
        <div style="padding: 10px 0" v-if="reportTarget.status > 1">
          <van-field v-model="successContent" rows="4" autosize readonly type="textarea" />
        </div>
      </div>
      <div class="contentContainer" v-if="reportTarget.reportRemarks != null">
        <div>
          <div v-for="(item, index) in reportTarget.reportRemarks" :key="index">
            <p class="contentContainerTitle">
              <template v-if="item.deptName">{{ item.deptName }}-</template>{{ item.postName }}-{{
                item.nickName
              }}的点评
            </p>
            <div style="padding: 10px 0">
              <van-field v-model="item.remarkContent" rows="4" autosize readonly type="textarea" />
            </div>
            <!-- <p style="text-align: right">点评时间：{{ item.createTime }}</p> -->
          </div>
        </div>
      </div>
      <div class="contentContainer">
        <p class="contentContainerTitle">点评</p>
        <div style="padding: 10px 0">
          <van-field
            v-model="managerRemarkContent"
            rows="4"
            autosize
            maxlength="800"
            show-word-limit
            type="textarea"
            :formatter="formatter" />
        </div>
      </div>
    </div>
    <br />
    <div class="contentborder">
      <van-button type="info" size="small" plain class="Btn1" @click="submint">提交点评</van-button>
    </div>
    <br />
    <!--    <div class="envelopes" @click="openEnterpriseChat" >-->
    <!--      <img :src="envelopes">-->
    <!--      <p>红包奖励</p>-->
    <!--    </div>-->
    <br /><br />
    <br /><br />
  </div>
</template>

<script>
import history from '@/assets/Icon/history.png';
import {
  userTodayPlanNum,
  loginLog,
  homeImge,
  insertRemark,
  getDetailById,
  double_week_type,
  updateReport,
} from '@/api/index';
import envelopes from '@/assets/envelopes.png';
import axios from 'axios';
import createStoreBJ from '@/views/componentsTarget/createStoreBJ';
import ZYPlaceOrder from '@/views/componentsTarget/ZYPlaceOrder';
import performanceSAP from '@/views/componentsTarget/performanceSAP';
import ZYSAP from '@/views/componentsTarget/ZYSAP';
import veryGoodPlaceOrder from '@/views/componentsTarget/veryGoodPlaceOrder';
import neiwaiqiangpingtu from '@/views/componentsTarget/neiwaiqiangpingtu';
export default {
  name: 'home',
  components: {
    createStoreBJ,
    ZYPlaceOrder,
    performanceSAP,
    ZYSAP,
    veryGoodPlaceOrder,
    neiwaiqiangpingtu,
  },
  data() {
    return {
      envelopes: envelopes,
      show: true,
      num: 0,
      todayGoal: {},
      title: '',
      ptitle: '',
      progressWidth: 0,
      history: history,
      imgArr: [],
      message: '89989880989890080989',
      activeNames: [
        '1',
        '2',
        '3',
        '4',
        '5',
        '6',
        '7',
        '8',
        '11',
        '12',
        '16',
        '17',
        '27',
        '28',
        '29',
      ],
      powerGrade: '',
      value: '2',
      reportTargetAll: {},
      reportTarget: {},
      reportContentsList1: [],
      reportContentsList2: [],
      reportContentsList3: [],
      weekType: [],
      successContent: '',
      managerRemarkContent: '',
      isDiy: false,
      type: '-1',
      //
    };
  },
  created() {
    this.powerGrade = localStorage.getItem('powerGrade');
    this.isDiy = localStorage.getItem('isDiy');
    this.getDetailById();
    double_week_type().then((res) => {
      this.weekType = res.data;
    });
  },
  watch: {
    $route(to, from) {
      this.powerGrade = localStorage.getItem('powerGrade');
      this.isDiy = localStorage.getItem('isDiy');
      // this.getReportInfo()
      if (to.path == '/doubleHistoricalWeeklyDetils') {
        this.getDetailById();
      }
      // &&from.path=="/myHistoricalDaily"
      //   if(to.path=="/weeklyApprovalDetils"&&from.path=="/dailyApprovalList"){
      //     this.getDetailById()
      //   }
    },
  },
  // activated() {
  //   this.num = 0;
  //   this.homeImgeFn()
  //   this.userTodayPlanNum()
  //   this.loginLogFn()
  // },
  methods: {
    openEnterpriseChat(val) {
      let loading1 = this.$toast.loading({
        duration: 0,
        message: '加载中...',
        forbidClick: true,
      });
      let url = window.location.href;
      let that = this;
      let wx = this.wx;
      let qiyeData;
      var userIds = this.reportTarget.reportContents[0].createBy;
      const instance = axios.create();
      instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
      instance
        .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
          params: {
            url: url,
          },
        })
        .then((response) => {
          if (response.status == 200) {
            loading1.clear();
            qiyeData = response.data.data;
            wx.config({
              beta: true, // 必须这么写，否则wx.invoke调用形式的jsapi会有问题
              debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
              appId: qiyeData.appId, // 必填，企业微信的corpID
              timestamp: qiyeData.timestamp, // 必填，生成签名的时间戳
              nonceStr: qiyeData.nonceStr, // 必填，生成签名的随机串
              signature: qiyeData.signature, // 必填，签名，见 附录-JS-SDK使用权限签名算法
              jsApiList: ['ready', 'openEnterpriseChat'], // 必填，需要使用的JS接口列表，凡是要调用的接口都需要传进来
            });
            wx.ready(function () {
              wx.openEnterpriseChat({
                //localStorage.getItem("loginName")
                userIds: userIds,
                // externalUserIds:"dingxiaogai.sm",
                groupName: '我的红包群', // 会话名称。单聊时该参数传入空字符串""即可。localStorage.getItem("loginName")
                chatId: '', //CHATID 若要打开已有会话，需指定此参数。如果是新建会话，chatId必须为空串
                success: function (res) {
                  var chatId = res.chatId; //返回当前群聊ID，仅当使用agentConfig注入该接口权限时才返回chatId
                },
                fail: function (res) {
                  if (res.errMsg.indexOf('function not exist') > -1) {
                    alert('版本过低请升级');
                  }
                },
              });
            });
          } else {
            this.$toast.fail(dataList.msg);
          }
        });
    },
    formatter(value) {
      return value.replace(
        /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi,
        ''
      );
    },
    submint() {
      let loading1 = this.$toast.loading({
        duration: 0,
        message: '数据提交中...',
        forbidClick: true,
      });
      if (this.managerRemarkContent.trim() == '') {
        this.$toast('点评内容未填写');

        return false;
      }
      if (this.managerRemarkContent.length > 800) {
        this.$toast('点评内容超过800字');
        return false;
      }
      var remak = {
        remarkContent: this.managerRemarkContent,
        reportId: this.$route.query.reportId,
      };
      insertRemark(remak).then((res) => {
        loading1.clear();
        if (res.code == 200) {
          this.$dialog
            .alert({
              title: '系统提示',
              message: '提交成功',
            })
            .then(() => {
              this.managerRemarkContent = '';
              this.getDetailById();
            });
        } else {
          this.$toast.fail(res.msg);
        }
      });
    },
    // submint(){
    //   let loading1 = this.$toast.loading({
    //     duration: 0,
    //     message: '数据提交中...',
    //     forbidClick: true,
    //   });
    //   if(this.managerRemarkContent.trim()==""){
    //     this.$toast("点评内容未填写")
    //     return false
    //   }
    //   this.reportTarget.managerRemarkContent=this.managerRemarkContent
    //   this.reportTarget.status=4
    //   updateReport(this.reportTarget).then(res=>{
    //     loading1.clear()
    //     if(res.code==200){
    //       this.$dialog.alert({
    //         title: '系统提示',
    //         message: '提交成功',
    //       }).then(() => {
    //         this.getDetailById()
    //       });
    //     }else{
    //       this.$toast.fail(res.msg)
    //     }
    //   })
    // },
    getDetailById() {
      let loading1 = this.$toast.loading({
        duration: 0,
        message: '加载中...',
        forbidClick: true,
      });
      getDetailById({ reportId: this.$route.query.reportId }).then((res) => {
        loading1.clear();
        this.title =
          res.data.deptName + '-' + res.data.postName + '-' + res.data.nickName + '的半月报';
        this.ptitle = res.data.pdeptName + '-' + res.data.ppostName + '-' + res.data.pnickName;
        this.reportTargetAll = res.data.reportTargetAll;
        this.reportTarget = res.data;
        this.type = res.data.userType;
        this.reportContents = res.data.reportContents;
        var reportContentsList1 = [];
        var reportContentsList2 = [];
        var reportContentsList3 = [];
        var reportContentsdata = res.data.reportContents;
        if (res.data.status == 3) {
          this.successContent = res.data.successContent;
        } else {
          this.successContent = res.data.failContent;
        }
        for (var i = 0; i < res.data.reportContents.length; i++) {
          if (res.data.reportContents[i].type == '1') {
            reportContentsList1.push(reportContentsdata[i]);
          }
          if (res.data.reportContents[i].type == '2') {
            reportContentsList2.push(reportContentsdata[i]);
          }
          if (res.data.reportContents[i].type == '3') {
            reportContentsList3.push(reportContentsdata[i]);
          }
        }
        var ln1 = reportContentsList1.length;
        var ln2 = reportContentsList2.length;
        if (reportContentsList1.length < reportContentsList2.length) {
          var len2 = ln2 - ln1;
          for (var x = 0; x < len2; x++) {
            reportContentsList1.push({
              doubleWeekContent: '',
            });
          }
        }
        this.reportContentsList1 = reportContentsList1;
        this.reportContentsList2 = reportContentsList2;
        this.reportContentsList3 = reportContentsList3;
      });
    },
    login() {
      if (this.num > 4) {
        this.$router.push('/login');
      } else {
        this.num = this.num + 1;
      }
    },
    homeImgeFn() {
      homeImge({}).then((res) => {
        var imgArr = res.msg;
        var imgReg = /<img.*?(?:>|\/>)/gi;
        var arr = imgArr.match(imgReg); // arr 为包含所有img标签的数组
        this.imgArr = arr;
      });
    },
    userTodayPlanNum() {
      userTodayPlanNum().then((res) => {
        if (res.code == 200) {
          this.todayGoal = res.data;
          this.progressWidth = (this.todayGoal.finishNum / this.todayGoal.planNum) * 100 + '%';
          localStorage.setItem('nickName', res.data.user.nickName);
          localStorage.setItem('storeType', res.data.user.type);
        } else {
          this.$toast.fail(res.msg);
        }
      });
    },
    loginLogFn() {
      // var ua="Mozilla/5.0 (Linux; Android 10; HRY-AL00Ta Build/HONORHRY-AL00Ta; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045737 Mobile Safari/537.36 wxwork/4.0.2 ColorScheme/Light MicroMessenger/7.0.1 NetType/WIFI Language/zh Lang/zh".toLowerCase();
      // console.log(ua)
      // var ua= window.navigator.userAgent.toLowerCase();
      // //  .toLowerCase();
      // if( (ua.match(/MicroMessenger/i) == 'micromessenger') && (ua.match(/wxwork/i) == 'wxwork') ){
      //
      // }else{
      //  this.$router.push("/err")
      // }
      var appVersion = navigator.appVersion;
      var Logapp = appVersion.split('(')[1].split(';');
      var arrLog = '';
      if (Logapp[0] == 'Linux') {
        arrLog = {
          browser: navigator.appCodeName,
          os: Logapp[1],
          phoneBrand: Logapp[2].split('/')[1],
          phoneModel: Logapp[2].split('/')[0],
        };
      } else {
        arrLog = {
          browser: navigator.appCodeName,
          os: Logapp[0],
          phoneBrand: '',
          phoneModel: '',
        };
      }
      loginLog(arrLog).then((res) => {
        if (res.code == 200) {
          console.log('设备记录成功');
        }
      });
    },
    onClickLeft() {
      this.$router.go(-1);
    },
    configFn() {
      this.show = false;
    },
  },
};
</script>
<style scoped>
.container {
  margin: 10px;
}

.container .van-collapse-item {
  margin-bottom: 10px;
  border-radius: 6px;
  overflow: hidden;
}

.linep p {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: #666;
  padding-left: 6px;
}

.linep .texttitle {
  color: #0057ba;
  position: relative;
  padding-left: 10px;
}
.linep .texttitledaily {
  color: #000;
  position: relative;
  padding-left: 10px;
}

.linep .texttitle2 {
  padding-left: 6px;
}

.linep .texttitle .opint {
  position: absolute;
  left: 0px;
  top: 6px;
  margin-right: 6px;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background-color: #0057ba;
}

.linep .texttitledaily .opint {
  position: absolute;
  left: 0px;
  top: 6px;
  margin-right: 6px;
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background-color: #0057ba;
}

.leftTitle {
  background-color: #74a4d9;
  color: #fff;
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
}

.rightTitle {
  background-color: #e7b4bb;
  color: #fff;
  display: inline-block;
  padding: 0 4px;
  border-radius: 2px;
}
</style>
<style>
.linep .van-cell__title {
  color: #1e5398;
  font-weight: 500;
}

.linep .contentContainer {
  background-color: white;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 10px;
}

.linep .contentContainer .contentContainerTitle {
  color: #222;
}

.linep .contentContainer .contentContainerTitle span {
  font-size: 12px;
  color: #666;
}

.linep .contentContainer .van-field__control {
  background-color: #ebf4ff;
  padding: 10px;
  border-radius: 8px;
}

.linep .contentContainer .van-cell {
  padding: 0;
}
.van-dialog__confirm,
.van-dialog__confirm:active {
  color: #0057ba;
}
</style>
