Skip to content

Commit

Permalink
提交 "酒店预定" 模板 (仅前端)
Browse files Browse the repository at this point in the history
  • Loading branch information
Houfeng committed Oct 21, 2015
1 parent 8d98f89 commit acea657
Show file tree
Hide file tree
Showing 225 changed files with 241,429 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
注意,所有开源项目并不是全部托管在当前工程下,点击如下开源项目,会自动跳转到对应代码托管地址。

## 资讯类
1.[36Kr流应用版](https://github.com/dcloudio/casecode/tree/master/36Kr)

2.[JFinal社区](http://git.oschina.net/20110516/jfbbs_mui)
1. [36Kr流应用版](https://github.com/dcloudio/casecode/tree/master/36Kr)
2. [JFinal社区](http://git.oschina.net/20110516/jfbbs_mui)

## 工具类
1.[滴石](http://git.oschina.net/uikoo9/uikoo9-dishi)
1. [滴石](http://git.oschina.net/uikoo9/uikoo9-dishi)

## 能力展示类
1.[Hello MUI](https://github.com/dcloudio/mui/tree/master/examples/hello-mui)
1. [Hello MUI](https://github.com/dcloudio/mui/tree/master/examples/hello-mui)

## 常用模板类
1.[登录模板](https://github.com/dcloudio/mui/tree/master/examples/login)
1. [登录模板](https://github.com/dcloudio/mui/tree/master/examples/login)
2. [酒店预定](https://github.com/dcloudio/casecode/tree/master/hotel)
10 changes: 10 additions & 0 deletions hotel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 目录结构
1. src 为源码目录(为避免 HBuilder 同步 node_modules 等构建工具用到的目录,所以将源码放到 src 目录)
2. docs 为文档目录,包括可能会用到的 ctrip 文档和项目过程中产生的一些文档
3. gulpfile.js 为 gulp(构建工具)脚本文件
4. package.json 为 npm 规范模块配置文件

# 构建说明
1. 分别全局和当前目录安装 gulp (``` [sudo] npm install gulp [-g] ```)
2. 安装构建用模块 (``` npm install ```)
3. 执行 gulp ,执行默认构建任务
192 changes: 192 additions & 0 deletions hotel/build/appstream.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
{
"version": "0.0.5",
"protocol": [
"http",
"https"
],
"rooturl": "",
"index": {
"href": "pages/index.html",
"resources": [
"manifest.json",
"mui/css/mui.min.css",
"mui/fonts/mui.ttf",
"styles/default.css",
"font-awesome/css/font-awesome.min.css",
"mui/js/mui.min.js",
"pages/index.js",
"controls/hotel-price-filter/main.js",
"common/page-helper.js",
"libs/vue.js",
"libs/utils.js",
"libs/ems.js",
"mui/js/mui.picker.min.js",
"mui/css/mui.picker.min.css",
"font-awesome/fonts/FontAwesome.otf",
"pages/blank.html",
"libs/ems-json.js",
"models/hotel.js",
"common/event-binder.js",
"pages/tmpl-head.js",
"pages/tmpl-head.html",
".settings/com.aptana.editor.common.prefs",
"libs/jquery.js",
"controls/room-type-filter/ui.html",
"controls/hotel-price-filter/style.css",
"common/element-maper.js",
"controls/price-detail/ui.html",
"common/vue-filter.js",
"controls/booking-date/style.css",
"favicon.ico",
"libs/tp.js",
"controls/booking-date/ui.html",
"controls/price-detail/style.css",
"controls/hotel-price-filter/ui.html",
"controls/room-type-filter/style.css",
"controls/room-type-filter/main.js",
"controls/price-detail/main.js",
"controls/booking-date/main.js",
"models/service.js",
"pages/booking-done.js",
"libs/ems-text.js",
"styles/images/hotel-loading.png",
"mui/js/mui.indexedlist.js",
"mui/css/mui.indexedlist.css",
"font-awesome/fonts/fontawesome-webfont.ttf",
"font-awesome/fonts/fontawesome-webfont.svg",
"font-awesome/fonts/fontawesome-webfont.eot",
"font-awesome/fonts/fontawesome-webfont.woff2",
"font-awesome/fonts/fontawesome-webfont.woff"
],
"refer": [
"pages/query-keyword.html",
"pages/city.html",
"pages/hotel-list.html",
"pages/hotel-info.html",
"pages/hotel-pic.html",
"pages/booking.html",
"pages/comment.html",
"pages/room-info.html",
"pages/hotel-detail.html",
"pages/query-filter.html",
"pages/area-filter.html"
],
"priority": 0
},
"pages": {
"pages/query-keyword.html": {
"href": "pages/query-keyword.html",
"resources": [
"pages/query-keyword.js"
],
"priority": 0
},
"pages/city.html": {
"href": "pages/city.html",
"resources": [
"pages/city.js"
],
"priority": 1
},
"pages/hotel-info.html": {
"href": "pages/hotel-info.html",
"resources": [
"pages/hotel-info.js"
],
"priority": 2
},
"pages/hotel-pic.html": {
"href": "pages/hotel-pic.html",
"resources": [
"pages/hotel-pic.js"
],
"priority": 3
},
"pages/hotel-detail.html": {
"href": "pages/hotel-detail.html",
"resources": [
"pages/hotel-detail.js"
],
"refer": [],
"priority": 2
},
"pages/booking.html": {
"href": "pages/booking.html",
"priority": 7
},
"pages/order-detail.html": {
"href": "pages/order-detail.html",
"resources": [
"pages/order-detail.js"
],
"refer": [
"pages/hotel-detail.html",
"pages/booking.html"
],
"priority": 4
},
"pages/booking-done.html": {
"href": "pages/booking-done.html",
"resources": [
"pages/booking.js"
],
"refer": [
"pages/order-detail.html"
],
"priority": 4
},
"pages/hotel-list.html": {
"href": "pages/hotel-list.html",
"resources": [
"pages/hotel-list.js"
],
"refer": [
"pages/hotel-list-inner.html"
],
"priority": 2
},
"pages/comment.html": {
"href": "pages/comment.html",
"resources": [
"pages/comment.js"
],
"priority": 6
},
"pages/room-info.html": {
"href": "pages/room-info.html",
"resources": [
"pages/room-info.js"
],
"refer": [
"pages/booking.html"
],
"priority": 7
},
"pages/query-filter.html": {
"href": "pages/query-filter.html",
"resources": [
"pages/query-filter.js"
],
"priority": 3
},
"pages/area-filter.html": {
"href": "pages/area-filter.html",
"resources": [
"pages/area-filter.js"
],
"priority": 4
},
"pages/hotel-list-inner.html": {
"href": "pages/hotel-list-inner.html",
"resources": [
"pages/hotel-list-inner.js"
],
"refer": [],
"priority": 2
}
},
"idle": {
"resources": [
]
}
}
7 changes: 7 additions & 0 deletions hotel/build/common/element-maper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
define(function(require,e,n){e.init=function(e,n){n=n||document.body;var i=e.el;e.el={};for(var o in i)e.el[o]=n.querySelector(i[o])}});
7 changes: 7 additions & 0 deletions hotel/build/common/event-binder.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
define(function(require,e,t){var n=function(e){var t=[],n=e.split(";");return n.forEach(function(e){var n={},a=e.split(">");if(a[0]&&(n.eventName=a[0],a[1])){var i=a[1].split(":");i[0]&&(n.method=i[0],i[1]?n.args=i[1].split(","):n.args=[],t.push(n))}}),t};e.init=function(e,t){t=t||document.body,e=e||window;var a=[].slice.call(t.querySelectorAll("[data-event]"));a.forEach(function(t){if(!t.__event_binded){t.__event_binded=!0;var a=n(t.getAttribute("data-event")||"");a.forEach(function(n){t.addEventListener(n.eventName,function(t){var a=[t];a.push.apply(a,n.args),e[n.method].apply(e,a)},!1)})}})}});
7 changes: 7 additions & 0 deletions hotel/build/common/page-helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions hotel/build/common/vue-filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
define(function(require,e,t){var a=require("../libs/utils.js");e.date=function(e){var t=new Date(e),n=parseInt(a.formatDate(t,"yyyyMMdd")),r=parseInt(a.formatDate(new Date,"yyyyMMdd"));return r==n?"今天":r-n==1?"昨天":r-n==2?"前天":r-n==-1?"明天":r-n==-2?"后天":a.formatDate(t,"MM月dd日")},e.week=function(e){var t=new Date(e),a=t.getDay();return["日","一","二","三","四","五","六"][a]}});
7 changes: 7 additions & 0 deletions hotel/build/controls/booking-date/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions hotel/build/controls/booking-date/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions hotel/build/controls/booking-date/ui.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="booking-date">
<ul class="mui-table-view">
<li data-event='tap>pickeDate' class="mui-table-view-cell mui-input-row">
<a class="mui-navigate-right">
{{beginDate | date}}
<span class="description"><span class="ct-color-gray">周{{beginDate | week}}</span> 入住</span>
</a>
</li>
<li class="mui-table-view-cell mui-input-row">
<label>
住 {{dayNum}} 晚 <span class="description" style="right: 105px;text-align: right;">
<span class="ct-color-gray">{{endDate | date}}(周{{endDate | week}})</span> 离店</span>
</label>
<div class="mui-numbox" data-numbox-min='1'>
<button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
<input data-event='change>changeDayNum' class="mui-numbox-input" type="number" value="1" />
<button class="mui-btn mui-numbox-btn-plus" type="button">+</button>
</div>
</li>
</ul>
<div class="btn-wraper">
<button type="button" data-event='tap>ok' class="mui-btn mui-btn-block mui-btn-warning ct-btn-main">确定</button>
</div>
</div>
7 changes: 7 additions & 0 deletions hotel/build/controls/hotel-price-filter/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions hotel/build/controls/hotel-price-filter/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions hotel/build/controls/hotel-price-filter/ui.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="hotel-price-filter">
<legend>价格(单选)</legend>
<ul>
<li v-repeat="priceRanges" class="{{ value==priceRange.value?'active':'' }}" v-on="tap:pickPriceRange($index)">
{{text}}
</li>
</ul>
<legend>星级(复选)</legend>
<ul>
<li v-repeat="starTypes" class="{{ value==star.value?'active':'' }}" v-on="tap:pickStar($index)">
{{text}}
</li>
</ul>
<div class="btn-wraper">
<button type="button" data-event='tap>ok' class="mui-btn mui-btn-block mui-btn-warning ct-btn-main">确定</button>
</div>
</div>
7 changes: 7 additions & 0 deletions hotel/build/controls/price-detail/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
define(function(require,e,t){var i=e,n=require("../../common/page-helper");require("./style.css");var s=require("../../libs/jquery"),a=(require("../../libs/tp"),require("../../libs/ems-text!./ui.html")),c=s(a)[0];document.body.appendChild(c),c.addEventListener("touchmove",function(e){e.preventDefault()}),c.addEventListener("tap",function(){i.hide()},!1),i.show=function(){c.classList.add("active")},i.hide=function(){c.classList.remove("active")},n.init(i,c)});
7 changes: 7 additions & 0 deletions hotel/build/controls/price-detail/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
.price-detail{position:fixed;width:100%;height:100%;left:0;top:0;z-index:99;background-color:rgba(0,0,0,.85);-webkit-transition:.5s;display:none}.price-detail.active{display:block}.price-detail-info{height:140px;position:absolute;left:0;width:100%;top:50%;margin-top:-70px;padding:10px}.price-detail-info .right{position:absolute;right:0}.price-detail-info p{color:#fff}.price-detail-info p span{margin-right:10px}.price-detail h5{padding:0;margin:0 0 10px;color:#fff;font-size:18px}.price-detail-info p.ln1{border-bottom:solid 1px #eee;padding-bottom:8px}
8 changes: 8 additions & 0 deletions hotel/build/controls/price-detail/ui.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="price-detail">
<div class="price-detail-info">
<h5>费用明细</h5>
<p class="ln1"><span class="ct-color-blue">房费</span><span class="right ct-color-orange">¥175</span></p>
<p class="ln2"><span>2015-09-22</span><span>无早</span><span class="right">¥175 x 1</span></p>
<p class="ln3"><span class="right ct-color-orange"><strong>总额 : ¥175</strong></span></p>
</div>
</div>
7 changes: 7 additions & 0 deletions hotel/build/controls/room-type-filter/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* ctrip - ctrip hotel
* @version v0.0.1
* @link http://www.dcloud.io
* @license MIT
*/
define(function(require,e,i){var t=e,n=require("../../common/page-helper");require("./style.css");var c=require("../../libs/jquery"),a=(require("../../libs/tp"),require("../../libs/ems-text!./ui.html")),s=c(a)[0];document.body.appendChild(s),s.addEventListener("touchmove",function(e){e.preventDefault()});var o=mui.createMask();o[0].addEventListener("tap",function(){t.hide()},!1),t.show=function(){o.show(),s.classList.add("active"),t.__back=mui.back,mui.back=function(){t.hide()}},t.hide=function(){s.classList.remove("active"),o.close(),mui.back=t.__back},t.ok=function(){t.hide()},n.init(t,s)});
7 changes: 7 additions & 0 deletions hotel/build/controls/room-type-filter/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit acea657

Please sign in to comment.