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
9f1da310
Commit
9f1da310
authored
Aug 07, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页预售页面轮播图获取数据
parent
aaeb1eaf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
64 deletions
+87
-64
building.js
src/api/assistingAgriculture/building.js
+28
-10
building.vue
src/pages/assistingAgriculture/index/building.vue
+1
-1
index.vue
src/pages/assistingAgriculture/index/index.vue
+43
-33
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+15
-20
No files found.
src/api/assistingAgriculture/building.js
View file @
9f1da310
import
{
request
}
from
'../../utils/request'
;
//
获取指定类型轮播图
//
筑农专区分类
export
function
getSortList
(
data
)
{
return
request
({
url
:
`/sgyrdd/category/znList`
,
...
...
@@ -9,6 +9,24 @@ export function getSortList(data) {
});
}
// 预售板块轮播图
export
function
getPresaleList
(
data
)
{
return
request
({
url
:
`/sgyrdd/carousel/presaleList`
,
method
:
'GET'
,
data
,
});
}
// 筑农严选分类
export
function
getStrictSelection
(
data
)
{
return
request
({
url
:
`/sgyrdd/category/getZnyx`
,
method
:
'GET'
,
data
,
});
}
// 筑农严选首页-分类预售商品列表
export
function
getPresaleCategory
(
data
)
{
return
request
({
...
...
@@ -18,28 +36,28 @@ export function getPresaleCategory(data) {
});
}
//
预售板块轮播图
export
function
get
Presale
List
(
data
)
{
//
筑农严选首页-好货特卖商品列表
export
function
get
GoodSaleProd
List
(
data
)
{
return
request
({
url
:
`/sgyrdd/
carousel/presale
List`
,
url
:
`/sgyrdd/
znprod/getGoodSaleProd
List`
,
method
:
'GET'
,
data
,
});
}
// 筑农严选
分类
export
function
get
StrictSelection
(
data
)
{
// 筑农严选
首页-分类查询商品列表
export
function
get
PlatformProdList
(
data
)
{
return
request
({
url
:
`/sgyrdd/
category/getZnyx
`
,
url
:
`/sgyrdd/
znprod/getPlatformProdList
`
,
method
:
'GET'
,
data
,
});
}
// 筑农
预售分类
export
function
get
BuindingSor
t
(
data
)
{
// 筑农
首页-分类查询商品列表
export
function
get
PresaleProdLis
t
(
data
)
{
return
request
({
url
:
`/sgyrdd/
category/presale
List`
,
url
:
`/sgyrdd/
znprod/getPresaleProd
List`
,
method
:
'GET'
,
data
,
});
...
...
src/pages/assistingAgriculture/index/building.vue
View file @
9f1da310
...
...
@@ -46,7 +46,7 @@
<view
class=
"hot-sale"
>
<view
class=
"top-title"
>
<text
class=
"left-title"
>
好货热卖
</text>
<text
class=
"right-title"
>
更多
</text>
<text
class=
"right-title"
@
tap=
"toPresale"
>
更多
</text>
</view>
<wd-icon
name=
"arrow-right"
...
...
src/pages/assistingAgriculture/index/index.vue
View file @
9f1da310
...
...
@@ -8,21 +8,16 @@
placeholderText=
"请输入要搜索的内容"
></Search>
<view>
<img
class=
"img1"
src=
"/static/assistingAgriculture/assets/bacImg.png"
style=
"width: 750rpx; height: 440rpx"
/>
<img
class=
"img2"
src=
"/static/assistingAgriculture/assets/bottom.png"
style=
"width: 750rpx; height: 32rpx"
/>
<img
class=
"img3"
src=
"/static/assistingAgriculture/assets/right.png"
style=
"width: 288rpx; height: 124rpx"
/>
<wd-swiper
:list=
"swiperList"
autoplay
v-model:current=
"current"
@
click=
"handleClick"
@
change=
"onChange"
customClass=
"guiyang"
height=
"220"
imageMode=
"aspectFill"
></wd-swiper>
</view>
<view
class=
"sort"
>
<view
style=
"display: flex; flex-direction: row"
>
...
...
@@ -62,11 +57,19 @@
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
{
getPresaleCategory
,
getPresaleList
,
getSortList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
import
{
onMounted
}
from
'vue'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
groupImgList
}
from
'@/api'
;
const
list
=
ref
([]);
const
sortList
=
ref
([]);
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
// 轮播图数据
let
lunboData
;
const
detailList
=
ref
([
{
img
:
'/static/assistingAgriculture/assets/detailedMapOne.png'
,
...
...
@@ -84,11 +87,11 @@ const detailList = ref([
text
:
'麻辣鱼豆腐'
,
},
]);
const
sortList
=
ref
([]);
onMounted
(
async
()
=>
{
getList
();
getPresaleCategoryList
();
getStrictSelectionList
();
getPresale
();
});
// 获取筑农专区分类;
const
getList
=
()
=>
{
...
...
@@ -107,7 +110,6 @@ const getPresaleCategoryList = () => {
item
.
commodityList
=
item
.
prodSimples
;
item
.
commodityList
.
forEach
((
item
)
=>
{
item
.
commodityImg
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
console
.
log
(
item
.
commodityImg
,
111
);
});
});
list
.
value
=
res
.
data
;
...
...
@@ -115,23 +117,40 @@ const getPresaleCategoryList = () => {
};
// 筑农严选分类
const
getStrictSelectionList
=
()
=>
{
getStrictSelection
().
then
((
res
)
=>
{
console
.
log
(
res
,
333
);
getStrictSelection
().
then
((
res
)
=>
{});
};
// 预售板块轮播图
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
'index_top'
}).
then
((
res
)
=>
{
console
.
log
(
res
,
111
);
res
.
data
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
imgUrl
;
});
lunboData
=
res
.
data
;
swiperList
.
value
=
res
.
data
.
map
((
item
)
=>
{
return
item
.
imgUrl
;
});
});
};
const
onChange
=
(
e
)
=>
{
// console.log(e);
};
function
toBuilding
(
index
)
{
if
(
index
===
0
)
{
// TODO: 跳转到筑农严选
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/index/building'
,
});
}
else
if
(
index
===
1
)
{
console
.
log
(
111
);
}
else
if
(
index
===
2
)
{
// TODO: 跳转到乡村旅居
xma
.
navigateTo
({
url
:
'/pages/assistingAgriculture/RuralTravel/RuralTravel'
,
});
}
else
if
(
index
===
3
)
{
console
.
log
(
222
);
}
console
.
log
(
index
,
121
);
}
// 跳转详情页
function
toDetail
()
{
...
...
@@ -157,15 +176,6 @@ page {
.img1
{
display
:
flex
;
}
.img2
{
display
:
flex
;
margin-top
:
-31rpx
;
}
.img3
{
display
:
flex
;
margin-top
:
-120rpx
;
margin-left
:
462rpx
;
}
.bottom-image
{
position
:
relative
;
top
:
-40rpx
;
...
...
@@ -273,8 +283,8 @@ page {
color
:
#fa5151
;
}
::v-deep
.icon
{
width
:
40rpx
;
height
:
40rpx
;
margin-left
:
40rpx
;
width
:
40
rpx
;
height
:
40
rpx
;
margin-left
:
40
rpx
;
}
</
style
>
src/pages/assistingAgriculture/index/presale.vue
View file @
9f1da310
...
...
@@ -10,13 +10,14 @@
</view>
<view
class=
"nav"
>
<wd-swiper
class=
"main-img"
:list=
"swiperList"
autoplay
v-model:current=
"current"
@
click=
"handleClick"
@
change=
"onChange"
height=
"188"
customClass=
"guiyang"
height=
"220"
imageMode=
"aspectFill"
></wd-swiper>
</view>
<view
class=
"sort"
>
...
...
@@ -143,12 +144,11 @@
<
script
setup
>
import
Search
from
'../../../components/assistingAgriculture/index/Search.vue'
;
import
{
ref
,
onMounted
}
from
'vue'
;
import
{
getBuindingSort
,
getPresaleList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
import
{
getPresaleList
}
from
'../../../api/assistingAgriculture/building'
;
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
// 轮播图数据
let
lunboData
;
const
light
=
ref
(
0
);
const
sortList
=
ref
([
{
img
:
'/static/assistingAgriculture/presale/bacImg.png'
,
price
:
'25'
,
text
:
'应季好物'
},
...
...
@@ -157,11 +157,6 @@ const sortList = ref([
{
img
:
'/static/assistingAgriculture/presale/img4.png'
,
price
:
'25'
,
text
:
'预选蔬菜'
},
{
img
:
'/static/assistingAgriculture/presale/img5.png'
,
price
:
'25'
,
text
:
'心选水果'
},
]);
const
swiperList
=
ref
([
'../../../static/assistingAgriculture/presale/img.png'
,
'../../../static/assistingAgriculture/presale/img.png'
,
'../../../static/assistingAgriculture/presale/img.png'
,
]);
const
tabsData
=
ref
([
{
img
:
'/static/assistingAgriculture/assets/mainPicture.png'
,
text
:
'全部'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类1'
},
...
...
@@ -235,18 +230,18 @@ const goodList = ref([
]);
onMounted
(
async
()
=>
{
getPresale
();
getBuindingSortList
();
});
// 预售板块轮播图
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
3
}).
then
((
res
)
=>
{
getPresaleList
({
place
:
'presale'
}).
then
((
res
)
=>
{
console
.
log
(
res
,
111
);
});
};
// 筑农预售分类
const
getBuindingSortList
=
()
=>
{
getBuindingSort
({
level
:
3
}).
then
((
res
)
=>
{
console
.
log
(
res
,
222
);
res
.
data
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
imgUrl
;
});
lunboData
=
res
.
data
;
swiperList
.
value
=
res
.
data
.
map
((
item
)
=>
{
return
item
.
imgUrl
;
});
});
};
// 左侧数据列表
...
...
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