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
237b9070
Commit
237b9070
authored
Aug 09, 2024
by
陈宗胤(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
5e87a55c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
packageDetail.js
src/api/packageDetail.js
+10
-0
detail.vue
src/pages/assistingAgriculture/detail/detail.vue
+21
-5
No files found.
src/api/packageDetail.js
View file @
237b9070
...
...
@@ -23,6 +23,16 @@ export function addOrder(data) {
data
,
});
}
// 获取购物车列表
export
function
getshoppingCartList
(
data
)
{
return
request
({
url
:
`/sgyrdd/sgyBasket/list`
,
method
:
'GET'
,
data
,
});
}
// 套餐详情
export
function
getCollect
(
data
)
{
return
request
({
...
...
src/pages/assistingAgriculture/detail/detail.vue
View file @
237b9070
...
...
@@ -69,7 +69,7 @@
<view
class=
"sort-text"
>
客服
</view>
</view>
-->
<view
class=
"borderClass"
@
tap=
"toCart"
>
<wd-badge
modelValue=
"4
"
>
<wd-badge
:modelValue=
"subscript
"
>
<img
src=
"/static/assistingAgriculture/detail/car.png"
style=
"width: 40rpx; height: 40rpx"
...
...
@@ -104,6 +104,7 @@ import {
getProdDetail
,
getEvalNumber
,
addOrder
,
getshoppingCartList
,
getCollect
,
getCouponShopList
,
receiveCoupon
,
...
...
@@ -131,10 +132,12 @@ const storeList = ref([
let
prodId
;
const
dataDetails
=
ref
({});
const
commentData
=
ref
({});
const
subscript
=
ref
(
0
);
onLoad
((
options
)
=>
{
prodId
=
'43834'
;
getProdDetailFn
();
getEvalNumberFn
();
getshoppingCartListFn
();
});
function
handleClick
(
e
)
{
console
.
log
(
e
);
...
...
@@ -170,14 +173,27 @@ const getEvalNumberFn = () => {
// 加入购物车
const
addOrderFn
=
()
=>
{
const
orderParams
=
{
shopId
:
dataDetails
.
value
.
prod
.
prod
Id
,
prodId
:
dataDetails
.
value
.
prodParameters
.
prodId
,
shopId
:
dataDetails
.
value
.
prod
.
shop
Id
,
prodId
:
dataDetails
.
value
.
skus
[
0
]
.
prodId
,
skuId
:
dataDetails
.
value
.
skus
[
0
].
skuId
,
shopType
:
3
,
shopType
:
'3'
,
basketCount
:
1
,
};
addOrder
(
orderParams
).
then
((
res
)
=>
{
console
.
log
(
'加入购物车'
,
res
);
xma
.
showToast
({
title
:
res
.
msg
,
duration
:
1500
,
icon
:
'none'
,
});
});
};
// 获取购物车列表
const
getshoppingCartListFn
=
()
=>
{
getshoppingCartList
({}).
then
((
res
)
=>
{
res
.
data
.
forEach
((
item
)
=>
{
// item.img = imgUrl + item.img;
});
subscript
.
value
=
res
.
data
.
length
;
});
};
// 进入页面回到顶部
...
...
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