Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
jijin
/
dance-pc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c3fb61cf
authored
2024-07-16 16:12:45 +0800
by
杨炀
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
d793ca6b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
6 deletions
src/viewsPc/booking/pay.vue
src/viewsPc/match/pay.vue
src/viewsPc/seat/api/index.js
src/viewsPc/seat/order-detail.vue
src/viewsPc/seat/utils/request.js
vite.config.js
src/viewsPc/booking/pay.vue
View file @
c3fb61c
...
...
@@ -714,6 +714,10 @@ function getremark(){
})
}
function
submitSJ
()
{
if
(
!
lpName
.
value
){
ElMessage
.
warning
(
language
.
value
==
0
?
'请填写开票人'
:
'Please fill in the invoice recipient'
)
return
}
loading
.
value
=
true
ElMessageBox
.
confirm
(
language
.
value
==
0
?
'提交后无法修改开票人,确认提交吗?'
:
'Confirm to submit ?'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'Confirm'
,
...
...
src/viewsPc/match/pay.vue
View file @
c3fb61c
...
...
@@ -663,6 +663,10 @@ function getremark() {
}
function
submitSJ
()
{
if
(
!
lpName
.
value
){
ElMessage
.
warning
(
language
.
value
==
0
?
'请填写开票人'
:
'Please fill in the invoice recipient'
)
return
}
loading
.
value
=
true
ElMessageBox
.
confirm
(
language
.
value
==
0
?
'提交后无法修改开票人,确认提交吗?'
:
'Confirm to submit ?'
,
{
confirmButtonText
:
language
.
value
==
0
?
'确定'
:
'Confirm'
,
...
...
src/viewsPc/seat/api/index.js
View file @
c3fb61c
...
...
@@ -54,4 +54,3 @@ export const payCallback = (data) =>
request
(
"POST"
,
`/api/order/palPayTicket/callback/`
,
data
);
export
const
getCanInvoiceTicket
=
(
data
)
=>
request
(
"GET"
,
`/api/order/getOrderInvoiceList`
,
data
);
...
...
src/viewsPc/seat/order-detail.vue
View file @
c3fb61c
This diff is collapsed.
Click to expand it.
src/viewsPc/seat/utils/request.js
View file @
c3fb61c
...
...
@@ -3,9 +3,11 @@
// import axios from "axios";
import
axios
from
"axios/dist/axios"
;
import
{
getToken
}
from
"./local-store"
;
import
{
ElMessage
}
from
"element-plus"
;
import
{
ElLoading
,
ElMessage
}
from
"element-plus"
;
import
{
saveAs
}
from
'file-saver'
import
{
useStorage
}
from
"@vueuse/core/index"
;
import
{
blobValidate
,
tansParams
}
from
"@/utils/ruoyi"
;
import
errorCode
from
"@/utils/errorCode"
;
const
language
=
useStorage
(
"language"
,
0
);
const
baseURL
=
import
.
meta
.
env
.
VITE_TICKET_BASE_API
// const baseURL = VITE_TICKET_BASE_API; //"http://book.xiaojinyu.games"; // 这里填入你的基础 API URL
...
...
@@ -44,6 +46,13 @@ http.interceptors.request.use(
http
.
interceptors
.
response
.
use
(
(
response
)
=>
{
// 判断是否有异常
if
(
response
.
request
.
responseType
===
'blob'
||
response
.
request
.
responseType
===
'arraybuffer'
)
{
return
response
}
let
error
=
null
;
// 若无异常此值为null
if
(
response
.
status
!==
200
)
{
error
=
Error
(
`Request failed with statuCode
${
response
.
status
}
`
);
...
...
@@ -54,6 +63,7 @@ http.interceptors.response.use(
return
Promise
.
reject
(
response
.
data
);
}
return
response
.
data
;
},
(
error
)
=>
{
...
...
@@ -62,13 +72,53 @@ http.interceptors.response.use(
}
);
export
function
download
(
url
,
params
,
filename
,
config
)
{
return
http
.
post
(
url
,
params
,
{
transformRequest
:
[
(
params
)
=>
{
return
tansParams
(
params
)
}
],
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
},
responseType
:
'blob'
,
...
config
})
.
then
(
async
(
res
)
=>
{
const
data
=
res
.
data
console
.
log
(
blobValidate
(
data
))
const
isBlob
=
blobValidate
(
data
)
if
(
isBlob
)
{
let
hz
=
''
if
(
res
.
headers
[
'content-disposition'
].
indexOf
(
'zip'
)
>
-
1
||
res
.
headers
[
'content-type'
].
indexOf
(
'pdf'
)
>
-
1
)
{
// if (res.headers['content-type'].indexOf('zip') > -1) {
// hz = '.zip'
// } else if (res.headers['content-type'].indexOf('pdf') > -1) {
// hz = '.pdf'
// }
const
index
=
res
.
headers
[
'content-disposition'
].
indexOf
(
'='
)
hz
=
res
.
headers
[
'content-disposition'
].
substr
(
index
+
1
,
res
.
headers
[
'content-disposition'
].
length
)
}
const
blob
=
new
Blob
([
data
])
saveAs
(
blob
,
hz
?
filename
=
decodeURIComponent
(
hz
)
:
filename
)
}
else
{
const
resText
=
await
data
.
text
()
const
rspObj
=
JSON
.
parse
(
resText
)
const
errMsg
=
errorCode
[
rspObj
.
code
]
||
rspObj
.
msg
||
errorCode
[
'default'
]
ElMessage
.
error
(
errMsg
)
}
}).
catch
((
r
)
=>
{
console
.
error
(
url
,
r
)
ElMessage
.
error
(
'下载文件出现错误,请联系管理员!'
)
})
}
// 封装请求函数
const
request
=
(
method
,
url
,
data
=
null
)
=>
{
function
request
(
method
,
url
,
data
=
null
)
{
return
http
({
method
,
url
,
data
,
});
}
;
}
export
default
request
;
...
...
vite.config.js
View file @
c3fb61c
...
...
@@ -90,7 +90,7 @@ export default defineConfig(({ mode, command }) => {
rewrite
:
(
p
)
=>
p
.
replace
(
/^
\/
dev-api/
,
''
)
},
'/ticket'
:
{
target
:
'http://192.168.1.131:80
81
/'
,
target
:
'http://192.168.1.131:80
98
/'
,
// target: 'http://192.168.1.131:8081/',
// target: 'https://jijin.wtwuxicenter.com/h5',
// target: 'https://ticketh5.wdsfwuxicenter.com/h5/stage-api',
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment