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
fe727bf0
Commit
fe727bf0
authored
Aug 10, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车数量
parent
68cd7bc8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
building.vue
src/pages/assistingAgriculture/index/building.vue
+15
-3
presale.vue
src/pages/assistingAgriculture/index/presale.vue
+15
-1
No files found.
src/pages/assistingAgriculture/index/building.vue
View file @
fe727bf0
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
</view>
</view>
<!-- 购物车悬浮按钮 -->
<!-- 购物车悬浮按钮 -->
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<wd-badge
modelValue=
"4
"
>
<wd-badge
:modelValue=
"subscript
"
>
<img
<img
class=
"shop-car"
class=
"shop-car"
src=
"/static/assistingAgriculture/presale/cart.png"
src=
"/static/assistingAgriculture/presale/cart.png"
...
@@ -136,7 +136,8 @@ import {
...
@@ -136,7 +136,8 @@ import {
getGoodSaleProdList
,
getGoodSaleProdList
,
getPlatformProdList
,
getPlatformProdList
,
}
from
'../../../api/assistingAgriculture/building'
;
}
from
'../../../api/assistingAgriculture/building'
;
import
{
onMounted
}
from
'vue'
;
import
{
getshoppingCartList
}
from
'@/api/packageDetail'
;
import
{
onMounted
,
ref
}
from
'vue'
;
import
{
useRoute
}
from
'vue-router'
;
import
{
useRoute
}
from
'vue-router'
;
const
current
=
ref
(
0
);
const
current
=
ref
(
0
);
...
@@ -144,6 +145,7 @@ const rightList = ref([]);
...
@@ -144,6 +145,7 @@ const rightList = ref([]);
const
light
=
ref
(
0
);
const
light
=
ref
(
0
);
const
hotImgList
=
ref
([]);
const
hotImgList
=
ref
([]);
const
testData
=
ref
([]);
const
testData
=
ref
([]);
const
subscript
=
ref
(
0
);
let
sortData
;
let
sortData
;
// 轮播图
// 轮播图
const
swiperList
=
ref
([
const
swiperList
=
ref
([
...
@@ -169,8 +171,18 @@ const filteredProdList = ref([]);
...
@@ -169,8 +171,18 @@ const filteredProdList = ref([]);
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getGoodSaleProd
();
getGoodSaleProd
();
platformProdList
();
platformProdList
();
getshoppingCartListFn
();
});
});
// 获取购物车列表
const
getshoppingCartListFn
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
// 累加prodInfos长度
const
totalLength
=
res
.
data
.
reduce
((
accumulator
,
current
)
=>
{
return
accumulator
+
(
current
.
prodInfos
?
current
.
prodInfos
.
length
:
0
);
},
0
);
subscript
.
value
=
totalLength
;
});
};
// 好货热卖
// 好货热卖
const
getGoodSaleProd
=
()
=>
{
const
getGoodSaleProd
=
()
=>
{
getGoodSaleProdList
(
params
).
then
((
res
)
=>
{
getGoodSaleProdList
(
params
).
then
((
res
)
=>
{
...
...
src/pages/assistingAgriculture/index/presale.vue
View file @
fe727bf0
...
@@ -113,7 +113,7 @@
...
@@ -113,7 +113,7 @@
</view>
</view>
<!-- 购物车悬浮按钮 -->
<!-- 购物车悬浮按钮 -->
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<view
class=
"cart-floating"
@
tap=
"toCart"
>
<wd-badge
modelValue=
"4
"
>
<wd-badge
:modelValue=
"subscript
"
>
<img
<img
class=
"shop-car"
class=
"shop-car"
src=
"/static/assistingAgriculture/presale/cart.png"
src=
"/static/assistingAgriculture/presale/cart.png"
...
@@ -133,6 +133,8 @@ import {
...
@@ -133,6 +133,8 @@ import {
getPresaleProdList
,
getPresaleProdList
,
getStrictSelection
,
getStrictSelection
,
}
from
'../../../api/assistingAgriculture/building'
;
}
from
'../../../api/assistingAgriculture/building'
;
import
{
getshoppingCartList
}
from
'@/api/packageDetail'
;
const
swiperList
=
ref
([]);
const
swiperList
=
ref
([]);
const
current
=
ref
(
0
);
const
current
=
ref
(
0
);
// 轮播图数据
// 轮播图数据
...
@@ -149,11 +151,23 @@ const params = {
...
@@ -149,11 +151,23 @@ const params = {
size
:
10
,
size
:
10
,
categoryId
:
router
.
query
.
categoryId
,
categoryId
:
router
.
query
.
categoryId
,
};
};
const
subscript
=
ref
(
0
);
const
tabsList
=
ref
([]);
const
tabsList
=
ref
([]);
onMounted
(
async
()
=>
{
onMounted
(
async
()
=>
{
getPresale
();
getPresale
();
presaleSortList
();
presaleSortList
();
getshoppingCartListFn
();
});
});
// 获取购物车列表
const
getshoppingCartListFn
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
// 累加prodInfos长度
const
totalLength
=
res
.
data
.
reduce
((
accumulator
,
current
)
=>
{
return
accumulator
+
(
current
.
prodInfos
?
current
.
prodInfos
.
length
:
0
);
},
0
);
subscript
.
value
=
totalLength
;
});
};
// 预售板块轮播图
// 预售板块轮播图
const
getPresale
=
()
=>
{
const
getPresale
=
()
=>
{
getPresaleList
({
place
:
'presale'
}).
then
((
res
)
=>
{
getPresaleList
({
place
:
'presale'
}).
then
((
res
)
=>
{
...
...
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