修改小程序与app的兼容文件
This commit is contained in:
47
api/order.js
47
api/order.js
@ -9,7 +9,9 @@ import request from "@/utils/request";
|
||||
* @returns {*}
|
||||
*/
|
||||
export function postOrderConfirm(cartId) {
|
||||
return request.post("/order/confirm", { cartId });
|
||||
return request.post("/order/confirm", {
|
||||
cartId
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -19,7 +21,7 @@ export function postOrderConfirm(cartId) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function postOrderComputed(key, data) {
|
||||
return request.post("/order/computed/" + key, data);
|
||||
return request.post("/order/computed/" + key, data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,7 +30,7 @@ export function postOrderComputed(key, data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getOrderCoupon(price) {
|
||||
return request.get("/coupons/order/" + (parseFloat(price) || 0));
|
||||
return request.get("/coupons/order/" + (parseFloat(price) || 0));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -38,7 +40,7 @@ export function getOrderCoupon(price) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function createOrder(key, data) {
|
||||
return request.post("/order/create/" + key, data || {});
|
||||
return request.post("/order/create/" + key, data || {});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,7 +48,7 @@ export function createOrder(key, data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getOrderData() {
|
||||
return request.get("/order/data");
|
||||
return request.get("/order/data");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,7 +56,7 @@ export function getOrderData() {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getOrderList(data) {
|
||||
return request.get("/order/list", data);
|
||||
return request.get("/order/list", data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -62,7 +64,9 @@ export function getOrderList(data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function cancelOrder(id) {
|
||||
return request.post("/order/cancel", { id });
|
||||
return request.post("/order/cancel", {
|
||||
id
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,7 +74,7 @@ export function cancelOrder(id) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function orderDetail(id) {
|
||||
return request.get("/order/detail/" + id);
|
||||
return request.get("/order/detail/" + id);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,7 +82,7 @@ export function orderDetail(id) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getRefundReason() {
|
||||
return request.get("/order/refund/reason");
|
||||
return request.get("/order/refund/reason");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,7 +90,7 @@ export function getRefundReason() {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function postOrderRefund(data) {
|
||||
return request.post("/order/refund/verify", data);
|
||||
return request.post("/order/refund/verify", data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,7 +98,9 @@ export function postOrderRefund(data) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function takeOrder(uni) {
|
||||
return request.post("/order/take", { uni });
|
||||
return request.post("/order/take", {
|
||||
uni
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,7 +108,9 @@ export function takeOrder(uni) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function delOrder(uni) {
|
||||
return request.post("/order/del", { uni });
|
||||
return request.post("/order/del", {
|
||||
uni
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +118,7 @@ export function delOrder(uni) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function express(params) {
|
||||
return request.post("order/express",params);
|
||||
return request.post("order/express", params);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,12 +126,19 @@ export function express(params) {
|
||||
* @returns {*}
|
||||
*/
|
||||
export function payOrder(uni, paytype, from) {
|
||||
return request.post("order/pay", { uni, paytype, from });
|
||||
return request.post("order/pay", {
|
||||
uni,
|
||||
paytype,
|
||||
from
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 订单核销
|
||||
* @returns {*}
|
||||
*/
|
||||
export function orderVerific(verify_code, is_confirm) {
|
||||
return request.post("order/order_verific", { verify_code, is_confirm });
|
||||
}
|
||||
return request.post("order/order_verific", {
|
||||
verify_code,
|
||||
is_confirm
|
||||
});
|
||||
}
|
||||
|
78
api/store.js
78
api/store.js
@ -4,128 +4,158 @@ import request from "@/utils/request";
|
||||
* 商品分类
|
||||
* */
|
||||
export function getCategory() {
|
||||
return request.get("/category", {}, { login: false });
|
||||
return request.get("/category", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品详情
|
||||
* */
|
||||
export function getProductDetail(id) {
|
||||
return request.get("/product/detail/" + id, {}, { login: true });
|
||||
export function getProductDetail(id, data) {
|
||||
return request.get("/product/detail/" + id, data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品分销二维码
|
||||
* */
|
||||
export function getProductCode(id) {
|
||||
return request.get("/product/code/" + id, {}, { login: true });
|
||||
return request.get("/product/code/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品列表
|
||||
* */
|
||||
export function getProducts(q) {
|
||||
return request.get("/products", q, { login: false });
|
||||
return request.get("/products", q, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车数量
|
||||
* */
|
||||
export function getCartNum() {
|
||||
return request.get("/cart/count");
|
||||
return request.get("/cart/count");
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加收藏
|
||||
* */
|
||||
export function toCollect(id, category) {
|
||||
return request.get("/collect/add/" + id + "/" + category);
|
||||
return request.get("/collect/add/" + id + "/" + category);
|
||||
}
|
||||
|
||||
/*
|
||||
* 为你推荐
|
||||
* */
|
||||
export function getHostProducts(page, limit) {
|
||||
return request.get(
|
||||
"/product/hot",
|
||||
{ page: page, limit: limit },
|
||||
{ login: false }
|
||||
);
|
||||
return request.get(
|
||||
"/product/hot", {
|
||||
page: page,
|
||||
limit: limit
|
||||
}, {
|
||||
login: false
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* 精品、热门、首发列表
|
||||
* */
|
||||
export function getGroomList(type) {
|
||||
return request.get("/groom/list/" + type, {}, { login: false });
|
||||
return request.get("/groom/list/" + type, {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 添加
|
||||
* */
|
||||
export function postCartAdd(data) {
|
||||
return request.post("/cart/add", data);
|
||||
return request.post("/cart/add", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车列表
|
||||
* */
|
||||
export function getCartList() {
|
||||
return request.get("/cart/list");
|
||||
return request.get("/cart/list");
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 删除
|
||||
* */
|
||||
export function postCartDel(ids) {
|
||||
return request.post("/cart/del", { ids });
|
||||
return request.post("/cart/del", {
|
||||
ids
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 获取数量
|
||||
* */
|
||||
export function getCartCount(data) {
|
||||
return request.get("/cart/count", data);
|
||||
return request.get("/cart/count", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 购物车 修改商品数量
|
||||
* */
|
||||
export function changeCartNum(id, number) {
|
||||
return request.post("/cart/num", { id, number });
|
||||
return request.post("/cart/num", {
|
||||
id,
|
||||
number
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索推荐关键字
|
||||
*/
|
||||
export function getSearchKeyword() {
|
||||
return request.get("/search/keyword", {}, { login: false });
|
||||
return request.get("/search/keyword", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评论列表
|
||||
*/
|
||||
export function getReplyList(id, q) {
|
||||
return request.get("/reply/list/" + id, q, { login: true });
|
||||
return request.get("/reply/list/" + id, q, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品评价数量和好评度
|
||||
*/
|
||||
export function getReplyConfig(id) {
|
||||
return request.get("/reply/config/" + id, {}, { login: true });
|
||||
return request.get("/reply/config/" + id, {}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 评价页面获取单个产品详情
|
||||
*/
|
||||
export function postOrderProduct(unique) {
|
||||
return request.post("/order/product", { unique }, { login: true });
|
||||
return request.post("/order/product", {
|
||||
unique
|
||||
}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交评价页面;
|
||||
*/
|
||||
export function postOrderComment(data) {
|
||||
return request.post("/order/comment", data, { login: true });
|
||||
}
|
||||
return request.post("/order/comment", data, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
154
api/user.js
154
api/user.js
@ -4,7 +4,9 @@ import request from "@/utils/request";
|
||||
* 省市区
|
||||
*/
|
||||
export function district(data) {
|
||||
return request.get("/citys", data, { login: false });
|
||||
return request.get("/citys", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -12,7 +14,9 @@ export function district(data) {
|
||||
* @param data object 用户账号密码
|
||||
*/
|
||||
export function login(data) {
|
||||
return request.post("/login", data, { login: false });
|
||||
return request.post("/login", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -20,7 +24,9 @@ export function login(data) {
|
||||
* @param data object 用户手机号 也只能
|
||||
*/
|
||||
export function loginMobile(data) {
|
||||
return request.post("/login/mobile", data, { login: false });
|
||||
return request.post("/login/mobile", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -28,7 +34,9 @@ export function loginMobile(data) {
|
||||
* @param data object 用户手机号
|
||||
*/
|
||||
export function registerVerify(data) {
|
||||
return request.post("/register/verify", data, { login: false });
|
||||
return request.post("/register/verify", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -36,7 +44,9 @@ export function registerVerify(data) {
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function register(data) {
|
||||
return request.post("/register", data, { login: false });
|
||||
return request.post("/register", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,42 +54,52 @@ export function register(data) {
|
||||
* @param data object 用户手机号 验证码 密码
|
||||
*/
|
||||
export function registerReset(data) {
|
||||
return request.post("/register/reset", data, { login: false });
|
||||
return request.post("/register/reset", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 领取优惠券列表
|
||||
* */
|
||||
export function getCoupon(q) {
|
||||
return request.get("/coupons", q, { login: true });
|
||||
return request.get("/coupons", q, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 点击领取优惠券
|
||||
* */
|
||||
export function getCouponReceive(id) {
|
||||
return request.post("/coupon/receive", { couponId: id }, { login: true });
|
||||
return request.post("/coupon/receive", {
|
||||
couponId: id
|
||||
}, {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 批量领取优惠券
|
||||
* */
|
||||
export function couponReceiveBatch(couponId) {
|
||||
return request.post("/coupon/receive/batch", { couponId });
|
||||
return request.post("/coupon/receive/batch", {
|
||||
couponId
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 我的优惠券
|
||||
* */
|
||||
export function getCouponsUser(type) {
|
||||
return request.get("/coupons/user/" + type);
|
||||
return request.get("/coupons/user/" + type);
|
||||
}
|
||||
|
||||
/*
|
||||
* 个人中心
|
||||
* */
|
||||
export function getUser() {
|
||||
return request.get("/user");
|
||||
return request.get("/user");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -87,7 +107,9 @@ export function getUser() {
|
||||
* */
|
||||
export function getUserInfo() {
|
||||
|
||||
return request.get("/userinfo", { login: true });
|
||||
return request.get("/userinfo", {
|
||||
login: true
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -95,269 +117,295 @@ export function getUserInfo() {
|
||||
* */
|
||||
export function wxappAuth(data) {
|
||||
|
||||
return request.post("/wxapp/auth", data, { login: false });
|
||||
return request.post("/wxapp/auth", data, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 个人中心(功能列表)
|
||||
* */
|
||||
export function getMenuUser() {
|
||||
return request.get("/menu/user");
|
||||
return request.get("/menu/user");
|
||||
}
|
||||
|
||||
/*
|
||||
* 地址列表
|
||||
* */
|
||||
export function getAddressList(data) {
|
||||
return request.get("/address/list", data || {});
|
||||
return request.get("/address/list", data || {});
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除地址
|
||||
* */
|
||||
export function getAddressRemove(id) {
|
||||
return request.post("/address/del", { id: id });
|
||||
return request.post("/address/del", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 设置默认地址
|
||||
* */
|
||||
export function getAddressDefaultSet(id) {
|
||||
return request.post("/address/default/set", { id: id });
|
||||
return request.post("/address/default/set", {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取默认地址
|
||||
* */
|
||||
export function getAddressDefault() {
|
||||
return request.get("/address/default");
|
||||
return request.get("/address/default");
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取单个地址
|
||||
* */
|
||||
export function getAddress(id) {
|
||||
return request.get("/address/detail/" + id);
|
||||
return request.get("/address/detail/" + id);
|
||||
}
|
||||
|
||||
/*
|
||||
* 修改 添加地址
|
||||
* */
|
||||
export function postAddress(data) {
|
||||
return request.post("/address/edit", data);
|
||||
return request.post("/address/edit", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取收藏产品
|
||||
* */
|
||||
export function getCollectUser(page, limit) {
|
||||
return request.get("/collect/user", { page: page, limit: limit });
|
||||
return request.get("/collect/user", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 删除收藏产品
|
||||
* */
|
||||
export function getCollectDel(id, category) {
|
||||
return request.post("/collect/del", { id: id, category: category });
|
||||
return request.post("/collect/del", {
|
||||
id: id,
|
||||
category: category
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 批量收藏产品
|
||||
* */
|
||||
export function postCollectAll(data) {
|
||||
return request.post("/collect/all", data);
|
||||
return request.post("/collect/all", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 添加收藏产品
|
||||
* */
|
||||
export function getCollectAdd(id, category) {
|
||||
return request.post("collect/add", { id: id, category: category });
|
||||
return request.post("collect/add", {
|
||||
id: id,
|
||||
category: category
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到配置
|
||||
* */
|
||||
export function getSignConfig() {
|
||||
return request.get("/sign/config");
|
||||
return request.get("/sign/config");
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到里的签到列表
|
||||
* */
|
||||
export function getSignList(page, limit) {
|
||||
return request.get("/sign/list", { page: page, limit: limit });
|
||||
return request.get("/sign/list", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到列表
|
||||
* */
|
||||
export function getSignMonth(page, limit) {
|
||||
return request.get("/sign/month", { page: page, limit: limit });
|
||||
return request.get("/sign/month", {
|
||||
page: page,
|
||||
limit: limit
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到用户信息
|
||||
* */
|
||||
export function postSignUser(sign) {
|
||||
return request.post("/sign/user", sign);
|
||||
return request.post("/sign/user", sign);
|
||||
}
|
||||
|
||||
/*
|
||||
* 签到
|
||||
* */
|
||||
export function postSignIntegral(sign) {
|
||||
return request.post("/sign/integral", sign);
|
||||
return request.post("/sign/integral", sign);
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广数据
|
||||
* */
|
||||
export function getSpreadInfo() {
|
||||
return request.get("/commission");
|
||||
return request.get("/commission");
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广人列表
|
||||
* */
|
||||
export function getSpreadUser(screen) {
|
||||
return request.post("/spread/people", screen);
|
||||
return request.post("/spread/people", screen);
|
||||
}
|
||||
|
||||
/*
|
||||
* 推广人订单
|
||||
* */
|
||||
export function getSpreadOrder(where) {
|
||||
return request.post("/spread/order", where);
|
||||
return request.post("/spread/order", where);
|
||||
}
|
||||
|
||||
/*
|
||||
* 资金明细(types|0=全部,1=消费,2=充值,3=返佣,4=提现)
|
||||
* */
|
||||
export function getCommissionInfo(q, types) {
|
||||
return request.get("/spread/commission/" + types, q);
|
||||
return request.get("/spread/commission/" + types, q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分记录
|
||||
* */
|
||||
export function getIntegralList(q) {
|
||||
return request.get("/integral/list", q);
|
||||
return request.get("/integral/list", q);
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现银行
|
||||
* */
|
||||
export function getBank() {
|
||||
return request.get("/extract/bank");
|
||||
return request.get("/extract/bank");
|
||||
}
|
||||
|
||||
/*
|
||||
* 提现申请
|
||||
* */
|
||||
export function postCashInfo(cash) {
|
||||
return request.post("/extract/cash", cash);
|
||||
return request.post("/extract/cash", cash);
|
||||
}
|
||||
|
||||
/*
|
||||
* 会员中心
|
||||
* */
|
||||
export function getVipInfo() {
|
||||
return request.get("/user/level/grade");
|
||||
return request.get("/user/level/grade");
|
||||
}
|
||||
|
||||
/*
|
||||
* 会员等级任务
|
||||
* */
|
||||
export function getVipTask(id) {
|
||||
return request.get("/user/level/task/" + id);
|
||||
return request.get("/user/level/task/" + id);
|
||||
}
|
||||
|
||||
/*
|
||||
* 资金统计
|
||||
* */
|
||||
export function getBalance() {
|
||||
return request.get("/user/balance");
|
||||
return request.get("/user/balance");
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动状态
|
||||
* */
|
||||
export function getActivityStatus() {
|
||||
return request.get("/user/activity", {}, { login: false });
|
||||
return request.get("/user/activity", {}, {
|
||||
login: false
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* 活动状态
|
||||
* */
|
||||
export function getSpreadImg() {
|
||||
return request.get("/spread/banner");
|
||||
export function getSpreadImg(data) {
|
||||
|
||||
return request.get("/spread/banner", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 用户修改信息
|
||||
* */
|
||||
export function postUserEdit(data) {
|
||||
return request.post("/user/edit", data);
|
||||
return request.post("/user/edit", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 用户修改信息
|
||||
* */
|
||||
export function getChatRecord(to_uid, data) {
|
||||
return request.get("user/service/record/" + to_uid, data);
|
||||
return request.get("user/service/record/" + to_uid, data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 用户修改信息
|
||||
* */
|
||||
export function serviceList() {
|
||||
return request.get("user/service/list");
|
||||
return request.get("user/service/list");
|
||||
}
|
||||
|
||||
/*
|
||||
* 公众号充值
|
||||
* */
|
||||
export function rechargeWechat(data) {
|
||||
return request.post("/recharge/wechat", data);
|
||||
return request.post("/recharge/wechat", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* 退出登录
|
||||
* */
|
||||
export function getLogout() {
|
||||
return request.post("/auth/logout");
|
||||
return request.post("/auth/logout");
|
||||
}
|
||||
|
||||
/*
|
||||
* 绑定手机号
|
||||
* */
|
||||
export function bindingPhone(data) {
|
||||
return request.post("wxapp/binding", data);
|
||||
return request.post("wxapp/binding", data);
|
||||
}
|
||||
|
||||
/*
|
||||
* h5切换公众号登陆
|
||||
* */
|
||||
export function switchH5Login() {
|
||||
return request.post("switch_h5", { from: "wechat" });
|
||||
return request.post("switch_h5", {
|
||||
from: "wechat"
|
||||
});
|
||||
}
|
||||
/*
|
||||
* 获取推广人排行
|
||||
* */
|
||||
export function getRankList(q) {
|
||||
return request.get("rank", q);
|
||||
return request.get("rank", q);
|
||||
}
|
||||
/*
|
||||
* 获取佣金排名
|
||||
* */
|
||||
export function getBrokerageRank(q) {
|
||||
return request.get("brokerage_rank", q);
|
||||
return request.get("brokerage_rank", q);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测会员等级
|
||||
*/
|
||||
export function setDetection() {
|
||||
return request.get("user/level/detection");
|
||||
}
|
||||
return request.get("user/level/detection");
|
||||
}
|
||||
|
Reference in New Issue
Block a user