支付:代金券功能

This commit is contained in:
luying
2022-07-11 18:07:56 +08:00
parent b9af56fd07
commit ae369f7bf2
14 changed files with 179 additions and 93 deletions

View File

@@ -33,6 +33,8 @@ export interface DicServerConst {
readonly DEBUG_TIME: number;
// 是否检查屏蔽词
readonly CHECK_WORD: number;
// 是否可以支付
readonly CAN_PAY: number;
}
export const dicServerConst: DicServerConst = {} as DicServerConst;

View File

@@ -57,10 +57,10 @@ export async function savePayLog(order: UserOrderModelType) {
try {
let role = await RoleModel.findByRoleId(order.roleId, 'userInfo roleId roleName serverId');
let params = getParamByRole(role);
let { productID, message: productName, price, localOrderID, orderID, state } = order;
let { productID, message: productName, price, localOrderID, orderID, state, useVoucher } = order;
let dicRmb = gameData.rmb.get(productID);
let isYuanbao = dicRmb.type == ACTIVITY_TYPE.YUAN_BAO_SHOP;
await UserLogModel.createRecord({ type: LOG_TYPE.PAY, ...params, productID, productName, price, isYuanbao, localOrderID, orderID, totalPay: role.totalPay, orderStatus: state });
await UserLogModel.createRecord({ type: LOG_TYPE.PAY, ...params, productID, productName, price, isYuanbao, localOrderID, orderID, totalPay: role.totalPay, orderStatus: state, useVoucher });
} catch (e) {
console.error(e);
}

View File

@@ -157,4 +157,8 @@ export function isDebugPay() {
export function isCheckWord(isDevelop = false) {
return gameData.serverConst.CHECK_WORD === 1 && !isDevelop;
}
export function canPay() {
return gameData.serverConst.CAN_PAY === 1;
}