Commit b536575d authored by daniel's avatar daniel

fix(claimer): 免责模块优化和修复

parent 3332bb26
......@@ -19,7 +19,7 @@
<result property="sort" column="sort"></result>
</resultMap>
<select id="queryCmptBycmptId" resultType="Cmpt">
<select id="queryCmptBycmptId" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
SELECT
cmpt_id cmptId,
cmpt_name as cmptName,
......
......@@ -8,7 +8,7 @@ public class RichText {
private Integer id;
private Integer userId;
private Integer cmptId;
// 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位)
// 类型配置(1 网页 2 小程序(appId,path) 3 短连接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png 7 定位 8 微信文章)
private Integer type;
// 分类id
private Integer moduleId;
......
......@@ -101,7 +101,7 @@ public class BannerService {
if(partner != null && StringUtils.isNotBlank(partner.getPartnerId())){
partnerId = partner.getPartnerId();
// 限制其他赛事的处理
if(partnerId != GEEXEK_PARTNER_ID){
if(Objects.equals(partnerId, GEEXEK_PARTNER_ID)||!Objects.equals(banner.getCmptId(), GK_CMPT_ID)){
return null;
}
}
......
package com.dlbridge.jadp.plugins.cmpt.web;
import com.dlbridge.jadp.common.interceptor.PageView;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
@RequestMapping(value = "/gk/disClaimer/")
@RestController
@ApiIgnore
@Log4j2
public class DisclaimerController {
@Resource
private CmptService cmptService;
@RequestMapping("index/{cmptId}")
@PageView
public ModelAndView index(@PathVariable("cmptId") Integer cmptId, ModelAndView mv) {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.setViewName("cmpt/disClaimer");
mv.addObject("cmpt", cmpt);
return mv;
}
}
......@@ -113,6 +113,7 @@ public class ResourcesController {
// 修改为小程序页面路径 by 2025-06-12
obj.put("page", "pages/race/raceHome");
obj.put("width", "1280");
obj.put("check_path", false);
String partnerId = cmptService.getPartnerId(cmptid);
try {
// 重新获取小程序access_token
......
......@@ -3,6 +3,8 @@ package com.dlbridge.jadp.plugins.common;
import cn.hutool.http.HttpUtil;
import com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt;
import com.dlbridge.jadp.plugins.cmpt.service.CmptService;
import com.dlbridge.jadp.plugins.cmpt.utils.AliOssUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -12,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import com.neusoft.www.utils.web.Result;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
......@@ -22,6 +25,9 @@ import java.util.*;
@Slf4j
public class CommonController {
@Resource
private CmptService cmptService;
// 定义允许上传的文件类型及其对应的魔数
private static final Map<String, byte[]> ALLOWED_FILE_TYPES = new HashMap<>();
static {
......@@ -96,6 +102,29 @@ public class CommonController {
return Result.fail().setMsg("文件上传失败");
}
@PostMapping("/uploadClaimer")
@ApiOperation(value = "参赛声明上传")
public Result<?> uploadClaimer(@RequestPart @RequestParam("file") MultipartFile file,@RequestParam(value = "gCmptId") Integer gCmptId) {
try {
String originalFilename = file.getOriginalFilename();
assert originalFilename != null;
// 检查文件名中是否包含点号
int lastIndex = originalFilename.lastIndexOf(".");
if (lastIndex == -1) {
// 如果没有后缀名,直接返回报错信息
return Result.fail().setMsg("上传的文件没有后缀名,请检查文件");
}
String objectName = "micro/" +gCmptId+ "_cmptId/mianze.png";
String filePath = aliOssUtil.upload(file.getBytes(), objectName);
log.info("文件上传名: {} 保存的文件名:{}", originalFilename,filePath);
return Result.success().setContent(filePath);
} catch (IOException e) {
log.error("文件上传失败:{}", e);
}
return Result.fail().setMsg("文件上传失败");
}
/**
* 检查文件的魔数是否与扩展名匹配
* @param fileBytes 文件字节数组
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fns" uri="/WEB-INF/tlds/fns.tld" %>
<%@ taglib prefix="fnc" uri="/WEB-INF/tlds/fnc.tld" %>
<c:set var="ctx" value="${pageContext.request.contextPath}${fns:getAdminPath()}" />
<c:set var="path" value="${pageContext.request.contextPath}${fns:getPath()}" />
<c:set var="jaaproot" value="${pageContext.request.contextPath}" />
<c:set var="ctxStatic" value="${pageContext.request.contextPath}/static" />
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>免责声明</title>
<!-- ... 保留原有的 Vue 引入 ... -->
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<!-- 添加 Naive UI 的引入 -->
<!-- 会使用最新版本,你最好指定一个版本 -->
<script src="https://unpkg.com/naive-ui"></script>
<script type="module"
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule
src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<!-- 自定义css -->
<link rel="stylesheet" href="${ctxStatic}/css/base.css">
<!-- Bootstrap CSS-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- theme stylesheet-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>"
id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<link rel="stylesheet"
href="${ctxStatic}/cmpt/setting.css?v=<%=System.currentTimeMillis()%>">
<script src=" ${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<style>
#app {
padding: 0 20px 20px 20px;
}
.layout {
min-height: 100vh;
}
.carousel-img {
width: 100%;
height: 240px;
object-fit: cover;
}
[v-cloak] {
display: none;
}
.n-message .n-message__icon>* {
position: absolute;
left: 0;
top: -5px !important;
right: 0;
bottom: 0;
}
.n-dialog__icon>* {
position: absolute;
left: 0;
top: -2px !important;
right: 0;
bottom: 0;
}
.light-green {
height: 108px;
background-color: rgba(0, 128, 0, 0.12);
}
.green {
height: 108px;
background-color: rgba(0, 128, 0, 0.24);
}
/* Quill编辑器样式 */
#editor {
height: 200px;
background: #fff;
}
.ql-toolbar {
border-radius: 4px 4px 0 0;
background: #f5f5f5;
}
.ql-container {
border-radius: 0 0 4px 4px;
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div id="app" class="flex-1" v-cloak>
<n-config-provider :locale="locale" :date-locale="dateLocale">
<n-modal-provider>
<n-message-provider>
<n-notification-provider>
<my-app></my-app>
</n-notification-provider>
</n-message-provider>
</n-modal-provider>
</n-config-provider>
</div>
</div>
<script type="text/x-template" id="my-app">
<n-spin :show="loading" >
<n-space >
<n-card title="免责图片">
<div class="flex flex-col w-full justify-center items-center gap-y-3">
<n-image
width="300"
:src="bgImage"
/>
<!-- 只允许上传png -->
<div>
<n-upload
:action="uploadUrl"
@finish="onFileUpload"
v-model:file-list="fileList"
accept="image/png"
>
<n-button type="primary">
上传免责声明
</n-button>
</n-upload>
</div>
</div>
</n-card>
<n-card>
<div class="flex flex-col w-full justify-center items-start gap-y-3">
<h4 class="mb-2">签名图片共 {{total}} 张</h4>
<div class="flex flex-col items-start gap-y-3">
<span class="flex-shrink-0">将签名图片分 </span>
<n-input-number v-model:value="pieceCount" />
<span class="flex-shrink-0">批次下载本次下载第 </span>
<n-input-number v-model:value="pieceNum" />
<span class="flex-shrink-0">批次 </span>
<n-button type="primary" @click="download" block>
下载
</n-button>
</div>
</div>
</n-card>
</n-space>
</n-spin>
</script>
<script>
// 枚举class
class SuperEnum {
constructor(param) {
const keyObj = {};
const valueObj = {};
const nameObj = {};
if (!Array.isArray(param)) {
throw new TypeError('param is not an array!');
}
param.forEach((element) => {
if (!element.key || !element.name) {
return;
}
// 使用对象存储键值对,方便快速查找
keyObj[element.key] = element;
valueObj[element.value] = element;
nameObj[element.name] = element;
// 动态添加属性
this[element.key] = element;
this[element.name] = element;
if (element.key !== element.value) {
this[element.value] = element;
}
});
// 保存源数组
this.data = param;
this.keyObj = keyObj;
this.valueObj = valueObj;
this.nameObj = nameObj;
// 防止被修改
Object.freeze(this);
}
getColorByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.color;
}
getData() {
return this.data;
}
getKeyByName(name) {
const prop = this.nameOf(name);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.key;
}
getNameByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.name;
}
getNameByValue(value) {
const prop = this.valueOf(value);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.name;
}
getValueByKey(key) {
const prop = this.keyOf(key);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.value;
}
getValueByName(name) {
const prop = this.nameOf(name);
if (!prop) {
const error = new Error('No enum constant');
error.code = 'ENUM_NOT_FOUND';
throw error;
}
return prop.value;
}
keyOf(key) {
return this.keyObj[key];
}
nameOf(name) {
return this.nameObj[name];
}
valueOf(value) {
return this.valueObj[value];
}
}
// to 方法,封装try catch
const to = async (
promise,
errorExt,
) => {
try {
const data = await promise
const result = [null, data]
return result
} catch (error) {
if (errorExt) {
const parsedError = Object.assign({}, error, errorExt)
return [parsedError, undefined]
}
return [error, undefined]
}
}
</script>
<script>
const { createApp, defineComponent, onBeforeUnmount, reactive, ref, onMounted, h, computed } = Vue;
const { useMessage, useNotification, dateZhCN, zhCN } = naive
const uploadUrl = window.location.origin + '/api-common/v1/uploadClaimer' + '?gCmptId=' + getCId()
// const cmpt = JSON.parse('${fns:toJson(cmpt)}');
const MyApp = defineComponent({
name: 'MyApp',
template: '#my-app',
setup() {
const message = useMessage()
const notification = useNotification()
const loading = ref(false)
/***---------------- 设置信息 start -----------------*/
const pieceCount = ref(1)
const pieceNum = ref(1)
const gtCmptId = 29197;
const certExit = ref(false)
const fileList = ref([])
const total = ref(0)
// 证书地址
const bgImage = "https://geexekimgoss-sxk.oss-cn-hangzhou.aliyuncs.com/micro/" + getCId() + "_cmptId/mianze.png"
const checkCert = () => {
// 判断图片是否存在
const img = new Image()
img.src = bgImage
img.onload = function () {
certExit.value = true
}
img.onerror = function () {
certExit.value = false
}
}
// 上传成功
const onFileUpload = (file) => {
fileList.value = []
checkCert()
window.location.reload()
}
// 获取统计
const getStatistics = async () => {
loading.value = true
const url = "https://timerbackend.geexek.com//statistics/getSignPicTotalCout.do?cmptId=" + getCId()
const [err, res] = await to(fetch(url).then(res => res.json()))
loading.value = false
if (err) {
message.error(err.message)
return
}
total.value = res.total
}
// 文件下载
const download = async () => {
if (total.value == 0) {
message.error('无签署声明文件')
return
}
loading.value = true
const checkUrl = "https://timerbackend.geexek.com/statistics/checkDownloadSignPic.do?pieceCount=" + pieceCount.value + "&pieceNum=" + pieceNum.value + "&cmptId=" + getCId()
const [err, res] = await to(fetch(checkUrl).then(res => res.json()))
loading.value = false
if (err) {
message.error(err.message)
return
}
if (res.status == 0) {
window.location.href = 'https://timerbackend.geexek.com/statistics/downloadSignPicZip.do?cmptId=' + getCId() + "&pieceCount=" + pieceCount.value + "&pieceNum=" + pieceNum.value;
}
}
// 文件上传
/***---------------- 设置信息 end-----------------*/
// 页面加载
onMounted(() => {
// getGunRules()
getStatistics()
})
return {
pieceCount,
pieceNum,
bgImage,
fileList,
checkCert,
onFileUpload,
uploadUrl,
total,
loading,
download,
}
}
})
const app = Vue.createApp({
setup() {
return {
locale: zhCN,
dateLocale: dateZhCN
}
}
})
app.component('my-app', MyApp)
app.use(naive)
app.mount('#app')
</script>
</body>
</html>
\ No newline at end of file
......@@ -454,7 +454,7 @@
<div class="label-box"
style="margin-left: 40px;margin-top: 20px;margin-bottom: 20px;">
<select id="openType">
<option value="0">文本</option>
<option value="8">推文内容</option>
<option value="1">h5</option>
<option value="2">小程序</option>
<option value="3">短链接</option>
......@@ -462,6 +462,7 @@
<option value="5">文档</option>
<option value="6">图片</option>
<option value="7">地图</option>
<option value="0">文本</option>
</select>
</div>
</div>
......@@ -537,7 +538,6 @@
<label for="">内容编辑 <span style="color:#ce3939">*</span></label>
<div id="container" style="float: right"></div>
</div>
<span id="save" class="save">保存</span>
</div>
</div>
......
......@@ -220,7 +220,6 @@
<span>添加外链项</span>
</div>
</div>
<div style="margin-top: -10px;margin-bottom: 50px">
<table style="width: 100%" class="rule-field">
<colgroup>
......@@ -415,10 +414,10 @@
dialog: false,
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: {
0: {
label: '文本',
placeholder: '请输入文本内容',
desc: '富文本内容',
8: {
label: '推文文本',
placeholder: '请复制推文文本的内容',
desc: '请复制推文文本的内容',
},
1: {
label: '网页',
......@@ -454,7 +453,13 @@
label: '经纬度',
placeholder: '请输入经纬度,逗号隔开',
desc: '请输入文本内容',
}
},
0: {
label: '文本',
placeholder: '请输入文本内容',
desc: '富文本内容',
},
},
typeOptions: [
{
......
......@@ -410,7 +410,7 @@
placeholder="请输入小程序appId">
</div>
</div>
<div class="func" v-if="service.type != 0">
<div class="func" v-if="![0,8].includes(service.type)">
<span class="title-new">{{typeDesc[service.type].label}}</span>
<div>
<input class="input" type="text" v-model="service.path"
......@@ -581,10 +581,11 @@
// 子类目 类型配置(1 网页 2 小程序(appId,path) 3 短链接(#小程序://) 4 页面(小程序) 5文档word,pdf 6 图片 png)
typeDesc: {
0: {
label: '文本',
placeholder: '请输入富文本下的内容',
8: {
label: '推文文本',
placeholder: '请输入推文文本的内容',
},
1: {
label: '网页',
placeholder: '请输入网页地址',
......@@ -612,13 +613,18 @@
7: {
label: '地图',
placeholder: '请输入地址和经纬度',
}
},
0: {
label: '文本',
placeholder: '请输入富文本下的内容',
},
},
typeOptions: [
{
name: '文本',
value: 0,
name: '推文文本',
value: 8,
},
{
name: 'H5',
value: 1,
......@@ -646,6 +652,10 @@
{
name: '地图',
value: 7,
},
{
name: '文本',
value: 0,
}
],
statusType: {
......@@ -935,7 +945,7 @@
layer.msg('上传成功', { icon: 1, time: 1500 });
this.$forceUpdate(); // 强制更新视图
} else {
layer.msg(res.msg, {icon: 2});
layer.msg(res.msg, { icon: 2 });
}
},
beforeSend: () => {
......@@ -976,7 +986,7 @@
layer.msg('上传成功', { icon: 1, time: 1500 });
this.$forceUpdate(); // 强制更新视图
} else {
layer.msg(res.msg, {icon: 2});
layer.msg(res.msg, { icon: 2 });
}
},
beforeSend: () => {
......
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html>
<html>
<head>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html>
<html>
<head>
<title>确认函</title>
<!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
......@@ -15,25 +16,30 @@
<!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>" id="theme-stylesheet">
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/style.default.css?v=<%=System.currentTimeMillis()%>"
id="theme-stylesheet">
<!-- Custom stylesheet - for your changes-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet"
href="${ctxStatic}/newdermon/css/custom.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/main.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css?v=<%=System.currentTimeMillis()%>"/>
<link rel="stylesheet"
href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>" />
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css" />
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css?v=<%=System.currentTimeMillis()%>" />
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css?v=<%=System.currentTimeMillis()%>" />
<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<style>
.submit{
.submit {
display: inline-block;
width: 120px;
height: 45px;
......@@ -46,82 +52,91 @@
cursor: pointer;
font-size: 16px;
}
.input{
width:377px;
height:45px;
.input {
width: 377px;
height: 45px;
line-height: 50px;
border: 2px solid #F4F4F4;
border-radius:4px;
border-radius: 4px;
margin-right: 30px;
margin-left: 0px;
padding-left: 12px;
background:rgba(247,247,247,1);
border-radius:4px;
border:1px solid rgba(229,229,229,1);
background: rgba(247, 247, 247, 1);
border-radius: 4px;
border: 1px solid rgba(229, 229, 229, 1);
}
.title-new{
font-size:20px;
color:rgba(51,51,51,1);
.title-new {
font-size: 20px;
color: rgba(51, 51, 51, 1);
margin-right: 15px;
}
.section{
.section {
display: flex;
height: 330px;
background: rgba(255,255,255,1);
box-shadow: 0px 0px 10px 0px rgba(238,235,235,1);
background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px;
flex-direction: column;
}
.func{
.func {
display: flex;
justify-content: center;
align-items: center;
margin-top: 50px;
}
.tip{
.tip {
font-size: 16px;
color: rgba(51,51,51,1);
color: rgba(51, 51, 51, 1);
position: absolute;
right: 45px;
top: 10px;
}
.road-notice{
.road-notice {
position: absolute;
top: 16px;
height: 15px;
width: 15px;
}
.road-notice-txt{
.road-notice-txt {
color: rgb(206, 57, 57);
font-size: 16px;
margin-left: 25px;
width: 400px;
display: inline-block;
}
.saveDiv{
.saveDiv {
display: flex;
justify-content: center;
margin: 80px;
}
</style>
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
</head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include>
<div class="page-content d-flex align-items-stretch main-body">
<jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght" id="letter">
<div class="section">
<div class="func">
<span class="title-new">功能名称</span>
<div style="position: relative;">
<input @input="count" class="input" type="text" v-model="letter.nameWeb" placeholder="请输入功能名称,最多五个字符">
<input @input="count" class="input" type="text" v-model="letter.nameWeb"
placeholder="请输入功能名称,最多五个字符">
<span class="tip">{{letter.nameWeb.length}}/5</span>
</div>
<div style="position: relative;">
<span class="road-notice"></span>
<span class="road-notice-txt">
此名称用于展示给选手,只能使用中文,<br/>且不能超过5个字。
此名称用于展示给选手,只能使用中文,<br />且不能超过5个字。
</span>
</div>
</div>
......@@ -133,47 +148,47 @@
</div>
</div>
</div>
<script src="${ctxStatic}/vue/vue.js"></script>
<script>
var customerV = new Vue({
el : '#letter',
data : {
letter : {id:'',nameWeb:'',cmptId:getCId()}
el: '#letter',
data: {
letter: { id: '', nameWeb: '', cmptId: getCId() }
},
methods:{
count:function(){
if(customerV.$data.letter.nameWeb.length > 5){
customerV.$data.letter.nameWeb = customerV.$data.letter.nameWeb.substr(0,5)
methods: {
count: function () {
if (customerV.$data.letter.nameWeb.length > 5) {
customerV.$data.letter.nameWeb = customerV.$data.letter.nameWeb.substr(0, 5)
}
},
save : function () {
if(customerV.$data.letter.nameWeb.length == 0){
layer.msg("功能名称不能为空!",{icon:5,duration:1500});
return ;
save: function () {
if (customerV.$data.letter.nameWeb.length == 0) {
layer.msg("功能名称不能为空!", { icon: 5, duration: 1500 });
return;
}
$.ajax({
url : '/gk/sure-letter/updateName',
data : customerV.$data.letter,
type:'post',
beforeSend:function(){
url: '/gk/sure-letter/updateName',
data: customerV.$data.letter,
type: 'post',
beforeSend: function () {
var index = layer.load()
setTimeout(function () {
layer.close(index);
},1500)
}, 1500)
},
success:function (data) {
success: function (data) {
layer.msg('保存成功!')
}
})
}
}
});
function getSureLetter(){
function getSureLetter() {
$.ajax({
url : '/gk/sure-letter/getFunc?cmptId='+getCId()+"&type=18",
success:function (data) {
if(data.content){
url: '/gk/sure-letter/getFunc?cmptId=' + getCId() + "&type=18",
success: function (data) {
if (data.content) {
customerV.$data.letter = data.content;
}
}
......@@ -181,7 +196,7 @@
}
getSureLetter();
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
......@@ -390,6 +390,13 @@
<span class="menu-txt">发枪预约</span>
</a>
</li>
<li class="disClaimer menu-sub-item">
<a
href="/gk/disClaimer/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="left-arrow"></span>
<span class="menu-txt">免责声明</span>
</a>
</li>
</ul>
</li>
</ul>
......@@ -452,7 +459,7 @@
var classes = ['cmptSetting', 'nameList', 'manual', 'contact', 'manage',
'route', 'road', 'equip', 'photo', 'news', 'cert', 'data',
'banner', 'score', 'auto', 'scan', 'review', 'customer', 'rule',
'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect", "feedback", "markNoRule", "gunRule"];
'outter-link', 'sure-letter', 'rankSetting', 'service', "module", "swiper", "bag", "invoice", "markNoSelect", "feedback", "markNoRule", "gunRule", "disClaimer"];
let url = document.location.href;
var done = false;
for (var i in classes) {
......
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