123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490 |
- <{include file="./admin/header.html"}>
- <{include file="./admin/left.html"}>
- <{include file="./admin/nav.html"}>
- <{include file="get_kindeditor.html"}>
- <style>
- .set-nav {
- margin: 0 auto;
- }
- .set-nav-hr {
- background-color: #ddd;
- height: 1px;
- position: relative;
- }
- .form-group label {
- font-weight: 600;
- }
- .checkbox-inline, .radio-inline {
- font-weight: 400!important;
- }
- .rowlabel {
- font-weight: 300!important;
- }
- .music_play_hide {
- display:none;
- }
- </style>
- <div id="activity_container">
- <form id="activity_form">
- <div class="activity_center">
- <{include file="./admin/activity/common_nav.html"}>
- <input name="events_id" type="hidden" value="<{$eventData.id}>">
- <div class="form-group">
- <label>标题:</label>
- <input name="events_name" type="text" class="form-control" value="<{$eventData.events_name}>">
- </div>
- <div class="form-group">
- <label class="control-label">列表默认图<small class="text-danger">(JPG、PNG,640x320,小于60k)</small></label>
- <div>
- <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">
- <input id="img_url_input" name="img_url" type="hidden" value="<{$eventData.img_url}>">
- <input id="image_upload" type="button" value="选择图片" >
- </div>
- </div>
- <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE' }>
- <div class="form-group">
- <label class="control-label">开始时间:</label>
- <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;">
- </div>
- <div class="form-group">
- <label class="control-label">结束时间:</label>
- <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;">
- </div>
- <{/if}>
- <div class="form-group">
- <label class="control-label">发布到哪些列表</label>
- <div>
- <{foreach from=$platformList item=platfrom}>
- <label class="checkbox-inline">
- <input disabled name="platform_ids[]" type="checkbox" value="<{$platfrom.id}>" <{if $platfrom.id|in_array:$platFormIds}>checked<{/if}> > <{$platfrom.name}>
- </label>
- <{/foreach}>
- </div>
- <div class="note">注:创建后不可修改</div>
- </div>
-
- <{if $typeData[$thisType].kw == 'TYPE_EVENTS_OTHER' }>
- <div class="form-group">
- <label>跳转URL:</label>
- <input name="other_url" type="text" class="form-control" value="<{$eventData.other_url}>">
- </div>
- <{/if}>
- <div class="form-group">
- <label class="control-label">选择分类</label>
- <div>
- <select id="cotegory_id" name="category_id">
- <option value="0" selected>选择分类名称</option>
- <{foreach from=$categoryList item=cate}>
- <option value="<{$cate.id}>" <{if $cate.id == $eventData.category_id}>selected<{/if}>><{$cate.name}></option>
- <{/foreach}>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label">是否推荐到焦点图</label>
- <div>
- <{foreach from=$focusDisplay item=info key=key}>
- <label class="radio-inline">
- <input name="focus_display" type="radio" value="<{$key}>" <{if $eventData.focus_display == $key}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label">是否置顶</label>
- <div>
- <{foreach from=$topDisplay item=info key=key}>
- <label class="radio-inline">
- <input name="top_display" type="radio" value="<{$key}>" <{if $eventData.top_display == $key}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label">是否用户登录</label>
- <div>
- <{foreach from=$authorize item=info key=authid}>
- <label class="radio-inline">
- <input name="authorize" type="radio" value="<{$authid}>" <{if $eventData.authorize == $authid}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label">是否在列表中出现</label>
- <div>
- <{foreach from=$listDisplay item=info key=key}>
- <label class="radio-inline">
- <input name="list_display" type="radio" value="<{$key}>" <{if $eventData.list_display == $key}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
-
- <{if $displayDesc[$eventData.display].kw != 'EVENT_DISPLAY_UNFINISHED'}>
- <div class="form-group">
- <label class="control-label">当前发布状态</label>
- <div>
- <{foreach from=$displayDesc item=info key=key}>
- <{if $info.kw != 'EVENT_DISPLAY_UNFINISHED' }>
- <label class="radio-inline">
- <input name="display" type="radio" value="<{$key}>" <{if $eventData.display == $key}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/if}>
- <{/foreach}>
- </div>
- </div>
- <{/if}>
-
- <{if !$thisType|in_array:$deliveryFormNotType}>
- <div class="form-group">
- <label class="control-label">当前奖品发货状态</label>
- <div>
- <{foreach from=$deliveryDesc item=info key=key}>
- <label class="radio-inline">
- <input name="delivery" type="radio" value="<{$key}>" <{if $eventData.delivery == $key}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
- <{/if}>
-
- <{if !$thisType|in_array:$weixinFormNotType}>
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">设置微信分享</h3></div>
- <div class="panel-body">
- <div class="form-group">
- <div class="form-group">
- <label class="control-label rowlabel">分享用图:<small class="text-danger">JPG、PNG,200*200,小于20k</small></label>
- <div>
- <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">
- <input id="share_image_input" name='wx_img_url' type="hidden" value="<{$eventData.weixinShare.imgUrl}>">
- <input id="share_image_upload" type="button" value="选择图片" >
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
- <div class="form-group">
- <label class="control-label rowlabel">标题:<small class="text-danger"><24个字</small></label>
- <input name="weixinShare_title" type="text" class="form-control" value="<{$eventData.weixinShare.title}>">
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">分享内容:<small class="text-danger"><36个字</small></label>
- <input name="weixinShare_content" type="text" class="form-control" value="<{$eventData.weixinShare.content}>">
- </div>
- <div class="form-group">
- <label class="control-label rowlabel">用户分享后跳转地址:</label>
- <input name="weixinShare_jump_url" type="text" class="form-control" value="<{$eventData.weixinShare.jump_url}>">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <{/if}>
- <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE'
- && $typeData[$thisType].kw != 'TYPE_EVENTS_CUT_SCREEN'
- && $typeData[$thisType].kw != 'TYPE_EVENTS_OTHER'
- }>
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">设置参与规则</h3></div>
- <div class="panel-body">
- <div class="form-group">
- <div class="row">
- <div class="col-md-3">
- <p>允许每天用户参与次数:</p>
- <input name="participation_user_num" type="text" class="form-control" value="<{$eventData.participation_user_num}>" style="max-width:;">
- </div>
- <div class="col-md-3">
- <p>允许每天IP参与次数:</p>
- <input name="participation_ip_num" type="text" class="form-control" value="<{$eventData.participation_ip_num}>" style="max-width:;">
- </div>
- <div class="col-md-3">
- <p>允许用户参与次数:</p>
- <input type="text" name="participation_user_all_num" class="form-control" value="<{$eventData.participation_user_all_num}>" style="max-width:;">
- </div>
- <{if $typeData[$thisType].kw == 'TYPE_EVENTS_TURNTABLE' }>
- <div class="col-md-3">
- <p>允许用户获奖次数:</p>
- <input type="text" name="winning_user_num" class="form-control" value="<{$eventData.winning_user_num}>" style="max-width:;">
- </div>
- <{/if}>
- </div>
- </div>
- </div>
- </div>
- <{/if}>
- <{if $thisType|in_array:$cutDirectionFormNotType}>
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">切屏方向</h3></div>
- <div class="panel-body">
- <div class="form-group">
- <div>
- <label class="radio-inline">
- <input name="cut_fx" type="radio" value="fadeInUp" <{if $eventData.cut_fx == 'fadeInUp'}>checked<{/if}> > 从下向上翻页
- </label>
- <label class="checkbox-inline">
- <input name="cut_fx" type="radio" value="fadeInRight" <{if $eventData.cut_fx == 'fadeInRight'}>checked<{/if}> > 从右向左翻页
- </label>
- </div>
- <div class='note'>调整切屏方向,将改变切屏方式及部分内容显示的效果,一旦选定,尽量不要修改</div>
- </div>
- </div>
- </div>
- <{/if}>
-
- <{if $thisType|in_array:$musicFormNotType}>
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">专题音乐设置</h3></div>
- <div class="panel-body">
- <div class="form-group">
- <div>
- <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>
- <input id="music_input" name="music_url" type="hidden" value="<{$eventData.music_url}>">
- <input id="music_upload" type="button" value="选择音乐" >
- </div>
- <div>
- <p></p>
- <span class="">音乐图标放置:</span>
- <{foreach from=$getMusicPosition item=info key=posid}>
- <label class="radio-inline">
- <input name="music_position" type="radio" value="<{$posid}>" <{if $eventData.music_position == $posid}>checked<{/if}> > <{$info.desc}>
- </label>
- <{/foreach}>
- </div>
- </div>
- <div>目前只支持MP3格式,小于20k</div>
- </div>
- </div>
-
- <div class="panel panel-default">
- <div class="panel-heading"><h3 class="panel-title" id="panel-title">加载动画设置</h3></div>
- <div class="panel-body">
- <div class="form-group">
- <div class="row">
- <div class="col-md-3">
- <p>加载背景色:</p>
- <input id="loading_bg_input" name="loading_bg_color" type="text" class="form-control" style="width:;" value="<{$eventData.loading_bg_color}>">
- </div>
- <div class="col-md-3">
- <p>加载动画、文本颜色:</p>
- <input id="loading_text_input" name="loading_text_color" type="text" class="form-control" style="width:;" value="<{$eventData.loading_text_color}>">
- </div>
- </div>
- </div>
- </div>
- </div>
- <{/if}>
- <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>
- </div>
- <{include file="./admin/activity/common_right.html"}>
- <div style="clear:both;"></div>
- </form>
- </div>
- <{if $thisType|in_array:$musicFormNotType}>
- <script src="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.js"></script>
- <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/js/jquery.minicolors.css">
- <{/if}>
- <script>
- KISSY.use('node, io, jquery, gallery/datetimepicker/2.0.0/index, gallery/xplayer/2.1.0/index', function (S, Node, IO, jQuery, Datetimepicker, Xplayer) {
- var $ = S.all;
-
- //日期
- new Datetimepicker({
- start : 'input[name=begin_time]'
- });
- //日期
- new Datetimepicker({
- start : 'input[name=end_time]'
- });
-
- var XiamiPlay = new Xplayer({
- "autoplay": false
- });
-
- <{if $eventData.music_url}>
- XiamiPlay.load({
- 'url' : '<{$eventData.music_url}>',
- });
- <{/if}>
-
- <{if $thisType|in_array:$musicFormNotType}>
- //选择音乐
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#music_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=mp3',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#music_input').val(data.url);
- $(".music_play_or_pause").removeClass('music_play_hide');
- XiamiPlay.load({
- 'url' : data.url,
- });
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
-
- $(".music_play_or_pause").on("click", function() {
- if ($(this).attr('data-type') == 'play') {
- XiamiPlay.play();
- $(this).attr('data-type', 'pause').text('停');
- } else {
- XiamiPlay.pause();
- $(this).attr('data-type', 'play').text('播');
- }
- });
- <{/if}>
-
- var activity_submit_status = false; //按钮状态
- function submit_button_active() {
- activity_submit_status = true;
- $("#activity_submit").addClass('active').all('i').show();
- }
- function submit_button_default() {
- activity_submit_status = false;
- $("#activity_submit").removeClass('active').all('i').hide();
- }
-
- $("#activity_submit").on('click', function () {
- if (activity_submit_status) {
- return false;
- }
- submit_button_active();
-
- //表单验证
- var events_name = S.trim($("input[name=events_name]").val());
- if (!events_name) {
- alert('请填写活动标题');
- submit_button_default();
- return false;
- }
-
- var img_url = $("input[name=img_url]").val();
- if (!img_url) {
- alert('请选择列表默认图片');
- submit_button_default();
- return false;
- }
-
- var type = $("input[name=type]:checked").val();
- if (type <= 0) {
- alert('请选择活动类型');
- submit_button_default();
- return false;
- }
-
- <{if $typeData[$thisType].kw != 'TYPE_EVENTS_ARTICLE' }>
- var begin_time = $("input[name=begin_time]").val();
- var end_time = $("input[name=end_time]").val();
- if (!begin_time || !end_time) {
- alert('请设置活动时间');
- submit_button_default();
- return false;
- }
- <{/if}>
-
- formData = IO.serialize("#activity_form");
- new IO({
- type: "post"
- , url: VG.conf.root_domain + '/?c=Admin_Activity_SetBasics&a=ReqUp'
- , data: formData
- , success: function (data) {
- if (data.ok) { //ok
- var url = data.msg;
- location.href = url;
- } else {
- alert('操作失败,原因:'+data.msg);
- }
- return false;
- }
- , error: function (NULL, textStatus) {
- alert("请求服务器失败,原因:"+textStatus);
- }
- , dataType: "json"
- });
- });
- });
- //设置微信分享
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#share_image_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#share_image_input').val(data.url);
- K('#share_image_tag').attr('src', data.url);
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
- //列表默认图
- KindEditor.ready(function(K) {
- var uploadbutton = K.uploadbutton({
- button : K('#image_upload')[0],
- fieldName : 'imgFile',
- url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
- afterUpload : function(data) {
- if (data.error === 0) {
- var url = K.formatUrl(data.url, 'absolute');
- K('#img_url_input').val(data.url);
- K('#img_url_tag').attr('src', data.url);
- } else {
- alert(data.message);
- }
- },
- afterError : function(str) {
- alert('自定义错误信息: ' + str);
- }
- });
- uploadbutton.fileBox.change(function(e) {
- uploadbutton.submit();
- });
- });
- <{if $thisType|in_array:$musicFormNotType}>
- $("#loading_bg_input").minicolors({
- defaultValue: '<{$eventData.loading_bg_color}>'
- });
- $("#loading_text_input").minicolors({
- defaultValue: '<{$eventData.loading_text_color}>'
- });
- <{/if}>
- </script>
- <{include file="./admin/bottom.html"}>
|