Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_wechat
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_wechat
Commits
0e472f79
Commit
0e472f79
authored
Jan 20, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
细节优化
parent
6c13eee2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
26 deletions
+43
-26
store.js
api/store.js
+6
-1
index.vue
pages/index/index.vue
+37
-25
No files found.
api/store.js
View file @
0e472f79
import
http
from
"@/common/vmeitime-http/index.js"
// 获取门店
及房间信息
// 获取门店
export
const
getListStore
=
(
data
)
=>
{
let
url
=
`/store/listVo`
return
http
.
get
(
url
,
data
)
}
export
const
getRoomList
=
(
data
)
=>
{
let
url
=
`/room/list`
return
http
.
get
(
url
,
data
)
}
export
const
roomInfo
=
(
data
)
=>
{
let
url
=
`/room/info`
return
http
.
get
(
url
,
data
)
...
...
pages/index/index.vue
View file @
0e472f79
...
...
@@ -95,7 +95,7 @@
</view>
<view
class=
"flex-row list-point-box"
>
<view
v-for=
"(val,k) in list"
:key=
"k"
class=
"flex-1 flex-col"
>
<view
class=
"box"
:class=
"item.
list && item.list[val].status==1 && item.l
ist[val].m>=59?'bg-pink':'bg-gray'"
>
<view
class=
"box"
:class=
"item.
roomStatusList && item.roomStatusList[val].status==1 && item.roomStatusL
ist[val].m>=59?'bg-pink':'bg-gray'"
>
</view>
<text
class=
"text-gray text-sm"
>
{{
val
==
24
?
'次日'
:
val
>
24
?
val
-
24
:
val
}}
</text>
...
...
@@ -139,7 +139,8 @@
}
from
"@/api/index.js"
;
import
{
getListStore
,
listSortDistance
listSortDistance
,
getRoomList
}
from
"@/api/store"
;
import
config
from
"@/config/index.config"
import
ToolBox
from
"@/components/toolBox/toolBox"
...
...
@@ -278,7 +279,6 @@
uni
.
setStorageSync
(
"longitude"
,
res
.
longitude
)
}
else
{
this
.
$refs
.
popup
.
open
()
uni
.
hideLoading
()
}
this
.
onGetListStore
()
}
...
...
@@ -292,29 +292,41 @@
nowLongitude
:
this
.
longitude
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
.
length
)
{
this
.
storeList
=
res
.
data
.
data
;
let
obj
=
{}
if
(
uni
.
getStorageSync
(
"storeId"
)){
obj
=
this
.
storeList
.
find
(
item
=>
item
.
id
===
uni
.
getStorageSync
(
"storeId"
))
}
else
{
obj
=
res
.
data
.
data
[
0
];
}
that
.
storeInfo
=
{
...
obj
,
distance
:
obj
.
distance
?
Number
(
obj
.
distance
.
substr
(
0
,
8
)).
toFixed
(
2
):
0
}
if
(
obj
.
roomVoList
&&
obj
.
roomVoList
.
length
){
that
.
roomVoList
=
obj
.
roomVoList
.
map
(
item
=>
{
return
{
...
item
,
facilities
:
item
.
facilities
?
item
.
facilities
.
split
(
","
)
:
[],
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[]
}
})
uni
.
hideLoading
()
that
.
onGetSortDistance
(
0
);
}
let
obj
=
{}
if
(
uni
.
getStorageSync
(
"storeId"
)){
obj
=
res
.
data
.
data
.
find
(
item
=>
item
.
id
===
uni
.
getStorageSync
(
"storeId"
))
}
else
{
obj
=
res
.
data
.
data
[
0
];
}
that
.
storeInfo
=
{
...
obj
,
distance
:
obj
.
distance
?
Number
(
obj
.
distance
.
substr
(
0
,
8
)).
toFixed
(
2
):
0
}
that
.
onGetRoomList
(
obj
.
id
)
}
})
},
onGetRoomList
(
storeId
){
let
that
=
this
;
getRoomList
({
storeId
}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
&&
res
.
data
.
data
.
length
){
that
.
roomVoList
=
res
.
data
.
data
.
map
(
item
=>
{
return
{
...
item
,
facilities
:
item
.
facilities
?
item
.
facilities
.
split
(
","
)
:
[],
images
:
item
.
images
?
item
.
images
.
split
(
","
).
map
(
val
=>
this
.
hostUrl
+
val
)
:
[],
roomStatusList
:
item
.
roomStatusList
.
map
(
val
=>
{
return
{
...
val
,
m
:
val
.
endHoldTime
?
Number
(
moment
(
val
.
endHoldTime
).
format
(
"mm"
)):
0
}
})
}
})
}
else
{
that
.
roomVoList
=
[]
}
uni
.
hideLoading
()
})
},
onGetSortDistance
(
i
=
0
){
...
...
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