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

chore: 订单管理代码优化

parent 700e6713
...@@ -3,31 +3,29 @@ import Layout from '@/layout/index.vue' ...@@ -3,31 +3,29 @@ import Layout from '@/layout/index.vue'
export default [ export default [
{ {
path: '/order-manage-layout', path: '/order/manage',
name: 'OrderManage-Layout',
meta: { meta: {
rank: 1001, rank: 1001,
title: 'router_title_module.order_manage', title: '',
}, },
component: Layout, component: Layout,
redirect: '/order-manage',
children: [ children: [
{ {
path: '/order-manage', path: '',
name: 'OrderManage', name: 'OrderManage',
meta: { meta: {
rank: 1001, rank: 1001,
title: 'router_title_module.order_manage', title: '',
}, },
component: () => import('@/views/order-manage/order-manage.vue'), component: () => import('@/views/order-manage/order-manage.vue'),
redirect: '/order-manage/package', redirect: '/order/manage/package',
children: [ children: [
{ {
path: 'package', path: 'package',
name: 'OrderManagePackage', name: 'OrderManagePackage',
meta: { meta: {
rank: 1001, rank: 1001,
title: 'router_title_module.order_manage', title: 'common_module.package',
}, },
component: () => import('@/views/order-manage/components/package-manage.vue'), component: () => import('@/views/order-manage/components/package-manage.vue'),
}, },
...@@ -36,7 +34,7 @@ export default [ ...@@ -36,7 +34,7 @@ export default [
name: 'OrderManageRecharge', name: 'OrderManageRecharge',
meta: { meta: {
rank: 1001, rank: 1001,
title: 'router_title_module.order_manage', title: 'common_module.recharge',
}, },
component: () => import('@/views/order-manage/components/recharge-manage.vue'), component: () => import('@/views/order-manage/components/recharge-manage.vue'),
}, },
......
...@@ -40,26 +40,44 @@ function handleGetPackageList() { ...@@ -40,26 +40,44 @@ function handleGetPackageList() {
} }
function judgeExpirationDate(lifespan: number) { function judgeExpirationDate(lifespan: number) {
if (lifespan === -1) return t('common_module.expired') switch (lifespan) {
else if (lifespan === -2) return t('common_module.forever_effective') case -1:
else return t('common_module.expired')
case -2:
return t('common_module.forever_effective')
default:
return ( return (
t('order_manage_module.remaining_validity_period') + t('order_manage_module.remaining_validity_period') +
lifespan + lifespan +
t('order_manage_module.remaining_validity_period_day') t('order_manage_module.remaining_validity_period_day')
) )
}
} }
function splicingPackageName(orderItem: OrderItem) { function splicingPackageName(orderItem: OrderItem) {
let expiredType = '' let expiredType = ''
let equityType = '' let equityType = ''
if (orderItem.type === 'normal') expiredType = t('order_manage_module.basic_edition') switch (orderItem.type) {
else if (orderItem.type === 'professional') expiredType = t('order_manage_module.professional_edition') case 'normal':
else if (orderItem.type === 'ultimate') expiredType = t('order_manage_module.flagship_edition') 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') switch (orderItem.expiredType) {
else if (orderItem.expiredType === 'month') equityType = t('common_module.month') case 'year':
equityType = t('common_module.year')
break
case 'month':
equityType = t('common_module.month')
break
}
return expiredType + orderItem.expiredNum + equityType return expiredType + orderItem.expiredNum + equityType
} }
......
...@@ -41,9 +41,17 @@ function handleGetRechargeList() { ...@@ -41,9 +41,17 @@ function handleGetRechargeList() {
function splicingRechargeDetails(orderItem: OrderItem) { function splicingRechargeDetails(orderItem: OrderItem) {
let rechargeType = '' let rechargeType = ''
if (orderItem.type === 'normal') rechargeType = 100 + t('order_manage_module.points') switch (orderItem.type) {
else if (orderItem.type === 'professional') rechargeType = 300 + t('order_manage_module.points') case 'normal':
else if (orderItem.type === 'ultimate') rechargeType = 800 + t('order_manage_module.points') 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 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