page_show.html 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  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. <style>
  6. .set-nav {
  7. margin: 0 auto;
  8. }
  9. .set-nav-hr {
  10. background-color: #ddd;
  11. height: 1px;
  12. position: relative;
  13. }
  14. .form-group label {
  15. font-weight: 600;
  16. }
  17. .checkbox-inline, .radio-inline {
  18. font-weight: 400!important;
  19. }
  20. .rowlabel {
  21. font-weight: 300!important;
  22. }
  23. .music_play_hide {
  24. display:none;
  25. }
  26. </style>
  27. <div id="activity_container">
  28. <form id="activity_form">
  29. <div class="activity_center">
  30. <{include file="./admin/activity/common_nav.html"}>
  31. <input name="events_id" type="hidden" value="<{$eventData.id}>">
  32. <div class="form-group">
  33. <label>标题:</label>
  34. <input name="events_name" type="text" class="form-control" value="<{$eventData.events_name}>">
  35. </div>
  36. <div class="form-group">
  37. <label class="control-label">列表默认图<small class="text-danger">(JPG、PNG,640x320,小于60k)</small></label>
  38. <div>
  39. <img id="img_url_tag" src="<{if $eventData.img_url}><{$eventData.img_url}><{else}>http://placehold.it/320x160&text=640x320<{/if}>" style="width:200px;" class="img-thumbnail">
  40. <input id="img_url_input" name="img_url" type="hidden" value="<{$eventData.img_url}>">
  41. <input id="image_upload" type="button" value="选择图片" >
  42. </div>
  43. </div>
  44. <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE' }>
  45. <div class="form-group">
  46. <label class="control-label">开始时间:</label>
  47. <input name="begin_time" type="text" value="<{$eventData.begin_time|date_format:'%Y-%m-%d %H:%M:%S'}>" class="form-control" style="max-width:250px;min-width:200px;">
  48. </div>
  49. <div class="form-group">
  50. <label class="control-label">结束时间:</label>
  51. <input name="end_time" type="text" value="<{$eventData.end_time|date_format:'%Y-%m-%d %H:%M:%S'}>" class="form-control" style="max-width:250px;min-width:200px;">
  52. </div>
  53. <{/if}>
  54. <div class="form-group">
  55. <label class="control-label">发布到哪些列表</label>
  56. <div>
  57. <{foreach from=$platformList item=platfrom}>
  58. <label class="checkbox-inline">
  59. <input disabled name="platform_ids[]" type="checkbox" value="<{$platfrom.id}>" <{if $platfrom.id|in_array:$platFormIds}>checked<{/if}> > <{$platfrom.name}>
  60. </label>
  61. <{/foreach}>
  62. </div>
  63. <div class="note">注:创建后不可修改</div>
  64. </div>
  65. <{if $typeData[$thisType].kw == 'TYPE_EVENTS_OTHER' }>
  66. <div class="form-group">
  67. <label>跳转URL:</label>
  68. <input name="other_url" type="text" class="form-control" value="<{$eventData.other_url}>">
  69. </div>
  70. <{/if}>
  71. <div class="form-group">
  72. <label class="control-label">选择分类</label>
  73. <div>
  74. <select id="cotegory_id" name="category_id">
  75. <option value="0" selected>选择分类名称</option>
  76. <{foreach from=$categoryList item=cate}>
  77. <option value="<{$cate.id}>" <{if $cate.id == $eventData.category_id}>selected<{/if}>><{$cate.name}></option>
  78. <{/foreach}>
  79. </select>
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="control-label">是否推荐到焦点图</label>
  84. <div>
  85. <{foreach from=$focusDisplay item=info key=key}>
  86. <label class="radio-inline">
  87. <input name="focus_display" type="radio" value="<{$key}>" <{if $eventData.focus_display == $key}>checked<{/if}> > <{$info.desc}>
  88. </label>
  89. <{/foreach}>
  90. </div>
  91. </div>
  92. <div class="form-group">
  93. <label class="control-label">是否置顶</label>
  94. <div>
  95. <{foreach from=$topDisplay item=info key=key}>
  96. <label class="radio-inline">
  97. <input name="top_display" type="radio" value="<{$key}>" <{if $eventData.top_display == $key}>checked<{/if}> > <{$info.desc}>
  98. </label>
  99. <{/foreach}>
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <label class="control-label">是否用户登录</label>
  104. <div>
  105. <{foreach from=$authorize item=info key=authid}>
  106. <label class="radio-inline">
  107. <input name="authorize" type="radio" value="<{$authid}>" <{if $eventData.authorize == $authid}>checked<{/if}> > <{$info.desc}>
  108. </label>
  109. <{/foreach}>
  110. </div>
  111. </div>
  112. <div class="form-group">
  113. <label class="control-label">是否在列表中出现</label>
  114. <div>
  115. <{foreach from=$listDisplay item=info key=key}>
  116. <label class="radio-inline">
  117. <input name="list_display" type="radio" value="<{$key}>" <{if $eventData.list_display == $key}>checked<{/if}> > <{$info.desc}>
  118. </label>
  119. <{/foreach}>
  120. </div>
  121. </div>
  122. <{if $displayDesc[$eventData.display].kw != 'EVENT_DISPLAY_UNFINISHED'}>
  123. <div class="form-group">
  124. <label class="control-label">当前发布状态</label>
  125. <div>
  126. <{foreach from=$displayDesc item=info key=key}>
  127. <{if $info.kw != 'EVENT_DISPLAY_UNFINISHED' }>
  128. <label class="radio-inline">
  129. <input name="display" type="radio" value="<{$key}>" <{if $eventData.display == $key}>checked<{/if}> > <{$info.desc}>
  130. </label>
  131. <{/if}>
  132. <{/foreach}>
  133. </div>
  134. </div>
  135. <{/if}>
  136. <{if !$thisType|in_array:$deliveryFormNotType}>
  137. <div class="form-group">
  138. <label class="control-label">当前奖品发货状态</label>
  139. <div>
  140. <{foreach from=$deliveryDesc item=info key=key}>
  141. <label class="radio-inline">
  142. <input name="delivery" type="radio" value="<{$key}>" <{if $eventData.delivery == $key}>checked<{/if}> > <{$info.desc}>
  143. </label>
  144. <{/foreach}>
  145. </div>
  146. </div>
  147. <{/if}>
  148. <{if !$thisType|in_array:$weixinFormNotType}>
  149. <div class="panel panel-default">
  150. <div class="panel-heading"><h3 class="panel-title" id="panel-title">设置微信分享</h3></div>
  151. <div class="panel-body">
  152. <div class="form-group">
  153. <div class="form-group">
  154. <label class="control-label rowlabel">分享用图:<small class="text-danger">JPG、PNG,200*200,小于20k</small></label>
  155. <div>
  156. <img id="share_image_tag" src="<{if $eventData.weixinShare.imgUrl}><{$eventData.weixinShare.imgUrl}><{else}>http://placehold.it/200&text=200x200<{/if}>" style="width:150px;" class="img-thumbnail">
  157. <input id="share_image_input" name='wx_img_url' type="hidden" value="<{$eventData.weixinShare.imgUrl}>">
  158. <input id="share_image_upload" type="button" value="选择图片" >
  159. </div>
  160. </div>
  161. <div class="row">
  162. <div class="col-md-6">
  163. <div class="form-group">
  164. <label class="control-label rowlabel">标题:<small class="text-danger">&lt;24个字</small></label>
  165. <input name="weixinShare_title" type="text" class="form-control" value="<{$eventData.weixinShare.title}>">
  166. </div>
  167. <div class="form-group">
  168. <label class="control-label rowlabel">分享内容:<small class="text-danger">&lt;36个字</small></label>
  169. <input name="weixinShare_content" type="text" class="form-control" value="<{$eventData.weixinShare.content}>">
  170. </div>
  171. <div class="form-group">
  172. <label class="control-label rowlabel">用户分享后跳转地址:</label>
  173. <input name="weixinShare_jump_url" type="text" class="form-control" value="<{$eventData.weixinShare.jump_url}>">
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <{/if}>
  181. <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE'
  182. && $typeData[$thisType].kw != 'TYPE_EVENTS_CUT_SCREEN'
  183. && $typeData[$thisType].kw != 'TYPE_EVENTS_OTHER'
  184. }>
  185. <div class="panel panel-default">
  186. <div class="panel-heading"><h3 class="panel-title" id="panel-title">设置参与规则</h3></div>
  187. <div class="panel-body">
  188. <div class="form-group">
  189. <div class="row">
  190. <div class="col-md-3">
  191. <p>允许每天用户参与次数:</p>
  192. <input name="participation_user_num" type="text" class="form-control" value="<{$eventData.participation_user_num}>" style="max-width:;">
  193. </div>
  194. <div class="col-md-3">
  195. <p>允许每天IP参与次数:</p>
  196. <input name="participation_ip_num" type="text" class="form-control" value="<{$eventData.participation_ip_num}>" style="max-width:;">
  197. </div>
  198. <div class="col-md-3">
  199. <p>允许用户参与次数:</p>
  200. <input type="text" name="participation_user_all_num" class="form-control" value="<{$eventData.participation_user_all_num}>" style="max-width:;">
  201. </div>
  202. <{if $typeData[$thisType].kw == 'TYPE_EVENTS_TURNTABLE' }>
  203. <div class="col-md-3">
  204. <p>允许用户获奖次数:</p>
  205. <input type="text" name="winning_user_num" class="form-control" value="<{$eventData.winning_user_num}>" style="max-width:;">
  206. </div>
  207. <{/if}>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. <{/if}>
  213. <{if $thisType|in_array:$cutDirectionFormNotType}>
  214. <div class="panel panel-default">
  215. <div class="panel-heading"><h3 class="panel-title" id="panel-title">切屏方向</h3></div>
  216. <div class="panel-body">
  217. <div class="form-group">
  218. <div>
  219. <label class="radio-inline">
  220. <input name="cut_fx" type="radio" value="fadeInUp" <{if $eventData.cut_fx == 'fadeInUp'}>checked<{/if}> > 从下向上翻页
  221. </label>
  222. <label class="checkbox-inline">
  223. <input name="cut_fx" type="radio" value="fadeInRight" <{if $eventData.cut_fx == 'fadeInRight'}>checked<{/if}> > 从右向左翻页
  224. </label>
  225. </div>
  226. <div class='note'>调整切屏方向,将改变切屏方式及部分内容显示的效果,一旦选定,尽量不要修改</div>
  227. </div>
  228. </div>
  229. </div>
  230. <{/if}>
  231. <{if $thisType|in_array:$musicFormNotType}>
  232. <div class="panel panel-default">
  233. <div class="panel-heading"><h3 class="panel-title" id="panel-title">专题音乐设置</h3></div>
  234. <div class="panel-body">
  235. <div class="form-group">
  236. <div>
  237. <a href="javascript:;" class="music_play_or_pause <{if !$eventData.music_url}>music_play_hide<{/if}> button button-caution button-circle button-tiny" data-type="play">播</a>
  238. <input id="music_input" name="music_url" type="hidden" value="<{$eventData.music_url}>">
  239. <input id="music_upload" type="button" value="选择音乐" >
  240. </div>
  241. <div>
  242. <p></p>
  243. <span class="">音乐图标放置:</span>
  244. <{foreach from=$getMusicPosition item=info key=posid}>
  245. <label class="radio-inline">
  246. <input name="music_position" type="radio" value="<{$posid}>" <{if $eventData.music_position == $posid}>checked<{/if}> > <{$info.desc}>
  247. </label>
  248. <{/foreach}>
  249. </div>
  250. </div>
  251. <div>目前只支持MP3格式,小于20k</div>
  252. </div>
  253. </div>
  254. <div class="panel panel-default">
  255. <div class="panel-heading"><h3 class="panel-title" id="panel-title">加载动画设置</h3></div>
  256. <div class="panel-body">
  257. <div class="form-group">
  258. <div class="row">
  259. <div class="col-md-3">
  260. <p>加载背景色:</p>
  261. <input id="loading_bg_input" name="loading_bg_color" type="text" class="form-control" style="width:;" value="<{$eventData.loading_bg_color}>">
  262. </div>
  263. <div class="col-md-3">
  264. <p>加载动画、文本颜色:</p>
  265. <input id="loading_text_input" name="loading_text_color" type="text" class="form-control" style="width:;" value="<{$eventData.loading_text_color}>">
  266. </div>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. <{/if}>
  272. <a id="activity_submit" href="javascript:;" class="button button-3d button-primary button-rounded"><i class="fa fa-refresh fa-spin" style="display:none;"></i> 保存设置</a>
  273. </div>
  274. <{include file="./admin/activity/common_right.html"}>
  275. <div style="clear:both;"></div>
  276. </form>
  277. </div>
  278. <{if $thisType|in_array:$musicFormNotType}>
  279. <script src="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.js"></script>
  280. <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.css">
  281. <{/if}>
  282. <script>
  283. KISSY.use('node, io, jquery, gallery/datetimepicker/2.0.0/index, gallery/xplayer/2.1.0/index', function (S, Node, IO, jQuery, Datetimepicker, Xplayer) {
  284. var $ = S.all;
  285. //日期
  286. new Datetimepicker({
  287. start : 'input[name=begin_time]'
  288. });
  289. //日期
  290. new Datetimepicker({
  291. start : 'input[name=end_time]'
  292. });
  293. var XiamiPlay = new Xplayer({
  294. "autoplay": false
  295. });
  296. <{if $eventData.music_url}>
  297. XiamiPlay.load({
  298. 'url' : '<{$eventData.music_url}>',
  299. });
  300. <{/if}>
  301. <{if $thisType|in_array:$musicFormNotType}>
  302. //选择音乐
  303. KindEditor.ready(function(K) {
  304. var uploadbutton = K.uploadbutton({
  305. button : K('#music_upload')[0],
  306. fieldName : 'imgFile',
  307. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=mp3',
  308. afterUpload : function(data) {
  309. if (data.error === 0) {
  310. var url = K.formatUrl(data.url, 'absolute');
  311. K('#music_input').val(data.url);
  312. $(".music_play_or_pause").removeClass('music_play_hide');
  313. XiamiPlay.load({
  314. 'url' : data.url,
  315. });
  316. } else {
  317. alert(data.message);
  318. }
  319. },
  320. afterError : function(str) {
  321. alert('自定义错误信息: ' + str);
  322. }
  323. });
  324. uploadbutton.fileBox.change(function(e) {
  325. uploadbutton.submit();
  326. });
  327. });
  328. $(".music_play_or_pause").on("click", function() {
  329. if ($(this).attr('data-type') == 'play') {
  330. XiamiPlay.play();
  331. $(this).attr('data-type', 'pause').text('停');
  332. } else {
  333. XiamiPlay.pause();
  334. $(this).attr('data-type', 'play').text('播');
  335. }
  336. });
  337. <{/if}>
  338. var activity_submit_status = false; //按钮状态
  339. function submit_button_active() {
  340. activity_submit_status = true;
  341. $("#activity_submit").addClass('active').all('i').show();
  342. }
  343. function submit_button_default() {
  344. activity_submit_status = false;
  345. $("#activity_submit").removeClass('active').all('i').hide();
  346. }
  347. $("#activity_submit").on('click', function () {
  348. if (activity_submit_status) {
  349. return false;
  350. }
  351. submit_button_active();
  352. //表单验证
  353. var events_name = S.trim($("input[name=events_name]").val());
  354. if (!events_name) {
  355. alert('请填写活动标题');
  356. submit_button_default();
  357. return false;
  358. }
  359. var img_url = $("input[name=img_url]").val();
  360. if (!img_url) {
  361. alert('请选择列表默认图片');
  362. submit_button_default();
  363. return false;
  364. }
  365. var type = $("input[name=type]:checked").val();
  366. if (type <= 0) {
  367. alert('请选择活动类型');
  368. submit_button_default();
  369. return false;
  370. }
  371. <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE' }>
  372. var begin_time = $("input[name=begin_time]").val();
  373. var end_time = $("input[name=end_time]").val();
  374. if (!begin_time || !end_time) {
  375. alert('请设置活动时间');
  376. submit_button_default();
  377. return false;
  378. }
  379. <{/if}>
  380. formData = IO.serialize("#activity_form");
  381. new IO({
  382. type: "post"
  383. , url: VG.conf.root_domain + '/?c=Admin_Activity_SetBasics&a=ReqUp'
  384. , data: formData
  385. , success: function (data) {
  386. if (data.ok) { //ok
  387. var url = data.msg;
  388. location.href = url;
  389. } else {
  390. alert('操作失败,原因:'+data.msg);
  391. }
  392. return false;
  393. }
  394. , error: function (NULL, textStatus) {
  395. alert("请求服务器失败,原因:"+textStatus);
  396. }
  397. , dataType: "json"
  398. });
  399. });
  400. });
  401. //设置微信分享
  402. KindEditor.ready(function(K) {
  403. var uploadbutton = K.uploadbutton({
  404. button : K('#share_image_upload')[0],
  405. fieldName : 'imgFile',
  406. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  407. afterUpload : function(data) {
  408. if (data.error === 0) {
  409. var url = K.formatUrl(data.url, 'absolute');
  410. K('#share_image_input').val(data.url);
  411. K('#share_image_tag').attr('src', data.url);
  412. } else {
  413. alert(data.message);
  414. }
  415. },
  416. afterError : function(str) {
  417. alert('自定义错误信息: ' + str);
  418. }
  419. });
  420. uploadbutton.fileBox.change(function(e) {
  421. uploadbutton.submit();
  422. });
  423. });
  424. //列表默认图
  425. KindEditor.ready(function(K) {
  426. var uploadbutton = K.uploadbutton({
  427. button : K('#image_upload')[0],
  428. fieldName : 'imgFile',
  429. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  430. afterUpload : function(data) {
  431. if (data.error === 0) {
  432. var url = K.formatUrl(data.url, 'absolute');
  433. K('#img_url_input').val(data.url);
  434. K('#img_url_tag').attr('src', data.url);
  435. } else {
  436. alert(data.message);
  437. }
  438. },
  439. afterError : function(str) {
  440. alert('自定义错误信息: ' + str);
  441. }
  442. });
  443. uploadbutton.fileBox.change(function(e) {
  444. uploadbutton.submit();
  445. });
  446. });
  447. <{if $thisType|in_array:$musicFormNotType}>
  448. $("#loading_bg_input").minicolors({
  449. defaultValue: '<{$eventData.loading_bg_color}>'
  450. });
  451. $("#loading_text_input").minicolors({
  452. defaultValue: '<{$eventData.loading_text_color}>'
  453. });
  454. <{/if}>
  455. </script>
  456. <{include file="./admin/bottom.html"}>