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
725a24fe
authored
2024-05-24 17:25:10 +0800
by
yyx
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
日期
1 parent
ce68ae29
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
7 deletions
src/viewsPc/seat/ticket-detail.vue
src/viewsPc/seat/utils/language.js
src/viewsPc/seat/ticket-detail.vue
View file @
725a24f
<
script
setup
>
import
{
dayjs
}
from
'element-plus'
import
{
dayjs
}
from
"element-plus"
;
import
useUserStore
from
"@/store/modules/user"
;
import
{
setToken
,
getToken
}
from
"./utils/local-store.js"
;
import
{
md5
}
from
"md5js"
;
...
...
@@ -11,7 +11,7 @@ import {
getSitePlaceInfo
,
getPriceLevelInfo
,
}
from
"./api/index.js"
;
import
{
languageFormat
}
from
"./utils/language.js"
;
import
{
languageFormat
,
getDayName
}
from
"./utils/language.js"
;
import
{
useStorage
}
from
"@vueuse/core/index"
;
const
language
=
useStorage
(
"language"
,
0
);
...
...
@@ -258,13 +258,29 @@ watch(
<div
class=
"time"
>
{{
languageFormat
(
language
,
"时间"
,
"Event Date & Time"
)
}}
:
{{
detail
.
data
?.
startTime
?
dayjs
(
detail
.
data
?.
startTime
).
format
(
"YYYY.MM.DD ddd"
)
?
dayjs
(
detail
.
data
?.
startTime
).
format
(
"YYYY.MM.DD"
)
:
""
}}
{{
detail
.
data
?.
startTime
?
getDayName
(
new
Date
(
detail
.
data
?.
startTime
),
language
==
1
?
"en-US"
:
"zh-CN"
)
:
""
}}
—
{{
detail
.
data
?.
endTime
?
dayjs
(
detail
.
data
?.
endTime
).
format
(
"YYYY.MM.DD ddd"
)
?
dayjs
(
detail
.
data
?.
endTime
).
format
(
"YYYY.MM.DD"
)
:
""
}}
{{
detail
.
data
?.
endTime
?
getDayName
(
new
Date
(
detail
.
data
?.
endTime
),
language
==
1
?
"en-US"
:
"zh-CN"
)
:
""
}}
</div>
...
...
@@ -288,13 +304,17 @@ watch(
@
click=
"select_form.onClickVenue(it)"
>
{{
it
.
dateStr
}}
<div
v-if=
"it.type == 1"
class=
"tag_t"
>
{{
languageFormat
(
language
,
"套票"
,
"Package ticket"
)
}}
</div>
<div
v-if=
"it.type == 1"
class=
"tag_t"
>
{{
languageFormat
(
language
,
"套票"
,
"Package ticket"
)
}}
</div>
</div>
</div>
</div>
<!-- 场次 -->
<div
class=
"select_item_box"
>
<div
class=
"label"
>
{{
languageFormat
(
language
,
"场次"
,
"Session"
)
}}
</div>
<div
class=
"label"
>
{{
languageFormat
(
language
,
"场次"
,
"Session"
)
}}
</div>
<div
class=
"select_item"
>
<div
:class=
"[
...
...
src/viewsPc/seat/utils/language.js
View file @
725a24f
export
const
languageFormat
=
(
language
=
0
,
zh
,
en
)
=>
{
return
language
==
1
?
en
:
zh
;
};
export
const
getDayName
=
(
date
,
locale
=
"zh-CN"
)
=>
{
// 定义本地化选项,指定需要显示星期几
let
options
=
{
weekday
:
"long"
};
// 使用 toLocaleDateString 方法,根据指定的语言和选项格式化日期
let
dayName
=
date
.
toLocaleDateString
(
locale
,
options
);
// 针对中文,替换 "星期" 为 "周"
if
(
locale
===
"zh-CN"
)
{
dayName
=
dayName
.
replace
(
"星期"
,
"周"
);
}
return
dayName
;
};
...
...
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