edit.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <{include file="./admin/header.html"}>
  2. <{include file="./admin/left.html"}>
  3. <{include file="./admin/nav.html"}>
  4. <{include file="get_kindeditor.html"}>
  5. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery-1.7.2.min.js"></script>
  6. <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.css" />
  7. <script type="text/javascript" src="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.js"></script>
  8. <style>
  9. .set-nav {
  10. margin: 0 auto;
  11. }
  12. .set-nav-hr {
  13. background-color: #ddd;
  14. height: 1px;
  15. position: relative;
  16. }
  17. .form-group label {
  18. font-weight: 600;
  19. }
  20. .checkbox-inline, .radio-inline {
  21. font-weight: 400!important;
  22. }
  23. .rowlabel {
  24. font-weight: 300!important;
  25. }
  26. .music_play_hide {
  27. display:none;
  28. }
  29. </style>
  30. <form id="add_platform_form">
  31. <input name="id" type="hidden" value="<{$platformData.id}>">
  32. <div class="col-md-5" style="padding-left: 30px;">
  33. <div class="form-group">
  34. <label class="control-label">编辑列表信息</label>
  35. </div>
  36. <div class="form-group">
  37. <label class="control-label rowlabel">描述</label>
  38. <input name="desc" type="text" class="form-control" value="<{$platformData.desc}>">
  39. <span class="note">平台的描述信息</span>
  40. </div>
  41. <div class="form-group">
  42. <label class="control-label rowlabel">名称</label>
  43. <input name="name" type="text" class="form-control" value="<{$platformData.name}>">
  44. <span class="note">页面标题使用</span>
  45. </div>
  46. <div class="form-group">
  47. <label class="control-label rowlabel">URL短地址</label>
  48. <input name="url" type="text" class="form-control" value="<{$platformData.url}>">
  49. <span class="note">短地址使用</span>
  50. </div>
  51. <div class="form-group">
  52. <label class="control-label rowlabel">色值</label>
  53. <input name="color" type="text" class="form-control" value="<{$platformData.color}>">
  54. <span class="note">页面统一颜色</span>
  55. </div>
  56. <div class="form-group">
  57. <label class="control-label rowlabel">关注地址</label>
  58. <input name="follow_url" type="text" class="form-control" value="<{$platformData.follow_url}>">
  59. <span class="note">导航栏“关注”链接地址</span>
  60. </div>
  61. <div class="form-group">
  62. <label class="control-label rowlabel">“活动”按钮图片</label>
  63. <div>
  64. <img id="home_image_tag" src="<{$platformData.home_img_url}>" style="width:30px;" class="img-thumbnail">
  65. <input id="home_image_input" name='home_img_url' type="hidden" value="<{$platformData.home_img_url}>">
  66. <input id="home_image_upload" type="button" value="默认图片" >
  67. </div>
  68. <div>
  69. <img id="home_image_tag_hover" src="<{$platformData.home_img_url_hover}>" style="width:30px;" class="img-thumbnail">
  70. <input id="home_image_input_hover" name='home_img_url_hover' type="hidden" value="<{$platformData.home_img_url_hover}>">
  71. <input id="home_image_upload_hover" type="button" value="选中图片" >
  72. </div>
  73. <label class="control-label rowlabel">按钮文字</label><input type="text" class="form-control" name='home_img_text' value="<{if $platformData.home_img_text}><{$platformData.home_img_text}><{else}>活动<{/if}>">
  74. <span class="note">导航活动按钮图片。36*36 PNG 图片</span>
  75. </div>
  76. <div class="form-group">
  77. <label class="control-label rowlabel">“关注”按钮图片</label>
  78. <div>
  79. <img id="follow_image_tag" src="<{$platformData.follow_img_url}>" style="width:30px;" class="img-thumbnail">
  80. <input id="follow_image_input" name='follow_img_url' type="hidden" value="<{$platformData.follow_img_url}>">
  81. <input id="follow_image_upload" type="button" value="默认图片" >
  82. </div>
  83. <div>
  84. <img id="follow_image_tag_hover" src="<{$platformData.follow_img_url_hover}>" style="width:30px;" class="img-thumbnail">
  85. <input id="follow_image_input_hover" name='follow_img_url_hover' type="hidden" value="<{$platformData.follow_img_url_hover}>">
  86. <input id="follow_image_upload_hover" type="button" value="选中图片" >
  87. </div>
  88. <label class="control-label rowlabel">按钮文字</label><input type="text" class="form-control" name='follow_img_text' value="<{if $platformData.follow_img_text}><{$platformData.follow_img_text}><{else}>关注<{/if}>">
  89. <span class="note">导航关注按钮图片。36*36 PNG 图片</span>
  90. </div>
  91. <div class="form-group">
  92. <label class="control-label rowlabel">“我的”按钮图片</label>
  93. <div>
  94. <img id="gift_image_tag" src="<{$platformData.gift_img_url}>" style="width:30px;" class="img-thumbnail">
  95. <input id="gift_image_input" name='gift_img_url' type="hidden" value="<{$platformData.gift_img_url}>">
  96. <input id="gift_image_upload" type="button" value="默认图片" >
  97. </div>
  98. <div>
  99. <img id="gift_image_tag_hover" src="<{$platformData.gift_img_url_hover}>" style="width:30px;" class="img-thumbnail">
  100. <input id="gift_image_input_hover" name='gift_img_url_hover' type="hidden" value="<{$platformData.gift_img_url_hover}>">
  101. <input id="gift_image_upload_hover" type="button" value="选中图片" >
  102. </div>
  103. <label class="control-label rowlabel">按钮文字</label><input type="text" class="form-control" name='gift_img_text' value="<{if $platformData.gift_img_text}><{$platformData.gift_img_text}><{else}>我的<{/if}>">
  104. <span class="note">导航我的按钮图片。36*36 PNG 图片</span>
  105. </div>
  106. <div class="form-group">
  107. <label class="control-label rowlabel">“分享”按钮图片</label>
  108. <div>
  109. <img id="share_image_tag" src="<{$platformData.share_img_url}>" style="width:30px;" class="img-thumbnail">
  110. <input id="share_image_input" name='share_img_url' type="hidden" value="<{$platformData.share_img_url}>">
  111. <input id="share_image_upload" type="button" value="默认图片" >
  112. </div>
  113. <div>
  114. <img id="share_image_tag_hover" src="<{$platformData.share_img_url_hover}>" style="width:30px;" class="img-thumbnail">
  115. <input id="share_image_input_hover" name='share_img_url_hover' type="hidden" value="<{$platformData.share_img_url_hover}>">
  116. <input id="share_image_upload_hover" type="button" value="选中图片" >
  117. </div>
  118. <label class="control-label rowlabel">按钮文字</label><input type="text" class="form-control" name='share_img_text' value="<{if $platformData.share_img_text}><{$platformData.share_img_text}><{else}>分享<{/if}>">
  119. <span class="note">导航分享按钮图片。36*36 PNG 图片</span>
  120. </div>
  121. <div class="form-group">
  122. <label class="control-label rowlabel">“招商”按钮图片</label>
  123. <div>
  124. <img id="zs_image_tag" src="<{$platformData.zs_img_url}>" style="width:30px;" class="img-thumbnail">
  125. <input id="zs_image_input" name='zs_img_url' type="hidden" value="<{$platformData.zs_img_url}>">
  126. <input id="zs_image_upload" type="button" value="默认图片" >
  127. </div>
  128. <div>
  129. <img id="zs_image_tag_hover" src="<{$platformData.zs_img_url_hover}>" style="width:30px;" class="img-thumbnail">
  130. <input id="zs_image_input_hover" name='zs_img_url_hover' type="hidden" value="<{$platformData.zs_img_url_hover}>">
  131. <input id="zs_image_upload_hover" type="button" value="选中图片" >
  132. </div>
  133. <label class="control-label rowlabel">按钮文字</label><input type="text" class="form-control" name='zs_img_text' value="<{if $platformData.zs_img_text}><{$platformData.zs_img_text}><{else}>招商<{/if}>">
  134. <br />
  135. <label class="control-label rowlabel">招商地址</label><input type="text" class="form-control" name='zs_img_link' value="<{if $platformData.zs_img_link}><{$platformData.zs_img_link}><{/if}>">
  136. <span class="note">导航招商按钮图片。36*36 PNG 图片</span>
  137. </div>
  138. <div class="form-group">
  139. <label class="control-label rowlabel">微信分享图:</label>
  140. <div>
  141. <img id="weixinShare_image_tag" src="<{$platformData.weixinShare_img_url}>" style="width:150px;" class="img-thumbnail">
  142. <input id="weixinShare_image_input" name='weixinShare_img_url' type="hidden" value="<{$platformData.weixinShare_img_url}>">
  143. <input id="weixinShare_image_upload" type="button" value="选择图片" >
  144. </div>
  145. <span class="note">默认微信分享的图片 JPG、PNG,200*200,小于20k</span>
  146. </div>
  147. <div class="form-group">
  148. <label class="control-label rowlabel">微信分享标题:</label>
  149. <input name="weixinShare_title" type="text" class="form-control" value="<{$platformData.weixinShare_title}>">
  150. <span class="note">少于24个字</span>
  151. </div>
  152. <div class="form-group">
  153. <label class="control-label rowlabel">微信分享内容:</label>
  154. <input name="weixinShare_content" type="text" class="form-control" value="<{$platformData.weixinShare_content}>">
  155. <span class="note">少于36个字</span>
  156. </div>
  157. <div class="form-group">
  158. <label class="control-label rowlabel">广告代码:</label>
  159. <textarea name="ad" class="form-control" placeholder="<{$platformData.ad}>"></textarea>
  160. </div>
  161. <div>
  162. <a id="add_platform_btn" href="javascript:;" class="button button-primary button-small">修改列表</a>
  163. </div>
  164. </div>
  165. </form>
  166. <script>
  167. KISSY.use('node, io', function (S, Node, IO) {
  168. var $ = S.all;
  169. $("#add_platform_btn").on('click', function () {
  170. var desc = $("input[name=desc]").val();
  171. if (!desc) {
  172. alert('请填写描述信息');
  173. return false;
  174. }
  175. var name = $("input[name=name]").val();
  176. if (!name) {
  177. alert('请填写名称');
  178. return false;
  179. }
  180. var url = $("input[name=url]").val();
  181. if (!url) {
  182. alert('请填短地址');
  183. return false;
  184. }
  185. var data = IO.serialize("#add_platform_form");
  186. new IO({
  187. type: "post"
  188. , url: VG.conf.root_domain + '/?c=Admin_Platform_index&a=PageList&a=ReqUp'
  189. , data: data
  190. , success: function (data) {
  191. if (data.ok) { //ok
  192. var url = data.msg;
  193. location.href = VG.conf.root_domain + '/?c=Admin_Platform_index&a=PageList';
  194. } else {
  195. alert('操作失败,原因:'+data.msg);
  196. }
  197. return false;
  198. }
  199. , error: function (NULL, textStatus) {
  200. alert("请求服务器失败,原因:"+textStatus);
  201. }
  202. , dataType: "json"
  203. });
  204. });
  205. });
  206. //取色器
  207. $(document).ready( function() {
  208. $("input[name=color]").minicolors({
  209. defaultValue: '#FFFFFF'
  210. });
  211. });
  212. //home image
  213. KindEditor.ready(function(K) {
  214. var uploadbutton = K.uploadbutton({
  215. button : K('#home_image_upload')[0],
  216. fieldName : 'imgFile',
  217. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  218. afterUpload : function(data) {
  219. if (data.error === 0) {
  220. var url = K.formatUrl(data.url, 'absolute');
  221. K('#home_image_input').val(data.url);
  222. K('#home_image_tag').attr('src', data.url);
  223. } else {
  224. alert(data.message);
  225. }
  226. },
  227. afterError : function(str) {
  228. alert('自定义错误信息: ' + str);
  229. }
  230. });
  231. uploadbutton.fileBox.change(function(e) {
  232. uploadbutton.submit();
  233. });
  234. });
  235. KindEditor.ready(function(K) {
  236. var uploadbutton = K.uploadbutton({
  237. button : K('#home_image_upload_hover')[0],
  238. fieldName : 'imgFile',
  239. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  240. afterUpload : function(data) {
  241. if (data.error === 0) {
  242. var url = K.formatUrl(data.url, 'absolute');
  243. K('#home_image_input_hover').val(data.url);
  244. K('#home_image_tag_hover').attr('src', data.url);
  245. } else {
  246. alert(data.message);
  247. }
  248. },
  249. afterError : function(str) {
  250. alert('自定义错误信息: ' + str);
  251. }
  252. });
  253. uploadbutton.fileBox.change(function(e) {
  254. uploadbutton.submit();
  255. });
  256. });
  257. //follow image
  258. KindEditor.ready(function(K) {
  259. var uploadbutton = K.uploadbutton({
  260. button : K('#follow_image_upload')[0],
  261. fieldName : 'imgFile',
  262. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  263. afterUpload : function(data) {
  264. if (data.error === 0) {
  265. var url = K.formatUrl(data.url, 'absolute');
  266. K('#follow_image_input').val(data.url);
  267. K('#follow_image_tag').attr('src', data.url);
  268. } else {
  269. alert(data.message);
  270. }
  271. },
  272. afterError : function(str) {
  273. alert('自定义错误信息: ' + str);
  274. }
  275. });
  276. uploadbutton.fileBox.change(function(e) {
  277. uploadbutton.submit();
  278. });
  279. });
  280. KindEditor.ready(function(K) {
  281. var uploadbutton = K.uploadbutton({
  282. button : K('#follow_image_upload_hover')[0],
  283. fieldName : 'imgFile',
  284. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  285. afterUpload : function(data) {
  286. if (data.error === 0) {
  287. var url = K.formatUrl(data.url, 'absolute');
  288. K('#follow_image_input_hover').val(data.url);
  289. K('#follow_image_tag_hover').attr('src', data.url);
  290. } else {
  291. alert(data.message);
  292. }
  293. },
  294. afterError : function(str) {
  295. alert('自定义错误信息: ' + str);
  296. }
  297. });
  298. uploadbutton.fileBox.change(function(e) {
  299. uploadbutton.submit();
  300. });
  301. });
  302. //share image
  303. KindEditor.ready(function(K) {
  304. var uploadbutton = K.uploadbutton({
  305. button : K('#share_image_upload')[0],
  306. fieldName : 'imgFile',
  307. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  308. afterUpload : function(data) {
  309. if (data.error === 0) {
  310. var url = K.formatUrl(data.url, 'absolute');
  311. K('#share_image_input').val(data.url);
  312. K('#share_image_tag').attr('src', data.url);
  313. } else {
  314. alert(data.message);
  315. }
  316. },
  317. afterError : function(str) {
  318. alert('自定义错误信息: ' + str);
  319. }
  320. });
  321. uploadbutton.fileBox.change(function(e) {
  322. uploadbutton.submit();
  323. });
  324. });
  325. KindEditor.ready(function(K) {
  326. var uploadbutton = K.uploadbutton({
  327. button : K('#share_image_upload_hover')[0],
  328. fieldName : 'imgFile',
  329. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  330. afterUpload : function(data) {
  331. if (data.error === 0) {
  332. var url = K.formatUrl(data.url, 'absolute');
  333. K('#share_image_input_hover').val(data.url);
  334. K('#share_image_tag_hover').attr('src', data.url);
  335. } else {
  336. alert(data.message);
  337. }
  338. },
  339. afterError : function(str) {
  340. alert('自定义错误信息: ' + str);
  341. }
  342. });
  343. uploadbutton.fileBox.change(function(e) {
  344. uploadbutton.submit();
  345. });
  346. });
  347. KindEditor.ready(function(K) {
  348. var uploadbutton = K.uploadbutton({
  349. button : K('#zs_image_upload')[0],
  350. fieldName : 'imgFile',
  351. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  352. afterUpload : function(data) {
  353. if (data.error === 0) {
  354. var url = K.formatUrl(data.url, 'absolute');
  355. K('#zs_image_input').val(data.url);
  356. K('#zs_image_tag').attr('src', data.url);
  357. } else {
  358. alert(data.message);
  359. }
  360. },
  361. afterError : function(str) {
  362. alert('自定义错误信息: ' + str);
  363. }
  364. });
  365. uploadbutton.fileBox.change(function(e) {
  366. uploadbutton.submit();
  367. });
  368. });
  369. KindEditor.ready(function(K) {
  370. var uploadbutton = K.uploadbutton({
  371. button : K('#zs_image_upload_hover')[0],
  372. fieldName : 'imgFile',
  373. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  374. afterUpload : function(data) {
  375. if (data.error === 0) {
  376. var url = K.formatUrl(data.url, 'absolute');
  377. K('#zs_image_input_hover').val(data.url);
  378. K('#zs_image_tag_hover').attr('src', data.url);
  379. } else {
  380. alert(data.message);
  381. }
  382. },
  383. afterError : function(str) {
  384. alert('自定义错误信息: ' + str);
  385. }
  386. });
  387. uploadbutton.fileBox.change(function(e) {
  388. uploadbutton.submit();
  389. });
  390. });
  391. //gift image
  392. KindEditor.ready(function(K) {
  393. var uploadbutton = K.uploadbutton({
  394. button : K('#gift_image_upload')[0],
  395. fieldName : 'imgFile',
  396. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  397. afterUpload : function(data) {
  398. if (data.error === 0) {
  399. var url = K.formatUrl(data.url, 'absolute');
  400. K('#gift_image_input').val(data.url);
  401. K('#gift_image_tag').attr('src', data.url);
  402. } else {
  403. alert(data.message);
  404. }
  405. },
  406. afterError : function(str) {
  407. alert('自定义错误信息: ' + str);
  408. }
  409. });
  410. uploadbutton.fileBox.change(function(e) {
  411. uploadbutton.submit();
  412. });
  413. });
  414. KindEditor.ready(function(K) {
  415. var uploadbutton = K.uploadbutton({
  416. button : K('#gift_image_upload_hover')[0],
  417. fieldName : 'imgFile',
  418. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  419. afterUpload : function(data) {
  420. if (data.error === 0) {
  421. var url = K.formatUrl(data.url, 'absolute');
  422. K('#gift_image_input_hover').val(data.url);
  423. K('#gift_image_tag_hover').attr('src', data.url);
  424. } else {
  425. alert(data.message);
  426. }
  427. },
  428. afterError : function(str) {
  429. alert('自定义错误信息: ' + str);
  430. }
  431. });
  432. uploadbutton.fileBox.change(function(e) {
  433. uploadbutton.submit();
  434. });
  435. });
  436. // weixin share
  437. KindEditor.ready(function(K) {
  438. var uploadbutton = K.uploadbutton({
  439. button : K('#weixinShare_image_upload')[0],
  440. fieldName : 'imgFile',
  441. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  442. afterUpload : function(data) {
  443. if (data.error === 0) {
  444. var url = K.formatUrl(data.url, 'absolute');
  445. K('#weixinShare_image_input').val(data.url);
  446. K('#weixinShare_image_tag').attr('src', data.url);
  447. } else {
  448. alert(data.message);
  449. }
  450. },
  451. afterError : function(str) {
  452. alert('自定义错误信息: ' + str);
  453. }
  454. });
  455. uploadbutton.fileBox.change(function(e) {
  456. uploadbutton.submit();
  457. });
  458. });
  459. </script>
  460. <{include file="./admin/bottom.html"}>