Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eMall_miniapp
Project
Project
Details
Activity
Releases
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
高宇
eMall_miniapp
Commits
59a6ea42
Commit
59a6ea42
authored
Jul 25, 2023
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商铺接口
parent
586f490f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
254 additions
and
181 deletions
+254
-181
index.vue
homePage/shop/detail/index.vue
+59
-49
index.vue
homePage/shop/index.vue
+195
-132
No files found.
homePage/shop/detail/index.vue
View file @
59a6ea42
...
...
@@ -13,11 +13,11 @@
<!-- 分割线上方 -->
<view
class=
"shopName"
>
<!-- 商铺名称 -->
<text>
{{
shopN
ame
}}
</text>
<text>
{{
newList
.
n
ame
}}
</text>
</view>
<view
class=
"address"
>
<!-- 地址 -->
<text>
{{
address
}}
</text>
<text>
{{
location
}}
</text>
</view>
</view>
<!-- 分割线 -->
...
...
@@ -25,39 +25,48 @@
<!-- 分割线下方 所在楼层 -->
<view
class=
"locations"
>
<u-icon
name=
"map"
></u-icon>
<text>
所在楼层:
<text
class=
"location"
>
{{
loca
tion
}}
</text></text>
<text>
所在楼层:
<text
class=
"location"
>
{{
newList
.
posi
tion
}}
</text></text>
</view>
</view>
</view>
</view>
<view
class=
"lowNav"
>
<!-- 底部样式 -->
<view
class=
"minlow"
>
<text
class=
"textModel"
>
已有
{{
person
}}
人点赞
</text>
</view>
<view
class=
"dianzan"
>
<u-rate
:count=
"1"
active-icon=
"heart-fill"
inactive-icon=
"heart"
inactive-color=
"#ff0000"
@
change=
"dianzan"
></u-rate>
<u-rate
:count=
"1"
active-icon=
"heart-fill"
inactive-icon=
"heart"
inactive-color=
"#ff0000"
@
change=
"dianzan"
></u-rate>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
(){
export
default
{
data
()
{
return
{
img
:
'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg'
,
shopName
:
'龙江烧烤'
,
address
:
'天津复悦里'
,
location
:
'A2-107'
,
person
:
0
,
flag
:
true
img
:
''
,
shopName
:
''
,
location
:
'天津复悦里'
,
position
:
''
,
person
:
0
,
flag
:
true
,
newList
:
[]
}
},
methods
:{
dianzan
(){
this
.
person
=
this
.
flag
?
this
.
person
+
1
:
this
.
person
-
1
;
onLoad
(
options
)
{
console
.
log
(
'options'
,
options
.
location
)
this
.
newList
=
JSON
.
parse
(
decodeURIComponent
(
options
.
data
))
console
.
log
(
'newList'
,
this
.
newList
);
this
.
img
=
this
.
newList
.
img
this
.
location
=
options
.
location
},
methods
:
{
dianzan
()
{
this
.
person
=
this
.
flag
?
this
.
person
+
1
:
this
.
person
-
1
;
this
.
flag
=
!
this
.
flag
;
}
}
...
...
@@ -65,84 +74,84 @@
</
script
>
<
style
lang=
"scss"
scoped
>
.detail
{
.detail
{
background-color
:
#eeeeee
;
min-height
:
100vh
;
//上半样式
.upModel
{
padding
:
25rpx
25rpx
0
;
.upModel
{
padding
:
25rpx
25rpx
0
;
//卡片
.card
{
.card
{
width
:
100%
;
height
:
50vh
;
background-color
:
#fff
;
border-radius
:
20px
;
//View1
.View1
{
.View1
{
height
:
60%
;
background-color
:
antiquewhite
;
border-radius
:
20px
20px
0
0
;
}
//图片父级样式
.priture
{
.priture
{
width
:
100%
;
height
:
60%
;
// border-radius: 20px 20px 0 0;
}
//图片
.image
{
.image
{
width
:
100%
;
height
:
100%
;
border-radius
:
20px
20px
0
0
;
}
//图片底部区域
.lowArea
{
.lowArea
{
padding
:
0
30rpx
0
30rpx
;
height
:
20vh
;
//分割线上方
.up-line
{
.up-line
{
margin
:
28rpx
0
28rpx
0
;
//商铺名称
.shopName
{
.shopName
{
font-size
:
40rpx
;
}
//地址
.address
{
.address
{
margin-top
:
14rpx
;
font-size
:
26rpx
;
color
:
#787878
;
}
}
//分割线下方 所造楼层
.locations
{
.locations
{
margin-top
:
40rpx
;
margin-bottom
:
auto
;
display
:
flex
;
font-size
:
26rpx
;
//楼层数
.location
{
.location
{
color
:
#787878
;
}
}
}
}
}
//底部样式
.lowNav
{
.lowNav
{
background-color
:
#fff
;
height
:
120rpx
;
width
:
100%
;
...
...
@@ -150,19 +159,20 @@
z-index
:
100
;
bottom
:
0
;
position
:
fixed
;
box-shadow
:
0
20px
20px
16px
rgba
(
0
,
0
,
0
,
0
.4
);
/* 添加阴影效果 */
box-shadow
:
0
20px
20px
16px
rgba
(
0
,
0
,
0
,
0
.4
);
/* 添加阴影效果 */
//文字部分
.minlow
{
.minlow
{
font-size
:
30rpx
;
color
:
#787878
;
margin-left
:
30rpx
;
margin-top
:
auto
;
margin-bottom
:
auto
;
}
//点赞
.dianzan
{
.dianzan
{
margin-left
:
30rpx
;
margin-top
:
auto
;
margin-bottom
:
auto
;
...
...
homePage/shop/index.vue
View file @
59a6ea42
<
template
>
<view
class=
"shop"
>
<view
class=
"shop"
>
<!-- 搜索框 -->
<view
class=
"u-search-box"
>
<view
class=
"u-search-inner"
>
<u-icon
name=
"search"
color=
"#909399"
:size=
"28"
></u-icon>
<u-input
class=
"u-search-text"
:disabled=
"ture"
type=
"text"
height=
"50"
@
click=
"toSearch
"
placeholder=
"搜商品名称"
/>
<u-input
class=
"u-search-text"
v-model=
"name"
:disabled=
"ture"
type=
"text"
height=
"50
"
placeholder=
"搜商品名称"
/>
</view>
<view
class=
"button"
>
<u-button
size=
"mini"
shape=
"circle"
hover-class=
"none"
@
click=
"search"
>
<u-icon
name=
"search"
></u-icon>
</u-button>
</view>
</view>
<!-- 选择框 -->
<view
class=
"container"
style=
"border-radius: 12px;"
>
<u-tabs
style=
"border-radius: 12px;"
:list=
"list"
active-color=
"#fa3534"
:current=
"current"
@
change=
"change"
></u-tabs>
<u-tabs
style=
"border-radius: 12px;"
:list=
"list"
active-color=
"#fa3534"
:current=
"current"
@
change=
"change"
></u-tabs>
</view>
<!-- 列表区 -->
<view
class=
"gl-body"
>
<view
class=
"list"
v-for=
"(item,index) in newList"
:key=
"index"
>
<view
class=
"list"
v-for=
"(item,index) in newList"
:key=
"index"
>
<!-- 图片 -->
<image
:src=
"item.img"
:mode=
mode
style=
"height: 50%;width: 80%;"
@
click=
"toDetail"
></image>
<!--
类别
-->
<view
class=
"test1"
>
{{
item
.
category
}}
</view>
<!--
地点
-->
<view
class=
"test2"
>
{{
item
.
locations
}}
</view>
<image
:src=
"item.img"
:mode=
mode
style=
"height: 50%;width: 80%;"
@
click=
"toDetail
(item)
"
></image>
<!--
商铺
-->
<view
class=
"test1"
>
{{
item
.
name
}}
</view>
<!--
商圈
-->
<view
class=
"test2"
>
{{
location
}}
</view>
<!-- 位置 -->
<view
class=
"test1"
>
{{
item
.
position
}}
</view>
</view>
...
...
@@ -28,140 +35,196 @@
</
template
>
<
script
>
export
default
{
data
()
{
return
{
mode
:
'aspectFill'
,
keyword
:
''
,
current
:
0
,
newList
:
[
{
img
:
'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg'
,
category
:
'生活类'
,
locations
:
'天津复悦里'
,
position
:
'A1-A区'
}
],
img
:
'http://192.144.239.97:20043/file/banner/20230605/6F749760FE1148369C4081EBD3248C6C.jpeg'
,
list
:
[{
name
:
'A1'
},
{
name
:
'A2'
},
{
name
:
'A3'
},
{
name
:
'A4'
},
{
name
:
'A5'
},
{
name
:
'A6'
},
{
name
:
'A7'
},
{
name
:
'A8'
},
{
name
:
'A9'
},
{
name
:
'B1'
},
{
name
:
'B2'
},
{
name
:
'B3'
},
{
name
:
'B4'
},]
}
},
onShow
()
{
this
.
getFloor
()
},
methods
:
{
getFloor
(){
this
.
$u
.
get
(
'/shop/mobile/selectShopFloor'
).
then
(
res
=>
{
console
.
log
(
'res'
,
res
)
})
},
toDetail
(){
uni
.
navigateTo
({
url
:
'/homePage/shop/detail/index'
})
},
toSearch
(){
export
default
{
data
()
{
return
{
tenantId
:
''
,
floor
:
''
,
name
:
''
,
mode
:
'aspectFill'
,
keyword
:
''
,
current
:
0
,
location
:
''
,
newList
:
[],
list
:
[]
}
},
onShow
()
{
this
.
getFloor
()
},
methods
:
{
getFloor
()
{
let
list
=
[]
const
that
=
this
let
tenantId
=
''
let
floor
=
''
// let location = ''
uni
.
getStorage
({
key
:
'business'
,
success
:
function
(
res
)
{
console
.
log
(
'res'
,
res
);
that
.
$u
.
get
(
'/shop/mobile/selectShopFloor?tenantId='
+
res
.
data
.
id
).
then
(
lres
=>
{
console
.
log
(
'lres'
,
lres
);
tenantId
=
res
.
data
.
id
that
.
tenantId
=
res
.
data
.
id
that
.
location
=
res
.
data
.
name
that
.
floor
=
lres
[
0
]
for
(
const
index
in
lres
)
{
const
item
=
lres
[
index
]
let
obj
=
{
name
:
item
}
list
.
push
(
obj
)
}
console
.
log
(
'list'
,
list
)
that
.
list
=
list
const
baseApi
=
that
.
baseApi
;
that
.
$u
.
get
(
'/shop/mobile/selectShopList?tenantId='
+
tenantId
+
'&floor='
+
lres
[
0
]).
then
(
llres
=>
{
console
.
log
(
'llres'
,
llres
);
that
.
newList
=
llres
let
list
=
llres
;
for
(
const
index
in
list
)
{
const
item
=
list
[
index
];
item
.
img
=
baseApi
+
'/file/getImgStream?idFile='
+
item
.
img
item
.
position
=
item
.
floor
+
'-'
+
item
.
floorNumber
item
.
name
=
item
.
name
}
that
.
newList
=
list
})
})
}
})
},
toDetail
(
item
)
{
const
data
=
JSON
.
stringify
(
item
)
uni
.
navigateTo
({
url
:
'/homePage/shop/detail/index?location='
+
this
.
location
+
'&data='
+
encodeURIComponent
(
data
)
})
},
toSearch
()
{
console
.
log
(
'点击搜索框'
)
const
baseApi
=
this
.
baseApi
;
this
.
$u
.
get
(
'/shop/mobile/selectShopList?tenantId='
+
this
.
tenantId
+
'&floor='
+
this
.
floor
+
"&name="
+
this
.
name
)
.
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
let
list
=
res
;
for
(
const
index
in
list
)
{
const
item
=
list
[
index
];
item
.
img
=
baseApi
+
'/file/getImgStream?idFile='
+
item
.
img
item
.
position
=
item
.
floor
+
'-'
+
item
.
floorNumber
item
.
name
=
item
.
name
}
this
.
newList
=
list
})
},
change
(
index
)
{
this
.
current
=
index
;
console
.
log
(
'tenantId'
,
this
.
tenantId
)
console
.
log
(
'list'
,
this
.
list
[
index
])
const
baseApi
=
this
.
baseApi
;
this
.
$u
.
get
(
'/shop/mobile/selectShopList?tenantId='
+
this
.
tenantId
+
'&floor='
+
this
.
list
[
index
].
name
)
.
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
let
list
=
res
;
for
(
const
index
in
list
)
{
const
item
=
list
[
index
];
item
.
img
=
baseApi
+
'/file/getImgStream?idFile='
+
item
.
img
item
.
position
=
item
.
floor
+
'-'
+
item
.
floorNumber
item
.
name
=
item
.
name
}
this
.
newList
=
list
})
},
search
()
{
console
.
log
(
'点击搜索'
)
const
baseApi
=
this
.
baseApi
;
this
.
$u
.
get
(
'/shop/mobile/selectShopList?tenantId='
+
this
.
tenantId
+
'&floor='
+
this
.
floor
+
"&name="
+
this
.
name
)
.
then
(
res
=>
{
console
.
log
(
'res'
,
res
);
let
list
=
res
;
for
(
const
index
in
list
)
{
const
item
=
list
[
index
];
item
.
img
=
baseApi
+
'/file/getImgStream?idFile='
+
item
.
img
item
.
position
=
item
.
floor
+
'-'
+
item
.
floorNumber
item
.
name
=
item
.
name
}
this
.
newList
=
list
})
}
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.shop
{
background-color
:
#eeeeee
;
min-height
:
100vh
;
.u-search-box
{
padding
:
10rpx
30rpx
;
.u-search-inner
{
background-color
:
rgb
(
234
,
234
,
234
);
border-radius
:
100rpx
;
.shop
{
background-color
:
#eeeeee
;
min-height
:
100vh
;
.u-search-box
{
padding
:
10rpx
30rpx
;
display
:
flex
;
align-items
:
center
;
padding
:
10rpx
16rpx
;
}
.u-search-text
{
font-size
:
24rpx
;
color
:
$u-tips-color
;
margin-left
:
10rpx
;
}
}
.container
{
margin-left
:
4%
;
width
:
92%
;
height
:
6vh
;
border-radius
:
12px
12px
12px
12px
;
background-color
:
#fff
;
}
.gl-body
{
display
:
grid
;
grid-template-columns
:
auto
auto
;
grid-column-gap
:
40rpx
;
margin
:
30rpx
;
.list
{
margin-bottom
:
30rpx
;
width
:
100%
;
height
:
20vh
;
.test1
{
margin-top
:
10rpx
;
font-size
:
28rpx
;
font-family
:
Source
Han
Sans
CN-Medium
,
Source
Han
Sans
CN
;
font-weight
:
500
;
color
:
chocolate
;
.u-search-inner
{
background-color
:
rgb
(
234
,
234
,
234
);
border-radius
:
100rpx
;
display
:
flex
;
align-items
:
center
;
padding
:
10rpx
16rpx
;
}
.test2
{
margin-top
:
10rpx
;
font-size
:
36rpx
;
font-family
:
Source
Han
Sans
CN-Medium
,
Source
Han
Sans
CN
;
font-weight
:
700
;
.button
{
background-color
:
rgb
(
234
,
234
,
234
);
border-radius
:
100rpx
;
display
:
flex
;
align-items
:
center
;
padding
:
10rpx
16rpx
;
margin-left
:
20rpx
;
}
.u-search-text
{
font-size
:
24rpx
;
color
:
$u-tips-color
;
margin-left
:
10rpx
;
}
}
.container
{
margin-left
:
4%
;
width
:
92%
;
height
:
6vh
;
border-radius
:
12px
12px
12px
12px
;
background-color
:
#fff
;
}
.gl-body
{
display
:
grid
;
grid-template-columns
:
auto
auto
;
grid-column-gap
:
40rpx
;
margin
:
30rpx
;
.list
{
margin-bottom
:
30rpx
;
width
:
100%
;
height
:
20vh
;
.test1
{
margin-top
:
10rpx
;
font-size
:
28rpx
;
font-family
:
Source
Han
Sans
CN-Medium
,
Source
Han
Sans
CN
;
font-weight
:
500
;
color
:
chocolate
;
}
.test2
{
margin-top
:
10rpx
;
font-size
:
36rpx
;
font-family
:
Source
Han
Sans
CN-Medium
,
Source
Han
Sans
CN
;
font-weight
:
700
;
}
}
}
}
}
</
style
>
\ No newline at end of file
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