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
42a04927
Commit
42a04927
authored
Aug 08, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口联调
parent
b0411422
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
108 additions
and
85 deletions
+108
-85
pages.json
src/pages.json
+1
-2
building.vue
src/pages/assistingAgriculture/index/building.vue
+64
-54
index.vue
src/pages/assistingAgriculture/index/index.vue
+7
-3
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+36
-26
culture.png
src/static/assistingAgriculture/assets/culture.png
+0
-0
bacImg.png
src/static/assistingAgriculture/preSale/bacImg.png
+0
-0
img.png
src/static/assistingAgriculture/preSale/img.png
+0
-0
img2.png
src/static/assistingAgriculture/preSale/img2.png
+0
-0
img3.png
src/static/assistingAgriculture/preSale/img3.png
+0
-0
img4.png
src/static/assistingAgriculture/preSale/img4.png
+0
-0
img5.png
src/static/assistingAgriculture/preSale/img5.png
+0
-0
No files found.
src/pages.json
View file @
42a04927
...
...
@@ -256,4 +256,4 @@
"globalStyle"
:
{
"navigationStyle"
:
"custom"
}
}
\ No newline at end of file
}
src/pages/assistingAgriculture/index/building.vue
View file @
42a04927
...
...
@@ -27,15 +27,28 @@
src=
"/static/assistingAgriculture/assets/culture.png"
style=
"width: 366rpx; height: 362rpx"
/>
<view>
<view
v-for=
"(item, index) in rightList"
:key=
"index"
@
click=
"toPresale(item.categoryId)"
>
<img
class=
"right-sort"
:src=
"item.icon"
style=
"width: 336rpx; height: 176rpx; margin-left: 8rpx"
/>
</view>
<view
class=
"right-img"
>
<img
class=
"delicacy"
src=
"/static/assistingAgriculture/assets/delicacy.png"
style=
"height: 176rpx; margin-left: 8rpx"
/>
<img
@
tap=
"toPresale"
class=
"fresh"
src=
"/static/assistingAgriculture/assets/fresh.png"
style=
"height: 176rpx; margin-left: 8rpx"
/>
</view>
<!--
<view>
-->
<!--
<view
v-for=
"(item, index) in rightList"
:key=
"index"
@
click=
"toPresale(item.categoryId)"
>
-->
<!--
<img-->
<!-- class="right-sort"-->
<!-- :src="item.icon"-->
<!-- style="width: 336rpx; height: 176rpx; margin-left: 8rpx"-->
<!-- />-->
<!--
</view>
-->
<!--
</view>
-->
</view>
</view>
<!-- 好货热卖-->
...
...
@@ -50,24 +63,15 @@
color=
"#ABAAAA"
style=
"position: relative; float: right; top: -42rpx"
></wd-icon>
<img
@
tap=
"toDetail"
class=
"rice"
src=
"/static/assistingAgriculture/assets/rice.png"
style=
"width: 670rpx; height: 236rpx"
/>
<img
@
tap=
"toDetail"
class=
"potato"
src=
"/static/assistingAgriculture/assets/potato.png"
style=
"width: 650rpx; height: 236rpx; margin-left: 20rpx; margin-top: -20rpx"
/>
<view
class=
"hot-img"
v-for=
"(item, index) in hotImgList"
:key=
"index"
>
<img
class=
"rice"
@
tap=
"toDetail"
:src=
"item.img"
style=
"width: 670rpx; height: 236rpx"
/>
</view>
</view>
<!-- tabs-->
<scroll-view
class=
"tabs"
show-scrollbar=
"false"
scroll-x
:scroll-with-animation=
"true"
>
<text
@
tap=
"choice(index, item
.categoryId
)"
v-for=
"(item, index) in
tabs
List"
@
tap=
"choice(index, item)"
v-for=
"(item, index) in
detail
List"
:key=
"index"
class=
"text"
:class=
"light === index ? 'light' : ''"
...
...
@@ -82,10 +86,10 @@
src=
"/static/assistingAgriculture/assets/fruit4.png"
style=
"width: 670rpx; height: 236rpx"
/>
<view
class=
"sort-list"
>
<view
class=
"sort-img"
v-for=
"(item, index) in
detailList
"
:key=
"index"
>
<img
@
tap=
"toDetail"
:src=
"item.img"
style=
"width: 330rpx; height: 330rpx"
/>
<view
class=
"detail-title"
>
{{
item
.
tex
t
}}
</view>
<view>
<view
class=
"sort-img"
v-for=
"(item, index) in
testData
"
:key=
"index"
>
<img
@
tap=
"toDetail"
:src=
"item.img
Url
"
style=
"width: 330rpx; height: 330rpx"
/>
<view
class=
"detail-title"
>
{{
item
.
conten
t
}}
</view>
<view
class=
"price-page"
>
<text
class=
"price"
>
¥
{{
item
.
price
}}
</text>
</view>
...
...
@@ -115,13 +119,16 @@ import Search from '../../../components/assistingAgriculture/index/Search.vue';
import
{
getGoodSaleProdList
,
getPlatformProdList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
import
{
onMounted
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
const
current
=
ref
(
0
);
const
rightList
=
ref
([]);
const
light
=
ref
(
0
);
const
hotImgList
=
ref
([]);
const
testData
=
ref
([]);
let
sortData
;
// 轮播图
const
swiperList
=
ref
([
'../../../static/assistingAgriculture/assets/village.png'
,
...
...
@@ -129,19 +136,7 @@ const swiperList = ref([
'../../../static/assistingAgriculture/assets/village.png'
,
]);
// 分类列表数据
const
detailList
=
ref
([
{
img
:
'/static/assistingAgriculture/assets/fruit.png'
,
price
:
'2555'
,
text
:
'这是草莓这是草莓'
},
{
img
:
'/static/assistingAgriculture/assets/fruit1.png'
,
price
:
'2555'
,
text
:
'这是草莓这是草莓'
,
},
{
img
:
'/static/assistingAgriculture/assets/fruit2.png'
,
price
:
'2555'
,
text
:
'麻辣鱼豆腐'
},
{
img
:
'/static/assistingAgriculture/assets/fruit3.png'
,
price
:
'2555'
,
text
:
'麻辣鱼豆腐'
},
]);
const
choice
=
(
index
)
=>
{
light
.
value
=
index
;
};
const
detailList
=
ref
([]);
const
params
=
{
current
:
1
,
size
:
10
,
...
...
@@ -152,35 +147,44 @@ const params1 = {
size
:
10
,
categoryId
:
router
.
query
.
categoryId
,
};
const
filteredProdList
=
ref
([]);
onMounted
(
async
()
=>
{
getStrictSelectionList
();
getGoodSaleProd
();
platformProdList
();
});
// 筑农严选分类
const
getStrictSelectionList
=
()
=>
{
getStrictSelection
().
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
)
=>
{
item
.
icon
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
rightList
.
value
=
res
.
data
.
splice
(
0
,
2
);
});
};
// 好货热卖
const
getGoodSaleProd
=
()
=>
{
getGoodSaleProdList
(
params
).
then
((
res
)
=>
{});
getGoodSaleProdList
(
params
).
then
((
res
)
=>
{
res
.
data
.
records
.
forEach
((
item
)
=>
{
item
.
img
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
hotImgList
.
value
=
res
.
data
.
records
.
slice
(
0
,
2
);
});
};
// 筑农严选首页-分类查询商品列表
const
platformProdList
=
()
=>
{
getPlatformProdList
(
params1
).
then
((
res
)
=>
{});
getPlatformProdList
({
categoryId
:
router
.
query
.
categoryId
}).
then
((
res
)
=>
{
detailList
.
value
=
res
.
data
;
});
};
const
choice
=
(
index
,
item
)
=>
{
console
.
log
(
item
.
categoryId
,
index
,
222
);
testData
.
value
=
detailList
.
value
[
index
].
prodList
;
testData
.
value
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
console
.
log
(
testData
.
value
,
323
);
light
.
value
=
index
;
};
// 跳转预售
const
toPresale
=
(
id
)
=>
{
const
toPresale
=
()
=>
{
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/index/presale?categoryId=
${
id
}
`
,
url
:
`/pages/assistingAgriculture/index/presale?categoryId=
3273
`
,
});
};
function
handleClick
(
e
)
{
console
.
log
(
e
);
}
...
...
@@ -423,4 +427,10 @@ page {
height
:
100%
;
background-color
:
lightgreen
;
}
img
.rice
{
border-radius
:
16rpx
16rpx
16rpx
16rpx
;
margin-left
:
20rpx
;
margin-top
:
-40rpx
;
padding-bottom
:
40rpx
;
}
</
style
>
src/pages/assistingAgriculture/index/index.vue
View file @
42a04927
...
...
@@ -32,12 +32,17 @@
</view>
</view>
</view>
<view
class=
"product-page"
v-for=
"(item, index) in list"
:key=
"index"
>
<view
class=
"product-page"
v-for=
"(item, index) in list"
:key=
"index"
@
click=
"toDetail"
>
<view>
<view
class=
"page-title"
>
{{
item
.
categoryName
}}
</view>
<img
:src=
"item.img"
class=
"main-img"
/>
<view
style=
"display: flex; flex-direction: row"
>
<view
class=
"detail-border"
v-for=
"(item, index) in item.commodityList"
:key=
"index"
>
<view
class=
"detail-border"
v-for=
"(item, index) in item.commodityList"
:key=
"index"
@
click=
"toDetail"
>
<img
:src=
"item.commodityImg"
style=
"width: 216rpx; height: 176rpx"
/>
<view
class=
"detail-title"
>
{{
item
.
prodName
}}
</view>
<view
class=
"jiage-page"
>
...
...
@@ -89,7 +94,6 @@ onMounted(async () => {
getList
();
getPresaleCategoryList
();
getPresale
();
platformProdList
();
});
// 获取筑农专区分类;
const
getList
=
()
=>
{
...
...
src/pages/assistingAgriculture/index/presale.vue
View file @
42a04927
...
...
@@ -22,9 +22,9 @@
</view>
<view
class=
"sort"
>
<view
style=
"display: flex; flex-direction: row"
>
<view
class=
"borderClass"
@
tap=
"to
Presale
"
v-for=
"(item, index) in sortList"
:key=
"index"
>
<img
:src=
"item.img"
style=
"width: 48rpx; height: 48rpx"
/>
<view
class=
"sort-text"
>
{{
item
.
text
}}
</view>
<view
class=
"borderClass"
@
tap=
"to
Tab(item)
"
v-for=
"(item, index) in sortList"
:key=
"index"
>
<img
:src=
"item.img
Url
"
style=
"width: 48rpx; height: 48rpx"
/>
<view
class=
"sort-text"
>
{{
item
.
categoryName
}}
</view>
</view>
</view>
</view>
...
...
@@ -38,7 +38,7 @@
class=
"text"
:class=
"light === index ? 'light' : ''"
>
{{
item
.
text
}}
{{
item
.
categoryName
}}
</text>
</scroll-view>
</view>
...
...
@@ -149,30 +149,16 @@ import {
categoryPresaleList
,
getPresaleList
,
getPresaleProdList
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
// 轮播图数据
let
lunboData
;
let
sortData
;
const
light
=
ref
(
0
);
const
sortList
=
ref
([
{
img
:
'/static/assistingAgriculture/presale/bacImg.png'
,
price
:
'25'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/img2.png'
,
price
:
'25'
,
text
:
'猪肉蛋禽'
},
{
img
:
'/static/assistingAgriculture/presale/img3.png'
,
price
:
'25'
,
text
:
'米面粮油'
},
{
img
:
'/static/assistingAgriculture/presale/img4.png'
,
price
:
'25'
,
text
:
'预选蔬菜'
},
{
img
:
'/static/assistingAgriculture/presale/img5.png'
,
price
:
'25'
,
text
:
'心选水果'
},
]);
const
tabsData
=
ref
([
{
img
:
'/static/assistingAgriculture/assets/mainPicture.png'
,
text
:
'全部'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类1'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类2'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类3'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类4'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类5'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类6'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类7'
},
{
img
:
'/static/assistingAgriculture/assets/presale.png'
,
text
:
'分类8'
},
]);
const
sortList
=
ref
([]);
const
tabsData
=
ref
([]);
const
buyList
=
ref
([
{
img
:
'/static/assistingAgriculture/presale/buy.png'
,
price
:
'29.9'
,
text
:
'应季好物'
},
{
img
:
'/static/assistingAgriculture/presale/buy.png'
,
price
:
'29.9'
,
text
:
'猪肉蛋禽'
},
...
...
@@ -244,6 +230,8 @@ onMounted(async () => {
getPresale
();
getPresaleProd
();
presaleSortList
();
getStrictSelectionList
();
// toTab(item.categoryId);
});
// 预售板块轮播图
const
getPresale
=
()
=>
{
...
...
@@ -260,15 +248,34 @@ const getPresale = () => {
};
// 筑农预售分类
const
presaleSortList
=
()
=>
{
categoryPresaleList
({
level
:
1
}).
then
((
res
)
=>
{
console
.
log
(
res
,
111
);
tabsList
.
value
=
res
.
data
;
categoryPresaleList
().
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
sortData
=
res
.
data
;
sortList
.
value
=
res
.
data
.
map
((
item
)
=>
{
return
item
.
imgUrl
;
});
console
.
log
(
res
.
data
,
111
);
sortList
.
value
=
res
.
data
;
});
};
// 筑农预售子分类
const
getStrictSelectionList
=
()
=>
{
getStrictSelection
({
parentId
:
'3287'
}).
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
)
=>
{
item
.
imgUrl
=
import
.
meta
.
env
.
VITE_APP_IMG_URL
+
item
.
pic
;
});
tabsData
.
value
=
res
.
data
;
});
};
// 筑农首页-分类查询商品列表
const
getPresaleProd
=
()
=>
{
getPresaleProdList
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
,
222
);
// res.data.forEach((item) => {
// item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
// });
// tabsData.value = res.data;
});
};
// 左侧数据列表
...
...
@@ -310,6 +317,9 @@ function toDetail() {
url
:
'/pages/assistingAgriculture/detail/detail'
,
});
}
function
toTab
(
item
)
{
console
.
log
(
item
,
222
);
}
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
src/static/assistingAgriculture/assets/culture.png
View replaced file @
b0411422
View file @
42a04927
56.1 KB
|
W:
|
H:
185 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/static/assistingAgriculture/preSale/bacImg.png
deleted
100644 → 0
View file @
b0411422
4.78 KB
src/static/assistingAgriculture/preSale/img.png
deleted
100644 → 0
View file @
b0411422
473 KB
src/static/assistingAgriculture/preSale/img2.png
deleted
100644 → 0
View file @
b0411422
3.13 KB
src/static/assistingAgriculture/preSale/img3.png
deleted
100644 → 0
View file @
b0411422
3.32 KB
src/static/assistingAgriculture/preSale/img4.png
deleted
100644 → 0
View file @
b0411422
4.78 KB
src/static/assistingAgriculture/preSale/img5.png
deleted
100644 → 0
View file @
b0411422
3.2 KB
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