Commit d3822bc9 authored by Davve's avatar Davve

修改样式

parent 84afe8a7
......@@ -59,8 +59,8 @@ class GroupUpdateOrCreate(APIView):
'description': request.POST.get('description', ''),
'creator_id': request.POST.get('user_id', ''),
'celebrity_ids': json.loads(request.POST.get('star', '')),
'is_online': request.POST.get('is_online', ''),
'is_recommend': request.POST.get('is_recommend', ''),
'is_online': int(request.POST.get('is_online', 0)),
'is_recommend': int(request.POST.get('is_recommend', 0)),
'group_user_ids': json.loads(request.POST.get('user_ids', '')),
'icon': request.POST.get('icon', '')[:-2]
}
......
......@@ -97,4 +97,24 @@ class PickUserListView(APIView):
raise e
return {
'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):
return {'data': data}
class StarSearchView(APIView):
class CelebritySearchView(APIView):
def get(self, request):
name = request.GET.get('name')
try:
......@@ -65,3 +65,13 @@ class CitySearchView(APIView):
except Exception as e:
raise e
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):
id = request.POST.get('id', '')
data = {
'name': request.POST.get('name'),
'gender': request.POST.get('gender'),
'gender': int(request.POST.get('gender')),
'city_id': request.POST.get('city'),
'is_online': int(request.POST.get('is_online')),
'desc': request.POST.get('description'),
......
......@@ -70,6 +70,8 @@ urlpatterns = [
url(r'^pick/detail/', UpdateOrCreateView.as_view()),
url(r'^pick/user/list$', 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()),
......@@ -83,8 +85,9 @@ search_urlpatterns = [
url(r'search/country', CountrySearchView.as_view()),
url(r'search/user', UserSearchView.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/topic', TopicSearchView.as_view()),
]
common_urlpatterns = [
......
......@@ -48,3 +48,19 @@ export function AddFakePickNums(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) {
export function starSearch(name) {
return request({
url: '/api/search/star',
url: '/api/search/celebrity',
method: 'get',
params: { name }
})
......@@ -47,3 +47,19 @@ export function citySearch(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 @@
user_id: '',
star: [],
icon: '',
is_online: 1,
is_online: 0,
is_recommend: 1,
user_ids: [],
}
......@@ -338,7 +338,8 @@
duration: 2000
})
setTimeout(() => {
this.$router.push('/group/list')
// this.$router.push('/group/list')
this.$router.go(0)
}, 1000)
}).catch(err => {
......@@ -372,7 +373,7 @@
this.getList()
},
appendUser() {
if (this.temp_user_ids){
if (this.temp_user_ids == ""){
this.$message.error('还没输入小组呢~~')
this.temp_user_ids = ''
return false
......@@ -431,7 +432,6 @@
starSearch(query).then(response => {
if (!response.data.data.data) return
this.starListOptions = response.data.data.data
console.log(response.data.data.data)
})
},
}
......
This diff is collapsed.
......@@ -298,7 +298,7 @@
this.postForm.city = this.temp_city_id;
}
console.log(this.postForm, '=====================')
starCreate(this.postForm).then(response => {
this.$notify({
title: '成功',
......
......@@ -101,6 +101,17 @@
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 = {
status: 'draft',
name: '',
......@@ -196,11 +207,10 @@
}
let flag = false;
let up_tag_arrays = this.postForm.up_tags.split(',')
let down_tags_arrays = this.postForm.down_tags.split(',')
for (let i = 0; i< up_tag_arrays.length; i++){
if (isInArray(down_tags_arrays, up_tag_arrays[i])){
let up_tag_arrays = removeNull(this.postForm.up_tags.split(','))
let down_tags_arrays = removeNull(this.postForm.down_tags.split(','))
for (let i = 0; i < up_tag_arrays.length; i++) {
if (isInArray(down_tags_arrays, up_tag_arrays[i])) {
this.$message.error('上下级标签不能存相同标签')
this.postForm.up_tags = [];
this.postForm.down_tags = [];
......@@ -208,7 +218,7 @@
break
}
}
if (flag){
if (flag) {
return false;
}
......
......@@ -146,6 +146,7 @@ export default {
SearchTypeOptions:[
{'key': 'id', 'display_name': '帖子ID'},
{'key': 'content', 'display_name': '帖子内容'},
{'key': 'group__name', 'display_name': '小组'},
],
ContentLevelTypeOptions:[
{'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