39 Star 194 Fork 70

RockYang/JMseats-电影票选座

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
step2.html 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
RockYang 提交于 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>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/blackfox/seats.git
git@gitee.com:blackfox/seats.git
blackfox
seats
JMseats-电影票选座
master

搜索帮助