洪海涛 8 rokov pred
rodič
commit
80e6b32eb3
60 zmenil súbory, kde vykonal 3556 pridanie a 4864 odobranie
  1. 1 1
      www/protected/modules/o2o/views/web/index.php
  2. 0 1
      www/webapp/common/css/common.css
  3. 1 1
      www/webapp/common/js/spa.js
  4. 0 0
      www/webapp/framework/ratchet-2.0.2/dist/css/ratchet-theme-ios.min.css
  5. 38 41
      www/webapp/o2o/build.js
  6. 146 152
      www/webapp/o2o/css/common.css
  7. 167 180
      www/webapp/o2o/css/home.css
  8. 0 79
      www/webapp/o2o/css/homeenterprise.css
  9. 0 79
      www/webapp/o2o/css/homestay.css
  10. 0 3
      www/webapp/o2o/css/main.css
  11. 4 42
      www/webapp/o2o/css/mine.css
  12. 0 1
      www/webapp/o2o/css/product.css
  13. 16 19
      www/webapp/o2o/css/ratchetOverloading.css
  14. 0 308
      www/webapp/o2o/css/secondary.css
  15. 0 0
      www/webapp/o2o/dist/css/main.css
  16. 1 4
      www/webapp/o2o/dist/js/build.txt
  17. 0 0
      www/webapp/o2o/dist/js/build/template.js
  18. 0 0
      www/webapp/o2o/dist/js/build/template/template.js
  19. 5 4
      www/webapp/o2o/dist/js/main.js
  20. 0 0
      www/webapp/o2o/dist/js/model/product.js
  21. 0 0
      www/webapp/o2o/dist/js/model/user.js
  22. 0 1
      www/webapp/o2o/dist/js/page/activities/day.js
  23. 0 0
      www/webapp/o2o/dist/js/page/home.js
  24. 0 1
      www/webapp/o2o/dist/js/page/homeenterprise.js
  25. 0 1
      www/webapp/o2o/dist/js/page/homestay.js
  26. 0 0
      www/webapp/o2o/dist/js/page/mine.js
  27. 0 0
      www/webapp/o2o/dist/js/page/placeOrder.js
  28. 1 1
      www/webapp/o2o/dist/js/page/rechargee.js
  29. 0 1
      www/webapp/o2o/dist/js/page/secondary.js
  30. 1 1
      www/webapp/o2o/dist/js/panel/alert.js
  31. 0 0
      www/webapp/o2o/dist/js/spa.js
  32. 0 4
      www/webapp/o2o/js/build/template.js
  33. 380 0
      www/webapp/o2o/js/build/template/template.js
  34. 581 619
      www/webapp/o2o/js/main.js
  35. 0 99
      www/webapp/o2o/js/model/product.js
  36. 331 333
      www/webapp/o2o/js/model/user.js
  37. 0 119
      www/webapp/o2o/js/page/activities/day.js
  38. 242 349
      www/webapp/o2o/js/page/home.js
  39. 0 83
      www/webapp/o2o/js/page/homeenterprise.js
  40. 0 190
      www/webapp/o2o/js/page/homestay.js
  41. 166 168
      www/webapp/o2o/js/page/mine.js
  42. 929 939
      www/webapp/o2o/js/page/placeOrder.js
  43. 209 208
      www/webapp/o2o/js/page/product.js
  44. 92 95
      www/webapp/o2o/js/page/rechargee.js
  45. 0 118
      www/webapp/o2o/js/page/secondary.js
  46. 3 13
      www/webapp/o2o/js/panel/alert.js
  47. 0 48
      www/webapp/o2o/tpl/activities/day.html
  48. 8 9
      www/webapp/o2o/tpl/desc/index.html
  49. 120 82
      www/webapp/o2o/tpl/home/index.html
  50. 0 68
      www/webapp/o2o/tpl/homeEnterprise/index.html
  51. 0 68
      www/webapp/o2o/tpl/homestay/index.html
  52. 76 76
      www/webapp/o2o/tpl/mine/index.html
  53. 2 2
      www/webapp/o2o/tpl/myOrder/index.html
  54. 2 3
      www/webapp/o2o/tpl/package.json
  55. 4 14
      www/webapp/o2o/tpl/placeOrder/index.html
  56. 1 1
      www/webapp/o2o/tpl/product/option.html
  57. 27 27
      www/webapp/o2o/tpl/product/reviewList.html
  58. 1 12
      www/webapp/o2o/tpl/recharge/cell.html
  59. 1 2
      www/webapp/o2o/tpl/recharge/index.html
  60. 0 194
      www/webapp/o2o/tpl/secondary/index.html

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
www/protected/modules/o2o/views/web/index.php


+ 0 - 1
www/webapp/common/css/common.css

@@ -128,7 +128,6 @@
 .box-container {
 	width: 100%;
 	height: 100%;
-	/*background: #fff;*/
 }
 
 .scroll-container {

+ 1 - 1
www/webapp/common/js/spa.js

@@ -471,7 +471,7 @@ define(['zepto'], function ($) {
 			// css3动画是异步无阻塞的,防止同时重绘/*可修改页面切换速度*/
 			requestAnimationFrame(function () {
 				$el.get(0).offsetWidth
-				properties[transitionName] = '600ms'
+				properties[transitionName] = '200ms'
 				$el.css(properties).emulateTransitionEnd(function () {
 					// 过渡动画结束后移除 transition
 					properties = {}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/framework/ratchet-2.0.2/dist/css/ratchet-theme-ios.min.css


+ 38 - 41
www/webapp/o2o/build.js

@@ -1,43 +1,40 @@
 ({
-	mainConfigFile: './js/main.js',
-	baseUrl: './js',
-	waitSeconds: 200,
-	paths: {
-		"BMap": "empty:"
-	},
-	dir: './dist/js',
-	modules: [{
-		name: 'main',
-		include: [
-			'ratchet',
-			'pageHome',
-			'pageHelp',
-			'pageAbout',
-			'pageRecharge',
-			'pageMine',
-			'pageSecondary',
-			'pageHomestay',
-			'pageHomeenterprise',
-			'pageProduct',
-			'pagePlaceOrder',
-			'pagePicker',
-			'pagePay',
-			'pageMyOrder',
-			'pageMyCoupon',
-			'pageSuccess',
-			'pageAgreement',
-			'pageAddressList',
-			'pageAddressAdd',
-			'pageAddressDetail',
-			'pageAddressPoisiton',
-			'pageBeautician',
-			'pageBeauticianDetail',
-			'pageHire',
-			'panelAlert',
-			'panelDataPicker',
-			'panelDataPicker',
-			'panelProductOption',
-			'panelPostReview'
-		]
-	}]
+  mainConfigFile: './js/main.js',
+  baseUrl: './js',
+  waitSeconds: 200,
+  paths: {
+    "BMap": "empty:"
+  },
+  dir: './dist/js',
+  modules: [{
+    name: 'main',
+    include: [
+      'ratchet',
+      'pageHome',
+      'pageHelp',
+      'pageAbout',
+      'pageRecharge',
+      'pageMine',
+      'pageProduct',
+      'pagePlaceOrder',
+      'pagePicker',
+      'pagePay',
+      'pageMyOrder',
+      'pageMyCoupon',
+      'pageSuccess',
+      'pageAgreement',
+      'pageAddressList',
+      'pageAddressAdd',
+      'pageAddressDetail',
+      'pageAddressPoisiton',
+      'pageBeautician',
+      'pageBeauticianDetail',
+      'pageHire',
+      'panelAlert',
+      'panelDataPicker',
+      'panelDataPicker',
+      'panelProductOption',
+      'panelPostReview'
+    ]
+  }]
 })

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 146 - 152
www/webapp/o2o/css/common.css


+ 167 - 180
www/webapp/o2o/css/home.css

@@ -1,151 +1,172 @@
-body {
-    /*background: #bdbdbd;*/
+.content{
+    background-color: #fff;
+}
+.spa-page-home {
+    /*��ͼ*/
+    /*��Ʒ�б�*/
+    /*������*/
+    /*������*/
 }
 
-/*swiper*/
-/*.swiper-container {
-    width: 100%;
+.spa-page-home .main-service-box .the-main-figure {
+    background-position: center;
+    /*/!*background-position: center;*/
+    /*margin-top: -6%;*/
+    overflow: hidden;
 }
 
-.swiper-slide {
+.spa-page-home .main-service-box .the-main-figure img {
+    width: 100%;
+    /*width: 100%;*/
+    margin: -4% 0 -6% 0;
+}
+
+.spa-page-home .global-msg {
+    font-size: 15px;
+    /*display: block;*/
+    font-weight: 500;
+    /*margin-top: 25px;*/
+    height: 65px;
+    /*line-height: 50px;*/
+    color: #999999;
+    font-family: '΢���ź�', 'Microsoft YaHei', 'STHeiti Light';
     text-align: center;
-    font-size: 18px;
-    background: #fff;
-    !* Center slide text vertically *!
-    display: -webkit-box;
-    display: -ms-flexbox;
-    display: -webkit-flex;
-    display: flex;
-    -webkit-box-pack: center;
-    -ms-flex-pack: center;
-    -webkit-justify-content: center;
-    justify-content: center;
-    -webkit-box-align: center;
-    -ms-flex-align: center;
-    -webkit-align-items: center;
-    align-items: center;
+    /*float: left;*/
 }
 
-.swiper-slide img {
-    width: 100%;
+.spa-page-home .global-msg-active {
+    border-bottom: 5px solid #b89400;
+    color: #b89400;
 }
 
-.swiper-pagination-bullet-active {
-    background-color: #516663 !important;
+.spa-page-home .extra-service-box .extra-service:nth-child(1) {
+    border-top: 1px solid #999999;
 }
 
-.swiper-pagination{
-    bottom: 5px;
-    width: 100%;
-    height: 20px;
-    background: aqua;
+.spa-page-home .extra-service-box .extra-service:nth-child(2) {
+    margin-bottom: 15%;
 }
-.swiper-pagination span{
-    padding: 5px;
-    background: #000000;
-    margin:0 5px;
-}*/
 
-.swiper-container {
-    width: 100%;
-    color: #fff;
+.spa-page-home .extra-service-box .extra-service-item {
+    padding: 50%;
+    position: relative;
     text-align: center;
+    /*�ճ����-logo*/
+    /*������-logo*/
+    /*����ɱ��-logo*/
+    /*����-logo*/
+    /*����a��ǩ�µ�������ʽ*/
 }
-.swiper-slide {
-    width: 100%;
-    height: 100%;
-}
-.swiper-slide .title {
-    font-style: italic;
-    font-size: 42px;
-    margin-top: 80px;
-    margin-bottom: 0;
-    line-height: 45px;
+
+.spa-page-home .extra-service-box .extra-service-item a {
+    position: absolute;
+    left: 20px;
+    right: 20px;
+    top: 10px;
+    bottom: 0;
 }
-.swiper-slide img{
-    width: 100%;
+
+.spa-page-home .extra-service-box .extra-service-item a:active {
+    transform: scale(0.95);
+    -webkit-transform: scale(0.95);
 }
-.pagination {
+
+.spa-page-home .extra-service-box .extra-service-item .extra-service-name {
+    left: 0;
+    right: 0;
+    bottom: 40px;
+    font-size: 15px;
+    font-weight: 500;
     position: absolute;
-    z-index: 20;
-    left: 10px;
-    bottom: 0.15rem;
-    width: 100%;
-    text-align: center;
+    color: #999999;
+}
+
+.spa-page-home .products-list {
+    display: flex;
+    flex-direction: row;
+    flex-wrap: wrap;
 }
-.swiper-pagination-switch {
+
+.spa-page-home .extra-service-box .extra-service-item .logo {
+    background-size: 50% 50%;
+    background-position: center center;
+    padding: 50%;
     display: inline-block;
-    width: 0.4rem;
-    height: 0.4rem;
-    border-radius: 10px;
-    background: rgba(153,153,153,0.5);
-    box-shadow: 0px 1px 2px #555 inset;
-    margin: 0 3px;
-    cursor: pointer;
-}
-.swiper-visible-switch {
-    background: #aaa;
-}
-.swiper-active-switch {
-    background: #190f0d;
-    box-shadow: 0px 1px 2px #555 inset;
-}s
-
-/*swiper结束*/
-.content-header {
-    width: 100%;
-    height: 44px;
 }
 
-/*图标*/
-.home-content .home-remy {
-    margin-top: 10px;
-    margin-bottom: 0px;
-    width: 100%;
+.spa-page-home .extra-service-box .extra-service-item .logo-richang {
+    background: url("http://odulvej8l.bkt.clouddn.com/Home_btn_clean%20%281%29.png");
+    background-repeat: no-repeat;
+    background-size: 50% 50%;
+    background-position: center center;
 }
 
-.home-content .home-box {
-    /*margin-top: 1.5rem;*/
+.spa-page-home .extra-service-box .extra-service-item .logo-shendu {
+    background: url("http://odulvej8l.bkt.clouddn.com/Home_btn_clean%20%282%29.png");
+    background-repeat: no-repeat;
+    background-size: 50% 50%;
+    background-position: center center;
 }
 
-.home-content .home-box .width-percent-50 {
-    margin-top: 10px;
-    -webkit-box-sizing: border-box;
-    -moz-box-sizing: border-box;
-    box-sizing: border-box;
-    float: left;
+.spa-page-home .extra-service-box .extra-service-item .logo-chumanshajun {
+    background: url("http://odulvej8l.bkt.clouddn.com/Home_btn_clean%20%283%29.png");
+    background-repeat: no-repeat;
+    background-size: 50% 50%;
+    background-position: center center;
 }
 
-.home-content .home-box .width-percent-50:nth-child(1),
-.home-content .home-box .width-percent-50:nth-child(3) {
-    padding-left: 4%;
-    padding-right: 2%;
+.spa-page-home .extra-service-box .extra-service-item .logo-qita {
+    background: url("http://odulvej8l.bkt.clouddn.com/Home_btn_clean%20%284%29.png");
+    background-repeat: no-repeat;
+    background-size: 50% 50%;
+    background-position: center center;
 }
 
-.home-content .home-box .width-percent-50:nth-child(2),
-.home-content .home-box .width-percent-50:nth-child(4) {
-    padding-right: 4%;
-    padding-left: 2%;
+.spa-page-home .extra-service-box .extra-service-item .extra-service {
+    display: block;
+    color: #999999;
+    font-weight: 500;
+    font-size: 18px;
+    text-align: center;
+    font-family: '΢���ź�', 'Microsoft YaHei', 'STHeiti Light';
 }
 
-.home-content .home-box .width-percent-50 img {
+.spa-page-home .extra-service-box .extra-service-item .extra-service .extra-service-name {
     width: 100%;
+    height: 100%;
 }
 
-.prevent-scroll {
+.spa-page-home .extra-service-box .extra-service-item .extra-service:nth-child(1) {
+    background-color: #00a2d4;
+}
+
+.spa-page-home .extra-service-box .extra-service-item .extra-service:nth-child(1) div .extra-service-item {
+    border-bottom: 1px solid #999999;
+}
+
+.spa-page-home .extra-service-box .extra-service-item:nth-child(1) {
+    border-right: 1px solid #999999;
+    border-bottom: 1px solid #999999;
+}
+
+.spa-page-home .h-clearfix-index {
+    margin-bottom: 20px;
+}
+
+.spa-page-home .prevent-scroll {
     width: 100%;
     position: fixed;
     bottom: 0;
     background-color: #2a2400;
 }
 
-.prevent-scroll .width-percent-33 .title-container-square {
+.spa-page-home .prevent-scroll .width-percent-33 .title-container-square {
     padding: 20%;
     position: relative;
     text-align: center;
 }
 
-.prevent-scroll .width-percent-33 .title-container-square a {
+.spa-page-home .prevent-scroll .width-percent-33 .title-container-square a {
     position: absolute;
     left: 0;
     right: 0;
@@ -153,7 +174,7 @@ body {
     bottom: 0;
 }
 
-.prevent-scroll .width-percent-33 .title-container-square a .logo {
+.spa-page-home .prevent-scroll .width-percent-33 .title-container-square a .logo {
     background-size: 65% 65%;
     background-position: center center;
     padding: 10%;
@@ -162,35 +183,35 @@ body {
     border-radius: 50%;
 }
 
-.prevent-scroll .width-percent-33 .title-container-square a .name {
+.spa-page-home .prevent-scroll .width-percent-33 .title-container-square a .name {
     display: block;
     margin-top: -5px;
     font-size: 12px;
 }
 
-.prevent-scroll .width-percent-33:nth-child(1) a:active .logo {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(1) a:active .logo {
     border-radius: inherit;
     background: url("http://odulvej8l.bkt.clouddn.com/tab_home.png") no-repeat;
     background-size: 100%;
     background-position: center center;
 }
 
-.prevent-scroll .width-percent-33:nth-child(1) a:active .name {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(1) a:active .name {
     color: #fff;
 }
 
-.prevent-scroll .width-percent-33:nth-child(1) a .logo {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(1) a .logo {
     border-radius: inherit;
     background: url("http://odulvej8l.bkt.clouddn.com/tab_home_pre.png") no-repeat;
     background-size: 100%;
     background-position: center center;
 }
 
-.prevent-scroll .width-percent-33:nth-child(1) a .name {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(1) a .name {
     color: #b89400;
 }
 
-.prevent-scroll .width-percent-33:nth-child(2) a .logo {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(2) a .logo {
     border-radius: 50%;
     display: inline-block;
     padding: 25%;
@@ -201,7 +222,7 @@ body {
     background-position: center;
 }
 
-.prevent-scroll .width-percent-33:nth-child(3) a .logo {
+.spa-page-home .width-percent-33:nth-child(3) a .logo {
     border-radius: inherit;
     background: url("http://odulvej8l.bkt.clouddn.com/tab_me_pre.png");
     background-repeat: no-repeat;
@@ -209,86 +230,52 @@ body {
     background-position: center center;
 }
 
-.prevent-scroll .width-percent-33:nth-child(3) a .name {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(3) a .name {
     color: #b89400;
 }
 
-.prevent-scroll .width-percent-33:nth-child(3) a:active .logo {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(3) a:active .logo {
     border-radius: inherit;
     background: url("http://odulvej8l.bkt.clouddn.com/tab_me.png");
     background-repeat: no-repeat;
-    background-size: 90%;
+    background-size: 100%;
     background-position: center center;
 }
 
-.prevent-scroll .width-percent-33:nth-child(3) a:active .name {
+.spa-page-home .prevent-scroll .width-percent-33:nth-child(3) a:active .name {
     color: #fff;
 }
 
-/*媒体查询开始*/
-@media (max-width: 320px) {
-    .home-content .home-box {
-        height: 320px;
-    }
-}
-@media (min-width:412px) {
-    .home-content .home-box{
-        height: 412px;
-    }
-}
-@media (min-width: 414px) {
-
-    .home-content .home-remy {
-        margin-bottom: 30px;
-    }
-}
-
-@media (min-width: 768px) {
-    .home-content {
-
-    }
-
-    .home-content .home-remy {
-        margin-top: 10px;
-        margin-bottom: 0px;
-        width: 100%;
-    }
-
-    .home-content .home-box {
-        width: 100%;
-        margin-top: 0rem;
-        height: 36rem;
-    }
-
-    .home-content .home-box .width-percent-50 {
-        margin-top: 1rem;
-        -webkit-box-sizing: border-box;
-        -moz-box-sizing: border-box;
-        box-sizing: border-box;
-        text-align: center;
-        /*图片左右内边距*/
-        /*图片上下外边距*/
-    }
-
-    .home-content .home-box .width-percent-50:nth-child(1),
-    .home-content .home-box .width-percent-50:nth-child(3) {
-        padding-left: 2rem;
-        padding-right: 1rem;
-    }
-
-    .home-content .home-box .width-percent-50:nth-child(2),
-    .home-content .home-box .width-percent-50:nth-child(4) {
-        padding-left: 1rem;
-        padding-right: 2rem;
-    }
-
-    .home-content .home-box .width-percent-50 img {
-        width: 100%;
-    }
-
-    .prevent-scroll .width-percent-33 .title-container-square a .name {
-        display: block;
-        margin-top: 5px;
-        font-size: 1.6rem;
-    }
+/*banner图*/
+.swiper-container {
+    width: 100%;
+    /*height: 100%;*/
 }
+
+.swiper-slide {
+    text-align: center;
+    font-size: 18px;
+    background: #fff;
+
+    /* Center slide text vertically */
+    display: -webkit-box;
+    display: -ms-flexbox;
+    display: -webkit-flex;
+    display: flex;
+    -webkit-box-pack: center;
+    -ms-flex-pack: center;
+    -webkit-justify-content: center;
+    justify-content: center;
+    -webkit-box-align: center;
+    -ms-flex-align: center;
+    -webkit-align-items: center;
+    align-items: center;
+}
+
+.swiper-slide img {
+    width: 100%;
+}
+
+.swiper-pagination-bullet-active {
+    background-color: #516663 !important;
+}

+ 0 - 79
www/webapp/o2o/css/homeenterprise.css

@@ -1,79 +0,0 @@
-#homestayScroll .prevent-scroll {
-    width: 100%;
-    position: fixed;
-    bottom: 0;
-    background-color: #2a2400;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square {
-    padding: 20%;
-    position: relative;
-    text-align: center;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a {
-    position: absolute;
-    left: 0;
-    right: 0;
-    top: 0;
-    bottom: 0;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a .logo {
-    background-size: 65% 65%;
-    background-position: center center;
-    padding: 10%;
-    margin-top: 5px;
-    display: inline-block;
-    border-radius: 50%;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a .name {
-    display: block;
-    margin-top: -5px;
-    font-size: 12px;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_home.png") no-repeat;
-    background-size: 100%;
-    background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .name {
-    color: #fff;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_home_pre.png") no-repeat;
-    background-size: 90%;
-    background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a .name {
-    color: #b89400;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(2) a .logo {
-    border-radius: 50%;
-    display: inline-block;
-    padding: 25%;
-    background-size: 100%;
-    margin-top: -15px;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_butler.png") 0 0 no-repeat #2a2400;
-    background-size: 65% 65%;
-    background-position: center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_me_pre.png");
-    background-repeat: no-repeat;
-    background-size: 90%;
-    background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a .name {
-    color: #b89400;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_me.png");
-    background-repeat: no-repeat;
-    background-size: 100%;
-    background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .name {
-    color: #fff;
-}

+ 0 - 79
www/webapp/o2o/css/homestay.css

@@ -1,79 +0,0 @@
-#homestayScroll .prevent-scroll {
-	width: 100%;
-	position: fixed;
-	bottom: 0;
-	background-color: #2a2400;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square {
-	padding: 20%;
-	position: relative;
-	text-align: center;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a {
-	position: absolute;
-	left: 0;
-	right: 0;
-	top: 0;
-	bottom: 0;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a .logo {
-	background-size: 65% 65%;
-	background-position: center center;
-	padding: 10%;
-	margin-top: 5px;
-	display: inline-block;
-	border-radius: 50%;
-}
-#homestayScroll .prevent-scroll .width-percent-33 .title-container-square a .name {
-	display: block;
-	margin-top: -5px;
-	font-size: 12px;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .logo {
-	border-radius: inherit;
-	background: url("http://odulvej8l.bkt.clouddn.com/tab_home.png") no-repeat;
-	background-size: 100%;
-	background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .name {
-	color: #fff;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a .logo {
-	border-radius: inherit;
-	background: url("http://odulvej8l.bkt.clouddn.com/tab_home_pre.png") no-repeat;
-	background-size: 90%;
-	background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(1) a .name {
-	color: #b89400;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(2) a .logo {
-	border-radius: 50%;
-	display: inline-block;
-	padding: 25%;
-	background-size: 100%;
-	margin-top: -15px;
-	background: url("http://odulvej8l.bkt.clouddn.com/tab_butler.png") 0 0 no-repeat #2a2400;
-	background-size: 65% 65%;
-	background-position: center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a .logo {
-	border-radius: inherit;
-	background: url("http://odulvej8l.bkt.clouddn.com/tab_me_pre.png");
-	background-repeat: no-repeat;
-	background-size: 90%;
-	background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a .name {
-	color: #b89400;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .logo {
-	border-radius: inherit;
-	background: url("http://odulvej8l.bkt.clouddn.com/tab_me.png");
-	background-repeat: no-repeat;
-	background-size: 100%;
-	background-position: center center;
-}
-#homestayScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .name {
-	color: #fff;
-}

+ 0 - 3
www/webapp/o2o/css/main.css

@@ -6,9 +6,6 @@
 @import url("./placeOrder.css");
 @import url("./myOrder.css");
 @import url("./mine.css");
-@import url("./secondary.css");
-@import url("./homestay.css");
-@import url("./homeenterprise.css");
 @import url("./desc.css");
 @import url("./agreement.css");
 @import url("./review.css");

+ 4 - 42
www/webapp/o2o/css/mine.css

@@ -10,16 +10,13 @@ body {
 }
 #mineScroll div .user .user-image {
     position: absolute;
-    width: 4rem;
-    height: 4rem;
+    width: 60px;
+    height: 60px;
     top: 4rem;
     right: 0;
     left: 0;
     margin: 0 auto;
-    /*background: #fff;*/
-    border-radius: 50%;
-}
-#mineScroll div .user .user-image img{
+    background: #fff;
     border-radius: 50%;
 }
 #mineScroll div .user .user-name {
@@ -169,7 +166,7 @@ body {
         top: 8rem;
     }
     #mineScroll div .user .user-image {
-        top: 3.6rem;
+        top: 4.2rem;
     }
     #mineScroll div .user-balance {
         font-size: 1rem;
@@ -197,19 +194,6 @@ body {
         height: 40px;*/
     }
 }
-/*最小高度为568*/
-@media (min-height: 568px) {
-    #mineScroll div .user {
-        margin-top: 0;
-    }
-    #mineScroll div .user .user-image{
-        top: 2.2rem;
-    }
-    #mineScroll div .user .user-name{
-        top: 7rem;
-    }
-
-}
 /*当其最小宽度为768*/
 @media (min-width: 768px) {
     #mineScroll div .user {
@@ -241,26 +225,4 @@ body {
         width: 60px;
         height: 60px;
     }
-}
-@media(min-width:375px){
-    #mineScroll div .user .user-name{
-        top:8rem;
-        font-size: 1.1rem;
-    }
-}
-@media(min-width:414px){
-    #mineScroll div .user .user-name{
-        top:9rem;
-    }
-}
-
-
-@media (min-width: 768px) {
-    @media (min-width: 768px) {
-        #mineScroll .prevent-scroll .width-percent-33 .title-container-square a .name {
-            display: block;
-            margin-top: 5px;
-            font-size: 1.6rem;
-        }
-    }
 }

+ 0 - 1
www/webapp/o2o/css/product.css

@@ -12,7 +12,6 @@
   width: 60%;
   /*border-color: #8bc34a;*/
   border-color: rgb(178,143,1);
-  margin-left: 20%;
 }
 .spa-page-product .type-control .control-item {
   line-height: 30px;

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 16 - 19
www/webapp/o2o/css/ratchetOverloading.css


+ 0 - 308
www/webapp/o2o/css/secondary.css

@@ -1,308 +0,0 @@
-#secondaryScroll {
-    /*底部导航栏*/
-}
-#secondaryScroll .secondary-content {
-    /*.secondary-type{
-        margin-top: 1rem;
-        width: 100%;
-        height: 100%;
-        div {
-          float: left;
-          padding-top: 5%;
-          padding-bottom: 5%;
-          text-align: center;
-          background: #ffffff;
-
-          &:nth-child(1),&:nth-child(3),&:nth-child(5),&:nth-child(7){
-            border-bottom: 1px solid;
-            border-right:1px solid;
-          }
-          img {
-            width: 50px;
-            height: 50px;
-          }
-          .mine-text {
-            display: block;
-            width: 100%;
-            border: 0;
-            padding: 0;
-          }
-        }
-      }*/
-}
-#secondaryScroll .secondary-content .secondary-head {
-    position: relative;
-    text-align: center;
-}
-#secondaryScroll .secondary-content .secondary-head img {
-    width: 100%;
-}
-#secondaryScroll .secondary-content .secondary-head img:nth-child(2) {
-    width: 5rem;
-    position: absolute;
-    left: 50%;
-    margin-left: -2.5rem;
-    bottom: -2.3rem;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list {
-    margin: 0;
-    list-style: none;
-    padding-left: 0;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list li {
-    padding-top: 0.4rem;
-    text-align: center;
-    width: 50%;
-    float: left;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list li img {
-    width: 50px;
-    height: 50px;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list li div {
-    border-bottom: 3px solid #a8a8a8;
-    width: 5rem;
-    margin: 0 auto;
-    padding-bottom: 0.3rem;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(1),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(3),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(5),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(7) {
-    border-bottom: 1px solid #b7b7b7;
-    border-right: 1px solid #b7b7b7;
-}
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-#secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-    border-bottom: 1px solid #b7b7b7;
-}
-#secondaryScroll .prevent-scroll {
-    width: 100%;
-    position: fixed;
-    bottom: 0;
-    background-color: #2a2400;
-}
-#secondaryScroll .prevent-scroll .width-percent-33 .title-container-square {
-    padding: 20%;
-    position: relative;
-    text-align: center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33 .title-container-square a {
-    position: absolute;
-    left: 0;
-    right: 0;
-    top: 0;
-    bottom: 0;
-}
-#secondaryScroll .prevent-scroll .width-percent-33 .title-container-square a .logo {
-    background-size: 65% 65%;
-    background-position: center center;
-    padding: 10%;
-    margin-top: 5px;
-    display: inline-block;
-    border-radius: 50%;
-}
-#secondaryScroll .prevent-scroll .width-percent-33 .title-container-square a .name {
-    display: block;
-    margin-top: -5px;
-    font-size: 12px;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_home.png") no-repeat;
-    background-size: 100%;
-    background-position: center center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(1) a:active .name {
-    color: #fff;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(1) a .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_home_pre.png") no-repeat;
-    background-size: 90%;
-    background-position: center center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(1) a .name {
-    color: #b89400;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(2) a .logo {
-    border-radius: 50%;
-    display: inline-block;
-    padding: 25%;
-    background-size: 100%;
-    margin-top: -15px;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_butler.png") 0 0 no-repeat #2a2400;
-    background-size: 65% 65%;
-    background-position: center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(3) a .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_me_pre.png");
-    background-repeat: no-repeat;
-    background-size: 90%;
-    background-position: center center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(3) a .name {
-    color: #b89400;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .logo {
-    border-radius: inherit;
-    background: url("http://odulvej8l.bkt.clouddn.com/tab_me.png");
-    background-repeat: no-repeat;
-    background-size: 100%;
-    background-position: center center;
-}
-#secondaryScroll .prevent-scroll .width-percent-33:nth-child(3) a:active .name {
-    color: #fff;
-}
-@media (min-width: 768px) {
-    #secondaryScroll .prevent-scroll .width-percent-33 .title-container-square a .name {
-        display: block;
-        margin-top: 5px;
-        font-size: 1.6rem;
-    }
-}
-/*媒体查询*/
-@media (min-width: 414px) {
-    #secondaryScroll .secondary-content .secondary-head {
-        position: relative;
-        text-align: center;
-    }
-    #secondaryScroll .secondary-content .secondary-head img {
-        width: 100%;
-    }
-    #secondaryScroll .secondary-content .secondary-head img:nth-child(2) {
-        width: 7rem;
-        position: absolute;
-        left: 50%;
-        margin-left: -3.5rem;
-        bottom: -3.4rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list {
-        /*margin: 0;
-              list-style: none;
-              padding-left: 0;*/
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li {
-        /*padding-top:0.4rem;
-                text-align: center;
-                width: 50%;
-                float: left;*/
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li img {
-        width: 2.7rem;
-        height: 2.7rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li div {
-        border-bottom: 3px solid #a8a8a8;
-        width: 6rem;
-        margin: 0 auto;
-        padding-bottom: 0.3rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(1),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(3),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(5),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(7) {
-        border-bottom: 1px solid #b7b7b7;
-        border-right: 1px solid #b7b7b7;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-        border-bottom: 1px solid #b7b7b7;
-    }
-}
-@media (min-width: 768px) {
-    #secondaryScroll .secondary-content .secondary-head {
-        position: relative;
-        text-align: center;
-    }
-    #secondaryScroll .secondary-content .secondary-head img {
-        width: 100%;
-    }
-    #secondaryScroll .secondary-content .secondary-head img:nth-child(2) {
-        width: 8rem;
-        position: absolute;
-        left: 50%;
-        margin-left: -4rem;
-        bottom: -3.9rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list {
-        /*margin: 0;
-              list-style: none;
-              padding-left: 0;*/
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li {
-        /*padding-top:0.4rem;
-                text-align: center;
-                width: 50%;
-                float: left;*/
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li img {
-        width: 5rem;
-        height: 5rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li div {
-        border-bottom: 3px solid #a8a8a8;
-        width: 6rem;
-        margin: 0 auto;
-        padding-bottom: 0.3rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(1),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(3),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(5),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(7) {
-        border-bottom: 1px solid #b7b7b7;
-        border-right: 1px solid #b7b7b7;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-        border-bottom: 1px solid #b7b7b7;
-    }
-}
-@media (max-height: 480px) {
-    #secondaryScroll .secondary-content .secondary-list .products-list {
-        height: 420px ;
-    }
-}
-@media (min-height: 568px) {
-    #secondaryScroll .secondary-content .secondary-list .products-list li img {
-        width: 1.5rem;
-        height: 1.5rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-        border-bottom: 1px solid #b7b7b7;
-    }
-}
-@media (min-height: 667px) {
-    #secondaryScroll .secondary-content .secondary-list .products-list li img {
-        width: 2.3rem;
-        height: 2.3rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-        border-bottom: 1px solid #b7b7b7;
-    }
-}
-@media (min-height: 700px) {
-    #secondaryScroll .secondary-content .secondary-list .products-list li img {
-        width: 2.8rem;
-        height: 2.8rem;
-    }
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(2),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(4),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(6),
-    #secondaryScroll .secondary-content .secondary-list .products-list li:nth-child(8) {
-        border-bottom: 1px solid #b7b7b7;
-    }
-}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/css/main.css


+ 1 - 4
www/webapp/o2o/dist/js/build.txt

@@ -24,12 +24,9 @@ model/recharge.js
 page/help.js
 page/about.js
 page/rechargee.js
-model/review.js
 page/mine.js
-page/secondary.js
-page/homestay.js
-page/homeenterprise.js
 model/cart.js
+model/review.js
 page/product.js
 page/placeOrder.js
 page/picker.js

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/build/template/template.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 5 - 4
www/webapp/o2o/dist/js/main.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/model/user.js


+ 0 - 1
www/webapp/o2o/dist/js/page/activities/day.js

@@ -1 +0,0 @@
-define(["$","template","IScroll","recharge","native","config","user","product"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"企业服务",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},r),r.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".btn-appliances",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));i.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:u.allList[n-1],needReset:!0}})},r),e.newTouch(".btn-home-day",function(e){e.preventDefault(),i.trigger("spa:navigate",{hash:"activity-day",pushData:{needReset:!0}})},r),e.newTouch(".btn-banner-coupon",function(e){e.preventDefault(),i.trigger("spa:navigate",{hash:"myCoupon",pushData:{needReload:!0}})},r),e.newTouch(".btn-banner-recharge",function(e){e.preventDefault(),i.trigger("spa:navigate",{hash:"recharge",pushData:{needReload:!0}})},r),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("activities/day",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o);var f=e(".btn-add-recharge").attr("data-index");for(var l=f;l<2;l++);setTimeout(function(){i.scroll=new n("#homeenterpriseScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/page/home.js


+ 0 - 1
www/webapp/o2o/dist/js/page/homeenterprise.js

@@ -1 +0,0 @@
-define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"企业服务",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},r),r.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/Enterprise"},r),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("homeenterprise/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o);var f=e(".btn-add-recharge").attr("data-index");for(var l=f;l<2;l++);setTimeout(function(){i.scroll=new n("#homeenterpriseScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});

+ 0 - 1
www/webapp/o2o/dist/js/page/homestay.js

@@ -1 +0,0 @@
-define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"民宿保洁",body:"",init:function(t,n){var r=this,i=e(document);r.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},r),r.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".o2o-btn-homestay",function(e){e.preventDefault(),window.location.href="/index.php?r=common/activity/SinglesDay"},r),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("homestay/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o);var f=e(".btn-add-recharge").attr("data-index");for(var l=f;l<2;l++);setTimeout(function(){i.scroll=new n("#homestayScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/page/mine.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/page/placeOrder.js


+ 1 - 1
www/webapp/o2o/dist/js/page/rechargee.js

@@ -1 +1 @@
-define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"充值卡",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},i),i.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".btn-add-recharge",function(t){t.preventDefault(),s.trigger("spa:openloader");var n=e(this).attr("data-value");r.addRechargeorder({user_id:o.id,recharge_id:e(this).attr("data-id")},function(e){s.trigger("spa:closeloader"),e.success&&(o.orders[1].data.push({id:e.data._id.$id,products:[{product:{name:"充值"+n+"元"}}],final_price:e.data.price}),s.trigger("spa:navigate",{hash:"pay",pushData:{isRecharge:!0,orderID:e.data._id.$id,backHash:"recharge"}}))})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("recharge/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o);var f=e(".btn-add-recharge").attr("data-index");for(var l=f;l<2;l++);setTimeout(function(){i.scroll=new n("#rechargeScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});
+define(["$","template","IScroll","recharge","native","config","user"],function(e,t,n,r,i,s,o){function u(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"充值卡",body:"",init:function(t,n){var i=this,s=e(document);i.on("swipeRight",function(e){history.go(-1)}),e.newTouch(".back-button",function(e){history.go(-1)},i),i.on("tapBackButton",function(e){history.go(-1)}),e.newTouch(".btn-add-recharge",function(t){t.preventDefault(),s.trigger("spa:openloader");var n=e(this).attr("data-value");r.addRechargeorder({user_id:o.id,recharge_id:e(this).attr("data-id")},function(e){s.trigger("spa:closeloader"),e.success&&(o.orders[1].data.push({id:e.data._id.$id,products:[{product:{name:"充值"+n+"元"}}],final_price:e.data.price}),s.trigger("spa:navigate",{hash:"pay",pushData:{isRecharge:!0,orderID:e.data._id.$id,backHash:"recharge"}}))})},i),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(i,o){var u=this,a=e(document);i.pushData.dontNeedReload||(a.trigger("spa:openloader"),r.getRechargeList(function(r){a.trigger("spa:closeloader");if(r.success){var o=t("recharge/index",{showNavBar:!s.isWX,recharges:r.data});e(".spa-page-body",u).html(o),setTimeout(function(){i.scroll=new n("#rechargeScroll")},500)}})),o.resolve()},beforeclose:function(e,t){t.resolve()}}});

+ 0 - 1
www/webapp/o2o/dist/js/page/secondary.js

@@ -1 +0,0 @@
-define(["$","template","IScroll","user","product","native","config","address"],function(e,t,n,r,i,s,o,u){function a(t){t.preventDefault(),e(document).trigger("spa:navigate",{hash:"",pushData:{dontNeedReload:!0}})}return{title:"家庭保洁",body:"",init:function(t,n){var s=this,o=e(document);s.on("swipeRight",function(e){a.call(this,e)}),e.newTouch(".back-button",function(e){a.call(this,e)},s),s.on("tapBackButton",function(e){a.call(this,e)}),e.newTouch(".btn-product",function(t){t.preventDefault();var n=parseInt(e(this).attr("data-product-type"));o.trigger("spa:navigate",{hash:"placeOrder",pushData:{product:i.allList[n-1],needReset:!0}})},s),e.newTouch(".btn-action-my-order",function(){event.preventDefault(),o.trigger("spa:navigate",{hash:"",pushData:{needReset:!0}})},s),e.newTouch(".btn-action-coupon",function(e){e.preventDefault(),r.checkLogin(function(){o.trigger("spa:navigate",{hash:"mine",pushData:{needReset:!0}})})},s),n.resolve()},beforeopen:function(e,t){t.resolve()},afteropen:function(r,i){var s=this,u=e(document);if(r.pushData&&r.pushData.needReset){var a=t("secondary/index",{showNavBar:!o.isWX});e(".spa-page-body",s).html(a),setTimeout(function(){r.scroll=new n("#secondaryScroll")},500)}i.resolve()},beforeclose:function(e,t){t.resolve()}}});

+ 1 - 1
www/webapp/o2o/dist/js/panel/alert.js

@@ -1 +1 @@
-define(["$","template","product"],function(e,t,n){return{body:"",init:function(t,n){var r=this,i=e(document);e.newTouch("button",function(n){e(this).html()==="查看"&&(n.preventDefault(),i.trigger("spa:navigate",{hash:"myCoupon",pushData:{needReload:!0}})),n.stopPropagation(),n.preventDefault();var s=e(this).data("button-index"),o=t.pushData;o.buttons&&o.buttons[s]&&e.isFunction(o.buttons[s].callback)&&o.buttons[s].callback(),r.trigger("spa:closepanel")},r),e.newTouch(".newTouch"),n.resolve()},beforeopen:function(n,r){var i=this,s=n.pushData,o=s.buttons?s.buttons:[{text:"我知道了","class":"btn-primary"}],u=s.html?s.html:"";e(".spa-page-bg",i).css({opacity:0}).transition({opacity:.6});var a=t("common/alert",{title:s.title,message:s.message,html:u,buttons:o});i.find(".spa-page-body").html(a),r.resolve()},beforeclose:function(t,n){var r=this;e(".spa-page-bg",r).transition({opacity:0}),setTimeout(function(){r.find(".alert-body").css({"pointer-events":!0})},100),n.resolve()}}});
+define(["$","template"],function(e,t){return{body:"",init:function(t,n){var r=this;e.newTouch("button",function(n){n.stopPropagation(),n.preventDefault();var i=e(this).data("button-index"),s=t.pushData;s.buttons&&s.buttons[i]&&e.isFunction(s.buttons[i].callback)&&s.buttons[i].callback(),r.trigger("spa:closepanel")},r),n.resolve()},beforeopen:function(n,r){var i=this,s=n.pushData,o=s.buttons?s.buttons:[{text:"我知道了","class":"btn-primary"}],u=s.html?s.html:"";e(".spa-page-bg",i).css({opacity:0}).transition({opacity:.6});var a=t("common/alert",{title:s.title,message:s.message,html:u,buttons:o});i.find(".spa-page-body").html(a),r.resolve()},beforeclose:function(t,n){var r=this;e(".spa-page-bg",r).transition({opacity:0}),setTimeout(function(){r.find(".alert-body").css({"pointer-events":!0})},100),n.resolve()}}});

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
www/webapp/o2o/dist/js/spa.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 4
www/webapp/o2o/js/build/template.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 380 - 0
www/webapp/o2o/js/build/template/template.js


+ 581 - 619
www/webapp/o2o/js/main.js

@@ -1,627 +1,589 @@
 require.config({
-	urlArgs: 'v=' + (new Date()).getTime(),
-	waitSeconds: 0,
-	paths: {
-		zepto: '../../common/js/zepto.min',
-		wx: '../../common/js/jweixin-1.0.0',
-		ctk: '../../common/js/ctk-1.0.0',
-		pingpp: '../../common/js/pingpp',
-		spa: '../../common/js/spa',
-		IScroll: '../../framework/iscroll5/iscroll-probe',
-		ratchet: '../../framework/ratchet-2.0.2/dist/js/ratchet.base',
-		$: '../../common/js/jq_extend',
-		autosize: '../../common/js/autosize',
-		config: '../../common/js/config',
-		helper: '../../common/js/helper',
-		native: '../../common/js/native',
-		storage: '../../common/js/storage',
-		base: '../../common/js/base',
-		template: './build/template',
-		api: './api',
-		bdmapapi: '../../common/js/bdmapapi',
-		BMap: 'http://api.map.baidu.com/getscript?v=2.0&ak=B349f0b32ef6e78b2e678f45cb9fddaf&services=&t=20160310104956',
-		//model
-		user: './model/user',
-		product: './model/product',
-		cart: './model/cart',
-		order: './model/order',
-		review: './model/review',
-		address: './model/address',
-		recharge: './model/recharge',
-		//page
-		pageHome: './page/home',
-		pageRecharge: './page/rechargee',
-		pageHelp: './page/help',
-		pageHomestay: './page/homestay',
-		pageHomeenterprise: './page/homeenterprise',
-		pageAbout: './page/about',
-		pageProduct: './page/product',
-		pageProductInfo: './page/productInfo',
-		pageDesc: './page/desc',
-		pagePlaceOrder: './page/placeOrder',
-		pagePicker: './page/picker',
-		pagePay: './page/pay',
-		pageAppendPay: './page/appendPay',
-		pageMyOrder: './page/myOrder',
-		pageMyOrderDetail: './page/myOrderDetail',
-		pageMyCoupon: './page/myCoupon',
-		pageOrderDone: './page/orderDone',
-		pageSuccess: './page/success',
-		pageAgreement: './page/agreement',
-		pageAddressList: './page/address/addressList',
-		pageAddressAdd: './page/address/addressAdd',
-		pageAddressDetail: './page/address/addressDetail',
-		pageAddressPoisiton: './page/address/addressPoi',
-		pageHire: './page/hire',
-		pageComing: './page/coming',
-		pageActivityCat: './page/activities/day',
-		pageAppend: './page/append',
-		pageRefund: './page/refund',
-		pageRefundSuccess: './page/refundSuccess',
-		pageBeautician: './page/beautician',
-		pageBeauticianDetail: './page/beauticianDetail',
-		pageMine: './page/mine',
-		pageSecondary: './page/secondary',
-		//panel
-		panelAlert: './panel/alert',
-		panelActionSheet: './panel/actionSheet',
-		// panelAddressAction: './panel/addressAction',
-		panelDataPicker: './panel/dataPicker',
-		panelProductOption: './panel/productOption',
-		panelPostReview: './panel/postReview',
-		panelActivity: './panel/activity'
-	},
-	shim: {
-		zepto: {
-			exports: '$'
-		},
-		IScroll: {
-			exports: 'IScroll'
-		},
-		BMap: {
-			exports: 'BMap'
-		}
-
-	}
+  urlArgs: 'v=' + (new Date()).getTime(),
+  waitSeconds: 0,
+  paths: {
+    zepto: '../../common/js/zepto.min',
+    wx: '../../common/js/jweixin-1.0.0',
+    ctk: '../../common/js/ctk-1.0.0',
+    pingpp: '../../common/js/pingpp',
+    spa: '../../common/js/spa',
+    IScroll: '../../framework/iscroll5/iscroll-probe',
+    ratchet: '../../framework/ratchet-2.0.2/dist/js/ratchet.base',
+    $: '../../common/js/jq_extend',
+    autosize: '../../common/js/autosize',
+    config: '../../common/js/config',
+    helper: '../../common/js/helper',
+    native: '../../common/js/native',
+    storage: '../../common/js/storage',
+    base: '../../common/js/base',
+    template: './build/template',
+    api: './api',
+    bdmapapi: '../../common/js/bdmapapi',
+    BMap: 'http://api.map.baidu.com/getscript?v=2.0&ak=B349f0b32ef6e78b2e678f45cb9fddaf&services=&t=20160310104956',
+    //model
+    user: './model/user',
+    product: './model/product',
+    cart: './model/cart',
+    order: './model/order',
+    review: './model/review',
+    address: './model/address',
+    recharge: './model/recharge',
+    //page
+    pageHome: './page/home',
+    pageRecharge: './page/rechargee',
+    pageHelp: './page/help',
+    pageAbout: './page/about',
+    pageProduct: './page/product',
+    pageProductInfo: './page/productInfo',
+    pageDesc: './page/desc',
+    pagePlaceOrder: './page/placeOrder',
+    pagePicker: './page/picker',
+    pagePay: './page/pay',
+    pageAppendPay: './page/appendPay',
+    pageMyOrder: './page/myOrder',
+    pageMyOrderDetail: './page/myOrderDetail',
+    pageMyCoupon: './page/myCoupon',
+    pageOrderDone: './page/orderDone',
+    pageSuccess: './page/success',
+    pageAgreement: './page/agreement',
+    pageAddressList: './page/address/addressList',
+    pageAddressAdd: './page/address/addressAdd',
+    pageAddressDetail: './page/address/addressDetail',
+    pageAddressPoisiton: './page/address/addressPoi',
+    pageHire: './page/hire',
+    pageComing: './page/coming',
+    pageActivityCat: './page/activities/cat',
+    pageAppend: './page/append',
+    pageRefund: './page/refund',
+    pageRefundSuccess: './page/refundSuccess',
+    pageBeautician: './page/beautician',
+    pageBeauticianDetail: './page/beauticianDetail',
+    pageMine: './page/mine',
+    //panel
+    panelAlert: './panel/alert',
+    panelActionSheet: './panel/actionSheet',
+    // panelAddressAction: './panel/addressAction',
+    panelDataPicker: './panel/dataPicker',
+    panelProductOption: './panel/productOption',
+    panelPostReview: './panel/postReview',
+    panelActivity: './panel/activity'
+  },
+  shim: {
+    zepto: {
+      exports: '$'
+    },
+    IScroll: {
+        exports: 'IScroll'
+    },
+    BMap: {
+      exports: 'BMap'
+    }
+
+  }
 });
 
 require(['$', 'spa', 'native', 'helper', 'ratchet', 'config', 'user'], function ($, spa, native, helper, ratchet, config, user) {
-	var $doc = $(document);
-
-	// 首页
-	var pageHome = {
-		route: '',
-		classname: 'home',
-		animate: 'fadeIn',
-		view: function () {
-			var $page = this;
-			requirejs(['pageHome'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//商品页
-	var pageProduct = {
-		route: 'product',
-		classname: 'product',
-		animate: 'slideInUp',
-		view: function () {
-			var $page = this;
-			requirejs(['pageProduct'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//充值卡
-	var pageRecharge = {
-		route: 'recharge',
-		classname: 'recharge',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageRecharge'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//个人中心
-	var pageMine = {
-		route: 'mine',
-		classname: 'mine',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageMine'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-	//家庭保洁
-	var pageSecondary = {
-		route: 'secondary',
-		classname: 'secondary',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageSecondary'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-	//民宿保洁
-	var pageHomestay = {
-		route: 'homestay',
-		classname: 'homestay',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageHomestay'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-	//企业服务
-	var pageHomeenterprise = {
-		route: 'homeenterprise',
-		classname: 'homeenterprise',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageHomeenterprise'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-	//商品提示信息
-	var pageProductInfo = {
-		route: 'product-info/:type',
-		classname: 'product-info',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageProductInfo'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//商品介绍页
-	var pageDesc = {
-		route: 'desc',
-		classname: 'desc',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageDesc'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//订单页
-	var pagePlaceOrder = {
-		route: 'placeOrder',
-		classname: 'place-order',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pagePlaceOrder'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//选择列表页
-	var pagePicker = {
-		route: 'picker',
-		classname: 'picker',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pagePicker'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//支付页面
-	var pagePay = {
-		route: 'pay',
-		classname: 'pay',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pagePay'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	// 追加订单支付页面
-	var pageAppendPay = {
-		route: 'append-pay',
-		classname: 'append-pay',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAppendPay'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	//支付成功
-	var pagePaySuccess = {
-		route: 'paySuccess',
-		classname: 'pay-success',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageSuccess'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//我的订单页
-	var pageMyOrder = {
-		route: 'myOrder(/:type)',
-		classname: 'my-order',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageMyOrder'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	var pageMyOrderDetail = {
-		route: 'OrderDetail/:id',
-		classname: 'my-order-detail',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageMyOrderDetail'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//我的优惠券
-	var pageMyCoupon = {
-		route: 'myCoupon',
-		classname: 'my-coupon',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageMyCoupon'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//用户服务协议
-	var pageAgreement = {
-		route: 'agreement',
-		classname: 'agreement',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAgreement'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//地址列表
-	var pageAddressList = {
-		route: 'addressList',
-		classname: 'address-list',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAddressList'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//地址添加
-	var pageAddressAdd = {
-		route: 'addressAdd',
-		classname: 'address-add',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAddressAdd'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//地址详情
-	var pageAddressDetail = {
-		route: 'addressDetail',
-		classname: 'address-detail',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAddressDetail'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//地址定位
-	var pageAddressPoisiton = {
-		route: 'addressPoisiton',
-		classname: 'address-poisition',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAddressPoisiton'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	//招聘
-	var pageHire = {
-		route: 'hire',
-		classname: 'hire',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageHire'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 未上线
-	var pageComing = {
-		route: 'coming',
-		classname: 'coming',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageComing'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 活动
-	var pageActivityCat = {
-		route: 'activity-day',
-		classname: 'activities-day',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageActivityCat'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 追加服务
-	var pageAppend = {
-		route: 'append',
-		classname: 'append',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAppend'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 申请退款
-	var pageRefund = {
-		route: 'refund',
-		classname: 'refund',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageRefund'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 申请成功
-	var pageRefundSuccess = {
-		route: 'refund-success',
-		classname: 'refund-success',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageRefundSuccess'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			});
-		}
-	};
-
-	// 订单确认完成
-	var pageOrderDone = {
-		route: 'order-done',
-		classname: 'order-done',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageOrderDone'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData])
-			})
-		}
-	};
-
-	var pageBeautician = {
-		route: 'beautician',
-		classname: 'beautician',
-		animate: 'pushInLeft',
-		view: function () {
-			var $page = this;
-			requirejs(['pageBeautician'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData]);
-			})
-		}
-	};
-
-	var pageBeauticianDetail = {
-		route: 'beautician-detail',
-		classname: 'beautician-detail',
-		animate: 'slideInUp',
-		view: function () {
-			var $page = this;
-			requirejs(['pageBeauticianDetail'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData]);
-			})
-		}
-	};
-
-	var pageHelp = {
-		route: 'help',
-		classname: 'help',
-		animate: 'slideInUp',
-		view: function () {
-			var $page = this;
-			requirejs(['pageHelp'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData]);
-			})
-		}
-	};
-
-	var pageAbout = {
-		route: 'about',
-		classname: 'about',
-		animate: 'slideInUp',
-		view: function () {
-			var $page = this;
-			requirejs(['pageAbout'], function (viewData) {
-				$doc.trigger('spa:initpage', [$page, viewData]);
-			})
-		}
-	};
-
-	$doc.trigger('spa:route', [pageHome, pageRecharge, pageAbout, pageHelp, pageMine, pageSecondary, pageHomestay, pageHomeenterprise,pageProduct, pageProductInfo, pageDesc, pagePlaceOrder, pagePicker, pagePay, pageAppendPay, pagePaySuccess, pageMyOrder, pageMyOrderDetail, pageMyCoupon, pageAgreement, pageAddressList, pageAddressAdd, pageAddressDetail, pageAddressPoisiton, pageHire, pageComing, pageActivityCat, pageAppend, pageRefund, pageRefundSuccess, pageOrderDone, pageBeautician, pageBeauticianDetail]);
-
-	var panelAlert = {
-		id: 'simpleAlert',
-		classname: 'alert',
-		animate: 'zoomIn',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelAlert'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	var panelActionSheet = {
-		id: 'actionSheet',
-		classname: 'action-sheet',
-		animate: 'overlayInUp',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelActionSheet'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	var panelDataPicker = {
-		id: 'dataPicker',
-		classname: 'data-picker',
-		animate: 'overlayInUp',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelDataPicker'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	var panelProductOption = {
-		id: 'productOption',
-		classname: 'product-option',
-		animate: 'overlayInUp',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelProductOption'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	var panelPostReview = {
-		id: 'postReview',
-		classname: 'post-review',
-		animate: 'overlayInUp',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelPostReview'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	var panelActivity = {
-		id: 'activity',
-		classname: 'activity',
-		animate: 'overlayInUp',
-		view: function () {
-			var $panel = this;
-			requirejs(['panelActivity'], function (viewData) {
-				$doc.trigger('spa:initpanel', [$panel, viewData]);
-			})
-		}
-	};
-
-	$doc.trigger('spa:panel', [panelAlert, panelActionSheet, panelDataPicker, panelProductOption, panelPostReview, panelActivity]);
-
-	$(function () {
-		if (config.isWX) {
-			//微信 去掉顶部导航栏
-			var styles = ".content {top: 0;}";
-			helper.includeStyleElement(styles, 'ios7');
-
-			//微信过来的登录后再启动
-			user.getUserInfo(function () {
-				$doc.trigger('spa:boot');
-			});
-
-		} else if (config.isAndroid || config.isIOS) {
-			//注册事件
-			native.delegateBackButton(true);
-
-			//安卓返回按钮
-			$(document).on('tapBackButton', function () {
-				$.spa.getCurPage().trigger('tapBackButton');
-			});
-
-			//ios7特殊样式 全屏幕往下移动20px
-			helper.osProxy({
-				ios: function () {
-					var styles = ".bar-nav {height: 64px;padding-top: 20px;}\
+  var $doc = $(document);
+
+  // 首页
+  var pageHome = {
+    route: '',
+    classname: 'home',
+    animate: 'fadeIn',
+    view: function () {
+      var $page = this;
+      requirejs(['pageHome'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //商品页
+  var pageProduct = {
+    route: 'product',
+    classname: 'product',
+    animate: 'slideInUp',
+    view: function () {
+      var $page = this;
+      requirejs(['pageProduct'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //充值卡
+  var pageRecharge = {
+    route: 'recharge',
+    classname: 'recharge',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageRecharge'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //个人中心
+  var pageMine = {
+    route: 'mine',
+    classname: 'mine',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageMine'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //商品提示信息
+  var pageProductInfo = {
+    route: 'product-info/:type',
+    classname: 'product-info',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageProductInfo'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //商品介绍页
+  var pageDesc = {
+    route: 'desc',
+    classname: 'desc',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageDesc'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //订单页
+  var pagePlaceOrder = {
+    route: 'placeOrder',
+    classname: 'place-order',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pagePlaceOrder'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //选择列表页
+  var pagePicker = {
+    route: 'picker',
+    classname: 'picker',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pagePicker'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //支付页面
+  var pagePay = {
+    route: 'pay',
+    classname: 'pay',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pagePay'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  // 追加订单支付页面
+  var pageAppendPay = {
+    route: 'append-pay',
+    classname: 'append-pay',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAppendPay'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  //支付成功
+  var pagePaySuccess = {
+    route: 'paySuccess',
+    classname: 'pay-success',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageSuccess'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //我的订单页
+  var pageMyOrder = {
+    route: 'myOrder(/:type)',
+    classname: 'my-order',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageMyOrder'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  var pageMyOrderDetail = {
+    route: 'OrderDetail/:id',
+    classname: 'my-order-detail',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageMyOrderDetail'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //我的优惠券
+  var pageMyCoupon = {
+    route: 'myCoupon',
+    classname: 'my-coupon',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageMyCoupon'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //用户服务协议
+  var pageAgreement = {
+    route: 'agreement',
+    classname: 'agreement',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAgreement'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //地址列表
+  var pageAddressList = {
+    route: 'addressList',
+    classname: 'address-list',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAddressList'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //地址添加
+  var pageAddressAdd = {
+    route: 'addressAdd',
+    classname: 'address-add',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAddressAdd'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //地址详情
+  var pageAddressDetail = {
+    route: 'addressDetail',
+    classname: 'address-detail',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAddressDetail'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //地址定位
+  var pageAddressPoisiton = {
+    route: 'addressPoisiton',
+    classname: 'address-poisition',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAddressPoisiton'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  //招聘
+  var pageHire = {
+    route: 'hire',
+    classname: 'hire',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageHire'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 未上线
+  var pageComing = {
+    route: 'coming',
+    classname: 'coming',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageComing'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 活动
+  var pageActivityCat = {
+    route: 'activity-cat',
+    classname: 'activities-cat',
+    animate: 'slideInUp',
+    view: function () {
+      var $page = this;
+      requirejs(['pageActivityCat'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 追加服务
+  var pageAppend = {
+    route: 'append',
+    classname: 'append',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageAppend'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 申请退款
+  var pageRefund = {
+    route: 'refund',
+    classname: 'refund',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageRefund'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 申请成功
+  var pageRefundSuccess = {
+    route: 'refund-success',
+    classname: 'refund-success',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageRefundSuccess'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      });
+    }
+  };
+
+  // 订单确认完成
+  var pageOrderDone = {
+    route: 'order-done',
+    classname: 'order-done',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageOrderDone'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData])
+      })
+    }
+  };
+
+  var pageBeautician = {
+    route: 'beautician',
+    classname: 'beautician',
+    animate: 'pushInLeft',
+    view: function () {
+      var $page = this;
+      requirejs(['pageBeautician'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData]);
+      })
+    }
+  };
+
+  var pageBeauticianDetail = {
+    route: 'beautician-detail',
+    classname: 'beautician-detail',
+    animate: 'slideInUp',
+    view: function () {
+      var $page = this;
+      requirejs(['pageBeauticianDetail'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData]);
+      })
+    }
+  };
+
+  var pageHelp = {
+    route: 'help',
+    classname: 'help',
+    animate: 'slideInUp',
+    view: function () {
+      var $page = this;
+      requirejs(['pageHelp'], function (viewData) {
+        $doc.trigger('spa:initpage', [$page, viewData]);
+      })
+    }
+  };
+
+    var pageAbout = {
+        route: 'about',
+        classname: 'about',
+        animate: 'slideInUp',
+        view: function () {
+            var $page = this;
+            requirejs(['pageAbout'], function (viewData) {
+                $doc.trigger('spa:initpage', [$page, viewData]);
+            })
+        }
+    };
+
+  $doc.trigger('spa:route', [pageHome, pageRecharge, pageAbout, pageHelp, pageMine, pageProduct, pageProductInfo, pageDesc, pagePlaceOrder, pagePicker, pagePay, pageAppendPay, pagePaySuccess, pageMyOrder, pageMyOrderDetail, pageMyCoupon, pageAgreement, pageAddressList, pageAddressAdd, pageAddressDetail, pageAddressPoisiton, pageHire, pageComing, pageActivityCat, pageAppend, pageRefund, pageRefundSuccess, pageOrderDone, pageBeautician, pageBeauticianDetail]);
+
+  var panelAlert = {
+    id: 'simpleAlert',
+    classname: 'alert',
+    animate: 'zoomIn',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelAlert'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  var panelActionSheet = {
+    id: 'actionSheet',
+    classname: 'action-sheet',
+    animate: 'overlayInUp',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelActionSheet'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  var panelDataPicker = {
+    id: 'dataPicker',
+    classname: 'data-picker',
+    animate: 'overlayInUp',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelDataPicker'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  var panelProductOption = {
+    id: 'productOption',
+    classname: 'product-option',
+    animate: 'overlayInUp',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelProductOption'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  var panelPostReview = {
+    id: 'postReview',
+    classname: 'post-review',
+    animate: 'overlayInUp',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelPostReview'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  var panelActivity = {
+    id: 'activity',
+    classname: 'activity',
+    animate: 'overlayInUp',
+    view: function () {
+      var $panel = this;
+      requirejs(['panelActivity'], function (viewData) {
+        $doc.trigger('spa:initpanel', [$panel, viewData]);
+      })
+    }
+  };
+
+  $doc.trigger('spa:panel', [panelAlert, panelActionSheet, panelDataPicker, panelProductOption, panelPostReview, panelActivity]);
+
+  $(function () {
+    if (config.isWX ) {
+      //微信 去掉顶部导航栏
+      var styles = ".content {top: 0;}";
+      helper.includeStyleElement(styles, 'ios7');
+
+      //微信过来的登录后再启动
+      user.getUserInfo(function() {
+        $doc.trigger('spa:boot');
+      });
+
+    } else if (config.isAndroid || config.isIOS) {
+      //注册事件
+      native.delegateBackButton(true);
+
+      //安卓返回按钮
+      $(document).on('tapBackButton', function () {
+        $.spa.getCurPage().trigger('tapBackButton');
+      });
+
+      //ios7特殊样式 全屏幕往下移动20px
+      helper.osProxy({
+        ios: function () {
+          var styles = ".bar-nav {height: 64px;padding-top: 20px;}\
           .content {top: 64px;}\
           .bar-nav .left-button {padding-top: 20px;}\
           .bar-nav .right-button {padding-top: 20px;}";
-					helper.includeStyleElement(styles, 'ios7');
-				}
-			});
-
-			$doc.trigger('spa:boot');
-		} else if (config.isChubao) {
-			var styles = ".content {top: 0;}";
-			helper.includeStyleElement(styles, 'ios7');
-			$doc.trigger('spa:boot');
-		} else {
-			$doc.trigger('spa:boot');
-		}
-	})
+          helper.includeStyleElement(styles, 'ios7');
+        }
+      });
+
+      $doc.trigger('spa:boot');
+    } else if (config.isChubao) {
+      var styles = ".content {top: 0;}";
+      helper.includeStyleElement(styles, 'ios7');
+      $doc.trigger('spa:boot');
+    } else {
+      $doc.trigger('spa:boot');
+    }
+  })
 })

+ 0 - 99
www/webapp/o2o/js/model/product.js

@@ -1133,105 +1133,6 @@ define(['base', '$', 'api'], function (base, $, api) {
                         height: 850
                     }
                 ]
-            },
-            {
-                id: "581fe5a6a84ea0e36c8b45bb",
-                name: "活动产品",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/1%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81%E9%A6%96%E5%9B%BE.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_rc.jpg"}, {content: "日常清洁"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "9",
-                type_str: "日常清洁",
-                extra: [
-                    {
-                        type: "一室一卫",
-                        price: "11"
-                    },
-                    {
-                        type: "两室一卫",
-                        price: "11"
-                    },
-                    {
-                        type: "两室两卫",
-                        price: "11"
-                    },
-                    {
-                        type: "三室两卫",
-                        price: "11"
-                    },
-                    {
-                        type: "四室三卫",
-                        price: "11"
-                    },
-                    {
-                        type: "200-250平米",
-                        price: "11"
-                    },
-                    {
-                        type: "200-300平米",
-                        price: "11"
-                    },
-                    {
-                        type: "三层别墅",
-                        price: "11"
-                    },
-                    {
-                        type: "四层别墅",
-                        price: "11"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/1%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81%E9%A6%96%E5%9B%BE.jpg",
-                        width: 537,
-                        height: 537
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_1%28720x1165%29.jpg",
-                        width: 720,
-                        height: 1165
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_2%28720x1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_3%28720x1127%29.jpg",
-                        width: 720,
-                        height: 1127
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_4%28720x1178%29.jpg",
-                        width: 720,
-                        height: 1178
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_5%28720x1246%29.jpg",
-                        width: 720,
-                        height: 1246
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_6%28720x520%29.jpg",
-                        width: 720,
-                        height: 520
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_7%28720x644%29.jpg",
-                        width: 720,
-                        height: 644
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81_8%28720x1257%29.jpg",
-                        width: 720,
-                        height: 644
-                    }
-                ]
             }
         ];
         //列出所有的产品

+ 331 - 333
www/webapp/o2o/js/model/user.js

@@ -1,366 +1,364 @@
 /**
  * 用户模型
  */
-define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function (base, $, native, api, order, config, address) {
-	var User = function () {
-		if (typeof User.instance === 'object') {
-			return User.instance;
-		}
-		User.instance = this;
-		this.storagePrefix = 'user_';
-		this.id = ''; //57e22bb59f5160c2048b456c//57e38f1b9f5160ac048b457d
-		this.lastID = this.getCache('lastID', null, '');
-		this.name = '';
-		this.avatar='';
-		this.mobile = '';
-		this.balance = 0;
-		this.info = {};
-		this.orders = {
-			1: {
-				data: [],
-				page: 0,
-				hasMore: false
-			},
-			2: {
-				data: [],
-				page: 0,
-				hasMore: false
-			},
-			3: {
-				data: [],
-				page: 0,
-				hasMore: false
-			},
-			4: {
-				data: [],
-				page: 0,
-				hasMore: false
-			},
-			5: {
-				data: [],
-				page: 0,
-				hasMore: false
-			}
-		};
-		this.appendOrder = {};//追加订单
+define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(base, $, native, api, order, config, address) {
+  var User = function() {
+    if (typeof User.instance === 'object') {
+      return User.instance;
+    }
+    User.instance = this;
+    this.storagePrefix = 'user_';
+    this.id = ''; //57e22bb59f5160c2048b456c
+    this.lastID = this.getCache('lastID', null, '');
+    this.name = '';
+    this.mobile = '';
+    this.balance = 0;
+    this.info = {};
+    this.orders = {
+      1: {
+        data: [],
+        page: 0,
+        hasMore: false
+      },
+      2: {
+        data: [],
+        page: 0,
+        hasMore: false
+      },
+      3: {
+        data: [],
+        page: 0,
+        hasMore: false
+      },
+      4: {
+        data: [],
+        page: 0,
+        hasMore: false
+      },
+      5: {
+        data: [],
+        page: 0,
+        hasMore: false
+      }
+    };
+    this.appendOrder = {};//追加订单
 
-		this.orderCoupons = [];// 所有优惠券按顺序排好
-		this.usable_coupons = [];// 可用优惠券
-		this.used_coupons = [];// 用过的优惠券
-		this.overtime_coupons = [];// 过期的优惠券
+    this.orderCoupons = [];// 所有优惠券按顺序排好
+    this.usable_coupons = [];// 可用优惠券
+    this.used_coupons = [];// 用过的优惠券
+    this.overtime_coupons = [];// 过期的优惠券
 
-		this.activities = this.getCache('activities', null, {//活动
-			"visited_dog": false,
-			"visited_order0104": false
-		});
-		this.productVisit = this.getCache('productVisit', null, {//产品访问-缓存为空
-			1: {
-				visited: false//访问
-			},
-			2: {
-				visited: false
-			},
-			3: {
-				visited: false
-			},
-			4: {
-				visited: false
-			},
-			5: {
-				visited: false
-			},
-			6: {
-				visited: false
-			},
-			7: {
-				visited: false
-			},
-			8: {
-				visited: false
-			},
-			9: {
-				visited: false
-			},
-			10: {
-				visited: false
-			},
-			11: {
-				visited: false
-			},
-			12: {
-				visited: false
-			},
-			13: {
-				visited: false
-			},
-			14: {
-				visited: false
-			},
-			15: {
-				visited: false
-			}
-		});
-		this.selectTech = {//选择...技术?
-			can: [],//能够
-			match: []//匹配
-		};
-		this.isCheck = this.getCache('isCheck', null, {//检测缓存中是否有优惠券数据
-			"couponCheck": false//优惠券是否存在
-		});
-	}
+    this.activities = this.getCache('activities', null, {//活动
+      "visited_dog": false,
+      "visited_order0104": false
+    });
+    this.productVisit = this.getCache('productVisit', null, {//产品访问-缓存为空
+      1: {
+        visited: false//访问
+      },
+      2: {
+        visited: false
+      },
+      3: {
+        visited: false
+      },
+      4: {
+        visited: false
+      },
+      5: {
+        visited: false
+      },
+      6: {
+        visited: false
+      },
+      7: {
+        visited: false
+      },
+      8: {
+        visited: false
+      },
+      9: {
+        visited: false
+      },
+      10: {
+        visited: false
+      },
+      11: {
+        visited: false
+      },
+      12: {
+        visited: false
+      },
+      13: {
+        visited: false
+      },
+      14: {
+        visited: false
+      },
+      15: {
+        visited: false
+      }
+    });
+    this.selectTech = {//选择...技术?
+      can: [],//能够
+      match: []//匹配
+    };
+    this.isCheck = this.getCache('isCheck', null, {//检测缓存中是否有优惠券数据
+      "couponCheck": false//优惠券是否存在
+    });
+  }
 
-	User.prototype = new base();//新建base()函数.继承User函数的原型
+  User.prototype = new base();//新建base()函数.继承User函数的原型
 
 
-	//获取用户信息
-	User.prototype.getUserInfo = function (callback) {
-		var that = this;
-		native.getUserInfo(function (res) {
-			loginWithData.call(that, res);//loginWithData-登录数据
-			if (typeof(callback) == 'function') {//判断callback是否为函数.
-				callback();//调用函数
-			}
-		});
-	};
+  //获取用户信息
+  User.prototype.getUserInfo = function(callback){
+    var that = this;
+    native.getUserInfo(function(res) {
+      loginWithData.call(that, res);//loginWithData-登录数据
+      if (typeof(callback) == 'function') {//判断callback是否为函数.
+        callback();//调用函数
+      }
+    });
+  };
 
-	// 获取用户的所有代金券
-	User.prototype.getCouponList = function (callback) {
-		var that = this;
+  // 获取用户的所有代金券
+  User.prototype.getCouponList = function(callback){
+    var that = this;
 
-		api.getCouponList({
-			get_all: 1,
-			user_id: that.id
-		}, function (res) {
-			if (res.success) {
-				// 现有可用优惠券,按照面额降序排序;已经过期的优惠券,按照过期时间由近到远排序
-				var now = new Date().getTime() / 1000;
-				that.usable_coupons = res.data.useable_coupons;
-				that.used_coupons = res.data.used_coupons;
-				that.overtime_coupons = res.data.overtime_coupons;
+    api.getCouponList({
+      get_all: 1,
+      user_id: that.id
+    }, function(res) {
+      if (res.success) {
+        // 现有可用优惠券,按照面额降序排序;已经过期的优惠券,按照过期时间由近到远排序
+        var now = new Date().getTime() / 1000;
+        that.usable_coupons = res.data.useable_coupons;
+        that.used_coupons = res.data.used_coupons;
+        that.overtime_coupons = res.data.overtime_coupons;
 
-				that.usable_coupons.sort(function (a, b) {
-					return b.coupon.value - a.coupon.value;
-				});
+        that.usable_coupons.sort(function (a, b) {
+          return b.coupon.value - a.coupon.value;
+        });
 
-				that.used_coupons.sort(function (a, b) {
-					return a.end_time - b.end_time;
-				});
+        that.used_coupons.sort(function (a, b) {
+          return a.end_time - b.end_time;
+        });
 
-				that.overtime_coupons.sort(function (a, b) {
-					return a.end_time - b.end_time;
-				});
+        that.overtime_coupons.sort(function (a, b) {
+          return a.end_time - b.end_time;
+        });
 
-				that.usable_coupons.forEach(function (item, index) {
-					var isRemind = (item.end_time - now) / (60 * 60 * 24) <= 7;
-					item.isRemind = isRemind;
-				});
+        that.usable_coupons.forEach(function(item, index){
+          var isRemind = (item.end_time - now) / (60 * 60 * 24) <= 7;
+          item.isRemind = isRemind;
+        });
 
-				that.orderCoupons = that.usable_coupons.concat(that.used_coupons).concat(that.overtime_coupons);
-			}
+        that.orderCoupons = that.usable_coupons.concat(that.used_coupons).concat(that.overtime_coupons);
+      }
 
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	};
+      if (typeof(callback) == 'function') {
+        callback(res);
+      }
+    });
+  };
 
-	//兑换优惠券   api预先定义的函数
-	User.prototype.exchangeCoupon = function (couponCode, callback) {
-		var that = this;
+  //兑换优惠券   api预先定义的函数
+  User.prototype.exchangeCoupon = function(couponCode, callback){
+    var that = this;
 
-		api.exchangeCoupon({
-			user_id: that.id,
-			exchange_code: couponCode//兑换码--为优惠券编码
-		}, function (res) {
-			if (typeof(callback) == 'function') {
-				callback(res);//回调函数传回
-			}
-		});
-	};
+    api.exchangeCoupon({
+      user_id: that.id,
+      exchange_code: couponCode//兑换码--为优惠券编码
+    }, function(res) {
+      if (typeof(callback) == 'function') {
+        callback(res);//回调函数传回
+      }
+    });
+  };
 
-	//判断当前用户是否登录.没有则让其去登录
-	User.prototype.goLogin = function (callback) {
-		var that = this;
-		this.getUserInfo(function (res) {//在获取用户信息
-			if (that.id == '') {
-				native.login(function (resA) {//本地中读取是否存在登陆数据
-					loginWithData.call(that, resA);//调用登录数据
+  //判断当前用户是否登录.没有则让其去登录
+  User.prototype.goLogin = function(callback){
+    var that = this;
+    this.getUserInfo(function(res) {//在获取用户信息
+      if (that.id == '') {
+        native.login(function(resA) {//本地中读取是否存在登陆数据
+          loginWithData.call(that, resA);//调用登录数据
 
-					if (typeof(callback) == 'function') {//判断callback是否为函数,true让其回调
-						callback();
-					}
-				});
-			} else {
-				if (typeof(callback) == 'function') {
-					callback();
-				}
-			}
-		});
-	};
+          if (typeof(callback) == 'function') {//判断callback是否为函数,true让其回调
+            callback();
+          }
+        });
+      } else {
+        if (typeof(callback) == 'function') {
+          callback();
+        }
+      }
+    });
+  };
 
-	//是否检查登陆凭据是否存在
-	User.prototype.checkLogin = function (callback) {
-		var that = this;
-		if (this.id == '') {
-			this.goLogin(function () {
-				if (that.id != '' && typeof(callback) == 'function') {//用户ID是否为空并且callback是否为函数
-					callback();
-				}
-			});
-		} else {
-			if (typeof(callback) == 'function') {
-				callback();
-			}
-		}
-	};
+  //是否检查登陆凭据是否存在
+  User.prototype.checkLogin = function(callback){
+    var that = this;
+    if (this.id == '') {
+      this.goLogin(function() {
+        if (that.id != '' && typeof(callback) == 'function') {//用户ID是否为空并且callback是否为函数
+          callback();
+        }
+      });
+    } else {
+      if (typeof(callback) == 'function') {
+        callback();
+      }
+    }
+  };
 
-	//获取订单列表
-	User.prototype.getOrderList = function (userId, type, callback, more) {
-		var that = this;
-		var page = this.orders[type].page + 1;
-		if (!more) {
-			page = 1;
-		}
-		api.getMyOrderList({
-			user_id: userId,
-			type: type,
-			page: page
-		}, function (res) {
-			if (res.current_page >= res.sum_page) {//如果当前页订单大于等于总页数
-				res.current_page = res.sum_page;
-				that.orders[type].hasMore = false;
-			} else {
-				that.orders[type].hasMore = true;
-			}
-			that.orders[type].page = res.current_page;//当前网页
-			if (more) {
-				that.orders[type].data = that.orders[type].data.concat(res.data);//concat 2个数组
-			} else {
-				that.orders[type].data = res.data;
-			}
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	};
+  //获取订单列表
+  User.prototype.getOrderList = function(userId, type, callback, more){
+    var that = this;
+    var page = this.orders[type].page + 1;
+    if (!more) {
+      page = 1;
+    }
+    api.getMyOrderList({
+      user_id: userId,
+      type: type,
+      page: page
+    }, function(res) {
+      if (res.current_page >= res.sum_page) {//如果当前页订单大于等于总页数
+        res.current_page = res.sum_page;
+        that.orders[type].hasMore = false;
+      } else {
+        that.orders[type].hasMore = true;
+      }
+      that.orders[type].page = res.current_page;//当前网页
+      if (more) {
+        that.orders[type].data = that.orders[type].data.concat(res.data);//concat 2个数组
+      } else {
+        that.orders[type].data = res.data;
+      }
+      if (typeof(callback) == 'function') {
+        callback(res);
+      }
+    });
+  };
 
-	//订单明细
-	User.prototype.getOrderDetail = function (orderID, callback) {
-		var that = this;
-		api.getOrderDetail({
-			user_id: that.id,
-			order_id: orderID//订单ID为orderID
-		}, function (res) {
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	};
+  //订单明细
+  User.prototype.getOrderDetail = function(orderID, callback) {
+    var that = this;
+    api.getOrderDetail({
+      user_id: that.id,
+      order_id: orderID//订单ID为orderID
+    }, function(res) {
+      if (typeof(callback) == 'function') {
+        callback(res);
+      }
+    });
+  };
 
-	//订单信息
-	//遍历函数。将所有产生的订单信息赋值给orderInfo
-	User.prototype.getOrderInfo = function (orderID) {
-		var that = this;
-		var orderInfo = {};//数组
-		var orderList = this.orders[1].data;
-		orderList.forEach(function (e, i) {//遍历函数
-			if (e.id == orderID) {
-				orderInfo = e;
-			}
-		})
-		return orderInfo;
-	};
+  //订单信息
+  //遍历函数。将所有产生的订单信息赋值给orderInfo
+  User.prototype.getOrderInfo = function(orderID){
+    var that = this;
+    var orderInfo = {};//数组
+    var orderList = this.orders[1].data;
+    orderList.forEach(function(e, i) {//遍历函数
+      if (e.id == orderID ) {
+        orderInfo = e;
+      }
+    })
+    return orderInfo;
+  };
 
-	//退款单
-	User.prototype.refundOrder = function (orderID, callback) {
-		var that = this;
-		var from = '';
-		if (config.isChubao) from = 'chubao';
-		api.refundOrder({
-			order_id: orderID,
-			user_id: this.id,
-			from: from
-		}, function (res) {
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		})
-	};
+  //退款单
+  User.prototype.refundOrder = function(orderID, callback) {
+    var that = this;
+    var from = '';
+    if (config.isChubao) from = 'chubao';
+    api.refundOrder({
+      order_id: orderID,
+      user_id: this.id,
+      from: from
+    }, function(res){
+      if (typeof(callback) == 'function') {
+        callback(res);
+      }
+    })
+  };
 
-	//完成订单
-	User.prototype.finishOrder = function (orderID, callback) {
-		var that = this;
-		api.finishOrder({
-			order_id: orderID,
-			user_id: this.id
-		}, function (res) {
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		})
-	};
+  //完成订单
+  User.prototype.finishOrder = function(orderID, callback) {
+    var that = this;
+    api.finishOrder({
+      order_id: orderID,
+      user_id: this.id
+    }, function(res){
+      if (typeof(callback) == 'function') {
+        callback(res);
+      }
+    })
+  };
 
-	//取消订单
-	User.prototype.cancelOrder = function (orderID, callback) {
-		var that = this;
+  //取消订单
+  User.prototype.cancelOrder = function (orderID, callback) {
+    var that = this;
 
-		api.cancelOrder({
-			user_id: this.id,
-			order_id: orderID
-		}, function (res) {
-			if (res.success) {
-				// that.id = res.data.id;
-			}
-			if (typeof (callback) == 'function') {
-				callback(res);
-			}
-		})
-	};
+    api.cancelOrder({
+      user_id: this.id,
+      order_id: orderID
+    }, function (res) {
+      if (res.success) {
+        // that.id = res.data.id;
+      }
+      if (typeof (callback) == 'function') {
+        callback(res);
+      }
+    })
+  };
 
-	//获得技术列表
-	//serviceType-服务类型
-	//bookingTime-预订时间
-	//addressID-地址
-	User.prototype.getTechList = function (serviceType, bookingTime, addressID, callback) {
-		var that = this;
-		api.selectTech({
-			service_type: serviceType,
-			booking_time: bookingTime,
-			address_id: addressID,
-			user_id: that.id
-		}, function (res) {
-			if (res.success) {
-				that.selectTech.can = res.data.can_select_tech;//可选择技术
-				that.selectTech.match = res.data.service_match_tech;//服务匹配技术
-			}
-			if (typeof (callback) == 'function') {
-				callback(res);
-			}
-		})
-	};
+  //获得技术列表
+  //serviceType-服务类型
+  //bookingTime-预订时间
+  //addressID-地址
+  User.prototype.getTechList = function (serviceType, bookingTime, addressID, callback) {
+    var that = this;
+    api.selectTech({
+      service_type: serviceType,
+      booking_time: bookingTime,
+      address_id: addressID,
+      user_id: that.id
+    }, function (res) {
+      if (res.success) {
+        that.selectTech.can = res.data.can_select_tech;//可选择技术
+        that.selectTech.match = res.data.service_match_tech;//服务匹配技术
+      }
+      if (typeof (callback) == 'function') {
+        callback(res);
+      }
+    })
+  };
 
 
-	//登录数据
-	function loginWithData(res) {
-		if (res.success) {
-			var userData = res.data;
-			if (userData.id) {
-				this.id = userData.id;
-				this.name = userData.user_name;
-				this.mobile = userData.mobile;
-				this.avatar = userData.avatar;
-				this.openId = userData.openid;
-				this.info = userData;
-				this.balance = userData.balance;
-				this.wx_pub_openid = userData.wx_pub_openid;
-				if ((config.isAndroid || config.isIOS) && this.lastID != this.id) {
-					//换用户了,清掉地址信息
-					order.set('address', null, true);
-				}
-				this.set('lastID', this.id);
-			}
-		}
-	}
+  //登录数据
+  function loginWithData(res){
+    if (res.success) {
+      var userData = res.data;
+      if (userData.id) {
+        this.id = userData.id;
+        this.name = userData.user_name;
+        this.mobile = userData.mobile;
+        this.openId = userData.openid;
+        this.info = userData;
+        this.balance = userData.balance;
+        this.wx_pub_openid = userData.wx_pub_openid;
+        if ((config.isAndroid || config.isIOS) && this.lastID != this.id) {
+          //换用户了,清掉地址信息
+          order.set('address', null, true);
+        }
+        this.set('lastID', this.id);
+      }
+    }
+  }
 
-	return new User();//new User函数
+  return new User();//new User函数
 })

+ 0 - 119
www/webapp/o2o/js/page/activities/day.js

@@ -1,119 +0,0 @@
-define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user','product'], function ($, template, IScroll, recharge, native, config, user,product) {
-
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
-
-	return {
-		title: '企业服务',
-		body: '',
-		init: function (pageData, dtd) {
-			/* this是什么? */
-			var $view = this;
-			var $doc = $(document);
-
-			/* 定义按钮事件。
-			 * 为什么不是$(selector).onclick(function)呢?
-			 */
-
-			// 返回
-			$view.on('swipeRight', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			});
-
-			$.newTouch('.back-button', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			}, $view);
-
-			$view.on('tapBackButton', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			});
-			//跳转下单页面
-			$.newTouch('.btn-appliances', function (event) {
-				event.preventDefault();
-				var type = parseInt($(this).attr('data-product-type'));
-				$doc.trigger('spa:navigate', {
-					hash: 'placeOrder',
-					pushData: {
-						product: product.allList[type - 1],
-						needReset: true
-					}
-				});
-			}, $view);
-			// 双十一活动
-			$.newTouch('.btn-home-day', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'activity-day',
-					pushData: {
-						needReset: true
-					}
-				});
-			}, $view);
-			//优惠券
-			$.newTouch('.btn-banner-coupon', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'myCoupon',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-			//充值卡
-			$.newTouch('.btn-banner-recharge', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'recharge',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-
-			if (!pageData.pushData.dontNeedReload) {
-				$doc.trigger('spa:openloader');
-				recharge.getRechargeList(function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						var tpl = template('activities/day', {
-							showNavBar: !config.isWX,
-							recharges: res.data
-						});
-						$('.spa-page-body', $view).html(tpl);
-						//var value = $(this).attr('data-value');
-						var value = $('.btn-add-recharge').attr('data-index');
-						for (var i = value; i < 2; i++) {
-						}
-						setTimeout(function () {
-							pageData.scroll = new IScroll('#homeenterpriseScroll');
-						}, 500);
-					}
-				});
-			}
-
-			dtd.resolve();
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-		}
-	}
-})

+ 242 - 349
www/webapp/o2o/js/page/home.js

@@ -1,376 +1,269 @@
 define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'address'], function ($, template, IScroll, product, user, native, config, address) {
 
-	/*
-	 * 先定义一些模块内用到的function
-	 */
-	function back(event) {
-		event.preventDefault();
-		native.back();
-	}
+    /*
+     * 先定义一些模块内用到的function
+     */
+    function back(event) {
+        event.preventDefault();
+        native.back();
+    }
 
-	/*
-	 * 模块结构:5部分。
-	 * title:题目。
-	 * content:不知道是什么,似乎从没用过。
-	 * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
-	 * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
-	 * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
-	 * afteropen:做一些网络请求。
-	 * beforeclose:
-	 */
-	return {
-		title: '壹管家上门服务',
-		body: '',
-		init: function (pageData, dtd) {
-			/* this是什么? */
-			var $view = this;
-			var $doc = $(document);
-			/*提示信息*/
+    /*
+     * 模块结构:5部分。
+     * title:题目。
+     * content:不知道是什么,似乎从没用过。
+     * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
+     * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
+     * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
+     * afteropen:做一些网络请求。
+     * beforeclose:
+     */
+    return {
+        title: '壹管家上门服务',
+        body: '',
+        init: function (pageData, dtd) {
+            /* this是什么? */
+            var $view = this;
+            var $doc = $(document);
 
+            /* 定义按钮事件。
+             * 为什么不是$(selector).onclick(function)呢?
+             */
 
-			/* 定义按钮事件。
-			 * 为什么不是$(selector).onclick(function)呢?
-			 */
+            //返回
+            $.newTouch('.back-button', function (event) {
+                back.call(this, event);
+            }, $view);
 
-			//返回
-			$.newTouch('.back-button', function (event) {
-				back.call(this, event);
-			}, $view);
+            $view.on('tapBackButton', function (event) {
+                back.call(this, event);
+            });
 
-			$view.on('tapBackButton', function (event) {
-				back.call(this, event);
-			});
+            //客服电话
+            $.newTouch('.service-telephone', function (event) {
+                event.preventDefault();
 
-			//客服电话
-			$.newTouch('.service-telephone', function (event) {
-				event.preventDefault();
+                native.call('4000328170');
+            }, $view);
+            //点击banner-1进入充值卡页
+            $.newTouch('.btn-banner-recharge', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'recharge',
+                    pushData: {
+                        needReload: true
+                    }
+                });
+            }, $view);
+            //点击banner-2进入充值卡页面
+            $.newTouch('.btn-banner-coupon', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'myCoupon',
+                    pushData: {
+                        needReload: true
+                    }
+                });
+            }, $view);
+            /* 点击产品列表的某一项 */
+            $.newTouch('.btn-product', function (event) {
+                event.preventDefault();
+                var type = parseInt($(this).attr('data-product-type'));
+                /*
+                 * 这个写法是SPA路由框架规定的。
+                 * $(selector).trigger(event, params)是jQuery的:触发被选元素上的指定事件
+                 */
+                $doc.trigger('spa:navigate', {
+                    hash: 'placeOrder',
+                    pushData: {
+                        product: product.allList[type - 1],
+                        needReset: true
+                    }
+                });
+            }, $view);
 
-				native.call('4000328170');
-			}, $view);
-			//加载弹框
-			setTimeout(function () {
-				$('.swiper-container').height($('.swiper-container img').height());
-				$('.pagination').css('bottom', '0.15rem');
-			}, 200);
-			/*setTimeout(function () {
-				$doc.trigger('spa:openpanel', ['simpleAlert', {
-					message: '您已获得双十一大礼包',
-					// title: '系统通知',
-					// html: '您已获得双十一大礼包',
-					buttons: [{text: '查看', class: 'btn-o2o-home btn-o2o-home-2'}, {text: '关闭', class: 'btn-o2o-home'}]
-				}]);
+            /* 点击标签
+             $.newTouch('.btn-product-group', function (event) {
+             event.preventDefault();
+             if ($(this).hasClass('global-msg-active')) return;
+             $(this).addClass('global-msg-active').siblings().removeClass('global-msg-active');
+             var index = $(this).attr('data-group-index');
+             switch (index){
+             case '0':
+             $('#list0').show().siblings().hide();
+             break;
+             case '1':
+             $('#list1').show().siblings().hide();
+             break;
+             case '2':
+             $('#list2').show().siblings().hide();
+             break;
+             case '3':
+             $('#list3').show().siblings().hide();
+             break;
+             }
+             }, $view);  */
 
-			}, 1000);*/
-			$.newTouch('.btn-o2o-home', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'myCoupon',
-					pushData: {
-						needReload: true
-					}
-				});
-				console.log('测试')
-			}, $view);
-			//充值卡
-			$.newTouch('.btn-banner-recharge', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'recharge',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-			//优惠券
-			$.newTouch('.btn-banner-coupon', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'myCoupon',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-			
-			/* 点击产品列表的某一项 */
-			$.newTouch('.btn-appliances', function (event) {
-				event.preventDefault();
-				// var type = 4;
-				var type = parseInt($(this).attr('data-product-type'));
-				/*
-				 * 这个写法是SPA路由框架规定的。
-				 * $(selector).trigger(event, params)是jQuery的:触发被选元素上的指定事件
-				 */
-				$doc.trigger('spa:navigate', {
-					hash: 'placeOrder',
-					pushData: {
-						product: product.allList[type - 1],
-						needReset: true
-					}
-				});
-			}, $view);
+            // 点击……不知如何说明……
+            $.newTouch('.btn-action-my-order', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: ''
+                });
+            }, $view);
 
-			/* 点击标签
-			 $.newTouch('.btn-product-group', function (event) {
-			 event.preventDefault();
-			 if ($(this).hasClass('global-msg-active')) return;
-			 $(this).addClass('global-msg-active').siblings().removeClass('global-msg-active');
-			 var index = $(this).attr('data-group-index');
-			 switch (index){
-			 case '0':
-			 $('#list0').show().siblings().hide();
-			 break;
-			 case '1':
-			 $('#list1').show().siblings().hide();
-			 break;
-			 case '2':
-			 $('#list2').show().siblings().hide();
-			 break;
-			 case '3':
-			 $('#list3').show().siblings().hide();
-			 break;
-			 }
-			 }, $view);  */
+            // 个人中心
+            $.newTouch('.btn-action-coupon', function (event) {
+                event.preventDefault();
+                user.checkLogin(function () {
+                    $doc.trigger('spa:navigate', {
+                        hash: 'mine',
+                        pushData: {
+                            needReset: true
+                        }
+                    });
+                });
+            }, $view);
 
-			// 家庭保洁
-			$.newTouch('.btn-secondary', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'secondary',
-					pushData: {
-						needReset: true
-					}
-				});
-			}, $view);
-			/* 点击产品列表的某一项 */
-			$.newTouch('.btn-appliances', function (event) {
-				event.preventDefault();
-				// var type = 4;
-				var type = parseInt($(this).attr('data-product-type'));
-				/*
-				 * 这个写法是SPA路由框架规定的。
-				 * $(selector).trigger(event, params)是jQuery的:触发被选元素上的指定事件
-				 */
-				$doc.trigger('spa:navigate', {
-					hash: 'placeOrder',
-					pushData: {
-						product: product.allList[type - 1],
-						needReset: true
-					}
-				});
-			}, $view);
+            /* 招聘
+             $.newTouch('.btn-action-hire', function () {
+             event.preventDefault();
+             $doc.trigger('spa:navigate', {
+             hash: 'hire'
+             });
+             }, $view); */
 
-			/* 点击标签
-			 $.newTouch('.btn-product-group', function (event) {
-			 event.preventDefault();
-			 if ($(this).hasClass('global-msg-active')) return;
-			 $(this).addClass('global-msg-active').siblings().removeClass('global-msg-active');
-			 var index = $(this).attr('data-group-index');
-			 switch (index){
-			 case '0':
-			 $('#list0').show().siblings().hide();
-			 break;
-			 case '1':
-			 $('#list1').show().siblings().hide();
-			 break;
-			 case '2':
-			 $('#list2').show().siblings().hide();
-			 break;
-			 case '3':
-			 $('#list3').show().siblings().hide();
-			 break;
-			 }
-			 }, $view);  */
+            /* 不知道什么意思。*/
+            dtd.resolve();
 
-			// 双十一活动
-			$.newTouch('.btn-home-day', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'activity-day',
-					pushData: {
-						needReset: true
-					}
-				});
-			}, $view);
-			// 民宿保洁
-			$.newTouch('.btn-homestay', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'homestay',
-					pushData: {
-						needReset: true
-					}
-				});
-			}, $view);
-			// 企业服务
-			$.newTouch('.btn-homeenterprise', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'homeenterprise',
-					pushData: {
-						needReset: true
-					}
-				});
-			}, $view);
+            /* 跳转到填写订单页面
+             function goProductPage(type) {
+             如果没登陆会跳转到登录。这个function参数是登陆成功的回调
+             user.checkLogin(function () {
+             预期字段不足 先清除本地数据
+             if (!user['productVisit'][13]) {
+             localStorage.removeItem('user_productVisit');
+             localStorage.removeItem('user_productVisit-time');
+             user['productVisit'][13] = {
+             visited: false
+             }
+             }
+             判断是否是第一次看这个类型。如果不是的话跳转到placeOrder页面
+             if (user['productVisit'][type]['visited']) {
 
-			// 个人中心
-			$.newTouch('.btn-action-coupon', function (event) {
-				event.preventDefault();
-				user.checkLogin(function () {
-					$doc.trigger('spa:navigate', {
-						hash: 'mine',
-						pushData: {
-							needReset: true
-						}
-					});
-				});
-			}, $view);
+             } else {
+             如果是的话跳转到product页面
+             $doc.trigger('spa:navigate', {
+             hash: 'product',
+             pushData: {
+             type: type,
+             needReload: true,
+             fromHome: true
+             }
+             });
+             并把这个类别的visit属性设置为true
+             user.productVisit[type].visited = true;
+             user.setCache('productVisit');
+             }
+             // });
+             } */
 
-			/* 招聘
-			 $.newTouch('.btn-action-hire', function () {
-			 event.preventDefault();
-			 $doc.trigger('spa:navigate', {
-			 hash: 'hire'
-			 });
-			 }, $view); */
+            /* 跳转到coming页面。
+             function goComing(type) {
+             user.checkLogin(function () {
+             $doc.trigger('spa:navigate', {
+             hash: 'coming',
+             pushData: {
+             productType: type
+             }
+             });
+             });
+             }*/
 
-			/* 不知道什么意思。*/
-			dtd.resolve();
+            /* 不知道这是干什么。离线显示一张图片?
+             if (!user.activities['visited_offservice0126']) {
+             // showActivity();
+             }
+             function showActivity() {
+             var imgUrl = 'http://wozhua-others.qiniudn.com/20160126-offservice.png';
+             var d = new Image();
+             d.src = imgUrl;
+             d.onload = function () {
+             $doc.trigger('spa:openpanel', ['activity', {
+             content: imgUrl
+             }]);
+             }
+             } */
+        },
+        beforeopen: function (pageData, dtd) {
+            localStorage.removeItem('cart_products');
+            dtd.resolve();
+            native.switchPopGesture(true);
+        },
+        afteropen: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
 
-			/* 跳转到填写订单页面
-			 function goProductPage(type) {
-			 如果没登陆会跳转到登录。这个function参数是登陆成功的回调
-			 user.checkLogin(function () {
-			 预期字段不足 先清除本地数据
-			 if (!user['productVisit'][13]) {
-			 localStorage.removeItem('user_productVisit');
-			 localStorage.removeItem('user_productVisit-time');
-			 user['productVisit'][13] = {
-			 visited: false
-			 }
-			 }
-			 判断是否是第一次看这个类型。如果不是的话跳转到placeOrder页面
-			 if (user['productVisit'][type]['visited']) {
+            /* 如果需要重新加载,就请求服务列表。 */
+            if (!pageData.pushData.dontNeedReload) {
+                $doc.trigger('spa:openloader');
 
-			 } else {
-			 如果是的话跳转到product页面
-			 $doc.trigger('spa:navigate', {
-			 hash: 'product',
-			 pushData: {
-			 type: type,
-			 needReload: true,
-			 fromHome: true
-			 }
-			 });
-			 并把这个类别的visit属性设置为true
-			 user.productVisit[type].visited = true;
-			 user.setCache('productVisit');
-			 }
-			 // });
-			 } */
+                /*
+                 * tmodjs:
+                 * 使用模版语法把数据填到html文件,生成一个js文件。
+                 * var tpl = template(html文件路径,数据)
+                 */
+                var tpl = template('home/index', {
+                    showNavBar: !config.isWX && !config.isChubao
+                });
 
-			/* 跳转到coming页面。
-			 function goComing(type) {
-			 user.checkLogin(function () {
-			 $doc.trigger('spa:navigate', {
-			 hash: 'coming',
-			 pushData: {
-			 productType: type
-			 }
-			 });
-			 });
-			 }*/
+                /*
+                 * jQuery:
+                 * 提供一个html元素到js变量的映射,和findViewById一个作用。
+                 * $(selector).???(xxx)
+                 * 其中selector是选择器,对应html的元素、类、id等
+                 * ???是jQuery定义的事件
+                 * xxx是参数,具体是什么取决于事件
+                 *
+                 * 这句的意思是,选取class=".spa-page-body"的元素,把tpl插入其中
+                 */
+                $('.spa-page-body', $view).html(tpl);
 
-			/* 不知道这是干什么。离线显示一张图片?
-			 if (!user.activities['visited_offservice0126']) {
-			 // showActivity();
-			 }
-			 function showActivity() {
-			 var imgUrl = 'http://wozhua-others.qiniudn.com/20160126-offservice.png';
-			 var d = new Image();
-			 d.src = imgUrl;
-			 d.onload = function () {
-			 $doc.trigger('spa:openpanel', ['activity', {
-			 content: imgUrl
-			 }]);
-			 }
-			 } */
-		},
-		beforeopen: function (pageData, dtd) {
-			localStorage.removeItem('cart_products');
-			dtd.resolve();
-			native.switchPopGesture(true);
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
+                /* 建立IScroll */
+                setTimeout(function () {
+                    pageData.scroll = new IScroll('#homeScroll');
+                    var swiper = new Swiper('.swiper-container', {
+                        pagination: '.swiper-pagination',
+                        nextButton: '.swiper-button-next',
+                        prevButton: '.swiper-button-prev',
+                        paginationClickable: true,
+                        spaceBetween: 30,
+                        centeredSlides: true,
+                        autoplay: 1500,
+                        autoplayDisableOnInteraction: false
+                    });
+                }, 500);
 
-			/* 如果需要重新加载,就请求服务列表。 */
-			if (!pageData.pushData.dontNeedReload) {
-				$doc.trigger('spa:openloader');
+                // 目前的作用只是供后端判断,该用户是否为新用户,所以没有回调。
+                product.getListAll(user.id);
 
-				/*
-				 * tmodjs:
-				 * 使用模版语法把数据填到html文件,生成一个js文件。
-				 * var tpl = template(html文件路径,数据)
-				 */
-				var tpl = template('home/index', {
-					showNavBar: !config.isWX && !config.isChubao
-				});
+                address.getList({
+                    request_from: 'weixin',
+                    user_id: user.id
+                });
 
-				/*
-				 * jQuery:
-				 * 提供一个html元素到js变量的映射,和findViewById一个作用。
-				 * $(selector).???(xxx)
-				 * 其中selector是选择器,对应html的元素、类、id等
-				 * ???是jQuery定义的事件
-				 * xxx是参数,具体是什么取决于事件
-				 *
-				 * 这句的意思是,选取class=".spa-page-body"的元素,把tpl插入其中
-				 */
-				$('.spa-page-body', $view).html(tpl);
+                $doc.trigger('spa:closeloader');
+            }
 
-				/* 建立IScroll */
-				setTimeout(function () {
-					pageData.scroll = new IScroll('#homeScroll');
-					var swiper = new Swiper('.swiper-container', {
-						/*	paginationClickable: true,
-						 pagination: '.pagination',
-						 spaceBetween: 30,
-						 centeredSlides: true,
-						 autoplay: 1500,
-						 autoplayDisableOnInteraction: false*/
-						pagination: '.pagination',
-						loop: true,
-						paginationClickable: true,
-						centeredSlides: true,
-						autoplay: 5000,
-						autoplayDisableOnInteraction: false
-					});
-					// $('.swiper-container').height($('.swiper-container img').height());
+            /* 又是这个。不知道什么玩意…… */
+            dtd.resolve();
 
-				}, 20);
-
-				// 目前的作用只是供后端判断,该用户是否为新用户,所以没有回调。
-				product.getListAll(user.id);
-
-				address.getList({
-					request_from: 'weixin',
-					user_id: user.id
-				});
-
-				$doc.trigger('spa:closeloader');
-			}
-
-			/* 又是这个。不知道什么玩意…… */
-			dtd.resolve();
-
-			//强制设置首页的上一页是空的,后面再调整框架
-			pageData.prevPage = $('.spa-page-empty');
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-			native.switchPopGesture(false);
-		}
-	}
+            //强制设置首页的上一页是空的,后面再调整框架
+            pageData.prevPage = $('.spa-page-empty');
+        },
+        beforeclose: function (pageData, dtd) {
+            dtd.resolve();
+            native.switchPopGesture(false);
+        }
+    }
 })

+ 0 - 83
www/webapp/o2o/js/page/homeenterprise.js

@@ -1,83 +0,0 @@
-define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user'], function ($, template, IScroll, recharge, native, config, user) {
-
-    function back(event) {
-        event.preventDefault();
-        $(document).trigger('spa:navigate', {
-            hash: '',
-            pushData: {
-                dontNeedReload: true
-            }
-        });
-    }
-
-    return {
-        title: '企业服务',
-        body: '',
-        init: function (pageData, dtd) {
-            /* this是什么? */
-            var $view = this;
-            var $doc = $(document);
-
-            /* 定义按钮事件。
-             * 为什么不是$(selector).onclick(function)呢?
-             */
-
-            // 返回
-            $view.on('swipeRight', function (event) {
-                //back.call(this, event);
-                history.go(-1);
-            });
-
-            $.newTouch('.back-button', function (event) {
-                //back.call(this, event);
-                history.go(-1);
-            }, $view);
-
-            $view.on('tapBackButton', function (event) {
-                //back.call(this, event);
-                history.go(-1);
-            });
-            $.newTouch('.o2o-btn-homestay',function (event) {
-                event.preventDefault();
-                window.location.href='/index.php?r=common/activity/Enterprise';
-                // window.location.href='http://commontest.yiguanjia.me/index.php?r=common/activity/Enterprise';
-                // console.log('测试')
-            },$view);
-
-            dtd.resolve();
-        },
-        beforeopen: function (pageData, dtd) {
-            dtd.resolve();
-        },
-        afteropen: function (pageData, dtd) {
-            var $view = this;
-            var $doc = $(document);
-
-            if (!pageData.pushData.dontNeedReload) {
-                $doc.trigger('spa:openloader');
-                recharge.getRechargeList(function (res) {
-                    $doc.trigger('spa:closeloader');
-                    if (res.success) {
-                        var tpl = template('homeenterprise/index', {
-                            showNavBar: !config.isWX,
-                            recharges: res.data
-                        });
-                        $('.spa-page-body', $view).html(tpl);
-                        //var value = $(this).attr('data-value');
-                        var value = $('.btn-add-recharge').attr('data-index');
-                        for (var i = value; i < 2; i++) {
-                        }
-                        setTimeout(function () {
-                            pageData.scroll = new IScroll('#homeenterpriseScroll');
-                        }, 500);
-                    }
-                });
-            }
-
-            dtd.resolve();
-        },
-        beforeclose: function (pageData, dtd) {
-            dtd.resolve();
-        }
-    }
-})

+ 0 - 190
www/webapp/o2o/js/page/homestay.js

@@ -1,190 +0,0 @@
-/*
-define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'address'], function ($, template, IScroll, user, product, native, config, address) {
-
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
-
-	/!*
-	 * 模块结构:5部分。
-	 * title:题目。
-	 * content:不知道是什么,似乎从没用过。
-	 * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
-	 * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
-	 * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
-	 * afteropen:做一些网络请求。
-	 * beforeclose:
-	 *!/
-	return {
-		title: '家庭保洁',
-		body: '',
-		init: function (pageData, dtd) {
-			/!* this是什么? *!/
-			var $view = this;
-			var $doc = $(document);
-
-			/!* 定义按钮事件。
-			 * 为什么不是$(selector).onclick(function)呢?
-			 *!/
-
-			// 返回
-			$view.on('swipeRight', function (event) {
-				back.call(this, event);
-			});
-
-			$.newTouch('.back-button', function (event) {
-				back.call(this, event);
-			}, $view);
-
-			$view.on('tapBackButton', function (event) {
-				back.call(this, event);
-			});
-			$.newTouch('.o2o-btn-homestay',function (event) {
-				event.preventDefault();
-				window.location.href='/index.php?r=common/activity/SinglesDay';
-				// console.log('测试')
-			},$view);
-			
-
-			/!* 点击产品列表的某一项 *!/
-			$.newTouch('.btn-product', function (event) {
-				event.preventDefault();
-				var type = parseInt($(this).attr('data-product-type'));
-				/!*
-				 * 这个写法是SPA路由框架规定的。
-				 * $(selector).trigger(event, params)是jQuery的:触发被选元素上的指定事件
-				 *!/
-				$doc.trigger('spa:navigate', {
-					hash: 'placeOrder',
-					pushData: {
-						product: product.allList[type - 1],
-						needReset: true
-					}
-				});
-			}, $view);
-			/!*首页*!/
-			$.newTouch('.btn-action-my-order', function () {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: '',
-					pushData: {
-						needReset: true
-					}
-				});
-			},$view);
-			/!*个人中心*!/
-			$.newTouch('.btn-action-coupon', function (event) {
-				event.preventDefault();
-				user.checkLogin(function () {
-					$doc.trigger('spa:navigate', {
-						hash: 'mine',
-						pushData: {
-							needReset: true
-						}
-					});
-				});
-			}, $view);
-			/!* 不知道什么意思。*!/
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-
-			if (pageData.pushData && pageData.pushData.needReset) {
-				var tpl = template('homestay/index', {showNavBar: !config.isWX});
-				$('.spa-page-body', $view).html(tpl);
-				setTimeout(function () {
-					pageData.scroll = new IScroll('#homestayScroll');
-				}, 500);
-			}
-
-			/!* 又是这个。不知道什么玩意…… *!/
-			dtd.resolve();
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-		}
-	}
-})*/
-
-
-define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user'], function ($, template, IScroll, recharge, native, config, user) {
-
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
-
-	return {
-		title: '民宿保洁',
-		body: '',
-		init: function (pageData, dtd) {
-			/* this是什么? */
-			var $view = this;
-			var $doc = $(document);
-			// 返回
-			$view.on('swipeRight', function (event) {
-				history.go(-1);
-			});
-			$.newTouch('.back-button', function (event) {
-				history.go(-1);
-			}, $view);
-			$view.on('tapBackButton', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			});
-			$.newTouch('.o2o-btn-homestay',function (event) {
-				event.preventDefault();
-				window.location.href='/index.php?r=common/activity/SinglesDay';
-				// console.log('测试')
-			},$view);
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-			if (!pageData.pushData.dontNeedReload) {
-				$doc.trigger('spa:openloader');
-				recharge.getRechargeList(function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						var tpl = template('homestay/index', {
-							showNavBar: !config.isWX,
-							recharges: res.data
-						});
-						$('.spa-page-body', $view).html(tpl);
-						//var value = $(this).attr('data-value');
-						var value = $('.btn-add-recharge').attr('data-index');
-						for (var i = value; i < 2; i++) {
-						}
-						setTimeout(function () {
-							pageData.scroll = new IScroll('#homestayScroll');
-						}, 500);
-					}
-				});
-			}
-			dtd.resolve();
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-		}
-	}
-})

+ 166 - 168
www/webapp/o2o/js/page/mine.js

@@ -1,169 +1,167 @@
-define(['$', 'template', 'IScroll', 'user', 'native', 'config', 'address', 'product', 'review'], function ($, template, IScroll, user, native, config, address, product, review) {
-
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
-
-	/*
-	 * 模块结构:5部分。
-	 * title:题目。
-	 * content:不知道是什么,似乎从没用过。
-	 * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
-	 * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
-	 * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
-	 * afteropen:做一些网络请求。
-	 * beforeclose:
-	 */
-	return {
-		title: '我的',
-		body: '',
-		init: function (pageData, dtd) {
-			/* this是什么? */
-			var $view = this;
-			var $doc = $(document);
-
-			/* 定义按钮事件。
-			 * 为什么不是$(selector).onclick(function)呢?
-			 */
-
-			// 返回
-			$view.on('swipeRight', function (event) {
-				back.call(this, event);
-			});
-
-			$.newTouch('.back-button', function (event) {
-				back.call(this, event);
-			}, $view);
-
-			$view.on('tapBackButton', function (event) {
-				back.call(this, event);
-			});
-
-			// 我的订单
-			$.newTouch('.btn-my-order', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'myOrder/1',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-
-			// 常用地址
-			$.newTouch('.btn-address-list', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'addressList',
-					pushData: {
-						backHash: 'mine'
-					},
-					callback: {
-						/* 在addressList页面挑选之后,回到这个页面时执行的回调。 */
-						onSelect: function (address, station) {
-							var addressStr = '';
-							if (address.address.poi) {
-								addressStr = address.address.city + address.address.area + address.address.poi.name + address.address.detail
-							} else {
-								addressStr = address.address.province + address.address.city + address.address.area + address.address.detail
-							}
-							$('#default-address', $view).text(addressStr);
-						}
-					}
-				});
-			}, $view);
-
-			// 充值卡
-			$.newTouch('.btn-recharge', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'recharge',
-					pushData: {
-						needReload: true
-					}
-				});
-			}, $view);
-
-			// 代金券
-			$.newTouch('.btn-coupon', function (event) {
-				event.preventDefault();
-				user.checkLogin(function () {
-					$doc.trigger('spa:navigate', {
-						hash: 'myCoupon'
-					});
-				});
-			}, $view);
-
-			// 帮助中心
-			$.newTouch('.btn-helper', function () {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'help'
-				});
-			}, $view);
-
-			// 关于
-			$.newTouch('.btn-about', function () {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: 'about'
-				});
-			}, $view);
-			//首页
-			$.newTouch('.btn-action-my-order', function () {
-				event.preventDefault();
-				$doc.trigger('spa:navigate', {
-					hash: ''
-				});
-			}, $view);
-
-			/* 定义按钮事件结束。*/
-
-			/* 不知道什么意思。*/
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-
-			if (pageData.pushData && pageData.pushData.needReset) {
-				var addressStr = '';
-				var defaultAddress = address.defaultAddress;
-				if (defaultAddress && defaultAddress.address && defaultAddress.address.poi) {
-					addressStr = defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.poi.name + defaultAddress.address.detail
-				} else if (defaultAddress && defaultAddress.address) {
-					addressStr = defaultAddress.address.province + defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.detail
-				}
-
-				var tpl = template('mine/index', {
-					showNavBar: !config.isWX,
-					userName: user.name == '' ? '未登录' : user.name,
-					userBalance: user.balance,
-					userAvatar:user.avatar,
-					defaultAddress: addressStr
-				});
-
-				$('.spa-page-body', $view).html(tpl);
-
-				setTimeout(function () {
-					pageData.scroll = new IScroll('#mineScroll');
-				}, 500);
-			}
-
-			/* 又是这个。不知道什么玩意…… */
-			dtd.resolve();
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-		}
-	}
+define(['$', 'template', 'IScroll', 'user', 'native', 'config', 'address'], function ($, template, IScroll, user, native, config, address) {
+
+    function back(event) {
+        event.preventDefault();
+        $(document).trigger('spa:navigate', {
+            hash: '',
+            pushData: {
+                dontNeedReload: true
+            }
+        });
+    }
+
+    /*
+     * 模块结构:5部分。
+     * title:题目。
+     * content:不知道是什么,似乎从没用过。
+     * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
+     * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
+     * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
+     * afteropen:做一些网络请求。
+     * beforeclose:
+     */
+    return {
+        title: '我的',
+        body: '',
+        init: function (pageData, dtd) {
+            /* this是什么? */
+            var $view = this;
+            var $doc = $(document);
+
+            /* 定义按钮事件。
+             * 为什么不是$(selector).onclick(function)呢?
+             */
+
+            // 返回
+            $view.on('swipeRight', function (event) {
+                back.call(this, event);
+            });
+
+            $.newTouch('.back-button', function (event) {
+                back.call(this, event);
+            }, $view);
+
+            $view.on('tapBackButton', function (event) {
+                back.call(this, event);
+            });
+
+            // 我的订单
+            $.newTouch('.btn-my-order', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'myOrder/1',
+                    pushData: {
+                        needReload: true
+                    }
+                });
+            }, $view);
+
+            // 常用地址
+            $.newTouch('.btn-address-list', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'addressList',
+                    pushData: {
+                        backHash: 'mine'
+                    },
+                    callback: {
+                        /* 在addressList页面挑选之后,回到这个页面时执行的回调。 */
+                        onSelect: function (address, station) {
+                            var addressStr = '';
+                            if (address.address.poi) {
+                                addressStr = address.address.city + address.address.area + address.address.poi.name + address.address.detail
+                            } else {
+                                addressStr = address.address.province + address.address.city + address.address.area + address.address.detail
+                            }
+                            $('#default-address', $view).text(addressStr);
+                        }
+                    }
+                });
+            }, $view);
+
+            // 充值卡
+            $.newTouch('.btn-recharge', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'recharge',
+                    pushData: {
+                        needReload: true
+                    }
+                });
+            }, $view);
+
+            // 代金券
+            $.newTouch('.btn-coupon', function (event) {
+                event.preventDefault();
+                user.checkLogin(function () {
+                    $doc.trigger('spa:navigate', {
+                        hash: 'myCoupon'
+                    });
+                });
+            }, $view);
+
+            // 帮助中心
+            $.newTouch('.btn-helper', function () {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'help'
+                });
+            }, $view);
+
+            // 关于
+            $.newTouch('.btn-about', function () {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: 'about'
+                });
+            }, $view);
+            //首页
+            $.newTouch('.btn-action-my-order', function () {
+                event.preventDefault();
+                $doc.trigger('spa:navigate', {
+                    hash: ''
+                });
+            }, $view);
+
+            /* 定义按钮事件结束。*/
+
+            /* 不知道什么意思。*/
+            dtd.resolve();
+        },
+        beforeopen: function (pageData, dtd) {
+            dtd.resolve();
+        },
+        afteropen: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
+
+            if (pageData.pushData && pageData.pushData.needReset) {
+                var addressStr = '';
+                var defaultAddress = address.defaultAddress;
+                if (defaultAddress && defaultAddress.address && defaultAddress.address.poi) {
+                    addressStr = defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.poi.name + defaultAddress.address.detail
+                } else if (defaultAddress && defaultAddress.address) {
+                    addressStr = defaultAddress.address.province + defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.detail
+                }
+
+                var tpl = template('mine/index', {
+                    showNavBar: !config.isWX,
+                    userName: user.name == '' ? '未登录' : user.name,
+                    userBalance: user.balance,
+                    defaultAddress: addressStr
+                });
+                $('.spa-page-body', $view).html(tpl);
+
+                setTimeout(function () {
+                    pageData.scroll = new IScroll('#mineScroll');
+                }, 500);
+            }
+
+            /* 又是这个。不知道什么玩意…… */
+            dtd.resolve();
+        },
+        beforeclose: function (pageData, dtd) {
+            dtd.resolve();
+        }
+    }
 })

+ 929 - 939
www/webapp/o2o/js/page/placeOrder.js

@@ -1,941 +1,931 @@
 define(['$', 'template', 'order', 'native', 'helper', 'user', 'api', 'config', 'address', 'IScroll'], function ($, template, order, native, helper, user, api, config, address, IScroll) {
 
-	/*
-	 * 这里对product和order做一个说明。
-	 * product前台写死。order沿用原模型,但只用其中几个字段。
-	 * 对应关系如下:
-	 * product.id == order.productID :产品ID
-	 * product.type == order.productType :产品类型,约定的数字
-	 * product.price == order.cost :订单原价,当product的extra字段为空
-	 * product.extra.price == order.cost :订单原价,当product的extra字段不为空
-	 * product.type_str == order.serviceName :服务名称
-	 * product.extra.type == order.appendID :服务的额外选项,当product的extra字段不为空
-	 */
-
-	/* 从首页传来的产品数据 */
-	var product;
-
-	/* 软键盘弹出与消失时布局变动。 */
-	function checkScroll(pageData, callback) {
-		if (pageData.scroll) {
-			if (!pageData.scrollHeight) {
-				pageData.scrollHeight = 0;
-			}
-			clearInterval(pageData.scrollCheck);
-			clearTimeout(pageData.scrollCheckAutoCancel);
-			pageData.scrollCheck = setInterval(function () {
-				pageData.scroll.refresh();
-				if ($.isFunction(callback)) {
-					callback();
-				}
-			}, 50);
-
-			pageData.scrollCheckAutoCancel = setTimeout(function () {
-				clearInterval(pageData.scrollCheck);
-			}, 500);
-		}
-	}
-
-	/* 返回上一级 */
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
-
-	/* 重置页面时调用,重新生成IScroll */
-	function fixScroll(pageData) {
-		if (pageData.scroll) {
-			pageData.scroll.destroy();
-			pageData.scroll = null;
-		}
-		var placeOrderScroll;
-		setTimeout(function () {
-			pageData.scroll = new IScroll('#placeOrderScroll');
-		}, 50);
-	}
-
-	/* 算账。 */
-	function payCharge($orderCost) {
-		order.payValue = order.cost - order.couponValue;
-		$orderCost.text('¥' + order.payValue);
-	}
-
-	/* 也是自动选取最大优惠券的操作,只是与setCoupon策略不同
-	 function suitable(me, doc, productID, type, petPrice, pay, pageData, extra, precedence) {
-	 extra = extra || 0;
-	 precedence = precedence || 0;
-	 // 获取该类型宠物 可用优惠券
-	 doc.trigger('spa:openloader');
-	 api.getCouponList({
-	 products: JSON.stringify([{
-	 product_id: productID,
-	 count: 1
-	 }]),
-	 type: type,
-	 user_id: user.id
-	 }, function (res) {
-	 doc.trigger('spa:closeloader');
-	 if (!res.success) {
-	 doc.trigger('spa:openpanel', ['simpleAlert', {
-	 message: res.message
-	 }]);
-	 } else {
-	 user.orderCoupons = res.data;
-
-	 // 优惠券数据更新
-	 var coupons = user.orderCoupons;
-	 var couponSelectVal = 0;
-	 if (coupons.length) {
-	 // 选取最大金额
-	 var selectCoupon = user.getMaxAvailableCoupon();
-
-	 // 缓存到购物车
-	 cart['products'][type]['couponName'] = coupons[selectCoupon.couponIndex].coupon.name;
-	 cart['products'][type]['couponVal'] = selectCoupon.couponSelectVal;
-	 cart['products'][type]['couponId'] = coupons[selectCoupon.couponIndex].id;
-	 cart['products'][type]['couponList'] = coupons;
-
-	 // dom 更新
-	 $('.coupon-selected-name', me).html(user.getCouponName(coupons[selectCoupon.couponIndex].id));
-	 $('.coupon-cost', me).html('-' + selectCoupon.couponSelectVal);
-	 $('.select-coupon', me).removeClass('hide');
-	 $('.order-cost', me).attr('data-coupon', selectCoupon.couponSelectVal);
-	 $('.order-list', me).removeClass('hide');
-	 $('.order-cost', me).attr('data-pay', parseFloat(petPrice) - parseFloat(selectCoupon.couponSelectVal) + extra);
-
-	 // 减去优惠
-	 petPrice = parseFloat(petPrice) - parseFloat(selectCoupon.couponSelectVal) + extra + precedence;
-
-	 } else {
-	 // 缓存到购物车
-	 cart['products'][type]['couponName'] = '';
-	 cart['products'][type]['couponVal'] = '';
-	 cart['products'][type]['couponId'] = '';
-	 cart['products'][type]['couponList'] = [];
-
-	 $('.coupon-selected-name', me).html('');
-	 $('.coupon-cost', me).html('- 0');
-	 $('.select-coupon', me).addClass('hide');
-	 $('.order-cost', me).attr('data-coupon', 0);
-
-	 petPrice = parseFloat(petPrice) + extra + precedence;
-	 }
-	 // 缓存到本地
-	 cart.setCache('products');
-
-	 // 更新dom总价
-	 $('.order-cost', me).attr('data-costs', pay);
-	 $('.order-cost', me).html('¥' + petPrice);
-
-	 $('.select-pet', me).removeClass('hide');
-
-	 if (pageData && pageData.scroll) {
-	 pageData.scroll.refresh();
-	 }
-	 }
-	 });
-	 }
-	 */
-
-	/* 优惠券取决于主服务、宠物、数量、时间,所以在这几个值改变后要调用这个方法,更新最大优惠
-	 function setCoupon(me, pageData, extraServicePrice) {
-	 $(document).trigger('spa:openloader');
-	 var products = JSON.stringify([{
-	 product_id: order['productID'],
-	 count: order.productCount
-	 }]);
-	 var time = order.bookingDate + ' ' + order.bookingTime + ':00';
-	 user.getProductCoupon(products, time, cachePageData.productType, function (res) {
-	 $(document).trigger('spa:closeloader');
-	 if (res.success) {
-	 var coupons = user.orderCoupons;
-	 var price = 0;
-	 if (coupons.length) {
-	 var selectCoupon = user.getMaxAvailableCoupon();
-	 cart['products'][cachePageData.productType]['couponName'] = coupons[selectCoupon.couponIndex].coupon.name;
-	 cart['products'][cachePageData.productType]['couponVal'] = selectCoupon.couponSelectVal;
-	 cart['products'][cachePageData.productType]['couponId'] = coupons[selectCoupon.couponIndex].id;
-	 cart['products'][cachePageData.productType]['couponList'] = coupons;
-
-	 $('.coupon-selected-name', me).html(user.getCouponName(coupons[selectCoupon.couponIndex].id));
-	 $('.coupon-cost', me).html('-' + selectCoupon.couponSelectVal);
-	 $('.select-coupon', me).removeClass('hide');
-	 $('.order-cost', me).attr('data-coupon', selectCoupon.couponSelectVal);
-	 $('.order-list', me).removeClass('hide');
-	 price = parseFloat(order.petPrice) * order.productCount - parseFloat(selectCoupon.couponSelectVal) + parseFloat(extraServicePrice);
-
-	 } else {
-	 price = parseFloat(order.petPrice) * order.productCount + parseFloat(extraServicePrice);
-
-	 $('.coupon-selected-name', me).html('');
-	 $('.select-coupon', me).addClass('hide');
-	 $('.order-cost', me).attr('data-coupon', '0');
-	 $('.order-cost', me).attr('data-pay', parseFloat(order.petPrice));
-	 cart['products'][cachePageData.productType]['couponName'] = '';
-	 cart['products'][cachePageData.productType]['couponVal'] = '';
-	 cart['products'][cachePageData.productType]['couponId'] = '';
-	 cart['products'][cachePageData.productType]['couponList'] = [];
-	 }
-	 // 加急
-	 if (order.precedence) {
-	 price = price + parseFloat(product.precedence);
-	 }
-	 $('.order-cost', me).attr('data-pay', price);
-	 $('.order-cost', me).attr('data-costs', order.petPrice);
-	 $('.order-cost', me).html('¥' + price);
-
-	 cart.setCache('products');
-
-	 pageData.scroll.refresh();
-	 } else {
-	 $(document).trigger('spa:openpanel', ['simpleAlert', {
-	 message: res.message
-	 }]);
-	 }
-	 });
-	 }  */
-
-	/* 在选择主服务或宠物后,筛选附加服务
-	 function suitExtraService(me, checkedName) {
-	 var newExtraService = product.getExtraServiceList(order.productType, order.petName, checkedName);
-	 var extraService = {
-	 extraService: newExtraService
-	 }
-	 var extraServiceTpl = template('placeOrder/list', extraService);
-	 var extraServiceTpl2 = template('placeOrder/list2', extraService);
-	 me.find('.extra-service-list').html(extraServiceTpl);
-	 me.find('.calc-items').html(extraServiceTpl2).addClass('hide');
-
-	 cachePageData.extraServicePrice = 0;
-	 cachePageData.extraServiceCount = 0;
-	 } */
-
-	/* 在选择主服务、附加服务、宠物、时间、地点之后,重置保洁师
-	 function resetTech(me) {
-	 order.beautician.name = '请选择';
-	 order.beautician.id = '';
-	 $('.booking-people', me).html(order.beautician.name);
-	 }  */
-
-	return {
-		title: '壹管家上门服务',
-		body: '',
-		init: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-
-			/* 三个返回操作 */
-			$.newTouch('.back-button', function (event) {
-				back.call(this, event);
-				// history.go(-1);
-			}, $view);
-			$view.on('tapBackButton', function (event) {
-				back.call(this, event);
-				// history.go(-1);
-			});
-			$view.on('swipeRight', function (event) {
-				back.call(this, event);
-				// history.go(-1);
-			});
-			/*setTimeOut*/
-			setInterval(function () {
-				if (product.name == "活动产品") {
-					$('.show-time-picker').css('display', 'none');
-					$('.show-coupon-picker').css('display', 'none');
-					$('.o2o-singles-day').css('display', 'inline');
-				}
-			}, 50);
-			/* 点击查看详情。跳转到product页面 */
-			$.newTouch('.product-pic-o2o', function (event) {
-				$doc.trigger('spa:navigate', {
-					hash: 'product',
-					pushData: {
-						produc: product,
-						needReload: true
-					}
-				});
-			}, $view);
-
-			/*特效*/
-			setInterval(function run() {
-				$('.product-img').fadeToggle();
-			},500);
-			/* 点击选择extra。 */
-			$.newTouch('.btn-main-service', function (event) {
-				/* on代表这一条的选中状态。如果已经选中了,就return。this的作用域是这一条extra。 */
-				if ($(this).hasClass('on')) return;
-				/* 如果没有on状态,加上on。 */
-				$(this).addClass('on');
-				/* 删掉其他选择框的on状态 */
-				$(this).parent().siblings().find('.btn').removeClass('on');
-				/* 填写order */
-				order.appendID = $(this).attr('data-extra-type');
-				order.price = $(this).attr('data-extra-price');
-				order.cost = order.price * order.productCount;
-				// 重置代金券
-				$('.coupon-selected-name', $view).html('选择优惠券');
-				order.couponValue = 0;
-				order.couponID = '';
-				payCharge($('.order-cost', $view));
-			}, $view);
-
-			/* 点击选择地址 */
-			$.newTouch('.select-address', function (event) {
-				event.preventDefault();
-				/* 如果是微信客户端,跳转到addressList页面。 */
-				if (!config.isAndroid && !config.isIOS) {
-					$doc.trigger('spa:navigate', {
-						hash: 'addressList',
-						pushData: {
-							backHash: 'placeOrder'
-						},
-						callback: {
-							/* 在addressList页面挑选之后,回到这个页面时执行的回调。 */
-							onSelect: function (address, station) {
-								order.set('address', address, true);
-								order.set('stationID', station, true);
-
-								var addressStr = '';
-								if (order.address.address.poi) {
-									addressStr = order.address.address.city + order.address.address.area + order.address.address.poi.name + order.address.address.detail
-								} else {
-									addressStr = order.address.address.province + order.address.address.city + order.address.address.area + order.address.address.detail
-								}
-								$('.order-address', $view).html(addressStr);
-								$('.order-username', $view).html(order.address.name);
-								$('.order-mobile', $view).html(order.address.mobile);
-							}
-						}
-					});
-				}
-			}, $view);
-
-			/* 点击选择附加服务
-			 $.newTouch('.item-checkbox', function (event) {
-			 event.preventDefault();
-			 // 如果'.main-service'元素的子元素数目为正(也就是说出现了选择主服务那一栏,也就是说在前一页选择的是附加服务),且不处于on状态(也就是还没有选择主服务)
-			 if ($('.main-service', $view).length && !$('.main-service', $view).find('.btn-main-service').hasClass('on')) {
-			 // 弹出一个对话框
-			 $doc.trigger('spa:openpanel', ['simpleAlert', {
-			 message: '请选择服务类型'
-			 }]);
-			 return;
-			 }
-			 // $(this).data('xxx'):获取this中data-xxx的数据。
-			 // 获取这一条附加服务的相关的数据。select没用,估计是原来想用这个记录选中状态的。
-			 var select = $(this).data('select'),
-			 id = $(this).data('id'),
-			 index = $(this).parent().index(),
-			 price = $(this).data('price');
-			 extraType = $(this).data('servicetype');
-			 // 获取附加服务的总费用。
-			 var extraCost = $('.order-cost', $view).attr('data-extra');
-			 // 如果原来没有选中这一项,下面就是选中的操作
-			 if (!$(this).hasClass('checked')) {
-			 // 附加服务数量+1
-			 cachePageData.extraServiceCount++;
-			 // 保存附加服务的总价格
-			 cachePageData.extraServicePrice += parseFloat(price);
-			 // 添加checked状态
-			 $(this).addClass('checked');
-			 var serviceParam = {
-			 product_id: id,
-			 count: 1
-			 }
-			 // /为什么是个数组?
-			 order.extraService[index] = serviceParam;
-			 // 把订单详情中对应的项目添加on属性
-			 $('.calc-items', $view).find('.select-extra-service').eq(index).addClass('on');
-			 // 计算附加服务的总费用。
-			 extraCost = parseFloat(extraCost) + parseFloat(price);
-			 $('.order-cost', $view).attr('data-extra', extraCost);
-			 }
-			 // 如果原来选中了这一项,下面就是取消选中的操作
-			 else {
-			 // 附加服务数量-1
-			 cachePageData.extraServiceCount--;
-			 // 保存附加服务的总价格
-			 cachePageData.extraServicePrice -= parseFloat(price);
-			 // 删除checked属性
-			 $(this).removeClass('checked');
-
-			 order.extraService[index] = {};
-			 // 把订单详情中对应的项目删掉on属性
-			 $('.calc-items', $view).find('.select-extra-service').eq(index).removeClass('on');
-			 // 计算附加服务的总费用。
-			 extraCost = parseFloat(extraCost) - parseFloat(price);
-			 $('.order-cost', $view).attr('data-extra', extraCost);
-			 }
-			 // 根据附加服务的数量,更新订单详情中附加服务模块的显示与隐藏
-			 if (cachePageData.extraServiceCount > 0) {
-			 $('.calc-items', $view).removeClass('hide');
-			 } else {
-			 $('.calc-items', $view).addClass('hide');
-			 }
-			 // 更新订单详情中每一条附加服务的显示与隐藏
-			 if ($('.calc-items', $view).find('.select-extra-service').hasClass('on')) {
-			 $('.calc-items', $view).removeClass('hide');
-			 } else {
-			 $('.calc-items', $view).addClass('hide');
-			 }
-			 // 计算总价钱
-			 payCharge();
-			 // 刷新界面
-			 pageData.scroll.refresh();
-			 }, $view); */
-
-			/* 点击选择保洁师
-			 $.newTouch('.show-beautician-picker', function (event) {
-			 // 如果订单的地址数据为空
-			 if (!order.address || !order.address.address_id) {
-			 // 弹出提示框
-			 $doc.trigger('spa:openpanel', ['simpleAlert', {
-			 message: '请选择地址'
-			 }]);
-			 return;
-			 }
-			 // 点击订单的预定时间为空
-			 if (order.bookingDate == '' || order.bookingTime == '') {
-			 // 弹出提示框
-			 $doc.trigger('spa:openpanel', ['simpleAlert', {
-			 message: '请选择上门时间'
-			 }]);
-			 return;
-			 }
-			 // 点击订单的主服务类型为空
-			 if (!order.productType) {
-			 // /弹出提示框
-			 $doc.trigger('spa:openpanel', ['simpleAlert', {
-			 message: '请选择服务类型'
-			 }]);
-			 return;
-			 }
-			 // 生成预定时间的字符串
-			 var bookingTime = order.bookingDate + ' ' + order.bookingTime + ':00';
-			 // 生成所有服务的字符串
-			 var service_type_array = [order.productType];
-			 var service_type = '[' + service_type_array.join(',') + ']';
-			 // 根据服务、时间、地址,向服务器请求保洁师列表
-			 user.getTechList(
-			 service_type,
-			 bookingTime,
-			 order.address.address_id,
-			 // 请求成功后跳转到beautician页面,在beautician页面展示保洁师列表
-			 function (res) {
-			 $doc.trigger('spa:navigate', {
-			 hash: 'beautician',
-			 pushData: {
-
-			 }
-			 });
-			 }
-			 );
-			 }, $view);  */
-
-			/* 点击选择宠物相关
-			 $.newTouch('.show-product-picker', function () {
-			 // 如果有了selected属性,就return
-			 if ($(this).hasClass('selected')) return;
-			 event.preventDefault();
-			 // 主服务>10是什么意思???
-			 if (cachePageData.productType > 10) {
-			 $doc.trigger('spa:openpanel', ['simpleAlert', {
-			 message: '请选择服务类型'
-			 }]);
-			 return;
-			 }
-			 // 弹出一个列表选择框。
-			 $doc.trigger('spa:openpanel', ['productOption', {
-			 pets: product.productGroup[cachePageData.productType],
-			 productType: cachePageData.productType,
-			 callback: {
-			 onSelect: function (petName, petWeight, petPrice) {
-			 // set order info
-			 order.petName = petName;
-			 order.petWeight = petWeight;
-			 order.petPrice = petPrice;
-			 order.productType = cachePageData.productType;
-			 order.petID = cart['products'][cachePageData.productType]['petID'];
-			 order.productID = cart['products'][cachePageData.productType]['productID'];
-			 // user.orderCoupons = res.data;
-			 // 筛选附加服务
-			 if (cachePageData.extraServiceType > 10) {
-			 var selectExtraServiceName = cachePageData.defaultExtraService[cachePageData.extraServiceType].serviceName;
-			 var selectExtraServicePrice = cachePageData.defaultExtraService[cachePageData.extraServiceType].servicePrice;
-
-			 $('.order-cost', $view).attr('data-extra', selectExtraServicePrice);
-			 }
-
-			 suitExtraService($view, selectExtraServiceName);
-
-			 $('.pet-info', $view).html(petName + ' (' + petWeight + ')');
-			 $('.pet-type', $view).html(petName + ' (' + petWeight + ')');
-			 $('.total-cost', $view).html('¥' + petPrice);
-
-			 if ($('.calc-items', $view).find('.select-extra-service').hasClass('on')) {
-			 $('.calc-items', $view).removeClass('hide');
-			 petPrice = parseFloat(petPrice) + parseFloat(selectExtraServicePrice);
-			 }
-
-			 $('.order-cost', $view).attr('data-costs', order.petPrice);
-			 $('.order-cost', $view).attr('data-extra', cachePageData.extraServicePrice);
-			 $('.order-cost', $view).html('¥' + petPrice);
-
-			 $('.select-pet', $view).removeClass('hide');
-
-			 if (order['productID'] && order.bookingDate) {
-			 setCoupon($view, pageData, cachePageData.extraServicePrice);
-			 }
-
-			 pageData.scroll.refresh();
-			 }
-			 }
-			 }]);
-			 }, $view); */
-
-			/* 点击数量-1 */
-			$.newTouch('.btn-sub', function (event) {
-				if (order.productCount <= 1) return;
-				if (order.price == 0) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择服务'
-					}]);
-					return;
-				}
-				var inputNum = $('.service-count', $view).children('.input-num').val();
-				if (isNaN(inputNum)) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请输入数字'
-					}]);
-					return false;
-				}
-				order.productCount = inputNum;
-				order.productCount--;
-				order.cost = order.productCount * order.price;
-				$('.service-count', $view).children('.input-num').val(order.productCount);
-				/* 算账 */
-				payCharge($('.order-cost', $view));
-			}, $view);
-
-			/*点击body重置金额*/
-			$.newTouch('body', function (event) {
-				//input输入
-				var inputNum = $('.service-count', $view).children('.input-num').val();
-				if (isNaN(inputNum)) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请输入数字'
-					}]);
-					return false;
-				}
-				//与input输入框的文本的数据做交互;
-				order.productCount = inputNum;
-				order.cost = order.productCount * order.price;
-				$('.service-count', $view).children('.input-num').val(order.productCount);
-			})
-
-			/* 点击数量+1 */
-			$.newTouch('.btn-add', function (event) {
-				if (order.productCount > 999) return;
-				if (order.price == 0) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						//message: '请选择extra'
-						message: '请选择服务'
-					}]);
-					return;
-				}
-				var inputNum = $('.service-count', $view).children('.input-num').val();
-				if (isNaN(inputNum)) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请输入数字'
-					}]);
-					return false;
-				}
-				order.productCount = inputNum;
-				order.productCount++;
-				order.cost = order.productCount * order.price;
-				$('.service-count', $view).children('.input-num').val(order.productCount);
-				/* 算账 */
-				payCharge($('.order-cost', $view));
-			}, $view);
-
-			/* 点击选择时间 */
-			$.newTouch('.show-time-picker', function (event) {
-				event.preventDefault();
-				// 以下是构建时间选择器,不用管。直接看选完之后的回调。
-				var dayNamesA = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
-				var dayNamesB = ['今天'];
-				var columns = {
-					columnDay: [],
-					columnTime: []
-				};
-				var now = new Date().getHours();
-				var daySelectIndex = 0;
-				for (var i = 1; i <= 9; i++) {
-					var dd = new Date();
-					dd.setDate(dd.getDate() + i);
-
-					var month = dd.getMonth() + 1;
-					var day = dd.getDate();
-					var date = month + '月' + day + '日';
-
-					var dayStr = helper.getDateStr({
-						date: dd,
-						separator: '-'
-					});
-
-					var dayStrSuffix;
-					if (i < dayNamesB.length) {
-						dayStrSuffix = dayNamesB[i];
-					} else {
-						dayStrSuffix = dayNamesA[dd.getDay()];
-					}
-					var selected = false;
-					if (order.bookingDate) {
-						selected = true;
-					}
-					if (dayStr == order.bookingDate) {
-						daySelectIndex = i;
-					} else {
-						daySelectIndex = -1;
-					}
-					columns.columnDay.push({
-						text: date, // 几月几日
-						day: dayStrSuffix, // 周几
-						value: dayStr,
-						selected: selected,
-						selectIndex: daySelectIndex
-					});
-				}
-
-				var currentDate = new Date();
-				var currentMonth = currentDate.getMonth() + 1;
-				var currentDay = currentDate.getDate();
-				var now = new Date().getHours();
-				var min = new Date().getMinutes();
-				var timeSelectIndex = 0;
-				for (var i = 9; i <= 19; i++) {
-					var hour = i + ':00';
-					var selected = false;
-					if (order.bookingTime) {
-						selected = true;
-					}
-					if (hour == order.bookingTime) {
-						timeSelectIndex = i;
-					} else {
-						timeSelectIndex = -1;
-					}
-					columns.columnTime.push({
-						month: currentMonth,
-						day: currentDay,
-						min: min,
-						num: i,
-						now: now,
-						text: hour,
-						value: hour,
-						selected: selected,
-						selectIndex: timeSelectIndex
-					})
-				}
-				$doc.trigger('spa:openpanel', ['dataPicker', {
-					// type: cachePageData.productType,
-					columns: columns,
-					selected: order.bookingDate,
-					// offDay: product.offDay,
-					callback: {
-						// 选完之后的回调。values:[日期,时间];texts:时间字符串;precedence:是否加急;
-						onSelect: function (values, texts, precedence) {
-							// 重置代金券
-							$('.coupon-selected-name', $view).html('选择优惠券');
-							order.couponValue = 0;
-							order.couponID = '';
-							payCharge($('.order-cost', $view));
-							// 填写order
-							order.bookingDate = values[0];
-							order.bookingTime = values[1];
-							order.bookingTimeStr = texts[0] + ' ' + texts[1];
-							order.precedence = precedence;
-							// 更新预定时间组件
-							$('.booking-time', $view).html(order.bookingTimeStr);
-						}
-					}
-				}]);
-			}, $view);
-
-			/* 点击选择优惠券 */
-			$.newTouch('.show-coupon-picker', function (event) {
-				if ($(this).hasClass('disabled')) return;
-				event.preventDefault();
-
-				var extraJson = '';
-				if (product.extra && !order.appendID) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择服务'
-					}]);
-					return;
-				} else {
-					extraJson = JSON.stringify([{type: order.appendID, price: order.price}]);
-				}
-
-				// 必须先选择时间
-				if (!order.bookingDate) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择服务时间'
-					}]);
-					return;
-				}
-
-				// 跳转到picker页面,展示优惠券
-				$doc.trigger('spa:navigate', {
-					hash: 'picker',
-					pushData: {
-						title: '选择优惠券',
-						backHash: 'placeOrder',
-						products: JSON.stringify([{
-							product_id: order.productID,
-							count: order.productCount
-						}]),
-						time: order.bookingDate + ' ' + order.bookingTime + ':00',
-						type: order.productType,
-						extraJson: extraJson
-					},
-					callback: {
-						// 在picker页面挑选之后,回到这个页面时执行的回调。pickValue:选中的优惠券的ID;
-						onSelect: function (pickValue) {
-							if (pickValue == '') {
-								$('.coupon-selected-name', $view).text('不使用');
-								order.couponValue = 0;
-							} else {
-								for (var i in user.orderCoupons) {
-									var couponInfo = user.orderCoupons[i];
-									if (couponInfo.id == pickValue) {
-										$('.coupon-selected-name', $view).text(couponInfo['coupon']['name']);
-										order.couponValue = couponInfo['coupon']['value'];
-										break;
-									}
-								}
-							}
-							// 填写order
-							order.couponID = pickValue;
-							// 计算总费用
-							payCharge($('.order-cost', $view));
-						}
-					}
-				});
-			}, $view);
-
-			/* 是否选中同意用户协议,关系到下订单按钮是否激活 */
-			$.newTouch('.agreement-touch-area', function (event) {
-				var agreementObj = $('.agreement-checkbox', $view);
-				if (agreementObj.prop('checked')) {
-					agreementObj.prop('checked', false);
-					$('.btn-place').addClass('disable');
-				} else {
-					agreementObj.prop('checked', true);
-					$('.btn-place').removeClass('disable');
-				}
-			}, $view);
-
-			/* 跳转到agreement页面查看协议 */
-			$.newTouch('.agreement', function (event) {
-				$doc.trigger('spa:navigate', {
-					hash: 'agreement'
-				});
-			}, $view);
-
-			/* 点击下订单 */
-			$.newTouch('.btn-place', function (event) {
-				event.preventDefault();
-				if ($(this).hasClass('disable')) {
-					return false;
-				}
-				if (product.type_str == "擦玻璃" && order.productCount < 10) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '数量不少于10平米'
-					}]);
-					return;
-				}
-
-				if (product.type_str == "新居开荒" && order.productCount < 50) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '数量不少于50平米'
-					}]);
-					return;
-				}
-				if (product.extra && !order.appendID) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择服务'
-					}]);
-					return;
-				}
-
-				if (!order.address) {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择地址'
-					}]);
-					return;
-				}
-
-				if (!order.bookingTimeStr&& product.name !== "活动产品") {
-					$doc.trigger('spa:openpanel', ['simpleAlert', {
-						message: '请选择上门时间'
-					}]);
-					return;
-				}
-
-
-				var payChannel = 'wx_pub';
-
-				/* 使备注输入框失去焦点,获取值 */
-				$('.order-memo', $view).blur();
-				order.set('memo', $('.order-memo', $view).val());
-
-				/* 向服务器下订单 */
-				$doc.trigger('spa:openloader');
-				if (user.balance >= order.payValue) {
-					order.balance = order.payValue;
-					order.payValue = 0;
-				} else {
-					order.balance = user.balance;
-					order.payValue = order.payValue - order.balance;
-				}
-				order.addOrder(user.id, payChannel, function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						// 更新user的订单
-						user.orders[1].data.push(res.data);
-						// 更新user的优惠券
-						var oldCouponList = user.orderCoupons;
-						var oldCouponId = order.couponID;
-						var newCouponList = [];
-						$.each(oldCouponList, function (index, val) {
-							if (val.id !== oldCouponId) {
-								newCouponList.push(oldCouponList[index])
-							}
-						});
-						user.orderCoupons = newCouponList;
-
-						var orderID = order.id;
-						order.reset();
-						$('.booking-time', $view).html('请选择');
-
-						if (res.data.status == 1) {
-							$doc.trigger('spa:navigate', {
-								hash: 'paySuccess'
-							});
-						} else {
-							$doc.trigger('spa:navigate', {
-								hash: 'pay',
-								pushData: {
-									orderID: orderID,
-									backHash: ''
-								}
-							});
-						}
-					} else {
-						$doc.trigger('spa:openpanel', ['simpleAlert', {
-							message: res.message
-						}]);
-					}
-				});
-			}, $view);
-
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			var $view = this;
-			var pushData = pageData.pushData;
-			/* 只有首页跳转来,才会带有needReset = true */
-			if (pushData.hasOwnProperty('needReset') && pushData.needReset) {
-				/* 接收首页传来的product,填写order的productType(产品类型)、productID(产品ID)两个字段 */
-				pushData.needReset = false;
-				product = pushData.product;
-
-				order.productType = product.type;
-				order.productID = product.id;
-				order.productCount = 1;
-				order.couponValue = 0;
-				/* 根据product建立渲染页面的数据 */
-				var tmpData = {
-					/* 环境,目前只决定是否显示保洁师 */
-					env: config,
-					/* 环境 */
-					showNavBar: !config.isWX && !config.isChubao,
-					imgSrc: product.imgSrc,
-					/* 标题栏的标题 */
-					title: product.name,
-					/* extra选择项 */
-					extra: product.extra,
-					/* 如果用户有优惠券,则显示优惠券的选择栏 */
-					showCoupon: user.orderCoupons.length,
-					/* 账户余额 */
-					balance: user.balance
-				};
-				/* 渲染页面 */
-				var tpl = template('placeOrder/index', tmpData);
-				$view.find('.spa-page-body').html(tpl);
-				/* 绑定费用数据 */
-				if (product.extra) {
-					order.price = 0;
-					order.cost = 0;
-				} else {
-					order.price = product.price;
-					order.cost = product.price * order.productCount;
-				}
-				payCharge($('.order-cost', $view));
-
-				/* 软键盘相关操作时对IScroll的补偿 */
-				fixScroll(pageData);
-				$('.order-memo', $view).focus(function (event) {
-					var that = this;
-					checkScroll(pageData, function () {
-						if (pageData.scroll) {
-							pageData.scroll.scrollToElement(that, 0);
-						}
-					});
-				});
-				$('.order-memo', $view).on('closeKeyboard', function (event) {
-					checkScroll(pageData);
-					$(this).blur();
-				});
-				$('.order-memo', $view).blur(function (event) {
-					checkScroll(pageData);
-				});
-
-				/* 填写备注时,提交按钮失焦 */
-				$('#order-form', $view).on('submit', function (event) {
-					$(this).blur();
-					return false;
-				});
-			}
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var type = pageData.pushData.productType;
-			native.registerEvent(true);
-			dtd.resolve();
-			if (config.isWX) {
-				wx.ready(function () {
-					wx.onMenuShareTimeline({
-						title: '家政服务' + product.desc[1].content + ',首选壹管家',
-						link: 'http://www.yiguanjia.me/o2o/web/index',
-						imgUrl: product.desc[0].content
-					});
-					wx.onMenuShareAppMessage({
-						title: '家政服务' + product.desc[1].content + ',首选壹管家',
-						desc: '全程管家,精心每一个细节',
-						link: 'http://www.yiguanjia.me/o2o/web/index',
-						imgUrl: product.desc[0].content
-					});
-				});
-			}
-		},
-		afterclose: function (pageData) {
-			native.registerEvent(false);
-		}
-	}
-})
+    /*
+     * 这里对product和order做一个说明。
+     * product前台写死。order沿用原模型,但只用其中几个字段。
+     * 对应关系如下:
+     * product.id == order.productID :产品ID
+     * product.type == order.productType :产品类型,约定的数字
+     * product.price == order.cost :订单原价,当product的extra字段为空
+     * product.extra.price == order.cost :订单原价,当product的extra字段不为空
+     * product.type_str == order.serviceName :服务名称
+     * product.extra.type == order.appendID :服务的额外选项,当product的extra字段不为空
+     */
+
+    /* 从首页传来的产品数据 */
+    var product;
+
+    /* 软键盘弹出与消失时布局变动。 */
+    function checkScroll(pageData, callback) {
+        if (pageData.scroll) {
+            if (!pageData.scrollHeight) {
+                pageData.scrollHeight = 0;
+            }
+            clearInterval(pageData.scrollCheck);
+            clearTimeout(pageData.scrollCheckAutoCancel);
+            pageData.scrollCheck = setInterval(function () {
+                pageData.scroll.refresh();
+                if ($.isFunction(callback)) {
+                    callback();
+                }
+            }, 50);
+
+            pageData.scrollCheckAutoCancel = setTimeout(function () {
+                clearInterval(pageData.scrollCheck);
+            }, 500);
+        }
+    }
+
+    /* 返回上一级 */
+    function back(event) {
+        event.preventDefault();
+        $(document).trigger('spa:navigate', {
+            hash: '',
+            pushData: {
+                dontNeedReload: true
+            }
+        });
+    }
+
+    /* 重置页面时调用,重新生成IScroll */
+    function fixScroll(pageData) {
+        if (pageData.scroll) {
+            pageData.scroll.destroy();
+            pageData.scroll = null;
+        }
+        var placeOrderScroll;
+        setTimeout(function () {
+            pageData.scroll = new IScroll('#placeOrderScroll');
+        }, 50);
+    }
+
+    /* 算账。 */
+    function payCharge($orderCost) {
+        order.payValue = order.cost - order.couponValue;
+        $orderCost.text('¥' + order.payValue);
+    }
+
+    /* 也是自动选取最大优惠券的操作,只是与setCoupon策略不同
+     function suitable(me, doc, productID, type, petPrice, pay, pageData, extra, precedence) {
+     extra = extra || 0;
+     precedence = precedence || 0;
+     // 获取该类型宠物 可用优惠券
+     doc.trigger('spa:openloader');
+     api.getCouponList({
+     products: JSON.stringify([{
+     product_id: productID,
+     count: 1
+     }]),
+     type: type,
+     user_id: user.id
+     }, function (res) {
+     doc.trigger('spa:closeloader');
+     if (!res.success) {
+     doc.trigger('spa:openpanel', ['simpleAlert', {
+     message: res.message
+     }]);
+     } else {
+     user.orderCoupons = res.data;
+
+     // 优惠券数据更新
+     var coupons = user.orderCoupons;
+     var couponSelectVal = 0;
+     if (coupons.length) {
+     // 选取最大金额
+     var selectCoupon = user.getMaxAvailableCoupon();
+
+     // 缓存到购物车
+     cart['products'][type]['couponName'] = coupons[selectCoupon.couponIndex].coupon.name;
+     cart['products'][type]['couponVal'] = selectCoupon.couponSelectVal;
+     cart['products'][type]['couponId'] = coupons[selectCoupon.couponIndex].id;
+     cart['products'][type]['couponList'] = coupons;
+
+     // dom 更新
+     $('.coupon-selected-name', me).html(user.getCouponName(coupons[selectCoupon.couponIndex].id));
+     $('.coupon-cost', me).html('-' + selectCoupon.couponSelectVal);
+     $('.select-coupon', me).removeClass('hide');
+     $('.order-cost', me).attr('data-coupon', selectCoupon.couponSelectVal);
+     $('.order-list', me).removeClass('hide');
+     $('.order-cost', me).attr('data-pay', parseFloat(petPrice) - parseFloat(selectCoupon.couponSelectVal) + extra);
+
+     // 减去优惠
+     petPrice = parseFloat(petPrice) - parseFloat(selectCoupon.couponSelectVal) + extra + precedence;
+
+     } else {
+     // 缓存到购物车
+     cart['products'][type]['couponName'] = '';
+     cart['products'][type]['couponVal'] = '';
+     cart['products'][type]['couponId'] = '';
+     cart['products'][type]['couponList'] = [];
+
+     $('.coupon-selected-name', me).html('');
+     $('.coupon-cost', me).html('- 0');
+     $('.select-coupon', me).addClass('hide');
+     $('.order-cost', me).attr('data-coupon', 0);
+
+     petPrice = parseFloat(petPrice) + extra + precedence;
+     }
+     // 缓存到本地
+     cart.setCache('products');
+
+     // 更新dom总价
+     $('.order-cost', me).attr('data-costs', pay);
+     $('.order-cost', me).html('¥' + petPrice);
+
+     $('.select-pet', me).removeClass('hide');
+
+     if (pageData && pageData.scroll) {
+     pageData.scroll.refresh();
+     }
+     }
+     });
+     }
+     */
+
+    /* 优惠券取决于主服务、宠物、数量、时间,所以在这几个值改变后要调用这个方法,更新最大优惠
+     function setCoupon(me, pageData, extraServicePrice) {
+     $(document).trigger('spa:openloader');
+     var products = JSON.stringify([{
+     product_id: order['productID'],
+     count: order.productCount
+     }]);
+     var time = order.bookingDate + ' ' + order.bookingTime + ':00';
+     user.getProductCoupon(products, time, cachePageData.productType, function (res) {
+     $(document).trigger('spa:closeloader');
+     if (res.success) {
+     var coupons = user.orderCoupons;
+     var price = 0;
+     if (coupons.length) {
+     var selectCoupon = user.getMaxAvailableCoupon();
+     cart['products'][cachePageData.productType]['couponName'] = coupons[selectCoupon.couponIndex].coupon.name;
+     cart['products'][cachePageData.productType]['couponVal'] = selectCoupon.couponSelectVal;
+     cart['products'][cachePageData.productType]['couponId'] = coupons[selectCoupon.couponIndex].id;
+     cart['products'][cachePageData.productType]['couponList'] = coupons;
+
+     $('.coupon-selected-name', me).html(user.getCouponName(coupons[selectCoupon.couponIndex].id));
+     $('.coupon-cost', me).html('-' + selectCoupon.couponSelectVal);
+     $('.select-coupon', me).removeClass('hide');
+     $('.order-cost', me).attr('data-coupon', selectCoupon.couponSelectVal);
+     $('.order-list', me).removeClass('hide');
+     price = parseFloat(order.petPrice) * order.productCount - parseFloat(selectCoupon.couponSelectVal) + parseFloat(extraServicePrice);
+
+     } else {
+     price = parseFloat(order.petPrice) * order.productCount + parseFloat(extraServicePrice);
+
+     $('.coupon-selected-name', me).html('');
+     $('.select-coupon', me).addClass('hide');
+     $('.order-cost', me).attr('data-coupon', '0');
+     $('.order-cost', me).attr('data-pay', parseFloat(order.petPrice));
+     cart['products'][cachePageData.productType]['couponName'] = '';
+     cart['products'][cachePageData.productType]['couponVal'] = '';
+     cart['products'][cachePageData.productType]['couponId'] = '';
+     cart['products'][cachePageData.productType]['couponList'] = [];
+     }
+     // 加急
+     if (order.precedence) {
+     price = price + parseFloat(product.precedence);
+     }
+     $('.order-cost', me).attr('data-pay', price);
+     $('.order-cost', me).attr('data-costs', order.petPrice);
+     $('.order-cost', me).html('¥' + price);
+
+     cart.setCache('products');
+
+     pageData.scroll.refresh();
+     } else {
+     $(document).trigger('spa:openpanel', ['simpleAlert', {
+     message: res.message
+     }]);
+     }
+     });
+     }  */
+
+    /* 在选择主服务或宠物后,筛选附加服务
+     function suitExtraService(me, checkedName) {
+     var newExtraService = product.getExtraServiceList(order.productType, order.petName, checkedName);
+     var extraService = {
+     extraService: newExtraService
+     }
+     var extraServiceTpl = template('placeOrder/list', extraService);
+     var extraServiceTpl2 = template('placeOrder/list2', extraService);
+     me.find('.extra-service-list').html(extraServiceTpl);
+     me.find('.calc-items').html(extraServiceTpl2).addClass('hide');
+
+     cachePageData.extraServicePrice = 0;
+     cachePageData.extraServiceCount = 0;
+     } */
+
+    /* 在选择主服务、附加服务、宠物、时间、地点之后,重置保洁师
+     function resetTech(me) {
+     order.beautician.name = '请选择';
+     order.beautician.id = '';
+     $('.booking-people', me).html(order.beautician.name);
+     }  */
+
+    return {
+        title: '壹管家上门服务',
+        body: '',
+        init: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
+
+            /* 三个返回操作 */
+            $.newTouch('.back-button', function (event) {
+                back.call(this, event);
+            }, $view);
+            $view.on('tapBackButton', function (event) {
+                back.call(this, event);
+            });
+            $view.on('swipeRight', function (event) {
+                back.call(this, event);
+            });
+
+            /* 点击查看详情。跳转到product页面 */
+            $.newTouch('.product-pic-o2o', function (event) {
+                $doc.trigger('spa:navigate', {
+                    hash: 'product',
+                    pushData: {
+                        produc: product,
+                        needReload: true
+                    }
+                });
+            }, $view);
+
+            /*特效*/
+            setInterval(function run() {
+                $('.product-img').fadeToggle();
+            },500);
+            /* 点击选择extra。 */
+            $.newTouch('.btn-main-service', function (event) {
+                /* on代表这一条的选中状态。如果已经选中了,就return。this的作用域是这一条extra。 */
+                if ($(this).hasClass('on')) return;
+                /* 如果没有on状态,加上on。 */
+                $(this).addClass('on');
+                /* 删掉其他选择框的on状态 */
+                $(this).parent().siblings().find('.btn').removeClass('on');
+                /* 填写order */
+                order.appendID = $(this).attr('data-extra-type');
+                order.price = $(this).attr('data-extra-price');
+                order.cost = order.price * order.productCount;
+                // 重置代金券
+                $('.coupon-selected-name', $view).html('选择优惠券');
+                order.couponValue = 0;
+                order.couponID = '';
+                payCharge($('.order-cost', $view));
+            }, $view);
+
+            /* 点击选择地址 */
+            $.newTouch('.select-address', function (event) {
+                event.preventDefault();
+                /* 如果是微信客户端,跳转到addressList页面。 */
+                if (!config.isAndroid && !config.isIOS) {
+                    $doc.trigger('spa:navigate', {
+                        hash: 'addressList',
+                        pushData: {
+                            backHash: 'placeOrder'
+                        },
+                        callback: {
+                            /* 在addressList页面挑选之后,回到这个页面时执行的回调。 */
+                            onSelect: function (address, station) {
+                                order.set('address', address, true);
+                                order.set('stationID', station, true);
+
+                                var addressStr = '';
+                                if (order.address.address.poi) {
+                                    addressStr = order.address.address.city + order.address.address.area + order.address.address.poi.name + order.address.address.detail
+                                } else {
+                                    addressStr = order.address.address.province + order.address.address.city + order.address.address.area + order.address.address.detail
+                                }
+                                $('.order-address', $view).html(addressStr);
+                                $('.order-username', $view).html(order.address.name);
+                                $('.order-mobile', $view).html(order.address.mobile);
+                            }
+                        }
+                    });
+                }
+            }, $view);
+
+            /* 点击选择附加服务
+             $.newTouch('.item-checkbox', function (event) {
+             event.preventDefault();
+             // 如果'.main-service'元素的子元素数目为正(也就是说出现了选择主服务那一栏,也就是说在前一页选择的是附加服务),且不处于on状态(也就是还没有选择主服务)
+             if ($('.main-service', $view).length && !$('.main-service', $view).find('.btn-main-service').hasClass('on')) {
+             // 弹出一个对话框
+             $doc.trigger('spa:openpanel', ['simpleAlert', {
+             message: '请选择服务类型'
+             }]);
+             return;
+             }
+             // $(this).data('xxx'):获取this中data-xxx的数据。
+             // 获取这一条附加服务的相关的数据。select没用,估计是原来想用这个记录选中状态的。
+             var select = $(this).data('select'),
+             id = $(this).data('id'),
+             index = $(this).parent().index(),
+             price = $(this).data('price');
+             extraType = $(this).data('servicetype');
+             // 获取附加服务的总费用。
+             var extraCost = $('.order-cost', $view).attr('data-extra');
+             // 如果原来没有选中这一项,下面就是选中的操作
+             if (!$(this).hasClass('checked')) {
+             // 附加服务数量+1
+             cachePageData.extraServiceCount++;
+             // 保存附加服务的总价格
+             cachePageData.extraServicePrice += parseFloat(price);
+             // 添加checked状态
+             $(this).addClass('checked');
+             var serviceParam = {
+             product_id: id,
+             count: 1
+             }
+             // /为什么是个数组?
+             order.extraService[index] = serviceParam;
+             // 把订单详情中对应的项目添加on属性
+             $('.calc-items', $view).find('.select-extra-service').eq(index).addClass('on');
+             // 计算附加服务的总费用。
+             extraCost = parseFloat(extraCost) + parseFloat(price);
+             $('.order-cost', $view).attr('data-extra', extraCost);
+             }
+             // 如果原来选中了这一项,下面就是取消选中的操作
+             else {
+             // 附加服务数量-1
+             cachePageData.extraServiceCount--;
+             // 保存附加服务的总价格
+             cachePageData.extraServicePrice -= parseFloat(price);
+             // 删除checked属性
+             $(this).removeClass('checked');
+
+             order.extraService[index] = {};
+             // 把订单详情中对应的项目删掉on属性
+             $('.calc-items', $view).find('.select-extra-service').eq(index).removeClass('on');
+             // 计算附加服务的总费用。
+             extraCost = parseFloat(extraCost) - parseFloat(price);
+             $('.order-cost', $view).attr('data-extra', extraCost);
+             }
+             // 根据附加服务的数量,更新订单详情中附加服务模块的显示与隐藏
+             if (cachePageData.extraServiceCount > 0) {
+             $('.calc-items', $view).removeClass('hide');
+             } else {
+             $('.calc-items', $view).addClass('hide');
+             }
+             // 更新订单详情中每一条附加服务的显示与隐藏
+             if ($('.calc-items', $view).find('.select-extra-service').hasClass('on')) {
+             $('.calc-items', $view).removeClass('hide');
+             } else {
+             $('.calc-items', $view).addClass('hide');
+             }
+             // 计算总价钱
+             payCharge();
+             // 刷新界面
+             pageData.scroll.refresh();
+             }, $view); */
+
+            /* 点击选择保洁师
+             $.newTouch('.show-beautician-picker', function (event) {
+             // 如果订单的地址数据为空
+             if (!order.address || !order.address.address_id) {
+             // 弹出提示框
+             $doc.trigger('spa:openpanel', ['simpleAlert', {
+             message: '请选择地址'
+             }]);
+             return;
+             }
+             // 点击订单的预定时间为空
+             if (order.bookingDate == '' || order.bookingTime == '') {
+             // 弹出提示框
+             $doc.trigger('spa:openpanel', ['simpleAlert', {
+             message: '请选择上门时间'
+             }]);
+             return;
+             }
+             // 点击订单的主服务类型为空
+             if (!order.productType) {
+             // /弹出提示框
+             $doc.trigger('spa:openpanel', ['simpleAlert', {
+             message: '请选择服务类型'
+             }]);
+             return;
+             }
+             // 生成预定时间的字符串
+             var bookingTime = order.bookingDate + ' ' + order.bookingTime + ':00';
+             // 生成所有服务的字符串
+             var service_type_array = [order.productType];
+             var service_type = '[' + service_type_array.join(',') + ']';
+             // 根据服务、时间、地址,向服务器请求保洁师列表
+             user.getTechList(
+             service_type,
+             bookingTime,
+             order.address.address_id,
+             // 请求成功后跳转到beautician页面,在beautician页面展示保洁师列表
+             function (res) {
+             $doc.trigger('spa:navigate', {
+             hash: 'beautician',
+             pushData: {
+
+             }
+             });
+             }
+             );
+             }, $view);  */
+
+            /* 点击选择宠物相关
+             $.newTouch('.show-product-picker', function () {
+             // 如果有了selected属性,就return
+             if ($(this).hasClass('selected')) return;
+             event.preventDefault();
+             // 主服务>10是什么意思???
+             if (cachePageData.productType > 10) {
+             $doc.trigger('spa:openpanel', ['simpleAlert', {
+             message: '请选择服务类型'
+             }]);
+             return;
+             }
+             // 弹出一个列表选择框。
+             $doc.trigger('spa:openpanel', ['productOption', {
+             pets: product.productGroup[cachePageData.productType],
+             productType: cachePageData.productType,
+             callback: {
+             onSelect: function (petName, petWeight, petPrice) {
+             // set order info
+             order.petName = petName;
+             order.petWeight = petWeight;
+             order.petPrice = petPrice;
+             order.productType = cachePageData.productType;
+             order.petID = cart['products'][cachePageData.productType]['petID'];
+             order.productID = cart['products'][cachePageData.productType]['productID'];
+             // user.orderCoupons = res.data;
+             // 筛选附加服务
+             if (cachePageData.extraServiceType > 10) {
+             var selectExtraServiceName = cachePageData.defaultExtraService[cachePageData.extraServiceType].serviceName;
+             var selectExtraServicePrice = cachePageData.defaultExtraService[cachePageData.extraServiceType].servicePrice;
+
+             $('.order-cost', $view).attr('data-extra', selectExtraServicePrice);
+             }
+
+             suitExtraService($view, selectExtraServiceName);
+
+             $('.pet-info', $view).html(petName + ' (' + petWeight + ')');
+             $('.pet-type', $view).html(petName + ' (' + petWeight + ')');
+             $('.total-cost', $view).html('¥' + petPrice);
+
+             if ($('.calc-items', $view).find('.select-extra-service').hasClass('on')) {
+             $('.calc-items', $view).removeClass('hide');
+             petPrice = parseFloat(petPrice) + parseFloat(selectExtraServicePrice);
+             }
+
+             $('.order-cost', $view).attr('data-costs', order.petPrice);
+             $('.order-cost', $view).attr('data-extra', cachePageData.extraServicePrice);
+             $('.order-cost', $view).html('¥' + petPrice);
+
+             $('.select-pet', $view).removeClass('hide');
+
+             if (order['productID'] && order.bookingDate) {
+             setCoupon($view, pageData, cachePageData.extraServicePrice);
+             }
+
+             pageData.scroll.refresh();
+             }
+             }
+             }]);
+             }, $view); */
+
+            /* 点击数量-1 */
+            $.newTouch('.btn-sub', function (event) {
+                if (order.productCount <= 1) return;
+                if (order.price == 0) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择服务'
+                    }]);
+                    return;
+                }
+                var inputNum = $('.service-count', $view).children('.input-num').val();
+                if (isNaN(inputNum)) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请输入数字'
+                    }]);
+                    return false;
+                }
+                order.productCount = inputNum;
+                order.productCount--;
+                order.cost = order.productCount * order.price;
+                $('.service-count', $view).children('.input-num').val(order.productCount);
+                /* 算账 */
+                payCharge($('.order-cost', $view));
+            }, $view);
+
+            /*点击body重置金额*/
+            $.newTouch('body', function (event) {
+                //input输入
+                var inputNum = $('.service-count', $view).children('.input-num').val();
+                if (isNaN(inputNum)) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请输入数字'
+                    }]);
+                    return false;
+                }
+                //与input输入框的文本的数据做交互;
+                order.productCount = inputNum;
+                order.cost = order.productCount * order.price;
+                $('.service-count', $view).children('.input-num').val(order.productCount);
+            })
+
+            /* 点击数量+1 */
+            $.newTouch('.btn-add', function (event) {
+                if (order.productCount > 999) return;
+                if (order.price == 0) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        //message: '请选择extra'
+                        message: '请选择服务'
+                    }]);
+                    return;
+                }
+                var inputNum = $('.service-count', $view).children('.input-num').val();
+                if (isNaN(inputNum)) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请输入数字'
+                    }]);
+                    return false;
+                }
+                order.productCount = inputNum;
+                order.productCount++;
+                order.cost = order.productCount * order.price;
+                $('.service-count', $view).children('.input-num').val(order.productCount);
+                /* 算账 */
+                payCharge($('.order-cost', $view));
+            }, $view);
+
+            /* 点击选择时间 */
+            $.newTouch('.show-time-picker', function (event) {
+                event.preventDefault();
+                // 以下是构建时间选择器,不用管。直接看选完之后的回调。
+                var dayNamesA = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
+                var dayNamesB = ['今天'];
+                var columns = {
+                    columnDay: [],
+                    columnTime: []
+                };
+                var now = new Date().getHours();
+                var daySelectIndex = 0;
+                for (var i = 1; i <= 9; i++) {
+                    var dd = new Date();
+                    dd.setDate(dd.getDate() + i);
+
+                    var month = dd.getMonth() + 1;
+                    var day = dd.getDate();
+                    var date = month + '月' + day + '日';
+
+                    var dayStr = helper.getDateStr({
+                        date: dd,
+                        separator: '-'
+                    });
+
+                    var dayStrSuffix;
+                    if (i < dayNamesB.length) {
+                        dayStrSuffix = dayNamesB[i];
+                    } else {
+                        dayStrSuffix = dayNamesA[dd.getDay()];
+                    }
+                    var selected = false;
+                    if (order.bookingDate) {
+                        selected = true;
+                    }
+                    if (dayStr == order.bookingDate) {
+                        daySelectIndex = i;
+                    } else {
+                        daySelectIndex = -1;
+                    }
+                    columns.columnDay.push({
+                        text: date, // 几月几日
+                        day: dayStrSuffix, // 周几
+                        value: dayStr,
+                        selected: selected,
+                        selectIndex: daySelectIndex
+                    });
+                }
+
+                var currentDate = new Date();
+                var currentMonth = currentDate.getMonth() + 1;
+                var currentDay = currentDate.getDate();
+                var now = new Date().getHours();
+                var min = new Date().getMinutes();
+                var timeSelectIndex = 0;
+                for (var i = 9; i <= 19; i++) {
+                    var hour = i + ':00';
+                    var selected = false;
+                    if (order.bookingTime) {
+                        selected = true;
+                    }
+                    if (hour == order.bookingTime) {
+                        timeSelectIndex = i;
+                    } else {
+                        timeSelectIndex = -1;
+                    }
+                    columns.columnTime.push({
+                        month: currentMonth,
+                        day: currentDay,
+                        min: min,
+                        num: i,
+                        now: now,
+                        text: hour,
+                        value: hour,
+                        selected: selected,
+                        selectIndex: timeSelectIndex
+                    })
+                }
+                $doc.trigger('spa:openpanel', ['dataPicker', {
+                    // type: cachePageData.productType,
+                    columns: columns,
+                    selected: order.bookingDate,
+                    // offDay: product.offDay,
+                    callback: {
+                        // 选完之后的回调。values:[日期,时间];texts:时间字符串;precedence:是否加急;
+                        onSelect: function (values, texts, precedence) {
+                            // 重置代金券
+                            $('.coupon-selected-name', $view).html('选择优惠券');
+                            order.couponValue = 0;
+                            order.couponID = '';
+                            payCharge($('.order-cost', $view));
+                            // 填写order
+                            order.bookingDate = values[0];
+                            order.bookingTime = values[1];
+                            order.bookingTimeStr = texts[0] + ' ' + texts[1];
+                            order.precedence = precedence;
+                            // 更新预定时间组件
+                            $('.booking-time', $view).html(order.bookingTimeStr);
+                        }
+                    }
+                }]);
+            }, $view);
+
+            /* 点击选择优惠券 */
+            $.newTouch('.show-coupon-picker', function (event) {
+                if ($(this).hasClass('disabled')) return;
+                event.preventDefault();
+
+                var extraJson = '';
+                if (product.extra && !order.appendID) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择服务'
+                    }]);
+                    return;
+                } else {
+                    extraJson = JSON.stringify([{type: order.appendID, price: order.price}]);
+                }
+
+                // 必须先选择时间
+                if (!order.bookingDate) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择服务时间'
+                    }]);
+                    return;
+                }
+
+                // 跳转到picker页面,展示优惠券
+                $doc.trigger('spa:navigate', {
+                    hash: 'picker',
+                    pushData: {
+                        title: '选择优惠券',
+                        backHash: 'placeOrder',
+                        products: JSON.stringify([{
+                            product_id: order.productID,
+                            count: order.productCount
+                        }]),
+                        time: order.bookingDate + ' ' + order.bookingTime + ':00',
+                        type: order.productType,
+                        extraJson: extraJson
+                    },
+                    callback: {
+                        // 在picker页面挑选之后,回到这个页面时执行的回调。pickValue:选中的优惠券的ID;
+                        onSelect: function (pickValue) {
+                            if (pickValue == '') {
+                                $('.coupon-selected-name', $view).text('不使用');
+                                order.couponValue = 0;
+                            } else {
+                                for (var i in user.orderCoupons) {
+                                    var couponInfo = user.orderCoupons[i];
+                                    if (couponInfo.id == pickValue) {
+                                        $('.coupon-selected-name', $view).text(couponInfo['coupon']['name']);
+                                        order.couponValue = couponInfo['coupon']['value'];
+                                        break;
+                                    }
+                                }
+                            }
+                            // 填写order
+                            order.couponID = pickValue;
+                            // 计算总费用
+                            payCharge($('.order-cost', $view));
+                        }
+                    }
+                });
+            }, $view);
+
+            /* 是否选中同意用户协议,关系到下订单按钮是否激活 */
+            $.newTouch('.agreement-touch-area', function (event) {
+                var agreementObj = $('.agreement-checkbox', $view);
+                if (agreementObj.prop('checked')) {
+                    agreementObj.prop('checked', false);
+                    $('.btn-place').addClass('disable');
+                } else {
+                    agreementObj.prop('checked', true);
+                    $('.btn-place').removeClass('disable');
+                }
+            }, $view);
+
+            /* 跳转到agreement页面查看协议 */
+            $.newTouch('.agreement', function (event) {
+                $doc.trigger('spa:navigate', {
+                    hash: 'agreement'
+                });
+            }, $view);
+
+            /* 点击下订单 */
+            $.newTouch('.btn-place', function (event) {
+                event.preventDefault();
+                if ($(this).hasClass('disable')) {
+                    return false;
+                }
+                if (product.type_str == "擦玻璃" && order.productCount < 10) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '数量不少于10平米'
+                    }]);
+                    return;
+                }
+
+                if (product.type_str == "新居开荒" && order.productCount < 50) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '数量不少于50平米'
+                    }]);
+                    return;
+                }
+                if (product.extra && !order.appendID) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择服务'
+                    }]);
+                    return;
+                }
+
+                if (!order.address) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择地址'
+                    }]);
+                    return;
+                }
+
+                if (!order.bookingTimeStr) {
+                    $doc.trigger('spa:openpanel', ['simpleAlert', {
+                        message: '请选择上门时间'
+                    }]);
+                    return;
+                }
+
+
+                var payChannel = 'wx_pub';
+
+                /* 使备注输入框失去焦点,获取值 */
+                $('.order-memo', $view).blur();
+                order.set('memo', $('.order-memo', $view).val());
+
+                /* 向服务器下订单 */
+                $doc.trigger('spa:openloader');
+                if (user.balance >= order.payValue) {
+                    order.balance = order.payValue;
+                    order.payValue = 0;
+                } else {
+                    order.balance = user.balance;
+                    order.payValue = order.payValue - order.balance;
+                }
+                order.addOrder(user.id, payChannel, function (res) {
+                    $doc.trigger('spa:closeloader');
+                    if (res.success) {
+                        // 更新user的订单
+                        user.orders[1].data.push(res.data);
+                        // 更新user的优惠券
+                        var oldCouponList = user.orderCoupons;
+                        var oldCouponId = order.couponID;
+                        var newCouponList = [];
+                        $.each(oldCouponList, function (index, val) {
+                            if (val.id !== oldCouponId) {
+                                newCouponList.push(oldCouponList[index])
+                            }
+                        });
+                        user.orderCoupons = newCouponList;
+
+                        var orderID = order.id;
+                        order.reset();
+                        $('.booking-time', $view).html('请选择');
+
+                        if (res.data.status == 1) {
+                            $doc.trigger('spa:navigate', {
+                                hash: 'paySuccess'
+                            });
+                        } else {
+                            $doc.trigger('spa:navigate', {
+                                hash: 'pay',
+                                pushData: {
+                                    orderID: orderID,
+                                    backHash: ''
+                                }
+                            });
+                        }
+                    } else {
+                        $doc.trigger('spa:openpanel', ['simpleAlert', {
+                            message: res.message
+                        }]);
+                    }
+                });
+            }, $view);
+
+            dtd.resolve();
+        },
+        beforeopen: function (pageData, dtd) {
+            var $view = this;
+            var pushData = pageData.pushData;
+            /* 只有首页跳转来,才会带有needReset = true */
+            if (pushData.hasOwnProperty('needReset') && pushData.needReset) {
+                /* 接收首页传来的product,填写order的productType(产品类型)、productID(产品ID)两个字段 */
+                pushData.needReset = false;
+                product = pushData.product;
+
+                order.productType = product.type;
+                order.productID = product.id;
+                order.productCount = 1;
+                order.couponValue = 0;
+                /* 根据product建立渲染页面的数据 */
+                var tmpData = {
+                    /* 环境,目前只决定是否显示保洁师 */
+                    env: config,
+                    /* 环境 */
+                    showNavBar: !config.isWX && !config.isChubao,
+                    imgSrc: product.imgSrc,
+                    /* 标题栏的标题 */
+                    title: product.name,
+                    /* extra选择项 */
+                    extra: product.extra,
+                    /* 如果用户有优惠券,则显示优惠券的选择栏 */
+                    showCoupon: user.orderCoupons.length,
+                    /* 账户余额 */
+                    balance: user.balance
+                };
+                /* 渲染页面 */
+                var tpl = template('placeOrder/index', tmpData);
+                $view.find('.spa-page-body').html(tpl);
+                /* 绑定费用数据 */
+                if (product.extra) {
+                    order.price = 0;
+                    order.cost = 0;
+                } else {
+                    order.price = product.price;
+                    order.cost = product.price * order.productCount;
+                }
+                payCharge($('.order-cost', $view));
+
+                /* 软键盘相关操作时对IScroll的补偿 */
+                fixScroll(pageData);
+                $('.order-memo', $view).focus(function (event) {
+                    var that = this;
+                    checkScroll(pageData, function () {
+                        if (pageData.scroll) {
+                            pageData.scroll.scrollToElement(that, 0);
+                        }
+                    });
+                });
+                $('.order-memo', $view).on('closeKeyboard', function (event) {
+                    checkScroll(pageData);
+                    $(this).blur();
+                });
+                $('.order-memo', $view).blur(function (event) {
+                    checkScroll(pageData);
+                });
+
+                /* 填写备注时,提交按钮失焦 */
+                $('#order-form', $view).on('submit', function (event) {
+                    $(this).blur();
+                    return false;
+                });
+            }
+            dtd.resolve();
+        },
+        afteropen: function (pageData, dtd) {
+            var type = pageData.pushData.productType;
+            native.registerEvent(true);
+            dtd.resolve();
+            if (config.isWX) {
+                wx.ready(function () {
+                    wx.onMenuShareTimeline({
+                        title: '家政服务' + product.desc[1].content + ',首选壹管家',
+                        link: 'http://www.yiguanjia.me/o2o/web/index',
+                        imgUrl: product.desc[0].content
+                    });
+                    wx.onMenuShareAppMessage({
+                        title: '家政服务' + product.desc[1].content + ',首选壹管家',
+                        desc: '全程管家,精心每一个细节',
+                        link: 'http://www.yiguanjia.me/o2o/web/index',
+                        imgUrl: product.desc[0].content
+                    });
+                });
+            }
+        },
+        afterclose: function (pageData) {
+            native.registerEvent(false);
+        }
+    }
+})

