Commit 4eda70c0 authored by yuwenwen's avatar yuwenwen

修改BUG

parent b26f2218
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<el-input placeholder="请输入" v-model="queryParams.userName"></el-input> <el-input placeholder="请输入" v-model="queryParams.userName"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary">搜索</el-button> <el-button type="primary" @click="handleQuery">搜索</el-button>
<el-button>重置</el-button> <el-button @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div v-if="selectDataList.length > 0" class="mb20"> <div v-if="selectDataList.length > 0" class="mb20">
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
{{ tag.nickName }} {{ tag.nickName }}
</el-tag> </el-tag>
</div> </div>
<el-table ref="tableRef" row-key="userName" :data="list" @selection-change="handleCheckboxChange" v-loading="loading"> <el-table ref="tableRef" row-key="userName" :data="list" @selection-change="handleCheckboxChange"
v-loading="loading">
<el-table-column type="selection" width="60"></el-table-column> <el-table-column type="selection" width="60"></el-table-column>
<el-table-column label="姓名" prop="nickName" align="center"></el-table-column> <el-table-column label="姓名" prop="nickName" align="center"></el-table-column>
<el-table-column label="用户名" prop="userName" align="center"></el-table-column> <el-table-column label="用户名" prop="userName" align="center"></el-table-column>
...@@ -42,11 +43,12 @@ export default { ...@@ -42,11 +43,12 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
nickName: '' nickName: '',
userName: ''
}, },
total: 0, total: 0,
selectDataList: [], selectDataList: [],
loading:false loading: false
} }
}, },
props: { props: {
...@@ -69,6 +71,19 @@ export default { ...@@ -69,6 +71,19 @@ export default {
this.getList(data) this.getList(data)
}, },
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
handleReset() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nickName: '',
userName: ''
}
this.getList()
},
getList(data) { getList(data) {
this.loading = true; this.loading = true;
listData(this.queryParams).then(res => { listData(this.queryParams).then(res => {
...@@ -77,7 +92,7 @@ export default { ...@@ -77,7 +92,7 @@ export default {
if (data) { if (data) {
this.getDetail(data) this.getDetail(data)
} }
}).finally(()=>{ }).finally(() => {
this.loading = false this.loading = false
}) })
}, },
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="page-container"> <div class="page-container">
<el-form :model="queryParams" :inline="true" label-width="80px"> <el-form :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="评论内容"> <el-form-item label="评论内容">
<el-input v-model="queryParams.content" placeholder="请输入"></el-input> <el-input v-model="queryParams.momentContent" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="姓名"> <el-form-item label="姓名">
<el-input v-model="queryParams.nickName" placeholder="请输入"></el-input> <el-input v-model="queryParams.nickName" placeholder="请输入"></el-input>
......
...@@ -7,8 +7,9 @@ ...@@ -7,8 +7,9 @@
<el-input placeholder="请输入" v-model="queryParams.content" style="width: 220px;"></el-input> <el-input placeholder="请输入" v-model="queryParams.content" style="width: 220px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间">
<el-date-picker placeholder="请选择" format="yyyy-MM-dd" value-format="yyyy-MM-dd" <el-date-picker placeholder="请选择" type="daterange" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="queryParams.createTime"></el-date-picker> v-model="dateRange" range-separator="至" start-placeholder="开始时间"
end-placeholder="结束时间" @change="dateChange"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button> <el-button type="primary" @click="handleQuery">查询</el-button>
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
</template> </template>
<script> <script>
import { listData , delData} from '@/api/moments'; import { listData, delData } from '@/api/moments';
import DetailDialog from './DetailDialog.vue'; import DetailDialog from './DetailDialog.vue';
export default { export default {
name: 'Moments', name: 'Moments',
...@@ -58,7 +59,7 @@ export default { ...@@ -58,7 +59,7 @@ export default {
dateRange: [], dateRange: [],
} }
}, },
components:{ components: {
DetailDialog DetailDialog
}, },
created() { created() {
...@@ -90,6 +91,12 @@ export default { ...@@ -90,6 +91,12 @@ export default {
this.getList() this.getList()
}) })
}, },
dateChange(val){
if(val.length > 0){
this.queryParams['params[startTime]'] = val[0]
this.queryParams['params[endTime]'] = val[1]
}
},
// 查询 // 查询
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
...@@ -101,6 +108,7 @@ export default { ...@@ -101,6 +108,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
} }
this.dateRange = []
this.getList() this.getList()
} }
} }
......
...@@ -4,16 +4,13 @@ ...@@ -4,16 +4,13 @@
<el-form :model="queryParams" :inline="true" label-width="80px"> <el-form :model="queryParams" :inline="true" label-width="80px">
<el-form-item label="兑换时间"> <el-form-item label="兑换时间">
<el-date-picker v-model="dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" <el-date-picker v-model="dateRange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
style="width: 220px;" value-format="YYYY-MM-DD" @change="dateChange"></el-date-picker> style="width: 240px;" value-format="yyyy-MM-dd" @change="dateChange"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="兑换人"> <el-form-item label="兑换人">
<el-input placeholder="请输入" v-model="queryParams.userName" style="width: 220px;"></el-input> <el-input placeholder="请输入" v-model="queryParams.userName" style="width: 220px;"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="兑换商品"> <el-form-item label="兑换商品">
<el-select v-model="queryParams.goodsCode" placeholder="请选择" style="width: 220px;"> <el-input placeholder="请输入" v-model="queryParams.goodsName" style="width: 220px;"></el-input>
<el-option v-for="(item, index) in optionList" :label="item.name" :value="item.code"
:key="index"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button> <el-button type="primary" @click="handleQuery">查询</el-button>
...@@ -109,9 +106,9 @@ export default { ...@@ -109,9 +106,9 @@ export default {
}, },
// 时间段选择 // 时间段选择
dateChange(val){ dateChange(val){
if(val){ if(val.length > 0){
this.queryParams.startTime = val[0] this.queryParams['params[startTime]'] = val[0]
this.queryParams.endTime = val[1] this.queryParams['params[endTime]'] = val[1]
} }
}, },
// 查询 // 查询
......
...@@ -78,7 +78,7 @@ export default { ...@@ -78,7 +78,7 @@ export default {
}, },
// 查详情 // 查详情
getDetail(row) { getDetail(row) {
detailData(row.id).then(res => { detailData(row.code).then(res => {
console.log(res) console.log(res)
this.form = { ...res.data } this.form = { ...res.data }
}) })
......
<template> <template>
<el-dialog :visible.sync="visible" v-if="visible" title="积分兑换" width="36%" class="dialog" @close="handleClose"> <el-dialog :visible.sync="visible" v-if="visible" title="积分兑换" width="36%" class="dialog" @close="handleClose">
<el-form :model="form" ref="formRef" label-position="top" :rules="rules"> <el-form :model="form" ref="formRef" label-position="top" :rules="rules">
<el-form-item label="兑换人"> <el-form-item label="兑换人" prop="userName">
<UserSelectInput :value.sync="form.userName" placeholder="请选择兑换人"></UserSelectInput> <UserSelectInput v-model="form.userName" :value.sync="form.userName" placeholder="请选择兑换人"></UserSelectInput>
</el-form-item> </el-form-item>
<el-form-item label="会员等级"> <el-form-item label="会员等级">
<el-input v-model="form.gradeName" :readonly="true" placeholder="请输入"></el-input> <el-input v-model="form.gradeName" :readonly="true" placeholder="请输入"></el-input>
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
userList: [], userList: [],
optionList: [], optionList: [],
rules: { rules: {
userName:[{required: true, message: '请选择兑换人', trigger:['blur', 'change']}],
goodsCode: [{ required: true, message: '请选择兑换商品', trigger: ['blur', 'change'] }] goodsCode: [{ required: true, message: '请选择兑换商品', trigger: ['blur', 'change'] }]
}, },
disabled: false disabled: false
...@@ -80,14 +81,6 @@ export default { ...@@ -80,14 +81,6 @@ export default {
goodsCode, goodsCode,
currentPoints currentPoints
} }
if (!userName) {
this.$modal.msgError("请选择兑换人");
return;
}
// if (!code) {
// this.$modal.msgError("请选择兑换商品");
// return;
// }
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
exchange(data).then(res => { exchange(data).then(res => {
......
<template>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload ref="upload" :limit="1" accept=".txt" :headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>导入文件格式:导入txt文件,每个敏感词占一行</span>
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板</el-link> -->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm">确 定</el-button>
<el-button @click="upload.open = false">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { getToken } from "@/utils/auth";
export default {
data() {
return {
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "批量导入敏感词",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
headers: { Authorization: "Bearer " + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + "/bbs/moment/sensitive/word/import"
},
}
},
created() {
},
methods: {
openModal(){
this.upload.open = true
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
this.$emit('handleOk')
},
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit();
}
}
}
</script>
\ No newline at end of file
...@@ -35,12 +35,15 @@ ...@@ -35,12 +35,15 @@
<!-- 表单 --> <!-- 表单 -->
<form-dialog ref="formDialogRef" @handleOk="handleReset"></form-dialog> <form-dialog ref="formDialogRef" @handleOk="handleReset"></form-dialog>
<!-- 批量导入 -->
<batch-import ref="batchImportRef" @handleOk="handleReset"></batch-import>
</div> </div>
</template> </template>
<script> <script>
import { listData, setTop ,delData} from '@/api/sensitives'; import { listData, setTop ,delData} from '@/api/sensitives';
import FormDialog from './FormDialog.vue'; import FormDialog from './FormDialog.vue';
import BatchImport from './BatchImport.vue';
export default { export default {
name: 'Sensitives', name: 'Sensitives',
data() { data() {
...@@ -54,7 +57,8 @@ export default { ...@@ -54,7 +57,8 @@ export default {
} }
}, },
components: { components: {
FormDialog FormDialog,
BatchImport
}, },
created() { created() {
...@@ -104,7 +108,7 @@ export default { ...@@ -104,7 +108,7 @@ export default {
}, },
// 导入敏感词 // 导入敏感词
handleImport(){ handleImport(){
this.$refs.batchImportRef.openModal()
}, },
} }
} }
......
...@@ -8,27 +8,32 @@ ...@@ -8,27 +8,32 @@
<view class="publish-box"> <view class="publish-box">
<textarea class="textarea" v-model="form.content" placeholder="分享有趣事~" <textarea class="textarea" v-model="form.content" placeholder="分享有趣事~"
placeholder-class="placeholder-class" /> placeholder-class="placeholder-class" />
<image-upload v-model="form.attachments" :limit="9" :showIcons="true" @componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"></image-upload> <image-upload v-model="form.attachments" :limit="9" :showIcons="true"
@componentsType="handleSetComponentsType" @handleTopic="handleOpenTopicSelection"></image-upload>
</view> </view>
<view class="permission-box"> <view class="permission-box">
<view class="item"> <view class="item">
<view class="text">允许评论</view> <view class="text">允许评论</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableComment')" :checked="form.isEnableComment==1" /> <switch color="#00E165" @change="(val)=>handleChange(val,'isEnableComment')"
:checked="form.isEnableComment==1" />
</view> </view>
<view class="item"> <view class="item">
<view class="text">开启评论精选</view> <view class="text">开启评论精选</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableFeaturedComment')" :checked="form.isEnableFeaturedComment==1"/> <switch color="#00E165" @change="(val)=>handleChange(val,'isEnableFeaturedComment')"
:checked="form.isEnableFeaturedComment==1" />
</view> </view>
<view class="item"> <view class="item">
<view class="text">开启PK</view> <view class="text">开启PK</view>
<switch color="#00E165" @change="(val)=>handleChange(val,'isEnableVote')" :checked="form.isEnableVote==1"/> <switch color="#00E165" @change="(val)=>handleChange(val,'isEnableVote')"
:checked="form.isEnableVote==1" />
</view> </view>
</view> </view>
<!-- pk数据编辑 --> <!-- pk数据编辑 -->
<view class="pk-edit-box" v-if="form.isEnableVote==1"> <view class="pk-edit-box" v-if="form.isEnableVote==1">
<view class="textarea-box"> <view class="textarea-box">
<textarea class="textarea" v-model="form.voteTitle" placeholder="请输入PK标题~(0/12)" placeholder-class="placeholder-class" /> <textarea class="textarea" v-model="form.voteTitle" placeholder="请输入PK标题~(0/12)"
placeholder-class="placeholder-class" />
</view> </view>
<view class="pk-type-box"> <view class="pk-type-box">
<radio-group v-model="form.voteOptionType" @change="radioChange"> <radio-group v-model="form.voteOptionType" @change="radioChange">
...@@ -42,11 +47,13 @@ ...@@ -42,11 +47,13 @@
<view class="choice-box" v-if="form.voteOptionType=='IMAGE'"> <view class="choice-box" v-if="form.voteOptionType=='IMAGE'">
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120" :showIcons="false"></image-upload> <image-upload v-model="voteOptionsAffirmative" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[0].name" placeholder="请输入选项1(4字以内)" /> <input class="text" v-model="form.voteOptions[0].name" placeholder="请输入选项1(4字以内)" />
</view> </view>
<view class="choice-item"> <view class="choice-item">
<image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120" :showIcons="false"></image-upload> <image-upload v-model="voteOptionsOpposing" :limit="1" :width="120" :height="120"
:showIcons="false"></image-upload>
<input class="text" v-model="form.voteOptions[1].name" placeholder="请输入选项2(4字以内)" /> <input class="text" v-model="form.voteOptions[1].name" placeholder="请输入选项2(4字以内)" />
</view> </view>
</view> </view>
...@@ -134,82 +141,99 @@ ...@@ -134,82 +141,99 @@
voteTitle: '', voteTitle: '',
voteOptionType: 'TEXT', voteOptionType: 'TEXT',
voteOptions: [{ voteOptions: [{
name:'', name: '',
imageUrl:'' imageUrl: ''
},{ }, {
name:'', name: '',
imageUrl:'' imageUrl: ''
}], }],
}, },
voteOptionsAffirmative:[], voteOptionsAffirmative: [],
voteOptionsOpposing:[] voteOptionsOpposing: []
} }
}, },
components: { components: {
ImageUpload ImageUpload
}, },
onLoad(options) { onLoad(options) {
let {topicId,topicName} = options; let {
if(topicId){ topicId,
this.topicList.push({name:topicName,id:topicId}) topicName
} = options;
if (topicId) {
this.topicList.push({
name: topicName,
id: topicId,
})
} }
}, },
methods: { methods: {
// 允许评论,开启精选等操作 // 允许评论,开启精选等操作
handleChange(e,field){ handleChange(e, field) {
console.log(e,field) console.log(e, field)
this.form[field] = e.detail.value?1:0 this.form[field] = e.detail.value ? 1 : 0
}, },
// 图文PK或者文字PK // 图文PK或者文字PK
radioChange(e) { radioChange(e) {
console.log(e) console.log(e)
this.form.voteOptionType = e.detail.value this.form.voteOptionType = e.detail.value
}, },
handleSetComponentsType(type){ handleSetComponentsType(type) {
if(type && this.form.attachments.length > 0){ if (type && this.form.attachments.length > 0) {
this.form.type = type this.form.type = type
}else{ } else {
this.form.type = 'TEXT' this.form.type = 'TEXT'
} }
}, },
// 发布动态 // 发布动态
handleSubmit(){ handleSubmit() {
if(this.topicList.length > 0){ if (this.topicList.length > 0) {
this.form.topicNames = []; this.form.topicNames = [];
this.form.topicIds = []; this.form.topicIds = [];
this.topicList.forEach((item)=>{ this.topicList.forEach((item) => {
this.form.topicNames.push(item.name); this.form.topicNames.push(item.name);
this.form.topicIds.push(item.id) this.form.topicIds.push(item.id)
}) })
} }
if(this.form.voteOptionType=='IMAGE'){ // 开启PK校验
if(this.voteOptionsAffirmative.length == 0){ if (this.form.isEnableVote == '1') {
if (this.form.voteOptionType == 'IMAGE') {
if (this.voteOptionsAffirmative.length == 0 || this.voteOptionsOpposing.length == 0) {
uni.showToast({ uni.showToast({
title:'请上传PK图片' title: '请上传PK图片',
icon: 'error'
}) })
return; return;
} }
if(this.voteOptionsOpposing.length == 0){ }
if (this.form.voteOptionType == 'IMAGE') {
this.$set(this.form.voteOptions[0], 'imageUrl', this.voteOptionsAffirmative[0].url);
this.$set(this.form.voteOptions[1], 'imageUrl', this.voteOptionsOpposing[0].url);
}
if(!this.form.voteTitle){
uni.showToast({ uni.showToast({
title:'请上传PK图片' title: '请输入PK标题',
icon: 'error'
}) })
return; return;
} }
if (!this.form.voteOptions[0].name || !this.form.voteOptions[1].name) {
uni.showToast({
title: '请输入PK选项',
icon: 'error'
})
return;
} }
if(this.form.voteOptionType == 'IMAGE'){
this.$set(this.form.voteOptions[0], 'imageUrl', this.voteOptionsAffirmative[0].url);
this.$set(this.form.voteOptions[1], 'imageUrl', this.voteOptionsOpposing[0].url);
} }
console.log(this.form) crateNewDynamic(this.form).then(res => {
crateNewDynamic(this.form).then(res=>{ if (res.code == 200) {
if(res.code == 200){
uni.showToast({ uni.showToast({
title:'创建成功', title: '创建成功',
}) })
uni.$emit('hanldeDynamicRefresh') uni.$emit('hanldeDynamicRefresh')
uni.switchTab({ uni.switchTab({
url:'/pages/index/index' url: '/pages/index/index'
}) })
} }
}) })
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="page-container topics-page"> <view class="page-container topics-page">
<view class="search-box-common"> <view class="search-box-common">
<image src="/static/images/search-icon.png" class="search-icon"></image> <image src="/static/images/search-icon.png" class="search-icon"></image>
<input placeholder="搜索" style="width: 100%;" placeholder-class="placeholder-class" /> <input placeholder="搜索" style="width: 100%;" v-model="topicName" @keypress.enter="getList" placeholder-class="placeholder-class" />
</view> </view>
<view class="hot-container"> <view class="hot-container">
<view class="hot-tag-box"> <view class="hot-tag-box">
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
data() { data() {
return { return {
hotList:[], hotList:[],
topicName:''
} }
}, },
onShow() { onShow() {
...@@ -35,7 +36,10 @@ ...@@ -35,7 +36,10 @@
methods: { methods: {
// 话题热搜榜 // 话题热搜榜
getList(){ getList(){
hotTopicRanking().then(res=>{ let params = {
name:this.topicName
}
hotTopicRanking(params).then(res=>{
console.log(res) console.log(res)
this.hotList = res.data this.hotList = res.data
}) })
......
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