Commit d3822bc9 authored by Davve's avatar Davve

修改样式

parent 84afe8a7
...@@ -59,8 +59,8 @@ class GroupUpdateOrCreate(APIView): ...@@ -59,8 +59,8 @@ class GroupUpdateOrCreate(APIView):
'description': request.POST.get('description', ''), 'description': request.POST.get('description', ''),
'creator_id': request.POST.get('user_id', ''), 'creator_id': request.POST.get('user_id', ''),
'celebrity_ids': json.loads(request.POST.get('star', '')), 'celebrity_ids': json.loads(request.POST.get('star', '')),
'is_online': request.POST.get('is_online', ''), 'is_online': int(request.POST.get('is_online', 0)),
'is_recommend': request.POST.get('is_recommend', ''), 'is_recommend': int(request.POST.get('is_recommend', 0)),
'group_user_ids': json.loads(request.POST.get('user_ids', '')), 'group_user_ids': json.loads(request.POST.get('user_ids', '')),
'icon': request.POST.get('icon', '')[:-2] 'icon': request.POST.get('icon', '')[:-2]
} }
......
...@@ -97,4 +97,24 @@ class PickUserListView(APIView): ...@@ -97,4 +97,24 @@ class PickUserListView(APIView):
raise e raise e
return { return {
'message': '操作失败' 'message': '操作失败'
} }
\ No newline at end of file
class PickTopicView(APIView):
def get(self, request):
topic_id = request.GET.get('id')
try:
data = self.rpc['venus/sun/topic/pick_topic'](id=topic_id).unwrap()
except Exception as e:
raise e
return [data, ]
class PickCelebrityListView(APIView):
def get(self, request):
celebrity_id = request.GET.get('id')
try:
data = self.rpc['venus/sun/pick/pick_celebrity'](id=celebrity_id).unwrap()
except Exception as e:
raise e
return [data, ]
\ No newline at end of file
...@@ -47,7 +47,7 @@ class TagSearchView(APIView): ...@@ -47,7 +47,7 @@ class TagSearchView(APIView):
return {'data': data} return {'data': data}
class StarSearchView(APIView): class CelebritySearchView(APIView):
def get(self, request): def get(self, request):
name = request.GET.get('name') name = request.GET.get('name')
try: try:
...@@ -65,3 +65,13 @@ class CitySearchView(APIView): ...@@ -65,3 +65,13 @@ class CitySearchView(APIView):
except Exception as e: except Exception as e:
raise e raise e
return {'data': data} return {'data': data}
class TopicSearchView(APIView):
def get(self, request):
name = request.GET.get('name')
try:
data = self.rpc['venus/sun/topic/search'](name=name).unwrap()
except Exception as e:
raise e
return {'data': data}
...@@ -50,7 +50,7 @@ class CelebrityUpdateOrCreate(APIView): ...@@ -50,7 +50,7 @@ class CelebrityUpdateOrCreate(APIView):
id = request.POST.get('id', '') id = request.POST.get('id', '')
data = { data = {
'name': request.POST.get('name'), 'name': request.POST.get('name'),
'gender': request.POST.get('gender'), 'gender': int(request.POST.get('gender')),
'city_id': request.POST.get('city'), 'city_id': request.POST.get('city'),
'is_online': int(request.POST.get('is_online')), 'is_online': int(request.POST.get('is_online')),
'desc': request.POST.get('description'), 'desc': request.POST.get('description'),
......
...@@ -70,6 +70,8 @@ urlpatterns = [ ...@@ -70,6 +70,8 @@ urlpatterns = [
url(r'^pick/detail/', UpdateOrCreateView.as_view()), url(r'^pick/detail/', UpdateOrCreateView.as_view()),
url(r'^pick/user/list$', PickUserListView.as_view()), url(r'^pick/user/list$', PickUserListView.as_view()),
url(r'^pick/add_fake_pick_nums$', PickUserListView.as_view()), url(r'^pick/add_fake_pick_nums$', PickUserListView.as_view()),
url(r'^pick/topic', PickTopicView.as_view()),
url(r'^pick/celebrity', PickCelebrityListView.as_view()),
# 标签相关 # 标签相关
url(r'^tag/list$', TagListView.as_view()), url(r'^tag/list$', TagListView.as_view()),
...@@ -83,8 +85,9 @@ search_urlpatterns = [ ...@@ -83,8 +85,9 @@ search_urlpatterns = [
url(r'search/country', CountrySearchView.as_view()), url(r'search/country', CountrySearchView.as_view()),
url(r'search/user', UserSearchView.as_view()), url(r'search/user', UserSearchView.as_view()),
url(r'search/tag', TagSearchView.as_view()), url(r'search/tag', TagSearchView.as_view()),
url(r'search/star', StarSearchView.as_view()), url(r'search/celebrity', CelebritySearchView.as_view()),
url(r'search/city', CitySearchView.as_view()), url(r'search/city', CitySearchView.as_view()),
url(r'search/topic', TopicSearchView.as_view()),
] ]
common_urlpatterns = [ common_urlpatterns = [
......
...@@ -48,3 +48,19 @@ export function AddFakePickNums(data) { ...@@ -48,3 +48,19 @@ export function AddFakePickNums(data) {
data data
}) })
} }
export function PickTopicDetail(id) {
return request({
url: '/api/pick/topic',
method: 'get',
params: { id }
})
}
export function PickCelebrityDetail(id) {
return request({
url: '/api/pick/celebrity',
method: 'get',
params: { id }
})
}
...@@ -34,7 +34,7 @@ export function tagSearch(name) { ...@@ -34,7 +34,7 @@ export function tagSearch(name) {
export function starSearch(name) { export function starSearch(name) {
return request({ return request({
url: '/api/search/star', url: '/api/search/celebrity',
method: 'get', method: 'get',
params: { name } params: { name }
}) })
...@@ -47,3 +47,19 @@ export function citySearch(name) { ...@@ -47,3 +47,19 @@ export function citySearch(name) {
params: { name } params: { name }
}) })
} }
export function celebritySearch(name) {
return request({
url: '/api/search/celebrity',
method: 'get',
params: { name }
})
}
export function topicSearch(name) {
return request({
url: '/api/search/topic',
method: 'get',
params: { name }
})
}
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
user_id: '', user_id: '',
star: [], star: [],
icon: '', icon: '',
is_online: 1, is_online: 0,
is_recommend: 1, is_recommend: 1,
user_ids: [], user_ids: [],
} }
...@@ -338,7 +338,8 @@ ...@@ -338,7 +338,8 @@
duration: 2000 duration: 2000
}) })
setTimeout(() => { setTimeout(() => {
this.$router.push('/group/list') // this.$router.push('/group/list')
this.$router.go(0)
}, 1000) }, 1000)
}).catch(err => { }).catch(err => {
...@@ -372,7 +373,7 @@ ...@@ -372,7 +373,7 @@
this.getList() this.getList()
}, },
appendUser() { appendUser() {
if (this.temp_user_ids){ if (this.temp_user_ids == ""){
this.$message.error('还没输入小组呢~~') this.$message.error('还没输入小组呢~~')
this.temp_user_ids = '' this.temp_user_ids = ''
return false return false
...@@ -431,7 +432,6 @@ ...@@ -431,7 +432,6 @@
starSearch(query).then(response => { starSearch(query).then(response => {
if (!response.data.data.data) return if (!response.data.data.data) return
this.starListOptions = response.data.data.data this.starListOptions = response.data.data.data
console.log(response.data.data.data)
}) })
}, },
} }
......
This diff is collapsed.
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
this.postForm.city = this.temp_city_id; this.postForm.city = this.temp_city_id;
} }
console.log(this.postForm, '=====================')
starCreate(this.postForm).then(response => { starCreate(this.postForm).then(response => {
this.$notify({ this.$notify({
title: '成功', title: '成功',
......
...@@ -101,6 +101,17 @@ ...@@ -101,6 +101,17 @@
return region_data.join(',') return region_data.join(',')
} }
function removeNull(parkingList) {
for (let i = 0; i < parkingList.length; i++) {
if (parkingList[i] == '' || parkingList[i] == null || typeof(parkingList[i]) == undefined) {
parkingList.splice(i, 1);
i = i - 1;
}
}
return parkingList
}
const defaultForm = { const defaultForm = {
status: 'draft', status: 'draft',
name: '', name: '',
...@@ -196,11 +207,10 @@ ...@@ -196,11 +207,10 @@
} }
let flag = false; let flag = false;
let up_tag_arrays = this.postForm.up_tags.split(',') let up_tag_arrays = removeNull(this.postForm.up_tags.split(','))
let down_tags_arrays = this.postForm.down_tags.split(',') let down_tags_arrays = removeNull(this.postForm.down_tags.split(','))
for (let i = 0; i < up_tag_arrays.length; i++) {
for (let i = 0; i< up_tag_arrays.length; i++){ if (isInArray(down_tags_arrays, up_tag_arrays[i])) {
if (isInArray(down_tags_arrays, up_tag_arrays[i])){
this.$message.error('上下级标签不能存相同标签') this.$message.error('上下级标签不能存相同标签')
this.postForm.up_tags = []; this.postForm.up_tags = [];
this.postForm.down_tags = []; this.postForm.down_tags = [];
...@@ -208,7 +218,7 @@ ...@@ -208,7 +218,7 @@
break break
} }
} }
if (flag){ if (flag) {
return false; return false;
} }
......
...@@ -146,6 +146,7 @@ export default { ...@@ -146,6 +146,7 @@ export default {
SearchTypeOptions:[ SearchTypeOptions:[
{'key': 'id', 'display_name': '帖子ID'}, {'key': 'id', 'display_name': '帖子ID'},
{'key': 'content', 'display_name': '帖子内容'}, {'key': 'content', 'display_name': '帖子内容'},
{'key': 'group__name', 'display_name': '小组'},
], ],
ContentLevelTypeOptions:[ ContentLevelTypeOptions:[
{'key': 0, 'display_name': '未审核'}, {'key': 0, 'display_name': '未审核'},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment