Ver Fonte

Merge branch 'test' of git.oschina.net:yiguanjia/php into test

north há 8 anos atrás
pai
commit
c1e98fa27c

+ 2 - 2
www/protected/modules/o2o/views/web/index.php

@@ -10,7 +10,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/framework/ratchet-2.0.2/dist/css/ratchet.min.css">
     <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/framework/ratchet-2.0.2/dist/css/ratchet-theme-ios.min.css">
-    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/o2o/dist/css/main.css?v=2017052500">
+    <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/webapp/o2o/dist/css/main.css?v=2017052502">
     <link href="<?php echo Yii::app()->request->baseUrl; ?>/css/common_o2o/swiper.css" rel="stylesheet">
     <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/o2o/swiper.min.js"></script>
     <style>
@@ -76,7 +76,7 @@
       location.hash = '';
     }
     var debug = false;
-    var main = '<?php echo Yii::app()->request->baseUrl;?>/webapp/o2o/dist/js/main.js?v=2017052500';
+    var main = '<?php echo Yii::app()->request->baseUrl;?>/webapp/o2o/dist/js/main.js?v=2017052502';
     if (debug) {
       main = '<?php echo Yii::app()->request->baseUrl;?>/webapp/o2o/js/main.js?v=' + (new Date()).getTime();
       document.getElementById('debugMain').src = '<?php echo Yii::app()->request->baseUrl; ?>/webapp/common/js/debuggap.js';

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/main.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
www/webapp/o2o/dist/js/page/placeOrder.js


Diff do ficheiro suprimidas por serem muito extensas
+ 3 - 4
www/webapp/o2o/js/build/template.js


+ 928 - 1434
www/webapp/o2o/js/model/product.js

@@ -2,1450 +2,944 @@
  * 商品模型
  */
 define(['base', '$', 'api'], function (base, $, api) {
-    var Product = function () {
-        if (typeof Product.instance === 'object') {
-            return Product.instance;
-        }
-        Product.instance = this;
-        this.storagePrefix = 'product_';//存储前缀
+  var Product = function () {
+    if (typeof Product.instance === 'object') {
+      return Product.instance;
+    }
+    Product.instance = this;
+    this.storagePrefix = 'product_';//存储前缀
 
-        /* 我新加的 */
-        /* this.allList = [
-         {
-         id: "57e0dffc9f5160dd048b4568",
-         name: "日常清洁",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_02.png',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_rc.jpg"}, {content: "日常清洁"}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "1",
-         type_str: "日常清洁",
-         extra: [
-         {
-         type: "一室一卫",
-         price: "98"
-         },
-         {
-         type: "两室一卫",
-         price: "118"
-         },
-         {
-         type: "两室两卫",
-         price: "138"
-         },
-         {
-         type: "三室两卫",
-         price: "158"
-         },
-         {
-         type: "四室三卫",
-         price: "228"
-         },
-         {
-         type: "200-250平米",
-         price: "298"
-         },
-         {
-         type: "200-300平米",
-         price: "398"
-         },
-         {
-         type: "三层别墅",
-         price: "498"
-         },
-         {
-         type: "四层别墅",
-         price: "598"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_02.png",
-         width: 537,
-         height: 537
-         },
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
-         width: 720,
-         height: 1165
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/ada69b8adb17b1475912214579.png",
-         width: 720,
-         height: 1129
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/rcqj_xqy_03.jpg",
-         width: 720,
-         height: 1127
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/03c6e0266e4661475977941220.png",
-         width: 720,
-         height: 1178
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/1e3638af93cab1475977951089.jpg",
-         width: 720,
-         height: 1246
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/cfd996a3783d11475977959884.png",
-         width: 720,
-         height: 520
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/d67ff4fcad4bc1475977977827.png",
-         width: 720,
-         height: 644
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/78ce92ec0d52d1475977966417.png",
-         width: 720,
-         height: 644
-         }
-         ]
-         },
-         {
-         id: "57e0e0189f5160dc048b4568",
-         name: "深度清洁",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_01.png',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_sd.jpg"}, {content: "深度清洁"}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "2",
-         type_str: "深度清洁",
-         extra: [
-         {
-         type: "卧室清洁",
-         price: "188"
-         },
-         {
-         type: "客厅清洁",
-         price: "288"
-         },
-         {
-         type: "厨房清洁",
-         price: "388"
-         },
-         {
-         type: "卫生间清洁",
-         price: "188"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_01.png",
-         width: 658,
-         height: 663
-         },
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
-         width: 720,
-         height: 1165
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/e295c92da2e7c1475913803198.png",
-         width: 720,
-         height: 1129
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/363f18ed617211475913944488.jpg",
-         width: 720,
-         height: 1246
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/64a1375694e091475913947183.png",
-         width: 720,
-         height: 715
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/8cf32629eece91475913957779.png",
-         width: 720,
-         height: 674
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/0ef470cf13ea51475914131334.jpg",
-         width: 720,
-         height: 786
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/341746e8065381475978339748.jpg",
-         width: 720,
-         height: 832
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/beb99ec9850041475978342874.jpg",
-         width: 720,
-         height: 1178
-         }
-         ]
-         },
-         {
-         id: "57e0e0369f5160b1048b456b",
-         name: "除螨杀菌",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_04.png',
-         desc: [{content: 'http://odqeoyzxd.bkt.clouddn.com/image/image_etsj.jpg'}, {content: "除螨杀菌"}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "3",
-         type_str: "除螨杀菌",
-         extra: [
-         {
-         type: "儿童床",
-         price: "80"
-         },
-         {
-         type: "布艺窗帘",
-         price: "100"
-         },
-         {
-         type: "整床除螨",
-         price: "180"
-         },
-         {
-         type: "整套布艺沙发",
-         price: "160"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_04.png",
-         width: 658,
-         height: 663
-         },
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
-         width: 720,
-         height: 1129
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/5536a4677fb781475914511648.jpg",
-         width: 720,
-         height: 1697
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/58eb5a44603191475914516767.jpg",
-         width: 720,
-         height: 1246
-         }
-         ]
-         },
-         {
-         id: "57e0e04e9f5160af048b456b",
-         name: "家电清洗",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_05.png',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "4",
-         type_str: "家电清洗",
-         extra: [
-         {
-         type: "微波炉",
-         price: "60"
-         },
-         {
-         type: "洗衣机",
-         price: "100"
-         },
-         {
-         type: "油烟机",
-         price: "120"
-         },
-         {
-         type: "挂式空调",
-         price: "100"
-         },
-         {
-         type: "立式空调",
-         price: "130"
-         },
-         {
-         type: "冰箱-单开门",
-         price: "100"
-         },
-         {
-         type: "冰箱-双开门",
-         price: "130"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_05.png",
-         width: 537,
-         height: 537
-         },
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
-         width: 720,
-         height: 1165
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/0f29fa9bf28161475979068565.jpg",
-         width: 720,
-         height: 844
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/205de28a664c21475979065361.png",
-         width: 720,
-         height: 1129
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/f17ecbfe231231475979073441.jpg",
-         width: 720,
-         height: 1204
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/30daa83d817761475979080897.jpg",
-         width: 720,
-         height: 1246
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/3ee87b41d9d241475979077357.png",
-         width: 720,
-         height: 1257
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/06e7de122aab21475979086760.png",
-         width: 720,
-         height: 647
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/2973a12ec9a0f1475979093617.jpg",
-         width: 720,
-         height: 786
-         }
-         ]
-         },
-         {
-         id: "57e0e0879f5160b8048b4571",
-         price: "8",
-         name: "新居开荒-每平米",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_03.png',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '新居开荒'}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "5",
-         type_str: "新居开荒",
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_03.png",
-         width: 658,
-         height: 663
-         },
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92-01.jpg",
-         width: 720,
-         height: 10637
-         }
-         ]
-         }, {
-         id: "57fb4a909f5160b2048b4a0e",
-         price: "10",
-         name: "擦玻璃-每平米",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/%E5%A3%B9%E7%AE%A1%E5%AE%B6%E6%93%A6%E7%8E%BB%E7%92%83%E9%A6%96%E5%9B%BE.jpg',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '擦玻璃'}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "6",
-         type_str: "擦玻璃",
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5.jpg",
-         width: 720,
-         height: 11906
-         }
-         ]
-         },
-         {
-         id: "57e3a5a49f5160c9048b457c",
-         price: "",
-         name: "母婴房清洁",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_06.png',
-         desc: [{content: "http://7oxep6.com2.z0.glb.clouddn.com/0e287e871c3831474536840941.jpg"}, {content: '母婴房清洁'}],
-         status: 1,
-         is_extra: 0,
-         order: 200,
-         type: "7",
-         type_str: "母婴房清洁",
-         extra: [
-         {
-         type: "整间日常清洁",
-         price: "388"
-         },
-         {
-         type: "整间深度清洁",
-         price: "888"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/Advertising_06.png",
-         width: 576,
-         height: 484
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/2a28708adeba61475912920337.jpg",
-         width: 730,
-         height: 522
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/49b77d125873d1475913063652.jpg",
-         width: 730,
-         height: 791
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/48787438272821475913069079.jpg",
-         width: 730,
-         height: 823
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/5f027131794191475913084173.jpg",
-         width: 730,
-         height: 808
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/0eb339c6872641475913124202.jpg",
-         width: 730,
-         height: 1196
-         },
-         {
-         url: "http://oduj3utzz.bkt.clouddn.com/1c48dcac293c31475913147997.jpg",
-         width: 730,
-         height: 1111
-         }
-         ]
-         },
-         {
-         id: "58085f4b9f5160a9048b490e",
-         name: "租房大扫除",
-         imgSrc: 'http://odulvej8l.bkt.clouddn.com/%E5%A3%B9%E7%AE%A1%E5%AE%B6%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE.jpg',
-         desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-         status: 1,
-         is_extra: 0,
-         order: 0,
-         type: "8",
-         type_str: "租房大扫除",
-         extra: [
-         {
-         type: "客厅清洁",
-         price: "100"
-         },
-         {
-         type: "厨房清洁",
-         price: "150"
-         },
-         {
-         type: "卧室清洁",
-         price: "100"
-         },
-         {
-         type: "卫生间清洁",
-         price: "150"
-         }
-         ],
-         action_user: "",
-         action_time: "",
-         action_log: "",
-         pics: [
-         {
-         url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5.jpg",
-         width: 720,
-         height: 11906
-         }
-         ]
-         }
-         ];*/
-        /*图片压缩*/
-        this.allList = [
-            {
-                id: "57e0dffc9f5160dd048b4568",
-                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: "1",
-                type_str: "日常清洁",
-                extra: [
-                    {
-                        type: "一室一卫",
-                        price: "98"
-                    },
-                    {
-                        type: "两室一卫",
-                        price: "118"
-                    },
-                    {
-                        type: "两室两卫",
-                        price: "138"
-                    },
-                    {
-                        type: "三室两卫",
-                        price: "158"
-                    },
-                    {
-                        type: "四室三卫",
-                        price: "228"
-                    },
-                    {
-                        type: "200-250平米",
-                        price: "298"
-                    },
-                    {
-                        type: "200-300平米",
-                        price: "398"
-                    },
-                    {
-                        type: "三层别墅",
-                        price: "498"
-                    },
-                    {
-                        type: "四层别墅",
-                        price: "598"
-                    }
-                ],
-                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
-                    }
-                ]
-            },
-            {
-                id: "57e0e0189f5160dc048b4568",
-                name: "深度清洁",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/2%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81%E9%A6%96%E5%9B%BE.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_sd.jpg"}, {content: "深度清洁"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "2",
-                type_str: "深度清洁",
-                extra: [
-                    {
-                        type: "卧室清洁",
-                        price: "188"
-                    },
-                    {
-                        type: "客厅清洁",
-                        price: "288"
-                    },
-                    {
-                        type: "厨房清洁",
-                        price: "388"
-                    },
-                    {
-                        type: "卫生间清洁",
-                        price: "188"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/2%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81%E9%A6%96%E5%9B%BE.jpg",
-                        width: 750,
-                        height: 585
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_1%28720x1165%29.jpg",
-                        width: 720,
-                        height: 1165
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_2%28720x1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_3%28720x1246%29.jpg",
-                        width: 720,
-                        height: 1246
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_4%28720x715%29.jpg",
-                        width: 720,
-                        height: 715
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_5%28720x674%29.jpg",
-                        width: 720,
-                        height: 674
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_6%28720x786%29.jpg",
-                        width: 720,
-                        height: 786
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_7%28720x832%29.jpg",
-                        width: 720,
-                        height: 832
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81_8%28720x1178%29.jpg",
-                        width: 720,
-                        height: 1178
-                    }
-                ]
-            },
-            {
-                id: "57e0e0369f5160b1048b456b",
-                name: "除螨杀菌",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/3%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C%E9%A6%96%E5%9B%BE.jpg',
-                desc: [{content: 'http://odqeoyzxd.bkt.clouddn.com/image/image_etsj.jpg'}, {content: "除螨杀菌"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "3",
-                type_str: "除螨杀菌",
-                extra: [
-                    {
-                        type: "儿童床",
-                        price: "80"
-                    },
-                    {
-                        type: "布艺窗帘",
-                        price: "100"
-                    },
-                    {
-                        type: "整床除螨",
-                        price: "180"
-                    },
-                    {
-                        type: "整套布艺沙发",
-                        price: "160"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/3%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C%E9%A6%96%E5%9B%BE.jpg",
-                        width: 720,
-                        height: 585
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C_1%28720+1165%29.jpg",
-                        width: 720,
-                        height: 1165
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C_2%28720+1697%29.jpg",
-                        width: 720,
-                        height: 1697
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C_3%28720+1246%29.jpg",
-                        width: 720,
-                        height: 1246
-                    }
-                ]
-            },
-            {
-                id: "57e0e04e9f5160af048b456b",
-                name: "家电清洗",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/4%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97%E9%A6%96%E5%9B%BE.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "4",
-                type_str: "家电清洗",
-                extra: [
-                    {
-                        type: "微波炉",
-                        price: "60"
-                    },
-                    {
-                        type: "洗衣机",
-                        price: "100"
-                    },
-                    {
-                        type: "油烟机",
-                        price: "120"
-                    },
-                    {
-                        type: "挂式空调",
-                        price: "100"
-                    },
-                    {
-                        type: "立式空调",
-                        price: "130"
-                    },
-                    {
-                        type: "冰箱-单开门",
-                        price: "100"
-                    },
-                    {
-                        type: "冰箱-双开门",
-                        price: "130"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/4%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97%E9%A6%96%E5%9B%BE.jpg",
-                        width: 720,
-                        height: 585
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_1%28720+1165%29.jpg",
-                        width: 720,
-                        height: 1165
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_2%28720+844%29.jpg",
-                        width: 720,
-                        height: 844
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_3%28720+1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_4%28720+1204%29.jpg",
-                        width: 720,
-                        height: 1204
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_5%28720+1246%29.jpg",
-                        width: 720,
-                        height: 1246
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_6%28720+1257%29.jpg",
-                        width: 720,
-                        height: 1257
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_7%28720+674%29.jpg",
-                        width: 720,
-                        height: 647
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97_8%28720+786%29.jpg",
-                        width: 720,
-                        height: 786
-                    }
-                ]
-            },
-            {
-                id: "57e0e0879f5160b8048b4571",
-                price: "8",
-                name: "新居开荒",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/5%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92%E9%A6%96%E5%9B%BE.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '新居开荒'}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "6",
-                type_str: "新居开荒",
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/5%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92%E9%A6%96%E5%9B%BE.jpg",
-                        width: 750,
-                        height: 585
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_01%28720x1209%29.jpg",
-                        width: 720,
-                        height: 1209
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_02%28720x1041%29.jpg",
-                        width: 720,
-                        height: 1041
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_03%28720x1264%29.jpg",
-                        width: 720,
-                        height: 1264
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_04%28720x1295%29.jpg",
-                        width: 720,
-                        height: 1295
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_05%28720x685%29.jpg",
-                        width: 720,
-                        height: 685
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_06%28720x717%29.jpg",
-                        width: 720,
-                        height: 717
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_07%28720x685%29.jpg",
-                        width: 720,
-                        height: 685
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_08%28720x1083%29.jpg",
-                        width: 720,
-                        height: 1083
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_09%28720x915%29.jpg",
-                        width: 720,
-                        height: 915
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_10%28720x785%29.jpg",
-                        width: 720,
-                        height: 785
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92_1_11%28720x958%29.jpg",
-                        width: 720,
-                        height: 958
-                    }
-                ]
-            },
-            {
-                id: "57fb4a909f5160b2048b4a0e",
-                price: "10",
-                name: "擦玻璃",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/6%E6%93%A6%E7%8E%BB%E7%92%83%E9%A6%96%E5%9B%BE2.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '擦玻璃'}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "10",
-                type_str: "擦玻璃",
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/6%E6%93%A6%E7%8E%BB%E7%92%83%E9%A6%96%E5%9B%BE2.jpg",
-                        width: 720,
-                        height: 560
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_02%28720+587%29.jpg",
-                        width: 720,
-                        height: 587
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_03%28720+600%29.jpg",
-                        width: 720,
-                        height: 600
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_04%28720+1061%29.jpg",
-                        width: 720,
-                        height: 1061
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_05%28720+906%29.jpg",
-                        width: 720,
-                        height: 906
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_06%28720+820%29.jpg",
-                        width: 720,
-                        height: 802
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_07%28720+1071%29.jpg",
-                        width: 720,
-                        height: 1071
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_08%28720+1204%29.jpg",
-                        width: 720,
-                        height: 1204
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_09%28720+720%29.jpg",
-                        width: 720,
-                        height: 720
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_10%28720+678%29.jpg",
-                        width: 720,
-                        height: 678
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_11%28720+1098%29.jpg",
-                        width: 720,
-                        height: 1098
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_12%28720+899%29.jpg",
-                        width: 720,
-                        height: 899
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5_13%28720+1702%29.jpg",
-                        width: 720,
-                        height: 1702
-                    }
-                ]
-            },
-            {
-                id: "57e3a5a49f5160c9048b457c",
-                price: "",
-                name: "母婴房清洁",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81.jpg',
-                desc: [{content: "http://7oxep6.com2.z0.glb.clouddn.com/0e287e871c3831474536840941.jpg"}, {content: '母婴房清洁'}],
-                status: 1,
-                is_extra: 0,
-                order: 200,
-                type: "8",
-                type_str: "母婴房深度清洁",
-                extra: [
-                    {
-                        type: "整间深度清洁",
-                        price: "888"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81.jpg",
-                        width: 750,
-                        height: 585
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF_01.jpg",
-                        width: 730,
-                        height: 522
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF_02.jpg",
-                        width: 730,
-                        height: 791
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF_03.jpg",
-                        width: 730,
-                        height: 823
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF_04.jpg",
-                        width: 730,
-                        height: 823
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E6%AF%8D%E5%A9%B4%E6%88%BF_05.jpg",
-                        width: 730,
-                        height: 823
-                    }
-                ]
-            },
-            {
-                id: "58085f4b9f5160a9048b490e",
-                name: "租房大扫除",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "9",
-                type_str: "租房清洁",
-                extra: [
-                    {
-                        type: "客厅清洁",
-                        price: "100"
-                    },
-                    {
-                        type: "厨房清洁",
-                        price: "150"
-                    },
-                    {
-                        type: "卧室清洁",
-                        price: "100"
-                    },
-                    {
-                        type: "卫生间清洁",
-                        price: "150"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg",
-                        width: 720,
-                        height: 562
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_02%28720x404%29.jpg",
-                        width: 720,
-                        height: 404
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_03%28720x783%29.jpg",
-                        width: 720,
-                        height: 783
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_04%28720x1048%29.jpg",
-                        width: 720,
-                        height: 1048
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_05%28720x915%29.jpg",
-                        width: 720,
-                        height: 915
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_06%28720x758%29.jpg",
-                        width: 720,
-                        height: 758
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_07%28720x1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_08%28720x1213%29.jpg",
-                        width: 720,
-                        height: 1213
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_09%28720x657%29.jpg",
-                        width: 720,
-                        height: 657
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_10%28720x720%29.jpg",
-                        width: 720,
-                        height: 720
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_11%28720x1104%29.jpg",
-                        width: 720,
-                        height: 1104
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_12%28720x951%29.jpg",
-                        width: 720,
-                        height: 951
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_13%28720x812%29.jpg",
-                        width: 720,
-                        height: 812
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_14%28720x850%29.jpg",
-                        width: 720,
-                        height: 850
-                    }
-                ]
-            },
-            {
-                id: "58324b7e9f5160a4048b5758",//test //583247cca84ea01d428b46a1 master//  58324b7e9f5160a4048b5758
-                price: "48",
-                name: "首单日常保洁2小时体验",//双11虹口区日常保洁特价体验//首单日常保洁2小时体验
-                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: "11",
-                type_str: "日常保洁2小时体验",
-                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
-                    }
-                ]
-            },
-            {
-                id: "5835418aa84ea0a7748b4587",//5835418aa84ea0a7748b4587
-                name: "小时工单次",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "12",
-                type_str: "长期订",
-                extra: [
-                    {
-                        type: "2小时/人",
-                        price: "90"
-                    },
-                    {
-                        type: "3小时/人",
-                        price: "135"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg",
-                        width: 720,
-                        height: 562
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_02%28720x404%29.jpg",
-                        width: 720,
-                        height: 404
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_03%28720x783%29.jpg",
-                        width: 720,
-                        height: 783
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_04%28720x1048%29.jpg",
-                        width: 720,
-                        height: 1048
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_05%28720x915%29.jpg",
-                        width: 720,
-                        height: 915
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_06%28720x758%29.jpg",
-                        width: 720,
-                        height: 758
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_07%28720x1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_08%28720x1213%29.jpg",
-                        width: 720,
-                        height: 1213
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_09%28720x657%29.jpg",
-                        width: 720,
-                        height: 657
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_10%28720x720%29.jpg",
-                        width: 720,
-                        height: 720
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_11%28720x1104%29.jpg",
-                        width: 720,
-                        height: 1104
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_12%28720x951%29.jpg",
-                        width: 720,
-                        height: 951
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_13%28720x812%29.jpg",
-                        width: 720,
-                        height: 812
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_14%28720x850%29.jpg",
-                        width: 720,
-                        height: 850
-                    }
-                ]
-            },
-            {
-                id: "5835423fa84ea0ac7a8b4568",
-                name: "小时工多次",
-                imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
-                desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
-                status: 1,
-                is_extra: 0,
-                order: 0,
-                type: "12",
-                type_str: "长期订",
-                extra: [
-                    {
-                        type: "3张(2小时/人)",
-                        price: "32"
-                    },
-                    {
-                        type: "3张(3小时/人)",
-                        price: "33"
-                    },
-                    {
-                        type: "6张(2小时/人)",
-                        price: "62"
-                    },
-                    {
-                        type: "6张(3小时/人)",
-                        price: "63"
-                    }
-                ],
-                action_user: "",
-                action_time: "",
-                action_log: "",
-                pics: [
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg",
-                        width: 720,
-                        height: 562
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_02%28720x404%29.jpg",
-                        width: 720,
-                        height: 404
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_03%28720x783%29.jpg",
-                        width: 720,
-                        height: 783
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_04%28720x1048%29.jpg",
-                        width: 720,
-                        height: 1048
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_05%28720x915%29.jpg",
-                        width: 720,
-                        height: 915
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_06%28720x758%29.jpg",
-                        width: 720,
-                        height: 758
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_07%28720x1129%29.jpg",
-                        width: 720,
-                        height: 1129
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_08%28720x1213%29.jpg",
-                        width: 720,
-                        height: 1213
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_09%28720x657%29.jpg",
-                        width: 720,
-                        height: 657
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_10%28720x720%29.jpg",
-                        width: 720,
-                        height: 720
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_11%28720x1104%29.jpg",
-                        width: 720,
-                        height: 1104
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_12%28720x951%29.jpg",
-                        width: 720,
-                        height: 951
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_13%28720x812%29.jpg",
-                        width: 720,
-                        height: 812
-                    },
-                    {
-                        url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5_14%28720x850%29.jpg",
-                        width: 720,
-                        height: 850
-                    }
-                ]
-            }
-        ];
-        //列出所有的产品
-        Product.prototype.getListAll = function (userID, callback) {
-            var that = this;
-            api.getProductList({
-                user_id: userID,
-                // type: type
-            }, function (res) {
-                if (res.success) {
-                    that.productList = {};
-                    var petDic = {};
-                    var productDatas = res['data']['products'];
-                    var extraroducts = res['data']['extra_products'];
-                    // that.extraService = extraroducts;
+    /* 我新加的 */
+    /* this.allList = [
+     {
+     id: "57e0dffc9f5160dd048b4568",
+     name: "日常清洁",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_02.png',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_rc.jpg"}, {content: "日常清洁"}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "1",
+     type_str: "日常清洁",
+     extra: [
+     {
+     type: "一室一卫",
+     price: "98"
+     },
+     {
+     type: "两室一卫",
+     price: "118"
+     },
+     {
+     type: "两室两卫",
+     price: "138"
+     },
+     {
+     type: "三室两卫",
+     price: "158"
+     },
+     {
+     type: "四室三卫",
+     price: "228"
+     },
+     {
+     type: "200-250平米",
+     price: "298"
+     },
+     {
+     type: "200-300平米",
+     price: "398"
+     },
+     {
+     type: "三层别墅",
+     price: "498"
+     },
+     {
+     type: "四层别墅",
+     price: "598"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_02.png",
+     width: 537,
+     height: 537
+     },
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
+     width: 720,
+     height: 1165
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/ada69b8adb17b1475912214579.png",
+     width: 720,
+     height: 1129
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/rcqj_xqy_03.jpg",
+     width: 720,
+     height: 1127
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/03c6e0266e4661475977941220.png",
+     width: 720,
+     height: 1178
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/1e3638af93cab1475977951089.jpg",
+     width: 720,
+     height: 1246
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/cfd996a3783d11475977959884.png",
+     width: 720,
+     height: 520
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/d67ff4fcad4bc1475977977827.png",
+     width: 720,
+     height: 644
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/78ce92ec0d52d1475977966417.png",
+     width: 720,
+     height: 644
+     }
+     ]
+     },
+     {
+     id: "57e0e0189f5160dc048b4568",
+     name: "深度清洁",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_01.png',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_sd.jpg"}, {content: "深度清洁"}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "2",
+     type_str: "深度清洁",
+     extra: [
+     {
+     type: "卧室清洁",
+     price: "188"
+     },
+     {
+     type: "客厅清洁",
+     price: "288"
+     },
+     {
+     type: "厨房清洁",
+     price: "388"
+     },
+     {
+     type: "卫生间清洁",
+     price: "188"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_01.png",
+     width: 658,
+     height: 663
+     },
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
+     width: 720,
+     height: 1165
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/e295c92da2e7c1475913803198.png",
+     width: 720,
+     height: 1129
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/363f18ed617211475913944488.jpg",
+     width: 720,
+     height: 1246
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/64a1375694e091475913947183.png",
+     width: 720,
+     height: 715
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/8cf32629eece91475913957779.png",
+     width: 720,
+     height: 674
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/0ef470cf13ea51475914131334.jpg",
+     width: 720,
+     height: 786
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/341746e8065381475978339748.jpg",
+     width: 720,
+     height: 832
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/beb99ec9850041475978342874.jpg",
+     width: 720,
+     height: 1178
+     }
+     ]
+     },
+     {
+     id: "57e0e0369f5160b1048b456b",
+     name: "专业除螨",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_04.png',
+     desc: [{content: 'http://odqeoyzxd.bkt.clouddn.com/image/image_etsj.jpg'}, {content: "专业除螨"}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "3",
+     type_str: "专业除螨",
+     extra: [
+     {
+     type: "儿童床",
+     price: "80"
+     },
+     {
+     type: "布艺窗帘",
+     price: "100"
+     },
+     {
+     type: "整床除螨",
+     price: "180"
+     },
+     {
+     type: "整套布艺沙发",
+     price: "160"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_04.png",
+     width: 658,
+     height: 663
+     },
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
+     width: 720,
+     height: 1129
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/5536a4677fb781475914511648.jpg",
+     width: 720,
+     height: 1697
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/58eb5a44603191475914516767.jpg",
+     width: 720,
+     height: 1246
+     }
+     ]
+     },
+     {
+     id: "57e0e04e9f5160af048b456b",
+     name: "家电清洗",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_05.png',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "4",
+     type_str: "家电清洗",
+     extra: [
+     {
+     type: "微波炉",
+     price: "60"
+     },
+     {
+     type: "洗衣机",
+     price: "100"
+     },
+     {
+     type: "油烟机",
+     price: "120"
+     },
+     {
+     type: "挂式空调",
+     price: "100"
+     },
+     {
+     type: "立式空调",
+     price: "130"
+     },
+     {
+     type: "冰箱-单开门",
+     price: "100"
+     },
+     {
+     type: "冰箱-双开门",
+     price: "130"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_05.png",
+     width: 537,
+     height: 537
+     },
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/a_01.png",
+     width: 720,
+     height: 1165
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/0f29fa9bf28161475979068565.jpg",
+     width: 720,
+     height: 844
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/205de28a664c21475979065361.png",
+     width: 720,
+     height: 1129
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/f17ecbfe231231475979073441.jpg",
+     width: 720,
+     height: 1204
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/30daa83d817761475979080897.jpg",
+     width: 720,
+     height: 1246
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/3ee87b41d9d241475979077357.png",
+     width: 720,
+     height: 1257
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/06e7de122aab21475979086760.png",
+     width: 720,
+     height: 647
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/2973a12ec9a0f1475979093617.jpg",
+     width: 720,
+     height: 786
+     }
+     ]
+     },
+     {
+     id: "57e0e0879f5160b8048b4571",
+     price: "8",
+     name: "新居开荒-每平米",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_03.png',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '新居开荒'}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "5",
+     type_str: "新居开荒",
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_03.png",
+     width: 658,
+     height: 663
+     },
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92-01.jpg",
+     width: 720,
+     height: 10637
+     }
+     ]
+     }, {
+     id: "57fb4a909f5160b2048b4a0e",
+     price: "10",
+     name: "擦玻璃-每平米",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/%E5%A3%B9%E7%AE%A1%E5%AE%B6%E6%93%A6%E7%8E%BB%E7%92%83%E9%A6%96%E5%9B%BE.jpg',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '擦玻璃'}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "6",
+     type_str: "擦玻璃",
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/%E6%93%A6%E7%8E%BB%E7%92%83%E8%AF%A6%E6%83%85%E9%A1%B5.jpg",
+     width: 720,
+     height: 11906
+     }
+     ]
+     },
+     {
+     id: "57e3a5a49f5160c9048b457c",
+     price: "",
+     name: "母婴房清洁",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/Advertising_06.png',
+     desc: [{content: "http://7oxep6.com2.z0.glb.clouddn.com/0e287e871c3831474536840941.jpg"}, {content: '母婴房清洁'}],
+     status: 1,
+     is_extra: 0,
+     order: 200,
+     type: "7",
+     type_str: "母婴房清洁",
+     extra: [
+     {
+     type: "整间日常清洁",
+     price: "388"
+     },
+     {
+     type: "整间深度清洁",
+     price: "888"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/Advertising_06.png",
+     width: 576,
+     height: 484
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/2a28708adeba61475912920337.jpg",
+     width: 730,
+     height: 522
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/49b77d125873d1475913063652.jpg",
+     width: 730,
+     height: 791
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/48787438272821475913069079.jpg",
+     width: 730,
+     height: 823
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/5f027131794191475913084173.jpg",
+     width: 730,
+     height: 808
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/0eb339c6872641475913124202.jpg",
+     width: 730,
+     height: 1196
+     },
+     {
+     url: "http://oduj3utzz.bkt.clouddn.com/1c48dcac293c31475913147997.jpg",
+     width: 730,
+     height: 1111
+     }
+     ]
+     },
+     {
+     id: "58085f4b9f5160a9048b490e",
+     name: "租房大扫除",
+     imgSrc: 'http://odulvej8l.bkt.clouddn.com/%E5%A3%B9%E7%AE%A1%E5%AE%B6%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE.jpg',
+     desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+     status: 1,
+     is_extra: 0,
+     order: 0,
+     type: "8",
+     type_str: "租房大扫除",
+     extra: [
+     {
+     type: "客厅清洁",
+     price: "100"
+     },
+     {
+     type: "厨房清洁",
+     price: "150"
+     },
+     {
+     type: "卧室清洁",
+     price: "100"
+     },
+     {
+     type: "卫生间清洁",
+     price: "150"
+     }
+     ],
+     action_user: "",
+     action_time: "",
+     action_log: "",
+     pics: [
+     {
+     url: "http://odulvej8l.bkt.clouddn.com/%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E8%AF%A6%E6%83%85%E9%A1%B5.jpg",
+     width: 720,
+     height: 11906
+     }
+     ]
+     }
+     ];*/
+    /*图片压缩*/
+    this.allList = [
+      {
+        id: "57e0dffc9f5160dd048b4568",
+        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: "1",
+        type_str: "日常清洁",
+        extra: [
+          {
+            type: "一室一卫",
+            price: "98"
+          },
+          {
+            type: "两室一卫",
+            price: "118"
+          },
+          {
+            type: "两室两卫",
+            price: "138"
+          },
+          {
+            type: "三室两卫",
+            price: "158"
+          },
+          {
+            type: "四室三卫",
+            price: "228"
+          },
+          {
+            type: "200-250平米",
+            price: "298"
+          },
+          {
+            type: "200-300平米",
+            price: "398"
+          },
+          {
+            type: "三层别墅",
+            price: "498"
+          },
+          {
+            type: "四层别墅",
+            price: "598"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_daily%20cleaning_1.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_daily%20cleaning_2.png"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_daily%20cleaning_3.png"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_daily%20cleaning_4.gif"
+          }
+        ]
+      },
+      {
+        id: "57e0e0189f5160dc048b4568",
+        name: "深度清洁",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/2%E6%B7%B1%E5%BA%A6%E6%B8%85%E6%B4%81%E9%A6%96%E5%9B%BE.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_sd.jpg"}, {content: "深度清洁"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "2",
+        type_str: "深度清洁",
+        extra: [
+          {
+            type: "卧室清洁",
+            price: "188"
+          },
+          {
+            type: "客厅清洁",
+            price: "288"
+          },
+          {
+            type: "厨房清洁",
+            price: "388"
+          },
+          {
+            type: "卫生间清洁",
+            price: "188"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/20170525_deep_cleaning_1.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/20170525_deep_cleaning_2.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/20170525_deep_cleaning_3.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/20170525_deep_cleaning_4.gif"
+          }
+        ]
+      },
+      {
+        id: "57e0e0369f5160b1048b456b",
+        name: "专业除螨",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/2017525_ProfessionalAdditionTo%20Mites_0.jpg',
+        desc: [{content: 'http://odqeoyzxd.bkt.clouddn.com/image/image_etsj.jpg'}, {content: "专业除螨"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "3",
+        type_str: "专业除螨",
+        extra: [
+          {
+            type: "儿童床",
+            price: "80"
+          },
+          {
+            type: "布艺窗帘",
+            price: "100"
+          },
+          {
+            type: "整床除螨",
+            price: "180"
+          },
+          {
+            type: "布艺沙发",
+            price: "50"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/3%E9%99%A4%E8%9E%A8%E6%9D%80%E8%8F%8C%E9%A6%96%E5%9B%BE.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_ProfessionalAdditionTo%20Mites_1.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_ProfessionalAdditionTo%20Mites_2.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_ProfessionalAdditionTo%20Mites_3.jpg"
+          }
+        ]
+      },
+      {
+        id: "57e0e04e9f5160af048b456b",
+        name: "家电清洗",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/4%E5%AE%B6%E7%94%B5%E6%B8%85%E6%B4%97%E9%A6%96%E5%9B%BE.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "4",
+        type_str: "家电清洗",
+        extra: [
+          {
+            type: "微波炉",
+            price: "60"
+          },
+          {
+            type: "洗衣机",
+            price: "100"
+          },
+          {
+            type: "油烟机",
+            price: "120"
+          },
+          {
+            type: "挂式空调",
+            price: "100"
+          },
+          {
+            type: "立式空调",
+            price: "130"
+          },
+          {
+            type: "冰箱-单开门",
+            price: "100"
+          },
+          {
+            type: "冰箱-双开门",
+            price: "130"
+          },
+          {
+            type: "冰箱-三开门",
+            price: "150"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_household_appliance_cleaning_1.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_household_appliance_cleaning_2.jpg"
+          }
+        ]
+      },
+      {
+        id: "57e0e0879f5160b8048b4571",
+        price: "8",
+        name: "新居开荒",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/5%E6%96%B0%E5%B1%85%E5%BC%80%E8%8D%92%E9%A6%96%E5%9B%BE.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '新居开荒'}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "6",
+        type_str: "新居开荒",
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_new_home_reclamation_1.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_new_home_reclamation_2.jpg"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_new_home_reclamation_3.gif"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_new_home_reclamation_4.gif"
+          }
+        ]
+      },
+      {
+        id: "57fb4a909f5160b2048b4a0e",
+        price: "10",
+        name: "擦玻璃",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/6%E6%93%A6%E7%8E%BB%E7%92%83%E9%A6%96%E5%9B%BE2.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_kh.jpg"}, {content: '擦玻璃'}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "10",
+        type_str: "擦玻璃",
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_wipe_glass_1.gif"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_wipe_glass_2.gif"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_wipe_glass_3.gif"
+          }
+        ]
+      },
+      {
+        id: "57e3a5a49f5160c9048b457c",
+        price: "",
+        name: "母婴房清洁",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/2017525_mother_room_0.jpg',
+        desc: [{content: "http://7oxep6.com2.z0.glb.clouddn.com/0e287e871c3831474536840941.jpg"}, {content: '母婴房清洁'}],
+        status: 1,
+        is_extra: 0,
+        order: 200,
+        type: "8",
+        type_str: "母婴房深度清洁",
+        extra: [
+          {
+            type: "整间深度清洁",
+            price: "888"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_mother_room.jpg"
+          }
+        ]
+      },
+      {
+        id: "58085f4b9f5160a9048b490e",
+        name: "租房大扫除",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "9",
+        type_str: "租房清洁",
+        extra: [
+          {
+            type: "客厅清洁",
+            price: "100"
+          },
+          {
+            type: "厨房清洁",
+            price: "150"
+          },
+          {
+            type: "卧室清洁",
+            price: "100"
+          },
+          {
+            type: "卫生间清洁",
+            price: "150"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: [
+          {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_RentCleaning_0.gif"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_RentCleaning_1.gif"
+          }, {
+            url: "http://odulvej8l.bkt.clouddn.com/2017525_RentCleaning_2.gif"
+          }
+        ]
+      },
+      {
+        id: "58324b7e9f5160a4048b5758",//test //583247cca84ea01d428b46a1 master//  58324b7e9f5160a4048b5758
+        price: "48",
+        name: "首单日常保洁2小时体验",//双11虹口区日常保洁特价体验//首单日常保洁2小时体验
+        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: "11",
+        type_str: "日常保洁2小时体验",
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: []
+      },
+      {
+        id: "5835418aa84ea0a7748b4587",//5835418aa84ea0a7748b4587
+        name: "小时工单次",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "12",
+        type_str: "长期订",
+        extra: [
+          {
+            type: "2小时/人",
+            price: "90"
+          },
+          {
+            type: "3小时/人",
+            price: "135"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: []
+      },
+      {
+        id: "5835423fa84ea0ac7a8b4568",
+        name: "小时工多次",
+        imgSrc: 'http://odulvej8l.bkt.clouddn.com/8%E7%A7%9F%E6%88%BF%E5%A4%A7%E6%89%AB%E9%99%A4%E9%A6%96%E5%9B%BE%E6%94%B9.jpg',
+        desc: [{content: "http://odqeoyzxd.bkt.clouddn.com/image/image_jdqx.jpg"}, {content: "家电清洗"}],
+        status: 1,
+        is_extra: 0,
+        order: 0,
+        type: "12",
+        type_str: "长期订",
+        extra: [
+          {
+            type: "3张(2小时/人)",
+            price: "32"
+          },
+          {
+            type: "3张(3小时/人)",
+            price: "33"
+          },
+          {
+            type: "6张(2小时/人)",
+            price: "62"
+          },
+          {
+            type: "6张(3小时/人)",
+            price: "63"
+          }
+        ],
+        action_user: "",
+        action_time: "",
+        action_log: "",
+        pics: []
+      }
+    ];
+    //列出所有的产品
+    Product.prototype.getListAll = function (userID, callback) {
+      var that = this;
+      api.getProductList({
+        user_id: userID,
+        // type: type
+      }, function (res) {
+        if (res.success) {
+          that.productList = {};
+          var petDic = {};
+          var productDatas = res['data']['products'];
+          var extraroducts = res['data']['extra_products'];
+          // that.extraService = extraroducts;
 
-                    for (var i in that.productGroup) {
-                        that.productGroup[i] = [];
-                    }
+          for (var i in that.productGroup) {
+            that.productGroup[i] = [];
+          }
 
-                    for (var i in that.extraProductGroup) {
-                        that.extraProductGroup[i] = [];
-                    }
+          for (var i in that.extraProductGroup) {
+            that.extraProductGroup[i] = [];
+          }
 
-                    for (var i = 0, len = productDatas.length; i < len; i++) {
-                        var eachProduct = productDatas[i];
-                        that.productGroup[eachProduct['type']].push(eachProduct);
-                        var petIDs = [];
+          for (var i = 0, len = productDatas.length; i < len; i++) {
+            var eachProduct = productDatas[i];
+            that.productGroup[eachProduct['type']].push(eachProduct);
+            var petIDs = [];
 
 
-                        that.productDic[eachProduct.id] = {//产品中心
-                            petIDs: petIDs,//宠物ID
-                            maxWeight: eachProduct.max_weight,//产品最大
-                            minWeight: eachProduct.min_weight,//产品最小
-                            // price: parseFloat(eachProduct.price).toFixed(2)
-                            price: parseFloat(eachProduct.price)//解析产品价格
-                            // 价格不要加小数点后两位
-                        };
-                    }
+            that.productDic[eachProduct.id] = {//产品中心
+              petIDs: petIDs,//宠物ID
+              maxWeight: eachProduct.max_weight,//产品最大
+              minWeight: eachProduct.min_weight,//产品最小
+              // price: parseFloat(eachProduct.price).toFixed(2)
+              price: parseFloat(eachProduct.price)//解析产品价格
+              // 价格不要加小数点后两位
+            };
+          }
 
 
-                    // for (var petID in petDic) {
-                    //   that.productGroup[eachProduct['type']].push(petDic[petID]);
-                    // }
-                }
-                if (typeof (callback) == 'function') {
-                    callback(res);
-                }
-            });
+          // for (var petID in petDic) {
+          //   that.productGroup[eachProduct['type']].push(petDic[petID]);
+          // }
         }
-    };
+        if (typeof (callback) == 'function') {
+          callback(res);
+        }
+      });
+    }
+  };
 
