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
ae6945f3
Commit
ae6945f3
authored
Aug 28, 2024
by
李明环(东信)
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.platform.xinhuaapp.com/pengjiani/groupPurchase-miniapp
parents
33964fa8
25d1c205
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
20 deletions
+41
-20
detail.vue
src/pages/order/detail.vue
+39
-18
order.vue
src/pages/order/order.vue
+2
-2
No files found.
src/pages/order/detail.vue
View file @
ae6945f3
...
...
@@ -30,7 +30,7 @@
</view>
<view
class=
"detail"
v-if=
"orderDetail.orderStore.status == 3 && orderDetail.baseOrder.prodType ===
9
"
v-if=
"orderDetail.orderStore.status == 3 && orderDetail.baseOrder.prodType ===
10
"
>
预约时间:
{{
orderDetail
.
orderStore
.
receiverTime
.
slice
(
0
,
4
)
}}
年
{{
orderDetail
.
orderStore
.
receiverTime
.
slice
(
5
,
7
)
...
...
@@ -47,7 +47,7 @@
<text
class=
"title"
>
{{
orderDetail
.
orderItems
[
0
].
prodName
}}
</text>
<!--
<text
class=
"detail"
>
周一至周日 到店吃
</text>
<text
class=
"detail"
>
随时退·过期自动退·免预约
</text>
-->
<text
class=
"detail"
v-if=
"orderDetail.baseOrder.prodType ===
9
"
>
<text
class=
"detail"
v-if=
"orderDetail.baseOrder.prodType ===
10
"
>
预约时间:
{{
orderDetail
.
orderStore
.
receiverTime
}}
</text>
<text
class=
"detail"
>
购买数量:
{{
orderDetail
.
orderItems
[
0
].
prodCount
}}
</text>
...
...
@@ -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,7 +445,12 @@ const anotherOrder = () => {
};
const
toProdDetail
=
()
=>
{
if
(
orderDetail
.
value
.
baseOrder
.
prodType
===
9
)
{
if
(
orderDetail
.
value
.
baseOrder
.
prodType
===
5
)
{
xma
.
navigateTo
({
url
:
`/pages/packageDetails/packageDetails?prodId=
${
orderDetail
.
value
.
orderItems
[
0
].
prodId
}
`
,
});
}
if
(
orderDetail
.
value
.
baseOrder
.
prodType
===
10
)
{
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;
}
}
}
...
...
src/pages/order/order.vue
View file @
ae6945f3
...
...
@@ -60,7 +60,7 @@
<image
mode=
"aspectFill"
:src=
"fileDomain + item.orderItems[0].pic"
/>
<view
class=
"info-box"
>
<view
class=
"text"
>
下单时间:
{{
item
.
createTime
.
slice
(
0
,
16
)
}}
</view>
<view
class=
"text"
v-if=
"item.prodType ===
9
"
>
<view
class=
"text"
v-if=
"item.prodType ===
10
"
>
预约时间:
{{
item
.
subOrder
.
receiverTime
}}
</view>
<view
class=
"text"
>
数量:
{{
item
.
orderItems
[
0
].
prodCount
}}
</view>
...
...
@@ -197,7 +197,7 @@ const stateList = ref({});
const
orderDic
=
ref
();
onLoad
(
async
(
options
)
=>
{
await
signIn
();
// if (!getToken()) await signIn2();
//
if (!getToken()) await signIn2();
if
(
!
getOrderDic
())
await
orderStatus
();
orderDic
.
value
=
getOrderDic
();
orderDic
.
value
.
baseOrder
[
0
].
value
=
'all'
;
...
...
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