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
626302b9
Commit
626302b9
authored
Nov 26, 2018
by
Davve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善用户获取信息
parent
6b6f5db0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
22 deletions
+40
-22
pick.py
api/pick.py
+12
-4
push.py
api/push.py
+4
-3
user.py
api/user.py
+8
-4
PickDetail.vue
vu/src/views/pick/components/PickDetail.vue
+4
-5
UserDetail.vue
vu/src/views/user/components/UserDetail.vue
+12
-6
No files found.
api/pick.py
View file @
626302b9
...
...
@@ -12,7 +12,7 @@ class PickListView(APIView):
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/
community/pick/get'
](
offset
=
offse
t
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/
sun/pick/list'
](
offset
=
(
offset
-
1
)
*
limi
t
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
data
...
...
@@ -20,8 +20,15 @@ class PickListView(APIView):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
self
.
rpc
[
'venus/
community/pick/offline_pick'
](
type
=
type
,
ids
=
ids
)
.
unwrap
()
self
.
rpc
[
'venus/
sun/pick/batch/update'
](
updates
=
updates
,
ids
=
ids
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
@@ -33,12 +40,13 @@ class UpdateOrCreateView(APIView):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/
community/pick/detail
'
](
id
=
id
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/
sun/pick/get
'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'data'
:
data
}
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
),
'desc'
:
request
.
POST
.
get
(
'desc'
),
...
...
@@ -50,7 +58,7 @@ class UpdateOrCreateView(APIView):
'is_online'
:
request
.
POST
.
get
(
'is_online'
),
}
try
:
self
.
rpc
[
'venus/
community/pick/update_or_create'
](
data
=
data
)
.
unwrap
()
self
.
rpc
[
'venus/
sun/pick/edit'
](
id
=
id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
api/push.py
View file @
626302b9
...
...
@@ -13,7 +13,7 @@ class PushListView(APIView):
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
data
=
self
.
rpc
[
'venus/
community/push/sun_list'
](
offset
=
page
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/
sun/push/list'
](
offset
=
(
page
-
1
)
*
limit
,
limit
=
limit
,
filters
=
filter
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
data
...
...
@@ -23,7 +23,7 @@ class PushUpdateOrCreateView(APIView):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
try
:
data
=
self
.
rpc
[
'venus/
community
/push/get'
](
id
=
id
)
.
unwrap
()
data
=
self
.
rpc
[
'venus/
sun
/push/get'
](
id
=
id
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
'data'
:
data
}
...
...
@@ -38,9 +38,10 @@ class PushUpdateOrCreateView(APIView):
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
)[:
-
2
],
'content'
:
request
.
POST
.
get
(
'content'
,
''
),
'title'
:
request
.
POST
.
get
(
'title'
,
''
),
'creator_id'
:
''
# TODO 运营ID
}
try
:
self
.
rpc
[
'venus/
community/push/update_or_create
'
](
id
=
id
,
data
=
data
)
.
unwrap
()
self
.
rpc
[
'venus/
sun/push/edit
'
](
id
=
id
,
data
=
data
)
.
unwrap
()
except
Exception
as
e
:
raise
e
return
{
...
...
api/user.py
View file @
626302b9
...
...
@@ -3,6 +3,7 @@
# __author__ = "chenwei"
# Date: 2018/11/15
import
time
import
json
from
utils.base
import
APIView
from
utils.time_utils
import
analysis_time
...
...
@@ -33,16 +34,19 @@ class UserUpdateOrCreate(APIView):
return
data
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
user_
id
=
request
.
POST
.
get
(
'id'
,
''
)
show_time
=
analysis_time
(
request
.
POST
.
get
(
'show_time'
,
0
))
tag_ids
=
list
(
set
(
request
.
POST
.
get
(
'tag_ids'
)
.
split
(
','
)))
if
not
user_id
:
user_id
=
time
.
time
()
data
=
{
'user_id'
:
user_id
,
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'tag_ids'
:
request
.
POST
.
get
(
'tag_ids'
),
'tag_ids'
:
list
(
filter
(
lambda
x
:
x
,
tag_ids
)
),
'is_puppet'
:
request
.
POST
.
get
(
'is_puppet'
),
'city'
:
request
.
POST
.
get
(
'city'
),
'city
_id
'
:
request
.
POST
.
get
(
'city'
),
'show_time'
:
show_time
,
'phone'
:
request
.
POST
.
get
(
'phone'
),
'email'
:
request
.
POST
.
get
(
'email'
),
...
...
vu/src/views/pick/components/PickDetail.vue
View file @
626302b9
...
...
@@ -75,7 +75,7 @@
<el-row>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"45px"
label=
"地区:"
class=
"postInfo-container-item"
>
<el-select
v-model=
"postForm.region"
:remote-method=
"getRemote
Region
List"
filterable
remote
multiple
value-key=
"id"
<el-select
v-model=
"postForm.region"
:remote-method=
"getRemote
City
List"
filterable
remote
multiple
value-key=
"id"
placeholder=
"搜索地区"
style=
"width: 100%"
>
<el-option
v-for=
"(item,index) in regionListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
...
...
@@ -122,7 +122,7 @@
import
MDinput
from
'@/components/MDinput'
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
{
fetchPickDetail
,
CreatePick
}
from
'@/api/pick'
import
{
groupSearch
,
regionSearch
}
from
'@/api/remoteSearch'
import
{
groupSearch
,
regionSearch
,
citySearch
}
from
'@/api/remoteSearch'
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
function
Assembledata
(
target
,
source
)
{
...
...
@@ -241,7 +241,6 @@
this
.
postForm
.
region
=
Assembledata
(
this
.
temparray
[
'region'
],
this
.
postForm
.
region
);
this
.
postForm
.
pick_group
=
Assembledata
(
this
.
temparray
[
'pick_group'
],
this
.
postForm
.
pick_group
);
}
else
{
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
pick_group
=
this
.
postForm
.
pick_group
.
join
(
','
)
}
...
...
@@ -274,8 +273,8 @@
}
})
},
getRemote
Region
List
(
query
)
{
region
Search
(
query
).
then
(
response
=>
{
getRemote
City
List
(
query
)
{
city
Search
(
query
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
.
data
)
return
this
.
regionListOptions
=
response
.
data
.
data
.
data
})
...
...
vu/src/views/user/components/UserDetail.vue
View file @
626302b9
...
...
@@ -80,10 +80,10 @@
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"75px"
label=
"
地区
:"
>
<el-form-item
label-width=
"75px"
label=
"
城市
:"
>
<el-select
v-model=
"postForm.city"
:remote-method=
"getRemoteCityList"
filterable
remote
value-key=
"id"
placeholder=
"搜索
地区
"
style=
"width: 230px"
>
placeholder=
"搜索
城市
"
style=
"width: 230px"
>
<el-option
v-for=
"(item,index) in regionListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
...
...
@@ -307,7 +307,8 @@
del_list
:
[],
temp
:
{
tags
:[],
city_temp
:
''
,
city_temp_id
:
''
,
city_temp_name
:
''
,
group_ids
:
[]
}
}
...
...
@@ -333,7 +334,8 @@
let
rep
=
response
.
data
.
data
let
temp_tags
=
[]
this
.
postForm
=
response
.
data
.
data
console
.
log
(
rep
.
tag_list
.
length
)
this
.
temp
.
city_temp_id
=
response
.
data
.
data
.
city
.
id
this
.
postForm
.
city
=
this
.
temp
.
city_temp_name
=
response
.
data
.
data
.
city
.
name
for
(
let
i
=
0
;
i
<
rep
.
tag_list
.
length
;
i
++
){
temp_tags
.
push
(
rep
.
tag_list
[
i
].
name
)
this
.
temp
.
tags
.
push
(
rep
.
tag_list
[
i
])
...
...
@@ -351,6 +353,10 @@
this
.
loading
=
true
this
.
postForm
.
group_ids
=
JSON
.
stringify
(
this
.
temp
.
group_ids
)
if
(
this
.
temp
.
city_temp_name
===
this
.
postForm
.
city
){
this
.
postForm
.
city
=
this
.
temp
.
city_temp_id
}
if
(
this
.
isEdit
){
this
.
postForm
.
tag_ids
=
Assembledata
(
this
.
temp
.
tags
,
this
.
postForm
.
tag_ids
)
}
else
{
...
...
@@ -418,8 +424,8 @@
},
getRemoteTagList
(
query
)
{
tagSearch
(
query
).
then
(
response
=>
{
if
(
!
response
.
data
.
items
)
return
this
.
user
ListOptions
=
response
.
data
.
data
.
data
if
(
!
response
.
data
.
data
.
data
)
return
this
.
tag
ListOptions
=
response
.
data
.
data
.
data
})
},
getList
()
{
...
...
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