+ 209 - 208
www/webapp/o2o/js/page/product.js

@@ -1,211 +1,212 @@
 define(['$', 'template', 'product', 'cart', 'api', 'order', 'user', 'config', 'review', 'native'], function ($, template, product, cart, api, order, user, config, review, native) {
 
-	/* 返回上一级 */
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: 'placeOrder'
-		});
-	}
-
-	function renderReviewTemplate(reviews, hasMore) {
-		var tpl = template('product/reviewList', {
-			reviews: reviews,
-			imgW: parseInt((document.body.clientWidth - 30) / 3) - 5
-		});
-		$('#productReviewScroll .list-content').append(tpl);
-
-		if (hasMore) {
-			$('#productReviewScroll .btn-more-container').removeClass('hide');
-		} else {
-			$('#productReviewScroll .btn-more-container').addClass('hide');
-		}
-	}
-
-	var isShowVideo = function () {
-		var show = true;
-		// 判断安卓版本
-		var UA = navigator.userAgent;
-		var index = UA.indexOf("Android");
-		if (index >= 0) {
-			var androidVersion = parseFloat(UA.slice(index + 8));
-			if (androidVersion < 4.4) {
-				show = false;
-			}
-		}
-		return false;
-	}
-
-	var cachePageData = {}; //page内部的数据传递
-
-	return {
-		title: '壹管家上门服务',
-		body: '',
-		init: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-
-			/* 三个返回操作 */
-			$.newTouch('.back-button', function (event) {
-				back.call(this, event);
-			}, $view);
-			$view.on('tapBackButton', function (event) {
-				back.call(this, event);
-			});
-			$view.on('swipeRight', function (event) {
-				back.call(this, event);
-			});
-
-			// 提示信息
-			$.newTouch('.btn-product-info', function (event) {
-				$doc.trigger('spa:navigate', {
-					hash: 'product-info/' + cachePageData.product.type,
-					pushData: {
-						needReload: cachePageData.needReload,
-						fromHome: cachePageData.fromHome
-					}
-				});
-			}, $view);
-
-			// 提示信息
-			$.newTouch('.group-title-container', function (event) {
-				if ($(this).find('.group-title').hasClass('active')) {
-					$(this).find('.group-title').removeClass('active');
-					$(this).next('.group-detail').addClass('hide');
-				} else {
-					$(this).find('.group-title').addClass('active');
-					$(this).next('.group-detail').removeClass('hide');
-				}
-				cachePageData.scroll.refresh();
-			}, $view);
-
-			// 点击用户头像 打开用户个人中心
-			$.newTouch('.user-info-btn', function (event) {
-				var url = 'http://www.yiguanjia.me'
-				if (config.test) {
-					url = 'http://wwwtest.yiguanjia.me';
-				}
-				var id = $(this).attr('data-id');
-				var param = {
-					url: url + '/user/' + id
-				};
-				native.openURL(param);
-			}, $view);
-
-			//tab切换
-			$.newTouch('.type-control .control-item', function (event) {
-				if (isShowVideo()) {
-					$('#iframe-service-introduce', $view).contents().find('video')[0].pause();
-				}
-
-				var type = $(this).data('type');
-				$('.type-container', $view).hide();
-				switch (type) {
-					case 1:
-						$('#descContainer').show();
-						break;
-					case 2:
-						$('#reviewContainer').show();
-						if (cachePageData.needReloadReview) {
-							cachePageData.needReloadReview = false;
-							$doc.trigger('spa:openloader');
-							review.getList(cachePageData.product.type, function (res) {
-								$doc.trigger('spa:closeloader');
-								var hasMore = true;
-								if (res.current_page >= res.sum_page) {
-									hasMore = false;
-								}
-								if (res.success) {
-									renderReviewTemplate(res.data.comments, hasMore);
-								}
-								if (cachePageData.reviewScroll) {
-									cachePageData.reviewScroll.destroy();
-									cachePageData.reviewScroll = null;
-								}
-								setTimeout(function () {
-									cachePageData.reviewScroll = new IScroll('#productReviewScroll');
-								}, 10);
-							}, true);
-						}
-						break;
-					case 3:
-						$('#consultationContainer').show();
-						break;
-					default:
-						break;
-				}
-			}, $view);
-
-			// 图片预览
-			$.newTouch('.img-preview', function (event) {
-				var current = $(this).attr('data-src');
-				var i = $(this).parents('.table-view-cell').index();
-				var imgList = review['reviewDatas'][cachePageData.product.type]['list'][i]['pics'];
-				var imgLists = [];
-				imgList.forEach(function (item, index) {
-					imgLists.push(item.url)
-				});
-				native.previewImage(imgLists, current);
-			}, $view);
-
-			//加载更多
-			$.newTouch('.btn-more-review', function (event) {
-				$doc.trigger('spa:openloader');
-				review.getList(cachePageData.product.type, function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						var hasMore = true;
-						if (res.current_page >= res.sum_page) {
-							hasMore = false;
-						}
-						renderReviewTemplate(res.data.comments, hasMore);
-						cachePageData.reviewScroll.refresh();
-					}
-				}, false);
-			}, $view);
-
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
-			var pushData = pageData.pushData;
-
-			//渲染空页面
-			cachePageData.product = pushData.produc;
-			cachePageData.needReload = pushData.needReload;
-			if (cachePageData.needReload) {
-				cachePageData.needReloadReview = true;
-				var commentCounts = 0;
-				var productType = cachePageData.product.type;
-				$doc.trigger('spa:openloader');
-				review.getList(productType, function (res) {
-					if (res.success) {
-						commentCounts = res.sum_count;
-						var tpl = template('product/index', {
-							type: productType,
-							title: cachePageData.product.name,
-							// tips: product.getGroupDesc(productType),
-							picLists: cachePageData.product.pics,
-							commentCounts: commentCounts,
-							showNavBar: !config.isWX && !config.isChubao,
-							// isShowVideo: isShowVideo()
-						});
-						$('.spa-page-body', $view).html(tpl);
-
-						var iframeW = document.body.clientWidth - 30;
-						$('#iframe-service-introduce', $view).height(Math.ceil(iframeW * 360 / 640));
-
-						setTimeout(function () {
-							cachePageData.scroll = new IScroll('#productDescScroll');
-						}, 1000);
-
-						$doc.trigger('spa:closeloader');
-					}
-				}, false);
-			}
-
-			dtd.resolve();
-		}
-	}
+    /* 返回上一级 */
+    function back(event) {
+        event.preventDefault();
+        $(document).trigger('spa:navigate', {
+            hash: 'placeOrder'
+        });
+    }
+
+    function renderReviewTemplate(reviews, hasMore) {
+        var tpl = template('product/reviewList', {
+            reviews: reviews,
+            imgW: parseInt((document.body.clientWidth - 30) / 3) - 5
+        });
+
+        $('#productReviewScroll .list-content').append(tpl);
+
+        if (hasMore) {
+            $('#productReviewScroll .btn-more-container').removeClass('hide');
+        } else {
+            $('#productReviewScroll .btn-more-container').addClass('hide');
+        }
+    }
+
+    var isShowVideo = function () {
+        var show = true;
+        // 判断安卓版本
+        var UA = navigator.userAgent;
+        var index = UA.indexOf("Android");
+        if (index >= 0) {
+            var androidVersion = parseFloat(UA.slice(index + 8));
+            if (androidVersion < 4.4) {
+                show = false;
+            }
+        }
+        return false;
+    }
+
+    var cachePageData = {}; //page内部的数据传递
+
+    return {
+        title: '壹管家上门服务',
+        body: '',
+        init: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
+
+            /* 三个返回操作 */
+            $.newTouch('.back-button', function (event) {
+                back.call(this, event);
+            }, $view);
+            $view.on('tapBackButton', function (event) {
+                back.call(this, event);
+            });
+            $view.on('swipeRight', function (event) {
+                back.call(this, event);
+            });
+
+            // 提示信息
+            $.newTouch('.btn-product-info', function (event) {
+                $doc.trigger('spa:navigate', {
+                    hash: 'product-info/' + cachePageData.product.type,
+                    pushData: {
+                        needReload: cachePageData.needReload,
+                        fromHome: cachePageData.fromHome
+                    }
+                });
+            }, $view);
+
+            // 提示信息
+            $.newTouch('.group-title-container', function (event) {
+                if ($(this).find('.group-title').hasClass('active')) {
+                    $(this).find('.group-title').removeClass('active');
+                    $(this).next('.group-detail').addClass('hide');
+                } else {
+                    $(this).find('.group-title').addClass('active');
+                    $(this).next('.group-detail').removeClass('hide');
+                }
+                cachePageData.scroll.refresh();
+            }, $view);
+
+            // 点击用户头像 打开用户个人中心
+            $.newTouch('.user-info-btn', function (event) {
+                var url = 'http://www.yiguanjia.me'
+                if (config.test) {
+                    url = 'http://wwwtest.yiguanjia.me';
+                }
+                var id = $(this).attr('data-id');
+                var param = {
+                    url: url + '/user/' + id
+                };
+                native.openURL(param);
+            }, $view);
+
+            //tab切换
+            $.newTouch('.type-control .control-item', function (event) {
+                if (isShowVideo()) {
+                    $('#iframe-service-introduce', $view).contents().find('video')[0].pause();
+                }
+
+                var type = $(this).data('type');
+                $('.type-container', $view).hide();
+                switch (type) {
+                    case 1:
+                        $('#descContainer').show();
+                        break;
+                    case 2:
+                        $('#reviewContainer').show();
+                        if (cachePageData.needReloadReview) {
+                            cachePageData.needReloadReview = false;
+                            $doc.trigger('spa:openloader');
+                            review.getList(cachePageData.product.type, function (res) {
+                                $doc.trigger('spa:closeloader');
+                                var hasMore = true;
+                                if (res.current_page >= res.sum_page) {
+                                    hasMore = false;
+                                }
+                                if (res.success) {
+                                    renderReviewTemplate(res.data.comments, hasMore);
+                                }
+                                if (cachePageData.reviewScroll) {
+                                    cachePageData.reviewScroll.destroy();
+                                    cachePageData.reviewScroll = null;
+                                }
+                                setTimeout(function () {
+                                    cachePageData.reviewScroll = new IScroll('#productReviewScroll');
+                                }, 10);
+                            }, true);
+                        }
+                        break;
+                    case 3:
+                        $('#consultationContainer').show();
+                        break;
+                    default:
+                        break;
+                }
+            }, $view);
+
+            // 图片预览
+            $.newTouch('.img-preview', function (event) {
+                var current = $(this).attr('data-src');
+                var i = $(this).parents('.table-view-cell').index();
+                var imgList = review['reviewDatas'][cachePageData.product.type]['list'][i]['pics'];
+                var imgLists = [];
+                imgList.forEach(function (item, index) {
+                    imgLists.push(item.url)
+                });
+                native.previewImage(imgLists, current);
+            }, $view);
+
+            //加载更多
+            $.newTouch('.btn-more-review', function (event) {
+                $doc.trigger('spa:openloader');
+                review.getList(cachePageData.product.type, function (res) {
+                    $doc.trigger('spa:closeloader');
+                    if (res.success) {
+                        var hasMore = true;
+                        if (res.current_page >= res.sum_page) {
+                            hasMore = false;
+                        }
+                        renderReviewTemplate(res.data.comments, hasMore);
+                        cachePageData.reviewScroll.refresh();
+                    }
+                }, false);
+            }, $view);
+
+            dtd.resolve();
+        },
+        beforeopen: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
+            var pushData = pageData.pushData;
+
+            //渲染空页面
+            cachePageData.product = pushData.produc;
+            cachePageData.needReload = pushData.needReload;
+            if (cachePageData.needReload) {
+                cachePageData.needReloadReview = true;
+                var commentCounts = 0;
+                var productType = cachePageData.product.type;
+                $doc.trigger('spa:openloader');
+                review.getList(productType, function (res) {
+                    if (res.success) {
+                        commentCounts = res.sum_count;
+                        var tpl = template('product/index', {
+                            type: productType,
+                            title: cachePageData.product.name,
+                            // tips: product.getGroupDesc(productType),
+                            picLists: cachePageData.product.pics,
+                            commentCounts: commentCounts,
+                            showNavBar: !config.isWX && !config.isChubao,
+                            // isShowVideo: isShowVideo()
+                        });
+                        $('.spa-page-body', $view).html(tpl);
+
+                        var iframeW = document.body.clientWidth - 30;
+                        $('#iframe-service-introduce', $view).height(Math.ceil(iframeW * 360 / 640));
+
+                        setTimeout(function () {
+                            cachePageData.scroll = new IScroll('#productDescScroll');
+                        }, 1000);
+
+                        $doc.trigger('spa:closeloader');
+                    }
+                }, false);
+            }
+
+            dtd.resolve();
+        }
+    }
 });

