vue实现手机端电影活动位置选座代码
代码语言:html
所属分类:其他
代码描述:vue实现手机端电影活动位置选座代码实现电影院位置选座代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum=1.0,minimum=1.0,user-scalable=0" />
<style>
body{
background: #ffe7e7;
}
.seatClass {
position: absolute;
}
.box {
position: relative;
margin-top: -40px;
}
.seatImgClass {
position: absolute;
top: 0;
left: 0;
height: 70%;
}
.title {
width: 100%;
height: 35px;
background-color: rgba(255, 0, 0, 0.8);
text-align: center;
line-height: 35px;
color: #fff;
letter-spacing: 2px;
}
.titleInfo {
display: flex;
justify-content: space-between;
font-size: 14px;
color: #ccc;
margin-top: 10px;
padding: 0 10px 0 10px;
}
.centerInfo {
display: flex;
justify-content: space-around;
align-items: center;
margin-top: 10px;
}
.centerInfo2 {
display: flex;
align-items: center;
}
.screen {
width: 250px;
border: 30px solid #ccc;
border-color: #ccc transparent transparent transparent;
height: 20px;
margin: auto;
margin-top: 10px;
}
.screen-text {
text-align: center;
white-space: nowrap;
font-size: 20px;
font-weight: 600;
color: #fff;
margin-top: -30px;
}
.btn {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 35px;
background-color: rgba(255, 0, 0, 0.8);
text-align: center;
line-height: 35px;
color: #fff;
}
</style>
</head>
<body>
<div id="app">
<div>
<div class="title">{{cinemaInfo.movieName }}</div>
<div class="titleInfo">
<div>{{cinemaInfo.showTime }}</div>
<div>{{ cinemaInfo.name }}</div>
</div>
<div class="centerInfo">
<div class="centerInfo2">
<span>{{cinemaInfo.seatTypeList[0].name }}</span>
<img style="width: 20px" :src="cinemaInfo.seatTypeList[0].icon" />
</div>
<div class="centerInfo2">
<span>{{cinemaInfo.seatTypeList[1].name }}</span>
<img style="width: 20px" :src="cinemaInfo.seatTypeList[1].icon" />
</div>
<div class="centerInfo2">
<span>{{cinemaInfo.seatTypeList[2].name }}</span>
<img style="width: 20px" :src="cinemaInfo.seatTypeList[2].icon" />
</div>
<div class="centerInfo2">
<span>{{cinemaInfo.seatTypeList[3].name }}</span>
<img style="width: 20px" :src="cinemaInfo.seatTypeList[3].icon" />
</div>
</div>
<div class="screen">
<div class="screen-text">屏幕方向</div>
</div>
<div class="box">
<div
v-for="(seatItem, index) in cinemaInfo.seatList"
class="seatClass"
:key="seatItem.id"
@click="clickzuowei(seatItem)"
:style="{
height: height + 'rem',
width: width + 'rem',
top: seatItem.gRow * positionDistin + 'rem',
left: seatItem.gCol * positionDistin + 'rem',
}"
>
<img
class="seatImgClass"
:seatId="seatItem.id"
:seatIndex="index"
:src="cinemaInfo.seatTypeList[seatItem.type].icon"
/>
</div>
</div>
<div class="btn" @click="ok">确 认 选 座</div>
</div>
</div>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue.2.2.min.js"></script>
<script>
new Vue({
el: '#app',
data: function() {
return {
//影院 厅信息
cinemaInfo: {
errorCode: 0,
errorMsg: "",
name: "4号厅",
movieName: "白蛇传之白蛇缘起",
showTime: "2019-03-06 周五 16:50",
cinema_name: "惊奇队长影院",
//座位信息
seatList: [
{
//座位id
id: "16879097",
//座位X轴实际位置,去掉过道
row: "1",
//座位Y轴实际位置,去掉过道
col: "1",
//座位X轴位置
gRow: 1,
//座位Y轴位置
gCol: 4,
//类型:区分座位状态,详情看seatTypeList数组,按0,1,2顺序下去代表不同状态,切换图片
type: "0",
flag: "0",
price: "69",
},
{
id: "16879101",
row: "1",
col: "4",
gRow: 1,
gCol: 8,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879104",
row: "1",
col: "7",
gRow: 1,
gCol: 11,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879099",
row: "1",
col: "2",
gRow: 1,
gCol: 6,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879102",
row: "1",
col: "5",
gRow: 1,
gCol: 9,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879105",
row: "1",
col: "8",
gRow: 1,
gCol: 12,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879100",
row: "1",
col: "3",
gRow: 1,
gCol: 7,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879103",
row: "1",
col: "6",
gRow: 1,
gCol: 10,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879107",
row: "1",
col: "9",
gRow: 1,
gCol: 14,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879113",
row: "2",
col: "1",
gRow: 2,
gCol: 3,
type: "0",
flag: "0",
price: "69",
},
{
id: "16879117",
row: "2",
col: "4",
gRow: 2,
gCol: 7,
type: "0",
flag: "0",
price: &quo.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0