Edit.cshtml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. @using MySystem.Models;
  2. @{
  3. string RightInfo = ViewBag.RightInfo as string;
  4. string right = ViewBag.right as string;
  5. string Id = ViewBag.Id as string;
  6. string MerchantId = ViewBag.MerchantId as string;
  7. }
  8. <!DOCTYPE html>
  9. <html>
  10. <head>
  11. <meta charset="utf-8">
  12. <title>商品规格(修改)</title>
  13. <meta name="renderer" content="webkit">
  14. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  15. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  16. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  17. <script src="/admin/js/jquery-1.10.1.min.js"></script>
  18. <script src="/admin/js/LAreaData2.js"></script>
  19. <script src="/admin/js/vue.min.js"></script>
  20. </head>
  21. <body>
  22. <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
  23. <input type="hidden" name="Id" value="@Id" />
  24. <input type="hidden" name="MerchantId" value="@MerchantId" />
  25. <input type="hidden" id="ItemList" name="ItemList" value="" />
  26. <input type="hidden" id="DetailList" name="DetailList" value="" />
  27. <div class="layui-card">
  28. <div class="layui-card-body">
  29. <div class="layui-tab" lay-filter="mytabbar">
  30. <ul class="layui-tab-title">
  31. <li class="layui-this" lay-id="1">规格项</li>
  32. <li lay-id="2">规格明细</li>
  33. </ul>
  34. <div class="layui-tab-content mt20" id="app">
  35. <div class="layui-tab-item layui-show">
  36. <div class="layui-form-item">
  37. <label class="layui-form-label">模板</label>
  38. <div class="layui-input-inline">
  39. <select id="TempId" name="TempId" lay-filter="tempid" lay-search="">
  40. <option value="">请选择</option>
  41. <option v-for="item in tempList" :value="item.id">{{item.name}}</option>
  42. </select>
  43. </div>
  44. <div class="layui-form-mid layui-word-aux">
  45. <a href="###" v-on:click="showTemplate">刷新</a>
  46. </div>
  47. <div class="layui-form-mid layui-word-aux">
  48. <a href="###" lay-href="/Admin/ProductNormTemp/Index?MerchantId=@MerchantId&right=@right">模板管理</a>
  49. </div>
  50. </div>
  51. <div class="layui-form-item">
  52. <label class="layui-form-label">商品规格</label>
  53. <div class="layui-input-block">
  54. <div>
  55. <table width="100%" v-for="item,i in itemList">
  56. <thead>
  57. <tr style="height:30px; line-height:30px; background-color:#eee;">
  58. <th style="padding:10px;width:60px;">规格名:</th>
  59. <th style="padding:10px;">
  60. <input class="layui-input" style="width:150px;" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入规格名" v-model="item.name">
  61. </th>
  62. <th style="padding:10px;width:150px;">
  63. <input type="button" value="上移" v-on:click="toup(i)" />
  64. <input type="button" value="下移" v-on:click="todown(i)" />
  65. <input type="button" value="删除" v-on:click="del(i)" />
  66. </th>
  67. </tr>
  68. </thead>
  69. <tbody>
  70. <tr style="height:30px; line-height:30px;">
  71. <td style="padding:10px;width:60px;">规格值:</td>
  72. <td style="padding:10px;">
  73. <div style="float:left;width:150px;margin-right:5px;" v-for="subitem,j in item.vallist">
  74. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入规格值" v-model="subitem.name" v-on:keyup="showDetail">
  75. <input type="button" value="左移" v-on:click="toleftsub(item,j)" />
  76. <input type="button" value="右移" v-on:click="torightsub(item,j)" />
  77. <input type="button" value="删除" v-on:click="delsub(item,j)" />
  78. </div>
  79. </td>
  80. <td style="padding:10px;">
  81. <input type="button" class="layui-btn" value="增加" v-on:click="addsub(item)" />
  82. </td>
  83. </tr>
  84. </tbody>
  85. </table>
  86. </div>
  87. <table width="100%">
  88. <tr style="height:30px; line-height:30px;">
  89. <td style="padding:10px;">
  90. <input type="button" class="layui-btn" value="添加项" v-on:click="add" />
  91. </td>
  92. </tr>
  93. </table>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="layui-tab-item">
  98. <div class="layui-form-item">
  99. <label class="layui-form-label">规格明细</label>
  100. <div class="layui-input-block">
  101. <table width="100%">
  102. <thead>
  103. <tr style="height:30px; line-height:30px; background-color:#eee;">
  104. <th style="padding:10px;" v-for="item in itemList">{{item.name}}</th>
  105. <th style="padding:10px;">价格</th>
  106. <th style="padding:10px;">积分抵扣</th>
  107. <th style="padding:10px;">创客价格</th>
  108. <th style="padding:10px;">创客积分抵扣</th>
  109. <th style="padding:10px;">库存</th>
  110. <th style="padding:10px;">规格编码</th>
  111. <th style="padding:10px;">成本价</th>
  112. <th style="padding:10px;">限购数量</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. <tr style="height:30px; line-height:30px;" v-for="item in detailList">
  117. <td style="padding:10px;width:80px;" v-for="subitem in item.title">{{subitem.name}}</td>
  118. <td style="padding:10px;">
  119. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入价格" v-model="item.price">
  120. </td>
  121. <td style="padding:10px;">
  122. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入积分抵扣" v-model="item.integral">
  123. </td>
  124. <td style="padding:10px;">
  125. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入创客价格" v-model="item.userprice">
  126. </td>
  127. <td style="padding:10px;">
  128. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入创客积分抵扣" v-model="item.userintegral">
  129. </td>
  130. <td style="padding:10px;">
  131. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入库存" v-model="item.stock">
  132. </td>
  133. <td style="padding:10px;">
  134. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入规格编码" v-model="item.code">
  135. </td>
  136. <td style="padding:10px;">
  137. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入成本价" v-model="item.costprice">
  138. </td>
  139. <td style="padding:10px;">
  140. <input class="layui-input" type="text" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入限购数量" v-model="item.limitcount">
  141. </td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="layui-form-item layui-hide">
  151. <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit" value="确认">
  152. </div>
  153. </div>
  154. </div>
  155. </div>
  156. <script src="/layuiadmin/layui/layui.js"></script>
  157. <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
  158. <script src="/other/mybjq/kindeditor-min.js"></script>
  159. <script src="/other/mybjq/lang/zh_CN.js"></script>
  160. <script>//编辑器
  161. KindEditor.ready(function (K) {
  162. });
  163. var ids = "";
  164. function getChildren(obj) {
  165. $.each(obj, function (index, value) {
  166. var id = obj[index].id;
  167. ids += id + ",";
  168. var children = obj[index].children;
  169. if (children) {
  170. getChildren(children);
  171. }
  172. });
  173. }
  174. function AreasProvinceInit(tagId, areasVal, form, func) {
  175. for (var i = 0; i < provs_data.length; i++) {
  176. var sel = "";
  177. if (areasVal.indexOf(provs_data[i].text) > -1) {
  178. sel = " selected=selected";
  179. }
  180. $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
  181. }
  182. form.render();
  183. func();
  184. }
  185. function AreasProvinceSelected(tagId, areasVal, form, value, func) {
  186. $("#" + tagId + "City").html('<option value="">市</option>');
  187. var list = citys_data[value];
  188. for (var i = 0; i < list.length; i++) {
  189. var sel = "";
  190. if (areasVal.indexOf(list[i].text) > -1) {
  191. sel = " selected=selected";
  192. }
  193. $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
  194. }
  195. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  196. form.render();
  197. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  198. func();
  199. }
  200. function AreasCitySelected(tagId, areasVal, form, value, func) {
  201. $("#" + tagId + "Area").html('<option value="">县/区</option>');
  202. var list = dists_data[value];
  203. for (var i = 0; i < list.length; i++) {
  204. var sel = "";
  205. if (areasVal.indexOf(list[i].text) > -1) {
  206. sel = " selected=selected";
  207. }
  208. $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
  209. }
  210. form.render();
  211. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  212. func();
  213. }
  214. function AreasAreaSelected(tagId, form) {
  215. form.render();
  216. $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
  217. }
  218. function movePrev(obj, tagId) {
  219. $(obj).parent().prev().insertAfter($(obj).parent());
  220. checkPics(tagId);
  221. }
  222. function moveNext(obj, tagId) {
  223. $(obj).parent().next().insertBefore($(obj).parent());
  224. checkPics(tagId);
  225. }
  226. function deletePic(obj, tagId) {
  227. $(obj).parent().remove();
  228. checkPics(tagId);
  229. }
  230. function checkPics(tagId) {
  231. var pics = "";
  232. var texts = "";
  233. $("#" + tagId + "Image div img").each(function (i) {
  234. pics += $(this).attr("src").replace(osshost, '') + "|";
  235. });
  236. $("#" + tagId + "Image div input").each(function (i) {
  237. texts += $(this).val() + "|";
  238. });
  239. if (pics == "") {
  240. $("#" + tagId).val("");
  241. } else {
  242. pics = pics.substring(0, pics.length - 1);
  243. texts = texts.substring(0, pics.length - 1);
  244. $("#" + tagId).val(pics + "#cut#" + texts);
  245. }
  246. }
  247. function checkBox(tagId) {
  248. var text = "";
  249. $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
  250. text += $(this).val() + ",";
  251. });
  252. $("#" + tagId).val(text);
  253. }
  254. function showBigPic(picpath) {
  255. parent.layer.open({
  256. type: 1,
  257. title: false,
  258. closeBtn: 0,
  259. shadeClose: true,
  260. area: ['auto', 'auto'],
  261. content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
  262. });
  263. }
  264. var tree;
  265. var form;
  266. function init_layui() {
  267. layui.config({
  268. base: '/layuiadmin/' //静态资源所在路径
  269. }).extend({
  270. index: 'lib/index' //主入口模块
  271. }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
  272. var $ = layui.$
  273. , element = layui.element
  274. , layer = layui.layer
  275. , layedit = layui.layedit
  276. , laydate = layui.laydate
  277. , croppers = layui.croppers
  278. , upload = layui.upload
  279. , transfer = layui.transfer
  280. , util = layui.util;
  281. tree = layui.tree;
  282. form = layui.form;
  283. form.on('select(tempid)', function (data) {
  284. app.showTemplateDetail(data.value);
  285. });
  286. //Hash地址的定位
  287. var layid = location.hash.replace(/^#test=/, '');
  288. element.tabChange('test', layid);
  289. element.on('tab(test)', function (elem) {
  290. location.hash = 'test=' + $(this).attr('lay-id');
  291. });
  292. //日期
  293. //上传文件
  294. //穿梭框
  295. //TreeView,比如权限管理
  296. //省市区
  297. });
  298. }
  299. //加载vue
  300. var app = new Vue({
  301. el: '#app',
  302. data() {
  303. return {
  304. itemList: @Html.Raw(ViewBag.ItemList),
  305. detailList: @Html.Raw(ViewBag.DetailList),
  306. tempList: [],
  307. TempId: 0,
  308. };
  309. },
  310. mounted() {
  311. this.showTemplate();
  312. init_layui();
  313. },
  314. methods: {
  315. showTemplate() {
  316. let that = this;
  317. $.ajax({
  318. url: "/Admin/ProductNorm/GetTemplate?r=" + Math.random(1),
  319. data: "MerchantId=@MerchantId",
  320. dataType: "json",
  321. success: function (data) {
  322. that.tempList = data;
  323. setTimeout(function () {
  324. form.render();
  325. }, 1000);
  326. }
  327. });
  328. },
  329. showTemplateDetail(id) {
  330. let that = this;
  331. $.ajax({
  332. url: "/Admin/ProductNorm/GetTemplateDetail?r=" + Math.random(1),
  333. data: "Id=" + id,
  334. dataType: "json",
  335. success: function (data) {
  336. that.itemList = JSON.parse(data.tempJsonData);
  337. that.showDetail();
  338. }
  339. });
  340. },
  341. add() {
  342. this.itemList.push({
  343. id: '0',
  344. name: '',
  345. vallist: [
  346. {
  347. id: '0',
  348. name: '',
  349. }
  350. ],
  351. });
  352. this.showDetail();
  353. },
  354. toup(index) {
  355. if (index > 0) {
  356. var sub = this.itemList[index - 1];
  357. this.itemList[index - 1] = this.itemList[index];
  358. this.itemList[index] = sub;
  359. this.showDetail();
  360. }
  361. },
  362. todown(index) {
  363. if (index < this.itemList.length - 1) {
  364. var sub = this.itemList[index + 1];
  365. this.itemList[index + 1] = this.itemList[index];
  366. this.itemList[index] = sub;
  367. this.showDetail();
  368. }
  369. },
  370. del(index) {
  371. if (this.itemList.length > 1) {
  372. this.itemList.splice(index, 1);
  373. this.showDetail();
  374. }
  375. },
  376. addsub(item) {
  377. item.vallist.push({
  378. id: '0',
  379. name: '',
  380. });
  381. this.showDetail();
  382. },
  383. toleftsub(item, index) {
  384. if (index > 0) {
  385. var sub = item.vallist[index - 1];
  386. item.vallist[index - 1] = item.vallist[index];
  387. item.vallist[index] = sub;
  388. this.showDetail();
  389. }
  390. },
  391. torightsub(item, index) {
  392. if (index < item.vallist.length - 1) {
  393. var sub = item.vallist[index + 1];
  394. item.vallist[index + 1] = item.vallist[index];
  395. item.vallist[index] = sub;
  396. this.showDetail();
  397. }
  398. },
  399. delsub(item, index) {
  400. if (item.vallist.length > 1) {
  401. item.vallist.splice(index, 1);
  402. this.showDetail();
  403. }
  404. },
  405. showDetail() {
  406. var array1 = [];
  407. var array2 = [];
  408. var array3 = [];
  409. var array4 = [];
  410. var array5 = [];
  411. for (var i = 0; i < this.itemList.length; i++) {
  412. var num = i + 1;
  413. for (var j = 0; j < this.itemList[i].vallist.length; j++) {
  414. var sub = {
  415. id: this.itemList[i].vallist[j].id,
  416. name: this.itemList[i].vallist[j].name,
  417. };
  418. if (num == 1) {
  419. array1.push(sub);
  420. } else if (num == 2) {
  421. array2.push(sub);
  422. } else if (num == 3) {
  423. array3.push(sub);
  424. } else if (num == 4) {
  425. array4.push(sub);
  426. } else if (num == 5) {
  427. array5.push(sub);
  428. }
  429. }
  430. }
  431. this.checkTitle();
  432. //this.detailList = [];
  433. for (var i = 0; i < array1.length; i++) {
  434. if (array2.length > 0) {
  435. for (var j = 0; j < array2.length; j++) {
  436. if (array3.length > 0) {
  437. for (var k = 0; k < array3.length; k++) {
  438. if (array4.length > 0) {
  439. for (var l = 0; l < array4.length; l++) {
  440. if (array5.length > 0) {
  441. for (var m = 0; m < array5.length; m++) {
  442. if (!this.isTitle(JSON.stringify([array1[i], array2[j], array3[k], array4[l], array5[m]]))) {
  443. this.detailList.push({
  444. title: [array1[i], array2[j], array3[k], array4[l], array5[m]],
  445. price: 0,
  446. integral: 0,
  447. userprice: 0,
  448. userintegral: 0,
  449. stock: 0,
  450. code: '',
  451. costprice: 0,
  452. limitcount: 0,
  453. });
  454. }
  455. }
  456. } else {
  457. if (!this.isTitle(JSON.stringify([array1[i], array2[j], array3[k], array4[l]]))) {
  458. this.detailList.push({
  459. title: [array1[i], array2[j], array3[k], array4[l]],
  460. price: 0,
  461. integral: 0,
  462. userprice: 0,
  463. userintegral: 0,
  464. stock: 0,
  465. code: '',
  466. costprice: 0,
  467. limitcount: 0,
  468. });
  469. }
  470. }
  471. }
  472. } else {
  473. if (!this.isTitle(JSON.stringify([array1[i], array2[j], array3[k]]))) {
  474. this.detailList.push({
  475. title: [array1[i], array2[j], array3[k]],
  476. price: 0,
  477. integral: 0,
  478. userprice: 0,
  479. userintegral: 0,
  480. stock: 0,
  481. code: '',
  482. costprice: 0,
  483. limitcount: 0,
  484. });
  485. }
  486. }
  487. }
  488. } else {
  489. if (!this.isTitle(JSON.stringify([array1[i], array2[j]]))) {
  490. this.detailList.push({
  491. title: [array1[i], array2[j]],
  492. price: 0,
  493. integral: 0,
  494. userprice: 0,
  495. userintegral: 0,
  496. stock: 0,
  497. code: '',
  498. costprice: 0,
  499. limitcount: 0,
  500. });
  501. }
  502. }
  503. }
  504. } else {
  505. if (!this.isTitle(JSON.stringify([array1[i]]))) {
  506. this.detailList.push({
  507. title: [array1[i]],
  508. price: 0,
  509. integral: 0,
  510. userprice: 0,
  511. userintegral: 0,
  512. stock: 0,
  513. code: '',
  514. costprice: 0,
  515. limitcount: 0,
  516. });
  517. }
  518. }
  519. }
  520. this.$forceUpdate();
  521. },
  522. checkTitle() {
  523. var array1 = [];
  524. var array2 = [];
  525. var array3 = [];
  526. var array4 = [];
  527. var array5 = [];
  528. for (var i = 0; i < this.itemList.length; i++) {
  529. var num = i + 1;
  530. for (var j = 0; j < this.itemList[i].vallist.length; j++) {
  531. var sub = {
  532. id: this.itemList[i].vallist[j].id,
  533. name: this.itemList[i].vallist[j].name,
  534. };
  535. if (num == 1) {
  536. array1.push(sub);
  537. } else if (num == 2) {
  538. array2.push(sub);
  539. } else if (num == 3) {
  540. array3.push(sub);
  541. } else if (num == 4) {
  542. array4.push(sub);
  543. } else if (num == 5) {
  544. array5.push(sub);
  545. }
  546. }
  547. }
  548. var arr = [];
  549. for (var i = 0; i < array1.length; i++) {
  550. if (array2.length > 0) {
  551. for (var j = 0; j < array2.length; j++) {
  552. if (array3.length > 0) {
  553. for (var k = 0; k < array3.length; k++) {
  554. if (array4.length > 0) {
  555. for (var l = 0; l < array4.length; l++) {
  556. if (array5.length > 0) {
  557. for (var m = 0; m < array5.length; m++) {
  558. for (var num = 0; num < this.detailList.length; num++) {
  559. if (JSON.stringify(this.detailList[num].title) == JSON.stringify([array1[i],array2[j],array3[k],array4[l],array5[m]]) && !this.isTitle(JSON.stringify([array1[i],array2[j],array3[k],array4[l],array5[m]]))) {
  560. arr.push(this.detailList[num]);
  561. }
  562. }
  563. }
  564. } else {
  565. for (var num = 0; num < this.detailList.length; num++) {
  566. if (JSON.stringify(this.detailList[num].title) == JSON.stringify([array1[i],array2[j],array3[k],array4[l]]) && !this.isTitle(JSON.stringify([array1[i],array2[j],array3[k],array4[l]]))) {
  567. arr.push(this.detailList[num]);
  568. }
  569. }
  570. }
  571. }
  572. } else {
  573. for (var num = 0; num < this.detailList.length; num++) {
  574. if (JSON.stringify(this.detailList[num].title) == JSON.stringify([array1[i],array2[j],array3[k]]) && !this.isTitle(JSON.stringify([array1[i],array2[j],array3[k]]))) {
  575. arr.push(this.detailList[num]);
  576. }
  577. }
  578. }
  579. }
  580. } else {
  581. for (var num = 0; num < this.detailList.length; num++) {
  582. if (JSON.stringify(this.detailList[num].title) == JSON.stringify([array1[i],array2[j]]) && !this.isTitle(JSON.stringify([array1[i],array2[j]]))) {
  583. arr.push(this.detailList[num]);
  584. }
  585. }
  586. }
  587. }
  588. } else {
  589. for (var num = 0; num < this.detailList.length; num++) {
  590. if (JSON.stringify(this.detailList[num].title) == JSON.stringify([array1[i]]) && !this.isTitle(JSON.stringify([array1[i]]))) {
  591. arr.push(this.detailList[num]);
  592. }
  593. }
  594. }
  595. }
  596. this.detailList = arr;
  597. },
  598. isTitle(title) {
  599. for (var num = 0; num < this.detailList.length; num++) {
  600. if (JSON.stringify(this.detailList[num].title) == title) {
  601. return true;
  602. }
  603. }
  604. return false;
  605. },
  606. }
  607. });
  608. </script>
  609. </body>
  610. </html>