style.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. // 顶部内容组件
  2. var newcomeTopConHtml = '<div>';
  3. newcomeTopConHtml += '<template v-if="data.style == 1">';
  4. newcomeTopConHtml += '<div class="goods-head">';
  5. newcomeTopConHtml += '<div class="title-wrap">';
  6. // newcomeTopConHtml += '<div class="left-icon" v-if="list.imageUrl"><img v-bind:src="$parent.$parent.changeImgUrl(list.imageUrl)" /></div>';
  7. // newcomeTopConHtml += '<span class="name">{{list.title}}</span>';
  8. newcomeTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 1">';
  9. newcomeTopConHtml += '<div class="left-icon" v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'"><img v-bind:src="imgUrl1" /></div>';
  10. newcomeTopConHtml += '<div class="left-icon" v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'"><img v-bind:src="$parent.$parent.changeImgUrl(item.imageUrl)" /></div>';
  11. newcomeTopConHtml += '<span class="name">{{item.title}}</span>';
  12. newcomeTopConHtml += '</template>';
  13. newcomeTopConHtml += '</div>';
  14. newcomeTopConHtml += '</div>';
  15. newcomeTopConHtml += '</template>';
  16. newcomeTopConHtml += '<template v-if="data.style == 2">';
  17. newcomeTopConHtml += '<div class="title-wrap title-wrap-2">';
  18. newcomeTopConHtml += '<div class="title-left">';
  19. newcomeTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 2">';
  20. newcomeTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'" :src="imgUrl2" />';
  21. newcomeTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'" :src="$parent.$parent.changeImgUrl(item.imageUrl)" />';
  22. newcomeTopConHtml += '</template>';
  23. newcomeTopConHtml += '</div>';
  24. newcomeTopConHtml += '<div class="title-right"><span>更多拼团</span><i class="iconfont iconyoujiantou"></i> </div>';
  25. newcomeTopConHtml += '</div>';
  26. newcomeTopConHtml += '</template>';
  27. newcomeTopConHtml += '<template v-if="data.style == 3">';
  28. newcomeTopConHtml += '<div class="title-wrap title-wrap-3">';
  29. newcomeTopConHtml += '<div class="title-left">';
  30. newcomeTopConHtml += '<template v-for="(item, index) in list" v-if="item.style == 3">';
  31. newcomeTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] == \'public\'" :src="imgUrl3" />';
  32. newcomeTopConHtml += '<img v-if="item.imageUrl && item.imageUrl.split(\'/\')[0] != \'public\'" :src="$parent.$parent.changeImgUrl(item.imageUrl)" />';
  33. newcomeTopConHtml += '</template>';
  34. newcomeTopConHtml += '</div>';
  35. newcomeTopConHtml += '</div>';
  36. newcomeTopConHtml += '</template>';
  37. /* newcomeTopConHtml += '<div class="more ns-red-color" v-if="listMore.title">';
  38. newcomeTopConHtml += '<span v-bind:style="{color: data.moreTextColor?data.moreTextColor:\'rgba(0,0,0,0)\'}">{{listMore.title}}</span>';
  39. newcomeTopConHtml += '<div class="right-icon" v-if="listMore.imageUrl"><img v-bind:src="$parent.$parent.changeImgUrl(listMore.imageUrl)" /></div>';
  40. newcomeTopConHtml += '<i class="iconfont iconyoujiantou" v-else v-bind:style="{color: data.moreTextColor?data.moreTextColor:\'rgba(0,0,0,0)\'}"></i>';
  41. newcomeTopConHtml += '</div>'; */
  42. newcomeTopConHtml +='</div>';
  43. Vue.component("newcome-top-content", {
  44. data: function () {
  45. return {
  46. data: this.$parent.data,
  47. list: this.$parent.data.list,
  48. listMore: this.$parent.data.listMore,
  49. imgUrl1: "",
  50. imgUrl2: "",
  51. imgUrl3: ""
  52. }
  53. },
  54. created: function () {
  55. this.imgUrl1 = this.list[0].imageUrl;
  56. this.imgUrl2 = this.list[1].imageUrl;
  57. this.imgUrl3 = this.list[2].imageUrl;
  58. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  59. this.$parent.data.verify.push(this.verify);//加载验证方法
  60. },
  61. methods: {
  62. verify : function () {
  63. var res = { code : true, message : "" };
  64. return res;
  65. },
  66. },
  67. template: newcomeTopConHtml
  68. });
  69. /**
  70. * 空的验证组件,后续如果增加业务,则更改组件
  71. */
  72. var newcomeListHtml = '<div class="goods-list-edit layui-form">';
  73. newcomeListHtml += '<div class="layui-form-item ns-icon-radio">';
  74. newcomeListHtml += '<label class="layui-form-label sm">商品来源</label>';
  75. newcomeListHtml += '<div class="layui-input-block">';
  76. newcomeListHtml += '<template v-for="(item, index) in goodsSources" v-bind:k="index">';
  77. newcomeListHtml += '<span :class="[item.value == data.sources ? \'\' : \'layui-hide\']">{{item.text}}</span>';
  78. newcomeListHtml += '</template>';
  79. newcomeListHtml += '<ul class="ns-icon">';
  80. newcomeListHtml += '<li v-for="(item, index) in goodsSources" v-bind:k="index" :class="[item.value == data.sources ? \'ns-text-color ns-border-color ns-bg-color-diaphaneity\' : \'\']" @click="data.sources=item.value">';
  81. newcomeListHtml += '<img v-if="item.value == data.sources" :src="item.selectedSrc" />'
  82. newcomeListHtml += '<img v-else :src="item.src" />'
  83. newcomeListHtml += '</li>';
  84. newcomeListHtml += '</ul>';
  85. /* newcomeListHtml += '<template v-for="(item,index) in goodsSources" v-bind:k="index">';
  86. newcomeListHtml += '<div v-on:click="data.sources=item.value" v-bind:class="{ \'layui-unselect layui-form-radio\' : true,\'layui-form-radioed\' : (data.sources==item.value) }"><i class="layui-anim layui-icon">&#xe63f;</i><div>{{item.text}}</div></div>';
  87. newcomeListHtml += '</template>'; */
  88. newcomeListHtml += '</div>';
  89. newcomeListHtml += '</div>';
  90. newcomeListHtml += '<div class="layui-form-item" v-if="data.sources == \'diy\'">';
  91. newcomeListHtml += '<label class="layui-form-label sm">手动选择</label>';
  92. newcomeListHtml += '<div class="layui-input-block">';
  93. newcomeListHtml += '<a href="#" class="ns-input-text selected-style" v-on:click="addGoods">选择<i class="layui-icon layui-icon-right"></i></a>';
  94. newcomeListHtml += '</div>';
  95. newcomeListHtml += '</div>';
  96. /* newcomeListHtml += '<div class="layui-form-item" v-show="data.sources == \'default\'">';
  97. newcomeListHtml += '<label class="layui-form-label sm">商品数量</label>';
  98. newcomeListHtml += '<div class="layui-input-block">';
  99. newcomeListHtml += '<input type="number" class="layui-input goods-account" v-on:keyup="shopNum" v-model="data.goodsCount"/>';
  100. newcomeListHtml += '</div>';
  101. newcomeListHtml += '</div>';
  102. newcomeListHtml += '<div class="layui-form-item" v-show="data.sources == \'default\'">';
  103. newcomeListHtml += '<label class="layui-form-label sm"></label>';
  104. newcomeListHtml += '<div class="layui-input-block">';
  105. newcomeListHtml += '<template v-for="(item,index) in goodsCount" v-bind:k="index">';
  106. newcomeListHtml += '<div v-on:click="data.goodsCount=item" v-bind:class="{ \'layui-unselect layui-form-radio\' : true,\'layui-form-radioed\' : (data.goodsCount==item) }"><i class="layui-anim layui-icon">&#xe63f;</i><div>{{item}}</div></div>';
  107. newcomeListHtml += '</template>';
  108. newcomeListHtml += '</div>';
  109. newcomeListHtml += '</div>'; */
  110. newcomeListHtml += '<slide v-bind:data="{ field : \'goodsCount\', label: \'商品数量\', max: 9, min: 1}" v-show="data.sources == \'default\'"></slide>';
  111. // newcomeListHtml += '<p class="hint">商品数量选择 0 时,前台会自动上拉加载更多</p>';
  112. newcomeListHtml += '</div>';
  113. var select_goods_list = []; //配合商品选择器使用
  114. Vue.component("newcome-list", {
  115. template: newcomeListHtml,
  116. data: function () {
  117. return {
  118. data: this.$parent.data,
  119. goodsSources: [
  120. {
  121. text: "默认",
  122. value: "default",
  123. src: newcomeResourcePath + "/new_come/img/goods.png",
  124. selectedSrc: newcomeResourcePath + "/newcome/img/goods_1.png"
  125. },
  126. {
  127. text : "手动选择",
  128. value : "diy",
  129. src: newcomeResourcePath + "/new_come/img/manual.png",
  130. selectedSrc: newcomeResourcePath + "/new_come/img/manual_1.png"
  131. }
  132. ],
  133. categoryList: [],
  134. isLoad: false,
  135. isShow: false,
  136. selectIndex: 0,//当前选中的下标
  137. goodsCount: [6, 12, 18, 24, 30],
  138. }
  139. },
  140. created:function() {
  141. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  142. this.$parent.data.verify.push(this.verify);//加载验证方法
  143. },
  144. methods: {
  145. shopNum: function () {
  146. if (this.$parent.data.goodsCount > 50) {
  147. layer.msg("商品数量最多为50");
  148. this.$parent.data.goodsCount = 50;
  149. }
  150. if (this.$parent.data.goodsCount.length > 0 && this.$parent.data.goodsCount < 1) {
  151. layer.msg("商品数量不能小于0");
  152. this.$parent.data.goodsCount = 1;
  153. }
  154. },
  155. verify: function () {
  156. var res = {code: true, message: ""};
  157. if (this.data.goodsCount.length === 0) {
  158. res.code = false;
  159. res.message = "请输入商品数量";
  160. }
  161. if (this.data.goodsCount < 0) {
  162. res.code = false;
  163. res.message = "商品数量不能小于0";
  164. }
  165. if (this.data.goodsCount > 50) {
  166. res.message = "商品数量最多为50";
  167. }
  168. return res;
  169. },
  170. addGoods: function () {
  171. var self = this;
  172. goodsSelect(function (res) {
  173. // if (!res.length) return false;
  174. // self.$parent.data.goodsId = [];
  175. // for (var i = 0; i < res.length; i++) {
  176. // self.$parent.data.goodsId.push(res[i]);
  177. // }
  178. self.$parent.data.goodsId = res;
  179. }, self.$parent.data.goodsId, {mode: "spu", promotion: "pintuan", disabled: 0, post: post});
  180. }
  181. }
  182. });
  183. var newcomeStyleHtml = '<div class="layui-form-item">';
  184. newcomeStyleHtml += '<label class="layui-form-label sm">选择风格</label>';
  185. newcomeStyleHtml += '<div class="layui-input-block">';
  186. // newcomeStyleHtml += '<span>{{data.styleName}}</span>';
  187. newcomeStyleHtml += '<div v-if="data.styleName" class="ns-input-text ns-text-color selected-style" v-on:click="selectGroupbuyStyle">{{data.styleName}} <i class="layui-icon layui-icon-right"></i></div>';
  188. newcomeStyleHtml += '<div v-else class="ns-input-text selected-style" v-on:click="selectGroupbuyStyle">选择 <i class="layui-icon layui-icon-right"></i></div>';
  189. newcomeStyleHtml += '</div>';
  190. newcomeStyleHtml += '</div>';
  191. Vue.component("newcome-style", {
  192. template: newcomeStyleHtml,
  193. data: function() {
  194. return {
  195. data: this.$parent.data,
  196. }
  197. },
  198. created:function() {
  199. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  200. this.$parent.data.verify.push(this.verify);//加载验证方法
  201. },
  202. methods: {
  203. verify: function () {
  204. var res = { code: true, message: "" };
  205. return res;
  206. },
  207. selectGroupbuyStyle: function() {
  208. var self = this;
  209. layer.open({
  210. type: 1,
  211. title: '风格选择',
  212. area:['930px','630px'],
  213. btn: ['确定', '返回'],
  214. content: $(".draggable-element[data-index='" + self.data.index + "'] .edit-attribute .pintuan-list-style").html(),
  215. success: function(layero, index) {
  216. $(".layui-layer-content input[name='style']").val(self.data.style);
  217. $(".layui-layer-content input[name='style_name']").val(self.data.styleName);
  218. $("body").on("click", ".layui-layer-content .style-list-con-pintuan .style-li-pintuan", function () {
  219. $(this).addClass("selected ns-border-color").siblings().removeClass("selected ns-border-color");
  220. $(".layui-layer-content input[name='style']").val($(this).index() + 1);
  221. $(".layui-layer-content input[name='style_name']").val($(this).find("span").text());
  222. });
  223. },
  224. yes: function (index, layero) {
  225. self.data.style = $(".layui-layer-content input[name='style']").val();
  226. self.data.styleName = $(".layui-layer-content input[name='style_name']").val();
  227. layer.closeAll()
  228. }
  229. });
  230. },
  231. }
  232. })
  233. // 图片上传
  234. var newcomeTopHtml = '<ul class="fenxiao-addon-title">';
  235. newcomeTopHtml += '<li>';
  236. newcomeTopHtml += '<template v-if="data.style == 1">';
  237. newcomeTopHtml += '<div class="layui-form-item">';
  238. newcomeTopHtml += '<label class="layui-form-label sm">左侧图标</label>';
  239. newcomeTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  240. newcomeTopHtml += '<div class="layui-input-block ns-img-upload">';
  241. newcomeTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  242. newcomeTopHtml += '</div>';
  243. newcomeTopHtml += '</template>';
  244. newcomeTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图标大小:125px * 30px</div>';
  245. newcomeTopHtml += '</div>';
  246. newcomeTopHtml += '</template>';
  247. newcomeTopHtml += '<template v-if="data.style == 2">';
  248. newcomeTopHtml += '<div class="layui-form-item">';
  249. newcomeTopHtml += '<label class="layui-form-label sm">左侧图标</label>';
  250. newcomeTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  251. newcomeTopHtml += '<div class="layui-input-block ns-img-upload">';
  252. newcomeTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  253. newcomeTopHtml += '</div>';
  254. newcomeTopHtml += '</template>';
  255. newcomeTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图片大小:131px * 37px</div>';
  256. newcomeTopHtml += '</div>';
  257. newcomeTopHtml += '</template>';
  258. newcomeTopHtml += '<template v-if="data.style == 3">';
  259. newcomeTopHtml += '<div class="layui-form-item">';
  260. newcomeTopHtml += '<label class="layui-form-label sm">顶部图标</label>';
  261. newcomeTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  262. newcomeTopHtml += '<div class="layui-input-block ns-img-upload">';
  263. newcomeTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  264. newcomeTopHtml += '</div>';
  265. newcomeTopHtml += '</template>';
  266. newcomeTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图片大小:174px * 37px</div>';
  267. newcomeTopHtml += '</div>';
  268. newcomeTopHtml += '</template>';
  269. newcomeTopHtml += '<template v-if="data.style == 4">';
  270. newcomeTopHtml += '<div class="layui-form-item">';
  271. newcomeTopHtml += '<label class="layui-form-label sm">左侧图标</label>';
  272. newcomeTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  273. newcomeTopHtml += '<div class="layui-input-block ns-img-upload">';
  274. newcomeTopHtml += '<img-sec-upload v-bind:data="{ data : item, text: \'\' }"></img-sec-upload>';
  275. newcomeTopHtml += '</div>';
  276. newcomeTopHtml += '</template>';
  277. newcomeTopHtml += '<div class="ns-word-aux ns-diy-word-aux">建议上传图标大小:125px * 30px</div>';
  278. newcomeTopHtml += '</div>';
  279. newcomeTopHtml += '<div class="content-block">';
  280. newcomeTopHtml += '<div class="layui-form-item">';
  281. newcomeTopHtml += '<label class="layui-form-label sm">标题内容</label>';
  282. newcomeTopHtml += '<template v-for="(item, index) in list" v-if="item.style == data.style">';
  283. newcomeTopHtml += '<div class="layui-input-block">';
  284. newcomeTopHtml += '<input type="text" name=\'title\' v-model="item.title" class="layui-input" />';
  285. newcomeTopHtml += '</div>';
  286. newcomeTopHtml += '</template>';
  287. newcomeTopHtml += '</div>';
  288. newcomeTopHtml += '</div>';
  289. newcomeTopHtml += '</template>';
  290. // newcomeTopHtml += '<color v-bind:data="{ field : \'titleTextColor\', label : \'标题颜色\', defaultcolor: \'#000\' }"></color>';
  291. newcomeTopHtml += '</li>';
  292. /* newcomeTopHtml += '<li>';
  293. newcomeTopHtml += '<div class="content-block">';
  294. newcomeTopHtml += '<div class="layui-form-item">';
  295. newcomeTopHtml += '<label class="layui-form-label sm">文本内容</label>';
  296. newcomeTopHtml += '<div class="layui-input-block">';
  297. newcomeTopHtml += '<input type="text" name=\'title\' v-model="listMore.title" class="layui-input" />';
  298. newcomeTopHtml += '</div>';
  299. newcomeTopHtml += '</div>';
  300. newcomeTopHtml += '<color v-bind:data="{ field : \'moreTextColor\', defaultcolor: \'#858585\' }"></color>';
  301. newcomeTopHtml += '</div>';
  302. newcomeTopHtml += '</li>'; */
  303. newcomeTopHtml += '</ul>';
  304. Vue.component("newcome-top-list",{
  305. template : newcomeTopHtml,
  306. data : function(){
  307. return {
  308. data : this.$parent.data,
  309. list : this.$parent.data.list,
  310. listMore: this.$parent.data.listMore
  311. };
  312. },
  313. created : function(){
  314. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  315. this.$parent.data.verify.push(this.verify);//加载验证方法
  316. },
  317. watch : {
  318. },
  319. methods : {
  320. verify:function () {
  321. var res = { code : true, message : "" };
  322. var _self = this;
  323. $(".draggable-element[data-index='" + this.data.index + "'] .graphic-navigation .graphic-nav-list>ul>li").each(function(index){
  324. if(_self.selectedTemplate == "imageNavigation"){
  325. $(this).find("input[name='title']").removeAttr("style");//清空输入框的样式
  326. //检测是否有未上传的图片
  327. if(_self.list[index].imageUrl == ""){
  328. res.code = false;
  329. res.message = "请选择一张图片";
  330. $(this).find(".error-msg").text("请选择一张图片").show();
  331. return res;
  332. }else{
  333. $(this).find(".error-msg").text("").hide();
  334. }
  335. }else{
  336. if(_self.list[index].title == ""){
  337. res.code = false;
  338. res.message = "请输入标题";
  339. $(this).find("input[name='title']").attr("style","border-color:red !important;").focus();
  340. $(this).find(".error-msg").text("请输入标题").show();
  341. return res;
  342. }else{
  343. $(this).find("input[name='title']").removeAttr("style");
  344. $(this).find(".error-msg").text("").hide();
  345. }
  346. }
  347. });
  348. return res;
  349. }
  350. }
  351. });
  352. // 背景颜色可选
  353. var newcomeColorHtml = '<div class="layui-form-item ns-bg-select">';
  354. newcomeColorHtml += '<label class="layui-form-label sm">背景颜色</label>';
  355. newcomeColorHtml += '<div class="layui-input-block">';
  356. newcomeColorHtml += '<ul class="ns-bg-select-ul">';
  357. newcomeColorHtml += '<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">';
  358. newcomeColorHtml += '<div :style="{background: item.color}"></div>';
  359. newcomeColorHtml += '</li>';
  360. newcomeColorHtml += '</ul>';
  361. newcomeColorHtml += '</div>';
  362. newcomeColorHtml += '</div>';
  363. Vue.component("newcome-color", {
  364. template: newcomeColorHtml,
  365. data: function () {
  366. return {
  367. data: this.$parent.data,
  368. colorList: [
  369. {name: "红", className: "red", color: "#FFD7D7"},
  370. {name: "蓝", className: "blue", color: "#D7FAFF"},
  371. {name: "黄", className: "yellow", color: "#FFF4E0"},
  372. {name: "紫", className: "violet", color: "#F9E5FF"}
  373. ]
  374. };
  375. },
  376. created: function () {
  377. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  378. this.$parent.data.verify.push(this.verify);//加载验证方法
  379. },
  380. methods: {
  381. verify : function () {
  382. var res = { code : true, message : "" };
  383. return res;
  384. }
  385. },
  386. });
  387. // 切换方式
  388. var changeType = '<div class="layui-form-item ns-icon-radio">';
  389. changeType += '<label class="layui-form-label sm">滑动方式</label>';
  390. changeType += '<div class="layui-input-block align-right">';
  391. changeType += '<template v-for="(item,index) in changeTypeList" v-bind:k="index">';
  392. changeType += '<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>';
  393. changeType += '</template>';
  394. changeType += '</div>';
  395. /* changeType += '<label class="layui-form-label sm">滑动方式</label>';
  396. changeType += '<div class="layui-input-block">';
  397. changeType += '<template v-for="(item, index) in changeTypeList" v-bind:k="index">';
  398. changeType += '<span :class="[item.value == data.changeType ? \'\' : \'layui-hide\']">{{item.name}}</span>';
  399. changeType += '</template>';
  400. changeType += '<ul class="ns-icon">';
  401. changeType += '<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">';
  402. changeType += '<img v-if="item.value == data.changeType" :src="item.selectedSrc" />'
  403. changeType += '<img v-else :src="item.src" />'
  404. changeType += '</li>';
  405. changeType += '</ul>';
  406. changeType += '</div>'; */
  407. changeType += '</div>';
  408. Vue.component("change-type", {
  409. template: changeType,
  410. data: function () {
  411. return {
  412. data: this.$parent.data,
  413. changeTypeList: [
  414. {name: "平移滑动", value: 1, src: pintuanResourcePath + "/pintuan/img/manual.png", selectedSrc: pintuanResourcePath + "/pintuan/img/manual_1.png"},
  415. {name: "切屏滑动", value: 2, src: pintuanResourcePath + "/pintuan/img/manual.png", selectedSrc: pintuanResourcePath + "/pintuan/img/manual_1.png"},
  416. ]
  417. };
  418. },
  419. created: function () {
  420. if(!this.$parent.data.verify) this.$parent.data.verify = [];
  421. this.$parent.data.verify.push(this.verify);//加载验证方法
  422. },
  423. methods: {
  424. verify : function () {
  425. var res = { code : true, message : "" };
  426. return res;
  427. }
  428. },
  429. });