-    //列出所有的产品
-    Product.prototype.getListAll = function (userID) {
-        api.getProductList({
-            user_id: userID
-        });
-    };
+  //列出所有的产品
+  Product.prototype.getListAll = function (userID) {
+    api.getProductList({
+      user_id: userID
+    });
+  };
 
-    Product.prototype = new base();
+  Product.prototype = new base();
 
-    return new Product();
+  return new Product();
 });

+ 960 - 954
www/webapp/o2o/js/page/placeOrder.js

@@ -1,978 +1,984 @@
 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;
-    var backHash;
-    /* 软键盘弹出与消失时布局变动。 */
-    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);
+  /*
+   * 这里对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;
+  var backHash;
+  /* 软键盘弹出与消失时布局变动。 */
+  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);
 
-    /* 返回上一级 */
-    function back(event) {
+      pageData.scrollCheckAutoCancel = setTimeout(function () {
+        clearInterval(pageData.scrollCheck);
+      }, 500);
+    }
+  }
+
+  /* 返回上一级 */
+  function back (event) {
+    event.preventDefault();
+    $(document).trigger('spa:navigate', {
+      hash: backHash,
+      pushData: {
+        dontNeedReload: true
+      }
+    });
+  }
+
+  /* 重置页面时调用,重新生成IScroll */
+  function fixScroll (pageData) {
+    // setInterval(function () {
+    //     if (product.name == "首单日常保洁2小时体验") {
+    //         $('.selected').css('display', 'none');
+    //     }
+    // }, 100);
+    if (pageData.scroll) {
+      pageData.scroll.destroy();
+      pageData.scroll = null;
+    }
+    var placeOrderScroll;
+    setTimeout(function () {
+      pageData.scroll = new IScroll('#placeOrderScroll');
+    }, 700);
+  }
+
+  /* 算账。 */
+  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();
-        $(document).trigger('spa:navigate', {
-            hash: backHash,
+        /* 如果是微信客户端,跳转到addressList页面。 */
+        if (!config.isAndroid && !config.isIOS) {
+          $doc.trigger('spa:navigate', {
+            hash: 'addressList',
             pushData: {
-                dontNeedReload: true
+              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);
+              }
             }
-        });
-    }
-
-    /* 重置页面时调用,重新生成IScroll */
-    function fixScroll(pageData) {
-        // setInterval(function () {
-        //     if (product.name == "首单日常保洁2小时体验") {
-        //         $('.selected').css('display', 'none');
-        //     }
-        // }, 100);
-        if (pageData.scroll) {
-            pageData.scroll.destroy();
-            pageData.scroll = null;
+          });
+        }
+      }, $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;
+        //这里修改预约日期 提前2天预约
+        for (var i = 2; 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.columnTime 中
+          columns.columnDay.push({
+            text: date, // 几月几日
+            day: dayStrSuffix, // 周几
+            value: dayStr,
+            selected: selected,
+            selectIndex: daySelectIndex
+          });
         }
