design.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <nc-component :data="data[index]" class="goods-brand">
  2. <!-- 预览 -->
  3. <template slot="preview">
  4. <div class="brand-wrap" :style="{ backgroundColor: nc.componentBgColor,
  5. borderTopLeftRadius: (nc.componentAngle == 'round' ? nc.topAroundRadius + 'px' : 0),
  6. borderTopRightRadius: (nc.componentAngle == 'round' ? nc.topAroundRadius + 'px' : 0),
  7. borderBottomLeftRadius: (nc.componentAngle == 'round' ? nc.bottomAroundRadius + 'px' : 0),
  8. borderBottomRightRadius: (nc.componentAngle == 'round' ? nc.bottomAroundRadius + 'px' : 0),
  9. boxShadow: nc.ornament.type == 'shadow' ? ('0 0 5px ' + nc.ornament.color) : '',
  10. border: nc.ornament.type == 'stroke' ? '1px solid ' + nc.ornament.color : ''
  11. }">
  12. <h3 class="title-wrap" v-show="nc.title" :style="{ color : nc.textColor, fontWeight : nc.fontWeight ? 'bold' : ''}">{{ nc.title }}</h3>
  13. <ul v-if="nc.previewList && Object.keys(nc.previewList).length">
  14. <li v-for="(item, previewIndex) in nc.previewList" :key="previewIndex">
  15. <img :src="item.image_url ? changeImgUrl(item.image_url) : '{$resource_path}/img/default.png'" :style="{
  16. borderTopLeftRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
  17. borderTopRightRadius: (nc.elementAngle == 'round' ? nc.topElementAroundRadius + 'px' : 0),
  18. borderBottomLeftRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0),
  19. borderBottomRightRadius: (nc.elementAngle == 'round' ? nc.bottomElementAroundRadius + 'px' : 0)
  20. }" onerror="this.src = '{$resource_path}/img/default.png';" />
  21. </li>
  22. </ul>
  23. </div>
  24. </template>
  25. <!-- 内容编辑 -->
  26. <template slot="edit-content">
  27. <template v-if="nc.lazyLoad">
  28. <goods-brand-sources></goods-brand-sources>
  29. <div class="template-edit-title">
  30. <h3>品牌标题</h3>
  31. <div class="layui-form-item">
  32. <label class="layui-form-label sm">标题</label>
  33. <div class="layui-input-block">
  34. <input type="text" v-model="nc.title" maxlength="20" placeholder="请输入标题" class="layui-input">
  35. </div>
  36. </div>
  37. </div>
  38. <div class="template-edit-title">
  39. <h3>品牌数据</h3>
  40. <div class="layui-form-item" v-if="nc.tempData.goodsSources">
  41. <label class="layui-form-label sm">数据来源</label>
  42. <div class="layui-input-block">
  43. <div class="source-selected">
  44. <div class="source">{{ nc.tempData.goodsSources[nc.sources].text }}</div>
  45. <div v-for="(item,sourcesKey) in nc.tempData.goodsSources" :key="sourcesKey" class="source-item" :title="item.text" @click="nc.sources=sourcesKey" :class="{ 'text-color border-color' : (nc.sources == sourcesKey) }">
  46. <i class='iconfont' :class='item.icon'></i>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="layui-form-item" v-if="nc.sources == 'diy'">
  52. <label class="layui-form-label sm">手动选择</label>
  53. <div class="layui-input-block">
  54. <div class="selected-style" @click="nc.tempData.methods.addBrand()">
  55. <span v-if="nc.brandIds.length == 0">请选择</span>
  56. <span v-if="nc.brandIds.length > 0" class="text-color">已选{{ nc.brandIds.length }}个</span>
  57. <i class="iconfont iconyoujiantou"></i>
  58. </div>
  59. </div>
  60. </div>
  61. <slide :data="{ field : 'count', label: '品牌数量', min:1, max: 30}" v-if="nc.sources != 'diy'"></slide>
  62. </div>
  63. </template>
  64. </template>
  65. <!-- 样式编辑 -->
  66. <template slot="edit-style">
  67. <template v-if="nc.lazyLoad">
  68. <div class="template-edit-title">
  69. <h3>品牌样式</h3>
  70. <div class="layui-form-item">
  71. <label class="layui-form-label sm">标题粗细</label>
  72. <div class="layui-input-block">
  73. <div class="layui-unselect layui-form-checkbox" lay-skin="primary" @click="nc.fontWeight = !nc.fontWeight" :class="{ 'layui-form-checked' : nc.fontWeight }">
  74. <span>{{ nc.fontWeight ? '粗' : '细' }}</span>
  75. <i class="layui-icon layui-icon-ok"></i>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="layui-form-item tag-wrap">
  80. <label class="layui-form-label sm">边框</label>
  81. <div class="layui-input-block">
  82. <div v-for="(item,ornamentIndex) in nc.tempData.ornamentList" :key="ornamentIndex" @click="nc.ornament.type=item.type" :class="{ 'layui-unselect layui-form-radio' : true,'layui-form-radioed' : (nc.ornament.type==item.type) }">
  83. <i class="layui-anim layui-icon">{{ nc.ornament.type == item.type ? "&#xe643;" : "&#xe63f;" }}</i>
  84. <div>{{item.text}}</div>
  85. </div>
  86. </div>
  87. </div>
  88. <color v-if="nc.ornament.type != 'default'" :data="{ field : 'color', 'label' : '边框颜色', parent : 'ornament', defaultColor : '#EDEDED' }"></color>
  89. <slide v-show="nc.elementAngle == 'round'" :data="{ field : 'topElementAroundRadius', label : '上圆角', max : 50 }"></slide>
  90. <slide v-show="nc.elementAngle == 'round'" :data="{ field : 'bottomElementAroundRadius', label : '下圆角', max : 50 }"></slide>
  91. </div>
  92. </template>
  93. </template>
  94. <!-- 资源 -->
  95. <template slot="resource">
  96. <css src="{$resource_path}/css/design.css"></css>
  97. <js src="{$resource_path}/js/design.js"></js>
  98. </template>
  99. </nc-component>