Files
frontend-app/utils/enumUtils.js
T

112 lines
1.9 KiB
JavaScript
Raw Normal View History

2025-03-20 08:46:07 +08:00
/**
* 根据key获取value
* @param optionArr
* @param key
*/
export function getValue(optionArr, key) {
let resultVal = "";
if (!optionArr || optionArr.length === 0) {
return resultVal;
}
optionArr.map(item => {
if (item.key === key) {
resultVal = item.value || item.name;
}
});
return resultVal;
}
// 短信类型:passwd-设置密码,login-登录,changepassword-修改密码
export const SMS_TYPE = {
"PASSWD":"passwd",
"LOGIN":"login",
2025-03-23 20:36:06 +08:00
"REGISTER":"register",
2025-03-20 08:46:07 +08:00
}
// 图片类型 common-公共,device-设备,ad-广告
export const IMG_TYPE = {
"COMMON":"common",
"DEVICE":"device",
"AD":"ad",
}
2025-03-23 20:36:06 +08:00
// 订单的 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
2025-03-20 08:46:07 +08:00
export const ORDER_TYPE = {
2025-03-23 20:36:06 +08:00
"UNPAID":0,
"PAYMENT_IMG":1,
2025-03-20 08:46:07 +08:00
"UNSHIPPED":2,
"NOT_RECEIVE":3,
2025-03-23 20:36:06 +08:00
"SUCCEED":4,
"CLOSE":5,
2025-03-20 08:46:07 +08:00
}
/**
2025-03-23 20:36:06 +08:00
* 订单的状态 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
2025-03-20 08:46:07 +08:00
*/
export const ORDER_STATUS=[
{
key:0,
2025-03-23 20:36:06 +08:00
name:"待支付"
2025-03-20 08:46:07 +08:00
},{
key:1,
2025-03-23 20:36:06 +08:00
name:"支付中"
2025-03-20 08:46:07 +08:00
},{
key:2,
name:"待发货"
},{
key:3,
name:"待收货"
},{
key:4,
2025-03-23 20:36:06 +08:00
name:"交易成功"
2025-03-20 08:46:07 +08:00
},{
key:5,
2025-03-23 20:36:06 +08:00
name:"交易关闭"
2025-03-20 08:46:07 +08:00
}
]
/**
* 支付方式 1-微信支付,2-支付宝
*/
export const PAYMENT_WAY = {
"WECHAT":1,
"ALIPAY":2,
}
export const PAYMENT_WAY_ = [
{
key: 1,
value: "微信支付"
},
{
key: 2,
value: "支付宝支付"
}
];
/**
* 发货时效:1-24小时内发货,2-48小时内发货,3-大于48小时发货
* @type {[{value: string, key: number},{value: string, key: number}]}
*/
export const PRODUCT_DELIVERY_TIME = [
{
key: 1,
value: "24小时内发货"
},
{
key: 2,
value: "48小时内发货"
},{
key: 3,
value: "大于48小时发货"
}
2025-03-23 20:36:06 +08:00
];
// 0-普通,1-爆单专区,2-好物专区
export const SEARCH_TYPE={
NORMAL:0,
EXPLOSIVE:1,
SOMETHING:2,
}