Commit 868204dd authored by zhengke's avatar zhengke

优化订单

parent 404ec02b
......@@ -257,7 +257,7 @@ const routes: RouteRecordRaw[] = [
}
},
{
path: '/a/order',
path: '/a/order/:activeName?',
component: () => import('@/views/TeamCenter/Order.vue'),
meta:{
title:'我的订单/发票'
......@@ -278,7 +278,7 @@ const routes: RouteRecordRaw[] = [
}
},
{
path: '/a/order/:id/:isFirm',
path: '/a/orderDetail/:id/:isFirm/:activeName',
component: () => import('@/views/TeamCenter/OrderDetail.vue'),
meta:{
title:'订单详情'
......@@ -308,14 +308,14 @@ const routes: RouteRecordRaw[] = [
}
},
{
path: '/u/order',
path: '/u/order/:activeName?',
component: () => import('@/views/UserCenter/Order.vue'),
meta:{
title:'我的订单/发票'
}
},
{
path: '/u/order/:id',
path: '/u/orderDetail/:id/:activeName',
component: () => import('@/views/UserCenter/OrderDetail.vue'),
meta:{
title:'订单详情'
......
......@@ -3,7 +3,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted } from "vue";
import { ref } from "vue";
import Order from '../UserCenter/Order.vue'
const type = ref(1)
</script>
......
......@@ -216,6 +216,14 @@ const InvoiceDatas = reactive({
} as any)
const InvoiceDetails = ref({})
if(router.currentRoute.value.params.activeName) {
activeName.value = router.currentRoute.value.params.activeName
if(activeName.value=='all') parameters.value.orderstatus = 0
if(activeName.value=='pay') parameters.value.orderstatus = 1
if(activeName.value=='finish') parameters.value.orderstatus = 2
if(activeName.value=='invoice') parameters.value.orderstatus = 4
}
const DownloadInvoice = (x:any) => {
let name = x.Content.split('/')
const xhr = new XMLHttpRequest()
......@@ -445,7 +453,7 @@ const scrollingHandler = () =>{
}
const forwardOrderDetail = (id:string,type:any)=>{
let url = props.firm?`/a/order/${encodeURIComponent(id)}/${props.firm}`:`/u/order/${encodeURIComponent(id)}`
let url = props.firm?`/a/orderDetail/${encodeURIComponent(id)}/${props.firm}/${activeName.value}`:`/u/orderDetail/${encodeURIComponent(id)}/${activeName.value}`
if(type) openNewBlank(url)
else router.push(url)
}
......
......@@ -124,7 +124,9 @@ const CanceltOrders = async ()=>{
}
const forwardOrder = (id: string) => {
let url = router.currentRoute.value.params.isFirm&&router.currentRoute.value.params.isFirm==1?'/a/order':'/u/order'
let activeName = router.currentRoute.value.params.activeName?`/${router.currentRoute.value.params.activeName}`:''
let isFirm = router.currentRoute.value.params.isFirm
let url = isFirm==1?`/a/order${activeName}`:`/u/order${activeName}`
router.push(url)
}
......
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