2024-11-06 11:19:37 +08:00
|
|
|
|
<template>
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div class="box box-primary">
|
|
|
|
|
<div class="box-body">
|
|
|
|
|
<section class="content-header">
|
|
|
|
|
<h1 id="itemTitle"></h1>
|
|
|
|
|
</section>
|
|
|
|
|
<section class="content">
|
|
|
|
|
<div id="table"></div>
|
|
|
|
|
<div id="toolbar">
|
|
|
|
|
<div class="col-sm-12">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="skipType" class="col-sm-1 control-label"
|
|
|
|
|
>跳转类型:
|
|
|
|
|
</label>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="skipType"
|
|
|
|
|
id="skipType"
|
|
|
|
|
class="input-m form-control"
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="0">--全部--</option>
|
|
|
|
|
<option value="2">Room ID</option>
|
|
|
|
|
<option value="1">指定地址</option>
|
|
|
|
|
<option value="3">跳转H5页面</option>
|
2024-11-08 11:46:57 +08:00
|
|
|
|
<option value="100">无跳转</option>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="status" class="col-sm-1 control-label">状态:</label>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select name="status" id="status" class="input-m form-control">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="0">--全部--</option>
|
|
|
|
|
<option value="1">激活启用中</option>
|
|
|
|
|
<option value="2">未激活</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="timeStatus" class="col-sm-1 control-label"
|
|
|
|
|
>过期状态:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="timeStatus"
|
|
|
|
|
id="timeStatus"
|
|
|
|
|
class="input-m form-control"
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="0">--全部--</option>
|
|
|
|
|
<option value="1">未开始</option>
|
|
|
|
|
<option value="2">已开始</option>
|
|
|
|
|
<option value="3">已过期</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="app" class="col-sm-1 control-label">app:</label>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select name="app" id="app" class="input-m form-control">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="">--全部--</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-12">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="bannerType" class="col-sm-1 control-label"
|
|
|
|
|
>banner位置:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="bannerType"
|
|
|
|
|
id="searchBannerType"
|
|
|
|
|
class="input-m form-control"
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="">--全部--</option>
|
|
|
|
|
<option value="1">首页</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <label for="beginTime"
|
|
|
|
|
class="col-sm-1 control-label">开始日期: </label>
|
|
|
|
|
<div class="col-sm-2">
|
|
|
|
|
<input type="text"
|
|
|
|
|
name="timeBegin"
|
|
|
|
|
id="beginTime"
|
|
|
|
|
class="input-sm form-control"
|
|
|
|
|
value="">
|
|
|
|
|
</div>
|
|
|
|
|
<label for="endTime"
|
|
|
|
|
class="col-sm-1 control-label">结束日期: </label>
|
|
|
|
|
<div class="col-sm-2">
|
|
|
|
|
<input type="text"
|
|
|
|
|
name="timeEnd"
|
|
|
|
|
id="endTime"
|
|
|
|
|
class="input-sm form-control"
|
|
|
|
|
value="">
|
|
|
|
|
</div> -->
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="partitionId" class="col-sm-1 control-label"
|
|
|
|
|
>地区:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-2">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="partitionId"
|
|
|
|
|
id="partitionId"
|
|
|
|
|
class="form-control"
|
|
|
|
|
></select>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button id="btnSearch" class="btn btn-sm btn-primary">查询</button>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button id="add" class="btn btn-default">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<i class="glyphicon glyphicon-plus"></i>增加
|
|
|
|
|
</button>
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button id="btnMultiDel" class="btn btn-default">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<i class="glyphicon"></i>删除选中
|
|
|
|
|
</button>
|
2024-11-08 17:26:57 +08:00
|
|
|
|
<div class="text">banner尺寸"690*236</div>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<div
|
|
|
|
|
class="modal fade"
|
|
|
|
|
id="bannerModal"
|
|
|
|
|
tabindex="-1"
|
|
|
|
|
role="dialog"
|
|
|
|
|
aria-labelledby="modalLabel"
|
|
|
|
|
>
|
|
|
|
|
<div class="modal-dialog" role="document">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="close"
|
|
|
|
|
data-dismiss="modal"
|
|
|
|
|
aria-label="Close"
|
|
|
|
|
>
|
|
|
|
|
<span aria-hidden="true">x</span>
|
|
|
|
|
</button>
|
|
|
|
|
<h4 class="modal-title" id="modalLabel">banner信息</h4>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<form class="form-horizontal" id="bannerForm">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div id="bannerPartitionDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label name="partition" class="col-sm-3 control-label"
|
|
|
|
|
>选择地区*:</label
|
|
|
|
|
>
|
|
|
|
|
<div class="form-check" id="partitionCheck">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<!-- 分区展示-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="name" class="col-sm-3 control-label"
|
|
|
|
|
>Banner名字:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
name="bannerName"
|
|
|
|
|
id="name"
|
|
|
|
|
/>
|
|
|
|
|
<input type="hidden" id="bannerId" name="bannerId" />
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">banner图:</label>
|
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<img
|
|
|
|
|
src=""
|
|
|
|
|
id="imgUrl"
|
|
|
|
|
style="width: 250px; height: 90px"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
<input type="file" id="uploadFile" name="uploadFile" />
|
|
|
|
|
<button class="btn btn-success" type="button" id="uploadBtn">
|
|
|
|
|
上传
|
|
|
|
|
</button>
|
|
|
|
|
<span class="attention"
|
|
|
|
|
>注意:图片尺寸请注意在750*250,选择图片后请点击上传按钮</span
|
|
|
|
|
>
|
|
|
|
|
<input
|
|
|
|
|
type="hidden"
|
|
|
|
|
id="bannerPic"
|
|
|
|
|
name="bannerPic"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">跳转链接:</label>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select name="skipType" id="skipUrlSort" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="2">Room ID</option>
|
|
|
|
|
<option value="1">指定地址</option>
|
|
|
|
|
<option value="3">跳转H5页面</option>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<option value="100">无跳转</option>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</select>
|
|
|
|
|
<div class="col-sm-6">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2024-11-08 17:26:57 +08:00
|
|
|
|
class="form-control"
|
2024-11-08 14:48:22 +08:00
|
|
|
|
name="skipUri"
|
|
|
|
|
id="skipUrlContent"
|
2024-11-20 11:23:57 +08:00
|
|
|
|
onkeydown="return event.key !== ' '"
|
|
|
|
|
oninput="this.value = this.value.replace(/\s+/g, '')"
|
2024-11-08 14:48:22 +08:00
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="startDate" class="col-sm-3 control-label"
|
|
|
|
|
>起始时间:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
id="startDate"
|
|
|
|
|
type="text"
|
|
|
|
|
name="startTime"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="endDate" class="col-sm-3 control-label"
|
|
|
|
|
>结束时间:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
id="endDate"
|
|
|
|
|
type="text"
|
|
|
|
|
name="endTime"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="seqNo" class="col-sm-3 control-label"
|
|
|
|
|
>排序设置:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="seqNo"
|
|
|
|
|
name="seqNo"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="iosVersion" class="col-sm-3 control-label"
|
|
|
|
|
>ios版本号:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="iosVersion"
|
|
|
|
|
name="iosVersion"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="androidVersion" class="col-sm-3 control-label"
|
|
|
|
|
>安卓版本号:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="androidVersion"
|
|
|
|
|
name="androidVersion"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<span style="color: red; padding-left: 60px"
|
|
|
|
|
>注:app版本号大于配置的版本号才显示该banner</span
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="noShowChannels" class="col-sm-3 control-label"
|
|
|
|
|
>不展示的渠道:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="noShowChannels"
|
|
|
|
|
name="noShowChannels"
|
|
|
|
|
class="form-control"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<span style="color: red; padding-left: 60px"
|
|
|
|
|
>注:留空则为所有渠道展示。多个渠道用英文逗号“,”隔开</span
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="bannerStatus" class="col-sm-3 control-label"
|
|
|
|
|
>激活设置:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="bannerStatus" id="bannerStatus" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">激活</option>
|
|
|
|
|
<option value="2">不激活</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<!--<div class="form-group">-->
|
|
|
|
|
<!--<label for="appId" class="col-sm-3 control-label">app:</label>-->
|
|
|
|
|
<!--<select name="appId" id="appId" class="col-sm-2">-->
|
|
|
|
|
<!--</select>-->
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">Banner位置:</label>
|
|
|
|
|
<div class="col-sm-4">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="bannerType"
|
|
|
|
|
id="bannerType"
|
|
|
|
|
class="col-sm-10"
|
|
|
|
|
onchange="selectOnChange(this.value)"
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">首页</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-5 hidden titleListDev">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="titleId"
|
|
|
|
|
id="titleList"
|
|
|
|
|
class="col-sm-10 titleList"
|
|
|
|
|
></select>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="bannerTypeDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="platform" class="col-sm-3 control-label"
|
|
|
|
|
>展示平台:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="platform" id="platform" class="col-sm-3">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="all">全平台展示</option>
|
|
|
|
|
<option value="ios">只展示IOS</option>
|
|
|
|
|
<option value="android">只展示安卓</option>
|
|
|
|
|
<option value="none">都不展示</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="actLimitDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="limitLevelExper" class="col-sm-3 control-label"
|
|
|
|
|
>活动限制等级经验:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="limitLevelExper"
|
|
|
|
|
id="limitLevelExper"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="showType" class="col-sm-3 control-label"
|
|
|
|
|
>h5页面是否全屏展示:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="showType" id="showType" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">全屏</option>
|
|
|
|
|
<option value="2">非全屏</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="showRule" class="col-sm-3 control-label"
|
|
|
|
|
>活动入口展示规则:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="showRule" id="showRule" class="col-sm-4">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">始终展示</option>
|
|
|
|
|
<option value="2">达到限制等级展示</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
|
|
|
|
关闭
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="save">保存</button>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<div
|
|
|
|
|
class="modal fade"
|
|
|
|
|
id="addBannerModal"
|
|
|
|
|
tabindex="-1"
|
|
|
|
|
role="dialog"
|
|
|
|
|
aria-labelledby="modalLabel2"
|
|
|
|
|
>
|
|
|
|
|
<div class="modal-dialog" role="document">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="modal-content">
|
|
|
|
|
<div class="modal-header">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
class="close"
|
|
|
|
|
data-dismiss="modal"
|
|
|
|
|
aria-label="Close"
|
|
|
|
|
>
|
|
|
|
|
<span aria-hidden="true">x</span>
|
|
|
|
|
</button>
|
|
|
|
|
<h4 class="modal-title" id="addModalLabel">新增banner</h4>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-body">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<form id="addBannerForm" class="form-horizontal">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div id="bannerAddPartitionDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label name="partition" class="col-sm-3 control-label"
|
|
|
|
|
>选择地区*:</label
|
|
|
|
|
>
|
|
|
|
|
<div class="form-check" id="partitionAddCheck">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<!-- 分区展示-->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="addName" class="col-sm-3 control-label"
|
|
|
|
|
>Banner名字:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="bannerName"
|
|
|
|
|
id="addName"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">banner图:</label>
|
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<img
|
|
|
|
|
src=""
|
|
|
|
|
id="addImgUrl"
|
|
|
|
|
style="width: 250px; height: 90px"
|
|
|
|
|
alt=""
|
|
|
|
|
/>
|
|
|
|
|
<input type="file" id="addUploadFile" name="uploadFile" />
|
|
|
|
|
<button class="btn btn-success" type="button" id="addUploadBtn">
|
|
|
|
|
上传
|
|
|
|
|
</button>
|
|
|
|
|
<input
|
|
|
|
|
type="hidden"
|
|
|
|
|
id="addBannerPic"
|
|
|
|
|
name="bannerPic"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">跳转链接:</label>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select name="skipType" id="addSkipUrlSort" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="2">Room ID</option>
|
|
|
|
|
<option value="1">指定地址</option>
|
|
|
|
|
<option value="3">跳转H5页面</option>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<option value="100">无跳转</option>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</select>
|
|
|
|
|
<div class="col-sm-6">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
2024-11-12 15:31:09 +08:00
|
|
|
|
class="form-control"
|
2024-11-08 14:48:22 +08:00
|
|
|
|
name="skipUri"
|
|
|
|
|
id="addSkipUrlContent"
|
2024-11-20 11:23:57 +08:00
|
|
|
|
onkeydown="return event.key !== ' '"
|
|
|
|
|
oninput="this.value = this.value.replace(/\s+/g, '')"
|
2024-11-08 14:48:22 +08:00
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="addStartDate" class="col-sm-3 control-label"
|
|
|
|
|
>起始时间:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
id="addStartDate"
|
|
|
|
|
type="text"
|
|
|
|
|
name="startTime"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="addEndDate" class="col-sm-3 control-label"
|
|
|
|
|
>结束时间:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
id="addEndDate"
|
|
|
|
|
type="text"
|
|
|
|
|
name="endTime"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="seqNo" class="col-sm-3 control-label"
|
|
|
|
|
>排序设置:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="addSeqNo"
|
|
|
|
|
name="seqNo"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="iosVersion" class="col-sm-3 control-label"
|
|
|
|
|
>ios版本号:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="addIosVersion"
|
|
|
|
|
name="iosVersion"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="androidVersion" class="col-sm-3 control-label"
|
|
|
|
|
>安卓版本号:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-3">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="addAndroidVersion"
|
|
|
|
|
name="androidVersion"
|
|
|
|
|
class="form-control validate[required]"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<span style="color: red; padding-left: 60px"
|
|
|
|
|
>注意:app版本号大于配置的版本号才显示该banner</span
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="noShowChannels" class="col-sm-3 control-label"
|
|
|
|
|
>不展示的渠道:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
id="addNoShowChannels"
|
|
|
|
|
name="noShowChannels"
|
|
|
|
|
class="form-control"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<span style="color: red; padding-left: 60px"
|
|
|
|
|
>注:留空则为所有渠道展示。多个渠道用英文逗号“,”隔开</span
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="bannerStatus" class="col-sm-3 control-label"
|
|
|
|
|
>激活设置:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="bannerStatus" id="addBannerStatus" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">激活</option>
|
|
|
|
|
<option value="2">不激活</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<!--<div class="form-group">-->
|
|
|
|
|
<!--<label for="appId" class="col-sm-3 control-label">app:</label>-->
|
|
|
|
|
<!--<select name="appId" id="addAppId" class="col-sm-2 validate[required]">-->
|
|
|
|
|
<!--<option value="">请选择</option>-->
|
|
|
|
|
<!--</select>-->
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="col-sm-3 control-label">Banner位置:</label>
|
|
|
|
|
<div class="col-sm-4">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="bannerType"
|
|
|
|
|
id="addBannerType"
|
|
|
|
|
class="col-sm-10"
|
|
|
|
|
onchange="addSelectOnChange(this.value)"
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">首页</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-sm-5 hidden titleListDev">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<select
|
|
|
|
|
name="titleId"
|
|
|
|
|
id="addTitleList"
|
|
|
|
|
class="col-sm-10 titleList"
|
|
|
|
|
></select>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="addBannerTypeDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="platform" class="col-sm-3 control-label"
|
|
|
|
|
>展示平台:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="platform" id="addPlatform" class="col-sm-3">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="all">全平台展示</option>
|
|
|
|
|
<option value="ios">只展示IOS</option>
|
|
|
|
|
<option value="android">只展示安卓</option>
|
|
|
|
|
<option value="none">都不展示</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div id="addActLimitDiv">
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="limitLevelExper" class="col-sm-3 control-label"
|
|
|
|
|
>活动限制等级经验:</label
|
|
|
|
|
>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<div class="col-sm-8">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<input
|
|
|
|
|
type="text"
|
|
|
|
|
class="form-control"
|
|
|
|
|
name="limitLevelExper"
|
|
|
|
|
id="addLimitLevelExper"
|
|
|
|
|
/>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="showType" class="col-sm-3 control-label"
|
|
|
|
|
>h5页面是否全屏展示:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="showType" id="addShowType" class="col-sm-2">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">全屏</option>
|
|
|
|
|
<option value="2">非全屏</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<label for="showRule" class="col-sm-3 control-label"
|
|
|
|
|
>活动入口展示规则:</label
|
|
|
|
|
>
|
|
|
|
|
<select name="showRule" id="addShowRule" class="col-sm-4">
|
2024-11-06 11:19:37 +08:00
|
|
|
|
<option value="1">始终展示</option>
|
|
|
|
|
<option value="2">达到限制等级展示</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="modal-footer">
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">
|
|
|
|
|
关闭
|
|
|
|
|
</button>
|
|
|
|
|
<button type="button" class="btn btn-primary" id="addSave">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
<div id="imgMask"><img src="" alt="" /></div>
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-11-08 14:48:22 +08:00
|
|
|
|
import TableHelper from "@/utils/bootstrap-table-helper";
|
|
|
|
|
import { getPartitionInfoList } from "@/api/partition/partitionInfo";
|
|
|
|
|
import { buildSelectOption } from "@/utils/system-helper";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
var app = {};
|
|
|
|
|
var validApp = {};
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "towPageBannerView",
|
2024-11-08 14:48:22 +08:00
|
|
|
|
setup() {
|
|
|
|
|
function selectOnChange(val) {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
if (val == 1) {
|
|
|
|
|
$("#bannerTypeDiv").show();
|
|
|
|
|
$("#actLimitDiv").hide();
|
|
|
|
|
} else if (val == 2) {
|
|
|
|
|
$("#actLimitDiv").show();
|
|
|
|
|
$("#bannerTypeDiv").hide();
|
|
|
|
|
} else {
|
|
|
|
|
$("#bannerTypeDiv").hide();
|
|
|
|
|
$("#actLimitDiv").hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
function addSelectOnChange(val) {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
if (val == 1) {
|
|
|
|
|
$("#addBannerTypeDiv").show();
|
|
|
|
|
$("#addActLimitDiv").hide();
|
|
|
|
|
} else if (val == 2) {
|
|
|
|
|
$("#addActLimitDiv").show();
|
|
|
|
|
$("#addBannerTypeDiv").hide();
|
|
|
|
|
} else {
|
|
|
|
|
$("#addBannerTypeDiv").hide();
|
|
|
|
|
$("#addActLimitDiv").hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
window.selectOnChange = selectOnChange;
|
|
|
|
|
window.addSelectOnChange = addSelectOnChange;
|
|
|
|
|
return {
|
|
|
|
|
selectOnChange,
|
2024-11-08 14:48:22 +08:00
|
|
|
|
addSelectOnChange,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
2024-11-08 14:48:22 +08:00
|
|
|
|
created() {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
this.$nextTick(function () {
|
|
|
|
|
this.initPartition();
|
|
|
|
|
this.initData();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
initData() {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
var isEdit = false;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#table").bootstrapTable("destroy");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
initTable();
|
|
|
|
|
|
|
|
|
|
//getAppNames();
|
|
|
|
|
// function getAppNames() {
|
|
|
|
|
// $.get('/admin/appName/listAll', {}, function (res) {
|
|
|
|
|
// if (res.rows.length > 0) {
|
|
|
|
|
// renderSelect(res.rows);
|
|
|
|
|
// renderAppObj(res.rows);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// function renderSelect(data) {
|
|
|
|
|
// var $select = $('#app');
|
|
|
|
|
// for (var i = 0; i < data.length; i++) {
|
|
|
|
|
// var $option = $('<option value="' + data[i].app + '" />');
|
|
|
|
|
// $option.html(data[i].appName);
|
|
|
|
|
// $select.append($option);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// function renderAppObj(rows) {
|
|
|
|
|
// for(var i = 0; i < rows.length; i++) {
|
|
|
|
|
// var row = rows[i];
|
|
|
|
|
// app[row.app] = row.appName;
|
|
|
|
|
// // 有效的app
|
|
|
|
|
// if(row.status == 1) {
|
|
|
|
|
// validApp[row.app] = row.appName;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
2024-11-08 14:48:22 +08:00
|
|
|
|
function initTable() {
|
|
|
|
|
$("#table").bootstrapTable({
|
2024-11-06 11:19:37 +08:00
|
|
|
|
columns: [
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "sel",
|
|
|
|
|
title: "ID",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
checkbox: true,
|
|
|
|
|
width: "1%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "bannerId",
|
|
|
|
|
title: "bannerID",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "5%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "partitionDesc",
|
|
|
|
|
title: "地区",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "5%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "bannerName",
|
|
|
|
|
title: "名称",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "bannerType",
|
|
|
|
|
title: "banner位置",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
switch (val) {
|
|
|
|
|
case 1:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "首页";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
case 2:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "房间内";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
case 3:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "我的装扮";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
case 10:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "个人中心";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "bannerPic",
|
|
|
|
|
title: "banner图",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "10%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
return "<img src='" + val + "' width='60' height='50'>";
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "skipType",
|
|
|
|
|
title: "跳转类型",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
switch (val) {
|
|
|
|
|
case 1:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "App页面";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
case 2:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "聊天室";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
case 3:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "H5页面";
|
|
|
|
|
case 100:
|
|
|
|
|
return "无跳转";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "seqNo",
|
|
|
|
|
title: "banner排序",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "8%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "bannerStatus",
|
|
|
|
|
title: "状态",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "10%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
console.log(val);
|
|
|
|
|
switch (val) {
|
|
|
|
|
case 1:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "正在启用";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
case 2:
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "未激活";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "platform",
|
|
|
|
|
title: "展示平台",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
if (row.bannerType == 1) {
|
|
|
|
|
switch (val) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
case "all":
|
|
|
|
|
return "所有平台展示";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
case "none":
|
|
|
|
|
return "都不展示";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
case "ios":
|
|
|
|
|
return "只在IOS展示";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
case "android":
|
|
|
|
|
return "只在安卓展示";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
|
|
|
|
} else {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "-";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "iosVersion",
|
|
|
|
|
title: "ios版本号",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "androidVersion",
|
|
|
|
|
title: "安卓版本号",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "noShowChannels",
|
|
|
|
|
title: "不展示的渠道",
|
|
|
|
|
align: "center",
|
|
|
|
|
valign: "middle",
|
|
|
|
|
width: "10%",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "startTime",
|
|
|
|
|
title: "活动开始时间",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "5%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
if (val) {
|
|
|
|
|
var date = new Date(val);
|
|
|
|
|
return date.format("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
} else {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "-";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "endTime",
|
|
|
|
|
title: "活动结束时间",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "5%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
if (val) {
|
|
|
|
|
var date = new Date(val);
|
|
|
|
|
return date.format("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
} else {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "-";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "operator",
|
|
|
|
|
title: "操作人",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "5%",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "updateTime",
|
|
|
|
|
title: "操作时间",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "5%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
if (val) {
|
|
|
|
|
var date = new Date(val);
|
|
|
|
|
return date.format("yyyy-MM-dd hh:mm:ss");
|
|
|
|
|
} else {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
return "-";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
2024-11-08 14:48:22 +08:00
|
|
|
|
field: "tmp",
|
|
|
|
|
title: "操作",
|
|
|
|
|
align: "center",
|
|
|
|
|
width: "10%",
|
|
|
|
|
valign: "middle",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
formatter: function (val, row, index) {
|
|
|
|
|
var key = row.bannerId;
|
|
|
|
|
var str;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
str =
|
|
|
|
|
"<button class='btn btn-sm btn-success opt-edit' data-id=" +
|
|
|
|
|
key +
|
|
|
|
|
">编辑</button>";
|
|
|
|
|
str +=
|
|
|
|
|
"<button class='btn btn-sm btn-success opt-del' data-id=" +
|
|
|
|
|
key +
|
|
|
|
|
">删除</button>";
|
2024-11-06 11:19:37 +08:00
|
|
|
|
return str;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
],
|
|
|
|
|
cache: false,
|
|
|
|
|
striped: true,
|
|
|
|
|
showRefresh: false,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pagination: true,
|
|
|
|
|
pageList: [10, 20, 30, 50],
|
|
|
|
|
sidePagination: "server", //表示服务端请求
|
|
|
|
|
//设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
|
|
|
|
|
//设置为limit可以获取limit, offset, search, sort, order
|
|
|
|
|
queryParamsType: "undefined",
|
2024-11-08 14:48:22 +08:00
|
|
|
|
queryParams: function queryParams(params) {
|
|
|
|
|
//设置查询参数
|
|
|
|
|
var beginTime = $("#beginTime").val()
|
|
|
|
|
? $("#beginTime").val() + " 00:00:00"
|
|
|
|
|
: null;
|
|
|
|
|
var endTime = $("#endTime").val()
|
|
|
|
|
? $("#endTime").val() + " 23:59:59"
|
|
|
|
|
: null;
|
2024-11-06 11:19:37 +08:00
|
|
|
|
var param = {
|
|
|
|
|
pageSize: params.pageSize,
|
2024-11-06 15:06:12 +08:00
|
|
|
|
pageNo: params.pageNumber,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
// beginTime: beginTime,
|
|
|
|
|
// endTime: endTime,
|
2024-11-08 14:48:22 +08:00
|
|
|
|
bannerStatus: parseInt($("#status").val()),
|
|
|
|
|
timeStatus: parseInt($("#timeStatus").val()),
|
|
|
|
|
skipType: parseInt($("#skipType").val()),
|
|
|
|
|
bannerType: $("#searchBannerType").val(),
|
|
|
|
|
partitionId: $("#partitionId").val(),
|
2024-11-06 11:19:37 +08:00
|
|
|
|
// appId: ($('#app').val()) ? $('#app').val() : null
|
|
|
|
|
};
|
|
|
|
|
// console.log(param);
|
|
|
|
|
return param;
|
|
|
|
|
},
|
2024-11-08 14:48:22 +08:00
|
|
|
|
uniqueId: "code",
|
|
|
|
|
toolbar: "#toolbar",
|
|
|
|
|
url: "/admin/secondBanner/list",
|
|
|
|
|
onLoadSuccess: function () {
|
|
|
|
|
//加载成功时执行
|
2024-11-06 11:19:37 +08:00
|
|
|
|
console.log("load success");
|
|
|
|
|
},
|
2024-11-08 14:48:22 +08:00
|
|
|
|
onLoadError: function () {
|
|
|
|
|
//加载失败时执行
|
2024-11-06 11:19:37 +08:00
|
|
|
|
console.log("load fail");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#btnSearch").on("click", function () {
|
|
|
|
|
TableHelper.doRefresh("#table");
|
|
|
|
|
});
|
|
|
|
|
$("#table").on("click", ".opt-edit", function () {
|
|
|
|
|
$("#titleList").html("");
|
|
|
|
|
$(".titleListDev").addClass("hidden");
|
|
|
|
|
var id = parseInt($(this).data("id"));
|
2024-11-06 11:19:37 +08:00
|
|
|
|
isEdit = true;
|
|
|
|
|
// // 处理appId
|
|
|
|
|
// $('#appId').empty();
|
|
|
|
|
// $('#appId').append('<option value="">请选择</option>');
|
|
|
|
|
// for(var key in app) {
|
|
|
|
|
// $('#appId').append('<option value="'+key+'">'+app[key]+'</option>');
|
|
|
|
|
// }
|
|
|
|
|
$.ajax({
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "get",
|
|
|
|
|
url: "/partition/listPartitionInfo",
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
|
|
|
|
var length = json.data.length;
|
|
|
|
|
var partitionCheck = $("#partitionCheck");
|
|
|
|
|
partitionCheck.empty();
|
|
|
|
|
// 分区
|
|
|
|
|
for (var i = 0; i < length; i++) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var checkbox = $("<input>", {
|
|
|
|
|
type: "checkbox",
|
|
|
|
|
id: "checkbox" + json.data[i].id,
|
|
|
|
|
name: "partitionIds",
|
|
|
|
|
value: json.data[i].id,
|
|
|
|
|
});
|
|
|
|
|
var label = $("<label>", {
|
|
|
|
|
class: "partition-checkbox-label",
|
|
|
|
|
text: json.data[i].desc,
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
partitionCheck.append(checkbox, label);
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "get",
|
|
|
|
|
url: "/admin/secondBanner/get",
|
|
|
|
|
data: { bannerId: id },
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var date = json.data.endTime
|
|
|
|
|
? new Date(json.data.endTime).format(
|
|
|
|
|
"yyyy-MM-dd hh:mm:ss"
|
|
|
|
|
)
|
|
|
|
|
: "";
|
|
|
|
|
var startDate = json.data.startTime
|
|
|
|
|
? new Date(json.data.startTime).format(
|
|
|
|
|
"yyyy-MM-dd hh:mm:ss"
|
|
|
|
|
)
|
|
|
|
|
: "";
|
|
|
|
|
$("#name").val(json.data.bannerName);
|
|
|
|
|
$("#imgUrl").attr("src", json.data.bannerPic);
|
|
|
|
|
$("#bannerPic").val(json.data.bannerPic);
|
|
|
|
|
$("#skipUrlSort").val(json.data.skipType);
|
|
|
|
|
$("#skipUrlContent").val(json.data.skipUri);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$("#bannerType").val(json.data.bannerType);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#seqNo").val(json.data.seqNo);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//$("#appId").val(json.data.appId);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#iosVersion").val(json.data.iosVersion);
|
|
|
|
|
$("#androidVersion").val(json.data.androidVersion);
|
|
|
|
|
$("#noShowChannels").val(json.data.noShowChannels);
|
|
|
|
|
$("#bannerStatus").val(json.data.bannerStatus);
|
|
|
|
|
$("#startDate").val(startDate);
|
|
|
|
|
$("#endDate").val(date);
|
|
|
|
|
$("#bannerId").val(json.data.bannerId);
|
|
|
|
|
$("#platform").val(json.data.platform);
|
|
|
|
|
$("#limitLevelExper").val(json.data.limitLevelExper);
|
|
|
|
|
$("#showType").val(json.data.showType);
|
|
|
|
|
$("#showRule").val(json.data.showRule);
|
|
|
|
|
window.selectOnChange(
|
|
|
|
|
json.data.bannerType,
|
|
|
|
|
json.data.titleId
|
|
|
|
|
);
|
|
|
|
|
$("#titleList").val(json.data.titleId);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
// 分区信息
|
|
|
|
|
var partitionIds = json.data.partitionIds;
|
|
|
|
|
var length = partitionIds.length;
|
|
|
|
|
for (var i = 0; i < length; i++) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#checkbox" + partitionIds[i]).prop("checked", true);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#bannerModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
// picker1.datetimepicker('setStartDate', startDate);
|
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("获取信息出错");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("获取信息出错");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
function cleanModal(obj) {
|
|
|
|
|
$("#addBannerForm")
|
|
|
|
|
.find("input[type=text],input[type=hidden],input[type=file]")
|
|
|
|
|
.each(function () {
|
|
|
|
|
$(this).val("");
|
|
|
|
|
});
|
|
|
|
|
$("#addBannerForm").find("img").attr("src", "");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空输入框
|
2024-11-08 14:48:22 +08:00
|
|
|
|
obj.find("input:text").val("");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空隐藏域
|
2024-11-08 14:48:22 +08:00
|
|
|
|
obj.find("input:hidden").val("");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空单选按钮
|
2024-11-08 14:48:22 +08:00
|
|
|
|
obj.find("input:radio").attr("checked", false);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空文本域
|
2024-11-08 14:48:22 +08:00
|
|
|
|
obj.find("textarea").val("");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空图片
|
2024-11-08 14:48:22 +08:00
|
|
|
|
obj.find("img").attr("src", "");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//清空已上传
|
|
|
|
|
}
|
|
|
|
|
// 事件编辑
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var $timeBegin = $("#beginTime").datepicker({
|
|
|
|
|
format: "yyyy-mm-dd",
|
|
|
|
|
autoclose: true,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var $timeEnd = $("#endTime").datepicker({
|
|
|
|
|
format: "yyyy-mm-dd",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
autoclose: true,
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$timeBegin.on("changeDate", function () {
|
|
|
|
|
var date = $("#beginTime").datepicker("getDate");
|
|
|
|
|
$timeEnd.datepicker("setStartDate", date);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$timeEnd.on("changeDate", function () {
|
|
|
|
|
var date = $("#endTime").datepicker("getDate");
|
|
|
|
|
$timeBegin.datepicker("setEndDate", date);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#save").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
// if(!$('#appId').val()){
|
|
|
|
|
// $("#tipMsg").text("请选择app");
|
|
|
|
|
// $("#tipModal").modal('show');
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
2024-11-08 17:26:57 +08:00
|
|
|
|
if (
|
|
|
|
|
parseInt($("#skipUrlSort").val()) != 100 &&
|
|
|
|
|
$("#skipUrlContent").val() == ""
|
|
|
|
|
) {
|
|
|
|
|
alert("请填写跳转链接跳转链接");
|
|
|
|
|
return;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
}
|
2024-11-08 17:26:57 +08:00
|
|
|
|
if (
|
|
|
|
|
parseInt($("#skipUrlSort").val()) == 100 &&
|
|
|
|
|
$("#skipUrlContent").val() != ""
|
|
|
|
|
) {
|
|
|
|
|
alert("无跳转无需填写跳转链接");
|
|
|
|
|
return;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
}
|
|
|
|
|
if ($("#bannerForm").validationEngine("validate")) {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$.ajax({
|
|
|
|
|
type: "post",
|
2024-11-08 14:48:22 +08:00
|
|
|
|
url:
|
|
|
|
|
"/admin/secondBanner/save?startTimeString=" +
|
|
|
|
|
$("#startDate").val() +
|
|
|
|
|
"&endTimeString=" +
|
|
|
|
|
$("#endDate").val(),
|
|
|
|
|
data: $("#bannerForm").serialize(),
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#bannerModal").modal("hide");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$("#tipMsg").text("保存成功");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
TableHelper.doRefresh("#table");
|
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#add").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
cleanModal($("#addBannerForm"));
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addTitleList").html("");
|
|
|
|
|
$("#addStartDate").val("");
|
|
|
|
|
$("#addEndDate").val("");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
// 分区处理
|
|
|
|
|
$.ajax({
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "get",
|
|
|
|
|
url: "/partition/listPartitionInfo",
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
|
|
|
|
var length = json.data.length;
|
|
|
|
|
var partitionCheck = $("#partitionAddCheck");
|
|
|
|
|
partitionCheck.empty();
|
|
|
|
|
// 创建3个checkbox元素并添加到myDiv元素上
|
|
|
|
|
for (var i = 0; i < length; i++) {
|
|
|
|
|
var checkbox = $("<input>", {
|
|
|
|
|
type: "checkbox",
|
|
|
|
|
id: "checkbox" + json.data[i].id,
|
|
|
|
|
name: "partitionIds",
|
2024-11-08 14:48:22 +08:00
|
|
|
|
value: json.data[i].id,
|
|
|
|
|
});
|
|
|
|
|
var label = $("<label>", {
|
|
|
|
|
class: "partition-checkbox-label",
|
|
|
|
|
text: json.data[i].desc,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
partitionCheck.append(checkbox, label);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
|
|
|
|
// 处理appId
|
|
|
|
|
// $('#addAppId').empty();
|
|
|
|
|
// $('#addAppId').append('<option value="">请选择</option>');
|
|
|
|
|
// for(var key in validApp) {
|
|
|
|
|
// $('#addAppId').append('<option value="'+key+'">'+validApp[key]+'</option>');
|
|
|
|
|
// }
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addBannerTypeDiv").hide();
|
|
|
|
|
$("#addActLimitDiv").hide();
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addSave").on("click", function () {
|
|
|
|
|
var startDateVal = $("#addStartDate").val();
|
|
|
|
|
var endDateVal = $("#addEndDate").val();
|
2024-11-08 17:26:57 +08:00
|
|
|
|
if (
|
|
|
|
|
parseInt($("#addSkipUrlSort").val()) != 100 &&
|
|
|
|
|
$("#addSkipUrlContent").val() == ""
|
|
|
|
|
) {
|
|
|
|
|
alert("请填写跳转链接跳转链接");
|
|
|
|
|
return;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
}
|
2024-11-08 17:26:57 +08:00
|
|
|
|
if (
|
|
|
|
|
parseInt($("#addSkipUrlSort").val()) == 100 &&
|
|
|
|
|
$("#addSkipUrlContent").val() != ""
|
|
|
|
|
) {
|
|
|
|
|
alert("无跳转无需填写跳转链接");
|
|
|
|
|
return;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
}
|
2024-11-06 11:19:37 +08:00
|
|
|
|
if (!startDateVal || !endDateVal) {
|
|
|
|
|
$("#tipMsg").text("请选择日期");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if(!$('#addAppId').val()){
|
|
|
|
|
// $("#tipMsg").text("请选择app");
|
|
|
|
|
// $("#tipModal").modal('show');
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
2024-11-08 14:48:22 +08:00
|
|
|
|
if ($("#addBannerForm").validationEngine("validate")) {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$.ajax({
|
|
|
|
|
type: "post",
|
2024-11-08 14:48:22 +08:00
|
|
|
|
url:
|
|
|
|
|
"/admin/secondBanner/save?startTimeString=" +
|
|
|
|
|
$("#addStartDate").val() +
|
|
|
|
|
"&endTimeString=" +
|
|
|
|
|
$("#addEndDate").val(),
|
|
|
|
|
data: $("#addBannerForm").serialize(),
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
console.log(json);
|
|
|
|
|
if (json.code == 200) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addBannerModal").modal("hide");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$("#tipMsg").text("保存成功");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
TableHelper.doRefresh("#table");
|
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("保存失败,错误码:" + json.message);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var picker2 = $("#addStartDate").datetimepicker({
|
|
|
|
|
format: "yyyy-mm-dd hh:ii:00",
|
|
|
|
|
autoclose: true,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var picker3 = $("#addEndDate").datetimepicker({
|
|
|
|
|
format: "yyyy-mm-dd hh:ii:00",
|
|
|
|
|
autoclose: true,
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
picker2.on("changeDate", function () {
|
|
|
|
|
var date = $("#addStartDate").datetimepicker("getDate");
|
|
|
|
|
picker2.datetimepicker("setStartDate", date);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
picker3.on("changeDate", function () {
|
|
|
|
|
var date = $("#addEndDate").datetimepicker("getDate");
|
|
|
|
|
picker3.datetimepicker("setEndDate", date);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var picker4 = $("#startDate").datetimepicker({
|
|
|
|
|
format: "yyyy-mm-dd hh:ii:00",
|
|
|
|
|
autoclose: true,
|
|
|
|
|
});
|
|
|
|
|
var picker5 = $("#endDate").datetimepicker({
|
|
|
|
|
format: "yyyy-mm-dd hh:ii:00",
|
|
|
|
|
autoclose: true,
|
|
|
|
|
});
|
|
|
|
|
picker4.on("changeDate", function () {
|
|
|
|
|
var date = $("#startDate").datetimepicker("getDate");
|
|
|
|
|
picker4.datetimepicker("setStartDate", date);
|
|
|
|
|
});
|
|
|
|
|
picker5.on("changeDate", function () {
|
|
|
|
|
var date = $("#endDate").datetimepicker("getDate");
|
|
|
|
|
picker5.datetimepicker("setEndDate", date);
|
|
|
|
|
});
|
|
|
|
|
$("#uploadBtn").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
var options = {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "post",
|
|
|
|
|
url: "/admin/banner/upload",
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#bannerPic").val(json.data);
|
|
|
|
|
$("#imgUrl").attr("src", json.data);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text(json.msg);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
2024-11-06 11:19:37 +08:00
|
|
|
|
$("#bannerForm").ajaxSubmit(options);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
});
|
|
|
|
|
$("#addUploadBtn").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
var options = {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "post",
|
|
|
|
|
url: "/admin/banner/upload",
|
|
|
|
|
dataType: "json",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addBannerPic").val(json.data);
|
|
|
|
|
$("#addImgUrl").attr("src", json.data);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
console.log(json.data);
|
|
|
|
|
} else {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipMsg").text(json.msg);
|
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
$("#addBannerForm").ajaxSubmit(options);
|
|
|
|
|
});
|
|
|
|
|
$("#add").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
isEdit = false;
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addBannerForm")[0].reset();
|
|
|
|
|
$("#addImgUrl").attr("src", "");
|
|
|
|
|
$("#addBannerPic").val("");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
//ComboboxHelper.setDef("#displayType", 0);
|
|
|
|
|
// // 处理appId
|
|
|
|
|
// $('#addAppId').empty();
|
|
|
|
|
// $('#addAppId').append('<option value="">请选择</option>');
|
|
|
|
|
// for(var key in validApp) {
|
|
|
|
|
// $('#addAppId').append('<option value="'+key+'">'+validApp[key]+'</option>');
|
|
|
|
|
// }
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#addBannerModal").modal("show");
|
|
|
|
|
});
|
|
|
|
|
$("#table").on("mouseenter", "img", function (e) {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
console.log($(this), e.clientX);
|
2024-11-08 14:48:22 +08:00
|
|
|
|
var src = $(this).attr("src");
|
|
|
|
|
$("#imgMask img").attr("src", src);
|
|
|
|
|
$("#imgMask").show();
|
|
|
|
|
$("#imgMask").css({
|
2024-11-06 11:19:37 +08:00
|
|
|
|
top: e.clientY + 20,
|
2024-11-08 14:48:22 +08:00
|
|
|
|
left: e.clientX + 20,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
$("#table").on("mouseleave", "img", function (e) {
|
|
|
|
|
console.log("移出");
|
|
|
|
|
$("#imgMask").hide();
|
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#btnMultiDel").on("click", function () {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
var rows = $("#table").bootstrapTable("getSelections");
|
|
|
|
|
if (rows.length == 0) {
|
|
|
|
|
alert("请先选择要删除的记录");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var idArr = [];
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < rows.length; i++) {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
idArr.push(rows[i]["bannerId"]);
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (confirm("你确认删除选中Banner吗?")) {
|
|
|
|
|
$.ajax({
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "post",
|
2024-11-06 15:58:14 +08:00
|
|
|
|
url: "/admin/secondBanner/delete",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
data: {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
ids: JSON.stringify(idArr),
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
|
|
|
|
$("#tipMsg").text("已删除选中Banner");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
TableHelper.doRefresh("#table");
|
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("操作失败");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#table").on("click", ".opt-del", function () {
|
|
|
|
|
var key = parseInt($(this).attr("data-id"));
|
2024-11-06 11:19:37 +08:00
|
|
|
|
var idArr = [];
|
|
|
|
|
idArr.push(key);
|
|
|
|
|
if (confirm("你确认删除Banner吗?")) {
|
|
|
|
|
$.ajax({
|
2024-11-08 14:48:22 +08:00
|
|
|
|
type: "post",
|
2024-11-06 15:58:14 +08:00
|
|
|
|
url: "/admin/secondBanner/delete",
|
2024-11-06 11:19:37 +08:00
|
|
|
|
data: {
|
2024-11-08 14:48:22 +08:00
|
|
|
|
ids: JSON.stringify(idArr),
|
2024-11-06 11:19:37 +08:00
|
|
|
|
},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function (json) {
|
|
|
|
|
if (json.code == 200) {
|
|
|
|
|
$("#tipMsg").text("已删除Banner");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
TableHelper.doRefresh("#table");
|
|
|
|
|
} else {
|
|
|
|
|
$("#tipMsg").text("操作失败");
|
2024-11-08 14:48:22 +08:00
|
|
|
|
$("#tipModal").modal("show");
|
2024-11-06 11:19:37 +08:00
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
},
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2024-11-08 14:48:22 +08:00
|
|
|
|
});
|
2024-11-06 11:19:37 +08:00
|
|
|
|
});
|
|
|
|
|
},
|
2024-11-08 14:48:22 +08:00
|
|
|
|
initPartition() {
|
|
|
|
|
getPartitionInfoList().then((res) => {
|
2024-11-06 11:19:37 +08:00
|
|
|
|
let data = res.data;
|
|
|
|
|
buildSelectOption(
|
|
|
|
|
"#partitionId",
|
|
|
|
|
null,
|
2024-11-08 14:48:22 +08:00
|
|
|
|
[
|
|
|
|
|
{
|
|
|
|
|
value: "",
|
|
|
|
|
text: "全部",
|
|
|
|
|
},
|
|
|
|
|
].concat(
|
|
|
|
|
data.map((v) => {
|
|
|
|
|
return {
|
|
|
|
|
value: v.id,
|
|
|
|
|
text: v.desc,
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
)
|
2024-11-06 11:19:37 +08:00
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
#skipType,
|
|
|
|
|
#status {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btn {
|
|
|
|
|
margin: 0 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#uploadBtn,
|
|
|
|
|
#addUploadBtn {
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#skipUrlSort,
|
|
|
|
|
#bannerStatus,
|
|
|
|
|
#addSkipUrlSort,
|
|
|
|
|
#addBannerStatus {
|
|
|
|
|
height: 34px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.attention {
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#imgMask {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
width: 450px;
|
|
|
|
|
height: 150px;
|
|
|
|
|
padding: 4px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
z-index: 999;
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#imgMask img {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
vertical-align: top;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.partition-checkbox-label {
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
margin-left: 5px;
|
|
|
|
|
}
|
2024-11-20 11:23:57 +08:00
|
|
|
|
.text {
|
2024-11-08 17:26:57 +08:00
|
|
|
|
font-size: 20px;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
color: rgb(173, 53, 53);
|
|
|
|
|
}
|
2024-11-06 11:19:37 +08:00
|
|
|
|
</style>
|