Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
e176e772
Commit
e176e772
authored
Jan 25, 2024
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
限时折扣组件展示优化
parent
7c86d2ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
static/nativeComponents/TimeLimitedDiscount/index.js
+13
-7
static/nativeComponents/TimeLimitedDiscount/index.wxml
+1
-0
No files found.
static/nativeComponents/TimeLimitedDiscount/index.js
View file @
e176e772
...
...
@@ -117,6 +117,7 @@ const componentOptions = {
},
// 组件数据
data
:
{
isStart
:
true
,
// 活动是否开始
loaded
:
false
,
isContain
:
false
,
isPageHidden
:
false
,
// 页面是否处于隐藏状态
...
...
@@ -144,7 +145,7 @@ const componentOptions = {
selectActivityValue
,
dimension
}
=
this
.
data
.
datas
.
componentData
;
let
{
deleteFlag
,
endTimeData
}
=
this
.
data
;
let
{
deleteFlag
,
endTimeData
,
isStart
}
=
this
.
data
;
let
_this
=
this
;
if
(
activityCode
==
""
)
{
return
;
...
...
@@ -156,16 +157,21 @@ const componentOptions = {
promoteApi
.
getSingleItemActivityV2
(
query
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
copyData
=
res
.
data
.
data
;
deleteFlag
=
copyData
.
activityStatus
!=
2
?
true
:
false
;
// 未开始和进行中的活动
deleteFlag
=
!
[
1
,
2
].
includes
(
+
copyData
.
activityStatus
);
if
(
dimension
==
0
&&
copyData
.
goodsItems
.
length
==
0
)
{
deleteFlag
=
true
;
}
endTimeData
=
new
Date
(
copyData
.
endTime
.
replace
(
/-/g
,
"/"
)).
getTime
()
-
new
Date
().
getTime
();
console
.
log
(
endTimeData
,
"----------------------150"
);
const
now
=
new
Date
().
getTime
();
if
(
new
Date
(
copyData
.
startTime
.
replace
(
/-/g
,
"/"
)).
getTime
()
>
now
)
{
isStart
=
false
;
endTimeData
=
new
Date
(
copyData
.
startTime
.
replace
(
/-/g
,
"/"
)).
getTime
()
-
now
;
}
else
{
isStart
=
true
;
endTimeData
=
new
Date
(
copyData
.
endTime
.
replace
(
/-/g
,
"/"
)).
getTime
()
-
now
;
}
this
.
setData
({
endTime
:
endTimeData
});
this
.
setData
({
isStart
});
this
.
setData
({
deleteFlag
});
console
.
log
(
"------------155"
);
// setTimeout(() => {
...
...
static/nativeComponents/TimeLimitedDiscount/index.wxml
View file @
e176e772
...
...
@@ -43,6 +43,7 @@
class="countDown"
bind:change="onChange"
>
<text wx:if="{{!isStart}}">距开始:</text>
<text class="endTime days">{{ timeData.days }}</text>
<text class="endTimedot">天</text>
<text class="endTime hours">{{ timeData.hours }}</text>
...
...
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