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
Commit
a02712ca
authored
Aug 23, 2024
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【代码评审】商城:满减送活动的实现
parent
814f9ba9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
src/api/mall/promotion/reward/rewardActivity.ts
+4
-3
src/views/mall/promotion/rewardActivity/RewardForm.vue
+1
-0
src/views/mall/promotion/rewardActivity/components/RewardRule.vue
+2
-2
No files found.
src/api/mall/promotion/reward/rewardActivity.ts
View file @
a02712ca
...
@@ -9,10 +9,11 @@ export interface RewardActivityVO {
...
@@ -9,10 +9,11 @@ export interface RewardActivityVO {
remark
?:
string
remark
?:
string
conditionType
?:
number
conditionType
?:
number
productScope
?:
number
productScope
?:
number
productScopeValues
?:
number
[]
// 商品范围:值为 品类编号列表 或 商品编号列表 ,用于提交
productCategoryIds
?:
number
[]
// 仅用于表单,不提交
productSpuIds
?:
number
[]
// 仅用于表单,不提交
rules
:
RewardRule
[]
rules
:
RewardRule
[]
// 如下仅用于表单,不提交
productScopeValues
?:
number
[]
// 商品范围:值为品类编号列表、商品编号列表
productCategoryIds
?:
number
[]
productSpuIds
?:
number
[]
}
}
// 优惠规则
// 优惠规则
...
...
src/views/mall/promotion/rewardActivity/RewardForm.vue
View file @
a02712ca
...
@@ -169,6 +169,7 @@ const getProductScope = async () => {
...
@@ -169,6 +169,7 @@ const getProductScope = async () => {
formData
.
value
.
productSpuIds
=
formData
.
value
.
productScopeValues
formData
.
value
.
productSpuIds
=
formData
.
value
.
productScopeValues
break
break
case
PromotionProductScopeEnum
.
CATEGORY
.
scope
:
case
PromotionProductScopeEnum
.
CATEGORY
.
scope
:
// TODO @puhui999:可以直接 await nextTick() 呀。
await
nextTick
(()
=>
{
await
nextTick
(()
=>
{
let
productCategoryIds
=
formData
.
value
.
productScopeValues
as
any
let
productCategoryIds
=
formData
.
value
.
productScopeValues
as
any
if
(
Array
.
isArray
(
productCategoryIds
)
&&
productCategoryIds
.
length
>
0
)
{
if
(
Array
.
isArray
(
productCategoryIds
)
&&
productCategoryIds
.
length
>
0
)
{
...
...
src/views/mall/promotion/rewardActivity/components/RewardRule.vue
View file @
a02712ca
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
placeholder=
""
placeholder=
""
type=
"number"
type=
"number"
/>
/>
<!-- TODO @puhui999:走字典数据? -->
{{
PromotionConditionTypeEnum
.
PRICE
.
type
===
formData
.
conditionType
?
'元'
:
'件'
}}
{{
PromotionConditionTypeEnum
.
PRICE
.
type
===
formData
.
conditionType
?
'元'
:
'件'
}}
</el-form-item>
</el-form-item>
<el-form-item
label=
"优惠内容:"
label-width=
"100px"
>
<el-form-item
label=
"优惠内容:"
label-width=
"100px"
>
...
@@ -26,6 +27,7 @@
...
@@ -26,6 +27,7 @@
订单金额优惠
订单金额优惠
<el-form-item>
<el-form-item>
减
减
<!-- TODO @puhui999:需要考虑 100 换算哈 -->
<el-input
<el-input
v-model=
"rule.discountPrice"
v-model=
"rule.discountPrice"
class=
"w-150px! p-x-20px!"
class=
"w-150px! p-x-20px!"
...
@@ -91,8 +93,6 @@ import { RewardActivityVO } from '@/api/mall/promotion/reward/rewardActivity'
...
@@ -91,8 +93,6 @@ import { RewardActivityVO } from '@/api/mall/promotion/reward/rewardActivity'
import
{
PromotionConditionTypeEnum
}
from
'@/utils/constants'
import
{
PromotionConditionTypeEnum
}
from
'@/utils/constants'
import
{
useVModel
}
from
'@vueuse/core'
import
{
useVModel
}
from
'@vueuse/core'
defineOptions
({
name
:
'RewardRule'
})
const
props
=
defineProps
<
{
const
props
=
defineProps
<
{
modelValue
:
RewardActivityVO
modelValue
:
RewardActivityVO
}
>
()
}
>
()
...
...
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