// 幻灯片·组件 var videoPreviewHtml = '
'; videoPreviewHtml += '
'; videoPreviewHtml += '
'; videoPreviewHtml += '
'; Vue.component("szy-video", { data: function () { return { id: "video_" + get_math_rant(10), data: this.$parent.data, list: this.$parent.data.list, videoWidth: 710 } }, created: function () { if (!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify); //加载验证方法 }, watch: { list : function(val, oldval){ console.log(val) console.log(oldval) }, }, methods: { verify: function () { var res = { code: true, message: "" }; return res; }, }, template: videoPreviewHtml }); /** * [视频的图片]·组件 */ var videoListHtml = '
'; videoListHtml += '
'; videoListHtml += ''; videoListHtml += '
'; videoListHtml += '
'; videoListHtml += ''; videoListHtml += '
'; videoListHtml += '
'; videoListHtml += '

其他设置

'; videoListHtml += ''; videoListHtml += '
'; videoListHtml += '
'; videoListHtml += ''; videoListHtml += '
'; videoListHtml += ''; videoListHtml += '
'; videoListHtml += '
'; videoListHtml += '
'; Vue.component("video-list", { data: function () { return { data: this.$parent.data, showAddItem: true, list: this.$parent.data.list, imageScale: this.$parent.data.imageScale, padding: this.$parent.data.padding, maxTip: 5, //最大上传数量提示 scrollSettingList: [{ name: "固定", value: "fixed", max: 5 }], }; }, created: function () { this.changeShowAddItem(); if (!this.$parent.data.verify) this.$parent.data.verify = []; this.$parent.data.verify.push(this.verify); //加载验证方法 }, watch: { list: function () { this.changeShowAddItem(); } }, methods: { //改变图文导航按钮的显示隐藏 changeShowAddItem: function () { if (this.list.length >= this.scrollSettingList[0].max) this.showAddItem = false; else this.showAddItem = true; this.maxTip = this.scrollSettingList[0].max; }, //改变上下边距 changePadding: function (event) { var v = event.target.value; if (v != "") { if (v >= 0 && v <= 100) { this.padding = v; this.$parent.data.padding = this.padding; //更新父级对象 } else { layer.msg("请输入合法数字0~100"); } } else { layer.msg("请输入合法数字0~100"); } }, verify: function () { var res = { code: true, message: "" }; var _self = this; $(".draggable-element[data-index='" + this.data.index + "'] .slider .slider-list .template-edit-wrap>ul>li").each(function (index) { $(this).find("input[name='title']").removeAttr("style"); //清空输入框的样式 //检测是否有未上传的视频 if (_self.list[index].videoUrl == "") { res.code = false; res.message = "请选择视频"; $(this).find(".error-msg").text("请选择视频").show(); return res; } else { $(this).find(".error-msg").text("").hide(); } }); return res; } }, template: videoListHtml }); var videoRadiusHtml = '
'; videoRadiusHtml += ''; videoRadiusHtml += '
'; videoRadiusHtml += ''; videoRadiusHtml += ''; videoRadiusHtml += '
'; videoRadiusHtml += '
'; Vue.component("video-radius", { template: videoRadiusHtml, data: function () { return { data: this.$parent.data, sliderRadius: [{ text: "直角", value: "right-angle", src: sliderResourcePath + "/graphic_nav/img/right-angle.png", selectedSrc: sliderResourcePath + "/graphic_nav/img/right-angle_1.png" }, { text: "圆角", value: "fillet", src: sliderResourcePath + "/graphic_nav/img/fillet.png", selectedSrc: sliderResourcePath + "/graphic_nav/img/fillet_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; }, }, });