Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
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
new-sing
admin-base
Commits
ecbafa04
Commit
ecbafa04
authored
Sep 06, 2018
by
王
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'development' of
http://git.singsingenglish.com/new-sing/admin
into development
parents
c31afee9
feecbdbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
20 deletions
+95
-20
dialog.vue
src/components/shop/dialog.vue
+95
-20
No files found.
src/components/shop/dialog.vue
View file @
ecbafa04
...
...
@@ -10,6 +10,20 @@
<el-form-item
label=
"商品名称"
>
<el-input
v-model=
"form.name"
></el-input>
</el-form-item>
<el-form-item
label=
"商品描述"
>
<el-input
v-model=
"form.goods_desc.desc"
></el-input>
</el-form-item>
<el-form-item
label=
"主图"
>
<el-upload
list-type=
"picture-card"
class=
"upload-demo"
action=
"/api/public/upload"
:http-request=
"uploadFileMain"
:file-list=
"form.goods_desc.img"
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"商品类型"
>
<el-select
v-model=
"form.goods_type"
placeholder=
"请选择"
>
<el-option
...
...
@@ -70,14 +84,26 @@
<el-form-item
label=
"现价"
>
<el-input-number
v-model=
"form.current_price"
label=
"现价"
></el-input-number>
元
</el-form-item>
<el-form-item
label=
"
商品描述
"
>
<el-input
v-model=
"form.
goods_desc"
type=
"textarea
"
></el-input>
<el-form-item
label=
"
分享标题
"
>
<el-input
v-model=
"form.
share_desc.title"
style=
"width: 200px
"
></el-input>
</el-form-item>
<el-form-item
label=
"分享内容"
>
<el-input
v-model=
"form.share_desc"
></el-input>
<el-input
v-model=
"form.share_desc.content"
></el-input>
</el-form-item>
<el-form-item
label=
"分享主图"
>
<el-upload
list-type=
"picture-card"
action=
"/api/public/upload"
:file-list=
"form.share_desc.img"
:http-request=
"uploadFileMain"
>
<i
class=
"el-icon-plus"
></i>
</el-upload>
</el-form-item>
<el-form-item
label=
"商品详情"
>
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.detail"
></el-input>
</el-form-item>
<el-form-item
label=
"
其他内容
"
>
<el-input
v-model=
"form.desc
"
></el-input>
<el-form-item
label=
"
Q&A详情
"
>
<el-input
type=
"textarea"
:rows=
"25"
v-model=
"form.desc.qa
"
></el-input>
</el-form-item>
</el-form>
...
...
@@ -91,7 +117,7 @@
</
template
>
<
script
>
import
{
getLessonApi
,
addGoodsApi
,
editGoodsApi
,
getGoodsDetailApi
}
from
"../../service/api"
;
import
{
getLessonApi
,
addGoodsApi
,
editGoodsApi
,
getGoodsDetailApi
,
uploadFileApi
}
from
"../../service/api"
;
import
{
TEACHERTYPE
}
from
"../../util/wordbook"
;
export
default
{
name
:
"dialogObj"
,
...
...
@@ -104,7 +130,10 @@
form
:{
name
:
''
,
goods_type
:
0
,
goods_desc
:
''
,
goods_desc
:{
desc
:
""
,
img
:[]
},
course_id
:
''
,
course_type
:
0
,
watch_num
:
''
,
...
...
@@ -112,9 +141,16 @@
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
''
,
share_desc
:
0
,
desc
:
''
is_auth_user
:
0
,
share_desc
:{
title
:
''
,
content
:
''
,
img
:[]
},
desc
:{
detail
:
""
,
qa
:
""
}
},
lessonList
:[]
}
...
...
@@ -124,6 +160,9 @@
let
_json
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
_json
.
original_price
=
_json
.
original_price
*
100
;
_json
.
current_price
=
_json
.
current_price
*
100
;
_json
.
goods_desc
=
JSON
.
stringify
(
_json
.
goods_desc
);
_json
.
desc
=
JSON
.
stringify
(
_json
.
desc
);
_json
.
share_desc
=
JSON
.
stringify
(
_json
.
share_desc
);
switch
(
this
.
dialogObj
.
type
){
case
1
:
// this.$refs['form'].validate((valid) => {
...
...
@@ -155,24 +194,60 @@
break
}
},
uploadFileMain
(
a
){
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
if
(
this
.
form
.
goods_desc
.
img
){
this
.
form
.
goods_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
goods_desc
.
img
=
[];
this
.
form
.
goods_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
uploadFileShare
(
a
){
this
.
$store
.
dispatch
(
'setProgress'
,{
type
:
'new'
,
id
:
a
.
file
.
uid
});
this
.
fileUid
=
a
.
file
.
uid
;
uploadFileApi
({
file
:
a
.
file
,
type
:
'local'
}).
then
(
res
=>
{
if
(
this
.
form
.
share_desc
.
img
){
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
else
{
this
.
form
.
share_desc
.
img
=
[];
this
.
form
.
share_desc
.
img
[
0
]
=
{
name
:
res
.
url
,
url
:
process
.
env
.
IMAGE_URL_HEAD
+
res
.
url
,
title
:
''
,
lable
:
''
}
}
})
},
initDialog
(){
switch
(
this
.
dialogObj
.
type
){
case
0
:
this
.
loading
=
false
;
this
.
form
=
{
name
:
''
,
goods_type
:
1
,
goods_desc
:
''
,
this
.
form
=
{
name
:
''
,
goods_type
:
0
,
goods_desc
:{
desc
:
""
,
img
:[]
},
course_id
:
''
,
course_type
:
1
,
course_type
:
0
,
watch_num
:
''
,
duration_num
:
0
,
original_price
:
''
,
current_price
:
''
,
is_real
:
0
,
is_auth_user
:
0
,
share_desc
:
0
,
desc
:
''
};
share_desc
:{
title
:
''
,
content
:
''
,
img
:[]
},
desc
:{
detail
:
""
,
qa
:
""
}
},
this
.
getLessonList
();
break
;
case
1
:
...
...
@@ -181,7 +256,7 @@
this
.
form
=
{
name
:
res
.
name
,
goods_type
:
res
.
goods_type
,
goods_desc
:
res
.
goods_desc
,
goods_desc
:
JSON
.
parse
(
res
.
goods_desc
)
,
course_id
:
res
.
course_id
,
course_type
:
res
.
course_type
,
watch_num
:
res
.
watch_num
,
...
...
@@ -190,8 +265,8 @@
current_price
:
res
.
current_price
/
100
,
is_real
:
res
.
is_real
,
is_auth_user
:
res
.
is_auth_user
,
share_desc
:
res
.
share_desc
,
desc
:
res
.
desc
share_desc
:
JSON
.
parse
(
res
.
share_desc
)
,
desc
:
JSON
.
parse
(
res
.
desc
)
};
this
.
getLessonList
()
});
...
...
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