-        var placeOrderScroll;
-        setTimeout(function () {
-            pageData.scroll = new IScroll('#placeOrderScroll');
-        }, 700);
-    }
-
-    /* 算账。 */
-    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);
-            });
+        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;
+        // 设定工作时间早上9:00  - 晚上 19:00
+        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 中
+          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;
+        }
 
-            /* 点击查看详情。跳转到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('选择优惠券');
+        // 跳转到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;
-                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;
+              } 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;
+                  }
                 }
-                //与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;
-                //这里修改预约日期 提前2天预约
-                for (var i = 2; 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.columnTime 中
-                    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;
-                // 设定工作时间早上9:00  - 晚上 19:00
-                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 中
-                    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 !== "双11虹口区日常保洁特价体验") {
-                    $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) {
-            /*地址- setInterval-setTimeout*/
-            /*地址-setInterval-setTimeout*/
-            setTimeout(function () {
-                if ($('.booking-time').html() == "选择服务时间" && order.bookingTimeStr.length > 0) {
-                    $('.booking-time', $view).html(order.bookingTimeStr);
-                }
-                /*隐藏广告位*/
-                // $('.product-pic-o2o').css('display', 'none');
-                /*当用户没有地址时*/
-                var defaultAddress = address.defaultAddress;
-                /*未登录*/
-                if (user.id.length == 0) {
-                    $('.order-mobile').html('添加服务地址');
-                } else if (user.id.length != 0 && typeof(defaultAddress) !== "undefined") {
-                    api.checkAddress({
-                        address_id: defaultAddress.address_id,
-                        user_id: user.id
-                    }, function (res) {
-                        if (res.success) {
-                            if ($('.order-username').html() == "") {
-                                order.address = address.defaultAddress;
-                                order.stationID = res.data.station;
-                                $('.order-username').html(defaultAddress.name);
-                                $('.order-mobile').html(defaultAddress.mobile);
-                                $('.order-address').html(defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.detail).css('text-align', 'right');
-                            }
-                        } else {
-                            $('.order-mobile').html('添加服务地址');
-                        }
-                    })
-                } else if (user.id.length != 0 && typeof(defaultAddress) == "undefined") {
-                    $('.order-mobile').html('添加服务地址');
-                }
-            }, 500);
-
-            var $view = this;
-            var pushData = pageData.pushData;
-
-
-            /* 只有首页跳转来,才会带有needReset = true */
-            /*获取上一页跳转的路由名称*/
-            backHash = pushData.backHash ? pushData.backHash : '';
+              }
+              // 填写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);
 
