page_create.html 15 KB

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