Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
groupPurchase-miniapp
Project
Project
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
彭佳妮(贵阳日报)
groupPurchase-miniapp
Commits
2e320459
Commit
2e320459
authored
Aug 01, 2024
by
陈宗胤(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商家列表
parent
6f8cab2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
8 deletions
+61
-8
FoodDetails.vue
src/Components/index/FoodDetails.vue
+2
-4
foodClassification.vue
src/pages/index/foodClassification.vue
+28
-3
index.vue
src/pages/index/index.vue
+3
-0
listFood.vue
src/pages/index/listFood.vue
+28
-1
No files found.
src/Components/index/FoodDetails.vue
View file @
2e320459
...
...
@@ -14,14 +14,12 @@
<text
class=
"one-text"
>
“
{{
item
.
evaluationVos
[
0
].
evaluation
}}
”
</text>
</view>
<view
class=
"labelBox"
>
<view>
卤味爱好者最佳选择
</view>
<view>
免费wifi
</view>
<view>
服务态度很好
</view>
<view
v-for=
"(item, index) in item.labels"
:key=
"index"
>
{{
item
}}
</view>
</view>
<view
class=
"groupPurchasePrice"
>
<image
class=
"img"
src=
"../../static/index/groupBuying.png"
mode=
"widthFix"
/>
<text
class=
"one-text"
>
¥19
</text>
<
view
class=
"two-text"
>
7.8折
</view
>
<
!--
<view
class=
"two-text"
>
7.8折
</view>
--
>
<text
class=
"three-text"
>
¥29.8
</text>
<text
class=
"four-text"
>
深夜加班续命套餐
</text>
</view>
...
...
src/pages/index/foodClassification.vue
View file @
2e320459
...
...
@@ -87,7 +87,7 @@ import Search from '../../components/index/Search.vue';
import
Classification
from
'../../components/index/Classification.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Sort
from
'../../components/index/Sort.vue'
;
import
{
getByParentId
}
from
'../../api/index'
;
import
{
getByParentId
,
merchantList
}
from
'../../api/index'
;
const
business
=
reactive
([
'优选商家'
,
'超值半价'
,
'今日可订'
,
'经典单人'
]);
const
active
=
ref
(
null
);
...
...
@@ -98,7 +98,9 @@ onLoad((option) => {
const
{
parentId
}
=
option
;
query
(
parentId
);
});
onMounted
(()
=>
{
getMerchantList
();
});
// 根据父级分类id查询子分类列表
const
query
=
(
parentId
)
=>
{
getByParentId
(
parentId
).
then
((
res
)
=>
{
...
...
@@ -113,7 +115,7 @@ const query = (parentId) => {
const
choice
=
(
index
)
=>
{
active
.
value
=
index
;
};
const
cardData
=
re
active
([
const
cardData
=
re
f
([
{
text
:
'测试'
,
},
...
...
@@ -144,6 +146,29 @@ const locationFiltering = (index) => {
break
;
}
};
// 商家列表分页-搜索列表
const
getMerchantList
=
()
=>
{
const
data
=
{
current
:
1
,
size
:
10
,
lon
:
106.68650025025502
,
lat
:
26.567192352601154
,
};
merchantList
(
data
).
then
((
res
)
=>
{
console
.
log
(
'商家列表'
,
res
);
res
.
data
.
content
.
forEach
((
item
)
=>
{
item
.
shopLogo
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
shopLogo
;
if
(
item
.
evaluationVos
.
length
>
0
)
{
item
.
evaluationVos
[
0
].
avatar
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
evaluationVos
[
0
].
avatar
;
}
if
(
item
.
labels
)
{
item
.
labels
=
item
.
labels
.
split
(
','
);
}
});
cardData
.
value
=
res
.
data
.
content
;
});
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/pages/index/index.vue
View file @
2e320459
...
...
@@ -274,6 +274,9 @@ const getMerchantList = () => {
item
.
evaluationVos
[
0
].
avatar
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
evaluationVos
[
0
].
avatar
;
}
if
(
item
.
labels
)
{
item
.
labels
=
item
.
labels
.
split
(
','
);
}
});
cardData
.
value
=
res
.
data
.
content
.
slice
(
0
,
2
);
cardData1
.
value
=
res
.
data
.
content
.
slice
(
2
,
4
);
...
...
src/pages/index/listFood.vue
View file @
2e320459
...
...
@@ -63,7 +63,11 @@ import FoodDetails from '../../components/index/FoodDetails.vue';
import
Classification
from
'../../components/index/Classification.vue'
;
import
Position
from
'../../components/index/Position.vue'
;
import
Sort
from
'../../components/index/Sort.vue'
;
import
{
merchantList
}
from
'../../api/index'
;
onMounted
(()
=>
{
getMerchantList
();
});
const
business
=
reactive
([
'优选商家'
,
'超值半价'
,
'今日可订'
,
'经典单人'
]);
const
active
=
ref
(
null
);
...
...
@@ -75,10 +79,33 @@ const back = () => {
delta
:
1
,
});
};
// 商家列表分页-搜索列表
const
getMerchantList
=
()
=>
{
const
data
=
{
current
:
1
,
size
:
10
,
lon
:
106.68650025025502
,
lat
:
26.567192352601154
,
};
merchantList
(
data
).
then
((
res
)
=>
{
console
.
log
(
'商家列表'
,
res
);
res
.
data
.
content
.
forEach
((
item
)
=>
{
item
.
shopLogo
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
shopLogo
;
if
(
item
.
evaluationVos
.
length
>
0
)
{
item
.
evaluationVos
[
0
].
avatar
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
evaluationVos
[
0
].
avatar
;
}
if
(
item
.
labels
)
{
item
.
labels
=
item
.
labels
.
split
(
','
);
}
});
cardData
.
value
=
res
.
data
.
content
;
});
};
const
choice
=
(
index
)
=>
{
active
.
value
=
index
;
};
const
cardData
=
re
active
([
const
cardData
=
re
f
([
{
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