-            if (pushData.hasOwnProperty('needReset') && pushData.needReset) {
+      /* 跳转到agreement页面查看协议 */
+      $.newTouch('.agreement', function (event) {
+        $doc.trigger('spa:navigate', {
+          hash: 'agreement'
+        });
+      }, $view);
 
-                /* 接收首页传来的product,填写order的productType(产品类型)、productID(产品ID)两个字段 */
-                pushData.needReset = false;
-                product = pushData.product;
+      /* 点击下订单 */
+      $.newTouch('.btn-place', function (event) {
+        event.preventDefault();
+        if(order.appendID="布艺沙发"){
+          if(order.productCount<3){
+            $doc.trigger('spa:openpanel', ['simpleAlert', {
+              message: '布衣沙发3套起购'
+            }]);
+            return;
+          }
+        }
+        if ($(this).hasClass('disable')) {
+          return false;
+        }
+        if (product.type_str == "擦玻璃" && order.productCount < 10) {
+          $doc.trigger('spa:openpanel', ['simpleAlert', {
+            message: '数量不少于10平米'
+          }]);
+          return;
+        }
 
-                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;
+        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 !== "双11虹口区日常保洁特价体验") {
+          $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: ''
                 }
-                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
-                    });
-                });
+          } else {
+            $doc.trigger('spa:openpanel', ['simpleAlert', {
+              message: res.message
+            }]);
+          }
+        });
+      }, $view);
+
+      dtd.resolve();
+    },
+    beforeopen: function (pageData, dtd) {
+      /*地址- setInterval-setTimeout*/
+      /*地址-setInterval-setTimeout*/
+      setTimeout(function () {
+        if ($('.booking-time').html() == "选择服务时间" && order.bookingTimeStr.length > 0) {
+          $('.booking-time', $view).html(order.bookingTimeStr);
+        }
+        /*隐藏广告位*/
+        // $('.product-pic-o2o').css('display', 'none');
+        /*当用户没有地址时*/
+        var defaultAddress = address.defaultAddress;
+        /*未登录*/
+        if (user.id.length == 0) {
+          $('.order-mobile').html('添加服务地址');
+        } else if (user.id.length != 0 && typeof(defaultAddress) !== "undefined") {
+          api.checkAddress({
+            address_id: defaultAddress.address_id,
+            user_id: user.id
+          }, function (res) {
+            if (res.success) {
+              if ($('.order-username').html() == "") {
+                order.address = address.defaultAddress;
+                order.stationID = res.data.station;
+                $('.order-username').html(defaultAddress.name);
+                $('.order-mobile').html(defaultAddress.mobile);
+                $('.order-address').html(defaultAddress.address.city + defaultAddress.address.area + defaultAddress.address.detail).css('text-align', 'right');
+              }
+            } else {
+              $('.order-mobile').html('添加服务地址');
             }
-        },
-        afterclose: function (pageData) {
-            native.registerEvent(false);
+          })
+        } else if (user.id.length != 0 && typeof(defaultAddress) == "undefined") {
+          $('.order-mobile').html('添加服务地址');
         }
+      }, 500);
+
+      var $view = this;
+      var pushData = pageData.pushData;
+
+
+      /* 只有首页跳转来,才会带有needReset = true */
+      /*获取上一页跳转的路由名称*/
+      backHash = pushData.backHash ? pushData.backHash : '';
+
+      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);
     }
+  }
 })

+ 1 - 1
www/webapp/o2o/tpl/home/index.html

@@ -22,7 +22,7 @@
                                 <!--<img class="btn-home-day lazy" data-product-type="9" src="http://odulvej8l.bkt.clouddn.com/1111%E5%85%83banner.jpg" alt="">-->
                                 <!--</div>-->
                                 <div class="swiper-slide btn-banner-recharge">
-                                    <img class="lazy" src="http://odulvej8l.bkt.clouddn.com/banner-2.jpg" alt="">
+                                    <img class="lazy" src="http://odulvej8l.bkt.clouddn.com/2017252_banner_1.jpg" alt="">
                                 </div>
                                 <div class="swiper-slide btn-banner-coupon">
                                     <img class="lazy" src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6-2.jpg"

+ 1 - 1
www/webapp/o2o/tpl/secondary/index.html

@@ -41,7 +41,7 @@
                                     <!--<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>
+                                    <div class="extra-service-name">专业除螨</div>
                                 </li>
 
                                 <li class="btn-product" data-product-type="5">

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff