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
6de55a00
Commit
6de55a00
authored
Aug 28, 2024
by
彭佳妮(贵阳日报)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单详情页修改
parent
8010e319
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
15 deletions
+36
-15
detail.vue
src/pages/order/detail.vue
+36
-15
No files found.
src/pages/order/detail.vue
View file @
6de55a00
...
...
@@ -57,12 +57,7 @@
</view>
</view>
</view>
<wd-icon
name=
"chevron-right"
size=
"22px"
color=
"#333"
v-if=
"orderDetail.baseOrder.prodType === 9"
></wd-icon>
<wd-icon
name=
"chevron-right"
size=
"22px"
color=
"#333"
></wd-icon>
</view>
<view
class=
"rectangle-with-semicircles"
></view>
...
...
@@ -138,18 +133,18 @@
<view
class=
"info"
v-if=
"prodDetail && orderDetail.baseOrder.prodType === 5"
>
<view
class=
"menu padding"
>
<text
class=
"title"
>
到店吃套餐
</text>
<view
class=
"menu-box"
v-for=
"(item, index) in prod
Detail.prodAdditionals
"
:key=
"index"
>
<view
class=
"menu-box"
v-for=
"(item, index) in prod
uctCombination
"
:key=
"index"
>
<view
class=
"header"
>
<view
class=
"circle"
></view>
<text
class=
"h-name"
>
{{
item
.
categorizeName
}}
</text>
<text
class=
"h-name"
>
{{
item
[
0
]
.
categorizeName
}}
</text>
</view>
<view
class=
"list-box"
>
<text
class=
"name"
>
{{
i
tem
.
prodName
}}
</text>
<view
class=
"list-box"
v-for=
"(i, n) in item"
:key=
"n"
>
<text
class=
"name"
>
{{
i
.
prodName
}}
</text>
<view
class=
"right-box"
>
<text
class=
"num"
>
(
{{
i
tem
.
count
}}
份)
</text>
<text
class=
"num"
>
(
{{
i
.
count
}}
份)
</text>
<view
class=
"price-box"
>
<text
class=
"icon"
>
¥
</text>
<text
class=
"num"
>
{{
i
tem
.
price
}}
</text>
<text
class=
"num"
>
{{
i
.
price
}}
</text>
</view>
</view>
</view>
...
...
@@ -171,7 +166,7 @@
}}
</text>
</view>
<view
class=
"row"
>
<view
class=
"row"
v-if=
"prodDetail.groupPurchasePackageRule.rule"
>
<text
class=
"name"
>
使用规则
</text>
<text
class=
"colon"
>
:
</text>
<text
class=
"textarea"
>
{{
prodDetail
.
groupPurchasePackageRule
.
rule
}}
</text>
...
...
@@ -319,11 +314,29 @@ const codeDetail = (item) => {
* 获取商品详情
*/
const
prodDetail
=
ref
();
const
productCombination
=
ref
([]);
const
getProductDetail
=
async
(
id
)
=>
{
const
res
=
await
getProdDetail
({
prodId
:
id
});
prodDetail
.
value
=
res
.
data
.
data
;
productCombination
.
value
=
groupByCategorizeName
(
res
.
data
.
data
.
prodAdditionals
);
};
// 定义一个函数来根据 categorizeName 字段对数据进行分组
function
groupByCategorizeName
(
prodAdditionals
)
{
if
(
!
Array
.
isArray
(
prodAdditionals
)
||
prodAdditionals
.
length
===
0
)
{
return
[];
}
const
grouped
=
prodAdditionals
.
reduce
((
result
,
item
)
=>
{
if
(
!
result
[
item
.
categorizeName
])
{
result
[
item
.
categorizeName
]
=
[];
}
result
[
item
.
categorizeName
].
push
(
item
);
return
result
;
},
{});
return
Object
.
values
(
grouped
);
}
/**
* 获取商铺信息
*/
...
...
@@ -432,6 +445,11 @@ const anotherOrder = () => {
};
const
toProdDetail
=
()
=>
{
if
(
orderDetail
.
value
.
baseOrder
.
prodType
===
5
)
{
xma
.
navigateTo
({
url
:
`/pages/packageDetails/packageDetails?prodId=
${
orderDetail
.
value
.
orderItems
[
0
].
prodId
}
`
,
});
}
if
(
orderDetail
.
value
.
baseOrder
.
prodType
===
9
)
{
xma
.
navigateTo
({
url
:
`/pages/assistingAgriculture/RouteDetails/RouteDetails?shopId=
${
orderDetail
.
value
.
baseOrder
.
shopId
}
&prodId=
${
orderDetail
.
value
.
orderItems
[
0
].
prodId
}
`
,
...
...
@@ -520,7 +538,7 @@ page {
.price-box
{
display
:
flex
;
align-items
:
last
baseline
;
align-items
:
baseline
;
.icon
{
font-weight
:
bold
;
...
...
@@ -602,6 +620,7 @@ page {
.between
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
baseline
;
margin-bottom
:
28rpx
;
}
...
...
@@ -650,6 +669,7 @@ page {
font-size
:
32rpx
;
line-height
:
56rpx
;
font-weight
:
bold
;
max-width
:
520rpx
;
}
.btn
{
...
...
@@ -769,7 +789,7 @@ page {
.price-box
{
display
:
flex
;
align-items
:
last
baseline
;
align-items
:
baseline
;
text
{
font-family
:
PingFang
SC
Bold
;
...
...
@@ -781,6 +801,7 @@ page {
.icon
{
font-size
:
26rpx
;
// line-height: 28rpx;
}
}
}
...
...
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