link.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. var form, laytpl;
  2. var goodsLink = ['ALL_GOODS', 'PINTUAN_GOODS', 'PINFAN_GOODS', 'GROUPBUY_GOODS', 'DISTRIBUTION_GOODS', 'BARGAIN_GOODS', 'PRESALE_GOODS'];
  3. layui.use(['form', 'laytpl'], function () {
  4. form = layui.form;
  5. laytpl = layui.laytpl;
  6. setTimeout(function () {
  7. if (selectLink.name) {
  8. // 编辑赋值
  9. $('.link-box .link-left dd.text-color').click();
  10. } else if (selectLink.parent && goodsLink.indexOf(selectLink.parent) !== -1) {
  11. // 如果选择了商品
  12. $('.link-box .link-left dd[data-name="' + selectLink.parent + '"]').click();
  13. } else {
  14. // 默认选中第一个
  15. $('.link-box .link-left dd:eq(0)').click();
  16. }
  17. }, 100);
  18. });
  19. /**
  20. * 查询子级链接
  21. * @param name
  22. */
  23. function getLinkInfo(name) {
  24. try {
  25. $('.link-box .link-right.js-system dl').hide();
  26. var linkList = $('.link-box .link-right.js-system dl[data-parent="' + name + '"]');
  27. linkList.show();
  28. if (linkList.length === 0) childLinkCallback(name); // 触发选择子级链接回调
  29. } catch (e) {
  30. console.log('childLinkCallback error', e);
  31. }
  32. }
  33. // 展开收缩自定义链接
  34. $(".link-box .link-left dt").click(function () {
  35. if ($(this).hasClass("active")) {
  36. $(this).removeClass("active");
  37. $(this).parent("dl").find("dd").removeClass("layui-hide");
  38. } else {
  39. $(this).addClass("active");
  40. $(this).parent("dl").find("dd").addClass("layui-hide");
  41. }
  42. if ($(this).parent("dl").find("dd").length === 0) {
  43. $(".link-box .link-left dd,.link-box .link-left dt").removeClass("text-color");
  44. $(this).addClass("text-color");
  45. }
  46. });
  47. // 选择左侧父级链接
  48. $('.link-box .link-left dd').click(function () {
  49. $('.link-box .link-left dd').removeClass("text-color");
  50. $(this).addClass("text-color");
  51. var name = $(this).attr('data-name');
  52. switch (name) {
  53. case 'CUSTOM_LINK':
  54. // 自定义链接,支持外链
  55. var data = JSON.parse(JSON.stringify(selectLink));
  56. if(data.parent !=='CUSTOM_LINK') {
  57. data.title = '';
  58. data.wap_url = '';
  59. }
  60. laytpl($('#customHtml').html()).render(data, function (html) {
  61. $(".link-right.js-system").hide();
  62. $(".link-right.js-extend").html(html).show();
  63. });
  64. break;
  65. case 'OTHER_APPLET':
  66. // 跳转小程序
  67. laytpl($('#appletHtml').html()).render(selectLink, function (html) {
  68. $(".link-right.js-system").hide();
  69. $(".link-right.js-extend").html(html).show();
  70. });
  71. break;
  72. case 'MOBILE':
  73. // 拨打手机号
  74. laytpl($('#mobileHtml').html()).render(selectLink, function (html) {
  75. $(".link-right.js-system").hide();
  76. $(".link-right.js-extend").html(html).show();
  77. });
  78. break;
  79. default:
  80. $(".link-right.js-extend").hide();
  81. $(".link-right.js-system").show();
  82. getLinkInfo(name);
  83. break;
  84. }
  85. });
  86. $("body").on("click", ".link-box .link-right dd", function () {
  87. $(".link-box .link-right dd").removeClass("border-color text-color");
  88. $(this).addClass("border-color text-color");
  89. });
  90. //清空
  91. $(".link-btn .link-eliminate").click(function () {
  92. window.linkData = {};
  93. layer.close(window.linkIndex);
  94. });
  95. // 取消
  96. $(".link-btn .link-cancel").click(function () {
  97. layer.close(window.linkIndex);
  98. });
  99. // 保存
  100. $(".link-box .link-save").click(function () {
  101. var value = {};
  102. var dd = $(".link-box .link-right dd.border-color"); // 子级链接
  103. var parentLink = $('.link-box .link-left dd.text-color'); // 父级链接
  104. // 标准链接
  105. if (dd.length) {
  106. value = {
  107. name: dd.attr('data-name'),
  108. title: dd.text(),
  109. wap_url: dd.attr('data-wap-url')
  110. };
  111. }
  112. // 自定义链接
  113. if (parentLink.attr('data-name') === 'CUSTOM_LINK') {
  114. var title = $(".custom-link input[name='title']").val();
  115. var wap_url = $(".custom-link input[name='wap_url']").val();
  116. if (!title) {
  117. layer.msg("链接名称不能为空");
  118. return;
  119. }
  120. if (!wap_url) {
  121. layer.msg("跳转路径不能为空");
  122. return;
  123. }
  124. value = {
  125. name: parentLink.attr('data-name'),
  126. title: title,
  127. wap_url: wap_url
  128. };
  129. }
  130. // 跳转小程序
  131. if (parentLink.attr('data-name') === 'OTHER_APPLET') {
  132. var appid = $(".other-applet input[name='appid']").val();
  133. var page = $(".other-applet input[name='page']").val();
  134. if (!appid) {
  135. layer.msg("跳转小程序的appid不能为空");
  136. return;
  137. }
  138. if (!page) {
  139. layer.msg("小程序路径不能为空");
  140. return;
  141. }
  142. value = {
  143. name: parentLink.attr('data-name'),
  144. title: '小程序-' + appid,
  145. appid: appid,
  146. page: page
  147. };
  148. }
  149. if (parentLink.attr('data-name') === 'MOBILE') {
  150. var mobile = $(".call-mobile input[name='mobile']").val();
  151. if (!mobile) {
  152. layer.msg("电话号码不能为空");
  153. return;
  154. }
  155. value = {
  156. name: parentLink.attr('data-name'),
  157. title: '拨打电话:' + mobile,
  158. mobile: mobile
  159. };
  160. }
  161. try {
  162. value = beforeSaveCallback(value); // 保存前处理数据的回调
  163. } catch (e) {
  164. console.log('saveCallback error', e);
  165. }
  166. if (Object.keys(value).length) {
  167. value.parent = parentLink.attr('data-name');
  168. window.linkData = value;
  169. }
  170. layer.close(window.linkIndex);
  171. });
  172. /**
  173. * 触发选择子级链接回调
  174. * @param name
  175. */
  176. function childLinkCallback(name) {
  177. if (name === 'GOODS_CATEGORY') {
  178. // 商品分类
  179. var html = `<div id="goods_category_list"></div>`;
  180. $(".link-right.js-extend").html(html).show();
  181. $(".link-right.js-system").hide();
  182. getGoodsCategory();
  183. } else if (goodsLink.indexOf(name) !== -1) {
  184. var html = "<div class='search'>";
  185. html += `<input name='search_text' class='layui-input search-input layui-input-inline len-mid' placeholder='请输入商品名称' onkeyup="if(event.keyCode === 13) getGoodsList('${name}') " />`;
  186. html += `<button onclick="getGoodsList('${name}')" class='layui-btn'>搜索</button>`;
  187. html += "</div>";
  188. html += `<table id="goods_list" lay-filter="goods_list"></table>`;
  189. $(".link-right.js-extend").html(html).show();
  190. $(".link-right.js-system").hide();
  191. getGoodsList(name);
  192. } else if (['CARDS_GAME', 'TURNTABLE_GAME', 'EGG_GAME'].indexOf(name) !== -1) {
  193. var html = `<table id="game_list" lay-filter="game_list"></table>`;
  194. $(".link-right.js-extend").html(html).show();
  195. $(".link-right.js-system").hide();
  196. getGameList(name);
  197. } else if (['DIY_FORM'].indexOf(name) !== -1) {
  198. var html = `<table id="diy_form_list" lay-filter="diy_form_list"></table>`;
  199. $(".link-right.js-extend").html(html).show();
  200. $(".link-right.js-system").hide();
  201. getDiyFormList(name);
  202. }
  203. }
  204. /**
  205. * 获取商品分类数据
  206. */
  207. function getGoodsCategory() {
  208. laytpl($("#goodsCategoryHtml").html()).render([], function (html) {
  209. $("#goods_category_list").html(html);
  210. //展开收齐点击事件
  211. $(".js-switch").click(function () {
  212. var category_id = $(this).attr("data-category-id");
  213. var operation = $(this).attr("data-operation");
  214. if (operation === 'off') {
  215. $(".goods-category-list .layui-table tr[data-pid='" + category_id + "']").show();
  216. $(this).text("-").attr("data-operation", 'on');
  217. } else {
  218. $(".goods-category-list .layui-table tr[data-pid='" + category_id + "']").hide();
  219. $(this).text("+").attr("data-operation", 'off');
  220. }
  221. });
  222. var category = $("input[name='category_id']:checked");
  223. if (category.length) {
  224. var pid = category.parent().parent().attr('data-pid');
  225. if (pid) $(".js-switch[data-category-id='" + pid + "']").click();
  226. }
  227. // 勾选分类
  228. form.on('checkbox(category_id)', function (data) {
  229. if (data.elem.checked) {
  230. $("input[name='category_id']:checked").prop("checked", false);
  231. $(data.elem).prop("checked", true);
  232. form.render();
  233. }
  234. });
  235. form.render();
  236. });
  237. }
  238. /**
  239. * 获取商品列表
  240. * @param name
  241. */
  242. function getGoodsList(name) {
  243. var promotion = '', goodsCols = [];
  244. if (name === 'ALL_GOODS') {
  245. promotion = 'all';
  246. goodsCols = [
  247. [
  248. {
  249. width: '8%',
  250. templet: function (data) {
  251. return `<input type="checkbox" name="goods_checkbox" value="${data.goods_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.goods_id == selectLink.goods_id ? 'checked' : ''} />`;
  252. }
  253. },
  254. {
  255. title: '商品',
  256. width: '52%',
  257. templet: '#goods_info'
  258. },
  259. {
  260. field: 'price',
  261. title: '价格',
  262. width: '15%'
  263. },
  264. {
  265. field: 'goods_stock',
  266. title: '库存',
  267. width: '15%'
  268. }
  269. ]
  270. ];
  271. } else if (name === "PINTUAN_GOODS") {
  272. promotion = 'pintuan';
  273. goodsCols = [
  274. [{
  275. unresize: 'false',
  276. width: '8%',
  277. templet: function (data) {
  278. return `<input type="checkbox" name="goods_checkbox" value="${data.pintuan_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.pintuan_id == selectLink.pintuan_id ? 'checked' : ''} />`;
  279. }
  280. }, {
  281. title: '拼团商品',
  282. unresize: 'false',
  283. width: '52%',
  284. templet: '#goods_info'
  285. }, {
  286. field: 'pintuan_price',
  287. title: '价格',
  288. unresize: 'false',
  289. width: '15%'
  290. }, {
  291. field: 'goods_stock',
  292. title: '库存',
  293. unresize: 'false',
  294. width: '15%'
  295. }]
  296. ];
  297. } else if (name === "PINFAN_GOODS") {
  298. promotion = 'pinfan';
  299. goodsCols = [
  300. [{
  301. unresize: 'false',
  302. width: '8%',
  303. templet: function (data) {
  304. return `<input type="checkbox" name="goods_checkbox" value="${data.pintuan_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.pintuan_id == selectLink.pinfan_id ? 'checked' : ''} />`;
  305. }
  306. }, {
  307. title: '拼团返利',
  308. unresize: 'false',
  309. width: '52%',
  310. templet: '#goods_info'
  311. }, {
  312. field: 'pintuan_price',
  313. title: '价格',
  314. unresize: 'false',
  315. width: '15%'
  316. }, {
  317. field: 'goods_stock',
  318. title: '库存',
  319. unresize: 'false',
  320. width: '15%'
  321. }]
  322. ];
  323. } else if (name === "GROUPBUY_GOODS") {
  324. promotion = 'groupbuy';
  325. goodsCols = [
  326. [{
  327. unresize: 'false',
  328. width: '8%',
  329. templet: function (data) {
  330. return `<input type="checkbox" name="goods_checkbox" value="${data.groupbuy_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.groupbuy_id == selectLink.groupbuy_id ? 'checked' : ''} />`;
  331. }
  332. }, {
  333. title: '团购商品',
  334. unresize: 'false',
  335. width: '52%',
  336. templet: '#goods_info'
  337. }, {
  338. field: 'groupbuy_price',
  339. title: '价格',
  340. unresize: 'false',
  341. width: '15%'
  342. }, {
  343. field: 'goods_stock',
  344. title: '库存',
  345. unresize: 'false',
  346. width: '15%'
  347. }]
  348. ];
  349. } else if (name === "DISTRIBUTION_GOODS") {
  350. promotion = 'fenxiao';
  351. goodsCols = [
  352. [{
  353. unresize: 'false',
  354. width: '8%',
  355. templet: function (data) {
  356. return `<input type="checkbox" name="goods_checkbox" value="${data.goods_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.goods_id == selectLink.goods_id ? 'checked' : ''} />`;
  357. }
  358. }, {
  359. title: '分销商品',
  360. unresize: 'false',
  361. width: '52%',
  362. templet: '#goods_info'
  363. }, {
  364. field: 'price',
  365. title: '价格',
  366. unresize: 'false',
  367. width: '15%'
  368. }, {
  369. field: 'goods_stock',
  370. title: '库存',
  371. unresize: 'false',
  372. width: '15%'
  373. }]
  374. ]
  375. } else if (name === "BARGAIN_GOODS") {
  376. promotion = 'bargain';
  377. goodsCols = [
  378. [{
  379. unresize: 'false',
  380. width: '8%',
  381. templet: function (data) {
  382. return `<input type="checkbox" name="goods_checkbox" value="${data.bargain_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.bargain_id == selectLink.bargain_id ? 'checked' : ''} />`;
  383. }
  384. }, {
  385. title: '砍价商品',
  386. unresize: 'false',
  387. width: '52%',
  388. templet: '#goods_info'
  389. }, {
  390. field: 'price',
  391. title: '价格',
  392. unresize: 'false',
  393. width: '15%'
  394. }, {
  395. field: 'goods_stock',
  396. title: '库存',
  397. unresize: 'false',
  398. width: '15%'
  399. }]
  400. ]
  401. } else if (name === "PRESALE_GOODS") {
  402. promotion = 'presale';
  403. goodsCols = [
  404. [{
  405. unresize: 'false',
  406. width: '8%',
  407. templet: function (data) {
  408. return `<input type="checkbox" name="goods_checkbox" value="${data.presale_id}" data-goods-name="${data.goods_name}" lay-skin="primary" lay-filter="goods_checkbox" ${data.presale_id == selectLink.presale_id ? 'checked' : ''} />`;
  409. }
  410. }, {
  411. title: '预售商品',
  412. unresize: 'false',
  413. width: '45%',
  414. templet: '#goods_info'
  415. }, {
  416. field: 'presale_name',
  417. title: '活动名称',
  418. unresize: 'false',
  419. width: '30%'
  420. }, {
  421. field: 'presale_stock',
  422. title: '库存',
  423. unresize: 'false',
  424. width: '15%'
  425. }]
  426. ]
  427. }
  428. new Table({
  429. elem: '#goods_list',
  430. url: ns.url('shop/goods/goodsselect'),
  431. where: {
  432. site_id: ns_url.siteId,
  433. app_module: ns_url.appModule,
  434. promotion: promotion,
  435. search_text: $("input[name='search_text']").val()
  436. },
  437. cols: goodsCols
  438. });
  439. // 选择商品
  440. form.on('checkbox(goods_checkbox)', function (data) {
  441. if (data.elem.checked) {
  442. $("input[name='goods_checkbox']:checked").prop("checked", false);
  443. $(data.elem).prop("checked", true);
  444. form.render();
  445. }
  446. });
  447. }
  448. /**
  449. * 获取小游戏
  450. * @param name
  451. */
  452. function getGameList(name) {
  453. var addon_url = '';
  454. if (name === 'CARDS_GAME') {
  455. addon_url = ns.url('cards://shop/cards/lists', {
  456. status: 1,
  457. app_module: ns_url.appModule,
  458. site_id: ns_url.siteId
  459. });
  460. } else if (name === 'TURNTABLE_GAME') {
  461. addon_url = ns.url('turntable://shop/turntable/lists', {
  462. status: 1,
  463. app_module: ns_url.appModule,
  464. site_id: ns_url.siteId
  465. });
  466. } else if (name === 'EGG_GAME') {
  467. addon_url = ns.url('egg://shop/egg/lists', {status: 1, app_module: ns_url.appModule, site_id: ns_url.siteId});
  468. }
  469. var gameCols = [
  470. [
  471. {
  472. unresize: 'false',
  473. width: '8%',
  474. templet: function (data) {
  475. return `<input type="checkbox" name="game_checkbox" value="${data.game_id}" data-game-name="${data.game_name}" lay-skin="primary" lay-filter="game_checkbox" ${data.game_id == selectLink.game_id ? 'checked' : ''} />`;
  476. }
  477. },
  478. {
  479. field: 'game_name',
  480. title: '游戏名称',
  481. unresize: 'false',
  482. width: '60%',
  483. },
  484. {
  485. field: 'status',
  486. title: '游戏状态',
  487. unresize: 'false',
  488. width: '30%',
  489. templet: function (d) {
  490. var status = '';
  491. if (d.status == 0) {
  492. status = '未开始';
  493. } else if (d.status == 1) {
  494. status = '进行中';
  495. } else if (d.status == 2) {
  496. status = '已结束';
  497. } else if (d.status == 3) {
  498. status = '已关闭';
  499. }
  500. return status;
  501. }
  502. }
  503. ]
  504. ];
  505. new Table({
  506. elem: '#game_list',
  507. url: addon_url,
  508. cols: gameCols
  509. });
  510. // 勾选小游戏
  511. form.on('checkbox(game_checkbox)', function (data) {
  512. if (data.elem.checked) {
  513. $("input[name='game_checkbox']:checked").prop("checked", false);
  514. $(data.elem).prop("checked", true);
  515. form.render();
  516. }
  517. });
  518. }
  519. /**
  520. * 获取小游戏
  521. * @param name
  522. */
  523. function getDiyFormList(name) {
  524. var addon_url = ns.url('form://shop/form/lists', {
  525. form_type: 'custom',
  526. is_use: 1,
  527. app_module: ns_url.appModule,
  528. site_id: ns_url.siteId
  529. });
  530. var diyFormCols = [
  531. [
  532. {
  533. unresize: 'false',
  534. width: '10%',
  535. templet: function (data) {
  536. return `<input type="checkbox" name="diy_form_checkbox" value="${data.id}" data-form-name="${data.form_name}" lay-skin="primary" lay-filter="diy_form_checkbox" ${data.id == selectLink.form_id ? 'checked' : ''} />`;
  537. }
  538. },
  539. {
  540. field: 'form_name',
  541. title: '表单名称',
  542. unresize: 'false',
  543. width: '80%',
  544. }
  545. ]
  546. ];
  547. new Table({
  548. elem: '#diy_form_list',
  549. url: addon_url,
  550. cols: diyFormCols
  551. });
  552. // 勾选自定义表单
  553. form.on('checkbox(diy_form_checkbox)', function (data) {
  554. if (data.elem.checked) {
  555. $("input[name='diy_form_checkbox']:checked").prop("checked", false);
  556. $(data.elem).prop("checked", true);
  557. form.render();
  558. }
  559. });
  560. }
  561. /**
  562. * 保存前处理数据的回调
  563. * @param oV 原链接
  564. */
  565. function beforeSaveCallback(oV) {
  566. var name = $('.link-box .link-left dd.text-color').attr('data-name');
  567. var value = {};
  568. // 选择商品分类
  569. var category = $("input[name='category_id']:checked");
  570. if (category.length) {
  571. value.name = name;
  572. value.wap_url = '/pages/goods/list?category_id=' + category.val();
  573. value.title = category.attr('data-category-name');
  574. value.category_id = category.val();
  575. }
  576. // 选择商品
  577. var goods = $("input[name='goods_checkbox']:checked");
  578. if (goods.length) {
  579. value.name = name;
  580. value.title = goods.attr('data-goods-name');
  581. switch (name) {
  582. case 'BARGAIN_GOODS':
  583. // 砍价商品
  584. value.bargain_id = goods.val();
  585. value.wap_url = '/pages_promotion/bargain/detail?b_id=';
  586. break;
  587. case 'GROUPBUY_GOODS':
  588. // 团购商品
  589. value.groupbuy_id = goods.val();
  590. value.wap_url = '/pages_promotion/groupbuy/detail?groupbuy_id=';
  591. break;
  592. case 'PINTUAN_GOODS':
  593. // 拼团商品
  594. value.pintuan_id = goods.val();
  595. value.wap_url = '/pages_promotion/pintuan/detail?pintuan_id=';
  596. break;
  597. case 'PINFAN_GOODS':
  598. // 拼团返利商品
  599. value.pinfan_id = goods.val();
  600. value.wap_url = '/pages_promotion/pinfan/detail?pinfan_id=';
  601. break;
  602. case 'PRESALE_GOODS':
  603. // 预售商品
  604. value.presale_id = goods.val();
  605. value.wap_url = '/pages_promotion/presale/detail?id=';
  606. break;
  607. default:
  608. // 全部商品、分销商品
  609. value.goods_id = goods.val();
  610. value.wap_url = '/pages/goods/detail?goods_id=';
  611. break;
  612. }
  613. value.wap_url += goods.val();
  614. }
  615. // 选择小游戏
  616. var game = $("input[name='game_checkbox']:checked");
  617. if(game.length) {
  618. value.name = name;
  619. value.wap_url = '';
  620. value.title = game.attr('data-game-name');
  621. value.game_id = game.val();
  622. switch (name) {
  623. case 'CARDS_GAME':
  624. value.wap_url = '/pages_promotion/game/cards?id=';
  625. break;
  626. case 'TURNTABLE_GAME':
  627. value.wap_url = '/pages_promotion/game/turntable?id=';
  628. break;
  629. case 'EGG_GAME':
  630. value.wap_url = '/pages_promotion/game/smash_eggs?id=';
  631. break;
  632. }
  633. value.wap_url += game.val();
  634. }
  635. // 选择自定义表单
  636. var diyForm = $("input[name='diy_form_checkbox']:checked");
  637. if(diyForm.length) {
  638. value.name = name;
  639. value.wap_url = '/pages_tool/form/form?id=';
  640. value.title = diyForm.attr('data-form-name');
  641. value.form_id = diyForm.val();
  642. value.wap_url += diyForm.val();
  643. }
  644. // 如果没有选择以上链接,则还原最初链接
  645. if (Object.keys(value).length === 0) value = oV;
  646. return value;
  647. }