Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
zhiliang-light-mp
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
d96bfccf
authored
2019-10-15 18:50:32 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
d943f54c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
src/pages/auction-detail/auction-detail.js
src/pages/auction-detail/auction-detail.js
View file @
d96bfcc
...
...
@@ -300,7 +300,7 @@ Page({
socketStatus
:
'connected'
,
waitingResponse
:
false
})
this
.
refreshView
();
//
this.refreshView();
})
wx
.
onSocketClose
(()
=>
{
...
...
@@ -321,10 +321,40 @@ Page({
// 监听服务器推送消息
wx
.
onSocketMessage
(
message
=>
{
console
.
log
(
'socket message:'
,
message
);
this
.
setData
({
loading
:
false
let
socketData
=
message
&&
message
.
data
||
""
;
let
result
=
null
;
if
(
socketData
)
{
let
parseData
=
JSON
.
parse
(
socketData
);
result
=
parseData
&&
parseData
.
content
||
null
;
}
console
.
log
(
"result:"
,
result
);
if
(
!
result
)
return
;
let
priceInfo
=
result
.
list
||
[];
priceInfo
.
forEach
(
element
=>
{
element
.
recordTime
=
new
Date
(
element
.
recordTime
).
toString
(
"yyyy.MM.dd hh:mm:ss"
);
element
.
memberPhone
=
element
.
memberPhone
.
substr
(
0
,
3
)
+
'****'
+
element
.
memberPhone
.
substr
(
7
);
});
this
.
refreshView
();
this
.
setData
({
priceInfo
:
priceInfo
,
maxPrice
:
result
.
maxPrice
||
0
,
priceTotal
:
result
.
total
||
0
})
// 重置倒计时
let
productInfo
=
this
.
data
.
productInfo
;
let
endTime
=
result
.
endTime
||
0
;
productInfo
.
endTime
=
endTime
this
.
setData
({
isTimeEnd
:
endTime
<=
0
,
productInfo
})
this
.
removeTimer
();
this
.
startTimer
();
// this.setData({
// loading: false
// });
// this.refreshView();
})
// 打开信道
...
...
Please
register
or
sign in
to post a comment