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
30bc52bc
Commit
30bc52bc
authored
Aug 12, 2024
by
张娇(东信)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
购物车修改数量接口添加
parent
c1a2085d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
DepartureDate.vue
src/Components/assistingAgriculture/index/DepartureDate.vue
+1
-9
shop.js
src/api/assistingAgriculture/shop.js
+8
-0
RuralTravel.vue
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
+7
-3
cart.vue
src/pages/assistingAgriculture/cart/cart.vue
+9
-1
No files found.
src/Components/assistingAgriculture/index/DepartureDate.vue
View file @
30bc52bc
...
...
@@ -8,7 +8,7 @@
:class=
"
{ active: selectedItem === index }"
@tap="selectItem(index, item)"
>
{{
item
}}
{{
item
.
startDate
}}
</li>
<wd-calendar
use-default-slot
v-model=
"value"
@
confirm=
"handleConfirm4"
>
<li>
选择日期
</li>
...
...
@@ -39,21 +39,13 @@ onMounted(async () => {
getStartDateList
();
});
const
selectItem
=
(
index
,
item
)
=>
{
console
.
log
(
'item'
,
item
);
selectedItem
.
value
=
index
;
emit
(
'dataParams'
,
item
);
};
// 查询出发日期
const
getStartDateList
=
()
=>
{
getStartDate
(
params
).
then
((
res
)
=>
{
console
.
log
(
'res.data'
,
res
.
data
);
const
transformedData
=
Object
.
keys
(
res
.
data
).
reduce
((
acc
,
key
)
=>
{
acc
[
key
]
=
{
[
key
]:
res
.
data
[
key
]
};
return
acc
;
},
{});
dataList
.
value
=
res
.
data
;
console
.
log
(
Object
.
keys
(
dataList
.
value
,
232
));
});
};
function
handleConfirm4
({
value
})
{
...
...
src/api/assistingAgriculture/shop.js
View file @
30bc52bc
...
...
@@ -64,3 +64,11 @@ export function sgyOrderOrderInfo(data) {
data
,
});
}
// 筑农首页-3、订单详情
export
function
quantity
(
data
)
{
return
request
({
url
:
`/sgyrdd/sgyBasket/quantity`
,
method
:
'POST'
,
data
,
});
}
src/pages/assistingAgriculture/RuralTravel/RuralTravel.vue
View file @
30bc52bc
...
...
@@ -213,6 +213,9 @@ const locationFiltering = (index) => {
sortType
.
value
=
null
;
attractionId
.
value
=
null
;
dateType
.
value
=
null
;
startCity
.
value
=
null
;
serviceCommitment
.
value
=
null
;
labelId
.
value
=
null
;
}
};
// 查询热门路线
...
...
@@ -231,7 +234,8 @@ const sortParams = (sortMode) => {
};
// 出发日期
const
dataParams
=
(
item
)
=>
{
dateType
.
value
=
item
;
console
.
log
(
item
,
item
.
key
,
22322323
);
dateType
.
value
=
item
.
key
;
getProd
();
};
// 景点
...
...
@@ -258,7 +262,7 @@ const getProd = () => {
size
:
10
,
...(
sortType
.
value
!==
null
&&
{
sortType
:
sortType
.
value
.
sortMode
}),
...(
attractionId
.
value
!==
null
&&
{
attractionId
:
attractionId
.
value
.
id
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
}),
...(
dateType
.
value
!==
null
&&
{
dateType
:
dateType
.
value
.
key
}),
...(
startCity
.
value
!==
null
&&
{
startCity
:
startCity
.
value
}),
...(
serviceCommitment
.
value
!==
null
&&
{
serviceCommitment
:
serviceCommitment
.
value
}),
...(
labelId
.
value
!==
null
&&
{
labelId
:
labelId
.
value
}),
...
...
@@ -274,7 +278,7 @@ function toRouteDetails(item) {
console
.
log
(
item
,
22222
);
// TODO: 跳转到线路详情
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?prodId=
${
item
.
prodId
}
`
,
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?
shopId=
${
item
.
shopId
}
,
prodId=
${
item
.
prodId
}
`
,
});
}
function
toSpecialOfferZoneList
()
{
...
...
src/pages/assistingAgriculture/cart/cart.vue
View file @
30bc52bc
...
...
@@ -31,7 +31,7 @@
<span>
¥
</span>
{{
item
.
skuPrice
}}
</div>
<wd-input-number
v-model=
"item.count"
/>
<wd-input-number
v-model=
"item.count"
@
change=
"changeQuantity(item)"
/>
</div>
</div>
</div>
...
...
@@ -60,6 +60,7 @@
import
{
ref
,
computed
,
onMounted
}
from
'vue'
;
import
{
getshoppingCartList
}
from
'../../../api/packageDetail'
;
import
{
categoryPresaleList
}
from
'../../../api/assistingAgriculture/building'
;
import
{
quantity
}
from
'../../../api/assistingAgriculture/shop'
;
// 计算是否全选
const
checkedAll
=
computed
(()
=>
{
return
cartList
.
value
.
every
((
item
)
=>
item
.
isChecked
);
...
...
@@ -114,6 +115,13 @@ const presaleSortList = (index) => {
});
});
};
// 购物车数量修改
const
changeQuantity
=
async
(
item
)
=>
{
const
res
=
await
quantity
({
basketId
:
item
.
basket
.
basketId
,
basketCount
:
item
.
count
,
});
};
const
selectedItems
=
computed
(()
=>
{
return
cartList
.
value
.
reduce
((
acc
,
shop
)
=>
{
const
selectedProducts
=
shop
.
prodInfos
.
filter
((
item
)
=>
item
.
isChecked
);
...
...
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