Authored by ping

抽签活动

... ... @@ -5,6 +5,9 @@ common=require('../common/common');
var e = new common.edit("#activityForm");
e.on("render", function() {
});
var bgStyle = $("#backgroundStyle").val();
var prizeList = $("#prizeList").val();
if (bgStyle) {
... ... @@ -20,8 +23,23 @@ e.on("render", function() {
$("#realUserNum").val(prizeObj.realUserNum);
$("#sockUserNum").val(prizeObj.sockUserNum);
}
});
function dealTotalHours() {
var beginTimeStr = $("#beginTimeStr").val();
var endTimeStr = $("#endTimeStr").val();
if (beginTimeStr != "" && endTimeStr != "") {
var bDate = new Date(beginTimeStr);
var eDate = new Date(endTimeStr);
var hours = eDate.getTime() - bDate.getTime();
$("#totalHours").html("总计时间:" + parseInt(hours / (1000 * 60 * 60)) + " 小时");
} else {
$("#totalHours").html("");
}
}
dealTotalHours();
$("#beginTimeStr,#endTimeStr").change(function() {
dealTotalHours();
});
e.init();
... ...
... ... @@ -61,6 +61,7 @@
} else if (item.status == 1) {
HtmArr.push('<a data-index="'+item.__index+'" href="javascript:void(0);" class="closeshops btn btn-danger btn-xs">关闭</a>');
}
HtmArr.push('<a href="/activity/drawline/data/'+item.activityId+'" href="javascript:void(0);" class="btn btn-info btn-xs">数据</a>');
return HtmArr.join('');
}}
]
... ...
... ... @@ -107,5 +107,16 @@ exports.res = [
{name: 'activityDesc',type: 'string'},
{name: 'prizeList',type: 'string'}
]
}, {
// 数据查询页面渲染
route: '/activity/drawline/data/:activityId',
method: 'GET',
view: 'pages/activity/data',
url : "/DrawlineActivityRest/getPrizeDetailInfo",
params:[{
name:'activityId',
type:'Number'
}],
src:'/activity/data'
}
];
... ...
... ... @@ -47,6 +47,9 @@
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:start:beginTimeStr" id="endTimeStr" required placeholder="活动结束时间" value="{{endTimeStr}}" readonly >
</div>
<div class="col-sm-3">
<label class="control-label" id="totalHours"></label>
</div>
<!-- readonly require-->
</div>
... ... @@ -88,12 +91,12 @@
<label class="">顶部banner:<span class="red">*</span></label>
</div>
<div class="col-sm-7">
<input type="file" id="topBanner" name="topBanner" value="{{topBanner}}" placeholder="顶部banner" />
<input type="file" id="topBanner" name="topBanner" value="{{topBanner}}" placeholder="顶部banner" required />
</div>
</div>
<div class="input-group col-sm-10">
<div class="col-sm-2">
<label class="">背景样式:<span class="red">*</span></label>
<div class="input-group col-sm-12">
<div class="col-sm-1">
<label class="">背景样式:</label>
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle1" name="backgroundStyle1" placeholder="背景样式" />
... ... @@ -126,7 +129,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">活动说明:</label>
<div class="col-sm-8">
<input type="text" id="activityDesc" placeholder="活动说明" class="form-control" value="{{activityDesc}}">
<input type="text" id="activityDesc" placeholder="请输入链接" class="form-control" value="{{activityDesc}}">
</div>
</div>
... ...