feat(充值): 添加英杰币

This commit is contained in:
luying
2023-04-11 11:33:10 +08:00
parent 10d0e13bcc
commit 86c5d08642
7 changed files with 62 additions and 11 deletions

View File

@@ -177,6 +177,7 @@ export const CURRENCY_TYPE = {
SPECIAL_DICE: "specialDice",
KING_EXP: 'kingExp',
VOUCHER: 'voucher',
VOUCHER_COIN: 'voucherCoin',
}
const currencyArr = [
@@ -193,7 +194,8 @@ const currencyArr = [
{ "gid": 72011, "name": "普通骰子", "type": CURRENCY_TYPE.NORMAL_DICE },
{ "gid": 72021, "name": "天机骰子", "type": CURRENCY_TYPE.SPECIAL_DICE },
{ "gid": 72030, "name": "主公经验", "type": CURRENCY_TYPE.KING_EXP },
{ "gid": 81000, "name": "代金券", "type": CURRENCY_TYPE.VOUCHER}
{ "gid": 81000, "name": "英杰券", "type": CURRENCY_TYPE.VOUCHER},
{ "gid": 81001, "name": "英杰币", "type": CURRENCY_TYPE.VOUCHER_COIN},
];
export const CURRENCY = new Map<number, { gid: number, name: string, type: string }>();
export const CURRENCY_BY_TYPE = new Map<string, number>();

View File

@@ -37,6 +37,8 @@ export default class UserOrder extends BaseModel {
@prop({ required: true })
useVoucher: boolean; // 使用代金券
@prop({ required: true })
voucherId: number; // 代金券类型
@prop({ required: true })
callbackMsg: string; // 信息
@@ -126,9 +128,9 @@ export default class UserOrder extends BaseModel {
//新增订单
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, paramStr: string, message: string, useVoucher: boolean) {
public static async applyOrder(serverId: number, roleId: string, productID: string, localOrderID: string, orderID: string, price: number, payType: number, activityId: number, paramStr: string, message: string, useVoucher: boolean, voucherId: number) {
let result: UserOrderModelType = await UserOrderModel.findOneAndUpdate({ serverId, roleId, productID, localOrderID, orderID, payType, activityId },
{ $set: { price, state: ORDER_STATE.APPLY, message, paramStr: paramStr ? paramStr : '', useVoucher } },
{ $set: { price, state: ORDER_STATE.APPLY, message, paramStr: paramStr ? paramStr : '', useVoucher, voucherId } },
{ upsert: true, new: true }).lean(true);
return result;
}

View File

@@ -14466,6 +14466,29 @@
"activityType": 0,
"info": "传说中给予英杰的契据,可用来兑换游戏内的等价礼包"
},
{
"good_id": 81001,
"name": "英杰币",
"quality": 4,
"image_id": "yingjiebi",
"itid": 63,
"goodType": 2,
"urType": 0,
"redPoint": 0,
"decomposeItem": "&",
"hid": 0,
"getWays": "&",
"addGetWay": "&",
"useWays": "23&",
"value": 0,
"condition": 0,
"timelimit": 0,
"gift": 0,
"randomShow": 0,
"seasonNum": 0,
"activityType": 0,
"info": "传说中给予英杰的珍贵货币,可用来兑换游戏内的等价礼包(不可与英杰券同时使用)"
},
{
"good_id": 82000,
"name": "下品宝物精华",