Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopFront
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
newshop
newShopFront
Commits
26550823
Commit
26550823
authored
Dec 23, 2019
by
Your Name
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://gitlab-ebiz.yiyao365.cn/newshop/newshopfront
into development
parents
fb358db8
d8180bae
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
516 additions
and
8 deletions
+516
-8
debug.log
debug.log
+1
-0
shopgoods.js
src/api/shopgoods.js
+90
-0
QuillEditor.vue
src/components/Editor/QuillEditor.vue
+44
-6
router.config.js
src/config/router.config.js
+17
-1
goodsDetailsTemplate.vue
src/views/goods/goodsDetailsTemplate.vue
+362
-0
uList.vue
src/views/userstaff/uList.vue
+1
-0
vue.config.js
vue.config.js
+1
-1
No files found.
debug.log
View file @
26550823
...
...
@@ -295,3 +295,4 @@
[1217/174328.389:ERROR:process_info.cc(359)] UncheckedAllocate
[1217/174415.247:ERROR:process_info.cc(359)] UncheckedAllocate
[1217/174421.088:ERROR:process_info.cc(359)] UncheckedAllocate
[1219/161906.094:ERROR:process_info.cc(359)] UncheckedAllocate
src/api/shopgoods.js
0 → 100644
View file @
26550823
import
api
from
'./index'
import
{
axios
}
from
'@/utils/request'
import
loginToken
from
'./token'
import
homeUrl
from
'./homeURL'
/**
* login func
* parameter: {
* username: '',
* password: '',
* remember_me: true,
* captcha: '12345'
* }
* @param parameter
* @returns {*}
*/
// 商品详情页模板列表
export
function
getGoodsTemplateList
(
parameter
)
{
if
(
parameter
.
START_TIME
){
parameter
.
START_TIME
=
parameter
.
START_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
if
(
parameter
.
END_TIME
){
parameter
.
END_TIME
=
parameter
.
END_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
return
axios
({
url
:
'shopgoods/goods-detail-settings/setting-list'
,
method
:
'get'
,
params
:
parameter
})
}
// 添加商品详情页模板
export
function
addGoosTemplate
(
parameter
)
{
if
(
parameter
.
START_TIME
){
parameter
.
START_TIME
=
parameter
.
START_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
if
(
parameter
.
END_TIME
){
parameter
.
END_TIME
=
parameter
.
END_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
return
axios
({
url
:
'shopgoods/goods-detail-settings/setting-add'
,
method
:
'post'
,
data
:
parameter
})
}
// 删除模板
export
function
deleteGoodsTemplate
(
id
)
{
return
axios
({
url
:
'shopgoods/goods-detail-settings/setting-del?GUID='
+
id
,
method
:
'delete'
})
}
// 获取模板编辑详情
export
function
getTemplateDetails
(
parameter
)
{
return
axios
({
url
:
'shopgoods/goods-detail-settings/setting-details'
,
method
:
'get'
,
params
:
parameter
})
}
// 更新模板详情
export
function
modifyGoodsTemplate
(
parameter
)
{
if
(
parameter
.
START_TIME
){
parameter
.
START_TIME
=
parameter
.
START_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
if
(
parameter
.
END_TIME
){
parameter
.
END_TIME
=
parameter
.
END_TIME
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
}
return
axios
({
url
:
'shopgoods/goods-detail-settings/setting-update'
,
method
:
'put'
,
data
:
parameter
})
}
/**
* get user 2step code open?
* @param parameter {*}
*/
export
function
get2step
(
parameter
)
{
return
axios
({
url
:
api
.
twoStepCode
,
method
:
'post'
,
data
:
parameter
})
}
\ No newline at end of file
src/components/Editor/QuillEditor.vue
View file @
26550823
...
...
@@ -39,23 +39,51 @@ export default {
data
()
{
return
{
content
:
null
,
editorOption
:
{
// some quill options
editorOption
:{
placeholder
:
'请输入'
,
modules
:{
toolbar
:{
container
:[
[
'bold'
,
'italic'
,
'underline'
,
'strike'
],
// toggled buttons
[{
'header'
:
1
},
{
'header'
:
2
}],
// custom button values
[{
'list'
:
'ordered'
},
{
'list'
:
'bullet'
}],
[{
'indent'
:
'-1'
},
{
'indent'
:
'+1'
}],
// outdent/indent
[{
'direction'
:
'rtl'
}],
// text direction
[{
'size'
:
[
'small'
,
false
,
'large'
,
'huge'
]}],
// custom dropdown
[{
'header'
:
[
1
,
2
,
3
,
4
,
5
,
6
,
false
]}],
[{
'color'
:
[]},
{
'background'
:
[]}],
// dropdown with defaults from theme
[{
'font'
:
[]}],
[{
'align'
:
[]}],
[
'link'
,
'image'
],
[
'clean'
]
],
handlers
:{
'image'
:
function
(
value
){
console
.
log
(
666666
)
if
(
value
){
console
.
log
(
value
)
}
else
{
this
.
quill
.
format
(
'image'
,
false
)
}
}
}
}
}
}
}
},
methods
:
{
onEditorBlur
(
quill
)
{
console
.
log
(
'editor blur!'
,
quill
)
//
console.log('editor blur!', quill)
},
onEditorFocus
(
quill
)
{
console
.
log
(
'editor focus!'
,
quill
)
//
console.log('editor focus!', quill)
},
onEditorReady
(
quill
)
{
console
.
log
(
'editor ready!'
,
quill
)
//
console.log('editor ready!', quill)
},
onEditorChange
({
quill
,
html
,
text
})
{
console
.
log
(
'editor change!'
,
quill
,
html
,
text
)
//
console.log('editor change!', quill, html, text)
this
.
$emit
(
'change'
,
html
)
}
},
...
...
@@ -74,9 +102,19 @@ export default {
.ant-editor-quill {
/deep/ .ql-toolbar.ql-snow {
border-radius: @border-radius-base @border-radius-base 0 0;
.ql-formats{
margin-right: 0;
}
}
/deep/ .ql-container.ql-snow {
border-radius: 0 0 @border-radius-base @border-radius-base;
}
/deep/ .ql-container.ql-snow{
min-height: 150px;
}
/deep/ .ql-snow .ql-picker-label{
display: grid;
}
}
</
style
>
src/config/router.config.js
View file @
26550823
...
...
@@ -200,7 +200,7 @@ export const asyncRouterMap = [
name
:
'delivery'
,
redirect
:
'/delivery/distributionPrice'
,
component
:
PageView
,
meta
:
{
title
:
'配送管理'
,
keepAlive
:
true
,
icon
:
'
doll
ar'
,
permission
:
[
'table'
]
},
meta
:
{
title
:
'配送管理'
,
keepAlive
:
true
,
icon
:
'
c
ar'
,
permission
:
[
'table'
]
},
children
:
[
{
path
:
'/delivery/distributionMode'
,
...
...
@@ -262,6 +262,22 @@ export const asyncRouterMap = [
},
]
},
// 商品
{
path
:
'/goods'
,
name
:
'goods'
,
redirect
:
'/goods/goodsDetailsTemplate'
,
component
:
PageView
,
meta
:
{
title
:
'商品管理'
,
keepAlive
:
true
,
icon
:
'shopping'
,
permission
:
[
'table'
]
},
children
:
[
{
path
:
'/goods/goodsDetailsTemplate'
,
name
:
'goodsDetailsTemplate'
,
component
:
()
=>
import
(
'@/views/goods/goodsDetailsTemplate'
),
meta
:
{
title
:
'商品详情页模板'
,
keepAlive
:
false
,
permission
:
[
'table'
]
}
},
]
},
// dashboard
{
path
:
'/dashboard'
,
...
...
src/views/goods/goodsDetailsTemplate.vue
0 → 100644
View file @
26550823
<
template
>
<a-card
:bordered=
"false"
>
<div>
<div
class=
"table-page-search-wrapper"
>
<a-form
:form=
"formCheck"
layout=
"inline"
>
<a-row
:gutter=
"48"
>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"版本名称"
>
<a-input
v-model=
"queryParam.NAME"
placeholder=
"请输入版本名称"
/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"状态"
>
<a-select
v-model=
"queryParam.STATUS"
placeholder=
"请选择"
>
<a-select-option
value=
"0"
>
停用
</a-select-option>
<a-select-option
value=
"1"
>
进行中
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<template
v-if=
"advanced"
>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"生效开始时间"
>
<a-date-picker
v-model=
"queryParam.START_TIME"
:showTime=
"
{ defaultValue:timeDafault }" style="width: 100%" placeholder="请选择"/>
</a-form-item>
</a-col>
<a-col
:md=
"8"
:sm=
"24"
>
<a-form-item
label=
"生效结束时间"
>
<a-date-picker
v-model=
"queryParam.END_TIME"
:showTime=
"
{ defaultValue:timeDafault }" style="width: 100%" placeholder="请选择"/>
</a-form-item>
</a-col>
</
template
>
<a-col
:md=
"!advanced && 8 || 24"
:sm=
"24"
>
<span
class=
"table-page-search-submitButtons"
:style=
"advanced && { float: 'right', overflow: 'hidden' } || {} "
>
<a-button
type=
"primary"
@
click=
"$refs.table.refresh(true)"
>
查询
</a-button>
<a-button
style=
"margin-left: 8px"
@
click=
"() => queryParam = {}"
>
重置
</a-button>
<a
@
click=
"toggleAdvanced"
style=
"margin-left: 8px"
>
{{ advanced ? '收起' : '展开' }}
<a-icon
:type=
"advanced ? 'up' : 'down'"
/>
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div
class=
"table-operator"
>
<a-button-group>
<a-button
type=
'primary'
icon=
'plus'
@
click=
"handleEdit(1)"
>
新建模板
</a-button>
<a-button
type=
'primary'
icon=
'download'
>
批量关联模板下载
</a-button>
<!-- <a-upload
name="file"
:customRequest="customRequest"
>
<a-button type='primary' icon='import'>批量导入关联</a-button>
</a-upload> -->
</a-button-group>
</div>
<s-table
ref=
"table"
size=
"default"
rowKey=
"GUID"
:columns=
"columns"
:data=
"loadData"
>
<span
slot=
"action"
slot-scope=
"text, record"
>
<a
type=
"primary"
>
关联商品
</a>
<a-divider
type=
"vertical"
/>
<a
type=
"primary"
@
click=
"handleEdit(record)"
>
编辑
</a>
<a-divider
type=
"vertical"
/>
<a
type=
"primary"
>
启用
</a>
<a-divider
type=
"vertical"
/>
<a-popconfirm
title=
"是否要删除此行?"
@
confirm=
"remove(record.GUID)"
>
<a>
删除
</a>
</a-popconfirm>
</span>
</s-table>
<a-modal
title=
"商品详情页模板"
:width=
"800"
:destroyOnClose=
"destroyOnClose"
v-model=
"visible"
@
ok=
'handleOk()'
>
<a-form
:form=
"modalForm"
>
<a-form-item
:labelCol=
'labelCol'
:wrapperCol=
'wrapperCol'
hidden
>
<a-input
hidden
v-decorator=
"['GUID']"
name=
"GUID"
/>
</a-form-item>
<a-form-item
label=
"版式名称"
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
>
<a-input
v-decorator=
"['NAME']"
name=
"NAME"
placeholder=
"请输入版式名称"
/>
</a-form-item>
<a-form-item
label=
"是否启用"
required
:labelCol=
"labelCol"
:wrapperCol=
"wrapperCol"
>
<a-select
v-decorator=
"['STATUS ',{rules:[{required:true,message:'请选择是否启用'}],initialValue:'1',normalize:checkNull}]"
placeholder=
"请选择"
>
<a-select-option
value=
"0"
>
不启用
</a-select-option>
<a-select-option
value=
"1"
>
启用
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"生效时间"
:labelCol=
"labelCol"
:wrapperCol=
"{
xs: { span: 24 },
sm: { span: 17 }
}"
>
<a-date-picker
placeholder=
"开始时间"
v-decorator=
"['START_TIME',{normalize:checkTime}]"
@
openChange=
"handleStartOpenChange"
:showTime=
"{ defaultValue:timeDafault }"
/>
<a-date-picker
placeholder=
"结束时间"
:open=
"endOpen"
v-decorator=
"['END_TIME',{normalize:checkTime}]"
@
openChange=
"handleEndOpenChange"
:showTime=
"{ defaultValue:timeDafault }"
/>
</a-form-item>
<a-form-item
label=
"顶部内容"
:labelCol=
"labelCol"
:wrapperCol=
"{
xs: { span: 24 },
sm: { span: 17 }
}"
>
<quill-editor
v-decorator=
"['HEAD_PIC_URL']"
ref=
"myQuillEditor"
>
>
</quill-editor>
</a-form-item>
<a-form-item
label=
"底部内容"
:labelCol=
"labelCol"
:wrapperCol=
"{
xs: { span: 24 },
sm: { span: 17 }
}"
>
<quill-editor
v-decorator=
"['FOOT_PIC_URL']"
ref=
"myQuillEditor"
>
>
</quill-editor>
</a-form-item>
</a-form>
</a-modal>
</div>
</a-card>
</template>
<
script
>
import
moment
from
'moment'
import
axios
from
'axios'
import
{
STable
}
from
'@/components'
import
QuillEditor
from
'@/components/Editor/QuillEditor'
import
WangEditor
from
'@/components/Editor/WangEditor'
import
{
getGoodsTemplateList
,
addGoosTemplate
,
deleteGoodsTemplate
,
getTemplateDetails
,
modifyGoodsTemplate
}
from
'@/api/shopgoods'
import
{
format
}
from
'path'
export
default
{
name
:
'goodsTemplate'
,
components
:
{
STable
,
QuillEditor
,
WangEditor
},
data
()
{
return
{
destroyOnClose
:
true
,
visible
:
false
,
endOpen
:
false
,
mdl
:
{},
labelCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
7
}
},
wrapperCol
:
{
xs
:
{
span
:
24
},
sm
:
{
span
:
12
}
},
columns
:
[
{
title
:
'模板ID'
,
dataIndex
:
'GUID'
},
{
title
:
'版式名称'
,
dataIndex
:
'NAME'
},
{
title
:
'已关联商品(个)'
,
dataIndex
:
'NUM'
},
{
title
:
'状态'
,
dataIndex
:
'STATUS'
,
customRender
:
(
text
)
=>
{
if
(
text
==
1
){
return
'进行中'
}
else
{
return
'停用'
}
}
},
{
title
:
'生效开始时间'
,
dataIndex
:
'START_TIME'
},
{
title
:
'生效结束时间'
,
dataIndex
:
'END_TIME'
},
{
title
:
'操作'
,
dataIndex
:
'action'
,
scopedSlots
:
{
customRender
:
'action'
}
}
],
timeDafault
:
moment
(
'00:00:00'
,
'HH:mm:ss'
),
// form
formCheck
:
this
.
$form
.
createForm
(
this
),
modalForm
:
this
.
$form
.
createForm
(
this
),
handOk
:
1
,
//新建or编辑
// 高级搜索 展开/关闭
advanced
:
false
,
// 查询参数
queryParam
:
{},
//查询参数
// 加载数据方法 必须为 Promise 对象
loadData
:
parameter
=>
{
return
getGoodsTemplateList
(
Object
.
assign
(
parameter
,
this
.
queryParam
))
.
then
(
res
=>
{
res
.
pageSize
=
res
.
_meta
.
perPage
;
res
.
page
=
res
.
_meta
.
currentPage
;
res
.
totalPage
=
res
.
_meta
.
pageCount
;
res
.
totalCount
=
res
.
_meta
.
totalCount
;
return
res
})
}
}
},
mounted
(){
// this.$refs.table.refresh();
},
methods
:
{
moment
,
// 删除
remove
(
value
){
deleteGoodsTemplate
(
value
).
then
(
res
=>
{
if
(
res
.
status
==
200
){
this
.
$message
.
success
(
res
.
message
);
this
.
$refs
.
table
.
refresh
();
}
}).
catch
(
err
=>
{
})
},
// 时间处理
checkTime
(
value
){
if
(
value
&&
value
!=
null
&&
value
!=
""
&&
value
!=
'undefined'
){
return
moment
(
value
,
'YYYY-MM-DD HH:mm:ss'
)
}
},
// 查询组展开关闭
toggleAdvanced
()
{
this
.
advanced
=
!
this
.
advanced
},
// 编辑
handleEdit
(
value
){
this
.
visible
=
true
;
if
(
value
==
1
){
this
.
handOk
=
1
;
// 新建
}
else
{
this
.
handOk
=
0
;
// 获取编辑详情
getTemplateDetails
({
GUID
:
value
.
GUID
}).
then
(
res
=>
{
this
.
modalForm
.
setFieldsValue
(
res
)
}).
catch
(
err
=>
{
})
}
},
// 下拉选择处理
checkNull
(
value
){
if
(
value
==
null
||
value
==
""
){
return
'0'
;
}
else
{
return
value
.
toString
()
}
},
handleStartOpenChange
(
open
){
if
(
!
open
){
this
.
endOpen
=
true
;
}
},
handleEndOpenChange
(
open
){
this
.
endOpen
=
open
;
},
handleOk
(){
if
(
this
.
handOk
==
1
){
// 新建
const
{
modalForm
:
{
validateFields
}
}
=
this
;
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
)
{
const
EvaluateModify
=
Object
.
assign
({
...
values
});
addGoosTemplate
(
EvaluateModify
).
then
(
res
=>
{
if
(
res
.
status
==
200
){
this
.
$message
.
success
(
res
.
message
)
this
.
visible
=
false
;
this
.
$refs
.
table
.
refresh
();
}
}).
catch
(
err
=>
{
})
}
})
}
else
{
// 编辑
const
{
modalForm
:
{
validateFields
}
}
=
this
;
validateFields
({
force
:
true
},
(
err
,
values
)
=>
{
if
(
!
err
)
{
const
EvaluateModify
=
Object
.
assign
({
...
values
});
modifyGoodsTemplate
(
EvaluateModify
).
then
(
res
=>
{
if
(
res
.
status
==
200
){
this
.
$message
.
success
(
res
.
message
)
this
.
visible
=
false
;
this
.
$refs
.
table
.
refresh
();
}
}).
catch
(
err
=>
{
})
}
})
}
},
}
}
</
script
>
<
style
lang=
"less"
scoped
>
.operator {
margin-bottom: 18px;
}
.table-operator .ant-btn-group{
display: flex!important;
}
.table-operator .ant-btn-group>span{
display: inline-block;
}
.ant-upload button{
margin-right:0;
}
</
style
>
src/views/userstaff/uList.vue
View file @
26550823
...
...
@@ -74,6 +74,7 @@
<a-form-item
:labelCol=
'labelCol'
:wrapperCol=
'wrapperCol'
hidden
>
<a-input
hidden
...
...
vue.config.js
View file @
26550823
...
...
@@ -102,7 +102,7 @@ const vueConfig = {
// If you want to turn on the proxy, please remove the mockjs /src/main.jsL11
proxy
:
{
'/apis'
:
{
target
:
'http://localhost/
hantengfei/newShopBack1
/backend/web/v1/'
,
target
:
'http://localhost/
dengxueyun/newshopBack
/backend/web/v1/'
,
ws
:
false
,
changeOrigin
:
true
,
pathRewrite
:{
...
...
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