var seckillHtml = '
'; seckillHtml += ''; seckillHtml += '
'; seckillHtml += '
{{data.styleName}}
'; seckillHtml += '
选择
'; seckillHtml += '
'; seckillHtml += '
'; Vue.component("seckill-style", { template: seckillHtml, data: function() { return { data: this.$parent.data, } }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify : function () { var res = { code : true, message : "" }; return res; }, selectTestStyle: function() { var self = this; layer.open({ type: 1, title: '风格选择', area:['930px','630px'], btn: ['确定', '返回'], content: $(".draggable-element[data-index='" + self.data.index + "'] .edit-attribute .seckill-list-style").html(), success: function(layero, index) { $(".layui-layer-content input[name='style']").val(self.data.style); $(".layui-layer-content input[name='style_name']").val(self.data.styleName); $("body").on("click", ".layui-layer-content .style-list-con-seckill .style-li-seckill", function () { $(this).addClass("selected ns-border-color").siblings().removeClass("selected ns-border-color"); $(".layui-layer-content input[name='style']").val($(this).index() + 1); $(".layui-layer-content input[name='style_name']").val($(this).find("span").text()); }); }, yes: function (index, layero) { self.data.style = $(".layui-layer-content input[name='style']").val(); self.data.styleName = $(".layui-layer-content input[name='style_name']").val(); layer.closeAll() } }); }, } }) // 多选 var seckillContentHtml = '
'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '商品名称'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '商品价格'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '商品原价'; seckillContentHtml += '
'; seckillContentHtml += '
'; seckillContentHtml += '
'; /* seckillContentHtml += '
'; seckillContentHtml += '
商品名称
'; // seckillContentHtml += '
商品描述
'; seckillContentHtml += '
商品价格
'; seckillContentHtml += '
商品原价
'; // seckillContentHtml += '
剩余库存
'; seckillContentHtml += '
'; */ seckillContentHtml += '
'; Vue.component("seckill-content", { template: seckillContentHtml, data: function () { return { data: this.$parent.data, }; }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify : function () { var res = { code : true, message : "" }; return res; }, changeStatus: function(field) { this.$parent.data[field] = this.$parent.data[field] ? 0 : 1; } } }); // 顶部内容组件 var seckillTopConHtml = '
'; seckillTopConHtml += ''; seckillTopConHtml += ''; seckillTopConHtml += ''; seckillTopConHtml +='
'; Vue.component("seckill-top-content", { data: function () { return { data: this.$parent.data, list: this.$parent.data.list, listMore: this.$parent.data.listMore, imgUrl1: "", imgUrl2: "", imgUrl3: "" } }, created: function () { this.imgUrl1 = this.list[0].imageUrl; this.imgUrl2 = this.list[1].imageUrl; this.imgUrl3 = this.list[2].imageUrl; if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify : function () { var res = { code : true, message : "" }; return res; }, }, template: seckillTopConHtml }); // 图片上传 var seckillTopHtml = ''; Vue.component("seckill-top-list",{ template : seckillTopHtml, data : function(){ return { data : this.$parent.data, list : this.$parent.data.list, listMore: this.$parent.data.listMore }; }, created : function(){ if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods : { verify:function () { var res = { code : true, message : "" }; var _self = this; $(".draggable-element[data-index='" + this.data.index + "'] .graphic-navigation .graphic-nav-list>ul>li").each(function(index){ if(_self.selectedTemplate == "imageNavigation"){ $(this).find("input[name='title']").removeAttr("style");//清空输入框的样式 //检测是否有未上传的图片 if(_self.list[index].imageUrl == ""){ res.code = false; res.message = "请选择一张图片"; $(this).find(".error-msg").text("请选择一张图片").show(); return res; }else{ $(this).find(".error-msg").text("").hide(); } }else{ if(_self.list[index].title == ""){ res.code = false; res.message = "请输入标题"; $(this).find("input[name='title']").attr("style","border-color:red !important;").focus(); $(this).find(".error-msg").text("请输入标题").show(); return res; }else{ $(this).find("input[name='title']").removeAttr("style"); $(this).find(".error-msg").text("").hide(); } } }); return res; } } }); // 背景颜色可选 var seckillColorHtml = '
'; seckillColorHtml += ''; seckillColorHtml += '
'; seckillColorHtml += ''; seckillColorHtml += '
'; seckillColorHtml += '
'; Vue.component("seckill-color", { template: seckillColorHtml, data: function () { return { data: this.$parent.data, colorList: [ {name: "红", className: "red", color: "#FFD7D7"}, {name: "蓝", className: "blue", color: "#D7FAFF"}, {name: "黄", className: "yellow", color: "#FFF4E0"}, {name: "紫", className: "violet", color: "#F9E5FF"} ] }; }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify : function () { var res = { code : true, message : "" }; return res; } }, }); // 切换方式 var seckillChangeType = '
'; seckillChangeType += ''; seckillChangeType += '
'; seckillChangeType += ''; seckillChangeType += '
'; /* seckillChangeType += ''; seckillChangeType += '
'; seckillChangeType += ''; seckillChangeType += ''; seckillChangeType += '
'; */ seckillChangeType += '
'; Vue.component("seckill-change-type", { template: seckillChangeType, data: function () { return { data: this.$parent.data, changeTypeList: [ {name: "平移滑动", value: 1, src: seckillResourcePath + "/seckill/img/manual.png", selectedSrc: seckillResourcePath + "/seckill/img/manual_1.png"}, {name: "切屏滑动", value: 2, src: seckillResourcePath + "/seckill/img/manual.png", selectedSrc: seckillResourcePath + "/seckill/img/manual_1.png"}, ] }; }, created: function () { if(!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify);//加载验证方法 }, methods: { verify : function () { var res = { code : true, message : "" }; return res; } }, });