';
goodsTagStyleHtml += '
';
goodsTagStyleHtml += '
';
goodsTagStyleHtml += '
';
goodsTagStyleHtml += '
';
Vue.component("goods-tag-style", {
template: goodsTagStyleHtml,
data: function() {
return {
data: this.$parent.data,
styleList: [
{
text: "默认",
value: "default"
},
{
text: "不显示",
value: "notshow"
},
{
text: "自定义",
value: "diy"
}
]
}
},
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;
if (_self.data.goodsTag == 'diy' && _self.data.tagImg.imageUrl == '') {
res.code = false;
res.message = "请添加图片";
$('.goods-tag-component .error-msg').text("请添加图片").show();
} else {
$('.goods-tag-component .error-msg').text("请添加图片").hide();
}
return res;
}
}
});