Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NJ_usercenter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
NJ_usercenter
Commits
49cd9abb
Commit
49cd9abb
authored
Nov 27, 2023
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 有效期显示
parent
cfd317f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
NJ_usercenter.ts
assets/NJ_usercenter/scene/NJ_usercenter.ts
+8
-4
No files found.
assets/NJ_usercenter/scene/NJ_usercenter.ts
View file @
49cd9abb
...
...
@@ -84,23 +84,27 @@ export default class SceneComponent extends MyCocosSceneComponent_NJ_usercenter
}
// 购买的有效期
const
productRes
:
any
=
await
asyncCallNetworkApiGet
(
'
/api/oxford/v1/product/list
'
,
{
token
:
this
.
token
});
const
products
=
JSON
.
parse
(
productRes
).
rows
.
filter
(
item
=>
item
.
type_
==
2
)
;
const
products
=
JSON
.
parse
(
productRes
).
rows
;
if
(
products
&&
products
.
length
>
0
)
{
const
endDate
=
products
[
0
].
syll_end_date
.
split
(
"
T
"
)[
0
].
trim
();
cc
.
find
(
`Canvas/usercenter/view/content/scollpage/user_center/enddate`
).
getComponent
(
cc
.
Label
).
string
=
`有效期至:
${
endDate
}
`
;
let
endDate
=
""
;
const
container
=
cc
.
find
(
`Canvas/usercenter/paylist_bg/container`
);
container
.
removeAllChildren
();
const
item
=
cc
.
find
(
`Canvas/usercenter/paylist_bg/item`
);
for
(
let
i
=
0
;
i
<
products
.
length
;
i
++
)
{
const
p
=
products
[
i
];
if
(
p
.
type_
==
2
)
{
if
(
!!
p
.
syll_end_date
&&
p
.
type_
==
2
)
{
const
endDay
=
p
.
syll_end_date
.
split
(
"
T
"
)[
0
].
trim
();
const
itemClone
=
cc
.
instantiate
(
item
);
itemClone
.
parent
=
container
;
itemClone
.
active
=
true
;
cc
.
find
(
`level`
,
itemClone
).
getComponent
(
cc
.
Label
).
string
=
`
${
p
.
name
}
有效期至
${
endDay
}
`
;
endDate
=
endDay
;
}
}
if
(
endDate
)
{
cc
.
find
(
`Canvas/usercenter/view/content/scollpage/user_center/enddate`
).
getComponent
(
cc
.
Label
).
string
=
`有效期至:
${
endDate
}
`
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment