Ver código fonte

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

DengTao 8 anos atrás
pai
commit
dbd2be40e5

Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
www/webapp/moonclub/dist/js/api.js


Diferenças do arquivo suprimidas por serem muito extensas
+ 0 - 0
www/webapp/moonclub/dist/js/main.js


+ 719 - 698
www/webapp/moonclub/js/api.js

@@ -5,702 +5,723 @@
  */
 // define(['config', 'base', '$'], function(config, base, $) {
 define(['config', 'base'], function (config, base) {
-    var API = function () {
-        if (typeof API.instance === 'object') {
-            return API.instance;
-        }
-        API.instance = this;
-        this.isLoading = false;
-    }
-
-    API.prototype = new base();
-
-    var apiErrorResult = {
-        success: false,
-        message: '网页加载失败,请您返回首页重新访问 <( ̄︶ ̄)>'
-    };
-
-    //获取用户信息
-    API.prototype.getUserInfo = function (data, callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/user/info',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-    API.prototype.getO2oUserInfo = function (data, callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/user/info',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //获取商品列表
-    API.prototype.getProductList = function(data,callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/product/list',
-            data: data,
-            dataType: 'JSON',
-            success: function(res) {
-                that.isLoading = false;
-	            if (callback) {
-		            callback(res);
-	            }
-            },
-            error: function(res) {
-                that.isLoading = false;
-	            if (callback) {
-		            callback(apiErrorResult);
-	            }
-            }
-        });
-    };
-
-    API.prototype.getAgreement = function (data, callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/common/staticSource&key=agreement',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    API.prototype.getHelp = function (data, callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/common/staticSource&key=help_center',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    API.prototype.getAbout = function (data, callback) {
-        var that = this;
-        this.isLoading = true;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/common/staticSource&key=about_us',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //获取优惠券列表
-    API.prototype.getCouponList = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/usableCoupon',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //兑换优惠券
-    API.prototype.exchangeCoupon = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/user/exchangeCoupon',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //检查用户的地址是否在服务站内
-    API.prototype.checkAddress = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/checkAddress',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //提交订单
-    API.prototype.addOrder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/add',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //取消订单
-    API.prototype.cancelOrder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/del',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 追加订单
-    API.prototype.appendOrder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/append',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 订单详情
-    API.prototype.getOrderDetail = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/detail',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //获取支付信息
-    API.prototype.getPayCharge = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/pay',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 获取追加订单信息
-    API.prototype.getAppendPayCharge = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/appendPay',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //获取我的订单列表
-    API.prototype.getMyOrderList = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/list',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //发表评价
-    API.prototype.postReview = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/product/comment',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //评价列表
-    API.prototype.getReviewList = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/product/commentList',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //地址列表
-    API.prototype.getAddressList = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/shop/addressList',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //新增地址
-    API.prototype.addAddress = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/shop/addAddress',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //删除地址
-    API.prototype.deleteAddress = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/shop/delAddress',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 修改地址
-    API.prototype.editAddress = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/shop/editAddress',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 获取上传图片token
-    API.prototype.gettoken = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=api/upload/gettoken',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 退款
-    API.prototype.refundOrder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/retrieve',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 确认完成
-    API.prototype.finishOrder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/confirmComplete',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 触宝 获取加密支付信息
-    API.prototype.getTradeStr = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/chubao/chubaoPay',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    // 选择保洁师
-    API.prototype.selectTech = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/selectTech',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    API.prototype.techComment = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/order/techComment',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //创建充值卡订单
-    API.prototype.addRechargeorder = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/recharge/addRechargeorder',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //充值卡支付
-    API.prototype.payRecharge = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/recharge/payRecharge',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    //充值卡列表
-    API.prototype.getRechargeList = function (data, callback) {
-        var that = this;
-        $.signAjax({
-            url: config.apiPath + '/index.php?r=moonclub/recharge/rechargeList',
-            data: data,
-            dataType: 'JSON',
-            success: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(res);
-                }
-            },
-            error: function (res) {
-                that.isLoading = false;
-                if (callback) {
-                    callback(apiErrorResult);
-                }
-            }
-        });
-    };
-
-    return new API();
+	var API = function () {
+		if (typeof API.instance === 'object') {
+			return API.instance;
+		}
+		API.instance = this;
+		this.isLoading = false;
+	}
+
+	API.prototype = new base();
+
+	var apiErrorResult = {
+		success: false,
+		message: '网页加载失败,请您返回首页重新访问 <( ̄︶ ̄)>'
+	};
+//获取预约信息
+	API.prototype.geteservation = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/reserve/myService',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+	//获取用户信息
+	API.prototype.getUserInfo = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/user/info',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+	API.prototype.getO2oUserInfo = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/user/info',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//获取商品列表
+	API.prototype.getProductList = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/product/list',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	API.prototype.getAgreement = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/common/staticSource&key=agreement',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	API.prototype.getHelp = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/common/staticSource&key=help_center',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	API.prototype.getAbout = function (data, callback) {
+		var that = this;
+		this.isLoading = true;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/common/staticSource&key=about_us',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//获取优惠券列表
+	API.prototype.getCouponList = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/usableCoupon',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//兑换优惠券
+	API.prototype.exchangeCoupon = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/user/exchangeCoupon',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//检查用户的地址是否在服务站内
+	API.prototype.checkAddress = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/checkAddress',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//提交订单
+	API.prototype.addOrder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/add',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//取消订单
+	API.prototype.cancelOrder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/del',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 追加订单
+	API.prototype.appendOrder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/append',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 订单详情
+	API.prototype.getOrderDetail = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/detail',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//获取支付信息
+	API.prototype.getPayCharge = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/pay',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 获取追加订单信息
+	API.prototype.getAppendPayCharge = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/appendPay',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//获取我的订单列表
+	API.prototype.getMyOrderList = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/list',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//发表评价
+	API.prototype.postReview = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/product/comment',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//评价列表
+	API.prototype.getReviewList = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/product/commentList',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//地址列表
+	API.prototype.getAddressList = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/shop/addressList',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//新增地址
+	API.prototype.addAddress = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/shop/addAddress',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//删除地址
+	API.prototype.deleteAddress = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/shop/delAddress',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 修改地址
+	API.prototype.editAddress = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/shop/editAddress',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 获取上传图片token
+	API.prototype.gettoken = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=api/upload/gettoken',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 退款
+	API.prototype.refundOrder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/retrieve',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 确认完成
+	API.prototype.finishOrder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/confirmComplete',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 触宝 获取加密支付信息
+	API.prototype.getTradeStr = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/chubao/chubaoPay',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	// 选择保洁师
+	API.prototype.selectTech = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/selectTech',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	API.prototype.techComment = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/order/techComment',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//创建充值卡订单
+	API.prototype.addRechargeorder = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/recharge/addRechargeorder',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//充值卡支付
+	API.prototype.payRecharge = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/recharge/payRecharge',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	//充值卡列表
+	API.prototype.getRechargeList = function (data, callback) {
+		var that = this;
+		$.signAjax({
+			url: config.apiPath + '/index.php?r=moonclub/recharge/rechargeList',
+			data: data,
+			dataType: 'JSON',
+			success: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(res);
+				}
+			},
+			error: function (res) {
+				that.isLoading = false;
+				if (callback) {
+					callback(apiErrorResult);
+				}
+			}
+		});
+	};
+
+	return new API();
 })

+ 1 - 1
www/webapp/o2o/js/model/user.js

@@ -8,7 +8,7 @@ define(['base', '$', 'native', 'api', 'order', 'config', 'address'], function (b
 		}
 		User.instance = this;
 		this.storagePrefix = 'user_';
-		this.id = ''; //57e22bb59f5160c2048b456c//57e38f1b9f5160ac048b457d
+		this.id = '57e38f1b9f5160ac048b457d'; //57e22bb59f5160c2048b456c//57e38f1b9f5160ac048b457d
 		this.lastID = this.getCache('lastID', null, '');
 		this.name = '';
 		this.avatar='';

+ 2 - 1
www/webapp/o2o/js/page/home.js

@@ -1,4 +1,4 @@
-define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'address'], function ($, template, IScroll, product, user, native, config, address) {
+define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'address','api'], function ($, template, IScroll, product, user, native, config, address,api) {
 
 	/*
 	 * 先定义一些模块内用到的function
@@ -314,6 +314,7 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
 					});
 				}, 20);
 				// 目前的作用只是供后端判断,该用户是否为新用户,所以没有回调。
+				api.geteservation(user.id);
 				product.getListAll(user.id);
 				console.log(user.id);
 				address.getList({

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff