feat: 新增枚举

This commit is contained in:
2025-08-16 20:05:46 +08:00
parent bed9fef247
commit 53b6577aba
4 changed files with 250 additions and 233 deletions
+6 -4
View File
@@ -96,6 +96,11 @@
"ms": "2.0.0"
}
},
"decimal.js": {
"version": "10.6.0",
"resolved": "https://registry.npmmirror.com/decimal.js/-/decimal.js-10.6.0.tgz",
"integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg=="
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
@@ -114,7 +119,6 @@
"echarts": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.6.0.tgz",
"integrity": "sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.6.1"
@@ -305,13 +309,11 @@
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz"
},
"zrender": {
"version": "5.6.1",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.1.tgz",
"integrity": "sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==",
"requires": {
"tslib": "2.3.0"
}
+1 -1
View File
@@ -76,9 +76,9 @@
"axios": "0.27.2",
"axios-adapter-uniapp": "^0.1.4",
"axios-miniprogram-adapter": "^0.3.4",
"bignumber.js": "^9.3.1",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.13",
"decimal.js": "^10.6.0",
"echarts": "^5.1.2",
"qs": "^6.14.0"
}
@@ -1,5 +1,5 @@
<template>
<view class="purse_log_warp">
<view class="mine_purse_log_warp">
<Header :leftTitle="$t('mine.purse.mine_purse_log.title')" left-path-type="navigateTo"
left-path="/pages/mine_package/mine_purse/mine_purse" />
@@ -45,7 +45,7 @@
</view>
</view>
<view class="ipurse_nfo_right">
<view class="purse_info_title">{{ handleAmount(item.amount) }}</view>
<view class="purse_info_title" style="text-align: end;">{{ handleAmount(item.amount) }}</view>
<view class="purse_info_value">{{ item.remark }}</view>
</view>
</view>
@@ -66,8 +66,7 @@ import Header from '@/components/header.vue';
import { getAcctFlow, getAcctMiningStat, getAcctContribution, getAcctFlowList, getBonusStat, getAcctBalance } from '@/api/finance.js';
import { getValue, BALANCE_TYPE } from '@/utils/enumUtils.js';
import { formatDate, handleAmount } from '@/utils/index.js';
import BigNumber from 'bignumber.js';
import Decimal from 'decimal.js';
export default {
computed: {
@@ -410,8 +409,8 @@ export default {
}
</script>
<style lang="scss" scoped>
.purse_log_warp {
<style lang="scss">
.mine_purse_log_warp {
height: calc(100vh - 58rpx);
overflow-y: hidden;
+238 -222
View File
@@ -1,99 +1,99 @@
/**
* 根据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.type === key || item.key === key ) {
resultVal = item.value || item.name ;
}
});
return resultVal;
let resultVal = "";
if (!optionArr || optionArr.length === 0) {
return resultVal;
}
optionArr.map(item => {
if (item.type === key || item.key === key) {
resultVal = item.value || item.name;
}
});
return resultVal;
}
// 短信类型:passwd-设置密码,login-登录,changepassword-修改密码
export const SMS_TYPE = {
"PASSWD":"passwd",
"LOGIN":"login",
"REGISTER":"register",
"PASSWD": "passwd",
"LOGIN": "login",
"REGISTER": "register",
}
// 图片类型 图片分类:COMMON-公共,CATEGORY-商品类目图标,BRAND-品牌LOGO,SHOP-店铺LOGO,GOODS-商品图片,SPECS-商品规格图片
export const IMG_TYPE = {
"COMMON":"COMMON",
"CATEGORY":"CATEGORY",
"BRAND":"BRAND",
"SHOP":"SHOP",
"GOODS":"GOODS",
"SPECS":"SPECS",
"COMMON": "COMMON",
"CATEGORY": "CATEGORY",
"BRAND": "BRAND",
"SHOP": "SHOP",
"GOODS": "GOODS",
"SPECS": "SPECS",
}
// 订单的 状态:1-待支付,2-待发货,3-待收货,4-交易成功,5-售后(我加的)
export const MINE_ORDER_TYPE = {
"UNPAID":1,
"UNSHIPPED":2,
"NOT_RECEIVE":3,
"SUCCEED":4,
"AFTER_SALE":5,
"UNPAID": 1,
"UNSHIPPED": 2,
"NOT_RECEIVE": 3,
"SUCCEED": 4,
"AFTER_SALE": 5,
}
// 订单的 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
// 订单的 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
export const ORDER_TYPE = {
"UNPAID":0,
"PAYMENT_IMG":1,
"UNSHIPPED":2,
"NOT_RECEIVE":3,
"SUCCEED":4,
"CLOSE":5,
"UNPAID": 0,
"PAYMENT_IMG": 1,
"UNSHIPPED": 2,
"NOT_RECEIVE": 3,
"SUCCEED": 4,
"CLOSE": 5,
}
/**
* 订单的状态 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
* 订单的状态 状态:0-待支付,1-支付中,2-待发货,3-待收货,4-交易成功,5-交易关闭
*/
export const ORDER_STATUS=[
export const ORDER_STATUS = [
{
key:0,
name:"待支付"
},{
key:1,
name:"支付中"
},{
key:2,
name:"待发货"
},{
key:3,
name:"待收货"
},{
key:4,
name:"交易成功"
},{
key:5,
name:"交易关闭"
key: 0,
name: "待支付"
}, {
key: 1,
name: "支付中"
}, {
key: 2,
name: "待发货"
}, {
key: 3,
name: "待收货"
}, {
key: 4,
name: "交易成功"
}, {
key: 5,
name: "交易关闭"
}
]
/**
* 支付方式 1-微信支付,2-支付宝
*/
export const PAYMENT_WAY = {
"WECHAT":1,
"ALIPAY":2,
"WECHAT": 1,
"ALIPAY": 2,
}
export const PAYMENT_WAY_ = [
{
key: 1,
value: "微信支付"
},
{
key: 2,
value: "支付宝支付"
}
{
key: 1,
value: "微信支付"
},
{
key: 2,
value: "支付宝支付"
}
];
/**
@@ -101,38 +101,38 @@ export const PAYMENT_WAY_ = [
* @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小时发货"
}
{
key: 1,
value: "24小时内发货"
},
{
key: 2,
value: "48小时内发货"
}, {
key: 3,
value: "大于48小时发货"
}
];
// 0-普通,1-爆单专区,2-好物专区
export const SEARCH_TYPE={
NORMAL:0,
EXPLOSIVE:1,
SOMETHING:2,
export const SEARCH_TYPE = {
NORMAL: 0,
EXPLOSIVE: 1,
SOMETHING: 2,
}
export const WAY_LIST = [
{
disabled:false,
id:PAYMENT_WAY.WECHAT,
name:"微信支付",
path:"/static/product/way_wx.png",
disabled: false,
id: PAYMENT_WAY.WECHAT,
name: "微信支付",
path: "/static/product/way_wx.png",
},
{
disabled:false,
id:PAYMENT_WAY.ALIPAY,
name:"支付宝支付",
path:"/static/product/way_zfb.png",
disabled: false,
id: PAYMENT_WAY.ALIPAY,
name: "支付宝支付",
path: "/static/product/way_zfb.png",
},
]
@@ -140,27 +140,27 @@ export const WAY_LIST = [
* 发货状态 0-无需发货,1-待发货,2-已发货,3-已收货
*/
export const DELIVER_STATUS = {
NO_DELIVERY_REQUIRED:0,
AWAIT_DELIVERY_REQUIRED:1,
YES_DELIVERY_REQUIRED:2,
RECEIVED:3,
NO_DELIVERY_REQUIRED: 0,
AWAIT_DELIVERY_REQUIRED: 1,
YES_DELIVERY_REQUIRED: 2,
RECEIVED: 3,
}
export const DELIVER_STATUS_ = [
{
key: 0,
value: "无需发货"
},{
key: 1,
value: "待发货"
},
{
key: 2,
value: "已发货"
},{
key: 3,
value: "已收货"
}
{
key: 0,
value: "无需发货"
}, {
key: 1,
value: "待发货"
},
{
key: 2,
value: "已发货"
}, {
key: 3,
value: "已收货"
}
];
/**
* 余额类型:1-消费获得,2-抽奖获得,3-直推获得,4-间推获得,5-差奖,6-平级奖,7-充值,8-提现,9-支付,10-转出,11-转入,12-兑换,13-释放转出,14-释放转入,15-协议变更,16-买入,17-卖出
@@ -197,22 +197,22 @@ export const BALANCE_TYPE = [
{
key: 8,
value: "提现"
},{
}, {
key: 9,
value: "支付"
},{
}, {
key: 10,
value: "转出"
},{
}, {
key: 11,
value: "转入"
},{
}, {
key: 12,
value: "兑换"
},{
}, {
key: 13,
value: "释放转出"
},{
}, {
key: 14,
value: "释放转入"
},
@@ -227,7 +227,7 @@ export const BALANCE_TYPE = [
{
key: 17,
value: "卖出"
},
},
{
key: 18,
value: "系统赠送"
@@ -235,7 +235,7 @@ export const BALANCE_TYPE = [
{
key: 19,
value: "区域代理收益"
},{
}, {
key: 20,
value: "分红"
},
@@ -243,15 +243,31 @@ export const BALANCE_TYPE = [
key: 21,
value: "退款"
},
{
key: 22,
value: "预分配"
},
{
key: 23,
value: "释放抽奖次数消耗"
},
{
key: 24,
value: "抽奖消耗"
},
{
key: 25,
value: "加速释放转出"
},
]
/**
* 证状证件类型:1-居民身份证,2-护照
*/
export const CERT_OPTION= [
{
export const CERT_OPTION = [
{
key: 1,
value: "居民身份证"
},{
}, {
key: 2,
value: "护照"
},
@@ -260,17 +276,17 @@ export const CERT_OPTION= [
/**
* 实名认证状态:0-未认证,1-审核中,2-已认证,3-认证失败
*/
export const CERT_STATUS_OPTION= [
export const CERT_STATUS_OPTION = [
{
key: 0,
value: "未认证"
},{
}, {
key: 1,
value: "审核中"
},{
}, {
key: 2,
value: "已认证"
},{
}, {
key: 3,
value: "认证失败"
},
@@ -280,56 +296,56 @@ export const CERT_STATUS_OPTION= [
* @type {[{value: string, key: number},{value: string, key: number},{value: string, key: number},{value: string, key: number},{value: string, key: number},null,null]}
*/
export const ACCOUNT_CATEGORY = [
{
key: "expend",
value: "贡献值"
},
{
key: "raffle",
value: "抽奖次数"
},
{
key: "exchange",
value: "兑换券"
},
{
key: "deduction",
value: "抵扣券"
},
{
key: "vcoin",
value: "交易币"
},
{
key: "bonus",
value: "推荐佣金"
},
{
key: "redpacket",
value: "现金红包"
},
{
key: "balance",
value: "现金余额"
}
{
key: "expend",
value: "贡献值"
},
{
key: "raffle",
value: "抽奖次数"
},
{
key: "exchange",
value: "兑换券"
},
{
key: "deduction",
value: "抵扣券"
},
{
key: "vcoin",
value: "交易币"
},
{
key: "bonus",
value: "推荐佣金"
},
{
key: "redpacket",
value: "现金红包"
},
{
key: "balance",
value: "现金余额"
}
];
/**
* 账户类型
* @type {[{value: string, key: number},{value: string, key: number},{value: string, key: number},{value: string, key: number},{value: string, key: number},null,null]}
*/
export const ACCOUNT_TYPE = [
{
key: "lock",
value: "锁定账户"
},
{
key: "current",
value: "活期账户"
},
{
key: "quicken",
value: "加速释放账户"
}
{
key: "lock",
value: "锁定账户"
},
{
key: "current",
value: "活期账户"
},
{
key: "quicken",
value: "加速释放账户"
}
];
/**
@@ -337,70 +353,70 @@ export const ACCOUNT_TYPE = [
* @type {[{value: string, key: number},{value: string, key: number}]}
*/
export const FINANCE_WITHDRAWAL_STATUS = [
{
key: 0,
value: "审核中"
}, {
key: 1,
value: "已打款"
},
{
key: 2,
value: "拒绝"
},
{
key: 0,
value: "审核中"
}, {
key: 1,
value: "已打款"
},
{
key: 2,
value: "拒绝"
},
];
/**
* 页面:1-APP首页,2-APP分类页,3-商学院资讯,4-爆单区,5-好物区,6-积分专区
* @type {[{value: string, key: string}]}
*/
export const APP_PAGE_TYPE = {
HOME:1,
SORT:2,
NEWS:3,
HOT:4,
GOOD:5,
INTEGRAL:6,
/**
* 页面:1-APP首页,2-APP分类页,3-商学院资讯,4-爆单区,5-好物区,6-积分专区
* @type {[{value: string, key: string}]}
*/
export const APP_PAGE_TYPE = {
HOME: 1,
SORT: 2,
NEWS: 3,
HOT: 4,
GOOD: 5,
INTEGRAL: 6,
};
/**
* 新闻:类型:1-推荐,2-热门,3-新闻,4-RWA资讯,5-商学院
* @type {[{value: string, key: string}]}
*/
export const NEWS_TYPE = [
{
key: 1,
value: "推荐"
},{
key: 2,
value: "热门"
},{
key: 3,
value: "新闻"
},{
key: 5,
value: "商学院"
},{
key: 4,
value: "RWA资讯"
},
/**
* 新闻:类型:1-推荐,2-热门,3-新闻,4-RWA资讯,5-商学院
* @type {[{value: string, key: string}]}
*/
export const NEWS_TYPE = [
{
key: 1,
value: "推荐"
}, {
key: 2,
value: "热门"
}, {
key: 3,
value: "新闻"
}, {
key: 5,
value: "商学院"
}, {
key: 4,
value: "RWA资讯"
},
];
/**
* RWA 状态:0-未提交,1-待确认,2-交易成功,3-交易失败
* @type {[{value: string, key: string}]}
*/
export const RWA_STATUS = [
{
key: 0,
value: "申请中"
},{
key: 1,
value: "待股东确认"
},{
key: 2,
value: "交易成功"
},{
key: 3,
value: "交易失败"
},
/**
* RWA 状态:0-未提交,1-待确认,2-交易成功,3-交易失败
* @type {[{value: string, key: string}]}
*/
export const RWA_STATUS = [
{
key: 0,
value: "申请中"
}, {
key: 1,
value: "待股东确认"
}, {
key: 2,
value: "交易成功"
}, {
key: 3,
value: "交易失败"
},
];