{
        template: '${tmpl}',
                data: function() {
                        return {
                                nav: [
                                        {
                                                name: '类别',
                                                item: [
                                                        { code: "01", name: "化学原料", type: 1, color: false, }, { code: "02", name: "颜料油漆", type: 1, color: false, }, { code: "03", name: "日化用品", type: 1, color: false, }, { code: "04", name: "燃料油脂", type: 1, color: false, }, { code: "05", name: "医药", type: 1, color: false, },
                                                        { code: "06", name: "金属材料", type: 1, color: false, }, { code: "07", name: "机械设备", type: 1, color: false, }, { code: "08", name: "手工器械", type: 1, color: false, }, { code: "09", name: "科学仪器", type: 1, color: false, }, { code: "10", name: "医疗器械", type: 1, color: false, },
                                                        { code: "11", name: "灯具空调", type: 1, color: false, }, { code: "12", name: "运输工具", type: 1, color: false, }, { code: "13", name: "军火烟火", type: 1, color: false, }, { code: "14", name: "珠宝钟表", type: 1, color: false, }, { code: "15", name: "乐器", type: 1, color: false, },
                                                        { code: "16", name: "办公用品", type: 1, color: false, }, { code: "17", name: "橡胶制品", type: 1, color: false, }, { code: "18", name: "皮革皮具", type: 1, color: false, }, { code: "19", name: "建筑材料", type: 1, color: false, }, { code: "20", name: "家具", type: 1, color: false, },
                                                        { code: "21", name: "厨房洁具", type: 1, color: false, }, { code: "22", name: "绳网袋篷", type: 1, color: false, }, { code: "23", name: "纱线丝", type: 1, color: false, }, { code: "24", name: "布料床单", type: 1, color: false, }, { code: "25", name: "服装鞋帽", type: 1, color: false, },
                                                        { code: "26", name: "纽扣拉链", type: 1, color: false, }, { code: "27", name: "地毯席垫", type: 1, color: false, }, { code: "28", name: "健身器材", type: 1, color: false, }, { code: "29", name: "食品", type: 1, color: false, }, { code: "30", name: "方便食品", type: 1, color: false, },
                                                        { code: "31", name: "饲料种籽", type: 1, color: false, }, { code: "32", name: "啤酒饮料", type: 1, color: false, }, { code: "33", name: "酒", type: 1, color: false, }, { code: "34", name: "烟草烟具", type: 1, color: false, }, { code: "35", name: "广告销售", type: 1, color: false, },
                                                        { code: "36", name: "金融物管", type: 1, color: false, }, { code: "37", name: "建筑修理", type: 1, color: false, }, { code: "38", name: "通讯服务", type: 1, color: false, }, { code: "39", name: "运输贮藏", type: 1, color: false, }, { code: "40", name: "材料加工", type: 1, color: false, },
                                                        { code: "41", name: "教育娱乐", type: 1, color: false, }, { code: "42", name: "网站服务", type: 1, color: false, }, { code: "43", name: "餐饮住宿", type: 1, color: false, }, { code: "44", name: "医疗园艺", type: 1, color: false, }, { code: "45", name: "社会服务", type: 1, color: false, }
                                                ],
                                        },
                                        {
                                                name: '价格',
                                                item: [
                                                        {
                                                                name: '1万以下',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '1-2万',
                                                                color: false,

                                                        },
                                                        {
                                                                name: '2-5万',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '5-8万',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '8-15万',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '15万以上',
                                                                color: false,
                                                        }
                                                ],
                                        },
                                        {
                                                name: '商标结构',
                                                item: [
                                                        {
                                                                name: '纯中文',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '中文+英文',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '中文+图形',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '英文+图形',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '纯英文',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '中文+英文+图形',
                                                                color: false,
                                                        }
                                                ],

                                        },
                                        {
                                                name: '商标字数',
                                                item: [
                                                        {
                                                                name: '1-2个字',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '3个字',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '4个字',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '5个字',
                                                                color: false,
                                                        },
                                                        {
                                                                name: '5个字以上',
                                                                color: false,
                                                        },

                                                ],

                                        },
                                ],
                                item: [],
                                searchValue: '',
                                showFileter: false,
                                obj: {
                                        currentpage: 1,
                                        keyword: "",
                                        max: 1000000,
                                        min: 0,
                                        order: "",
                                        pagesize: 10,
                                        sort: "",
                                        tm_nclcode: [],
                                        tm_structure: "",
                                        tm_word: "",
                                },
                                selectedColor: false,
                                selected: '',
                                list: [],
                                dataNull: false,
                                typeList: [],
                                count: '',
                                currentpage: 1,
                                autoFill: false,
                                allLoaded: false,
                        }
                },
        mounted: function() {
                if (Object.prototype.toString.call(this.$route.query.type) == '[object String]') {
                        let type = JSON.parse(this.$route.query.type);
                        if (type) {
                                this.obj.tm_nclcode = type;
                        }
                }

                this.$root.hidemenu();
                this.currentpage = 1;
                this.$root.postReq('/web/trademarktransactionCtl/tmTransactionSearch', this.obj).then((res) => {
                        if (res.status == 0) {
                                this.count = res.total;
                                this.list = res.data.rows;
                                console.log('cccccccccccccccccccccccc', res, this.list);
                                this.list.length > 0 ? this.dataNull = true : this.dataNull = false;
                        }
                });
        },
        created: function() {
                this.searchValue = this.$route.query.data;
                console.log('xxxxxxxxxx');
                this.obj.keyword = this.searchValue;
        },
        watch: {

        },
        methods: {
                toggleSelected(item, index){
                        this.showFileter = true;
                        this.selected = index;
                        /* */
                        if (index == 0) {
                                let num = parseInt(item.item[index].name);

                                if (isNaN(num)) {
                                        item.item.forEach((item, index) => {
                                                item.name = item.code + item.name;
                                        });
                                        this.item = item.item;
                                } else {
                                        this.item = item.item;
                                }

                        } else {
                                this.item = item.item;
                        }

                },
                searchBrand(item, index){
                        /*根据sclected判断储存对象 */
                        /*控制点击颜色 */
                        if (this.selected == 0) {
                                this.item[index].color = !this.item[index].color;
                        } else {
                                this.item.forEach((element, i) => {
                                        this.item[i].color = false;
                                        this.item[i].count = 1;
                                });
                                this.item[index].color = !this.item[index].color;
                        }

                        switch (this.selected) {
                                case 0:
                                        if (this.typeList.includes(index + 1)) {
                                                var sign = this.typeList.indexOf(index + 1);
                                                this.typeList.splice(sign, 1);
                                                this.obj.tm_nclcode = this.typeList;
                                        } else {
                                                this.typeList.push(index + 1);
                                                this.obj.tm_nclcode = this.typeList;
                                        }
                                        console.log(this.typeList);
                                        break;
                                case 1:
                                        if (index == 0) {
                                                this.obj.min = 0;
                                                this.obj.max = 10000;
                                        }
                                        if (index == 1) {
                                                this.obj.min = 10000;
                                                this.obj.max = 20000;
                                        }
                                        if (index == 2) {
                                                this.obj.min = 20000;
                                                this.obj.max = 50000;
                                        }
                                        if (index == 3) {
                                                this.obj.min = 50000;
                                                this.obj.max = 80000;
                                        }
                                        if (index == 4) {
                                                this.obj.min = 80000;
                                                this.obj.max = 150000;
                                        }
                                        if (index == 5) {
                                                this.obj.min = 150000;
                                        }




                                        break;
                                case 2:

                                        this.obj.tm_structure = item.name;



                                        break;
                                case 3:
                                        this.obj.tm_word = item.name;
                                        break;

                                default:
                                        break;
                        }



                },
                maskedFileter(){
                        this.showFileter = false;
                },
                resetSearch(){
                        this.typeList = [];
                        this.obj = {
                                currentpage: 1,
                                keyword: "",
                                max: 1000000,
                                min: 0,
                                order: "",
                                pagesize: 10,
                                sort: "",
                                tm_nclcode: [],
                                tm_structure: "",
                                tm_word: "",
                        };
                        console.log(this.obj, "........");
                        this.item.forEach((item, index) => {
                                this.item[index].color = false;
                        });
                },
                dealSearch(){
                        this.currentpage = 1;
                        this.obj.currentpage = this.currentpage;
                        this.$root.postReq('/web/trademarktransactionCtl/tmTransactionSearch', this.obj).then((res) => {
                                if (res.status == 0) {
                                        this.count = res.total;
                                        this.list = res.data.rows;
                                        this.list.length > 0 ? this.dataNull = true : this.dataNull = false;
                                }

                        });
                        this.$refs.search.getObj(this.obj);
                        this.showFileter = false;
                },
                searchResult(data){
                        this.list = data;
                        if (data) {
                                this.dataNull = true;
                        }
                },
                loadBottom() {
                        this.obj.currentpage = ++this.currentpage;
                        this.$root.postReq('/web/trademarktransactionCtl/tmTransactionSearch', this.obj).then((res) => {
                                if (res.status == 0) {
                                        if (this.obj.currentpage != 1) {
                                                this.list.push(...res.data.rows);
                                        } else {
                                                this.list = res.data.rows;
                                        }

                                        this.count = res.total;
                                        console.log(this.list, 'bbbbbbbbbbbbbb', ...res.data.rows);
                                        this.list.length > 0 ? this.dataNull = true : this.dataNull = false;
                                        if (this.list.length >= this.count) {
                                                this.allLoaded = true;
                                        }
                                }
                        });
                },
                goDeatails(item){
                        let obj = JSON.stringify(item);
                        this.$router.push({path:'/mobiledealdetail',query:{obj}});
                }
                /*
                getLoginUser : function (){
                  var self =this;
                  this.$root.postReq("/web/userCtl/loginUser",{}).then(function(d){
                    if(d.status==0){
                      self.loginUser = d.data;
                    }
                  });
                }
                */
        },
        vname: "gsb-mobiledeallist"
}
