Browse Source

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

Charlie 8 years ago
parent
commit
e213b62d8e

+ 4 - 1
www/webapp/o2o/css/home.css

@@ -1,3 +1,6 @@
+.content{
+    background-color: #fff;
+}
 .spa-page-home {
     /*Ö÷ͼ*/
     /*²úÆ·Áбí*/
@@ -173,7 +176,7 @@
 .spa-page-home .prevent-scroll .width-percent-33 .title-container-square a .name {
     display: block;
     margin-top: -5px;
-    font-size: 0.7rem;
+    font-size: 12px;
 }
 
 .spa-page-home .prevent-scroll .width-percent-33:nth-child(1) a:active .logo {

File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/css/main.css


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/build/.cache/home/index.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/build/template.js


File diff suppressed because it is too large
+ 406 - 0
www/webapp/o2o/dist/js/build/template/template.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/main.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/model/product.js


File diff suppressed because it is too large
+ 0 - 0
www/webapp/o2o/dist/js/page/home.js


+ 4 - 0
www/webapp/o2o/js/build/.cache/home/index.js

@@ -1,4 +1,8 @@
+<<<<<<< HEAD
+/*TMODJS:{"version":10,"md5":"f360d9ee09ca9d54f420e9a6512efbef"}*/
+=======
 /*TMODJS:{"version":8,"md5":"b68c8016ad34d705e596a272499fc364"}*/
+>>>>>>> 1706258625cf17960ad83b6da113babc21dc9074
 template('home/index',function($data,$filename
 /**/) {
 'use strict';var $utils=this,$helpers=$utils.$helpers,showNavBar=$data.showNavBar,$out='';if(showNavBar ){

File diff suppressed because it is too large
+ 374 - 0
www/webapp/o2o/js/build/template.js


File diff suppressed because it is too large
+ 406 - 0
www/webapp/o2o/js/build/template/template.js


+ 79 - 75
www/webapp/o2o/js/model/address.js

@@ -1,88 +1,92 @@
 /**
  * 地址模型
  */
-define(['base', '$', 'native', 'api', 'user', 'config'], function(base, $, native, api, user) {
-	var Address = function() {
-		if (typeof Address.instance === 'object') {
-			return Address.instance;
-		}
-		Address.instance = this;
-		this.storagePrefix = 'address_';
-		this.list = [];
-		this.defaultAddress = {
-			name: '',
-		  	mobile: '',
-		  	address: {
-				province: '',
-			  	city: '',
-			  	area: '',
-			  	detail: '',
-				poi: {
-					uid: '',
-					name: ''
-				}
-		  	},
-			position: [0, 0]
-		};
-		this.newAddress = []; // 保存新添加地址
-	}
+define(['base', '$', 'native', 'api', 'user', 'config'], function (base, $, native, api, user) {
+    var Address = function () {
+        if (typeof Address.instance === 'object') {
+            return Address.instance;
+        }
+        Address.instance = this;
+        this.storagePrefix = 'address_';
+        this.list = [];
+        this.defaultAddress = {
+            name: '',
+            mobile: '',
+            address: {
+                province: '',
+                city: '',
+                area: '',
+                detail: '',
+                poi: {
+                    uid: '',
+                    name: ''
+                }
+            },
+            position: [0, 0]
+        };
+        this.newAddress = []; // 保存新添加地址
+    }
 
-	Address.prototype = new base();
+    Address.prototype = new base();
 
-	Address.prototype.addAddress = function(data, callback){
-		var that = this;
-		api.addAddress( data, function(res) {
-			// if (res.success) {
-			// }
+    //添加地址
+    Address.prototype.addAddress = function (data, callback) {
+        var that = this;
+        api.addAddress(data, function (res) {
+            // if (res.success) {
+            // }
 
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	};
+            if (typeof(callback) == 'function') {
+                callback(res);
+            }
+        });
+    };
 
-	Address.prototype.getList = function(data, callback){
-		var that = this;
-		api.getAddressList(
-			data
-		, function(res) {
-			if (res.success) {
-				that.list = res.data;
-				// that.defaultAddress = res.data[0];
-			}
+    //获取列表
+    Address.prototype.getList = function (data, callback) {
+        var that = this;
+        api.getAddressList(//获取地址列表
+            data
+            , function (res) {
+                if (res.success) {
+                    that.list = res.data;
+                    // that.defaultAddress = res.data[0];
+                }
 
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	};
+                if (typeof(callback) == 'function') {
+                    callback(res);
+                }
+            });
+    };
 
-	Address.prototype.editAddress = function(data, callback) {
-		var that = this;
-		api.editAddress( data, function(res) {
-			if (res.success) {
-				that.list = res.data;
-				that.defaultAddress = res.data[0];
-			}
+    //编辑地址
+    Address.prototype.editAddress = function (data, callback) {
+        var that = this;
+        api.editAddress(data, function (res) {
+            if (res.success) {
+                that.list = res.data;
+                that.defaultAddress = res.data[0];
+            }
 
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		});
-	}
+            if (typeof(callback) == 'function') {
+                callback(res);
+            }
+        });
+    }
 
-	Address.prototype.deleteAddress = function(userId, addressId, callback){
-		var that = this;
-		api.deleteAddress({
-			address_id: addressId,
-			user_id: userId,
-			request_from: 'weixin'
-		}, function(res){
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		})
-	}
+    //删除地址
+    Address.prototype.deleteAddress = function (userId, addressId, callback) {
+        var that = this;
+        api.deleteAddress({
+            address_id: addressId,
+            user_id: userId,
+            request_from: 'weixin'//请求微信
+        }, function (res) {
+            if (typeof(callback) == 'function') {
+                callback(res);
+            }
+        })
+    }
 
-	return new Address();
+    return new Address();
 })

+ 133 - 13
www/webapp/o2o/js/model/cart.js

@@ -1,6 +1,124 @@
 /**
  * 购物车模型,目前服务有多种类型,所以通过增加一个购物车对象来缓存用户所选的服务
  */
+<<<<<<< HEAD
+define(['base', '$', 'native', 'product'], function (base, $, native, product) {
+    var Cart = function () {
+        if (typeof Cart.instance === 'object') {
+            return Cart.instance;
+        }
+        Cart.instance = this;
+        this.storagePrefix = 'cart_';//存储前缀
+        this.products = this.getCache('products', null, {
+            1: {//洗澡-钟点工
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            2: {//剃光-除螨杀菌
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            3: {//美容-深度清洁
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            4: { // 洁牙-住家保姆
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            5: { // spa-日常清洁
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            6: { //训犬-育儿嫂
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            7: { //断尾-月子套餐
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            8: { // 碳酸浴-金牌月嫂
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            },
+            9: {//驱虫-催乳服务
+                petID: '',
+                productID: '',
+                petName: '',
+                petWeight: '',
+                petPrice: '',
+                couponName: '',
+                couponId: '',
+                couponVal: '',
+                couponList: []
+            }
+        });
+        this.petInfo = this.getCache('petInfo', null, {
+            petID: '',
+            productID: '',
+            petName: '',
+            petWeight: '',
+            petPrice: ''
+        });
+    };
+=======
 define(['base', '$', 'native', 'product'], function(base, $, native, product) {
 	var Cart = function() {
 		if (typeof Cart.instance === 'object') {
@@ -88,21 +206,23 @@ define(['base', '$', 'native', 'product'], function(base, $, native, product) {
 			price: ''
 		});
 	};
+>>>>>>> 1706258625cf17960ad83b6da113babc21dc9074
 
-	Cart.prototype = new base();
+    Cart.prototype = new base();
 
-	Cart.prototype.precheck = function(type, callback) {
-		var productID = this.products[type]['productID'];
-		var productParam = [{product_id: productID, count: 1}];
+    //预检
+    Cart.prototype.precheck = function (type, callback) {
+        var productID = this.products[type]['productID'];
+        var productParam = [{product_id: productID, count: 1}];//产品参数
 
-		api.precheck({
-			products: JSON.stringify(productParam)
-		}, function(res) {
-			if (typeof(callback) == 'function') {
-				callback(res);
-			}
-		})
-	};
+        api.precheck({
+            products: JSON.stringify(productParam)//产品
+        }, function (res) {
+            if (typeof(callback) == 'function') {
+                callback(res);
+            }
+        })
+    };
 
-	return new Cart();
+    return new Cart();
 })

+ 127 - 42
www/webapp/o2o/js/model/order.js

@@ -2,6 +2,43 @@
  * 订单模型
  */
 define(['base', '$', 'native', 'product', 'api'], function (base, $, native, product, api) {
+<<<<<<< HEAD
+    var Order = function () {
+        if (typeof Order.instance === 'object') {
+            return Order.instance;
+        }
+        Order.instance = this;
+        this.storagePrefix = 'order_';//存储前缀
+        this.memo = '';//备注
+        this.cost = 0;//费用
+        this.bookingDate = '';//预订日期
+        this.bookingTime = '';//预订时间
+        this.bookingTimeStr = '';//预约的时间序列
+        this.address = this.getCache('address', null);//地址
+        this.productType = '';//产品类型
+        this.productID = '';//产品ID
+        this.productCount = 1;//产品数量
+        this.petID = '';//宠物ID-
+        this.petName = '';//宠物名字-
+        this.petWeight = '';//宠物重量-
+        this.petPrice = '';//宠物价格-
+        this.couponID = '';//优惠券ID-
+        this.stationID = this.getCache('stationID', null, '');//服务站点ID
+        this.cacheReview = this.getCache('cacheReview', null, '');//缓存的评论
+        this.precedence = ''; // 是否加急
+        this.extraService = [];//额外的服务
+        this.extraServiceType = [];//额外的服务类型
+        // this.bath = '';     // 药浴
+        // this.desinsectization = ''; // 驱虫
+        // this.barbering = ''; // 剃毛
+        this.serviceName = '';//服务类型
+        this.servicePrice = '';//服务价格
+        this.appendID = '';//追加ID
+        this.beautician = { // 保洁师
+            name: '请选择',
+            id: ''
+        };
+=======
   var Order = function () {
     if (typeof Order.instance === 'object') {
       return Order.instance;
@@ -31,11 +68,32 @@ define(['base', '$', 'native', 'product', 'api'], function (base, $, native, pro
     this.beautician = { // 保洁师
       name: '请选择',
       id: ''
+>>>>>>> 1706258625cf17960ad83b6da113babc21dc9074
     };
-  };
 
-  Order.prototype = new base();
+    Order.prototype = new base();
 
+<<<<<<< HEAD
+    //重置 所有数据
+    Order.prototype.reset = function () {
+        this.couponID = '';
+        this.bookingTime = '';
+        this.bookingTimeStr = '';
+        this.bookingDate = '';
+        this.productType = '';
+        this.productID = '';
+        this.petID = '';
+        this.extraService = [];
+        this.serviceName = '';
+        this.servicePrice = '';
+        this.productCount = 1;
+        this.precedence = '';
+        this.extraServiceType = [];
+        this.beautician = {
+            name: '',
+            id: ''
+        };
+=======
   Order.prototype.reset = function () {
     this.couponID = '';
     this.bookingTime = '';
@@ -52,35 +110,61 @@ define(['base', '$', 'native', 'product', 'api'], function (base, $, native, pro
     this.beautician = {
       name: '',
       id: ''
+>>>>>>> 1706258625cf17960ad83b6da113babc21dc9074
     };
-  };
 
-  Order.prototype.addOrder = function (userID, channel, callback) {
-    var that = this;
+    //添加顺序
+    //channel-渠道
+    Order.prototype.addOrder = function (userID, channel, callback) {
+        var that = this;
 
-    var productParam = [{
-      product_id: this.productID,
-      count: this.productCount
-    }];
+        var productParam = [{//产品参数
+            product_id: this.productID,
+            count: this.productCount//产品数
+        }];
 
-    for (var i = 0; i < that.extraService.length; i++) {
-      if(that.extraService[i] && that.extraService[i].product_id) {
-        productParam.push(that.extraService[i]);
-      }
-    };
-    var extraServiceTypeParam = [];
-    that.extraServiceType.forEach(function(e, i) {
-      if(e !== 100) {
-        extraServiceTypeParam.push(e);
-      }
-    });
-    // productParam = productParam.concat(that.extraService);
+        for (var i = 0; i < that.extraService.length; i++) {//额外的服务长度
+            if (that.extraService[i] && that.extraService[i].product_id) {
+                productParam.push(that.extraService[i]);//产品参数
+            }
+        }
+        ;
+        var extraServiceTypeParam = [];//额外的服务类型参数
+        that.extraServiceType.forEach(function (e, i) {//额外的服务类型
+            if (e !== 100) {
+                extraServiceTypeParam.push(e);
+            }
+        });
+        // productParam = productParam.concat(that.extraService);
 
-    var coupons = [];
-    if (this.couponID != '') {
-      coupons.push(this.couponID);
-    }
+        var coupons = [];//优惠券
+        if (this.couponID != '') {
+            coupons.push(this.couponID);
+        }
 
+<<<<<<< HEAD
+        api.addOrder({//添加顺序
+            products: JSON.stringify(productParam),//产品参数
+            memo: this.memo,//备忘录
+            precedence: this.precedence,
+            booking_time: this.bookingDate + ' ' + this.bookingTime + ':00',//预订时间
+            address_id: this.address.address_id,//地址
+            coupons: JSON.stringify(coupons),//优惠券
+            station: this.stationID,//站
+            type: this.productType,//产品类型
+            tech_id: this.beautician.id,//美容师
+            user_id: userID,
+            order_channel: channel
+        }, function (res) {
+            if (res.success) {
+                that.id = res.data.id;
+            }
+            if (typeof (callback) == 'function') {
+                callback(res);
+            }
+        })
+    };
+=======
     api.addOrder({
       products: JSON.stringify(productParam),
       memo: this.memo,
@@ -104,23 +188,24 @@ define(['base', '$', 'native', 'product', 'api'], function (base, $, native, pro
       }
     })
   };
+>>>>>>> 1706258625cf17960ad83b6da113babc21dc9074
 
-  // 追加订单
-  Order.prototype.appendOrder = function (orderID, userID, products, callback) {
-    var that = this;
-    api.appendOrder({
-      order_id: orderID,
-      products: products,
-      user_id: userID
-    }, function(res) {
-      if (res.success) {
-        that.appendID = res.data.id;
-      }
-      if (typeof (callback) == 'function') {
-        callback(res);
-      }
-    })
-  }
+    // 追加订单
+    Order.prototype.appendOrder = function (orderID, userID, products, callback) {
+        var that = this;
+        api.appendOrder({
+            order_id: orderID,
+            products: products,
+            user_id: userID
+        }, function (res) {
+            if (res.success) {
+                that.appendID = res.data.id;
+            }
+            if (typeof (callback) == 'function') {
+                callback(res);
+            }
+        })
+    }
 
-  return new Order();
+    return new Order();
 })

+ 132 - 110
www/webapp/o2o/js/model/product.js

@@ -7,37 +7,41 @@ define(['base', '$', 'api'], function (base, $, api) {
       return Product.instance;
     }
     Product.instance = this;
-    this.storagePrefix = 'product_';
-    this.products = [];
-    this.productDic = {};     //商品对象
+    this.storagePrefix = 'product_';//存储前缀
+    this.products = [];            //产品
+    this.productDic = {};          //商品对象
     this.extraProductDic = {};     //商品对象
     this.productGroup = {     //商品分组
-      1: [],            //洗澡
-      2: [],            //剪毛
-      3: [],            //美容
-      4: [],            //洁牙
-      5: [],            //SPA
-      6: [],            //训犬
-      7: [],            //断尾
-      8: []             //碳酸浴
+      1: [],            //洗澡-钟点工
+      2: [],            //剪毛-除螨杀菌
+      3: [],            //美容-深度清洁
+      4: [],            //洁牙-住家保姆
+      5: [],            //SPA-日常清洁
+      6: [],            //训犬-育儿嫂
+      7: [],            //断尾-月子套餐
+      8: [],             //碳酸浴-金牌月嫂
+      9: []             //驱虫-催乳服务
     };
     this.extraProductGroup = {     //商品分组
-      1: [],          //洗澡
-      2: [],          //剪毛
-      3: [],          //美容
-      4: [],          //洁牙
-      5: [],           //SPA
-      6: [],            //训犬
-      7: [],            //断尾
-      8: []             //碳酸浴
+      1: [],            //洗澡-钟点工
+      2: [],            //剪毛-除螨杀菌
+      3: [],            //美容-深度清洁
+      4: [],            //洁牙-住家保姆
+      5: [],            //SPA-日常清洁
+      6: [],            //训犬-育儿嫂
+      7: [],            //断尾-月子套餐
+      8: [],             //碳酸浴-金牌月嫂
+      9: []             //驱虫-催乳服务
     };
     this.precedence = 40;   // 加急
-    this.extraService = [];
-    this.offDay = [];
+    this.extraService = [];//额外的服务
+    this.offDay = [];//休息日
   };
 
   Product.prototype = new base();
 
+
+  //获得第一批
   Product.prototype.getGroupStep = function (type) {
     var steps = [];
 
@@ -104,11 +108,12 @@ define(['base', '$', 'api'], function (base, $, api) {
     return steps;
   };
 
+  //描述
   Product.prototype.getGroupDesc = function (type) {
     var descs = [];
     var notes = [];
     switch(type){
-      case 1: // 洗澡
+      case 1: // 洗澡-钟点工
         descs = [
           '1.疫苗未完成或完成一周内的幼犬猫不提供服务;',
           '2.怀孕、哺乳期间的犬猫不提供服务;',
@@ -124,7 +129,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 2: // 剃光
+      case 2: // 剃光-除螨杀菌
         descs = [
           '1.疫苗未完成或完成一周内的幼犬不提供服务;',
           '2.怀孕、哺乳期间的母犬不提供服务;',
@@ -140,7 +145,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ]
         break;
-      case 3: // 美容
+      case 3: // 美容-深度清洁
         descs = [
           '1.疫苗未完成或完成一周内的幼犬猫不提供服务;',
           '2.怀孕、哺乳期间的犬猫不提供服务;',
@@ -156,7 +161,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 4: // 洁牙
+      case 4: // 洁牙-住家保姆
         descs = [
           '1.疫苗未完成或完成一周内的幼犬不提供服务;',
           '2.怀孕、哺乳期间的母犬不提供服务;',
@@ -173,7 +178,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 5: // SPA
+      case 5: // SPA-日常清洁
         descs = [
           '1.疫苗未完成或完成一周内的幼犬不提供服务;',
           '2.怀孕、哺乳期间的母犬不提供服务;',
@@ -190,7 +195,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 6: // 训犬
+      case 6: // 训犬-育儿嫂
         descs = [
           '1.需提前一周预约;',
           '2.上门训犬的时间:两个小时左右;',
@@ -204,7 +209,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 7: // 断尾
+      case 7: // 断尾-月子套餐
         descs = [
           '1.本服务只限出生后3-7天的幼犬;',
           '2.服务前,主人须签订《断尾告知书》,告知服务人员需要留几节尾骨,方可进行下一步断尾服务;'
@@ -217,7 +222,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '请提前三天预约,预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 8: // 碳酸浴
+      case 8: // 碳酸浴-金牌月嫂
         descs = [
           '1.疫苗未完成或完成一周内的幼犬不提供服务;',
           '2.怀孕、哺乳期间的母犬不提供服务;',
@@ -233,7 +238,7 @@ define(['base', '$', 'api'], function (base, $, api) {
           '请提前1天预约,预约时间仅供参考,具体上门时间请以壹管家客服安排为准。'
         ];
         break;
-      case 11: // 驱虫
+      case 11: // 驱虫-催乳服务
         descs = [
           '1.疫苗未完成或完成一周内的幼犬猫不提供服务;',
           '2.怀孕、哺乳期间的犬猫不提供服务;',
@@ -294,50 +299,51 @@ define(['base', '$', 'api'], function (base, $, api) {
     };
   };
 
+  //获得商品照片组
   Product.prototype.getGroupPics = function (type) {
     var imglists = [];
     switch(type){
-      case 1:
+      case 1:// 洗澡-钟点工
         imglists = [
           '20151030-1-1.jpg'
         ];
         break;
-      case 2:
+      case 2: // 剃光-除螨杀菌
         imglists = [
           '20151030-2-1.jpg'
         ];
         break;
-      case 3:
+      case 3:// 美容-深度清洁
         imglists = [
           '20151030-3-1.jpg'
         ];
         break;
-      case 4:
+      case 4:// 洁牙-住家保姆
         imglists = [
           '20151030-4-1.jpg'
         ];
         break;
-      case 5:
+      case 5:// SPA-日常清洁
         imglists = [
           '20151202-5-1.jpg'
         ];
         break;
-      case 6:
+      case 6:// 训犬-育儿嫂
         imglists = [
           '20151224-6-1.jpg'
         ];
         break;
-      case 7:
+      case 7:// 断尾-月子套餐
         imglists = [
           '20160106-7-1.jpg'
         ];
         break;
-      case 8:
+      case 8:// 碳酸浴-金牌月嫂
         imglists = [
           '20160111-8-1.jpg'
         ];
         break;
-      case 11:
+      case 11:// 驱虫-催乳服务
         imglists = [
           '20151030-6-1.jpg'
         ];
@@ -360,42 +366,43 @@ define(['base', '$', 'api'], function (base, $, api) {
     }
   }
 
+  //得到商品名称组
   Product.prototype.getGroupName = function (type) {
     var name = '';
 
     switch(type){
       case 1:
-        name = '宠物洗澡';
+        name = '宠物洗澡';/*宠物洗澡*/
         break;
       case 2:
-        name = '宠物剃光';
+        name = '宠物剃光';/*宠物剃光*/
         break;
       case 3:
-        name = '宠物美容';
+        name = '宠物美容';/*宠物美容*/
         break;
       case 4:
-        name = '宠物洁牙';
+        name = '宠物洁牙';/*宠物洁牙*/
         break;
       case 5:
-        name = '宠物SPA';
+        name = '宠物SPA';/*宠物SPA*/
         break;
       case 6:
-        name = '宠物训犬';
+        name = '宠物训犬';/*宠物训犬*/
         break;
       case 7:
-        name = '宠物断尾';
+        name = '宠物断尾';/*宠物断尾*/
         break;
       case 8:
-        name = '碳酸浴';
+        name = '碳酸浴';/*碳酸浴*/
         break;
       case 11:
-        name = '宠物驱虫';
+        name = '宠物驱虫';/*宠物驱虫*/
         break;
       case 12:
-        name = '宠物药浴';
+        name = '宠物药浴';/*宠物药浴*/
         break;
       case 13:
-        name = '一次性局部染色';
+        name = '一次性局部染色';/*一次性局部染色*/
         break;
       default:
         break;
@@ -404,45 +411,46 @@ define(['base', '$', 'api'], function (base, $, api) {
     return name;
   };
 
+  //获得详细的组名
   Product.prototype.getGroupFullName = function (type) {
     var name = '';
 
     switch(type){
       case 1:
-        name = '宠物洗澡';
+        name = '宠物洗澡';/*宠物洗澡*/
         break;
       case 2:
-        name = '宠物剃光';
+        name = '宠物剃光';/*宠物剃光*/
         break;
       case 3:
-        name = '宠物美容(含洗澡)';
+        name = '宠物美容(含洗澡)';/*宠物美容(含洗澡)*/
         break;
       case 4:
-        name = '宠物洁牙';
+        name = '宠物洁牙';/*宠物洁牙*/
         break;
       case 5:
-        name = 'SPA';
+        name = 'SPA';/*SPA*/
         break;
       case 6:
-        name = '训犬';
+        name = '训犬';/*训犬*/
         break;
       case 7:
-        name = '断尾';
+        name = '断尾';/*断尾*/
         break;
       case 8:
-        name = '碳酸浴';
+        name = '碳酸浴';/*碳酸浴*/
         break;
       case 9:
-        name = '助产';
+        name = '助产';/*助产*/
         break;
       case 11:
-        name = '宠物驱虫';
+        name = '宠物驱虫';/*宠物驱虫*/
         break;
       case 12:
-        name = '宠物药浴';
+        name = '宠物药浴';/*宠物药浴*/
         break;
       case 13:
-        name = '宠物染色';
+        name = '宠物染色';/**/
       default:
         break;
     }
@@ -450,6 +458,7 @@ define(['base', '$', 'api'], function (base, $, api) {
     return name;
   };
 
+  //获得产品称号
   Product.prototype.getProductTitle = function (type) {
     var title = {
       name: '',
@@ -510,6 +519,7 @@ define(['base', '$', 'api'], function (base, $, api) {
     return title;
   }
 
+  //获得微信分享
   Product.prototype.getWXShare = function (type) {
     var title = {
       name: '',
@@ -570,16 +580,17 @@ define(['base', '$', 'api'], function (base, $, api) {
     return title;
   }
 
+  //获得产品列表
   Product.prototype.getProductList = function (type, petID) {
     var productList = [];
-    if (this.productGroup.hasOwnProperty(type)) {
-      var petList = this.productGroup[type];
-      for (var i in petList) {
-        var petInfo = petList[i];
-        if (!petID || petInfo.id == petID) {
+    if (this.productGroup.hasOwnProperty(type)) {//自己的属性
+      var petList = this.productGroup[type];//产品组
+      for (var i in petList) {//宠物列表
+        var petInfo = petList[i];//宠物信息
+        if (!petID || petInfo.id == petID) {//宠物ID
           for (var j in petInfo.products) {
             if ($.inArray(petInfo.products[j], productList) == -1) {
-              productList.push(petInfo.products[j]);
+              productList.push(petInfo.products[j]);//产品列表
             }
           }
           if (petID) {
@@ -591,28 +602,31 @@ define(['base', '$', 'api'], function (base, $, api) {
     return productList;
   };
 
+  //适合服务的宠物
+  //petMaxWeight-最大宠物质量以及最小宠物数量
   Product.prototype.isSuitablePet = function (type, petName, petMaxWeight, petMinWeight) {
-    var suitablePet = {};
+    var suitablePet = {};//合适的宠物
     var productGroupTmp = this.productGroup[type];
-    for(var i in productGroupTmp) {
-      var productGroupTmpList = productGroupTmp[i];
+    for(var i in productGroupTmp) {//产品模块组
+      var productGroupTmpList = productGroupTmp[i];//产品模块列表组
       if (productGroupTmpList.pet_types[0]['name'] == petName && productGroupTmpList.min_weight == petMinWeight && productGroupTmpList.max_weight == petMaxWeight) {
         suitablePet = {
-          petPrice: productGroupTmpList.price,
-          productID: productGroupTmpList.id
+          petPrice: productGroupTmpList.price,//价格
+          productID: productGroupTmpList.id//产品ID
         }
       };
     }
-    return suitablePet;
+    return suitablePet;//合适的宠物
   }
 
+  //宠物名字
   Product.prototype.getPetName = function (type, petID) {
     var petName = '';
-    if (this.productGroup.hasOwnProperty(type)) {
+    if (this.productGroup.hasOwnProperty(type)) {//产品组自己的属性为  TYEP
       var petList = this.productGroup[type];
-      for (var i in petList) {
+      for (var i in petList) {//宠物列表
         var petInfo = petList[i];
-        if (petInfo.id == petID) {
+        if (petInfo.id == petID) {//判断ID一致赋予宠物名字
           petName = petInfo['name'];
           break;
         }
@@ -621,8 +635,9 @@ define(['base', '$', 'api'], function (base, $, api) {
     return petName;
   };
 
+  //得到宠物的重量
   Product.prototype.getPetWeight = function (productID) {
-    var productInfo = this.productDic[productID];
+    var productInfo = this.productDic[productID];//产品信息
     if (!productInfo) {
       return '';
     } else {
@@ -631,66 +646,72 @@ define(['base', '$', 'api'], function (base, $, api) {
   };
 
   Product.prototype.getProductPrice = function (productID) {
-    var productInfo = this.productDic[productID];
+    var productInfo = this.productDic[productID];//产品中心
     if (!productInfo) {
       return '';
     } else {
-      return productInfo.price + '元';
+      return productInfo.price + '元';//产品价格
     }
   };
 
+  //获得宠物服务类型
+  //productType-产品类型
   Product.prototype.getPetServiceType = function (productType, productID) {
     var petServiceType = '';
-    this.productGroup[productType].forEach(function(e) {
-      if (e.id == productID) {
+    this.productGroup[productType].forEach(function(e) {//遍历函数
+      if (e.id == productID) {//id一致则将服务类型赋值给petServiceType
         petServiceType = e.service_type
       }
     });
     return petServiceType;
   };
 
+  //获得额外的服务类型
+  //checkedName - 检查名称
   Product.prototype.getExtraServiceList = function (type, petName, checkedName) {
     var extraServiceTmp = [];
-    var extraServiceList = this.extraProductGroup[type];
+    var extraServiceList = this.extraProductGroup[type];//额外额产品组
     for(var i in extraServiceList) {
-      if (extraServiceList[i].pet_types[0].name == petName) {
+      if (extraServiceList[i].pet_types[0].name == petName) {//pet_types 宠物类型
         var seleted = false;
-        if (extraServiceList[i].name == checkedName) {
+        if (extraServiceList[i].name == checkedName) {//如果额外的服务类型与检查的一致
           seleted = true;
         }
+        //额外的服务参数
         var extraServiceParam = {
-          name: extraServiceList[i].name,
-          price: extraServiceList[i].price,
-          id: extraServiceList[i].id,
-          serviceType: extraServiceList[i].service_type,
-          seleted: seleted
+          name: extraServiceList[i].name,//名字
+          price: extraServiceList[i].price,//价格
+          id: extraServiceList[i].id,//ID
+          serviceType: extraServiceList[i].service_type,//服务类型
+          seleted: seleted//选择
         }
-        extraServiceTmp.push(extraServiceParam);
+        extraServiceTmp.push(extraServiceParam);//额外的服务数组
       };
     }
     return extraServiceTmp
   }
 
+  //获取列表
   Product.prototype.getList = function (type, callback) {
     var that = this;
-    api.getProductList({
+    api.getProductList({//获得产品列表
       type: type
     }, function (res) {
       if (res.success) {
-        that.products = res.data.products;
-        that.productList = {};
-        that.productGroup[type] = [];
+        that.products = res.data.products;//产品
+        that.productList = {};//产品列表
+        that.productGroup[type] = [];//产品组
 
-        var petDic = {};
-        var productDatas = res['data']['products'];
-        var extraroducts = res['data']['extra_products'];
+        var petDic = {};//宠物DIC
+        var productDatas = res['data']['products'];//产品数据
+        var extraroducts = res['data']['extra_products'];//额外的服务
         that.extraService = extraroducts;
 
         for (var i = 0, len = productDatas.length; i < len; i++) {
-          var eachProduct = productDatas[i];
-          var petIDs = [];
+          var eachProduct = productDatas[i];//每个产品
+          var petIDs = [];//宠物ID
           for (var j = 0, len1 = eachProduct['pet_types'].length; j < len1; j++) {
-            var eachPet = eachProduct['pet_types'][j];
+            var eachPet = eachProduct['pet_types'][j];//遍历
             petIDs.push(eachPet.id);
             if (!petDic[eachPet.id]) {
               petDic[eachPet.id] = {
@@ -702,7 +723,7 @@ define(['base', '$', 'api'], function (base, $, api) {
               petDic[eachPet.id]['products'].push(eachProduct.id);
             }
           }
-          that.productDic[eachProduct.id] = {
+          that.productDic[eachProduct.id] = {//每个产品的ID
             petIDs: petIDs,
             maxWeight: eachProduct.max_weight,
             minWeight: eachProduct.min_weight,
@@ -722,6 +743,7 @@ define(['base', '$', 'api'], function (base, $, api) {
     });
   }
 
+  //列出所有的产品
   Product.prototype.getListAll = function (userID, callback) {
     var that = this;
     api.getProductList({
@@ -758,20 +780,20 @@ define(['base', '$', 'api'], function (base, $, api) {
                 products: [eachProduct.id]
               };
             } else {
-              petDic[eachPet.id]['products'].push(eachProduct.id);
+              petDic[eachPet.id]['products'].push(eachProduct.id);//给每个宠物ID下的产品中添加产品ID
             }
           }
 
-          that.productDic[eachProduct.id] = {
-            petIDs: petIDs,
-            maxWeight: eachProduct.max_weight,
-            minWeight: eachProduct.min_weight,
+          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)
+            price: parseFloat(eachProduct.price)//解析产品价格
             // 价格不要加小数点后两位
           };
         }
-
+        //额外的产品
         for (var i = 0, len = extraroducts.length; i < len; i++) {
           var eachProduct = extraroducts[i];
           var petIDs = [];
@@ -814,7 +836,7 @@ define(['base', '$', 'api'], function (base, $, api) {
     // 某个主服务里面 是否有某个附加服务
     var suitableService = this.productGroup;
     var suitableServiceTmp = this.extraProductGroup;
-    for(var i in suitableService) {
+    for(var i in suitableService) {//合适的服务
       suitableService[i][0]['suitable'] = false;
       for(var j in suitableServiceTmp[i]) {
         if (suitableServiceTmp[i][j].name == name) {

+ 22 - 17
www/webapp/o2o/js/model/review.js

@@ -7,20 +7,21 @@ define(['base', '$', 'api'], function (base, $, api) {
       return Review.instance;
     }
     Review.instance = this;
-    this.storagePrefix = 'review_';
-    this.reviewDatas = {};
-    this.techCommentData = {};
+    this.storagePrefix = 'review_';//存储前缀
+    this.reviewDatas = {};//审查数据
+    this.techCommentData = {};//评论数据
   }
 
-  var defultReviewData = {
+  var defultReviewData = {//默认评论数据
     page: 0,
     list: [],
-    refreshTime: 0,
+    refreshTime: 0,//刷新时间
     hasMore: true
   };
 
   Review.prototype = new base();
 
+  //得到评论的数据
   Review.prototype.getReviewData = function(type) {
     if (!this.reviewDatas.hasOwnProperty(type)) {
       this.reviewDatas[type] = $.extend(true, {}, defultReviewData);
@@ -28,20 +29,23 @@ define(['base', '$', 'api'], function (base, $, api) {
     return this.reviewDatas[type];
   };
 
+  //获取技术评论数据
   Review.prototype.getTechCommentData = function(techID) {
-    if (!this.techCommentData.hasOwnProperty(techID)) {
+    if (!this.techCommentData.hasOwnProperty(techID)) {//有自己的属性
       this.techCommentData[techID] = $.extend(true, {}, defultReviewData);
     }
     return this.techCommentData[techID];
   };
 
-  Review.prototype.getList = function (type, callback, reset) {
+  //获取列表
+  Review.prototype.getList = function (type, callback, reset) {//reset-重置
     var that = this;
-    var reviewData = this.getReviewData(type);
-    var page = reviewData.page + 1;
+    var reviewData = this.getReviewData(type);//审查数据
+    var page = reviewData.page + 1;//
     if (reset) {
       page = 1;
     }
+    //获取评论列表
     api.getReviewList({
       type: type,
       page: page
@@ -53,7 +57,7 @@ define(['base', '$', 'api'], function (base, $, api) {
         } else {
           reviewData.hasMore = true;
         }
-        reviewData.page = res.current_page;
+        reviewData.page = res.current_page;//当前页
         reviewData.refreshTime = new Date().getTime();
         if (reset) {
           reviewData.list = res.data.comments;
@@ -68,6 +72,7 @@ define(['base', '$', 'api'], function (base, $, api) {
     });
   };
 
+  //获得技术评论
   Review.prototype.getTechComment = function (techID, callback, reset) {
     var that = this;
     var techData = this.getTechCommentData(techID);
@@ -80,23 +85,23 @@ define(['base', '$', 'api'], function (base, $, api) {
       page: page
     }, function (res) {
       if (res.success) {
-        if (res.current_page >= res.sum_page) {
+        if (res.current_page >= res.sum_page) {//如果当前页数大于等于总页数.则其值等于总页数
           res.current_page = res.sum_page;
-          techData.hasMore = false;
+          techData.hasMore = false;//到了这里,基本上没有个多的页数了
         } else {
-          techData.hasMore = true;
+          techData.hasMore = true;//否则还有更多的页数
         }
         techData.page = res.current_page;
-        techData.refreshTime = new Date().getTime();
+        techData.refreshTime = new Date().getTime();//刷新时间
         if (reset) {
-          techData.list = res.data.comments;
+          techData.list = res.data.comments;//评论列表
         } else {
-          techData.list = techData.list.concat(res.data.comments);
+          techData.list = techData.list.concat(res.data.comments);//concat  2个数组
         }
       }
 
       if (typeof (callback) == 'function') {
-        callback(res);
+        callback(res);//回调res
       }
     });
   };

+ 77 - 51
www/webapp/o2o/js/model/user.js

@@ -40,17 +40,17 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
         hasMore: false
       }
     };
-    this.appendOrder = {}
-    this.coupons = [];
-    this.orderCoupons = [];
-    this.unuseable_coupons = [];
-    this.activities = this.getCache('activities', null, {
+    this.appendOrder = {};//追加订单
+    this.coupons = [];//优惠券
+    this.orderCoupons = [];// 优惠券顺序
+    this.unuseable_coupons = []; //优惠券不可用
+    this.activities = this.getCache('activities', null, {//活动
       "visited_dog": false,
       "visited_order0104": false
     });
-    this.productVisit = this.getCache('productVisit', null, {
+    this.productVisit = this.getCache('productVisit', null, {//产品访问-缓存为空
       1: {
-        visited: false
+        visited: false//访问
       },
       2: {
         visited: false
@@ -95,33 +95,36 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
         visited: false
       }
     });
-    this.selectTech = {
-      can: [],
-      match: []
+    this.selectTech = {//选择...技术?
+      can: [],//能够
+      match: []//匹配
     };
-    this.isCheck = this.getCache('isCheck', null, {
-      "couponCheck": false
+    this.isCheck = this.getCache('isCheck', null, {//检测缓存中是否有优惠券数据
+      "couponCheck": false//优惠券是否存在
     });
   }
 
-  User.prototype = new base();
+  User.prototype = new base();//新建base()函数.继承User函数的原型
+
 
+  //获取用户信息
   User.prototype.getUserInfo = function(callback){
     var that = this;
     native.getUserInfo(function(res) {
-      loginWithData.call(that, res);
-      if (typeof(callback) == 'function') {
-        callback();
+      loginWithData.call(that, res);//loginWithData-登录数据
+      if (typeof(callback) == 'function') {//判断callback是否为函数.
+        callback();//调用函数
       }
     });
   };
 
+  //获取优惠券名字
   User.prototype.getCouponName = function (couponID) {
-    var couponName = '';
-    for (var i in this.orderCoupons) {
-      var couponInfo = this.orderCoupons[i];
-      if (couponInfo.id == couponID) {
-        couponName = couponInfo['coupon']['name'];
+    var couponName = '';//优惠券名字为空
+    for (var i in this.orderCoupons) {//将代购的优惠券信息赋给  i
+      var couponInfo = this.orderCoupons[i];//优惠券信息为  this.orderCoupons[i];
+      if (couponInfo.id == couponID) {//判断优惠券信息是否真实
+        couponName = couponInfo['coupon']['name'];//若为真返回优惠券的名字
         break;
       }
     }
@@ -129,12 +132,14 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     return couponName;
   };
 
+
+  //获取优惠券价格
   User.prototype.getCouponValue = function (couponID) {
     var couponValue = 0;
     for (var i in this.orderCoupons) {
       var couponInfo = this.orderCoupons[i];
-      if (couponInfo.id == couponID) {
-        couponValue = couponInfo['coupon']['value'];
+      if (couponInfo.id == couponID) {//判断优惠券是否存在
+        couponValue = couponInfo['coupon']['value'];//value为优惠券价格
         break;
       }
     }
@@ -142,6 +147,8 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     return couponValue;
   };
 
+
+  //获取最多可以使用的优惠券
   User.prototype.getMaxAvailableCoupon = function () {
     var couponSelectVal = 0;
     var couponTmp = 0;
@@ -152,11 +159,12 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
       };
     });
     return {
-      couponSelectVal: couponSelectVal,
-      couponIndex: couponTmp
+      couponSelectVal: couponSelectVal,//选择优惠券
+      couponIndex: couponTmp//优惠券索引
     }
   };
 
+  //给每一个获取到的优惠券进行排序--index索引
   User.prototype.getAvailableCoupon = function () {
     var couponSelectVal = 0;
     var couponTmp = 0;
@@ -172,6 +180,7 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     }
   };
 
+  //优惠券列表
   User.prototype.getCouponList = function(userId, callback){
     var that = this;
 
@@ -212,46 +221,49 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     });
   };
 
+  //获取各类产品的优惠券
   User.prototype.getProductCoupon = function(products, time, type, callback){
     var that = this;
     api.getCouponList({
-      products: products,
-      booking_time: time,
-      user_id: this.id,
-      type: type
+      products: products,//产品
+      booking_time: time,//预订时间
+      user_id: this.id,//用户id
+      type: type//资源
     }, function(res) {
       if (res.success) {
-        that.orderCoupons = res.data;
-        that.unuseable_coupons = res.unuseable_coupons;
+        that.orderCoupons = res.data;//订购优惠券
+        that.unuseable_coupons = res.unuseable_coupons;//不可用的优惠券
       }
 
-      if (typeof(callback) == 'function') {
+      if (typeof(callback) == 'function') {//true  回调函数  中将传值res
         callback(res);
       }
     });
   };
 
+  //兑换优惠券   api预先定义的函数
   User.prototype.exchangeCoupon = function(couponCode, callback){
     var that = this;
 
     api.exchangeCoupon({
       user_id: that.id,
-      exchange_code: couponCode
+      exchange_code: couponCode//兑换码--为优惠券编码
     }, function(res) {
       if (typeof(callback) == 'function') {
-        callback(res);
+        callback(res);//回调函数传回
       }
     });
   };
 
+  //判断当前用户是否登录.没有则让其去登录
   User.prototype.goLogin = function(callback){
     var that = this;
-    this.getUserInfo(function(res) {
+    this.getUserInfo(function(res) {//在获取用户信息
       if (that.id == '') {
-        native.login(function(resA) {
-          loginWithData.call(that, resA);
+        native.login(function(resA) {//本地中读取是否存在登陆数据
+          loginWithData.call(that, resA);//调用登录数据
 
-          if (typeof(callback) == 'function') {
+          if (typeof(callback) == 'function') {//判断callback是否为函数,true让其回调
             callback();
           }
         });
@@ -263,11 +275,12 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     });
   };
 
+  //是否检查登陆凭据是否存在
   User.prototype.checkLogin = function(callback){
     var that = this;
     if (this.id == '') {
       this.goLogin(function() {
-        if (that.id != '' && typeof(callback) == 'function') {
+        if (that.id != '' && typeof(callback) == 'function') {//用户ID是否为空并且callback是否为函数
           callback();
         }
       });
@@ -278,6 +291,7 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     }
   };
 
+  //获取订单列表
   User.prototype.getOrderList = function(userId, type, callback, more){
     var that = this;
     var page = this.orders[type].page + 1;
@@ -289,15 +303,15 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
       type: type,
       page: page
     }, function(res) {
-      if (res.current_page >= res.sum_page) {
+      if (res.current_page >= res.sum_page) {//如果当前页订单大于等于总页数
         res.current_page = res.sum_page;
         that.orders[type].hasMore = false;
       } else {
         that.orders[type].hasMore = true;
       }
-      that.orders[type].page = res.current_page;
+      that.orders[type].page = res.current_page;//当前网页
       if (more) {
-        that.orders[type].data = that.orders[type].data.concat(res.data);
+        that.orders[type].data = that.orders[type].data.concat(res.data);//concat 2个数组
       } else {
         that.orders[type].data = res.data;
       }
@@ -307,23 +321,26 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     });
   };
 
+  //订单明细
   User.prototype.getOrderDetail = function(orderID, callback) {
     var that = this;
     api.getOrderDetail({
       user_id: that.id,
-      order_id: orderID
+      order_id: orderID//订单ID为orderID
     }, function(res) {
       if (typeof(callback) == 'function') {
         callback(res);
       }
     });
-  }
+  };
 
+  //订单信息
+  //遍历函数。将所有产生的订单信息赋值给orderInfo
   User.prototype.getOrderInfo = function(orderID){
     var that = this;
-    var orderInfo = {};
+    var orderInfo = {};//数组
     var orderList = this.orders[1].data;
-    orderList.forEach(function(e, i) {
+    orderList.forEach(function(e, i) {//遍历函数
       if (e.id == orderID ) {
         orderInfo = e;
       }
@@ -331,6 +348,7 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     return orderInfo;
   };
 
+  //退款单
   User.prototype.refundOrder = function(orderID, callback) {
     var that = this;
     var from = '';
@@ -344,8 +362,9 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
         callback(res);
       }
     })
-  }
+  };
 
+  //完成订单
   User.prototype.finishOrder = function(orderID, callback) {
     var that = this;
     api.finishOrder({
@@ -356,8 +375,9 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
         callback(res);
       }
     })
-  }
+  };
 
+  //取消订单
   User.prototype.cancelOrder = function (orderID, callback) {
     var that = this;
 
@@ -374,6 +394,10 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     })
   };
 
+  //获得技术列表
+  //serviceType-服务类型
+  //bookingTime-预订时间
+  //addressID-地址
   User.prototype.getTechList = function (serviceType, bookingTime, addressID, callback) {
     var that = this;
     api.selectTech({
@@ -383,8 +407,8 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
       user_id: that.id
     }, function (res) {
       if (res.success) {
-        that.selectTech.can = res.data.can_select_tech;
-        that.selectTech.match = res.data.service_match_tech;
+        that.selectTech.can = res.data.can_select_tech;//可选择技术
+        that.selectTech.match = res.data.service_match_tech;//服务匹配技术
       }
       if (typeof (callback) == 'function') {
         callback(res);
@@ -392,6 +416,8 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     })
   };
 
+
+  //登录数据
   function loginWithData(res){
     if (res.success) {
       var userData = res.data;
@@ -411,5 +437,5 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function(ba
     }
   }
 
-  return new User();
+  return new User();//new User函数
 })

+ 1 - 1
www/webapp/o2o/js/page/activities/cat.js

@@ -23,7 +23,7 @@ define(['template', 'native', 'config', 'user'], function (template, native, con
       });
       var d = new Image();
       d.src = url;
-      $doc.trigger('spa:openloader');
+      $doc.trigger('spa:openloader');//触发
       d.onload = function() {
         $doc.trigger('spa:closeloader');
         $('.spa-page-body', $view).html(tpl);

+ 72 - 37
www/webapp/o2o/js/page/home.js

@@ -3,7 +3,6 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
         event.preventDefault();
         native.back();
     }
-
     return {
         title: '壹管家上门服务',
         body: '',
@@ -38,55 +37,95 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
                 native.call('4000328170');
             }, $view);
 
-            // SPA
-            $.newTouch('.btn-action-spa', function (event) {
+
+            //日常清洁-SPA
+            $.newTouch('.btn-action-richang', function (event) {
                 event.preventDefault();
                 goProductPage(5);
             }, $view);
+            // SPA
+           /* $.newTouch('.btn-action-spa', function (event) {
+                event.preventDefault();
+                goProductPage(5);
+            }, $view);*/
 
-            // 美容
-            $.newTouch('.btn-action-groom', function (event) {
+
+            //深度清洁-美容
+            $.newTouch('btn-action-shendu', function (event) {
                 event.preventDefault();
 
                 goProductPage(3);
             }, $view);
+            // 美容
+            /*$.newTouch('.btn-action-groom', function (event) {
+                event.preventDefault();
 
-            // 剃毛
-            $.newTouch('.btn-action-shave', function (event) {
+                goProductPage(3);
+            }, $view);*/
+
+
+            //除螨杀菌-剃毛
+            $.newTouch('btn-action-chumanshajun', function (event) {
                 event.preventDefault();
                 goProductPage(2);
             }, $view);
+            // 剃毛
+            /*$.newTouch('.btn-action-shave', function (event) {
+                event.preventDefault();
+                goProductPage(2);
+            }, $view);*/
 
-            // 洗澡
-            $.newTouch('.btn-action-bath', function (event) {
+
+            //钟点工-洗澡
+            $.newTouch('.btn-action-zhongdiangong', function (event) {
                 event.preventDefault();
                 goProductPage(1);
             }, $view);
+            // 洗澡
+           /* $.newTouch('.btn-action-bath', function (event) {
+                event.preventDefault();
+                goProductPage(1);
+            }, $view);*/
 
-            //日常清洁=洁牙
-            $.newTouch('.btn-action-richang', function (event) {
+
+            //住家保姆=洁牙
+            $.newTouch('.btn-action-zhujiabaomu', function (event) {
                 event.preventDefault();
                 goProductPage(4);
             }, $view);
-           /*  //洁牙
-            $.newTouch('.btn-action-jieya', function (event) {
-              event.preventDefault();
-              goProductPage(4);
-            }, $view);*/
+            /*  //洁牙
+             $.newTouch('.btn-action-jieya', function (event) {
+             event.preventDefault();
+             goProductPage(4);
+             }, $view);*/
 
-            // 训犬
-            $.newTouch('.btn-action-xunquan', function (event) {
+
+            //育儿嫂-训犬
+            $.newTouch('.btn-action-yuersao', function (event) {
                 event.preventDefault();
                 goProductPage(6);
             }, $view);
+            // 训犬
+            /*$.newTouch('.btn-action-xunquan', function (event) {
+                event.preventDefault();
+                goProductPage(6);
+            }, $view);*/
 
-            // 断尾
-            $.newTouch('.btn-action-duanwei', function (event) {
+
+            //月子套餐-断尾
+            $.newTouch('.btn-action-yuezitaocan', function (event) {
                 event.preventDefault();
                 goProductPage(7);
             }, $view);
-            //除螨杀菌-碳酸浴
-            $.newTouch('.btn-action-tansuanyun', function (event) {
+            // 断尾
+            /*$.newTouch('.btn-action-duanwei', function (event) {
+                event.preventDefault();
+                goProductPage(7);
+            }, $view);*/
+
+
+            //金牌月嫂-碳酸浴
+            $.newTouch('.btn-action-jinpaiyuesao', function (event) {
                 event.preventDefault();
                 goProductPage(8);
             }, $view);
@@ -95,8 +134,10 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
              event.preventDefault();
              goProductPage(8);
              }, $view);*/
-            //深度清洁=屈虫
-            $.newTouch('.btn-action-shendu', function (event) {
+
+
+            //催乳服务-驱虫
+            $.newTouch('.btn-action-cuirufuwu', function (event) {
                 event.preventDefault();
                 goProductPage(11);
             }, $view);
@@ -105,16 +146,13 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
              event.preventDefault();
              goProductPage(11);
              }, $view);*/
-            //其它-药浴
-            $.newTouch('.btn-action-qita', function (event) {
-                event.preventDefault();
-                goProductPage(12);
-            }, $view);
+
+
             // 药浴
-           /* $.newTouch('.btn-action-yaoyu', function (event) {
-                event.preventDefault();
-                goProductPage(12);
-            }, $view);*/
+             $.newTouch('.btn-action-yaoyu', function (event) {
+             event.preventDefault();
+             goProductPage(12);
+             }, $view);
 
             // 染色
             $.newTouch('.btn-action-ranse', function (event) {
@@ -255,7 +293,4 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config'], func
             native.switchPopGesture(false);
         }
     }
-})
-
-
-
+})

+ 2 - 0
www/webapp/o2o/tpl/home/index.html

@@ -109,3 +109,5 @@
         </div>
     </div>
 </div>
+
+

Some files were not shown because too many files changed in this diff