You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
high-mini/Utils/Api.js

178 lines
6.6 KiB

import {
POST
} from "./Request.js";
import {
POSTBREST} from "./bRequest.js";
let app = getApp();
let base = app.globalData.url;
let brestBase = app.globalData.brestUrl;
//根据code获取openId
export const HandleCode = params => {
return POST('GET', `${base}/wechat/handleCode`, params).then(res => res.data);
}
//微信登录获取手机号
export const GetPhoneNumber = params => {
return POST('GET', `${base}/wechat/getPhoneNumber`, params).then(res => res.data);
};
//获取用户授权信息
export const getUserInfo = params => {
return POST('GET', `${base}/wechat/getUserInfo`, params).then(res => res.data);
}
//获取用户信息
export const findUser = params => {
return POST('GET', `${base}/highUser/findUser`, params).then(res => res.data);
}
//微信登录
export const WXlogin = params => {
return POST('GET', `${base}/wechat/login`, params).then(res => res.data);
};
//通过openid获取用户的信息
export const OpenidGetUser = (openId, params) => {
return POST('GET', `${base}/User/openid/${openId}`, params).then(res => res.data);
};
//获取卡券列表
export const getCouponList = params => {
return POST('GET', `${base}/coupon/getCouponList`, params).then(res => res.data);
};
4 years ago
//获取门店信息
export const getStoreListByCoupon = params => {
return POST('GET', `${base}/highMerchantStore/getStoreListByCoupon`, params).then(res => res.data);
}
4 years ago
//根据门店ID 获取门店详情
export const getMerchantStoreById = params => {
return POST('GET', `${base}/highMerchantStore/getMerchantStoreById`, params).then(res => res.data);
}
//根据门店ID 获取卡券
export const getCouponListByStoreId = params => {
return POST('GET', `${base}/coupon/getCouponListByStoreId`, params).then(res => res.data);
}
//卡券详情
export const getCouponById = params => {
return POST('GET', `${base}/coupon/getCouponById`, params).then(res => res.data);
}
//生成订单
export const addOrder = params => {
return POST('POST', `${base}/highOrder/addOrder`, params).then(res => res.data);
}
//获取订单支付信息
export const orderToPay = params => {
return POST('POST', `${base}/order/orderToPay`, params).then(res => res.data);
}
//金币支付
export const orderToGoldPay = params => {
return POST('POST', `${base}/order/orderToGoldPay`, params).then(res => res.data);
}
//查询用户金币使用情况
export const getUserGoldRecList = params => {
return POST('GET', `${base}/highGoldRec/getUserGoldRecList`, params).then(res => res.data);
}
//获取用户卡券
export const getUserCouponList = params => {
return POST('GET', `${base}/coupon/getUserCouponList`, params).then(res => res.data);
}
//获取用户卡券详情
export const getUserCouponDetail = params => {
return POST('GET', `${base}/coupon/getUserCouponDetail`, params).then(res => res.data);
}
//获取用户最新卡券详情
export const getUserNewCouponDetail = params => {
return POST('GET', `${base}/coupon/getUserNewCouponDetail`, params).then(res => res.data);
}
//获取订单信息
export const getUserOrderList = params => {
return POST('GET', `${base}/highOrder/getUserOrderList`, params).then(res => res.data);
}
//取消订单
export const cancelOrder = params => {
return POST('GET', `${base}/highOrder/cancelOrder`, params).then(res => res.data);
}
//订单查询详情
export const getOrderById = params => {
return POST('GET', `${base}/highOrder/getOrderById`, params).then(res => res.data);
}
4 years ago
//获取商户列表
export const getMerchantList = params => {
return POST('GET', `${base}/highMerchantStore/getMerchantList`, params).then(res => res.data);
}
//首页获取门店
export const getStoreListByMerchant = params => {
return POST('GET', `${base}/highMerchantStore/getStoreListByMerchant`, params).then(res => res.data);
}
//获取优惠券详情
export const getDiscountByQrCode = params => {
return POST('GET', `${base}/discount/getDiscountByQrCode`, params).then(res => res.data);
4 years ago
}
//领取优惠券
export const receiveDiscount = params => {
return POST('POST', `${base}/userDiscount/receiveDiscount`, params).then(res => res.data);
}
// 根据优惠券查卡券
export const getCouponByDiscount = params => {
return POST('GET', `${base}/discount/getCouponByDiscount`, params).then(res => res.data);
}
// 重新领取卡券
export const againReceiveCoupon = params => {
return POST('GET', `${base}/coupon/againReceiveCoupon`, params).then(res => res.data);
}
4 years ago
//查询我的优惠券
export const getUserDiscountList = params => {
return POST('GET', `${base}/userDiscount/getUserDiscountList`, params).then(res => res.data);
}
//我的优惠券查详情
export const getDiscountByUserDiscountId = params => {
return POST('GET', `${base}/userDiscount/getDiscountByUserDiscountId`, params).then(res => res.data);
}
//确认订单查优惠券
export const getUserNormalDiscountList = params => {
return POST('GET', `${base}/userDiscount/getUserNormalDiscountList`, params).then(res => res.data);
}
//搜索门店
export const getStoreList = params => {
return POST('GET', `${base}/highMerchantStore/getStoreList`, params).then(res => res.data);
}
//**门店//
export const userLogin = params => {
return POST('POST', `${brestBase}/login/userLogin`, params).then(res => res.data);
}
//门店扫码销核
export const useCouponCode = params => {
return POSTBREST('POST', `${brestBase}/couponCode/useCouponCode`, params).then(res => res.data);
}
//**代理商//
export const getAgentCount = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getAgentCount`, params).then(res => res.data);
}
// 查询销售码
export const getCodeListByAgentCoupon = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getCodeListByAgentCoupon`, params).then(res => res.data);
}
// 生成二维码
export const generateCode = params => {
4 years ago
return POSTBREST('POST', `${brestBase}/highCouponAgent/generateCode`, params).then(res => res.data);
}
// 查看二维码
export const getCodeById = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getCodeById`, params).then(res => res.data);
}
// 查看流水
export const getAgentSalesCodeList = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getAgentSalesCodeList`, params).then(res => res.data);
}
//查询流水总价格
export const getAgentSalesPriceCount = params => {
return POSTBREST('GET', `${brestBase}/highCouponAgent/getAgentSalesPriceCount`, params).then(res => res.data);
}
//修改密码
export const sendUserPass = params => {
return POSTBREST('POST', `${brestBase}/secUser/sendUserPass`, params).then(res => res.data);
}