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
7bf3e41c
authored
Aug 13, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商城:
1. 微调砍价活动的代码
parent
127e6b20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
14 deletions
+3
-14
src/views/mall/promotion/bargain/activity/BargainActivityForm.vue
+0
-1
src/views/mall/promotion/bargain/activity/bargainActivity.data.ts
+0
-0
src/views/mall/promotion/bargain/activity/index.vue
+3
-13
No files found.
src/views/mall/promotion/bargain/BargainActivityForm.vue
→
src/views/mall/promotion/bargain/
activity/
BargainActivityForm.vue
View file @
7bf3e41c
...
...
@@ -129,7 +129,6 @@ const getSpuDetails = async (
if
(
typeof
products
!==
'undefined'
)
{
const
product
=
products
.
find
((
item
)
=>
item
.
skuId
===
sku
.
id
)
if
(
product
)
{
// 分转元
product
.
bargainFirstPrice
=
formatToFraction
(
product
.
bargainFirstPrice
)
product
.
bargainPrice
=
formatToFraction
(
product
.
bargainPrice
)
}
...
...
src/views/mall/promotion/bargain/bargainActivity.data.ts
→
src/views/mall/promotion/bargain/
activity/
bargainActivity.data.ts
View file @
7bf3e41c
File moved
src/views/mall/promotion/bargain/index.vue
→
src/views/mall/promotion/bargain/
activity/
index.vue
View file @
7bf3e41c
...
...
@@ -65,8 +65,8 @@
import
{
allSchemas
}
from
'./bargainActivity.data'
import
*
as
BargainActivityApi
from
'@/api/mall/promotion/bargain/bargainActivity'
import
BargainActivityForm
from
'./BargainActivityForm.vue'
import
{
cloneDeep
}
from
'lodash-es'
import
{
createImageViewer
}
from
'@/components/ImageViewer'
import
{
sortTableColumns
}
from
'@/hooks/web/useCrudSchemas'
defineOptions
({
name
:
'PromotionBargainActivity'
})
...
...
@@ -98,20 +98,10 @@ const handleDelete = (id: number) => {
tableMethods
.
delList
(
id
,
false
)
}
// TODO @puhui999:要不还是使用原生的 element plus 做。感觉 crud schema 复杂界面,做起来麻烦
/** 初始化 **/
onMounted
(()
=>
{
/**
TODO
后面准备封装成一个函数来操作 tableColumns 重新排列:比如说需求是表单上商品选择是在后面的而列表展示的时候需要调到位置。
封装效果支持批量操作,给出 field 和需要插入的位置,例:[{field:'spuId',index: 1}] 效果为把 field 为 spuId 的 column 移动到第一个位置
*/
// 处理一下表格列让商品往前
const
index
=
allSchemas
.
tableColumns
.
findIndex
((
item
)
=>
item
.
field
===
'spuId'
)
const
column
=
cloneDeep
(
allSchemas
.
tableColumns
[
index
])
allSchemas
.
tableColumns
.
splice
(
index
,
1
)
// 添加到开头
allSchemas
.
tableColumns
.
unshift
(
column
)
// 获得活动列表
sortTableColumns
(
allSchemas
.
tableColumns
,
'spuId'
)
getList
()
})
</
script
>
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