Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
df90c46a
authored
Aug 16, 2024
by
芋道源码
Committed by
Gitee
Aug 16, 2024
Browse files
Options
Browse Files
Download
Plain Diff
!501 【功能修复】商城店铺装修的拼团价格和秒杀价格
Merge pull request !501 from 卢越/master
parents
aadf1373
4130b2fe
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
2 deletions
+25
-2
src/api/mall/product/spu.ts
+2
-0
src/api/mall/promotion/seckill/seckillActivity.ts
+1
-0
src/components/DiyEditor/components/mobile/PromotionCombination/index.vue
+11
-1
src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue
+11
-1
No files found.
src/api/mall/product/spu.ts
View file @
df90c46a
...
@@ -50,6 +50,8 @@ export interface Spu {
...
@@ -50,6 +50,8 @@ export interface Spu {
giveIntegral
?:
number
// 赠送积分
giveIntegral
?:
number
// 赠送积分
virtualSalesCount
?:
number
// 虚拟销量
virtualSalesCount
?:
number
// 虚拟销量
price
?:
number
// 商品价格
price
?:
number
// 商品价格
combinationPrice
?:
number
// 商品拼团价格
seckillPrice
?:
number
// 商品秒杀价格
salesCount
?:
number
// 商品销量
salesCount
?:
number
// 商品销量
marketPrice
?:
number
// 市场价
marketPrice
?:
number
// 市场价
costPrice
?:
number
// 成本价
costPrice
?:
number
// 成本价
...
...
src/api/mall/promotion/seckill/seckillActivity.ts
View file @
df90c46a
...
@@ -24,6 +24,7 @@ export interface SeckillActivityVO {
...
@@ -24,6 +24,7 @@ export interface SeckillActivityVO {
// 秒杀活动所需属性
// 秒杀活动所需属性
export
interface
SeckillProductVO
{
export
interface
SeckillProductVO
{
skuId
:
number
skuId
:
number
spuId
:
number
seckillPrice
:
number
seckillPrice
:
number
stock
:
number
stock
:
number
}
}
...
...
src/components/DiyEditor/components/mobile/PromotionCombination/index.vue
View file @
df90c46a
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
class=
"text-12px"
class=
"text-12px"
:style=
"
{ color: property.fields.price.color }"
:style=
"
{ color: property.fields.price.color }"
>
>
¥
{{
spu
.
price
}}
¥
{{
fenToYuan
(
spu
.
combinationPrice
||
spu
.
price
||
0
)
}}
</span>
</span>
</div>
</div>
</div>
</div>
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
import
{
PromotionCombinationProperty
}
from
'./config'
import
{
PromotionCombinationProperty
}
from
'./config'
import
*
as
ProductSpuApi
from
'@/api/mall/product/spu'
import
*
as
ProductSpuApi
from
'@/api/mall/product/spu'
import
*
as
CombinationActivityApi
from
'@/api/mall/promotion/combination/combinationActivity'
import
*
as
CombinationActivityApi
from
'@/api/mall/promotion/combination/combinationActivity'
import
{
Spu
}
from
"@/api/mall/product/spu"
;
import
{
CombinationProductVO
}
from
"@/api/mall/promotion/combination/combinationActivity"
;
import
{
fenToYuan
}
from
"@/utils"
;
/** 拼团 */
/** 拼团 */
defineOptions
({
name
:
'PromotionCombination'
})
defineOptions
({
name
:
'PromotionCombination'
})
...
@@ -80,6 +83,13 @@ watch(
...
@@ -80,6 +83,13 @@ watch(
const
activity
=
await
CombinationActivityApi
.
getCombinationActivity
(
props
.
property
.
activityId
)
const
activity
=
await
CombinationActivityApi
.
getCombinationActivity
(
props
.
property
.
activityId
)
if
(
!
activity
?.
spuId
)
return
if
(
!
activity
?.
spuId
)
return
spuList
.
value
=
[
await
ProductSpuApi
.
getSpu
(
activity
.
spuId
)]
spuList
.
value
=
[
await
ProductSpuApi
.
getSpu
(
activity
.
spuId
)]
// 循环活动信息,赋值拼团价格
activity
.
products
.
forEach
((
product
:
CombinationProductVO
)
=>
{
spuList
.
value
.
forEach
((
spu
:
Spu
)
=>
{
// 商品原售价和拼团价,哪个便宜就赋值哪个
spu
.
combinationPrice
=
Math
.
min
(
spu
.
combinationPrice
||
Infinity
,
product
.
combinationPrice
);
// 设置 SPU 的最低价格
})
});
},
},
{
{
immediate
:
true
,
immediate
:
true
,
...
...
src/components/DiyEditor/components/mobile/PromotionSeckill/index.vue
View file @
df90c46a
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
class=
"text-12px"
class=
"text-12px"
:style=
"
{ color: property.fields.price.color }"
:style=
"
{ color: property.fields.price.color }"
>
>
¥
{{
spu
.
price
}}
¥
{{
fenToYuan
(
spu
.
seckillPrice
||
spu
.
price
||
0
)
}}
</span>
</span>
</div>
</div>
</div>
</div>
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
import
{
PromotionSeckillProperty
}
from
'./config'
import
{
PromotionSeckillProperty
}
from
'./config'
import
*
as
ProductSpuApi
from
'@/api/mall/product/spu'
import
*
as
ProductSpuApi
from
'@/api/mall/product/spu'
import
*
as
SeckillActivityApi
from
'@/api/mall/promotion/seckill/seckillActivity'
import
*
as
SeckillActivityApi
from
'@/api/mall/promotion/seckill/seckillActivity'
import
{
Spu
}
from
"@/api/mall/product/spu"
;
import
{
SeckillProductVO
}
from
"@/api/mall/promotion/seckill/seckillActivity"
;
import
{
fenToYuan
}
from
"@/utils"
;
/** 秒杀 */
/** 秒杀 */
defineOptions
({
name
:
'PromotionSeckill'
})
defineOptions
({
name
:
'PromotionSeckill'
})
...
@@ -80,6 +83,13 @@ watch(
...
@@ -80,6 +83,13 @@ watch(
const
activity
=
await
SeckillActivityApi
.
getSeckillActivity
(
props
.
property
.
activityId
)
const
activity
=
await
SeckillActivityApi
.
getSeckillActivity
(
props
.
property
.
activityId
)
if
(
!
activity
?.
spuId
)
return
if
(
!
activity
?.
spuId
)
return
spuList
.
value
=
[
await
ProductSpuApi
.
getSpu
(
activity
.
spuId
)]
spuList
.
value
=
[
await
ProductSpuApi
.
getSpu
(
activity
.
spuId
)]
spuList
.
value
=
[
await
ProductSpuApi
.
getSpu
(
activity
.
spuId
)]
// 循环活动信息,赋值秒杀最低价格
activity
.
products
.
forEach
((
product
:
SeckillProductVO
)
=>
{
spuList
.
value
.
forEach
((
spu
:
Spu
)
=>
{
spu
.
seckillPrice
=
Math
.
min
(
spu
.
seckillPrice
||
Infinity
,
product
.
seckillPrice
);
// 设置 SPU 的最低价格
})
});
},
},
{
{
immediate
:
true
,
immediate
:
true
,
...
...
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