{
    template:'${tmpl}',
    data:function(){
      return {
        activeIndex:1,
        items:[
        ],
        sloganitems:[],
        active: 0,
        servicesitems:[
        ],
        channelData:[],
        tagnames:[
        ],
        onlines:[],
        coldata:[
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28102518d7t2.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28102536pxms.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/29105459d9vy.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/291055215r2b.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28102720ls56.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/29105614g0zz.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28102938lxnt.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28102955alon.jpg"},
          {"imgurl":"http://gsb-public.oss-cn-beijing.aliyuncs.com/cms/df61d7ee85b4bd5b3bc8eba7023374ff.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28103035bzm0.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28103047cys5.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/281031009q9y.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/281031110n4f.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28103124xr3g.jpg"},
          {"imgurl":"http://gsb-public.oss-cn-beijing.aliyuncs.com/cms/b98ce14d53f585716979d59198def45d.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/281031385j27.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/281033327e0o.jpg"},
          {"imgurl":"http://www.gongsibao.com/u/cms/w3/201703/28103319rq34.jpg"},
        ],
      };
    },
    mounted:function(){
      this.fetchData();
    },
    created:function(){

    },
    methods:{
      aboutus:function(){
         this.$router.push("/sysmag/articledetail/1");
      },
      rowclick:function(r){
        console.log("----------------------------------articledetail--------------------------------------");
        this.$router.push("/sysmag/articledetail/"+r.id);
      },
      detailclick:function(r){
        console.log("----------------------------------servicesitemdetail--------------------------------------");
        console.log(r);
        console.log(this.servicesitems);
        this.$router.push("/sysmag/servicesitemdetail/"+r.id);
      },
      moreclick:function(id){
        this.$router.push("/sysmag/channelquery/"+id);
      },
      fetchData(){
        var self=this;
        var q={};
        q.pageInfo={pageSize:20,pageNo:1};
        q.search={};
        q.channelCode = "index";
        this.$root.postReq("/web/loopplayCtl/findAndCountAll",q).then(d=>{
          d.data.rows.forEach(r=>{
            self.items.push(r);
          });
        });
        this.$root.postReq("/web/sloganpictureCtl/findAndCountAll",q).then(d=>{
          d.data.rows.forEach(r=>{
            self.sloganitems.push(r);
          });
        });
        this.$root.postReq("/web/servicesitemCtl/findAndCountAll",q).then(d=>{
          console.log("-----------------------------------ser");
          d.data.rows.forEach(r=>{
            self.servicesitems.push(r);
          });
        });
        var b={};
        b.dicKey="partnerinfoSkill";
        this.$root.getReq("/web/metaCtl/getDicConfig",b).then(cfg=>{
          console.log(JSON.stringify(cfg.data));
          Object.keys(cfg.data).forEach(key=>{
            self.tagnames.push({"code":key,"text":cfg.data[key]});
          });
        });

        this.$root.postReq("/web/appCtl/findHomeInitData",q).then(d=>{
          if(d && d.status==0){
            /*d.data.loopplays.rows.forEach(r=>{
              self.items.push(r);
            });*/
            d.data.news.forEach(r=>{
              self.channelData.push(r);
            });

            d.data.onlines.forEach(r=>{
              var arry= r.split("￥");
              var tmp={name:arry[2],imgurl:arry[3]};
              self.onlines.push(tmp);
            });
            console.log(d.data);
            self.$store.state.logoUrl=d.data.logoUrl;
            self.$store.state.appimgUrl=d.data.appimgUrl;
            localStorage.setItem("logoUrl",d.data.logoUrl);
            localStorage.setItem("appimgUrl",d.data.appimgUrl);
          }
        });
      },

    },
    vname:"gsb-homepage"
}