+ 92 - 95
www/webapp/o2o/js/page/rechargee.js

@@ -1,107 +1,104 @@
 define(['$', 'template', 'IScroll', 'recharge', 'native', 'config', 'user'], function ($, template, IScroll, recharge, native, config, user) {
 
-	function back(event) {
-		event.preventDefault();
-		$(document).trigger('spa:navigate', {
-			hash: '',
-			pushData: {
-				dontNeedReload: true
-			}
-		});
-	}
+    function back(event) {
+        event.preventDefault();
+        $(document).trigger('spa:navigate', {
+            hash: '',
+            pushData: {
+                dontNeedReload: true
+            }
+        });
+    }
 
-	return {
-		title: '充值卡',
-		body: '',
-		init: function (pageData, dtd) {
-			/* this是什么? */
-			var $view = this;
-			var $doc = $(document);
+    return {
+        title: '充值卡',
+        body: '',
+        init: function (pageData, dtd) {
+            /* this是什么? */
+            var $view = this;
+            var $doc = $(document);
 
-			/* 定义按钮事件。
-			 * 为什么不是$(selector).onclick(function)呢?
-			 */
+            /* 定义按钮事件。
+             * 为什么不是$(selector).onclick(function)呢?
+             */
 
-			// 返回
-			$view.on('swipeRight', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			});
+            // 返回
+            $view.on('swipeRight', function (event) {
+                //back.call(this, event);
+                history.go(-1);
+            });
 
-			$.newTouch('.back-button', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			}, $view);
+            $.newTouch('.back-button', function (event) {
+                //back.call(this, event);
+                history.go(-1);
+            }, $view);
 
-			$view.on('tapBackButton', function (event) {
-				//back.call(this, event);
-				history.go(-1);
-			});
+            $view.on('tapBackButton', function (event) {
+                //back.call(this, event);
+                history.go(-1);
+            });
 
-			// 点击充值
-			$.newTouch('.btn-add-recharge', function (event) {
-				event.preventDefault();
-				$doc.trigger('spa:openloader');
-				var value = $(this).attr('data-value');
-				recharge.addRechargeorder({
-					user_id: user.id,
-					recharge_id: $(this).attr('data-id')
-				}, function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						// 更新user的订单
-						user.orders[1].data.push({
-							id: res.data._id.$id,
-							products: [{product: {name: '充值' + value + '元'}}],
-							final_price: res.data.price
-						});
-						// 只能用现金支付,跳转到pay页面
-						$doc.trigger('spa:navigate', {
-							hash: 'pay',
-							pushData: {
-								isRecharge: true,
-								orderID: res.data._id.$id,
-								backHash: 'recharge'
-							}
-						});
-					}
-				});
-			}, $view);
+            // 点击充值
+            $.newTouch('.btn-add-recharge', function (event) {
+                event.preventDefault();
+                $doc.trigger('spa:openloader');
+                var value = $(this).attr('data-value');
+                recharge.addRechargeorder({
+                    user_id: user.id,
+                    recharge_id: $(this).attr('data-id')
+                }, function (res) {
+                    $doc.trigger('spa:closeloader');
+                    if (res.success) {
+                        // 更新user的订单
+                        user.orders[1].data.push({
+                            id: res.data._id.$id,
+                            products: [{ product:{name: '充值' + value + '元'}}],
+                            final_price: res.data.price
+                        });
+                        // 只能用现金支付,跳转到pay页面
+                        $doc.trigger('spa:navigate', {
+                            hash: 'pay',
+                            pushData: {
+                                isRecharge: true,
+                                orderID: res.data._id.$id,
+                                backHash: 'recharge'
+                            }
+                        });
+                    }
+                });
+            }, $view);
 
-			dtd.resolve();
-		},
-		beforeopen: function (pageData, dtd) {
-			dtd.resolve();
-		},
-		afteropen: function (pageData, dtd) {
-			var $view = this;
-			var $doc = $(document);
+            dtd.resolve();
+        },
+        beforeopen: function (pageData, dtd) {
+            dtd.resolve();
+        },
+        afteropen: function (pageData, dtd) {
+            var $view = this;
+            var $doc = $(document);
 
-			if (!pageData.pushData.dontNeedReload) {
-				$doc.trigger('spa:openloader');
-				recharge.getRechargeList(function (res) {
-					$doc.trigger('spa:closeloader');
-					if (res.success) {
-						var tpl = template('recharge/index', {
-							showNavBar: !config.isWX,
-							recharges: res.data
-						});
-						$('.spa-page-body', $view).html(tpl);
-						//var value = $(this).attr('data-value');
-						var value = $('.btn-add-recharge').attr('data-index');
-						for (var i = value; i < 2; i++) {
-						}
-						setTimeout(function () {
-							pageData.scroll = new IScroll('#rechargeScroll');
-						}, 500);
-					}
-				});
-			}
+            if (!pageData.pushData.dontNeedReload) {
+                $doc.trigger('spa:openloader');
+                recharge.getRechargeList(function (res) {
+                    $doc.trigger('spa:closeloader');
+                    if (res.success) {
+                        var tpl = template('recharge/index', {
+                            showNavBar: !config.isWX,
+                            recharges: res.data
+                        });
+                        $('.spa-page-body', $view).html(tpl);
 
-			dtd.resolve();
-		},
-		beforeclose: function (pageData, dtd) {
-			dtd.resolve();
-		}
-	}
+                        setTimeout(function () {
+                            pageData.scroll = new IScroll('#rechargeScroll');
+                        }, 500);
+                    }
+                });
+            }
+
+            dtd.resolve();
+        },
+        beforeclose: function (pageData, dtd) {
+            dtd.resolve();
+        }
+    }
 })

