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):
...
@@ -12,7 +12,7 @@ class PickListView(APIView):
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
data
return
data
...
@@ -20,8 +20,15 @@ class PickListView(APIView):
...
@@ -20,8 +20,15 @@ class PickListView(APIView):
def
post
(
self
,
request
):
def
post
(
self
,
request
):
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
ids
=
request
.
POST
.
get
(
'ids'
,
''
)
.
split
()
type
=
request
.
POST
.
get
(
'type'
,
''
)
type
=
request
.
POST
.
get
(
'type'
,
''
)
updates
=
{}
if
type
==
'offline'
:
updates
[
'is_online'
]
=
0
else
:
updates
[
'is_online'
]
=
1
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
{
return
{
...
@@ -33,12 +40,13 @@ class UpdateOrCreateView(APIView):
...
@@ -33,12 +40,13 @@ class UpdateOrCreateView(APIView):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
id
=
request
.
GET
.
get
(
'id'
)
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
{
'data'
:
data
}
return
{
'data'
:
data
}
def
post
(
self
,
request
):
def
post
(
self
,
request
):
id
=
request
.
POST
.
get
(
'id'
,
''
)
data
=
{
data
=
{
'name'
:
request
.
POST
.
get
(
'name'
),
'name'
:
request
.
POST
.
get
(
'name'
),
'desc'
:
request
.
POST
.
get
(
'desc'
),
'desc'
:
request
.
POST
.
get
(
'desc'
),
...
@@ -50,7 +58,7 @@ class UpdateOrCreateView(APIView):
...
@@ -50,7 +58,7 @@ class UpdateOrCreateView(APIView):
'is_online'
:
request
.
POST
.
get
(
'is_online'
),
'is_online'
:
request
.
POST
.
get
(
'is_online'
),
}
}
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
{
return
{
...
...
api/push.py
View file @
626302b9
...
@@ -13,7 +13,7 @@ class PushListView(APIView):
...
@@ -13,7 +13,7 @@ class PushListView(APIView):
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
limit
=
int
(
request
.
GET
.
get
(
'limit'
,
10
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
filter
=
self
.
handle_filter
(
request
.
GET
.
get
(
'filter'
,
""
))
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
data
return
data
...
@@ -23,7 +23,7 @@ class PushUpdateOrCreateView(APIView):
...
@@ -23,7 +23,7 @@ class PushUpdateOrCreateView(APIView):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
id
=
request
.
GET
.
get
(
'id'
)
id
=
request
.
GET
.
get
(
'id'
)
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
{
'data'
:
data
}
return
{
'data'
:
data
}
...
@@ -38,9 +38,10 @@ class PushUpdateOrCreateView(APIView):
...
@@ -38,9 +38,10 @@ class PushUpdateOrCreateView(APIView):
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
)[:
-
2
],
'icon'
:
request
.
POST
.
get
(
'icon'
,
''
)[:
-
2
],
'content'
:
request
.
POST
.
get
(
'content'
,
''
),
'content'
:
request
.
POST
.
get
(
'content'
,
''
),
'title'
:
request
.
POST
.
get
(
'title'
,
''
),
'title'
:
request
.
POST
.
get
(
'title'
,
''
),
'creator_id'
:
''
# TODO 运营ID
}
}
try
:
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
:
except
Exception
as
e
:
raise
e
raise
e
return
{
return
{
...
...
api/user.py
View file @
626302b9
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# __author__ = "chenwei"
# __author__ = "chenwei"
# Date: 2018/11/15
# Date: 2018/11/15
import
time
import
json
import
json
from
utils.base
import
APIView
from
utils.base
import
APIView
from
utils.time_utils
import
analysis_time
from
utils.time_utils
import
analysis_time
...
@@ -33,16 +34,19 @@ class UserUpdateOrCreate(APIView):
...
@@ -33,16 +34,19 @@ class UserUpdateOrCreate(APIView):
return
data
return
data
def
post
(
self
,
request
):
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
))
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
=
{
data
=
{
'user_id'
:
user_id
,
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'is_recommend'
:
request
.
POST
.
get
(
'is_recommend'
),
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'profile_pic'
:
request
.
POST
.
get
(
'avatar'
)[:
-
2
],
'nick_name'
:
request
.
POST
.
get
(
'nick_name'
),
'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'
),
'is_puppet'
:
request
.
POST
.
get
(
'is_puppet'
),
'city'
:
request
.
POST
.
get
(
'city'
),
'city
_id
'
:
request
.
POST
.
get
(
'city'
),
'show_time'
:
show_time
,
'show_time'
:
show_time
,
'phone'
:
request
.
POST
.
get
(
'phone'
),
'phone'
:
request
.
POST
.
get
(
'phone'
),
'email'
:
request
.
POST
.
get
(
'email'
),
'email'
:
request
.
POST
.
get
(
'email'
),
...
...
vu/src/views/pick/components/PickDetail.vue
View file @
626302b9
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label-width=
"45px"
label=
"地区:"
class=
"postInfo-container-item"
>
<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%"
>
placeholder=
"搜索地区"
style=
"width: 100%"
>
<el-option
v-for=
"(item,index) in regionListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
<el-option
v-for=
"(item,index) in regionListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
</el-select>
</el-select>
...
@@ -122,7 +122,7 @@
...
@@ -122,7 +122,7 @@
import
MDinput
from
'@/components/MDinput'
import
MDinput
from
'@/components/MDinput'
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
Sticky
from
'@/components/Sticky'
// 粘性header组件
import
{
fetchPickDetail
,
CreatePick
}
from
'@/api/pick'
import
{
fetchPickDetail
,
CreatePick
}
from
'@/api/pick'
import
{
groupSearch
,
regionSearch
}
from
'@/api/remoteSearch'
import
{
groupSearch
,
regionSearch
,
citySearch
}
from
'@/api/remoteSearch'
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
import
{
isInArray
,
removeByvale
}
from
"@/utils"
;
function
Assembledata
(
target
,
source
)
{
function
Assembledata
(
target
,
source
)
{
...
@@ -241,7 +241,6 @@
...
@@ -241,7 +241,6 @@
this
.
postForm
.
region
=
Assembledata
(
this
.
temparray
[
'region'
],
this
.
postForm
.
region
);
this
.
postForm
.
region
=
Assembledata
(
this
.
temparray
[
'region'
],
this
.
postForm
.
region
);
this
.
postForm
.
pick_group
=
Assembledata
(
this
.
temparray
[
'pick_group'
],
this
.
postForm
.
pick_group
);
this
.
postForm
.
pick_group
=
Assembledata
(
this
.
temparray
[
'pick_group'
],
this
.
postForm
.
pick_group
);
}
else
{
}
else
{
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
region
=
this
.
postForm
.
region
.
join
(
','
)
this
.
postForm
.
pick_group
=
this
.
postForm
.
pick_group
.
join
(
','
)
this
.
postForm
.
pick_group
=
this
.
postForm
.
pick_group
.
join
(
','
)
}
}
...
@@ -274,8 +273,8 @@
...
@@ -274,8 +273,8 @@
}
}
})
})
},
},
getRemote
Region
List
(
query
)
{
getRemote
City
List
(
query
)
{
region
Search
(
query
).
then
(
response
=>
{
city
Search
(
query
).
then
(
response
=>
{
if
(
!
response
.
data
.
data
.
data
)
return
if
(
!
response
.
data
.
data
.
data
)
return
this
.
regionListOptions
=
response
.
data
.
data
.
data
this
.
regionListOptions
=
response
.
data
.
data
.
data
})
})
...
...
vu/src/views/user/components/UserDetail.vue
View file @
626302b9
...
@@ -80,10 +80,10 @@
...
@@ -80,10 +80,10 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<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
<el-select
v-model=
"postForm.city"
:remote-method=
"getRemoteCityList"
filterable
remote
value-key=
"id"
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"
<el-option
v-for=
"(item,index) in regionListOptions"
:key=
"item+index"
:label=
"item.name"
:value=
"item.id"
/>
:value=
"item.id"
/>
</el-select>
</el-select>
...
@@ -307,7 +307,8 @@
...
@@ -307,7 +307,8 @@
del_list
:
[],
del_list
:
[],
temp
:
{
temp
:
{
tags
:[],
tags
:[],
city_temp
:
''
,
city_temp_id
:
''
,
city_temp_name
:
''
,
group_ids
:
[]
group_ids
:
[]
}
}
}
}
...
@@ -333,7 +334,8 @@
...
@@ -333,7 +334,8 @@
let
rep
=
response
.
data
.
data
let
rep
=
response
.
data
.
data
let
temp_tags
=
[]
let
temp_tags
=
[]
this
.
postForm
=
response
.
data
.
data
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
++
){
for
(
let
i
=
0
;
i
<
rep
.
tag_list
.
length
;
i
++
){
temp_tags
.
push
(
rep
.
tag_list
[
i
].
name
)
temp_tags
.
push
(
rep
.
tag_list
[
i
].
name
)
this
.
temp
.
tags
.
push
(
rep
.
tag_list
[
i
])
this
.
temp
.
tags
.
push
(
rep
.
tag_list
[
i
])
...
@@ -351,6 +353,10 @@
...
@@ -351,6 +353,10 @@
this
.
loading
=
true
this
.
loading
=
true
this
.
postForm
.
group_ids
=
JSON
.
stringify
(
this
.
temp
.
group_ids
)
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
){
if
(
this
.
isEdit
){
this
.
postForm
.
tag_ids
=
Assembledata
(
this
.
temp
.
tags
,
this
.
postForm
.
tag_ids
)
this
.
postForm
.
tag_ids
=
Assembledata
(
this
.
temp
.
tags
,
this
.
postForm
.
tag_ids
)
}
else
{
}
else
{
...
@@ -418,8 +424,8 @@
...
@@ -418,8 +424,8 @@
},
},
getRemoteTagList
(
query
)
{
getRemoteTagList
(
query
)
{
tagSearch
(
query
).
then
(
response
=>
{
tagSearch
(
query
).
then
(
response
=>
{
if
(
!
response
.
data
.
items
)
return
if
(
!
response
.
data
.
data
.
data
)
return
this
.
user
ListOptions
=
response
.
data
.
data
.
data
this
.
tag
ListOptions
=
response
.
data
.
data
.
data
})
})
},
},
getList
()
{
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