Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
op-web-service
Project
Project
Details
Activity
Releases
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
bp
op-web-service
Commits
14324871
Commit
14324871
authored
Aug 26, 2021
by
liwenhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add:商品上架时间
parent
b4b18033
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
21 deletions
+67
-21
goods.js
server/controllers/goods.js
+11
-0
router.js
server/router.js
+1
-0
index.less
src/pages/Goods/List/index.less
+3
-0
index.vue
src/pages/Goods/List/index.vue
+47
-21
goods.js
src/service/Goods/goods.js
+5
-0
No files found.
server/controllers/goods.js
View file @
14324871
...
...
@@ -56,6 +56,17 @@ exports.putOffline = async ctx => {
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 设置商品上架
exports
.
putOnlineSite
=
async
ctx
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/online_site`
;
const
opts
=
{
url
,
method
:
"POST"
,
json
:
true
,
body
:
ctx
.
request
.
body
};
ctx
.
body
=
await
req
(
ctx
,
opts
);
};
// 获取商品详情列表
exports
.
getGoodsInfo
=
async
ctx
=>
{
const
url
=
`
${
GOODS_URI
}
/goods/background/get_goods_info`
;
...
...
server/router.js
View file @
14324871
...
...
@@ -48,6 +48,7 @@ router.get(`${API_VERSION}/get_goods_category_list`, goods.getCategoryList);
router
.
get
(
`
${
API_VERSION
}
/goods/background/get_goods_list`
,
goods
.
getList
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/online`
,
goods
.
putOnline
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/offline`
,
goods
.
putOffline
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/putOnlineSite`
,
goods
.
putOnlineSite
);
router
.
get
(
`
${
API_VERSION
}
/goods/background/get_goods_info`
,
goods
.
getGoodsInfo
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/audit_pass`
,
goods
.
postSuccess
);
router
.
post
(
`
${
API_VERSION
}
/goods/background/check_goods_name`
,
goods
.
checkGoodsName
);
...
...
src/pages/Goods/List/index.less
View file @
14324871
...
...
@@ -17,6 +17,9 @@
}
}
}
.pick-time {
margin-left: 10px;
}
.commodity_list {
margin-top: 30px;
}
...
...
src/pages/Goods/List/index.vue
View file @
14324871
...
...
@@ -146,7 +146,7 @@
></el-table-column>
<el-table-column
label=
"上架时间"
prop=
"
create
_time"
prop=
"
online_start
_time"
align=
"center"
></el-table-column>
<!-- 操作快捷键 -->
...
...
@@ -199,37 +199,40 @@
>
<el-button
type=
"text"
@
click=
"
checkedAddTime.showAddTime = true
"
@
click=
"
handleGoodOnline(scope.row.goods_spu_id)
"
>
上架配置
</el-button
>
</template>
</el-table-column>
</el-table>
<el-dialog
title=
"上架时间配置"
width=
"50%"
top=
"10%"
v-model=
"checkedAddTime.showAddTime"
>
<el-form-item
label=
"上架时间:"
>
<el-radio-group
v-model=
"checkedAddTime.addType"
>
<el-dialog
title=
"上架时间配置"
width=
"50%"
top=
"10%"
center
v-model=
"showGoodsAddTime"
>
<el-form-item>
上架时间:
<el-radio-group
v-model=
"checkedAddTime.online_type"
>
<el-radio
:label=
"1"
>
立即上架
</el-radio>
<el-radio
:label=
"2"
>
定点上架
<
!-- <el-input v-model="checkedAddTime.addTime"></el-input> --
>
<
span
class=
"pick-time"
>
<el-date-picker
v-model=
"checkedAddTime.addTime"
type=
"datetimerange"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
@
change=
"pickerStartTime"
>
</el-date-picker>
v-model=
"addTimeRange"
type=
"datetimerange"
start-placeholder=
"开始日期"
end-placeholder=
"结束日期"
format=
"YYYY-MM-DD HH:mm:ss"
value-format=
"YYYY-MM-DD HH:mm:ss"
@
change=
"pickerStartTime"
:disabled=
"checkedAddTime.online_type!=2"
>
</el-date-picker>
</span>
</el-radio>
<el-radio
:label=
"3"
>
暂不上架
</el-radio>
</el-radio-group>
</el-form-item>
<
template
#
footer
>
<span>
<el-button
@
click=
"handleConfirmRefund"
>
确认
</el-button>
<el-button
type=
"primary"
@
click=
"g
oodsAddTime = false"
>
返回
</el-button>
<el-button
type=
"primary"
@
click=
"handleConfirmRefund"
>
确认
</el-button>
<el-button
@
click=
"showG
oodsAddTime = false"
>
返回
</el-button>
</span>
</
template
>
</el-dialog>
...
...
@@ -254,7 +257,8 @@ import {
getGoodsList
,
getList
,
putOnline
,
putOffline
putOffline
,
putOnlineSite
}
from
"@/service/Goods/goods"
;
import
Layout
from
"../layout/index.vue"
;
export
default
{
...
...
@@ -319,10 +323,13 @@ export default {
goodsList
:
[],
totalCount
:
0
,
// 总条数
showGoodsAddTime
:
false
,
//商品添加弹窗
addTimeRange
:
[],
checkedAddTime
:
{
showAddTime
:
false
,
addType
:
1
,
addTime
:
''
,
online_start_time
:
''
,
online_end_time
:
''
,
online_type
:
1
,
goods_spu_id
:
''
}
};
},
...
...
@@ -428,6 +435,25 @@ export default {
goDetail
(
operation
,
spuId
)
{
console
.
log
(
spuId
);
this
.
$router
.
push
({
name
:
"GoodsDetail"
,
params
:
{
operation
,
spuId
}
});
},
handleGoodOnline
(
id
)
{
this
.
showGoodsAddTime
=
true
;
this
.
checkedAddTime
.
goods_spu_id
=
id
;
},
async
handleConfirmRefund
()
{
this
.
checkedAddTime
.
online_start_time
=
this
.
addTimeRange
[
0
];
this
.
checkedAddTime
.
online_end_time
=
this
.
addTimeRange
[
1
];
let
res
=
await
putOnlineSite
(
this
.
checkedAddTime
);
if
(
res
.
code
!==
0
)
return
this
.
$message
.
error
(
res
.
reason
);
this
.
showGoodsAddTime
=
false
;
this
.
addTimeRange
=
[];
this
.
checkedAddTime
=
{
online_start_time
:
''
,
online_end_time
:
''
,
online_type
:
1
,
goods_spu_id
:
''
}
return
this
.
$message
.
success
(
'操作成功'
);
}
}
};
...
...
src/service/Goods/goods.js
View file @
14324871
...
...
@@ -26,6 +26,11 @@ export async function putOffline (query) {
});
return
res
;
}
// 设置商品上架
export
async
function
putOnlineSite
(
params
)
{
const
res
=
await
axios
.
post
(
"/api/v1/goods/background/putOnlineSite"
,
params
);
return
res
;
}
// 获取商品详情列表
export
async
function
getGoodsInfo
(
params
)
{
const
res
=
await
axios
.
get
(
"/api/v1/goods/background/get_goods_info"
,
{
...
...
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