Score
0
Watch 36 Star 101 Fork 24

RockYang / JMseats-电影票选座JavaScript

Join us
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
电影票,电影厅的选座js插件,movie seats select, 轻松完成电影厅的自定义排座,设置票价,购票的一站式服务 spread retract

Clone or download
step2.html 1.90 KB
Copy Edit Web IDE Raw Blame History
RockYang authored 2017-08-17 23:05 . docs: 更新文档
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>剧场排座插件</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="plugin/spectrum/spectrum.css">
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="plugin/spectrum/spectrum.js"></script>
<script src="plugin/jdialog/JDialog.min.js"></script>
<script src="src/seat.js"></script>
</head>
<body>
<div id="box">
<h1>设置座位票价和颜色</h1>
<h4 class="text-danger text-left">Step2:先选中要设置票价的座位,然后填写票价,选择颜色后点击“设置票价”按钮,这个动作可以重复操作N遍,全部设置完了之后点击“下一步”</h4>
</div>
<div class="container" style="margin-top: 10px;">
<div class="form-inline">
<label>票价</label>
<input type="text" class="form-control" id="price" value="100" placeholder="票价">
<input type="text" class="form-control" id="color" value="#cc0000" placeholder="座位颜色">
<button class="btn btn-info" id="set-price">设置票价</button>
<a href="step3.html" class="btn btn-success">下一步</a>
</div>
</div>
<script>
try {
var datas = JSON.parse(localStorage.getItem("seats"));
} catch (e){}
var seats = $.seats({
box:"#box",
step:2,
datas:datas
});
$('#set-price').on('click', function() {
var color = $('#color').val();
var price = $('#price').val();
seats.setPrice(price, color);
//更新座位信息
localStorage.setItem("seats", JSON.stringify(seats.getSeats()));
JDialog.msg({type:"ok", content:"更新票价成功.", container:"#box"});
});
$("#color").spectrum({
change: function(color) {
$("#color").val(color.toHexString());
}
});
</script>
</body>
</html>

Comment ( 0 )

Sign in for post a comment

JavaScript
1
https://gitee.com/blackfox/seats.git
git@gitee.com:blackfox/seats.git
blackfox
seats
JMseats-电影票选座
master

Help Search