Commit d67f6e08 authored by daniel's avatar daniel

fix(custom): 客服电话校验更新

parent 4c2d8eb0
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %> <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!doctype html> <!doctype html>
<html> <html>
<head>
<head>
<title>赛客客服</title> <title>赛客客服</title>
<!-- Bootstrap CSS--> <!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
...@@ -15,25 +16,30 @@ ...@@ -15,25 +16,30 @@
<!-- Google fonts - Poppins --> <!-- Google fonts - Poppins -->
<link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css"> <link rel="stylesheet" href="${ctxStatic}/newdermon/css/font-css.css">
<!-- theme stylesheet--> <!-- 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--> <!-- 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"> <link rel="stylesheet" href="${ctxStatic}/newdermon/css/juery-ui-1.12.css">
<!-- Favicon--> <!-- Favicon-->
<link rel="shortcut icon" href="https://img.geexek.com/files/home/favicon.ico"> <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}/newdermon/css/main.css?v=<%=System.currentTimeMillis()%>">
<link rel="stylesheet" href="${ctxStatic}/cmpt/setting.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"
<link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css"/> href="${ctxStatic}/leaflet/css/leaflet.css?v=<%=System.currentTimeMillis()%>" />
<link rel="stylesheet" href="${ctxStatic}/cmpt/road.css?v=<%=System.currentTimeMillis()%>"/> <link rel="stylesheet" href="${ctxStatic}/leaflet/css/leaflet_label.css" />
<link rel="stylesheet" href="${ctxStatic}/cmpt/road-new.css?v=<%=System.currentTimeMillis()%>"/> <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}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script> <script src="${ctxStatic}/newdermon/vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script> <script type="text/javascript" charset="utf-8" src="${ctxStatic}/layer/layer.js"></script>
<link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css"> <link rel="stylesheet" href="${ctxStatic}/layer/skin/layer.css">
<style> <style>
.submit{ .submit {
display: inline-block; display: inline-block;
width: 120px; width: 120px;
height: 45px; height: 45px;
...@@ -46,35 +52,39 @@ ...@@ -46,35 +52,39 @@
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 16px;
} }
.input{
.input {
height: 50px; height: 50px;
width: 790px; width: 790px;
line-height: 50px; line-height: 50px;
border: 2px solid #F4F4F4; border: 2px solid #F4F4F4;
border-radius:4px; border-radius: 4px;
margin-right: 30px; margin-right: 30px;
margin-left: 0px; margin-left: 0px;
padding-left: 12px; padding-left: 12px;
} }
.title-new{
.title-new {
font-size: 24px; font-size: 24px;
color: #333333; color: #333333;
} }
.section{
.section {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin: 30px 0px; margin: 30px 0px;
height: 130px; height: 130px;
align-items: center; align-items: center;
background: rgba(255,255,255,1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 0px 10px 0px rgba(238,235,235,1); box-shadow: 0px 0px 10px 0px rgba(238, 235, 235, 1);
border-radius: 4px; border-radius: 4px;
} }
</style> </style>
</head> </head>
<body>
<jsp:include page="../common/header.jsp"></jsp:include> <body>
<div class="page-content d-flex align-items-stretch main-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> <jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght" id="customer"> <div class="rght" id="customer">
<div class="title-new"> <div class="title-new">
...@@ -85,51 +95,51 @@ ...@@ -85,51 +95,51 @@
<span v-on:click="save" class="submit">保存</span> <span v-on:click="save" class="submit">保存</span>
</div> </div>
</div> </div>
<script src="${ctxStatic}/vue/vue.js"></script> <script src="${ctxStatic}/vue/vue.js"></script>
<script> <script>
var customerV = new Vue({ var customerV = new Vue({
el : '#customer', el: '#customer',
data : { data: {
customer : {id:-1,mobile:'',cmptId:getCId()} customer: { id: -1, mobile: '', cmptId: getCId() }
}, },
methods:{ methods: {
save : function () { save: function () {
var telNo = $.trim(customerV.$data.customer.mobile); var telNo = $.trim(customerV.$data.customer.mobile);
var telphone = /^(0|86|17951)?(13[0-9]|15[012356789]|17[01678]|18[0-9]|14[57])[0-9]{8}$/; var telPhone = /^(0|86|17951)?(13[0-9]|14[5-9]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])[0-9]{8}$/;
var fixedTel = /^(0[0-9]{2,3}\-)([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$/; const fixedTel = /^(0[0-9]{2,3}-)([2-9][0-9]{6,7})(-[0-9]{1,4})?$/;
if(!telphone.test(telNo)&&!fixedTel.test(telNo)){ if (!telPhone.test(telNo) && !fixedTel.test(telNo)) {
layer.alert('联系电话格式不正确,请输入正确的固定电话或手机号'); layer.alert('联系电话格式不正确,请输入正确的固定电话或手机号');
return false; return false;
} }
$.ajax({ $.ajax({
url : '/gk/customer/saveOrUpdate', url: '/gk/customer/saveOrUpdate',
data : customerV.$data.customer, data: customerV.$data.customer,
type:'post', type: 'post',
beforeSend:function(){ beforeSend: function () {
var index = layer.load() var index = layer.load()
setTimeout(function () { setTimeout(function () {
layer.close(index); layer.close(index);
},1500) }, 1500)
}, },
success:function (data) { success: function (data) {
customerV.$data.customer = data.content; customerV.$data.customer = data.content;
layer.msg('保存成功!') layer.msg('保存成功!')
setTimeout(function () { setTimeout(function () {
layer.closeAll(); layer.closeAll();
},1000) }, 1000)
} }
}) })
} }
} }
}); });
function getCustomer(){ function getCustomer() {
$.ajax({ $.ajax({
url : '/gk/customer/'+getCId(), url: '/gk/customer/' + getCId(),
success:function (data) { success: function (data) {
if(data.content){ if (data.content) {
customerV.$data.customer = data.content; customerV.$data.customer = data.content;
} }
} }
...@@ -137,7 +147,7 @@ ...@@ -137,7 +147,7 @@
} }
getCustomer(); getCustomer();
</script> </script>
</body> </body>
</html> </html>
\ No newline at end of file
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