list.html 17 KB

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