2021-06-28 18:04:17 +08:00
|
|
|
import storage from "@/utils/storage";
|
|
|
|
import { http, Method } from "@/utils/request.js";
|
2021-05-13 11:03:32 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 意见反馈
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function feedBack(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/other/feedback",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-06-28 18:04:17 +08:00
|
|
|
// 提现
|
|
|
|
export function withdrawalApply(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/wallet/wallet/withdrawal",
|
2021-06-28 18:04:17 +08:00
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
2021-05-13 11:03:32 +08:00
|
|
|
|
2021-06-28 18:04:17 +08:00
|
|
|
/**
|
|
|
|
* 支付结果查询
|
|
|
|
* @param orderType 交易类型,可用值:TRADE,ORDER,RECHARGE
|
|
|
|
* @param sn 订单编号
|
|
|
|
*/
|
|
|
|
export function payCallback(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: `/payment/cashier/result`,
|
2021-06-28 18:04:17 +08:00
|
|
|
method: Method.GET,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
2021-05-13 11:03:32 +08:00
|
|
|
|
2021-06-28 18:04:17 +08:00
|
|
|
// 在线充值
|
|
|
|
export function recharge(params) {
|
|
|
|
return http.request({
|
|
|
|
url: "/trade/recharge",
|
|
|
|
method: Method.POST,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
2021-05-13 11:03:32 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 分页获取预存款充值记录
|
|
|
|
* @param params
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function getUserRecharge(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
|
|
|
url: "/member/recharge",
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 分页获取预存款充值记录
|
|
|
|
* @param params
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function getWalletLog(params) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
|
|
|
url: "/wallet/log",
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取优惠券列表
|
|
|
|
* @param params
|
|
|
|
*/
|
|
|
|
export function getCoupons(params) {
|
|
|
|
return http.request({
|
2021-06-28 18:04:17 +08:00
|
|
|
url: "/promotion/coupon/getCoupons",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 领取优惠券
|
|
|
|
* @param couponId
|
|
|
|
*/
|
|
|
|
export function receiveCoupons(couponId) {
|
|
|
|
return http.request({
|
|
|
|
url: `/promotion/coupon/receive/${couponId}`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取积分明细数据
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function getPointsData(params) {
|
|
|
|
return http.request({
|
2021-06-28 18:04:17 +08:00
|
|
|
url: "member/memberPointsHistory/getByPage",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取我的评论列表
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function getComments(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/member/evaluation",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前会员的浏览数量是多少
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function getFootprintNum(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/member/footprint/getFootprintNum",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订单评论
|
|
|
|
* @param params
|
|
|
|
*/
|
|
|
|
export function commentsMemberOrder(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/member/evaluation",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
2021-06-28 18:04:17 +08:00
|
|
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
2021-05-13 11:03:32 +08:00
|
|
|
data: params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 追加评论
|
|
|
|
* @param params
|
|
|
|
*/
|
|
|
|
export function AppendCommentsOrder(params) {
|
|
|
|
return http.request({
|
2021-06-28 18:04:17 +08:00
|
|
|
url: "members/comments/additional",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
2021-06-28 18:04:17 +08:00
|
|
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
2021-05-13 11:03:32 +08:00
|
|
|
data: params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-05-21 16:47:26 +08:00
|
|
|
// TODO 第一版本暂未实现此功能
|
2021-06-28 18:04:17 +08:00
|
|
|
/**
|
2021-05-13 11:03:32 +08:00
|
|
|
* 商品咨询
|
|
|
|
* @param goods_id
|
|
|
|
* @param ask_content
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function consultating(goods_id, ask_content, anonymous) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
2021-06-28 18:04:17 +08:00
|
|
|
url: "members/asks",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
2021-06-28 18:04:17 +08:00
|
|
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
2021-05-13 11:03:32 +08:00
|
|
|
needToken: true,
|
|
|
|
data: {
|
|
|
|
goods_id,
|
|
|
|
ask_content,
|
2021-06-28 18:04:17 +08:00
|
|
|
anonymous,
|
2021-05-13 11:03:32 +08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取商品收藏
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function getGoodsCollection(params, type) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
|
|
|
url: `/member/collection/${type}`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
loading: false,
|
|
|
|
message: false,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-05-15 14:34:54 +08:00
|
|
|
/**
|
|
|
|
* 获取商品收藏
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function getStoreCollection(params, type) {
|
|
|
|
return http.request({
|
|
|
|
url: `/member/storeCollection/${type}`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
loading: false,
|
|
|
|
message: false,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-05-13 11:03:32 +08:00
|
|
|
/**
|
|
|
|
* 收藏商品
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
2021-08-05 19:01:31 +08:00
|
|
|
export function collectionGoods(type, id) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
|
|
|
url: `/member/collection/add/${type}/${id}`,
|
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除商品收藏
|
|
|
|
* @param ids 收藏ID【集合或单个商品ID】
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function deleteGoodsCollection(ids) {
|
|
|
|
if (Array.isArray(ids)) {
|
2021-06-28 18:04:17 +08:00
|
|
|
ids = ids.join(",");
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
return http.request({
|
|
|
|
url: `/member/collection/delete/GOODS/${ids}`,
|
|
|
|
method: Method.DELETE,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-08-05 19:01:31 +08:00
|
|
|
/**
|
|
|
|
* 删除店铺收藏
|
|
|
|
* @param store_id
|
|
|
|
*/
|
|
|
|
export function deleteStoreCollection(store_id) {
|
|
|
|
return http.request({
|
2023-05-15 14:21:38 +08:00
|
|
|
url: `/member/storeCollection/delete/STORE/${store_id}`,
|
2021-08-05 19:01:31 +08:00
|
|
|
method: Method.DELETE,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-05-13 11:03:32 +08:00
|
|
|
/**
|
|
|
|
* 获取商品是否被收藏
|
|
|
|
* @param good_id
|
|
|
|
*/
|
2021-08-05 19:01:31 +08:00
|
|
|
export function getGoodsIsCollect(type, good_id) {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
|
|
|
url: `/member/collection/isCollection/${type}/${good_id}`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
loading: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-05-15 14:21:38 +08:00
|
|
|
/**
|
|
|
|
* 获取商品是否被收藏
|
|
|
|
* @param good_id
|
|
|
|
*/
|
|
|
|
export function getStoreIsCollect(type, store_id) {
|
|
|
|
return http.request({
|
|
|
|
url: `/member/storeCollection/isCollection/${type}/${store_id}`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
loading: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-05-13 11:03:32 +08:00
|
|
|
/**
|
|
|
|
* 收藏店铺
|
|
|
|
* @param store_id 店铺ID
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function collectionStore(store_id) {
|
|
|
|
return http.request({
|
2023-05-15 14:21:38 +08:00
|
|
|
url: `/member/storeCollection/add/STORE/${store_id}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
2023-05-15 14:21:38 +08:00
|
|
|
needToken: true,
|
2021-05-13 11:03:32 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前登录的用户信息
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
2021-06-28 18:04:17 +08:00
|
|
|
export function getUserInfo() {
|
2021-05-13 11:03:32 +08:00
|
|
|
return http.request({
|
2022-02-12 15:20:48 +08:00
|
|
|
url: "/passport/member",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前用户的预存款
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function getUserWallet() {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: "/wallet/wallet",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 保存用户信息
|
|
|
|
* @param params
|
|
|
|
* @returns {AxiosPromise}
|
|
|
|
*/
|
|
|
|
export function saveUserInfo(params) {
|
|
|
|
return http.request({
|
2022-02-12 15:20:48 +08:00
|
|
|
url: "/passport/member/editOwn",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.PUT,
|
2021-06-28 18:04:17 +08:00
|
|
|
header: { "content-type": "application/x-www-form-urlencoded" },
|
2021-05-13 11:03:32 +08:00
|
|
|
needToken: true,
|
|
|
|
data: params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 添加发票
|
|
|
|
* @param params
|
|
|
|
*/
|
|
|
|
export function addReceipt(params) {
|
|
|
|
return http.request({
|
2021-06-28 18:04:17 +08:00
|
|
|
url: "/trade/receipt",
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.POST,
|
|
|
|
needToken: true,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取商品评论列表
|
|
|
|
* @param goodsId
|
|
|
|
* @param params
|
|
|
|
*/
|
|
|
|
export function getGoodsComments(goodsId, params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: `/member/evaluation/${goodsId}/goodsEvaluation`,
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
loading: false,
|
|
|
|
params,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取商品评论数量统计
|
|
|
|
* @param goodsId
|
|
|
|
*/
|
|
|
|
export function getGoodsCommentsCount(goodsId) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: `/member/evaluation/${goodsId}/evaluationNumber`,
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
loading: false,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取未读消息数量信息
|
|
|
|
*/
|
|
|
|
export function getNoReadMessageNum() {
|
|
|
|
return http.request({
|
|
|
|
url: `members/member-nocice-logs/number`,
|
|
|
|
method: Method.GET,
|
2021-06-28 18:04:17 +08:00
|
|
|
needToken: true,
|
|
|
|
});
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 我的足迹列表
|
|
|
|
* @param pageNumber pageSize
|
2021-06-28 18:04:17 +08:00
|
|
|
*
|
2021-05-13 11:03:32 +08:00
|
|
|
*/
|
|
|
|
export function myTrackList(params) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: `/member/footprint`,
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
2021-06-28 18:04:17 +08:00
|
|
|
params,
|
2021-05-13 11:03:32 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 根据id删除会员足迹
|
|
|
|
* @param id
|
|
|
|
*/
|
|
|
|
export function deleteHistoryListId(ids) {
|
|
|
|
return http.request({
|
2022-02-10 18:57:17 +08:00
|
|
|
url: `/member/footprint/delByIds/${ids}`,
|
2021-05-13 11:03:32 +08:00
|
|
|
method: Method.DELETE,
|
2021-06-28 18:04:17 +08:00
|
|
|
needToken: true,
|
|
|
|
});
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前会员优惠券列表
|
2021-06-28 18:04:17 +08:00
|
|
|
* @param
|
2021-05-13 11:03:32 +08:00
|
|
|
*/
|
|
|
|
export function getMemberCoupons(data) {
|
|
|
|
return http.request({
|
|
|
|
url: `/promotion/coupon/getCoupons`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
2021-06-28 18:04:17 +08:00
|
|
|
params: data,
|
|
|
|
});
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取当前会员可使用的优惠券数量
|
2021-06-28 18:04:17 +08:00
|
|
|
*
|
2021-05-13 11:03:32 +08:00
|
|
|
*/
|
|
|
|
export function getCouponsNum() {
|
|
|
|
return http.request({
|
|
|
|
url: `/promotion/coupon/getCouponsNum`,
|
|
|
|
method: Method.GET,
|
2021-06-28 18:04:17 +08:00
|
|
|
needToken: true,
|
|
|
|
});
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取会员积分VO
|
2021-06-28 18:04:17 +08:00
|
|
|
* @param
|
2021-05-13 11:03:32 +08:00
|
|
|
*/
|
|
|
|
export function getMemberPointSum() {
|
|
|
|
return http.request({
|
|
|
|
url: `member/memberPointsHistory/getMemberPointsHistoryVO`,
|
2021-06-28 18:04:17 +08:00
|
|
|
method: Method.GET,
|
|
|
|
});
|
2021-05-13 11:03:32 +08:00
|
|
|
}
|
2023-03-08 22:01:02 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取会员积分VO
|
|
|
|
* @param
|
|
|
|
*/
|
|
|
|
export function withdrawalSettingVO() {
|
|
|
|
return http.request({
|
|
|
|
url: `/wallet/wallet/withdrawalSettingVO`,
|
|
|
|
method: Method.GET,
|
|
|
|
needToken: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|