design.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // 显示内容
  2. var showContentHtml = '<div class="layui-form-item goods-show-box checkbox-wrap">';
  3. showContentHtml += '<div class="layui-input-block">';
  4. showContentHtml += '<div class="layui-input-inline-checkbox">';
  5. showContentHtml += '<span>主播信息</span>';
  6. showContentHtml += '<div @click="changeStatus(\'isShowAnchorInfo\')" class="layui-unselect layui-form-checkbox" :class="{\'layui-form-checked\': (data.isShowAnchorInfo == 1)}" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>';
  7. showContentHtml += '</div>';
  8. showContentHtml += '<div class="layui-input-inline-checkbox">';
  9. showContentHtml += '<span>直播商品</span>';
  10. showContentHtml += '<div @click="changeStatus(\'isShowLiveGood\')" class="layui-unselect layui-form-checkbox" :class="{\'layui-form-checked\': (data.isShowLiveGood == 1)}" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>';
  11. showContentHtml += '</div>';
  12. showContentHtml += '</div>';
  13. showContentHtml += '</div>';
  14. Vue.component("live-show-content", {
  15. template: showContentHtml,
  16. data: function () {
  17. return {
  18. data: this.$parent.data,
  19. isShowAnchorInfo: this.$parent.data.isShowAnchorInfo,
  20. isShowLiveGood: this.$parent.data.isShowLiveGood,
  21. };
  22. },
  23. created: function () {
  24. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  25. this.$parent.data.verify.push(this.verify);//加载验证方法
  26. },
  27. methods: {
  28. verify :function () {
  29. var res = { code: true, message: "" };
  30. return res;
  31. },
  32. changeStatus: function(field) {
  33. this.$parent.data[field] = this.$parent.data[field] ? 0 : 1;
  34. }
  35. }
  36. });
  37. // 显示内容
  38. var liveSetHtml = '<div></div>';
  39. Vue.component("live-set", {
  40. template: liveSetHtml,
  41. data: function () {
  42. return {};
  43. },
  44. created: function () {
  45. this.$parent.data.ignore = ['marginBoth', 'textColor', 'elementAngle', 'componentAngle', 'elementBgColor', 'componentBgColor', 'pageBgColor']; //加载忽略内容 -- 其他设置中的属性设置
  46. this.$parent.data.ignoreLoad = true; // 等待忽略数组赋值后加载
  47. }
  48. });