代码拉取完成,页面将自动刷新
<!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="admin1">
<div class="main2">
<span class="mainp1">电影管理</span><span class="mainp2">全部电影</span>
</div>
<div class="main3">
<div class="main4">
<input type="search" style="height: 30px;width: 250px;float: right;border: none;outline: none;margin-right: 30px;border-top-right-radius: 3px;border-bottom-right-radius: 3px;" placeholder="搜索电影名" v-model="Name">
<button style="background-color: #3B9970;border: none;outline:none;width: 60px;color: white;float: right;height: 30px;line-height: 30px;border-top-left-radius: 3px;border-bottom-left-radius: 3px;" @click="sherh()">搜索</button>
</div>
<table class="table table-hover all">
<tr>
<th style="width: 10%;text-align: center;line-height: 40px;">ID</th>
<th style="width: 20%;text-align: center;line-height: 40px;">电影名字</th>
<th style="width: 20%;text-align: center;line-height: 40px;">电影地区</th>
<th style="width: 20%;text-align: center;line-height: 40px;">电影状态</th>
<th style="width: 20%;text-align: center;line-height: 40px;">电影属性</th>
<th style="width: 10%;text-align: center;line-height: 40px;">修改</th>
</tr>
<template v-for="movie,index in movies">
<tr>
<td style="width: 10%;text-align: center;line-height: 40px;">{{index+1}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;">{{movie.movieName}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;">{{movie.addr}}</td>
<td style="width: 20%;text-align: center;line-height: 40px;" v-if="movie.strust==1">已上架</td>
<td style="width: 20%;text-align: center;line-height: 40px;" v-else>已下架</td>
<td style="width: 20%;text-align: center;line-height: 40px;"><span v-for="type,dex in movie.movieTypes" > {{type.typeName}}</span>
<td style="width: 10%;text-align: center;line-height: 40px;"><a :href="surl+movie.movieId" style="display: inline-block;background-color: #3B9970;border: none;outline:none;width: 60px;color: white;text-decoration: none;">修改</a></td>
</tr>
</template>
</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>
var token=getCookieValue("token");
var burl=Baseurl+"/movieupdate/all";
var hurl=Baseurl+"/movieupdate/byname";
var vm=new Vue({
el:"#admin1",
data:{
movies:[],
surl:"page2.html?movieId=",
Name:""
},
created() {
axios({
method:"get",
url:burl,
headers:{
//设置请求头
token:token
}
}).then((res)=>{
var vo=res.data;
if(vo.code==10001){
vm.movies={};
vm.movies=vo.data;
console.log(vo.data);
}else{
if(vo.code==20002){
setTimeout(function(){
window.location.href="adminload.html";
},50)
}else{
alert("暂时还没有电影!");
}
}
});
},
methods:{
sherh:function(){
axios({
method:"get",
url:hurl+"/"+vm.Name,
headers:{
//设置请求头
token:token
}
}).then((res)=>{
var vo=res.data;
if(vo.code==10001){
vm.movies=[];
vm.movies=vo.data;
}else{
alert("没有该电影!");
}
});
}
}
})
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。