Commit 747dbb3d authored by daniel's avatar daniel

fix(gk): 新增图片样式

parent 9f98a5a0
......@@ -33,7 +33,8 @@
cmpt_status cmptStatus,
audit_status auditStatus,
is_year_rank isYearRank,
show_in_list showInList
show_in_list showInList,
IFNULL(time_style, 1) timeStyle
FROM `gk_cmpt`
WHERE cmpt_id = #{id} LIMIT 1
</select>
......@@ -53,7 +54,8 @@
update_by,
update_date,
del_flag,
show_in_list
show_in_list,
time_style
) VALUES (
#{cmptId},
#{cmptName},
......@@ -68,7 +70,8 @@
#{updateBy},
#{updateDate},
#{delFlag},
#{showInList}
#{showInList},
#{timeStyle}
)
</insert>
......@@ -303,6 +306,9 @@
<if test="showInList != null">
show_in_list=#{showInList},
</if>
<if test="timeStyle != null">
time_style=#{timeStyle},
</if>
<if test="cmptName != null">
a.cmpt_name = #{cmptName},
c.cmptName = #{cmptName},
......
......@@ -83,4 +83,7 @@ public class Cmpt extends JaapRecord<Cmpt> {
@ApiModelProperty(value = "是否显示在列表中(1:显示,0:不显示)", notes = "是否显示在列表中(1:显示,0:不显示)")
private int showInList;
@ApiModelProperty(value = "时间展示样式(1-5)", notes = "时间展示样式(1-5)")
private Integer timeStyle;
}
......@@ -75,6 +75,7 @@ public class CmptService {
localCmpt.setLocation(cmpt.getLocation());
localCmpt.setLogo(localCmpt.getLogo());
update(localCmpt);
// timeStyle 为本地字段,从数据库读取后已在 localCmpt 中,无需覆盖
return localCmpt;
}
} catch (Exception ex) {
......
......@@ -151,6 +151,25 @@
border: solid 3px #e31515;
}
.time-style-card {
width: 160px;
height: 80px;
border-radius: 6px;
border: 2px solid #e0e0e0;
cursor: pointer;
object-fit: contain;
transition: all 0.2s;
box-sizing: border-box;
}
.time-style-card:hover {
border-color: #999;
}
.time-style-card.active-style {
border: solid 3px #e31515;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #999999;
......@@ -319,7 +338,6 @@
</div>
</div>
</div>
<!-- Check List -->
<div class="cmptLogo">
<div class="checklist card">
<div class="card-header d-flex align-items-center">
......@@ -363,6 +381,36 @@
</div>
</div>
</div>
<div class="row line-first" style="margin-top: 10px;">
<div style="width: 100%;">
<div class="articles card">
<div class="card-header d-flex align-items-center">
<h2 class="h3">时间展示样式</h2>
</div>
<div class="card-body"
style="display: flex;flex-direction: row;align-items: center;flex-wrap: wrap;gap: 15px;padding: 0px 30px;"
id="time-style-select">
<img data-style="1"
class="time-style-card ${(cmpt.timeStyle==1||cmpt.timeStyle==null)?'active-style':''}"
src="https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/assistant/time/style_01.png" />
<img data-style="2"
class="time-style-card ${cmpt.timeStyle==2?'active-style':''}"
src="https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/assistant/time/style_02.png" />
<img data-style="3"
class="time-style-card ${cmpt.timeStyle==3?'active-style':''}"
src="https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/assistant/time/style_03.png" />
<img data-style="4"
class="time-style-card ${cmpt.timeStyle==4?'active-style':''}"
src="https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/assistant/time/style_04.png" />
<img data-style="5"
class="time-style-card ${cmpt.timeStyle==5?'active-style':''}"
src="https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/assistant/time/style_05.png" />
<input type="hidden" name="timeStyle"
id="timeStyle" value="${cmpt.timeStyle}" />
</div>
</div>
</div>
</div>
<div class="row line-first">
<div class="title-sec">
<h2 class="h3 title">赛事小程序码</h2>
......
......@@ -31,6 +31,14 @@ $(function () {
$('#isShowInList').val(this.checked ? 1 : 0);
});
// 时间展示样式选择
$("#time-style-select .time-style-card").click(function () {
var selectedStyle = $(this).data('style');
$("#time-style-select .time-style-card").removeClass('active-style');
$(this).addClass('active-style');
$("#timeStyle").val(selectedStyle ?? '1');
});
$('.savebtn').click(function () {
let bg = $('#cmptBgColorInput').val();
......@@ -38,6 +46,7 @@ $(function () {
let detailStyle = $('#detailStyle').val()?.trim();
let isShowTab = $('#isShowInput').val();
let showInList = $('#isShowInList').val();
let timeStyle = $('#timeStyle').val()?.trim();
let cmptId = getCId();
if (bg.length != 6) {
layer.msg('请输入6位合法字符!');
......@@ -45,6 +54,7 @@ $(function () {
}
const param = {
detailStyle: detailStyle == null || detailStyle.length === 0 ? '1' : detailStyle,
timeStyle: timeStyle == null || timeStyle.length === 0 ? '1' : timeStyle,
cmptId,
logo,
cmptbgColor: "#" + bg,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment