style.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. var seckillHtml = '<div class="layui-form-item">';
  2. seckillHtml += '<label class="layui-form-label sm">选择风格</label>';
  3. seckillHtml += '<div class="layui-input-block choose-style">';
  4. seckillHtml += '<div v-if="data.styleName" class="ns-input-text ns-text-color selected-style" v-on:click="selectTestStyle">{{data.styleName}} <i class="layui-icon layui-icon-right"></i></div>';
  5. seckillHtml += '<div v-else class="ns-input-text selected-style" v-on:click="selectTestStyle">选择 <i class="layui-icon layui-icon-right"></i></div>';
  6. seckillHtml += '</div>';
  7. seckillHtml += '</div>';
  8. Vue.component("seckill-style", {
  9. template: seckillHtml,
  10. data: function() {
  11. return {
  12. data: this.$parent.data,
  13. }
  14. },
  15. created: function () {
  16. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  17. this.$parent.data.verify.push(this.verify);//加载验证方法
  18. },
  19. methods: {
  20. verify : function () {
  21. var res = { code : true, message : "" };
  22. return res;
  23. },
  24. selectTestStyle: function() {
  25. var self = this;
  26. layer.open({
  27. type: 1,
  28. title: '风格选择',
  29. area:['930px','630px'],
  30. btn: ['确定', '返回'],
  31. content: $(".draggable-element[data-index='" + self.data.index + "'] .edit-attribute .seckill-list-style").html(),
  32. success: function(layero, index) {
  33. $(".layui-layer-content input[name='style']").val(self.data.style);
  34. $(".layui-layer-content input[name='style_name']").val(self.data.styleName);
  35. $("body").on("click", ".layui-layer-content .style-list-con-seckill .style-li-seckill", function () {
  36. $(this).addClass("selected ns-border-color").siblings().removeClass("selected ns-border-color");
  37. $(".layui-layer-content input[name='style']").val($(this).index() + 1);
  38. $(".layui-layer-content input[name='style_name']").val($(this).find("span").text());
  39. });
  40. },
  41. yes: function (index, layero) {
  42. self.data.style = $(".layui-layer-content input[name='style']").val();
  43. self.data.styleName = $(".layui-layer-content input[name='style_name']").val();
  44. layer.closeAll()
  45. }
  46. });
  47. },
  48. }
  49. })
  50. // 多选
  51. var seckillContentHtml = '<div class="layui-form-item goods-show-box ns-checkbox-wrap">';
  52. seckillContentHtml += '<div class="layui-input-block">';
  53. seckillContentHtml += '<div class="layui-input-inline-checkbox">';
  54. seckillContentHtml += '<span>商品名称</span>';
  55. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsName\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodName == 1)}" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>';
  56. seckillContentHtml += '</div>';
  57. seckillContentHtml += '<div class="layui-input-inline-checkbox">';
  58. seckillContentHtml += '<span>商品价格</span>';
  59. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsPrice\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsPrice == 1)}" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>';
  60. seckillContentHtml += '</div>';
  61. seckillContentHtml += '<div class="layui-input-inline-checkbox">';
  62. seckillContentHtml += '<span>商品原价</span>';
  63. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsPrimary\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsPrimary == 1)}" lay-skin="primary"><i class="layui-icon layui-icon-ok"></i></div>';
  64. seckillContentHtml += '</div>';
  65. seckillContentHtml += '</div>';
  66. /* seckillContentHtml += '<div class="layui-input-inline">';
  67. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsName\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsName == 1)}" lay-skin="primary"><span>商品名称</span><i class="layui-icon layui-icon-ok"></i></div>';
  68. // seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsDesc\', data.isShowGoodsDesc)" id="isShowGoodsDesc" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsDesc == 1)}" lay-skin="primary"><span>商品描述</span><i class="layui-icon layui-icon-ok"></i></div>';
  69. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsPrice\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsPrice == 1)}" lay-skin="primary"><span>商品价格</span><i class="layui-icon layui-icon-ok"></i></div>';
  70. seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsPrimary\')" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsPrimary == 1)}" lay-skin="primary"><span>商品原价</span><i class="layui-icon layui-icon-ok"></i></div>';
  71. // seckillContentHtml += '<div v-on:click="changeStatus(\'isShowGoodsStock\', data.isShowGoodsStock)" id="isShowGoodsStock" class="layui-unselect layui-form-checkbox" v-bind:class="{\'layui-form-checked\': (data.isShowGoodsStock == 1)}" lay-skin="primary"><span>剩余库存</span><i class="layui-icon layui-icon-ok"></i></div>';
  72. seckillContentHtml += '</div>'; */
  73. seckillContentHtml += '</div>';
  74. Vue.component("seckill-content", {
  75. template: seckillContentHtml,
  76. data: function () {
  77. return {
  78. data: this.$parent.data,
  79. };
  80. },
  81. created: function () {
  82. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  83. this.$parent.data.verify.push(this.verify);//加载验证方法
  84. },
  85. methods: {
  86. verify : function () {
  87. var res = { code : true, message : "" };
  88. return res;
  89. },
  90. changeStatus: function(field) {
  91. this.$parent.data[field] = this.$parent.data[field] ? 0 : 1;
  92. }
  93. }
  94. });
  95. // 顶部内容组件
  96. var seckillTopConHtml = '<div>';
  97. seckillTopConHtml += '<template v-if="data.style == 1">';
  98. seckillTopConHtml += '<div class="goods-head">';
  99. seckillTopConHtml += '<div class="title-wrap">';
  100. // seckillTopConHtml += '<div class="left-icon" v-if="list.imageUrl"><img v-bind:src="$parent.$parent.changeImgUrl(list.imageUrl)" /></div>';
  101. seckillTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 1">';
  102. seckillTopConHtml += '<div class="left-icon" v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'"><img v-bind:src="imgUrl1" /></div>';
  103. seckillTopConHtml += '<div class="left-icon" v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'"><img v-bind:src="$parent.$parent.changeImgUrl(item.imageUrl)" /></div>';
  104. seckillTopConHtml += '</template>';
  105. // seckillTopConHtml += '<span class="name" v-bind:style="{color: data.titleTextColor?data.titleTextColor:\'rgba(0,0,0,0)\'}">{{list.title}}</span>';
  106. seckillTopConHtml += '<div class="time">距离结束<span class="hour">02</span>:<span class="minute">00</span>:<span class="second">00</span></div>';
  107. seckillTopConHtml += '</div>';
  108. /* seckillTopConHtml += '<div class="more ns-red-color" v-if="listMore.title">';
  109. seckillTopConHtml += '<span v-bind:style="{color: data.moreTextColor?data.moreTextColor:\'rgba(0,0,0,0)\'}">更多秒杀</span>';
  110. seckillTopConHtml += '<div class="right-icon" v-if="listMore.imageUrl"><img v-bind:src="$parent.$parent.changeImgUrl(listMore.imageUrl)" /></div>';
  111. seckillTopConHtml += '<i class="iconfont iconyoujiantou" v-else v-bind:style="{color: data.moreTextColor?data.moreTextColor:\'rgba(0,0,0,0)\'}"></i>';
  112. seckillTopConHtml += '</div>'; */
  113. seckillTopConHtml += '<div class="more violet" v-if="data.bgSelect==\'violet\'">';
  114. seckillTopConHtml += '<span>';
  115. seckillTopConHtml += '<span style="color: #8662FD;">更多</span>';
  116. seckillTopConHtml += '<span style="color: #627BFD;">秒杀</span>';
  117. seckillTopConHtml += '</span>';
  118. seckillTopConHtml += '<i class="iconfont iconyoujiantou" style="color: #627BFD;"></i>';
  119. seckillTopConHtml += '</div>';
  120. seckillTopConHtml += '<div class="more red" v-if="data.bgSelect==\'red\'">';
  121. seckillTopConHtml += '<span>';
  122. seckillTopConHtml += '<span style="color: #FF7B91;">更多</span>';
  123. seckillTopConHtml += '<span style="color: #FF5151;">秒杀</span>';
  124. seckillTopConHtml += '</span>';
  125. seckillTopConHtml += '<i class="iconfont iconyoujiantou" style="color: #FF5151;"></i>';
  126. seckillTopConHtml += '</div>';
  127. seckillTopConHtml += '<div class="more blue" v-if="data.bgSelect==\'blue\'">';
  128. seckillTopConHtml += '<span>';
  129. seckillTopConHtml += '<span style="color: #12D0AE;">更多</span>';
  130. seckillTopConHtml += '<span style="color: #0ECFD3;">秒杀</span>';
  131. seckillTopConHtml += '</span>';
  132. seckillTopConHtml += '<i class="iconfont iconyoujiantou" style="color: #0ECFD3;"></i>';
  133. seckillTopConHtml += '</div>';
  134. seckillTopConHtml += '<div class="more yellow" v-if="data.bgSelect==\'yellow\'">';
  135. seckillTopConHtml += '<span>';
  136. seckillTopConHtml += '<span style="color: #FEB632;">更多</span>';
  137. seckillTopConHtml += '<span style="color: #FE6232;">秒杀</span>';
  138. seckillTopConHtml += '</span>';
  139. seckillTopConHtml += '<i class="iconfont iconyoujiantou" style="color: #FE6232;"></i>';
  140. seckillTopConHtml += '</div>';
  141. seckillTopConHtml += '</div>';
  142. seckillTopConHtml += '</template>';
  143. seckillTopConHtml += '<template v-if="data.style == 2">';
  144. seckillTopConHtml += '<div class="title-wrap title-wrap-2">';
  145. seckillTopConHtml += '<div class="title-left">';
  146. seckillTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 2">';
  147. seckillTopConHtml += '<div class="img">';
  148. seckillTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'" :src="imgUrl2" />';
  149. seckillTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'" :src="$parent.$parent.changeImgUrl(item.imageUrl)" />';
  150. seckillTopConHtml += '</div>';
  151. seckillTopConHtml += '</template>';
  152. seckillTopConHtml += '<div class="time">';
  153. seckillTopConHtml += '<label class="font">疯抢中</label>';
  154. seckillTopConHtml += '<span class="hour">02</span>:<span class="minute">00</span>';
  155. seckillTopConHtml += '</div>';
  156. seckillTopConHtml += '</div>';
  157. seckillTopConHtml += '<div class="title-right"><span>更多秒杀</span><i class="iconfont iconyoujiantou"></i></div>';
  158. seckillTopConHtml += '</div>';
  159. seckillTopConHtml += '</template>';
  160. seckillTopConHtml += '<template v-if="data.style == 3">';
  161. seckillTopConHtml += '<div class="title-wrap title-wrap-3">';
  162. seckillTopConHtml += '<div class="title-left">';
  163. seckillTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 3">';
  164. seckillTopConHtml += '<div class="img">';
  165. seckillTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'" :src="imgUrl3" />';
  166. seckillTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'" :src="$parent.$parent.changeImgUrl(item.imageUrl)" />';
  167. seckillTopConHtml += '</div>';
  168. seckillTopConHtml += '</template>';
  169. seckillTopConHtml += '<div class="time">';
  170. seckillTopConHtml += '<label class="font">疯抢中</label>';
  171. seckillTopConHtml += '<span class="hour">02</span>:<span class="minute">00</span>';
  172. seckillTopConHtml += '</div>';
  173. seckillTopConHtml += '</div>';
  174. seckillTopConHtml += '</div>';
  175. seckillTopConHtml += '</template>';
  176. seckillTopConHtml +='</div>';
  177. Vue.component("seckill-top-content", {
  178. data: function () {
  179. return {
  180. data: this.$parent.data,
  181. list: this.$parent.data.list,
  182. listMore: this.$parent.data.listMore,
  183. imgUrl1: "",
  184. imgUrl2: "",
  185. imgUrl3: ""
  186. }
  187. },
  188. created: function () {
  189. this.imgUrl1 = this.list[0].imageUrl;
  190. this.imgUrl2 = this.list[1].imageUrl;
  191. this.imgUrl3 = this.list[2].imageUrl;
  192. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  193. this.$parent.data.verify.push(this.verify);//加载验证方法
  194. },
  195. methods: {
  196. verify : function () {
  197. var res = { code : true, message : "" };
  198. return res;
  199. },
  200. },
  201. template: seckillTopConHtml
  202. });
  203. // 图片上传
  204. var seckillTopHtml = '<ul class="fenxiao-addon-title">';
  205. seckillTopHtml += '<li>';
  206. seckillTopHtml += '<template v-if="data.style == 1">';
  207. seckillTopHtml += '<div class="layui-form-item">';
  208. seckillTopHtml += '<label class="layui-form-label sm">秒杀图标</label>';
  209. // seckillTopHtml += '<div class="layui-input-block ns-img-upload">';
  210. // seckillTopHtml += '<img-sec-upload v-bind:data="{ data : list }"></img-sec-upload>';
  211. // seckillTopHtml += '</div>';
  212. seckillTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  213. seckillTopHtml += '<div class="layui-input-block ns-img-upload">';
  214. seckillTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  215. seckillTopHtml += '</div>';
  216. seckillTopHtml += '</template>';
  217. seckillTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图标大小:125px * 30px</div>';
  218. seckillTopHtml += '</div>';
  219. seckillTopHtml += '</template>';
  220. seckillTopHtml += '<template v-if="data.style == 2">';
  221. seckillTopHtml += '<div class="layui-form-item">';
  222. seckillTopHtml += '<label class="layui-form-label sm">秒杀图标</label>';
  223. seckillTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  224. seckillTopHtml += '<div class="layui-input-block ns-img-upload">';
  225. seckillTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  226. seckillTopHtml += '</div>';
  227. seckillTopHtml += '</template>';
  228. seckillTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图标大小:103px * 16px</div>';
  229. seckillTopHtml += '</div>';
  230. seckillTopHtml += '</template>';
  231. seckillTopHtml += '<template v-if="data.style == 3">';
  232. seckillTopHtml += '<div class="layui-form-item">';
  233. seckillTopHtml += '<label class="layui-form-label sm">秒杀图标</label>';
  234. seckillTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  235. seckillTopHtml += '<div class="layui-input-block ns-img-upload">';
  236. seckillTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  237. seckillTopHtml += '</div>';
  238. seckillTopHtml += '</template>';
  239. seckillTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图标大小:174px * 17px</div>';
  240. seckillTopHtml += '</div>';
  241. seckillTopHtml += '</template>';
  242. /* seckillTopHtml += '<div class="content-block">';
  243. seckillTopHtml += '<div class="layui-form-item">';
  244. seckillTopHtml += '<label class="layui-form-label sm">标题</label>';
  245. seckillTopHtml += '<div class="layui-input-block">';
  246. seckillTopHtml += '<input type="text" name=\'title\' v-model="list.title" class="layui-input" />';
  247. seckillTopHtml += '</div>';
  248. seckillTopHtml += '</div>';
  249. seckillTopHtml += '</div>'; */
  250. // seckillTopHtml += '<color v-bind:data="{ field : \'titleTextColor\', label : \'标题颜色\', defaultcolor: \'#000\' }"></color>';
  251. seckillTopHtml += '</li>';
  252. /* seckillTopHtml += '<li>';
  253. // seckillTopHtml += '<div class="layui-form-item">';
  254. // seckillTopHtml += '<label class="layui-form-label sm">右侧图标</label>';
  255. // seckillTopHtml += '<div class="layui-input-block">';
  256. // seckillTopHtml += '<img-upload v-bind:data="{ data : item }"></img-upload>';
  257. // seckillTopHtml += '</div>';
  258. // seckillTopHtml += '</div>';
  259. seckillTopHtml += '<div class="content-block">';
  260. seckillTopHtml += '<div class="layui-form-item">';
  261. seckillTopHtml += '<label class="layui-form-label sm">文本内容</label>';
  262. seckillTopHtml += '<div class="layui-input-block">';
  263. seckillTopHtml += '<input type="text" name=\'title\' v-model="listMore.title" class="layui-input" />';
  264. seckillTopHtml += '</div>';
  265. seckillTopHtml += '</div>';
  266. seckillTopHtml += '<color v-bind:data="{ field : \'moreTextColor\', defaultcolor: \'#858585\' }"></color>';
  267. // seckillTopHtml += '<nc-link v-bind:data="{ field : $parent.data.list[index].link }"></nc-link>';
  268. seckillTopHtml += '</div>';
  269. seckillTopHtml += '</li>'; */
  270. seckillTopHtml += '</ul>';
  271. Vue.component("seckill-top-list",{
  272. template : seckillTopHtml,
  273. data : function(){
  274. return {
  275. data : this.$parent.data,
  276. list : this.$parent.data.list,
  277. listMore: this.$parent.data.listMore
  278. };
  279. },
  280. created : function(){
  281. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  282. this.$parent.data.verify.push(this.verify);//加载验证方法
  283. },
  284. methods : {
  285. verify:function () {
  286. var res = { code : true, message : "" };
  287. var _self = this;
  288. $(".draggable-element[data-index='" + this.data.index + "'] .graphic-navigation .graphic-nav-list>ul>li").each(function(index){
  289. if(_self.selectedTemplate == "imageNavigation"){
  290. $(this).find("input[name='title']").removeAttr("style");//清空输入框的样式
  291. //检测是否有未上传的图片
  292. if(_self.list[index].imageUrl == ""){
  293. res.code = false;
  294. res.message = "请选择一张图片";
  295. $(this).find(".error-msg").text("请选择一张图片").show();
  296. return res;
  297. }else{
  298. $(this).find(".error-msg").text("").hide();
  299. }
  300. }else{
  301. if(_self.list[index].title == ""){
  302. res.code = false;
  303. res.message = "请输入标题";
  304. $(this).find("input[name='title']").attr("style","border-color:red !important;").focus();
  305. $(this).find(".error-msg").text("请输入标题").show();
  306. return res;
  307. }else{
  308. $(this).find("input[name='title']").removeAttr("style");
  309. $(this).find(".error-msg").text("").hide();
  310. }
  311. }
  312. });
  313. return res;
  314. }
  315. }
  316. });
  317. // 背景颜色可选
  318. var seckillColorHtml = '<div class="layui-form-item ns-bg-select">';
  319. seckillColorHtml += '<label class="layui-form-label sm">背景颜色</label>';
  320. seckillColorHtml += '<div class="layui-input-block">';
  321. seckillColorHtml += '<ul class="ns-bg-select-ul">';
  322. seckillColorHtml += '<li v-for="(item, index) in colorList" v-bind:k="index" :class="[item.className == data.bgSelect ? \'ns-text-color ns-border-color\' : \'\']" @click="data.bgSelect = item.className">';
  323. seckillColorHtml += '<div :style="{background: item.color}"></div>';
  324. seckillColorHtml += '</li>';
  325. seckillColorHtml += '</ul>';
  326. seckillColorHtml += '</div>';
  327. seckillColorHtml += '</div>';
  328. Vue.component("seckill-color", {
  329. template: seckillColorHtml,
  330. data: function () {
  331. return {
  332. data: this.$parent.data,
  333. colorList: [
  334. {name: "红", className: "red", color: "#FFD7D7"},
  335. {name: "蓝", className: "blue", color: "#D7FAFF"},
  336. {name: "黄", className: "yellow", color: "#FFF4E0"},
  337. {name: "紫", className: "violet", color: "#F9E5FF"}
  338. ]
  339. };
  340. },
  341. created: function () {
  342. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  343. this.$parent.data.verify.push(this.verify);//加载验证方法
  344. },
  345. methods: {
  346. verify : function () {
  347. var res = { code : true, message : "" };
  348. return res;
  349. }
  350. },
  351. });
  352. // 切换方式
  353. var seckillChangeType = '<div class="layui-form-item ns-icon-radio">';
  354. seckillChangeType += '<label class="layui-form-label sm">滑动方式</label>';
  355. seckillChangeType += '<div class="layui-input-block align-right">';
  356. seckillChangeType += '<template v-for="(item,index) in changeTypeList" v-bind:k="index">';
  357. seckillChangeType += '<div v-on:click="data.changeType=item.value" v-bind:class="{ \'layui-unselect layui-form-radio\' : true,\'layui-form-radioed\' : (data.changeType==item.value) }"><i class="layui-anim layui-icon">&#xe63f;</i><div>{{item.name}}</div></div>';
  358. seckillChangeType += '</template>';
  359. seckillChangeType += '</div>';
  360. /* seckillChangeType += '<label class="layui-form-label sm">滑动方式</label>';
  361. seckillChangeType += '<div class="layui-input-block">';
  362. seckillChangeType += '<template v-for="(item, index) in changeTypeList" v-bind:k="index">';
  363. seckillChangeType += '<span :class="[item.value == data.changeType ? \'\' : \'layui-hide\']">{{item.name}}</span>';
  364. seckillChangeType += '</template>';
  365. seckillChangeType += '<ul class="ns-icon">';
  366. seckillChangeType += '<li v-for="(item, index) in changeTypeList" v-bind:k="index" :class="[item.value == data.changeType ? \'ns-text-color ns-border-color\' : \'\']" @click="data.changeType = item.value">';
  367. seckillChangeType += '<img v-if="item.value == data.changeType" :src="item.selectedSrc" />'
  368. seckillChangeType += '<img v-else :src="item.src" />'
  369. seckillChangeType += '</li>';
  370. seckillChangeType += '</ul>';
  371. seckillChangeType += '</div>'; */
  372. seckillChangeType += '</div>';
  373. Vue.component("seckill-change-type", {
  374. template: seckillChangeType,
  375. data: function () {
  376. return {
  377. data: this.$parent.data,
  378. changeTypeList: [
  379. {name: "平移滑动", value: 1, src: seckillResourcePath + "/seckill/img/manual.png", selectedSrc: seckillResourcePath + "/seckill/img/manual_1.png"},
  380. {name: "切屏滑动", value: 2, src: seckillResourcePath + "/seckill/img/manual.png", selectedSrc: seckillResourcePath + "/seckill/img/manual_1.png"},
  381. ]
  382. };
  383. },
  384. created: function () {
  385. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  386. this.$parent.data.verify.push(this.verify);//加载验证方法
  387. },
  388. methods: {
  389. verify : function () {
  390. var res = { code : true, message : "" };
  391. return res;
  392. }
  393. },
  394. });