Commit 8d460109 authored by shirlyn.guo's avatar shirlyn.guo 👌🏻

chore: 订单管理代码优化

parent 700e6713
......@@ -3,31 +3,29 @@ import Layout from '@/layout/index.vue'
export default [
{
path: '/order-manage-layout',
name: 'OrderManage-Layout',
path: '/order/manage',
meta: {
rank: 1001,
title: 'router_title_module.order_manage',
title: '',
},
component: Layout,
redirect: '/order-manage',
children: [
{
path: '/order-manage',
path: '',
name: 'OrderManage',
meta: {
rank: 1001,
title: 'router_title_module.order_manage',
title: '',
},
component: () => import('@/views/order-manage/order-manage.vue'),
redirect: '/order-manage/package',
redirect: '/order/manage/package',
children: [
{
path: 'package',
name: 'OrderManagePackage',
meta: {
rank: 1001,
title: 'router_title_module.order_manage',
title: 'common_module.package',
},
component: () => import('@/views/order-manage/components/package-manage.vue'),
},
......@@ -36,7 +34,7 @@ export default [
name: 'OrderManageRecharge',
meta: {
rank: 1001,
title: 'router_title_module.order_manage',
title: 'common_module.recharge',
},
component: () => import('@/views/order-manage/components/recharge-manage.vue'),
},
......
......@@ -40,26 +40,44 @@ function handleGetPackageList() {
}
function judgeExpirationDate(lifespan: number) {
if (lifespan === -1) return t('common_module.expired')
else if (lifespan === -2) return t('common_module.forever_effective')
else
return (
t('order_manage_module.remaining_validity_period') +
lifespan +
t('order_manage_module.remaining_validity_period_day')
)
switch (lifespan) {
case -1:
return t('common_module.expired')
case -2:
return t('common_module.forever_effective')
default:
return (
t('order_manage_module.remaining_validity_period') +
lifespan +
t('order_manage_module.remaining_validity_period_day')
)
}
}
function splicingPackageName(orderItem: OrderItem) {
let expiredType = ''
let equityType = ''
if (orderItem.type === 'normal') expiredType = t('order_manage_module.basic_edition')
else if (orderItem.type === 'professional') expiredType = t('order_manage_module.professional_edition')
else if (orderItem.type === 'ultimate') expiredType = t('order_manage_module.flagship_edition')
switch (orderItem.type) {
case 'normal':
expiredType = t('order_manage_module.basic_edition')
break
case 'professional':
expiredType = t('order_manage_module.professional_edition')
break
case 'ultimate':
expiredType = t('order_manage_module.flagship_edition')
break
}
if (orderItem.expiredType === 'year') equityType = t('common_module.year')
else if (orderItem.expiredType === 'month') equityType = t('common_module.month')
switch (orderItem.expiredType) {
case 'year':
equityType = t('common_module.year')
break
case 'month':
equityType = t('common_module.month')
break
}
return expiredType + orderItem.expiredNum + equityType
}
......
......@@ -41,9 +41,17 @@ function handleGetRechargeList() {
function splicingRechargeDetails(orderItem: OrderItem) {
let rechargeType = ''
if (orderItem.type === 'normal') rechargeType = 100 + t('order_manage_module.points')
else if (orderItem.type === 'professional') rechargeType = 300 + t('order_manage_module.points')
else if (orderItem.type === 'ultimate') rechargeType = 800 + t('order_manage_module.points')
switch (orderItem.type) {
case 'normal':
rechargeType = 100 + t('order_manage_module.points')
break
case 'professional':
rechargeType = 300 + t('order_manage_module.points')
break
case 'ultimate':
rechargeType = 800 + t('order_manage_module.points')
break
}
return rechargeType
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment