{
    template:'${tmpl}',
    data:function(){
      var validateMobile = (rule, value, callback) =>{
        if(value==""){
          callback(new Error('请输入手机号码'));
        }else{
          var x=(/^1(3|4|5|7|8)\d{9}$/.test(value));
          if(!x){
            callback(new Error('手机号码格式有误'));
          }else{
            callback();
          }
        }
      };
        return {
          popupsDataList:[],
          pDataKey: 0,
          pTowDataKey: null,
          popupsData:[],
          bgcArr:[
            "background:url('/imgs/springz0.jpg')",
            "background:url('/imgs/springz1.jpg')",
            "background:url('/imgs/springz2.jpg')",
            "background:url('/imgs/springz0.jpg')",
            "background:url('/imgs/springz1.jpg')",
            "background:url('/imgs/springz2.jpg')",
          ],
          bgcUrl:[
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdsbtu.jpg',
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdbq.jpg',
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdzl.jpg',
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdgs.jpg',
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdcs.jpg',
            'http://gsb-zc.oss-cn-beijing.aliyuncs.com/default/zcsyhdjy.jpg',
          ],
          bgcArr2:[
            'background:linear-gradient(142deg, rgb(174, 201, 243) 0%, rgb(12, 56, 243) 100%);',
            'background:linear-gradient(142deg, rgb(212, 202, 239) 0%, rgb(75, 7, 245) 100%);',
            'background:linear-gradient(142deg, rgb(245, 222, 189) 0%, #fb9905 100%);',
            'background:linear-gradient(142deg,#65cfff 0%,#2a75fd 100%)',
            'background:linear-gradient(142deg,#ffd700 0%,#ff694a 100%)',
            'background:linear-gradient(142deg,#feabb6 0%,#e06e7c 100%)',
          ],
          slideLeft: false,
          slideRight: false,
          tabKey:null,
          cardKey:null,
          cardK:null,
          slideKey:null,
          swiperNum: 0,
          inputstr:"",
          itemtype:"ip",
          imgHeight:"",
          loopplays:[],
          datalist:[],
          widthnumber:"",
          dialogFormVisible:false,
          serviceName:"",
          serviceCode:"",
          form:{
            name:"",
            mobile:"",
            city:[],
            notes:""
          },
          rules:{
            name: [
              { required: true, message: '请输入您的名字', trigger: 'blur' }
            ],
            mobile: [
              { required: true,validator: validateMobile, trigger: 'blur' }
            ],
          },

        }
    },
    mounted:function(){
      this.$root.showHeadLogo();
      this.$root.headerRowType = true;
      window.addEventListener('scroll', this.handleScroll, true);
      var itemtype=this.$router.history.current.query.itemtype;
      if(itemtype!= null){
        this.itemtype=itemtype;
      };
      this.loopplays=loopplays;
      if(loopplays && loopplays.length==0){
        this.loopplays.push({"leftimg":"https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_202215516795147422019414514742leftimg.png"});
      }
      var self=this;
      var f=function(){
        var own=self;
        var t=setTimeout(()=>{
        if(own.$root.currentCompany){
            own.findAllServicesitemA();
            /*own.findAllServicesitem();*/
            clearTimeout(t);
        }else{
            f();
        }
        },1000);
      };
      f();
      
    },
    created:function(){
  
    },
    methods:{
      rightServiceModule (key,item) {
        if (item.length > 3) {
          if (((item.length/3) * 960) - Math.abs(this.swiperNum) >  960) {
            this.slideLeft = true;
            this.swiperNum = this.swiperNum - 960;
            this.$refs.serviceModule[key].style.transform = 'translateX(' + this.swiperNum + 'px) scale(1)';
          } else {
            this.slideRight = false;
            this.$message({
              message: '没有更多了',
              type: 'warning'
            });
          }   
        }
      },
      leftServiceModule(key,item) {
        if (item.length > 3) {
          console.log(this.swiperNum,'kanzheliaaaaaaaaaaaaaaaaaaaaa');
          if (this.swiperNum < 0) {
            this.slideRight = true;
            this.swiperNum = this.swiperNum + 960;
            this.$refs.serviceModule[key].style.transform = 'translateX(' + this.swiperNum + 'px) scale(1)';
          } else {
            this.slideLeft = false;
            this.$message({
              message: '没有更多了',
              type: 'warning'
            });
          }   
        }
      },
      moveLocation (key,move) {
        if (this.swiperNum != move) {
          this.swiperNum = -move;
          this.$refs.serviceModule[key].style.transform = 'translateX(' + -move + 'px) scale(1)';
        }
        /* 点击下面导航点 跳转 */
      },
      handleScroll () {
        var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
      },
      goServiceDetails(i){
        console.log('?????????????????????');
        if (i.code == 'zzsbzc') {
          this.$root.popupsType = false;
          this.$root.pushx({
            title:"自主商标注册",
            name:"/selftmreg",
            params:{itemCode:i.code}
          });
        }else {
          window.open(window.location.href.split("#")[0]+"#/servicedetails?isDirectJump=1&sdsId="+i.id)
        }
      },
      enterCard(k,key) {
        this.cardK = k;
        this.cardKey = key;
      },
      /* 移入 */
      enter (key,item) {
        if (item.length > 3) {
          this.slideKey = key;
          this.slideRight = true;
          this.slideLeft = true;
        }
      },
      /* 移出 */
      leave () {
        this.slideLeft = false;
        this.slideRight = false;
        this.slideKey = null;
      },
      onfocus(){
        if(this.inputstr==""){
          this.$message({
              type: 'error',
              message: '请填写搜索内容'
            });
        }else{
          this.$root.pushx({
            title:"标眼查",
            name:"/bycquerytm",
            params:{tminput:this.inputstr}
          });
        }
      },
      showneed(name,code){
        this.dialogFormVisible=true;
        this.serviceName=name;
        this.serviceCode=code;		
      },
      toZzsbzc(name,code){
        if(code){
          this.$root.pushx({
            title:"自主商标注册",
            name:"/selftmreg",
            params:{itemCode:code}
          });
        }else{
         this.$message.warning("产品编码错误");
        }
      },     
      styleset(obj){
        var that=this;
        that.widthnumber=1200/that.datalist.length+"px";
        console.log("width:",that.widthnumber);
        if(that.itemtype==obj){
          return {width:that.widthnumber,color:'#2692FF'};
        }else{
          return {width:that.widthnumber,color:'#B2B2B2'};
        }
      },
      change(obj,key){
        this.tabKey = key;
        this.itemtype=obj;
        this.styleset();
      },
      popupsList (list,key) {
          this.popupsDataList = list.smallList;
          this.pDataKey = key;
          this.pTowDataKey = key;
      },
      popupsLeave() {
        this.pTowDataKey = null;
      },
      findAllServicesitemA(){
          /*this.company_id=this.$root.currentCompany.id;*/
          var params={company_id:this.$root.currentCompany?this.$root.currentCompany.id:""};
          var that=this;
       
          that.company_id=that.$root.currentCompany.id;
          that.popupsData = [];
          if(productLst){
            productLst.forEach(r=>{
              if(r){
                  that.popupsData.push(r);
              }
              that.popupsDataList = that.popupsData[0].smallList;
              });
              that.datalist = that.popupsData;
              that.$root.popupsType = true;
              $("#header").addClass("headtransparent");
              $("#welcome").css("color", "#fff");
              $("#exitbtn").css("color", "#fff");
              $("#adminbtn").css("color", "#fff");
              $('.nav_color').css("color",'#fff');

              that.$root.popupsData=that.popupsData;
              that.$root.popupsDataList=  that.popupsDataList;

          }
        
      },
      goServiceDetails(item){
        if (item.code == 'zzsbzc') {
          $('.popups').fadeOut(200);
          this.popupsType = false;
          this.$root.pushx({
            title:"自主商标注册",
            name:"/selftmreg",
            params:{itemCode:item.code}
          });
        }else {
          this.$root.windowOpen({
            url:window.location.href.split("#")[0]+"#/servicedetails",
            title:"服务详情",
            params:[
              {name:"sdsId",value: item.id}
            ]
          })
        }
        /*setTimeout(()=>{
          this.$refs.topmenu.fetchMetaData(()=>{

          });
        },300);*/
      }
    },
    computed:{
    },
    vname:"gsb-moreservice"
}
