代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" integrity="sha384-6pzBo3FDv/PJ8r2KRkGHifhEocL+1X2rVCTTkUfGk7/0pbek5mMa1upzvWbrUbOZ" crossorigin="anonymous">
<script src="static/js/jquery-3.4.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<meta charset="utf-8">
<title></title>
<style>
*{margin: 0;padding: 0;}
.mid{
margin: 0 auto;
}
.main1{
border-radius: 3px;
margin-top: 20px;
width: 96%;
height: 100%;
-moz-box-shadow: 5px 5px 5px #888888; /* 老的 Firefox */
box-shadow: 5px 5px 5px #888888;
background-color: #e2e2e2;
}
.main2{
width: 100%;
height: 80px;
line-height: 80px;
}
.main3{
width: 100%;
}
.main4{
width: 100%;
height: 50px;
line-height: 50px;
}
.left{
float: left;
width: 100px;
height: 49px;
border: 1px solid #d0d0d0;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
margin-left: 10px;
text-align: center;
line-height: 50px;
}
.right{
float: left;
width: 100px;
height: 49px;
border: 1px solid #d0d0d0;
border-left: none;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
text-align: center;
line-height: 50px;
}
.mainp1{
font-size: 40px;
margin: 10px 10px;
}
.mainp2{
font-size: 30px;
margin: 10px 10px;
color: #545454;
}
.all{
width: 100%;
height: 100%;
margin-top: 30px;
}
.mr{
float: right;
}
tr{
height: 40px;
}
td th{
font-size: 20px;
}
.left:hover{
background-color: #d0d0d0;
}
.right:hover{
background-color: #d0d0d0;
cursor: pointer;
}
a{
cursor: pointer;
}
</style>
</head>
<body>
<div class="main1 mid" id="page5">
<div class="main2">
<span class="mainp1">分类管理</span><span class="mainp2">添加分类类型</span>
</div>
<div class="main3">
<table class="table table-hover all">
<tr>
<td style="width: 20%;text-align: center;line-height: 40px;">注意事项</td>
<td style="width: 30%;text-align: center;line-height: 40px;" class="denh5" :style="colorStyle">{{tips}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;">输入标签</td>
<td style="width: 30%;text-align: center;line-height: 40px;"><input type="text" style="width: 100%;"placeholder="输入要增加的标签" v-model="typeName" @keyup="checkRegistInfo"></td>
</tr>
<tr>
<td colspan="4" style="width: 20%;text-align: center;line-height: 40px;">
<button style="background-color: #3B9970;border: none;outline:none;width: 60px;color: white;" @click="submit()">修改</button>
</td>
</tr>
</table>
</div>
</div>
<div style="width: 100%;height: 100px;"></div>
</body>
<script type="text/javascript" src="static/js/vue.js"></script>
<script type="text/javascript" src="static/js/axios.min.js"></script>
<script type="text/javascript" src="static/js/base.js"></script>
<script type="text/javascript" src="static/js/cookie_utils.js"></script>
<script type="text/javascript" src="static/js/utils.js"></script>
<script>
var burl=Baseurl+"/typeandaddr/type";
var token=getCookieValue("token");
var vm=new Vue({
el:"#page5",
data:{
typeName:"",
colorStyle:"color:red",
tips:"",
isRight:false
},
methods:{
submit:function(){
if(vm.checkRegistInfo()){
axios({
method:"post",
url:burl+"/"+vm.typeName,
headers:{
//设置请求头
token:token
}
}).then((res)=>{
var vo=res.data;
if(vo.code==10001){
console.log(vo.msg);
setTimeout(function(){
window.location.href="admain3.html";
},10)
}else{
alert(vo.msg);
}
});
}else{
alert("请输入正确的类型名");
}
},
checkRegistInfo:function(){
if(vm.typeName == ""){
vm.tips="请输入类型名!";
vm.isRight = false;
}else if(vm.typeName.length<2 || vm.typeName.length>4){
vm.tips="类型名必须为2-4给字符!";
vm.isRight = false;
}else{
vm.tips = "";
vm.isRight = true;
}
return vm.isRight;
}
}
})
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。