index.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <cm-construct v-bind:data="data[index]" class="component-title">
  2. <!-- 预览 -->
  3. <template slot="preview">
  4. <div class="preview-box" v-bind:style="{textAlign: nc.alignStyle, backgroundColor : nc.backgroundColor, margin : nc.marginTop + 'px 15px 0'}">
  5. <!-- 图一 -->
  6. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-if="nc.style == 1">
  7. <div class="text-title-box" v-show="nc.title">
  8. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, padding: '0 7px' }">{{ nc.title }}</span>
  9. <span class="line-left" v-bind:style="{ background: nc.textColor }"></span>
  10. <span class="line-right" v-bind:style="{ background: nc.textColor }"></span>
  11. </div>
  12. </div>
  13. <!-- 图二 -->
  14. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 2">
  15. <div class="text-title-box" v-show="nc.title">
  16. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px' }">{{ nc.title }}</span>
  17. </div>
  18. <div v-bind:class="'text-title-con'+ nc.style">
  19. <span class="inner-line" v-bind:style="{ background: nc.textColor }"></span>
  20. <span class="line-triangle" v-bind:style="{ borderColor: nc.textColor, opacity: nc.textColor ? 1 : 0 }"></span>
  21. </div>
  22. </div>
  23. <!-- 图三 -->
  24. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 3">
  25. <div class="text-title-box" v-show="nc.title">
  26. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px' }">{{ nc.title }}</span>
  27. </div>
  28. <div v-bind:class="'text-title-con'+ nc.style">
  29. <span class="inner-line" v-bind:style="{ background: nc.textColor }"></span>
  30. <span class="line-short" v-bind:style="{ background: nc.textColor, opacity: nc.textColor ? 1 : 0 }"></span>
  31. </div>
  32. </div>
  33. <!-- 图四 -->
  34. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 4">
  35. <div class="text-title-box" v-show="nc.title">
  36. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px' }">{{ nc.title }}</span>
  37. </div>
  38. <div class="text-title-line">
  39. <span class="line-left" v-bind:style="{ background: nc.textColor }"></span>
  40. <span class="line-center" v-bind:style="{ borderColor: nc.textColor, opacity: nc.textColor ? 1 : 0 }"></span>
  41. <span class="line-right" v-bind:style="{ background: nc.textColor }"></span>
  42. </div>
  43. </div>
  44. <!-- 图五 -->
  45. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 5">
  46. <div class="text-title-box" v-show="nc.title">
  47. <span class="text-title-block" v-bind:style="{ borderColor: nc.textColor, opacity: nc.textColor ? 1 : 0 }">
  48. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px', borderColor: nc.textColor }">{{ nc.title }}</span>
  49. <span class="line-left" v-bind:style="{ background: nc.textColor }"></span>
  50. <span class="line-right" v-bind:style="{ background: nc.textColor }"></span>
  51. </span>
  52. </div>
  53. </div>
  54. <!-- 图六 -->
  55. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 6">
  56. <div class="text-title-box" v-show="nc.title">
  57. <span class="text-title-outer" v-bind:style="{ borderColor: nc.textColor }">
  58. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px', borderColor: nc.textColor, background: '#fff' }">{{ nc.title }}</span>
  59. <span class="text-title-con-2" v-bind:style="{ borderColor: nc.textColor, opacity: nc.textColor ? 1 : 0 }"></span>
  60. </span>
  61. </div>
  62. </div>
  63. <!-- 图七 -->
  64. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 7">
  65. <div class="text-title-box" v-show="nc.title">
  66. <span class="text-title-outer" v-bind:style="{ borderColor: nc.textColor }">
  67. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : '#fff', paddingBottom: 3+'px', borderColor: nc.textColor, background: nc.textColor, opacity: nc.textColor ? 1 : 0 }">{{ nc.title }}</span>
  68. <span class="text-title-con-2" v-bind:style="{ borderColor: nc.textColor, opacity: nc.textColor ? 1 : 0 }"></span>
  69. </span>
  70. </div>
  71. </div>
  72. <!-- 图八 -->
  73. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 8" >
  74. <div class="text-title-box" v-show="nc.title" v-bind:style="{ textAlign: 'left'}">
  75. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px' }">{{ nc.title }}</span>
  76. <span class="line-left" v-bind:style="{ height: (nc.fontSize*1 + 2) + 'px', background: nc.textColor}"></span>
  77. </div>
  78. </div>
  79. <!-- 图九 -->
  80. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 9" >
  81. <div class="text-title-box" v-show="nc.title">
  82. <div class="left"></div>
  83. <div class="center">
  84. <div><img src="{$resourceurl}/text/img/style9-1.png" /></div>
  85. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px', fontWeight: nc.fontWeight }">{{ nc.title }}</span>
  86. <div><img src="{$resourceurl}/text/img/style9-2.png" /></div>
  87. </div>
  88. <div v-show="nc.isShowMore == 1" class="more" v-bind:style="{ color: nc.btnColor, opacity: nc.btnColor ? 1 : 0 }">{{nc.moreText}} <i class="iconfont iconyoujiantou"></i></div>
  89. </div>
  90. <div class="text-subTitle-box" v-show="nc.subTitle">
  91. <p v-show="nc.subTitle" v-bind:style="{ fontSize : nc.fontSizeSub + 'px', color: nc.colorSub, opacity: nc.colorSub ? 1 : 0 }">{{ nc.subTitle }}</p>
  92. </div>
  93. </div>
  94. <!-- 图十 -->
  95. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 10" >
  96. <div class="text-title-box" v-show="nc.title">
  97. <div class="left"></div>
  98. <div class="center">
  99. <div><img src="{$resourceurl}/text/img/style10-1.png" /></div>
  100. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px', fontWeight: nc.fontWeight }">{{ nc.title }}</span>
  101. <div><img src="{$resourceurl}/text/img/style10-2.png" /></div>
  102. <img src="{$resourceurl}/text/img/style10-3.png" />
  103. </div>
  104. <div v-show="nc.isShowMore == 1" class="more" v-bind:style="{ color: nc.btnColor, opacity: nc.btnColor ? 1 : 0 }">{{nc.moreText}} <i class="iconfont iconyoujiantou"></i></div>
  105. </div>
  106. <div class="text-subTitle-box" v-show="nc.subTitle">
  107. <p v-show="nc.subTitle" v-bind:style="{ fontSize : nc.fontSizeSub + 'px', color: nc.colorSub, opacity: nc.colorSub ? 1 : 0 }">{{ nc.subTitle }}</p>
  108. </div>
  109. </div>
  110. <!-- 图十一 -->
  111. <div class="text-title" v-bind:class="'text-title-'+ nc.style" v-else-if="nc.style == 11" >
  112. <div class="text-title-box" v-show="nc.title">
  113. <div class="left">
  114. <span class="text-title-con" v-bind:style="{ fontSize : nc.fontSize + 'px', color : nc.textColor, opacity: nc.textColor ? 1 : 0, paddingBottom: 3+'px', fontWeight: nc.fontWeight }">{{ nc.title }}</span>
  115. <div class="text-subTitle-box" v-show="nc.subTitle">
  116. <p v-show="nc.subTitle" v-bind:style="{ fontSize : nc.fontSizeSub + 'px', color: nc.colorSub, opacity: nc.colorSub ? 1 : 0 }">{{ nc.subTitle }}</p>
  117. </div>
  118. </div>
  119. <div v-show="nc.isShowMore == 1" class="more" v-bind:style="{ color: nc.btnColor, opacity: nc.btnColor ? 1 : 0 }"><span>{{nc.moreText}}</span> <i class="iconfont iconyoujiantou"></i></div>
  120. <img class="left-img" src="{$resourceurl}/text/img/style11-1.png" />
  121. <img class="right-img" src="{$resourceurl}/text/img/style11-2.png" />
  122. </div>
  123. </div>
  124. </div>
  125. </template>
  126. <!-- 编辑 -->
  127. <template slot="edit">
  128. <template v-if="nc.lazyLoad">
  129. <!-- <text-style></text-style> -->
  130. </template>
  131. <!-- <h3 class="template-title">文本名</h3>
  132. <div class="layui-form-item ns-padding-left">
  133. <input type="text" v-model="nc.title" v-bind:id="'title_'+index" placeholder="请输入文本" class="layui-input">
  134. </div> -->
  135. <div class="layui-form-item">
  136. <label class="layui-form-label sm">文本名称</label>
  137. <div class="layui-input-block">
  138. <input type="text" v-model="nc.title" v-bind:id="'title_'+index" placeholder="请输入文本" class="layui-input">
  139. </div>
  140. </div>
  141. <sel-link v-bind:data="{ field : nc.link }"></sel-link>
  142. <div class="template-edit-title">
  143. <h3>文字显示样式</h3>
  144. <i class="layui-icon layui-icon-down" onclick="closeBox(this)"></i>
  145. </div>
  146. <div class="template-edit-wrap">
  147. <!-- <font-size v-bind:data="{ value : nc.fontSize }"></font-size> -->
  148. <!-- <slide v-bind:data="{ field : 'fontSize', label : '文字大小', max: 30, min: 12 }"></slide> -->
  149. <!-- <text-align></text-align> -->
  150. <template v-if="nc.lazyLoad">
  151. <text-font-size v-bind:data="{ field : 'fontSize', label : '文字大小', max: 16 }"></text-font-size>
  152. <color v-bind:data="{ field : 'textColor', 'label' : '文本颜色', 'defaultcolor': '#333333' }"></color>
  153. <font-weight v-show="nc.sub == 1"></font-weight>
  154. <!-- <text-align-style></text-align-style> -->
  155. </template>
  156. </div>
  157. <!-- <hr v-show="nc.sub == 1" /> -->
  158. <!-- <hr v-show="nc.sub == 1" /> -->
  159. <!-- 副文本 -->
  160. <div v-show="nc.sub == 1">
  161. <div class="template-edit-title">
  162. <h3>副标题</h3>
  163. <i class="layui-icon layui-icon-down" onclick="closeBox(this)"></i>
  164. </div>
  165. <div class="template-edit-wrap">
  166. <div class="layui-form-item">
  167. <label class="layui-form-label sm">标题文字</label>
  168. <div class="layui-input-block">
  169. <input type="text" v-model="nc.subTitle" v-bind:id="'subTitle_'+index" placeholder="请输入标题文字" class="layui-input">
  170. </div>
  171. </div>
  172. <!-- <font-size v-bind:data="{ field : 'fontSizeSub', 'label' : '文字大小' }"></font-size> -->
  173. <template v-if="nc.lazyLoad">
  174. <text-font-size v-bind:data="{ field : 'fontSizeSub', label : '文字大小', max: 14 }"></text-font-size>
  175. </template>
  176. <!-- <slide v-bind:data="{ field : 'fontSize', label : '文字大小', max: 30, min: 12 }"></slide> -->
  177. <color v-bind:data="{ field : 'colorSub', 'label' : '文字颜色', 'defaultcolor': '#999' }"></color>
  178. </div>
  179. </div>
  180. <!-- <hr v-show="nc.sub == 1" /> -->
  181. <!-- “更多”按钮设置 -->
  182. <div v-show="nc.sub == 1">
  183. <div class="template-edit-title">
  184. <h3>“更多”按钮设置</h3>
  185. <i class="layui-icon layui-icon-down" onclick="closeBox(this)"></i>
  186. </div>
  187. <div class="template-edit-wrap">
  188. <template v-if="nc.lazyLoad">
  189. <text-more-btn></text-more-btn>
  190. </template>
  191. <div class="layui-form-item">
  192. <label class="layui-form-label sm">按钮文字</label>
  193. <div class="layui-input-block">
  194. <input type="text" v-model="nc.moreText" v-bind:id="'moreText'+index" placeholder="查看更多 >" class="layui-input">
  195. </div>
  196. </div>
  197. <color v-bind:data="{ field : 'btnColor', 'label' : '文字颜色', 'defaultcolor': '#999' }"></color>
  198. <nc-link v-bind:data="{ field : nc.moreLink }"></nc-link>
  199. </div>
  200. </div>
  201. <div class="template-edit-title">
  202. <h3>其他设置</h3>
  203. <i class="layui-icon layui-icon-down" onclick="closeBox(this)"></i>
  204. </div>
  205. <div class="template-edit-wrap">
  206. <color v-bind:data="{ field : 'backgroundColor', 'label' : '背景颜色' }"></color>
  207. <template v-if="nc.lazyLoad">
  208. <text-empty></text-empty>
  209. </template>
  210. </div>
  211. <!-- 弹框 -->
  212. <div class="style-list-box">
  213. <div class="style-list layui-form">
  214. <div class="style-list-con">
  215. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 1}">
  216. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  217. <span class="layui-hide">模板一</span>
  218. <img src="{$resourceurl}/text/img/style1.png" />
  219. </div>
  220. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 2}">
  221. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  222. <span class="layui-hide">模板二</span>
  223. <img src="{$resourceurl}/text/img/style2.png" />
  224. </div>
  225. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 3}">
  226. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  227. <span class="layui-hide">模板三</span>
  228. <img src="{$resourceurl}/text/img/style3.png" />
  229. </div>
  230. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 4}">
  231. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  232. <span class="layui-hide">模板四</span>
  233. <img src="{$resourceurl}/text/img/style4.png" />
  234. </div>
  235. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 5}">
  236. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  237. <span class="layui-hide">模板五</span>
  238. <img src="{$resourceurl}/text/img/style5.png" />
  239. </div>
  240. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 6}">
  241. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  242. <span class="layui-hide">模板六</span>
  243. <img src="{$resourceurl}/text/img/style6.png" />
  244. </div>
  245. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 7}">
  246. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  247. <span class="layui-hide">模板七</span>
  248. <img src="{$resourceurl}/text/img/style7.png" />
  249. </div>
  250. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 8}">
  251. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="0" />
  252. <span class="layui-hide">模板八</span>
  253. <img src="{$resourceurl}/text/img/style8.png" />
  254. </div>
  255. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 9}">
  256. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="1" />
  257. <span class="layui-hide">模板九</span>
  258. <img src="{$resourceurl}/text/img/style9.png" />
  259. </div>
  260. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 10}">
  261. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="1" />
  262. <span class="layui-hide">模板十</span>
  263. <img src="{$resourceurl}/text/img/style10.png" />
  264. </div>
  265. <div class="style-li" v-bind:class="{'selected ns-border-color': nc.style == 11}">
  266. <input type="hidden" v-bind:class="'style-li-'+ nc.style" value="1" />
  267. <span class="layui-hide">模板十一</span>
  268. <img src="{$resourceurl}/text/img/style11.png" />
  269. </div>
  270. </div>
  271. <input type="hidden" name="style">
  272. <input type="hidden" name="sub" />
  273. <input type="hidden" name="style_name" />
  274. </div>
  275. </div>
  276. </template>
  277. <!-- 资源 -->
  278. <template slot="resource">
  279. <js>
  280. var textResourcePath = "{$resourceurl}";
  281. </js>
  282. <css src="{$resourceurl}/text/css/style.css"></css>
  283. <js src="{$resourceurl}/text/js/style.js"></js>
  284. </template>
  285. </cm-construct>