Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sun
Project
Project
Details
Activity
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
钟尚武
sun
Commits
938e4cf3
Commit
938e4cf3
authored
6 years ago
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成pick后端接口
parent
9176b660
master
dev
like-pre/r01
quick-reply
refactor
test
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
28 deletions
+12
-28
pick.py
api/pick.py
+2
-11
pick.js
vu/src/api/pick.js
+1
-10
PickDetail.vue
vu/src/views/pick/components/PickDetail.vue
+9
-7
No files found.
api/pick.py
View file @
938e4cf3
...
...
@@ -35,16 +35,7 @@ class UpdateOrCreateView(APIView):
try
:
data
=
self
.
rpc
[
'venus/community/pick/detail'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
# raise e
data
=
{
'name'
:
1
,
'desc'
:
'hahah'
,
'gender'
:
'哈哈'
,
'region'
:
'123124312423'
,
'pick_type'
:
'www.baid.com'
,
'position'
:
22
,
'is_online'
:
1
}
raise
e
return
{
'data'
:
data
}
def
post
(
self
,
request
):
...
...
@@ -58,7 +49,7 @@ class UpdateOrCreateView(APIView):
'is_online'
:
request
.
POST
.
get
(
' is_online'
),
}
try
:
self
.
rpc
[
'venus/community/pick/create'
](
data
=
data
)
.
unwrap
()
self
.
rpc
[
'venus/community/pick/
update_or_
create'
](
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
This diff is collapsed.
Click to expand it.
vu/src/api/pick.js
View file @
938e4cf3
...
...
@@ -17,15 +17,6 @@ export function OffLineOrOnLine(data) {
})
}
export
function
fetchPickDetail
(
id
)
{
return
request
({
url
:
'/api/account/detail'
,
method
:
'get'
,
param
:
{
id
}
})
}
export
function
CreatePick
(
data
)
{
return
request
({
url
:
'/api/pick/create'
,
...
...
@@ -34,7 +25,7 @@ export function CreatePick(data) {
})
}
export
function
fetchP
P
ickDetail
(
id
)
{
export
function
fetchPickDetail
(
id
)
{
return
request
({
url
:
'/api/pick/detail'
,
method
:
'get'
,
...
...
This diff is collapsed.
Click to expand it.
vu/src/views/pick/components/PickDetail.vue
View file @
938e4cf3
...
...
@@ -2,7 +2,7 @@
<div
class=
"createPost-container"
>
<el-form
ref=
"postForm"
:model=
"postForm"
:rules=
"rules"
class=
"form-container"
>
<sticky
:class-name=
"'sub-navbar
'+postForm.status
"
>
<sticky
:class-name=
"'sub-navbar
'
"
>
<el-button
v-loading=
"loading"
style=
"margin-left: 10px;"
type=
"success"
@
click=
"submitForm"
>
发布
</el-button>
</sticky>
...
...
@@ -72,11 +72,11 @@
<
script
>
import
MDinput
from
'@/components/MDinput'
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
{
fetchPickDetail
,
CreatePick
,
fetchPPickDetail
}
from
'@/api/pick'
import
{
fetchPickDetail
,
CreatePick
}
from
'@/api/pick'
import
{
userSearch
}
from
'@/api/remoteSearch'
const
defaultForm
=
{
status
:
'draft'
,
//
status: 'draft',
name
:
''
,
desc
:
''
,
gender
:
''
,
...
...
@@ -87,7 +87,7 @@ const defaultForm = {
}
export
default
{
name
:
'
Article
Detail'
,
name
:
'
Pick
Detail'
,
components
:
{
MDinput
,
Sticky
},
props
:
{
isEdit
:
{
...
...
@@ -127,6 +127,7 @@ export default {
created
()
{
if
(
this
.
isEdit
)
{
const
id
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
id
console
.
log
(
id
)
this
.
fetchData
(
id
)
}
else
{
this
.
postForm
=
Object
.
assign
({},
defaultForm
)
...
...
@@ -136,8 +137,9 @@ export default {
},
methods
:
{
fetchData
(
id
)
{
fetchPPickDetail
(
id
).
then
(
response
=>
{
this
.
postForm
=
response
.
data
.
data
.
data
fetchPickDetail
(
id
).
then
(
response
=>
{
console
.
log
(
response
.
data
.
data
.
data
)
// this.postForm = response.data.data.data
}).
catch
(
err
=>
{
console
.
log
(
err
)
...
...
@@ -169,7 +171,7 @@ export default {
});
this
.
postForm
.
status
=
'published'
//
this.postForm.status = 'published'
this
.
loading
=
false
}
else
{
console
.
log
(
'error submit!!'
)
...
...
This diff is collapsed.
Click to expand it.
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