+ 0 - 118
www/webapp/o2o/js/page/secondary.js

@@ -1,118 +0,0 @@
-define(['$', 'template', 'IScroll', 'user', 'product', 'native', 'config', 'address'], function ($, template, IScroll, user, product, native, config, address) {
-
-    function back(event) {
-        event.preventDefault();
-        $(document).trigger('spa:navigate', {
-            hash: '',
-            pushData: {
-                dontNeedReload: true
-            }
-        });
-    }
-
-    /*
-     * 模块结构:5部分。
-     * title:题目。
-     * content:不知道是什么,似乎从没用过。
-     * 以下可以当作生命周期回调,虽然并不清楚是什么时候回调的……
-     * init:根据上一个页面传来的pageData初始化本页数据,生成页面,绑定事件。
-     * beforeopen:接收上一个页面传来的数据、有需要的话重置数据
-     * afteropen:做一些网络请求。
-     * beforeclose:
-     */
-    return {
-        title: '家庭保洁',
-        body: '',
-        init: function (pageData, dtd) {
-            /* this是什么? */
-            var $view = this;
-            var $doc = $(document);
-
-            /* 定义按钮事件。
-             * 为什么不是$(selector).onclick(function)呢?
-             */
-
-            // 返回
-            $view.on('swipeRight', function (event) {
-                back.call(this, event);
-            });
-
-            $.newTouch('.back-button', function (event) {
-                back.call(this, event);
-            }, $view);
-
-            $view.on('tapBackButton', function (event) {
-                back.call(this, event);
-            });
-
-
-            /* 点击产品列表的某一项 */
-            $.newTouch('.btn-product', function (event) {
-                event.preventDefault();
-                var type = parseInt($(this).attr('data-product-type'));
-                /*
-                 * 这个写法是SPA路由框架规定的。
-                 * $(selector).trigger(event, params)是jQuery的:触发被选元素上的指定事件
-                 */
-                $doc.trigger('spa:navigate', {
-                    hash: 'placeOrder',
-                    pushData: {
-                        product: product.allList[type - 1],
-                        needReset: true
-                    }
-                });
-            }, $view);
-            /*首页*/
-            $.newTouch('.btn-action-my-order', function () {
-                event.preventDefault();
-                $doc.trigger('spa:navigate', {
-                    hash: '',
-                    pushData: {
-                        needReset: true
-                    }
-                });
-            },$view);
-            /*个人中心*/
-            $.newTouch('.btn-action-coupon', function (event) {
-                event.preventDefault();
-                user.checkLogin(function () {
-                    $doc.trigger('spa:navigate', {
-                        hash: 'mine',
-                        pushData: {
-                            needReset: true
-                        }
-                    });
-                });
-            }, $view);
-            /* 不知道什么意思。*/
-            dtd.resolve();
-        },
-        beforeopen: function (pageData, dtd) {
-            dtd.resolve();
-        },
-        afteropen: function (pageData, dtd) {
-            var $view = this;
-            var $doc = $(document);
-
-            if (pageData.pushData && pageData.pushData.needReset) {
-                /*var tpl = template('secondary/index', {
-                 showNavBar: !config.isWX,
-                 userName: user.name == '' ? '未登录' : user.name,
-                 userBalance: user.balance,
-                 defaultAddress: addressStr
-                 });*/
-                var tpl = template('secondary/index', {showNavBar: !config.isWX});
-                $('.spa-page-body', $view).html(tpl);
-                setTimeout(function () {
-                    pageData.scroll = new IScroll('#secondaryScroll');
-                }, 500);
-            }
-
-            /* 又是这个。不知道什么玩意…… */
-            dtd.resolve();
-        },
-        beforeclose: function (pageData, dtd) {
-            dtd.resolve();
-        }
-    }
-})

