e 8 years ago
parent
commit
21eb817b77

+ 1 - 1
www/webapp/o2o/css/secondary.css

@@ -61,7 +61,7 @@
 }
 #secondaryScroll .secondary-content .secondary-list .products-list li div {
     border-bottom: 3px solid #a8a8a8;
-    width: 6rem;
+    width: 5rem;
     margin: 0 auto;
     padding-bottom: 0.3rem;
 }

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


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

@@ -24,10 +24,10 @@ model/recharge.js
 page/help.js
 page/about.js
 page/rechargee.js
+model/review.js
 page/mine.js
 page/secondary.js
 model/cart.js
-model/review.js
 page/product.js
 page/placeOrder.js
 page/picker.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
+ 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/user.js


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


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


+ 334 - 332
www/webapp/o2o/js/model/user.js

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

+ 245 - 245
www/webapp/o2o/js/page/home.js

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

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

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

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

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

+ 79 - 78
www/webapp/o2o/tpl/home/index.html

@@ -1,13 +1,13 @@
 {{ if showNavBar }}
 <header class="bar bar-nav">
-    <a class="left-button back-button">
-        <div class="icon icon-left-nav"></div>
-    </a>
-    <a class="right-button service-telephone">
-        <div></div>
-    </a>
+	<a class="left-button back-button">
+		<div class="icon icon-left-nav"></div>
+	</a>
+	<a class="right-button service-telephone">
+		<div></div>
+	</a>
 
-    <h1 class="title">壹管家</h1>
+	<h1 class="title">壹管家</h1>
 </header>
 {{ /if }}
 <!--
@@ -129,78 +129,79 @@
 
 
 <div class="content">
-    <div class="box-container">
-        <div class="box-container box box-vertical">
-            <div id="homeScroll" class="scroll-container box-flex-1">
-                <div class="scroller">
-                    <div class="home-content">
-                        <!-- Swiper -->
-                        <div class="swiper-container">
-                            <div class="swiper-wrapper">
-                                <div class="swiper-slide">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6.jpg" alt="">
-                                </div>
-                                <div class="swiper-slide btn-banner-recharge">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/banner-2.jpg" alt="">
-                                </div>
-                                <div class="swiper-slide btn-banner-coupon">
-                                    <img src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6-2.jpg" alt="">
-                                </div>
-                            </div>
-                            <!-- 如果需要分页器 -->
-                            <div class="swiper-pagination" style="bottom: 5px"></div>
-                        </div>
-                        <img class="home-remy" src="http://odulvej8l.bkt.clouddn.com/%E5%9B%BE%E6%A0%87-01.jpg" alt="">
+	<div class="box-container">
+		<div class="box-container box box-vertical">
+			<div id="homeScroll" class="scroll-container box-flex-1">
+				<div class="scroller">
+					<div class="home-content">
+						<!-- Swiper -->
+						<div class="swiper-container">
+							<div class="swiper-wrapper">
+								<div class="swiper-slide">
+									<img src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6.jpg" alt="">
+								</div>
+								<div class="swiper-slide btn-banner-recharge">
+									<img src="http://odulvej8l.bkt.clouddn.com/banner-2.jpg" alt="">
+								</div>
+								<div class="swiper-slide btn-banner-coupon">
+									<img src="http://odulvej8l.bkt.clouddn.com/%E7%AE%A1%E5%AE%B6-2.jpg" alt="">
+								</div>
+							</div>
+							<!-- 如果需要分页器 -->
+							<div class="swiper-pagination" style="bottom: 5px"></div>
+						</div>
+						<img class="home-remy" src="http://odulvej8l.bkt.clouddn.com/%E5%9B%BE%E6%A0%87-01.jpg" alt="">
 
-                        <div class="home-box">
-                            <div class="width-percent-50 box-align-center">
-                                <img class="btn-secondary" src="http://odulvej8l.bkt.clouddn.com/4-1-01.png" alt="">
-                            </div>
-                            <div class="width-percent-50 box-align-center ">
-                                <img class="btn-appliances" data-product-type="4" src="http://odulvej8l.bkt.clouddn.com/4-2-01.png" alt="">
-                            </div>
-                            <div class="width-percent-50 box-align-center">
-                                <img src="http://odulvej8l.bkt.clouddn.com/4-3-01.png" alt="">
-                            </div>
-                            <div class="width-percent-50 box-align-center">
-                                <img src="http://odulvej8l.bkt.clouddn.com/4-4-01.png" alt="">
-                            </div>
-                        </div>
+						<div class="home-box">
+							<div class="width-percent-50 box-align-center">
+								<img class="btn-secondary" src="http://odulvej8l.bkt.clouddn.com/4-1-01.png" alt="">
+							</div>
+							<div class="width-percent-50 box-align-center ">
+								<img class="btn-appliances" data-product-type="4" src="http://odulvej8l.bkt.clouddn.com/4-2-01.png"
+								     alt="">
+							</div>
+							<div class="width-percent-50 box-align-center">
+								<img src="http://odulvej8l.bkt.clouddn.com/4-3-01.png" alt="">
+							</div>
+							<div class="width-percent-50 box-align-center">
+								<img src="http://odulvej8l.bkt.clouddn.com/4-4-01.png" alt="">
+							</div>
+						</div>
 
-                    </div>
-                </div>
-                <div class="prevent-scroll">
-                    <div class="box my-action">
-                        <!--首页-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-my-order">
-                                    <div class="logo logo-my-order"></div>
-                                    <div class="name">首页</div>
-                                </a>
-                            </div>
-                        </div>
-                        <!--LOGO-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
-                                    <div class="logo logo-my-logo"></div>
-                                </a>
-                            </div>
-                        </div>
-                        <!--我的-->
-                        <div class="width-percent-33">
-                            <div class="title-container-square">
-                                <a class="btn-home-action btn-action-coupon">
-                                    <div class="logo logo-coupon"></div>
-                                    <div class="name">我的</div>
-                                </a>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
+					</div>
+				</div>
+				<div class="prevent-scroll">
+					<div class="box my-action">
+						<!--首页-->
+						<div class="width-percent-33">
+							<div class="title-container-square">
+								<a class="btn-home-action btn-action-my-order">
+									<div class="logo logo-my-order"></div>
+									<div class="name">首页</div>
+								</a>
+							</div>
+						</div>
+						<!--LOGO-->
+						<div class="width-percent-33">
+							<div class="title-container-square">
+								<a class="btn-home-action btn-action-logo" href="weixin://contacts/profile/honghaitzz">
+									<div class="logo logo-my-logo"></div>
+								</a>
+							</div>
+						</div>
+						<!--我的-->
+						<div class="width-percent-33">
+							<div class="title-container-square">
+								<a class="btn-home-action btn-action-coupon">
+									<div class="logo logo-coupon"></div>
+									<div class="name">我的</div>
+								</a>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
 
-        </div>
-    </div>
+		</div>
+	</div>
 </div>

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

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

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

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

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

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

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