Authored by yyq

lottery

... ... @@ -125,20 +125,72 @@
<form class="form-horizontal" id="publish-form">
<div class="form-group">
<span class="control-label col-md-2 col-xs-12">APP</span>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="app" placeholder="请输入抽奖码">
</div>
</div>
<div class="form-group">
<span class="control-label col-md-2 col-xs-12">小程序</span>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="miniapp" placeholder="请输入文案">
<div class="col-md-9 col-sm-6 col-xs-12">
<select class="form-control col-md-4 notice-btn-select" name="miniapptype">
<option value="0">默认</option>
<option value="1">关注</option>
<option value="2">跳转</option>
</select>
</div>
</div>
<div class="input-switch-group">
<div class="form-group tip-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="miniapptip" placeholder="请输入弹窗内容">
</div>
</div>
<div class="form-group tip-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="miniappcopy" placeholder="请输入点击复制内容">
</div>
</div>
<div class="form-group link-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="miniapplink" placeholder="请输入跳转链接">
</div>
</div>
</div>
<div class="form-group">
<span class="control-label col-md-2 col-xs-12">H5</span>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="h5" placeholder="请输入跳转的H5链接">
<div class="col-md-9 col-sm-6 col-xs-12">
<select class="form-control notice-btn-select" name="h5type">
<option value="0">默认</option>
<option value="1">关注</option>
<option value="2">跳转</option>
</select>
</div>
</div>
<div class="input-switch-group">
<div class="form-group tip-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="h5tip" placeholder="请输入弹窗内容">
</div>
</div>
<div class="form-group tip-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="h5copy" placeholder="请输入点击复制内容">
</div>
</div>
<div class="form-group link-group">
<span class="control-label col-md-2 col-xs-12"></span>
<div class="col-md-9 col-sm-6 col-xs-12">
<input type="text" class="form-control" name="h5link" placeholder="请输入跳转链接">
</div>
</div>
</div>
</form>
... ...
... ... @@ -5,8 +5,8 @@
*/
#注意:GO;分割执行块
ALTER TABLE act_prize_product ADD (
`notice` VARCHAR(500) DEFAULT '' comment '公告',
`lottery_info` VARCHAR(800) DEFAULT '' comment '开奖信息',
`notice` VARCHAR(1000) DEFAULT '' comment '公告',
`lottery_info` VARCHAR(1000) DEFAULT '' comment '开奖信息',
`lottery_time` int(10) NOT NULL DEFAULT 0 comment '开奖时间'
);
GO;
... ...
... ... @@ -72,22 +72,35 @@ function bindListPageEvent() {
const publishFn = function() {
let t = $publishForm.serializeArray();
let tips = {};
let error;
let tipsVal = {};
$.each(t, function() {
if (!this.value) {
error = true;
return;
}
tips[this.name] = this.value;
});
// 暂时不限制必填
// if (error) {
// alert('请填写完整各端提示信息后进行开奖');
// return;
// }
tipsVal.app = tips.app;
tipsVal.miniappType = +tips.miniapptype;
if (tipsVal.miniappType) {
if (tipsVal.miniappType === 1) {
tipsVal.miniappTip = tips.miniapptip;
tipsVal.miniappCopy = tips.miniappcopy;
} else {
tipsVal.miniappLink = tips.miniapplink;
}
}
tipsVal.h5Type = +tips.h5type;
if (tipsVal.h5Type) {
if (tipsVal.h5Type === 1) {
tipsVal.h5Tip = tips.h5tip;
tipsVal.h5Copy = tips.h5copy;
} else {
tipsVal.h5Link = tips.h5link;
}
}
$.ajax({
method: 'post',
... ... @@ -95,7 +108,7 @@ function bindListPageEvent() {
data: {
id: $confirm.data('id'),
channel: $confirm.data('channel'),
lotteryInfo: JSON.stringify(tips)
lotteryInfo: JSON.stringify(tipsVal)
}
}).then(res => {
if (res.code === 200) {
... ... @@ -116,7 +129,6 @@ function bindListPageEvent() {
notice[this.name] = this.value;
});
noticeVal.content = notice.content;
noticeVal.miniappBtnName = notice.miniappbtn;
... ... @@ -173,11 +185,14 @@ function bindListPageEvent() {
const noticeBtnTypeChangeFn = function() {
let $this = $(this);
let $dom = $this.closest('.form-group').next('.input-switch-group');
let val = +$this.val();
if (+$this.val() === 1) {
$dom.removeClass('type-link');
if (val === 0) {
$dom.removeClass('type-link type-tip');
} else if (val === 1) {
$dom.removeClass('type-link').addClass('type-tip');
} else {
$dom.addClass('type-link');
$dom.removeClass('type-tip').addClass('type-link');
}
};
... ... @@ -189,6 +204,9 @@ function bindListPageEvent() {
$('.btn-switch-close').on('click', switchFn);
$('.btn-export').on('click', exportFn);
$('.btn-publish').on('click', function() {
$('input', $confirm).val('');
$('select', $confirm).val(0).change();
$confirm.data('id', $(this).data('id'));
$confirm.data('channel', $(this).data('channel'));
$confirm.modal('show');
... ...
... ... @@ -81,12 +81,13 @@
display: block;
}
.input-switch-group .tip-group,
.input-switch-group .link-group{
display: none;
}
.input-switch-group.type-link .tip-group{
display: none;
.input-switch-group.type-tip .tip-group{
display: block;
}
.input-switch-group.type-link .link-group{
... ...