+ 3 - 13
www/webapp/o2o/js/panel/alert.js

@@ -1,20 +1,10 @@
-define(['$', 'template','product'], function ($, template,product) {
+define(['$', 'template'], function ($, template) {
 	return {
 		body: '',
 		init: function (pageData, dtd) {
 			var $view = this;
-			var $doc = $(document);
+
 			$.newTouch('button', function (event) {
-				// console.log($(this).html());
-				if($(this).html()==="查看"){
-					event.preventDefault();
-					$doc.trigger('spa:navigate', {
-						hash: 'myCoupon',
-						pushData: {
-							needReload: true
-						}
-					});
-				}
 				event.stopPropagation();
 				event.preventDefault();
 				var buttonIndex = $(this).data('button-index');
@@ -25,7 +15,7 @@ define(['$', 'template','product'], function ($, template,product) {
 
 				$view.trigger('spa:closepanel');
 			}, $view);
-$.newTouch('.newTouch')
+
 			dtd.resolve();
 		},
 		beforeopen: function (pageData, dtd) {

+ 0 - 48
www/webapp/o2o/tpl/activities/day.html

@@ -1,48 +0,0 @@
-{{ if showNavBar }}
-<header class="bar bar-nav">
-	<a class="left-button back-button">
-		<div class="icon icon-left-nav"></div>
-	</a>
-	<h1 class="title">双十一活动</h1>
-</header>
-{{ /if }}
-<div id="activities-scroll" class="content">
-	<div class="scroller">
-		<div class="box-container">
-			<div class="box-container box box-vertical" style="background: #fff">
-				<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%801-%E7%AC%AC%E4%B8%80%E9%83%A8%E5%88%86.jpg" alt="">
-				<!--下单-->
-				<div style="position: relative;margin-top: -0.2rem;margin-bottom: -0.2rem;">
-					<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%801.jpg" alt="">
-					<div style="    width: 32.7%;
-    padding-bottom: 10.5%;
-    position: absolute;
-    left: 35.6%;
-    top: 0;" class="btn-appliances" data-product-type="9" ></div>
-				</div>
-				<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%803-%E7%AC%AC%E4%BA%8C%E9%83%A8%E5%88%86.jpg" alt="">
-				<!--优惠券-->
-				<div style="position: relative;margin-top: -0.2rem;margin-bottom: -0.2rem;">
-					<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%802.jpg" alt="">
-					<div style="    width: 32.7%;
-    padding-bottom: 10.5%;
-    position: absolute;
-    left: 35.6%;
-    top: 0;" class="btn-banner-coupon"></div>
-				</div>
-				<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%805-%E7%AC%AC%E4%B8%89%E9%83%A8%E5%88%86.jpg" alt="">
-				<!--充值卡-->
-				<div style="position: relative;margin-top: -0.2rem;margin-bottom: -0.2rem;">
-					<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%803.jpg" alt="">
-					<div style="    width: 32.7%;
-    padding-bottom: 10.5%;
-    position: absolute;
-    left: 35.6%;
-    top: 0;" class="btn-banner-recharge"></div>
-				</div>
-				<img style="width: 100%;" src="http://odulvej8l.bkt.clouddn.com/%E5%8F%8C%E5%8D%81%E4%B8%807-%E7%AC%AC%E5%9B%9B%E9%83%A8%E5%88%86.jpg" alt="">
-			</div>
-		</div>
-	</div>
-</div>
-</div>

+ 8 - 9
www/webapp/o2o/tpl/desc/index.html

@@ -1,16 +1,15 @@
 {{ if showNavBar }}
 <header class="bar bar-nav">
-    <a class="left-button back-button">
-        <div class="icon icon-left-nav"></div>
-    </a>
-
-    <h1 class="title">服务介绍</h1>
+	<a class="left-button back-button">
+		<div class="icon icon-left-nav"></div>
+	</a>
+	<h1 class="title">服务介绍</h1>
 </header>
 {{ /if }}
 
 <div class="content" id="descScroll">
-    <div class="scroller">
-        <div></div>
-
-    </div>
+	<div class="scroller">
+		<div>
+			
+	</div>
 </div>

+ 120 - 82
www/webapp/o2o/tpl/home/index.html

@@ -1,89 +1,127 @@
 {{ if showNavBar }}
 <header class="bar bar-nav">
-	<a class="left-button back-button">
-		<div class="icon icon-left-nav"></div>
-	</a>
-	<a class="right-button service-telephone">
-		<div></div>
-	</a>
+    <a class="left-button back-button">
+        <div class="icon icon-left-nav"></div>
+    </a>
+    <a class="right-button service-telephone">
+        <div></div>
+    </a>
 
-	<h1 class="title">壹管家</h1>
+    <h1 class="title">壹管家</h1>
 </header>
 {{ /if }}
 <div class="content">
-	<div class="box-container">
-		<div class="box-container box box-vertical">
-			<div id="homeScroll" class="scroll-container box-flex-1">
-				<div class="scroller">
-					<div class="home-content">
-						<!-- Swiper -->
-						<div class="swiper-container">
-							<div class="swiper-wrapper">
-								<div class="swiper-slide">
-									<!--<img class="btn-appliances" data-product-type="9" src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6.jpg" alt="">-->
-									<img class="btn-home-day" data-product-type="9" src="http://odulvej8l.bkt.clouddn.com/11%E5%85%83banner.jpg" alt="">
-								</div>
-								<div class="swiper-slide btn-banner-recharge">
-									<img src="http://odulvej8l.bkt.clouddn.com/banner-2.jpg" alt="">
-								</div>
-								<div class="swiper-slide btn-banner-coupon">
-									<img src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6-2.jpg" alt="">
-								</div>
-							</div>
-							<div class="pagination"></div>
-						</div>
-						<img class="home-remy" src="http://odulvej8l.bkt.clouddn.com/%E5%9B%BE%E6%A0%87-01.jpg" alt="">
-
-						<div class="home-box">
-							<div class="width-percent-50 box-align-center">
-								<img class="btn-secondary" src="http://odulvej8l.bkt.clouddn.com/4-1-01.png" alt="">
-							</div>
-							<div class="width-percent-50 box-align-center ">
-								<img class="btn-appliances" data-product-type="4" src="http://odulvej8l.bkt.clouddn.com/4-2-01.png"
-								     alt="">
-							</div>
-							<div class="width-percent-50 box-align-center">
-								<img class="btn-homestay" src="http://odulvej8l.bkt.clouddn.com/4-3-01.png" alt="">
-							</div>
-							<div class="width-percent-50 box-align-center">
-								<img class="btn-homeenterprise" src="http://odulvej8l.bkt.clouddn.com/4-4-01.png" alt="">
-							</div>
-						</div>
-
-					</div>
-				</div>
-				<div class="prevent-scroll">
-					<div class="box my-action">
-						<!--首页-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-my-order">
-									<div class="logo logo-my-order"></div>
-									<div class="name">首页</div>
-								</a>
-							</div>
-						</div>
-						<!--LOGO-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
-									<div class="logo logo-my-logo"></div>
-								</a>
-							</div>
-						</div>
-						<!--我的-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-coupon">
-									<div class="logo logo-coupon"></div>
-									<div class="name">我的</div>
-								</a>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-
-		</div>
-	</div>
+    <div class="box-container">
+        <div class="box-container box box-vertical">
+            <div id="homeScroll" class="scroll-container box-flex-1">
+                <div class="scroller">
+                    <div class="home-content">
+                        <!-- Swiper -->
+                        <div class="swiper-container swiper-container-horizontal">
+                            <div class="swiper-wrapper"
+                                 style="transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;">
+                                <div class="swiper-slide swiper-slide-active btn-banner-recharge"><img
+                                        src="http://odulvej8l.bkt.clouddn.com/banner_1.jpg" alt=""></div>
+                                <div class="swiper-slide swiper-slide-next btn-banner-coupon"><img
+                                        src="http://odulvej8l.bkt.clouddn.com/test_banner_21.png" alt=""></div>
+                            </div>
+                            <!-- Add Pagination -->
+                            <div class="swiper-pagination swiper-pagination-clickable swiper-pagination-bullets"><span
+                                    class="swiper-pagination-bullet swiper-pagination-bullet-active"></span><span
+                                    class="swiper-pagination-bullet"></span></div>
+                        </div>
+                        <!--<div class="box main-service-box width-percent-100">
+                            <div class="title-column-left box-container">
+                                <div class="title-container-square">
+                                    <div class="the-main-figure">
+                                        <img src="http://odulvej8l.bkt.clouddn.com/Home_image_3.jpg" alt=""/>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>-->
+                        <!-- 隐藏标签
+                        <div class="global-msg" style="display: flex;justify-content: space-between; padding: 15px;">
+                            <div class="width-percent-25 btn-product-group global-msg-active" data-group-index="0">家庭保洁</div>
+                            <div class="width-percent-25 btn-product-group" data-group-index="1">月子服务</div>
+                            <div class="width-percent-25 btn-product-group" data-group-index="2">保姆服务</div>
+                            <div class="width-percent-25 btn-product-group" data-group-index="3">家庭产品</div>
+                        </div>
+                        -->
+                        <div>
+                            <ul class="products-list" id="list0">
+                                <li class="btn-product" style="border-top: 1px solid rgb(241, 241, 241); border-right: 1px solid rgb(241, 241, 241); border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="1">
+                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%281%29.png" width="50px" height="50px">-->
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81icon_1.png" width="50px" height="50px">
+                                    <div class="extra-service-name">日常清洁</div>
+                                </li>
+                                <li class="btn-product" style="border-top: 1px solid rgb(241, 241, 241); border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="2">
+                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%282%29.png"  width="50px" height="50px">-->
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81icon_1.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">深度清洁</div>
+                                </li>
+                                <li class="btn-product" style="border-right: 1px solid rgb(241, 241, 241);border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="3">
+                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%283%29.png"  width="50px" height="50px">-->
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8Cicon_01.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">除螨杀菌</div>
+                                </li>
+                                <li class="btn-product" style="border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="4">
+                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%287%29.png"  width="50px" height="50px">-->
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97icon_01.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">家电清洗</div>
+                                </li>
+                                <li class="btn-product" style="border-right: 1px solid rgb(241, 241, 241);border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="5">
+                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%286%29.png"  width="50px" height="50px">-->
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92icon_01.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">新居开荒</div>
+                                </li>
+                                <li class="btn-product" style="border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="6">
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83icon-003.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">擦玻璃</div>
+                                </li> <li class="btn-product" style="border-right: 1px solid rgb(241, 241, 241);border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="7">
+                                <img src="http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4icon-002.png"  width="50px" height="50px">
+                                <div class="extra-service-name">母婴房清洁</div>
+                            </li>
+                                <li class="btn-product" style="border-bottom: 1px solid rgb(241, 241, 241);width: 49%; text-align: center; padding-top: 10px; padding-bottom: 10px" data-product-type="8">
+                                    <img src="http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BFicon-001.png"  width="50px" height="50px">
+                                    <div class="extra-service-name">租房大扫除</div>
+                                </li>
+                            </ul>
+                        </div>
+                        <!--<div style="width: 100%; height: 80px"></div>-->
+                        <div style="width: 100%;padding-bottom: 14%"></div>
+                    </div>
+                </div>
+            </div>
+            <div class="prevent-scroll">
+                <div class="box my-action">
+                    <!--首页-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-my-order">
+                                <div class="logo logo-my-order"></div>
+                                <div class="name">首页</div>
+                            </a>
+                        </div>
+                    </div>
+                    <!--LOGO-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
+                                <div class="logo logo-my-logo"></div>
+                            </a>
+                        </div>
+                    </div>
+                    <!--我的-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-coupon">
+                                <div class="logo logo-coupon"></div>
+                                <div class="name">我的</div>
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
 </div>

+ 0 - 68
www/webapp/o2o/tpl/homeEnterprise/index.html

@@ -1,68 +0,0 @@
-{{ if showNavBar }}
-<header class="bar bar-nav">
-	<a class="left-button back-button">
-		<div class="icon icon-left-nav"></div>
-	</a>
-	<h1 class="title">企业服务</h1>
-</header>
-{{ /if }}
-
-<div class="content">
-	<div class="box-container">
-		<div class="box-container box box-vertical">
-			<div id="homeenterpriseScroll" class="scroll-container box-flex-1">
-				<div class="scroller">
-					<div class="home-stay-content">
-						<img
-							src="http://odulvej8l.bkt.clouddn.com/1107%E4%BC%81%E4%B8%9A%E6%9C%8D%E5%8A%A1%E8%AF%A6%E6%83%85%E9%A1%B5.jpg"
-							style="width: 100%;">
-
-						<div style="padding-bottom:10%;"></div>
-					</div>
-				</div>
-				<div class="prevent-scroll">
-					<div class="o2o-btn-homestay" style="
-					    text-align: center;
-              background: rgb(219,199,67);
-              color: #fff;
-              position: absolute;
-              right: 0;
-              width: 25%;
-              top: -1.65rem;
-              border: 0px solid rgba(0,0,0,0.14);
-              border-radius: 14px;
-              line-height: 1.5rem;">点击咨询
-					</div>
-					<div class="box my-action">
-						<!--首页-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-my-order">
-									<div class="logo logo-my-order"></div>
-									<div class="name">首页</div>
-								</a>
-							</div>
-						</div>
-						<!--LOGO-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
-									<div class="logo logo-my-logo"></div>
-								</a>
-							</div>
-						</div>
-						<!--我的-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-coupon">
-									<div class="logo logo-coupon"></div>
-									<div class="name">我的</div>
-								</a>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>

+ 0 - 68
www/webapp/o2o/tpl/homestay/index.html

@@ -1,68 +0,0 @@
-{{ if showNavBar }}
-<header class="bar bar-nav">
-	<a class="left-button back-button">
-		<div class="icon icon-left-nav"></div>
-	</a>
-	<h1 class="title">民宿保洁</h1>
-</header>
-{{ /if }}
-
-<div class="content">
-	<div class="box-container">
-		<div class="box-container box box-vertical">
-			<div id="homestayScroll" class="scroll-container box-flex-1">
-				<div class="scroller">
-					<div class="home-stay-content">
-						<img
-							src="http://odulvej8l.bkt.clouddn.com/%E6%B0%91%E5%AE%BF%E4%BF%9D%E6%B4%81%E8%AF%A6%E6%83%85%E9%A1%B51.jpg"
-							style="width: 100%;">
-
-						<div style="padding-bottom:10%;"></div>
-					</div>
-				</div>
-				<div class="prevent-scroll">
-					<div class="o2o-btn-homestay" style="
-					    text-align: center;
-              background: rgb(219,199,67);
-              color: #fff;
-              position: absolute;
-              right: 0;
-              width: 25%;
-              top: -1.65rem;
-              border: 0px solid rgba(0,0,0,0.14);
-              border-radius: 14px;
-              line-height: 1.5rem;">点击咨询
-					</div>
-					<div class="box my-action">
-						<!--首页-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-my-order">
-									<div class="logo logo-my-order"></div>
-									<div class="name">首页</div>
-								</a>
-							</div>
-						</div>
-						<!--LOGO-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
-									<div class="logo logo-my-logo"></div>
-								</a>
-							</div>
-						</div>
-						<!--我的-->
-						<div class="width-percent-33">
-							<div class="title-container-square">
-								<a class="btn-home-action btn-action-coupon">
-									<div class="logo logo-coupon"></div>
-									<div class="name">我的</div>
-								</a>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-</div>

+ 76 - 76
www/webapp/o2o/tpl/mine/index.html

@@ -1,92 +1,92 @@
 {{ if showNavBar }}
 <header class="bar bar-nav">
-	<a class="left-button back-button">
-		<div class="icon icon-left-nav"></div>
-	</a>
-
-	<h1 class="title">{{title}}</h1>
+    <a class="left-button back-button">
+        <div class="icon icon-left-nav"></div>
+    </a>
+    <h1 class="title">{{title}}</h1>
 </header>
 {{ /if }}
 
 <div class="content">
-	<div class="box-container box box-vertical">
-		<div id="mineScroll" class="scroll-container box-flex-1">
-			<div class="">
-				<div class="user">
-					<img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg" alt="">
-					<div class="user-image"><img src="{{userAvatar}}"></div>
-					<div class="user-name">{{userName}}</div>
-				</div>
-				<div class="user-balance"><span><img
-					src="http://odulvej8l.bkt.clouddn.com/mine-%E9%92%B1%E8%A2%8B%E5%AD%90-01.png" alt=""></span>我的余额:{{userBalance}}元
-				</div>
-				<div class="mine-type">
-					<div class="width-percent-33 btn-my-order">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
+    <div class="box-container box box-vertical">
+        <div id="mineScroll" class="scroll-container box-flex-1">
+            <div class="">
+                <div class="user">
+                    <img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%BA%95%E7%BA%B9.jpg" alt="">
+
+                    <div class="user-image"></div>
+                    <div class="user-name">{{userName}}</div>
+                </div>
+                <div class="user-balance"><span><img
+                        src="http://odulvej8l.bkt.clouddn.com/mine-%E9%92%B1%E8%A2%8B%E5%AD%90-01.png" alt=""></span>我的余额:{{userBalance}}元
+                </div>
+                <div class="mine-type">
+                    <div class="width-percent-33 btn-my-order">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E8%AE%A2%E5%8D%95icon-01.png" alt="">
 
-						<div class="mine-text">订单</div>
-					</div>
-					<div class="width-percent-33 btn-recharge">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%85%85%E5%80%BC%E5%8D%A1icon-01-01.png" alt="">
+                        <div class="mine-text">订单</div>
+                    </div>
+                    <div class="width-percent-33 btn-recharge">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%85%85%E5%80%BC%E5%8D%A1icon-01-01.png" alt="">
 
-						<div class="mine-text">充值卡</div>
-					</div>
-					<div class="width-percent-33 btn-address-list">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%9C%B0%E5%9D%80icon-01-01.png" alt="">
+                        <div class="mine-text">充值卡</div>
+                    </div>
+                    <div class="width-percent-33 btn-address-list">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%9C%B0%E5%9D%80icon-01-01.png" alt="">
 
-						<div class="mine-text">地址</div>
-					</div>
-					<div class="width-percent-33 btn-contact">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%BB%BA%E8%AE%AEicon-01-01.png" alt="">
+                        <div class="mine-text">地址</div>
+                    </div>
+                    <div class="width-percent-33 btn-contact">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%BB%BA%E8%AE%AEicon-01-01.png" alt="">
 
-						<div class="mine-text">建议</div>
-					</div>
-					<div class="width-percent-33 btn-coupon">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E4%BB%A3%E9%87%91%E5%88%B8icon-01-01-01.png" alt="">
+                        <div class="mine-text">建议</div>
+                    </div>
+                    <div class="width-percent-33 btn-coupon">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E4%BB%A3%E9%87%91%E5%88%B8icon-01-01-01.png" alt="">
 
-						<div class="mine-text">代金券</div>
-					</div>
-					<div class="width-percent-33 btn-about">
-						<img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%85%B3%E4%BA%8Eicon-01-01-01.png" alt="">
+                        <div class="mine-text">代金券</div>
+                    </div>
+                    <div class="width-percent-33 btn-about">
+                        <img src="http://odulvej8l.bkt.clouddn.com/mine-%E5%85%B3%E4%BA%8Eicon-01-01-01.png" alt="">
 
-						<div class="mine-text">关于</div>
-					</div>
-				</div>
-				<!--<div style="width: 100%;padding-bottom: 250px"></div>-->
-			</div>
+                        <div class="mine-text">关于</div>
+                    </div>
+                </div>
+                <!--<div style="width: 100%;padding-bottom: 250px"></div>-->
+            </div>
 
-			<div class="prevent-scroll">
-				<div class="box my-action">
-					<!--首页-->
-					<div class="width-percent-33">
-						<div class="title-container-square">
-							<a class="btn-home-action btn-action-my-order">
-								<div class="logo logo-my-order"></div>
-								<div class="name">首页</div>
-							</a>
-						</div>
-					</div>
-					<!--LOGO-->
-					<div class="width-percent-33">
-						<div class="title-container-square">
-							<a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
-								<div class="logo logo-my-logo"></div>
-							</a>
-						</div>
-					</div>
-					<!--我的-->
-					<div class="width-percent-33">
-						<div class="title-container-square">
-							<a class="btn-home-action btn-action-coupon">
-								<div class="logo logo-coupon"></div>
-								<div class="name">我的</div>
-							</a>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
+            <div class="prevent-scroll">
+                <div class="box my-action">
+                    <!--首页-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-my-order">
+                                <div class="logo logo-my-order"></div>
+                                <div class="name">首页</div>
+                            </a>
+                        </div>
+                    </div>
+                    <!--LOGO-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
+                                <div class="logo logo-my-logo"></div>
+                            </a>
+                        </div>
+                    </div>
+                    <!--我的-->
+                    <div class="width-percent-33">
+                        <div class="title-container-square">
+                            <a class="btn-home-action btn-action-coupon">
+                                <div class="logo logo-coupon"></div>
+                                <div class="name">我的</div>
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
 </div>
 <!--
 <div class="content">

+ 2 - 2
www/webapp/o2o/tpl/myOrder/index.html

@@ -7,8 +7,8 @@
 </header>
 {{ /if }}
 
-<div class="content box box-vertical" style="background-color: #fff;">
-  <div class="segmented-control order-type-control">
+<div class="content box box-vertical">
+  <div class="segmented-control order-type-control prevent-scroll">
     <a class="control-item {{if type == '1'}}active{{/if}}" data-order-type="1">预约中</a>
     <a class="control-item {{if type == '2'}}active{{/if}}" data-order-type="3">已完成</a>
     <a class="control-item {{if type == '3'}}active{{/if}}" data-order-type="2">已取消</a>

+ 2 - 3
www/webapp/o2o/tpl/package.json

@@ -2,7 +2,7 @@
     "name": "template",
     "version": "1.0.0",
     "dependencies": {
-        "tmodjs": "1.0.4"
+        "tmodjs": "1.0.3"
     },
     "tmodjs-config": {
         "output": "../js/build",
@@ -15,7 +15,6 @@
         "runtime": "template.js",
         "combo": true,
         "minify": true,
-        "cache": true,
-        "verbose": true
+        "cache": true
     }
 }

+ 4 - 14
www/webapp/o2o/tpl/placeOrder/index.html

@@ -12,21 +12,13 @@
         <div class="box-container box box-vertical">
             <div id="placeOrderScroll" class="scroll-container box-flex-1">
                 <div class="scroller">
-                    <div class="o2o-product-html">
+                    <div class="">
                         <ul class="table-view product-pic-o2o">
                             <li id="product-pic-bg">
                                 <img src="{{imgSrc}}" style="width: 100%;" alt="">
                                 <!--<div class="product-name">{{title}}详情及评价 <span id="hot">&gt;&gt;&gt;</span></div>-->
                                 <div class="product-img"></div>
                             </li>
-                            <li class="o2o-singles-day" style="display: none;">
-                                <h4 style="padding: 0 0 0 10px">本次活动明细</h4>
-                                <p style="margin: 0 10px"><label style="font-weight:700;font-size: 14px;">1、</label>11元活动产品仅于2016/11/11-2016/11/13在线销售,每日销售111份,共计333份。</p>
-                                <p style="margin: 0 10px"><label style="font-weight:700;font-size: 14px;">2、</label>本产品为日常保洁服务,不包含擦玻璃、家电清洁、大扫除等深层服务内容</p>
-                                <p style="margin: 0 10px"><label style="font-weight:700;font-size: 14px;">3、</label>每个微信号限购买1次,每个地址限使用1次,限虹口区地址的民用住宅使用,不限房型。</p>
-                                <p style="margin: 0 10px"><label style="font-weight:700;font-size: 14px;">4、</label>购买产品后,请于2016/11/11-2016/11/24之间拨打400-806-5111,预约服务时间,服务时间为2016/11/14-2016/12/23内。</p>
-                                <p style="margin: 0 10px"><label style="font-weight:700;font-size: 14px;">5、</label>在未使用的情况下,可于2016/11/14后拨打400-806-5111,申请退款。</p>
-                            </li>
                         </ul>
                         <!-- 选择extra -->
                         {{if extra}}
@@ -43,7 +35,7 @@
                         {{/if}}
                         <ul class="table-view">
                             <!-- 选择数量 -->
-                            <li class="table-view-cell show-time-picker">
+                            <li class="table-view-cell">
                                 <div class="link-label show-product-picker selected">
                                     购买数量
                                     <div class="service-count">
@@ -111,6 +103,7 @@
                                           style="display: block; position: static; text-align: right">选择服务时间</span>
                                 </a>
                             </li>
+
                         </ul>
                         <!-- 附加服务
                         <div class="extra-service-title">附加服务</div>
@@ -178,7 +171,7 @@
                         -->
                         <!-- 优惠券 -->
                         <ul class="table-view">
-                            <li class="show-coupon-picker table-view-cell {{if !showCoupon }}disabled{{/if}}">
+                            <li class="table-view-cell {{if !showCoupon }}disabled{{/if}}">
                                 <a class="navigate-right show-coupon-picker"
                                    style="display: flex; justify-content:space-between; align-items: center; padding-right: 2rem">
                                     优惠券
@@ -246,12 +239,9 @@
                 </span>
                             </div>
                         </div>
-                        <!--高度补偿-->
-                        <div class="o2o-height" style="width: 100%;"></div>
                     </div>
                 </div>
             </div>
-
             <div class="result-item btn-container prevent-scroll" style="padding-left: 15px; display: flex; justify-content: space-between; align-items: center">
                 <!--<div style="font-size: 0.8rem">账户余额<span class="order-cost" style="font-size: 0.8rem; color: #ec5330; text-align: right; display: inline">¥ {{balance}}</span></div>-->
                 <div style="font-size: 0.8rem">费用总计:<span class="order-cost" style="font-size: 0.8rem; color: #ec5330; text-align: right; display: inline">¥ 0</span></div><a class="btn btn-main btn-block btn-place">确认预约</a>

+ 1 - 1
www/webapp/o2o/tpl/product/option.html

@@ -9,4 +9,4 @@
 			<a class="btn btn-cancle btn-block btn-next">取消</a>
 		</div>
 	</div>
-</div>
+</div>

+ 27 - 27
www/webapp/o2o/tpl/product/reviewList.html

@@ -2,10 +2,10 @@
 <li class="table-view-cell">
 	<div>
 		<div class="user-info-container">
-			<div class="user-info-btn" data-id="{{review.user.id}}">
-				<img class="user-avatar" src="{{review.user.avatar}}?imageView2/2/w/60/h/60"/>
-				<span class="user-name">{{ review.user.user_name }}</span>
-			</div>
+      <div class="user-info-btn" data-id="{{review.user.id}}">
+  			<img class="user-avatar" src="{{review.user.avatar}}?imageView2/2/w/60/h/60"/>
+  			<span class="user-name">{{ review.user.user_name }}</span>
+      </div>
 		</div>
 		<div class="box">
 			<div class="box-flex-1">
@@ -16,30 +16,30 @@
 				{{ review.time_str }}
 			</div>
 		</div>
-		<div class="review-content">
+    <div class="review-content">
 			{{ review.content }}
 		</div>
-		<div class="img-preview-list" {{if review.pics.length> 0}}style="height:{{imgW}}px"{{/if}}>
-			{{if review.pics.length > 0}}
-			{{each review.pics as pic i}}
-			{{if i < 3}}
-			<div class="width-percent-33">
-				<div class="img-preview" data-src="{{pic.url}}" style="width: {{imgW}}px">
-					<img src="{{pic.url}}?imageView2/5/w/{{imgW * 2}}/h/{{imgW * 2}}" alt="" class="img-preview-item">
-					{{if review.pics.length > 3 && i == 2}}
-					<span class="img-count">{{review.pics.length}}</span>
-					{{/if}}
-				</div>
-			</div>
-			{{/if}}
-			{{/each}}
-			{{/if}}
-		</div>
-		{{if review.reply !== ''}}
-		<div class="reply-content">
-			壹管家回复:{{review.reply}}
-		</div>
-		{{/if}}
-	</div>
+    <div class="img-preview-list" {{if review.pics.length > 0}}style="height:{{imgW}}px"{{/if}}>
+      {{if review.pics.length > 0}}
+      {{each review.pics as pic i}}
+      {{if i < 3}}
+      <div class="width-percent-33">
+        <div class="img-preview" data-src="{{pic.url}}" style="width: {{imgW}}px">
+          <img src="{{pic.url}}?imageView2/5/w/{{imgW * 2}}/h/{{imgW * 2}}" alt="" class="img-preview-item">
+          {{if review.pics.length > 3 && i == 2}}
+          <span class="img-count">{{review.pics.length}}</span>
+          {{/if}}
+        </div>
+      </div>
+      {{/if}}
+      {{/each}}
+      {{/if}}
+    </div>
+    {{if review.reply !== ''}}
+    <div class="reply-content">
+      壹管家回复:{{review.reply}}
+    </div>
+    {{/if}}
+  </div>
 </li>
 {{ /each }}

+ 1 - 12
www/webapp/o2o/tpl/recharge/cell.html

@@ -1,4 +1,3 @@
-<!--
 {{ each recharges as recharge i }}
 <li class="table-view-cell media btn-add-recharge" data-id="{{ recharge.id }}" data-value="{{ recharge.denomination }}"
     data-index="{{ i }}" style="margin: 10px">
@@ -16,14 +15,4 @@
     </a>
     <button class="btn btn-add-recharge" data-id="{{ recharge.id }}" data-value="{{ recharge.denomination }}" data-index="{{ i }}" style="background-color: rgba(146,118,3,1);color: rgb(233,233,216);border: 0;border-radius: 0px;">立即充值</button>
 </li>
-{{ /each }}-->
-
-
-
-{{ each recharges as recharge i }}
-<li class="media btn-add-recharge" data-id="{{ recharge.id }}" data-value="{{ recharge.denomination }}"
-    data-index="{{ i }}">
-    <div></div>
-    <span>立即充值>>></span>
-</li>
-{{ /each }}
+{{ /each }}

+ 1 - 2
www/webapp/o2o/tpl/recharge/index.html

@@ -9,8 +9,7 @@
 <div class="content">
     <div class="box-container box box-vertical">
         <div id="rechargeScroll" class="scroll-container box-flex-1">
-            <img src="http://odulvej8l.bkt.clouddn.com/1101%E5%85%85%E5%80%BC%E5%8D%A1.jpg" style="width: 100%;">
-            <ul class="table-view list-content list-recharge" style="padding-top: 5px;padding-bottom: 5px">
+            <ul class="table-view list-content" style="padding-top: 5px;padding-bottom: 5px">
                 {{include './cell'}}
             </ul>
         </div>

+ 0 - 194
www/webapp/o2o/tpl/secondary/index.html

@@ -1,194 +0,0 @@
-{{ if showNavBar }}
-<header class="bar bar-nav">
-    <a class="left-button back-button">
-        <div class="icon icon-left-nav"></div>
-    </a>
-    <h1 class="title">家庭保洁</h1>
-</header>
-{{ /if }}
-
-<div class="content">
-    <div class="box-container">
-        <div class="box-container box box-vertical">
-            <div id="secondaryScroll" class="scroll-container box-flex-1">
-                <div class="scroller">
-                    <div class="secondary-content">
-                        <div class="secondary-head">
-                            <img src="http://odulvej8l.bkt.clouddn.com/banner-01.jpg" alt="">
-                            <img src="http://odulvej8l.bkt.clouddn.com/%E4%BA%8C%E7%BA%A7%E5%85%83%E7%B4%A0-01.png" alt="">
-                        </div>
-                        <div class="secondary-list">
-                            <ul class="products-list" id="list0">
-                                <li class="btn-product" data-product-type="1">
-                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%281%29.png" width="50px" height="50px">-->
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81icon_1.png">
-
-                                    <div class="extra-service-name">日常清洁</div>
-                                </li>
-                                <li class="Long-term-set">
-                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%287%29.png"  width="50px" height="50px">-->
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E9%95%BF%E6%9C%9F%E5%AE%9Aicon-01-01-01.png">
-
-                                    <div class="extra-service-name">敬请期待</div>
-                                </li>
-                                <li class="btn-product" data-product-type="2">
-                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%282%29.png"  width="50px" height="50px">-->
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81icon_1.png">
-
-                                    <div class="extra-service-name">深度清洁</div>
-                                </li>
-                                <li class="btn-product" data-product-type="3">
-                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%283%29.png"  width="50px" height="50px">-->
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8Cicon_01.png">
-
-                                    <div class="extra-service-name">除螨杀菌</div>
-                                </li>
-
-                                <li class="btn-product" data-product-type="5">
-                                    <!--<img src="http://oduj3utzz.bkt.clouddn.com/Home_btn_clean%20%286%29.png"  width="50px" height="50px">-->
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92icon_01.png">
-
-                                    <div class="extra-service-name">新居开荒</div>
-                                </li>
-                                <li class="btn-product" data-product-type="6">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83icon-003.png">
-
-                                    <div class="extra-service-name">擦玻璃</div>
-                                </li>
-                                <li class="btn-product" data-product-type="7">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4icon-002.png">
-
-                                    <div class="extra-service-name">母婴房清洁</div>
-                                </li>
-                                <li class="btn-product" data-product-type="8">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BFicon-001.png">
-
-                                    <div class="extra-service-name">租房大扫除</div>
-                                </li>
-                            </ul>
-                        </div>
-                    </div>
-                </div>
-                <div class="prevent-scroll">
-                    <div class="box my-action">
-                        <!--首页-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-my-order">
-                                    <div class="logo logo-my-order"></div>
-                                    <div class="name">首页</div>
-                                </a>
-                            </div>
-                        </div>
-                        <!--LOGO-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-logo"
-                                   href="weixin://contacts/profile/honghaitzz">
-                                    <div class="logo logo-my-logo"></div>
-                                </a>
-                            </div>
-                        </div>
-                        <!--我的-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-coupon">
-                                    <div class="logo logo-coupon"></div>
-                                    <div class="name">我的</div>
-                                </a>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-
-
-<!--
-<div id="secondaryScroll" class="scroll-container box-flex-1">
-    <div class="scroller">
-        <div class="secondary-content">
-            <div class="secondary-head">
-                <img src="../images/banner-01.jpg" alt="">
-                <img src="../images/二级元素-01.png" alt="">
-            </div>
-            <div class="secondary-list">
-                <ul class="products-list" id="list0">
-                    <li class="btn-product" data-product-type="1">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E6%97%A5%E5%B8%B8%E6%B8%85%E6%B4%81icon_1.png">
-
-                        <div class="extra-service-name">日常清洁</div>
-                    </li>
-                    <li class="btn-product" data-product-type="2">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81icon_1.png">
-
-                        <div class="extra-service-name">深度清洁</div>
-                    </li>
-                    <li class="btn-product" data-product-type="3">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8Cicon_01.png">
-
-                        <div class="extra-service-name">除螨杀菌</div>
-                    </li>
-                    <li class="btn-product" data-product-type="4">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97icon_01.png">
-
-                        <div class="extra-service-name">家电清洗</div>
-                    </li>
-                    <li class="btn-product" data-product-type="5">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92icon_01.png">
-
-                        <div class="extra-service-name">新居开荒</div>
-                    </li>
-                    <li class="btn-product" data-product-type="6">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83icon-003.png">
-
-                        <div class="extra-service-name">擦玻璃</div>
-                    </li>
-                    <li class="btn-product" data-product-type="7">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4icon-002.png">
-
-                        <div class="extra-service-name">母婴房清洁</div>
-                    </li>
-                    <li class="btn-product" data-product-type="8">
-                        <img src="http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BFicon-001.png">
-
-                        <div class="extra-service-name">租房大扫除</div>
-                    </li>
-                </ul>
-            </div>
-            <div class="prevent-scroll">
-                <div class="box my-action">
-                    &lt;!&ndash;首页&ndash;&gt;
-                    <div class="width-percent-33">
-                        <div class="title-container-square">
-                            <a class="btn-home-action btn-action-my-order">
-                                <div class="logo logo-my-order"></div>
-                                <div class="name">首页</div>
-                            </a>
-                        </div>
-                    </div>
-                    &lt;!&ndash;LOGO&ndash;&gt;
-                    <div class="width-percent-33">
-                        <div class="title-container-square">
-                            <a class="btn-home-action btn-action-logo"
-                               href="weixin://contacts/profile/honghaitzz">
-                                <div class="logo logo-my-logo"></div>
-                            </a>
-                        </div>
-                    </div>
-                    &lt;!&ndash;我的&ndash;&gt;
-                    <div class="width-percent-33">
-                        <div class="title-container-square">
-                            <a class="btn-home-action btn-action-coupon">
-                                <div class="logo logo-coupon"></div>
-                                <div class="name">我的</div>
-                            </a>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>-->

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov