Commit 94215a4d authored by 万成波's avatar 万成波

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	safe-campus-bbs-uniapp/components/Dynamic-Item.vue
parents 1101ff07 4eda70c0
...@@ -17,6 +17,14 @@ export function exchangeUser(params) { ...@@ -17,6 +17,14 @@ export function exchangeUser(params) {
params params
}) })
} }
// 兑换商品选择
export function exchangeGoods(params){
return request({
url: '/bbs/points/exchange/select/goods',
method: 'get',
params
})
}
// 兑换列表 // 兑换列表
export function listData(params) { export function listData(params) {
......
...@@ -17,6 +17,13 @@ export function detailData(params) { ...@@ -17,6 +17,13 @@ export function detailData(params) {
params params
}) })
} }
// 积分详情
export function pointsDetail(userName){
return request({
url:`/bbs/points/user/points/${userName}`,
method: 'get',
})
}
// 导出用户 // 导出用户
export function exportUser(data){ export function exportUser(data){
......
<template>
<el-dialog :visible.sync="visible" :title="title" width="60%" append-to-body>
<el-form :model="queryParams" ref="formRef" :inline="true" @submit.prevent.stop>
<el-form-item label="商品名称">
<el-input placeholder="请输入" v-model="queryParams.name"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary">搜索</el-button>
<el-button>重置</el-button>
</el-form-item>
</el-form>
<div v-if="selectDataList.length > 0" class="mb20">
<el-tag v-for="tag in selectDataList" :key="tag.code" closable>
{{ tag.name }}
</el-tag>
</div>
<el-table ref="tableRef" row-key="code" :data="list" @selection-change="handleCheckboxChange" v-loading="loading">
<el-table-column type="selection" width="60"></el-table-column>
<el-table-column label="商品名称" prop="name" align="center"></el-table-column>
<el-table-column label="商品图片" align="center">
<template #default="{ row }">
<el-image :src="row.imgsUrl" style="width: 30px;height: 30px;"></el-image>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { listData, detailData } from '@/api/pointsMall';
export default {
data() {
return {
visible: false,
title: '选择',
list: [],
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: ''
},
total: 0,
selectDataList: [],
loading:false
}
},
props: {
multiple: {
type: Boolean,
default: false
},
modelValue: {
type: [Object, Array],
default: undefined
},
data: {
type: [String, Number, Array],
default: undefined
},
},
methods: {
openModal(data) {
this.visible = true;
this.getList(data)
},
getList(data) {
this.loading = true
listData(this.queryParams).then(res => {
this.list = res.rows;
this.total = res.total
if (data) {
this.getDetail(data)
}
}).finally(()=>{
this.loading = false
})
},
getDetail(data) {
let _this = this;
detailData(data).then(res => {
_this.selectDataList = [res.data]
})
const users = this.list.filter((item) => {
return data == item.code;
});
if (users.length > 0) {
users.forEach(async (item) => {
await _this.$nextTick(() => {
this.$refs.tableRef.toggleRowSelection(item, true);
});
})
}
},
handleCheckboxChange(selection) {
if (!this.multiple) {
if (selection.length > 1) {
this.$refs.tableRef.clearSelection();
this.$refs.tableRef.toggleRowSelection(selection[selection.length - 1]);
this.selectDataList = [selection[selection.length - 1]]
} else {
this.selectDataList = selection
}
} else {
this.selectDataList = selection
}
},
handleClose() {
this.visible = false
},
handleConfirm() {
this.$emit('update:modelValue', this.selectDataList);
this.$emit('confirmCallBack', this.selectDataList);
this.handleClose()
}
}
}
</script>
\ No newline at end of file
<template>
<div style="width: 100%;">
<el-input v-model="selectName" :readonly="readonly" :placeholder="placeholder">
<el-button slot="append" icon="el-icon-search" @click="openUserSelect"></el-button>
</el-input>
<GoodsSelect ref="userSelectRef" :multiple="multiple" :data="selectData" @confirmCallBack="userSelectCallBack">
</GoodsSelect>
</div>
</template>
<script>
import GoodsSelect from './index.vue'
import { detailData } from '@/api/pointsMall';
export default {
data() {
return {
selectName: '',
selectData: ''
}
},
components: {
GoodsSelect
},
props: {
multiple: {
type: Boolean,
default: false
},
placeholder: {
value: String,
default: '请选择'
},
value: {
value: [String, Number],
default: ''
},
readonly: {
type: Boolean,
default: true
},
},
watch: {
value: {
handler: function (val, oVal) {
if (val) {
this.selectData = val;
this.handleGoodsChange(val)
}
}
},
deep: true,
immediate: true
},
methods: {
openUserSelect() {
this.$refs.userSelectRef.openModal(this.selectData)
},
userSelectCallBack(data) {
if (data.length === 0) {
this.selectName = undefined
this.selectData = ''
} else {
this.selectName = data.map((item) => item.name).join(',');
this.selectData = data.map((item) => item.code).join(',');
}
this.$emit('update:value', this.selectData);
this.$emit('getValue', this.selectData, this.selectName);
},
handleGoodsChange(val) {
detailData(val).then(res => {
if (val) {
this.selectName = res.data.name;
}
})
},
}
}
</script>
\ No newline at end of file
...@@ -87,13 +87,15 @@ export default { ...@@ -87,13 +87,15 @@ export default {
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
debugger
if (val) { if (val) {
// 首先将值转为数组 // 首先将值转为数组
const list = Array.isArray(val) ? val : this.value.split(','); const list = Array.isArray(val) ? val : this.value.split(',');
// 然后将数组转为对象数组 // 然后将数组转为对象数组
this.fileList = list.map(item => { this.fileList = list.map(item => {
debugger
if (typeof item === "string") { if (typeof item === "string") {
if (item.indexOf(this.baseUrl) === -1) { if (item.indexOf('http') === -1) {
item = { name: this.baseUrl + item, url: this.baseUrl + item }; item = { name: this.baseUrl + item, url: this.baseUrl + item };
} else { } else {
item = { name: item, url: item }; item = { name: item, url: item };
...@@ -154,6 +156,8 @@ export default { ...@@ -154,6 +156,8 @@ export default {
}, },
// 上传成功回调 // 上传成功回调
handleUploadSuccess(res, file) { handleUploadSuccess(res, file) {
console.log(res, file)
debugger
if (res.code === 200) { if (res.code === 200) {
this.uploadList.push({ name: res.fileName, url: res.url }); this.uploadList.push({ name: res.fileName, url: res.url });
this.uploadedSuccessfully(); this.uploadedSuccessfully();
......
<template>
<el-dialog :visible.sync="visible" :title="title" width="60%" append-to-body>
<el-form :model="queryParams" ref="formRef" :inline="true" @submit.prevent.stop>
<el-form-item label="姓名">
<el-input placeholder="请输入" v-model="queryParams.nickName"></el-input>
</el-form-item>
<el-form-item label="用户名">
<el-input placeholder="请输入" v-model="queryParams.userName"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">搜索</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div v-if="selectDataList.length > 0" class="mb20">
<el-tag v-for="tag in selectDataList" :key="tag.userName" closable>
{{ tag.nickName }}
</el-tag>
</div>
<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 label="姓名" prop="nickName" align="center"></el-table-column>
<el-table-column label="用户名" prop="userName" align="center"></el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<div slot="footer" class="dialog-footer">
<el-button @click="handleClose">取 消</el-button>
<el-button type="primary" @click="handleConfirm">确定</el-button>
</div>
</el-dialog>
</template>
<script>
import { listData, pointsDetail } from '@/api/pointsManage';
export default {
data() {
return {
visible: false,
title: '选择',
list: [],
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: '',
userName: ''
},
total: 0,
selectDataList: [],
loading: false
}
},
props: {
multiple: {
type: Boolean,
default: false
},
modelValue: {
type: [Object, Array],
default: undefined
},
data: {
type: [String, Number, Array],
default: undefined
},
},
methods: {
openModal(data) {
this.visible = true;
this.getList(data)
},
handleQuery() {
this.queryParams.pageNum = 1;
this.getList()
},
handleReset() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
nickName: '',
userName: ''
}
this.getList()
},
getList(data) {
this.loading = true;
listData(this.queryParams).then(res => {
this.list = res.rows;
this.total = res.total
if (data) {
this.getDetail(data)
}
}).finally(() => {
this.loading = false
})
},
getDetail(data) {
let _this = this;
pointsDetail(data).then(res => {
_this.selectDataList = [res.data]
})
const users = this.list.filter((item) => {
return data == item.userName;
});
if (users.length > 0) {
users.forEach(async (item) => {
await _this.$nextTick(() => {
this.$refs.tableRef.toggleRowSelection(item, true);
});
})
}
},
handleCheckboxChange(selection) {
if (!this.multiple) {
if (selection.length > 1) {
this.$refs.tableRef.clearSelection();
this.$refs.tableRef.toggleRowSelection(selection[selection.length - 1]);
this.selectDataList = [selection[selection.length - 1]]
} else {
this.selectDataList = selection
}
} else {
this.selectDataList = selection
}
},
handleClose() {
// this.selectDataList = [];
// this.list = [];
// this.total = 0;
this.visible = false
},
handleConfirm() {
this.$emit('update:modelValue', this.selectDataList);
this.$emit('confirmCallBack', this.selectDataList);
this.handleClose()
}
}
}
</script>
\ No newline at end of file
<template>
<div style="width: 100%;">
<el-input v-model="selectName" :readonly="readonly" :placeholder="placeholder">
<el-button slot="append" icon="el-icon-search" @click="openUserSelect"></el-button>
</el-input>
<UserSelect ref="userSelectRef" :multiple="multiple" :data="selectData" @confirmCallBack="userSelectCallBack">
</UserSelect>
</div>
</template>
<script>
import { pointsDetail } from '@/api/pointsManage';
import UserSelect from './index.vue'
export default {
data() {
return {
selectName: '',
selectData: ''
}
},
components: {
UserSelect
},
props: {
multiple: {
type: Boolean,
default: false
},
placeholder: {
value: String,
default: '请选择'
},
value: {
value: [String, Number],
default: ''
},
readonly: {
type: Boolean,
default: true
},
},
watch: {
value: {
handler: function (val, oVal) {
if (val) {
this.selectData = val;
this.handleUserChange(val)
}
}
},
deep: true,
immediate: true
},
methods: {
openUserSelect() {
this.$refs.userSelectRef.openModal(this.selectData)
},
userSelectCallBack(data) {
debugger
if (data.length === 0) {
this.selectName = undefined
this.selectData = ''
} else {
this.selectName = data.map((item) => item.nickName).join(',');
this.selectData = data.map((item) => item.userName).join(',');
}
this.$emit('update:value', this.selectData);
this.$emit('getValue', this.selectData, this.selectName);
},
handleUserChange(val) {
pointsDetail(val).then(res => {
if (val) {
this.selectName = res.data.nickName;
}
})
},
}
}
</script>
\ No newline at end of file
...@@ -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>
......
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
<style rel="stylesheet/scss" lang="scss"> <style rel="stylesheet/scss" lang="scss">
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: flex-end;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg"); background-image: url("../assets/images/login-background.jpg");
...@@ -175,6 +175,7 @@ export default { ...@@ -175,6 +175,7 @@ export default {
background: #ffffff; background: #ffffff;
width: 400px; width: 400px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
margin-right: 240px;
.el-input { .el-input {
height: 38px; height: 38px;
input { input {
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<div class="text">{{ form.content }}</div> <div class="text">{{ form.content }}</div>
<div class="imgs" v-if="form.attachments && form.attachments.length > 0"> <div class="imgs" v-if="form.attachments && form.attachments.length > 0">
<template v-for="(item, index) in form.attachments"> <template v-for="(item, index) in form.attachments">
<img class="item" :src="item.url"></img> <el-image class="item" :src="item.url" :preview-src-list="[item.url]"></el-image>
<!-- <img class="item" :src="item.url"></img> -->
</template> </template>
</div> </div>
</div> </div>
......
...@@ -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="请选择" 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>
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
<el-table-column label="帐号" prop="userName" align="center" width="140"></el-table-column> <el-table-column label="帐号" prop="userName" align="center" width="140"></el-table-column>
<el-table-column label="姓名" prop="nickName" align="center" width="120"></el-table-column> <el-table-column label="姓名" prop="nickName" align="center" width="120"></el-table-column>
<el-table-column label="点赞数" prop="likeCount" align="center" width="100"></el-table-column> <el-table-column label="点赞数" prop="likeCount" align="center" width="100"></el-table-column>
<el-table-column label="评论数" prop="commentCount" align="center" width="100"></el-table-column> <el-table-column label="评论数" prop="commentCount" align="center" width="100"></el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center" width="160"></el-table-column> <el-table-column label="创建时间" prop="createTime" align="center" width="160"></el-table-column>
<el-table-column label="操作" align="center" width="160"> <el-table-column label="操作" align="center" width="160">
<template #default="{ row }"> <template #default="{ row }">
...@@ -38,12 +39,12 @@ ...@@ -38,12 +39,12 @@
:limit.sync="queryParams.pageSize" @pagination="getList" /> :limit.sync="queryParams.pageSize" @pagination="getList" />
</div> </div>
<!-- 动态详情 --> <!-- 动态详情 -->
<detail-dialog ref="detailDialogRef"></detail-dialog> <detail-dialog ref="detailDialogRef"></detail-dialog>
</div> </div>
</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" title="兑换明细" width="70%"> <el-dialog :visible.sync="visible" title="积分明细" width="70%">
<el-table :data="tableList" v-loading="loading"> <el-table :data="tableList" v-loading="loading">
<el-table-column type="index" label="序号" width="55" align="center"></el-table-column> <el-table-column type="index" label="序号" width="55" align="center"></el-table-column>
<el-table-column label="明细名称" prop="detailName" align="center" width="150"></el-table-column> <el-table-column label="明细名称" prop="detailName" align="center" width="150"></el-table-column>
......
<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">
<el-select placeholder="请选择" style="width: 100%;" v-model="form.userName" @change="handleUserChange"> <UserSelectInput v-model="form.userName" :value.sync="form.userName" placeholder="请选择兑换人"></UserSelectInput>
<el-option v-for="(item, index) in userList" :key="index" :value="item.userName"
:label="item.nickName"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="会员等级"> <el-form-item label="会员等级">
<el-input v-model="form.gradeName" :disabled="true" placeholder="请输入"></el-input> <el-input v-model="form.gradeName" :readonly="true" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="当前积分"> <el-form-item label="当前积分">
<el-input v-model="form.currentPoints" :disabled="true" placeholder="请输入"></el-input> <el-input v-model="form.currentPoints" :readonly="true" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="兑换商品" prop="goodsCode"> <el-form-item label="兑换商品" prop="goodsCode">
<el-select placeholder="请选择" style="width: 100%;" v-model="form.goodsCode"> <GoodsSelectInput :value.sync="form.goodsCode" placeholder="请选择兑换商品"></GoodsSelectInput>
<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> </el-form>
<template #footer> <template #footer>
...@@ -27,7 +21,10 @@ ...@@ -27,7 +21,10 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import { pointsExchange, exchangeUser, exchange } from '@/api/pointsExchange' import { pointsExchange, exchange } from '@/api/pointsExchange'
import { pointsDetail } from '@/api/pointsManage';
import UserSelectInput from '@/components/UserSelect/input'
import GoodsSelectInput from '@/components/GoodsSelect/input'
export default { export default {
data() { data() {
return { return {
...@@ -36,57 +33,54 @@ export default { ...@@ -36,57 +33,54 @@ export default {
userList: [], userList: [],
optionList: [], optionList: [],
rules: { rules: {
goodsCode: [{ required: true, message: '请选择兑换商品', trigger: 'change' }] userName:[{required: true, message: '请选择兑换人', trigger:['blur', 'change']}],
goodsCode: [{ required: true, message: '请选择兑换商品', trigger: ['blur', 'change'] }]
}, },
disabled: false disabled: false
} }
}, },
components: {
UserSelectInput,
GoodsSelectInput
},
watch: {
"form.userName": {
handler: function (val, oVal) {
console.log(val, oVal)
if (val) {
this.handleUserChange(val)
}
}
},
deep: true,
immediate: true
},
methods: { methods: {
// 打开兑换窗口 // 打开兑换窗口
openModal(row) { openModal(row) {
this.visible = true; this.visible = true;
this.getUsers(row)
this.getOptions()
this.disabled = row ? true : false this.disabled = row ? true : false
this.$nextTick(() => { this.$nextTick(() => {
this.form = { ...this.form, ...row } this.form = { ...this.form, ...row }
}) })
}, },
// 兑换人
getUsers(row) {
exchangeUser().then(res => {
console.log(res)
this.userList = res.data;
if (row && row.userName) {
res.data.forEach((item) => {
if (item.userName == row.userName) {
this.form.nickName = item.nickName;
this.form.gradeName = item.gradeName
}
})
}
})
},
handleUserChange(val) { handleUserChange(val) {
this.userList.forEach((item) => { pointsDetail(val).then(res => {
if (item.userName == val) { if (val) {
this.form.nickName = item.nickName; console.log(res.data)
this.form.gradeName = item.gradeName this.form = { ...this.form, ...res.data }
this.form.currentPoints = item.currentPoints
} }
}) })
}, },
// 兑换商品列表
getOptions() {
pointsExchange().then(res => {
console.log(res)
this.optionList = res.data
})
},
handleConfirm() { handleConfirm() {
let { nickName, userName, userGradeName, goodsCode } = this.form let { nickName, userName, userGradeName, goodsCode, currentPoints } = this.form;
let data = { nickName, userName, userGradeName, goodsCode } let data = {
nickName,
userName,
userGradeName,
goodsCode,
currentPoints
}
this.$refs.formRef.validate((valid) => { this.$refs.formRef.validate((valid) => {
if (valid) { if (valid) {
exchange(data).then(res => { exchange(data).then(res => {
...@@ -95,7 +89,7 @@ export default { ...@@ -95,7 +89,7 @@ export default {
this.handleClose() this.handleClose()
this.$emit('handleOk'); this.$emit('handleOk');
} else { } else {
this.$modal.msgSuccess(res.msg || "兑换失败"); this.$modal.msgError(res.msg || "兑换失败");
} }
}) })
} }
......
...@@ -91,7 +91,7 @@ export default { ...@@ -91,7 +91,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
inputPattern: /^[1-9]\d*$/, inputPattern: /^[1-9]\d*$/,
inputErrorMessage: '增加积分需大于0' inputErrorMessage: '增加积分需为大于0的正整数'
}).then(({ value }) => { }).then(({ value }) => {
let data = { let data = {
userName: row.userName, userName: row.userName,
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
inputPattern: /^[1-9]\d*$/, inputPattern: /^[1-9]\d*$/,
inputErrorMessage: '扣减积分需大于0' inputErrorMessage: '扣减积分需为大于0的正整数'
}).then(({ value }) => { }).then(({ value }) => {
let data = { let data = {
userName: row.userName, userName: row.userName,
......
<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
<template> <template>
<el-dialog :visible.sync="visible" v-if="visible" :title="dialogTitle" width="28%" class="dialog" @close="handleClose"> <el-dialog :visible.sync="visible" v-if="visible" :title="dialogTitle" width="28%" class="dialog" @close="handleClose">
<el-form :model="form" ref="formRef" :rules="rules"> <el-form :model="form" ref="formRef" :rules="rules" @submit.native.prevent>
<el-form-item label="敏感词" prop="name"> <el-form-item label="敏感词" prop="name">
<el-input placeholder="请输入" v-model="form.name"></el-input> <el-input placeholder="请输入" v-model="form.name"></el-input>
</el-form-item> </el-form-item>
......
<template> <template>
<div class="app-container"> <div class="app-container">
<div class="page-container"> <div class="page-container">
<el-form :model="queryParams" :inline="true" label-width="90"> <el-form :model="queryParams" :inline="true" label-width="90" @submit.native.prevent>
<el-form-item label="敏感词"> <el-form-item label="敏感词">
<el-input v-model="queryParams.name" placeholder="请输入"></el-input> <el-input v-model="queryParams.name" placeholder="请输入" @keyup.enter.native="handleQuery"></el-input>
</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>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-button type="primary" @click="handleAdd">新增敏感词</el-button> <el-button type="primary" @click="handleAdd">新增敏感词</el-button>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="2">
<el-button type="primary" plain>批量导入敏感词</el-button> <el-button type="primary" plain @click="handleImport">批量导入敏感词</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="tableList"> <el-table :data="tableList">
...@@ -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() {
...@@ -101,7 +105,11 @@ export default { ...@@ -101,7 +105,11 @@ export default {
pageSize: 10 pageSize: 10
} }
this.getList() this.getList()
} },
// 导入敏感词
handleImport(){
this.$refs.batchImportRef.openModal()
},
} }
} }
</script> </script>
......
...@@ -146,4 +146,12 @@ export function delComment(commentId){ ...@@ -146,4 +146,12 @@ export function delComment(commentId){
url:`moment/comment/delete/${commentId}`, url:`moment/comment/delete/${commentId}`,
method:'delete' method:'delete'
}) })
}
// 删除动态
export function delMonment(momentId){
return request({
url:`moment/delete/${momentId}`,
method:'delete'
})
} }
\ No newline at end of file
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
<view class="item" v-if="form.isSelf==1" :class="{'active':activeIndex==1}" @click="handleChange(1)">管理全部评论 <view class="item" v-if="form.isSelf==1" :class="{'active':activeIndex==1}" @click="handleChange(1)">管理全部评论
</view> </view>
</view> </view>
<view class="empty-box" v-if="list.length == 0"> <view class="empty-box" v-if="commentList.length == 0">
<image src="/static/images/empty.png" class="icon"></image> <image src="/static/images/empty.png" class="icon"></image>
<view class="text">期待您的经常评论~</view> <view class="text">期待您的经常评论~</view>
</view> </view>
<view class="comment-display-box" v-else> <view class="comment-display-box" v-else>
<view class="comment-item" v-for="(item,index) in list"> <view class="comment-item" v-for="(item,index) in commentList">
<view class="user-info"> <view class="user-info">
<view class="username">{{item.nickName}}</view> <view class="username">{{item.nickName}}</view>
<view class="datetime">{{item.createTime}}</view> <view class="datetime">{{item.createTime}}</view>
...@@ -23,12 +23,15 @@ ...@@ -23,12 +23,15 @@
<view class="operation-text"> <view class="operation-text">
<view class="add-text" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==0" <view class="add-text" v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==0"
@click="handleFeatured(item)">加入精选</view> @click="handleFeatured(item)">加入精选</view>
<view v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==1" <view v-if="form.isSelf==1&&activeIndex==1 &&item.isFeatured==1" @click="handleFeatured(item)">
@click="handleFeatured(item)">取消精选</view> 取消精选</view>
<view v-if="form.isSelf==1&&activeIndex==1" @click="handleDelete(item)">删除</view> <view v-if="form.isSelf==1&&activeIndex==1" @click="handleDelete(item)">删除</view>
</view> </view>
</view> </view>
</view>
<view class="show-more-box" v-if="commentList.length < total" @click="loadMore">
加载更多
<image src="/static/images/down.png" class="icon"></image>
</view> </view>
</view> </view>
...@@ -41,26 +44,27 @@ ...@@ -41,26 +44,27 @@
import PublishComment from './PublishComment.vue'; import PublishComment from './PublishComment.vue';
import { import {
commentFeatured, commentFeatured,
delComment delComment,
dynamicDetailComments
} from '@/api/api.js' } from '@/api/api.js'
export default { export default {
name: "Comment-Item", name: "Comment-Item",
data() { data() {
return { return {
commentList: [], commentList: [],
activeIndex: 0 activeIndex: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
momentId: ''
},
total:0
}; };
}, },
components: { components: {
PublishComment PublishComment
}, },
props: { props: {
list: {
type: Object,
default: () => {
return []
}
},
form: { form: {
type: Object, type: Object,
default: () => { default: () => {
...@@ -68,39 +72,60 @@ ...@@ -68,39 +72,60 @@
} }
} }
}, },
watch: {
form(newVal, oldVal){
console.log(newVal, oldVal)
if(newVal.id){
this.queryParams.momentId = newVal.id;
this.getCommentList()
}
}
},
onLoad() {
},
methods: { methods: {
handleChange(index) { handleChange(index) {
this.activeIndex = index this.activeIndex = index
}, },
handleRefresh() { handleRefresh() {
console.log('222') this.queryParams.pageNum = 1;
this.$emit('refresh') this.getCommentList()
},
getCommentList() {
dynamicDetailComments(this.queryParams).then(res => {
this.commentList = [...this.commentList,...res.rows]
this.total = res.total
})
},
loadMore(){
this.queryParams.pageNum += 1;
this.getCommentList()
}, },
// 回复评论 // 回复评论
handleReplayComment(item) { handleReplayComment(item) {
this.$refs.publishCommentRef.openModal(item) this.$refs.publishCommentRef.openModal(item)
}, },
// 加入精选,取消精选 // 加入精选,取消精选
handleFeatured(item){ handleFeatured(item) {
let _this = this; let _this = this;
let text = item.isFeatured==1?'取消精选':'加入精选' let text = item.isFeatured == 1 ? '取消精选' : '加入精选'
let data = { let data = {
momentId:this.form.id, momentId: this.form.id,
commentId:item.id, commentId: item.id,
featuredStatus:item.isFeatured==1?0:1 featuredStatus: item.isFeatured == 1 ? 0 : 1
} }
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: `是否将评论:${item.content}${text}`, content: `是否将评论:${item.content}${text}`,
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
commentFeatured(data).then(res=>{ commentFeatured(data).then(res => {
if(res.code == 200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title:`${text}成功` title: `${text}成功`
}) })
_this.$emit('refresh') _this.getCommentList()
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
...@@ -109,19 +134,19 @@ ...@@ -109,19 +134,19 @@
} }
}); });
}, },
handleDelete(item){ handleDelete(item) {
let _this = this; let _this = this;
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: `是否确认删除评论:${item.content}?`, content: `是否确认删除评论:${item.content}?`,
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
delComment(item.id).then(res=>{ delComment(item.id).then(res => {
if(res.code == 200){ if (res.code == 200) {
uni.showToast({ uni.showToast({
title:`删除成功` title: `删除成功`
}) })
_this.$emit('refresh') _this.getCommentList()
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
...@@ -231,4 +256,17 @@ ...@@ -231,4 +256,17 @@
} }
} }
} }
</style>
.show-more-box{
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
color: #BBBBBB;
font-size: 24rpx;
.icon{
width: 32rpx;
height: 32rpx;
}
}
</style>
\ No newline at end of file
<template> <template>
<view> <view>
<view class="dynamic-item" @click="toDynamicDetailPage"> <view class="dynamic-item" @click="toDynamicDetailPage">
<view class="user-info-box"> <view class="user-info-box" style="position: relative;">
<image class="avatar" src="/static/images/default-avatar.png"></image> <image class="avatar" src="/static/images/default-avatar.png"></image>
<view class="user-name">{{form.nickName}}</view> <view class="user-name">{{form.nickName}}</view>
<image class="more-icon" src="/static/images/more-icon.png"></image> <image v-if="!deleteable" class="more-icon" src="/static/images/more-icon.png"></image>
<image v-if="deleteable" class="more-icon" @click.stop="handleDelDynamics"
src="/static/images/more-icon.png"></image>
<!-- 删除按钮 -->
<view class="del-btn" v-if="showDelBtn" @click.stop="handleDel" :style="'left:' + clientX + 'rpx;' +'top:' + clientY + 'rpx'">
删除动态</view>
</view> </view>
<view class="topics-box" v-if="form.topicNames && form.topicNames.length >0"> <view class="topics-box" v-if="form.topicNames && form.topicNames.length >0">
<template v-for="(name,index) in form.topicNames"> <template v-for="(name,index) in form.topicNames">
...@@ -15,7 +20,7 @@ ...@@ -15,7 +20,7 @@
<view class="text">{{form.content}}</view> <view class="text">{{form.content}}</view>
<view class="imgs" v-if="form.type=='IMAGE'&&form.attachments && form.attachments.length > 0"> <view class="imgs" v-if="form.type=='IMAGE'&&form.attachments && form.attachments.length > 0">
<template v-for="(item,index) in form.attachments"> <template v-for="(item,index) in form.attachments">
<image class="item" :src="item.url"></image> <image class="item" :src="item.url" @click.stop="preview(item.url)"></image>
</template> </template>
</view> </view>
<view class="imgs" v-if="form.type=='VIDEO'&&form.attachments && form.attachments.length > 0"> <view class="imgs" v-if="form.type=='VIDEO'&&form.attachments && form.attachments.length > 0">
...@@ -46,33 +51,41 @@ ...@@ -46,33 +51,41 @@
</view> </view>
<view class="pk-imgs" v-if="form.voteOptionType=='IMAGE' && form.voteOptions.length>0 "> <view class="pk-imgs" v-if="form.voteOptionType=='IMAGE' && form.voteOptions.length>0 ">
<template v-for="(item,index) in form.voteOptions"> <template v-for="(item,index) in form.voteOptions">
<image :src="item.imageUrl" class="img"></image> <image :src="item.imageUrl" @click.stop="preview(item.imageUrl)" class="img"></image>
</template> </template>
</view> </view>
<!-- 未投票 --> <!-- 未投票 -->
<view v-if="form.isVote==0"> <view v-if="form.isVote==0">
<view class="pk-btns" v-if="form.voteOptions.length>0 "> <view class="pk-btns" v-if="form.voteOptions.length>0 ">
<view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])"> <view class="btns red-btn" @click.stop="handleVote(form.voteOptions[0])">
{{form.voteOptions[0].name}}</view> {{form.voteOptions[0].name}}
</view>
<image src="/static/images/pk-img.png" class="img"></image> <image src="/static/images/pk-img.png" class="img"></image>
<view class="btns blue-btn" @click.stop="handleVote(form.voteOptions[1])"> <view class="btns blue-btn" @click.stop="handleVote(form.voteOptions[1])">
{{form.voteOptions[1].name}}</view> {{form.voteOptions[1].name}}
</view>
</view> </view>
<view class="pk-tips">点击上方按钮,选择你的观点</view> <view class="pk-tips">点击上方按钮,选择你的观点</view>
</view> </view>
<!-- 已投票,显示投票结果 --> <!-- 已投票,显示投票结果 -->
<view v-if="form.isVote==1" > <view v-if="form.isVote==1">
<view class="pk-results" > <view class="pk-results">
<view class="left" @click.stop="toPKDetailPage(0)"> <view class="left" @click.stop="toPKDetailPage(0)">
<view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view> <view class="left-num">{{form.voteOptions[0].name}} {{form.voteOptions[0].voteCount}}</view>
<view class="results-item left-item"></view>
</view> </view>
<view class="right" @click.stop="toPKDetailPage(1)"> <view class="right" @click.stop="toPKDetailPage(1)">
<view class="right-num" >{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}}</view> <view class="right-num">{{form.voteOptions[1].name}} {{form.voteOptions[1].voteCount}}
</view>
</view>
</view>
<view class="pk-results">
<view class="left" :style="'flex:' + form.voteOptions[0].voteCount" @click.stop="toPKDetailPage(0)">
<view class="results-item left-item"></view>
</view>
<view class="right" :style="'flex:' + form.voteOptions[1].voteCount" @click.stop="toPKDetailPage(1)">
<view class="results-item right-item"></view> <view class="results-item right-item"></view>
</view> </view>
</view> </view>
<view class="results-sum" @click.stop="toPKDetailPage(0)"> <view class="results-sum" @click.stop="toPKDetailPage(0)">
<view>{{form.voteCount}}人参与</view> <view>{{form.voteCount}}人参与</view>
<image src="/static/images/detail-icon.png" class="icon"></image> <image src="/static/images/detail-icon.png" class="icon"></image>
...@@ -87,9 +100,10 @@ ...@@ -87,9 +100,10 @@
<view class="username">{{item.nickName}}:</view> <view class="username">{{item.nickName}}:</view>
<view class="datetime">2025-07-01 04:21:21</view> <view class="datetime">2025-07-01 04:21:21</view>
</view> </view>
<view class="content" v-if="!item.replyNickName" @click.stop="handleReplayComment(item)">{{item.content}}</view> <view class="content" v-if="!item.replyNikeName" @click.stop="handleReplayComment(item)">
{{item.content}}</view>
<view class="content" v-else @click.stop="handleReplayComment(item)"> <view class="content" v-else @click.stop="handleReplayComment(item)">
回复<span style="color: #0058B6;">{{item.replyNickName}}:</span>:{{item.content}} 回复<span style="color: #0058B6;">{{item.replyNikeName}}:</span>:{{item.content}}
</view> </view>
<!-- <view class="tips">未精选,仅自己可见</view> --> <!-- <view class="tips">未精选,仅自己可见</view> -->
</view> </view>
...@@ -98,13 +112,15 @@ ...@@ -98,13 +112,15 @@
</view> </view>
<!-- 发布评论区 --> <!-- 发布评论区 -->
<publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment> <publish-comment :form="form" ref="publishCommentRef" @refresh="$emit('refresh')"></publish-comment>
</view> </view>
</template> </template>
<script> <script>
import { import {
dynamicLikeUnlike, dynamicLikeUnlike,
delMonment,
dynamicVote dynamicVote
} from '@/api/api.js' } from '@/api/api.js'
import PublishComment from './PublishComment.vue'; import PublishComment from './PublishComment.vue';
...@@ -115,15 +131,22 @@ ...@@ -115,15 +131,22 @@
commentList: [{}, {}], commentList: [{}, {}],
showComment: false, showComment: false,
commentContent: '', commentContent: '',
clientX: 0,
clientY: 0,
showDelBtn: false
}; };
}, },
components:{ components: {
PublishComment PublishComment
}, },
props: { props: {
form: { form: {
type: Object, type: Object,
default: {} default: {}
},
deleteable: {
type: Boolean,
default: false
} }
}, },
methods: { methods: {
...@@ -133,9 +156,17 @@ ...@@ -133,9 +156,17 @@
momentId: this.form.id, momentId: this.form.id,
likeStatus likeStatus
} }
if(likeStatus == '1'){
this.form.likeCount = this.form.likeCount + 1
this.form.isLike = 1
}
if(likeStatus == '0'){
this.form.likeCount = this.form.likeCount - 1
this.form.isLike = 0
}
dynamicLikeUnlike(data).then(res => { dynamicLikeUnlike(data).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$emit('refresh') // this.$emit('refresh')
} }
}) })
...@@ -146,11 +177,39 @@ ...@@ -146,11 +177,39 @@
this.$refs.publishCommentRef.openModal() this.$refs.publishCommentRef.openModal()
}, },
// 回复评论 // 回复评论
handleReplayComment(item){ handleReplayComment(item) {
console.log(item) console.log(item)
this.$refs.publishCommentRef.openModal(item) this.$refs.publishCommentRef.openModal(item)
}, },
// 展示删除动态按钮
handleDelDynamics(e) {
this.showDelBtn = !this.showDelBtn
this.clientX = (e.target.offsetLeft * 2 - 148);
this.clientY = ((e.target.offsetTop * 2) + 34);
},
// 删除动态
handleDel(){
let _this = this;
uni.showModal({
title: '提示',
content: '是否确认删除动态?',
success: function (res) {
if (res.confirm) {
delMonment(_this.form.id).then(res=>{
if(res.code == 200){
uni.showToast({
title:'删除成功',
})
_this.$emit('refresh');
uni.$emit('hanldeDynamicRefresh')
}
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
// 投票 // 投票
handleVote(item) { handleVote(item) {
let data = { let data = {
...@@ -167,9 +226,15 @@ ...@@ -167,9 +226,15 @@
} }
}) })
}, },
// 预览
preview(url) {
uni.previewImage({
urls: [url]
});
},
toDynamicDetailPage() { toDynamicDetailPage() {
let pathName = window.location.pathname let pathName = window.location.pathname
if(pathName.indexOf('/pages/dynamic-detail/dynamic-detail') > -1){ if (pathName.indexOf('/pages/dynamic-detail/dynamic-detail') > -1) {
return; return;
} }
uni.navigateTo({ uni.navigateTo({
...@@ -195,4 +260,17 @@ ...@@ -195,4 +260,17 @@
<style lang="scss"> <style lang="scss">
@import '@/static/styles/index.scss'; @import '@/static/styles/index.scss';
.del-btn {
position: absolute;
width: 168rpx;
height: 68rpx;
line-height: 68rpx;
border-radius: 6rpx;
background-color: rgba(255, 255, 255, 1);
color: rgba(102, 102, 102, 1);
font-size: 26rpx;
text-align: center;
box-shadow: 0px 2px 12rpx 0px rgba(0, 0, 0, 0.2);
}
</style> </style>
...@@ -405,7 +405,7 @@ ...@@ -405,7 +405,7 @@
width: 20px; width: 20px;
height: 20px; height: 20px;
border-radius: 100%; border-radius: 100%;
z-index: 999; z-index: 900;
} }
} }
......
<template>
<view class="list-empty-components">
<image src="/static/images/empty.png" class="img"></image>
<view class="text">{{text}}</view>
</view>
</template>
<script>
export default {
name:"ListEmpty",
data() {
return {
};
},
props:{
text:{
type:String,
default:'暂无数据~'
}
},
}
</script>
<style lang="scss">
.list-empty-components{
min-height: 600rpx;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.img{
width:160rpx;
height: 160rpx;
}
.text{
color: rgba(195, 200, 206, 1);
font-size: 28rpx;
}
}
</style>
\ No newline at end of file
<template> <template>
<view class="comment-dialog-shadow" v-if="showComment"> <view class="comment-dialog-shadow" v-if="showComment">
<view class="comment-edit-box"> <view class="comment-edit-box">
<textarea v-model="commentContent" :placeholder="placeholder" class="textarea"></textarea> <textarea v-model="commentContent" maxlength="120" :placeholder="placeholder" class="textarea"></textarea>
<view class="btns"> <view class="btns">
<button class="btn" size="mini" @click="handleCloseComment">取消</button> <button class="btn" size="mini" @click="handleCloseComment">取消</button>
<button class="btn" size="mini" type="primary" @click="handlePublishComment">确定</button> <button class="btn" size="mini" type="primary" @click="handlePublishComment">确定</button>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
return { return {
showComment:false, showComment:false,
commentContent:'', commentContent:'',
placeholder:'请输入评论', placeholder:'请输入评论(最多输入120字)',
parentId:'', parentId:'',
}; };
}, },
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "轻享" "navigationBarTitleText": "轻享",
"enablePullDownRefresh": true
} }
}, },
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="detail-page-container"> <view class="detail-page-container">
<dynamic-item :form="form" @refresh="handleRefresh"></dynamic-item> <dynamic-item :form="form" @refresh="handleRefresh"></dynamic-item>
<!-- 评论管理区 --> <!-- 评论管理区 -->
<comment-item :list="commentList" :form="form" @refresh="getCommentList"></comment-item> <comment-item :form="form" ></comment-item>
</view> </view>
</template> </template>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
this.momentId = momentId; this.momentId = momentId;
this.queryParams.momentId = momentId this.queryParams.momentId = momentId
this.getDetail() this.getDetail()
this.getCommentList() // this.getCommentList()
}, },
components: { components: {
DynamicItem, DynamicItem,
......
...@@ -5,11 +5,14 @@ ...@@ -5,11 +5,14 @@
<input placeholder="搜索" placeholder-class="placeholder-class" /> <input placeholder="搜索" placeholder-class="placeholder-class" />
</view> </view>
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" @scrolltolower="loadMore"> <scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-if="list.length>0" @scrolltolower="loadMore">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<dynamic-item :form="item" @refresh="getList"></dynamic-item> <dynamic-item :form="item" @refresh="getList"></dynamic-item>
</template> </template>
</scroll-view> </scroll-view>
<scroll-view class="scroll-view-index" scroll-y :show-scrollbar="false" v-else>
<list-empty></list-empty>
</scroll-view>
<!-- 发布按钮 --> <!-- 发布按钮 -->
<movable-area class="movable-area"> <movable-area class="movable-area">
<movable-view class="add-dynamic-box move-button" :x="area.x" :y="area.y" direction="all" @change="onChange" <movable-view class="add-dynamic-box move-button" :x="area.x" :y="area.y" direction="all" @change="onChange"
...@@ -22,6 +25,7 @@ ...@@ -22,6 +25,7 @@
<script> <script>
import DynamicItem from '@/components/Dynamic-Item.vue' import DynamicItem from '@/components/Dynamic-Item.vue'
import ListEmpty from '@/components/ListEmpty.vue';
import { import {
dynamicList dynamicList
} from '@/api/api.js' } from '@/api/api.js'
...@@ -41,33 +45,56 @@ ...@@ -41,33 +45,56 @@
} }
}, },
components: { components: {
DynamicItem DynamicItem,
ListEmpty
}, },
onLoad() { onLoad() {
this.getList() this.getList()
let _this = this; let _this = this;
uni.$on('hanldeDynamicRefresh', function() { uni.$on('hanldeDynamicRefresh', function() {
_this.list = [];
_this.queryParams.pageNum = 1;
_this.getList() _this.getList()
}) })
}, },
beforeDestroy() { beforeDestroy() {
uni.$off('hanldeDynamicRefresh') uni.$off('hanldeDynamicRefresh')
}, },
onPullDownRefresh() {
this.refreshContentList()
setTimeout(()=>{
uni.stopPullDownRefresh();
}, 1000)
},
methods: { methods: {
getList() { getList() {
uni.showLoading({
title:'加载中...'
})
dynamicList(this.queryParams).then(res => { dynamicList(this.queryParams).then(res => {
console.log(res) this.list = [...this.list,...res.rows];
this.list = res.rows this.total = res.total
}).finally(()=>{
uni.hideLoading()
}) })
}, },
loadMore() { loadMore() {
if(this.list.length < this.total){
this.queryParams.pageNum += 1;
this.getList()
}
}, },
toPublishPage() { toPublishPage() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/publish/publish' url: '/pages/publish/publish'
}) })
}, },
// 下拉刷新
refreshContentList() {
this.list = [];
this.queryParams.pageNum = 1;
this.getList();
},
toPKDetailPage() { toPKDetailPage() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/pk-detail/pk-detail' url: '/pages/pk-detail/pk-detail'
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
// window.location = res.data // window.location = res.data
// } // }
// }) // })
window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww63ca87d5f8647514&redirect_uri=http%3A%2F%2Fqywx.tangguo.ren/h5/pages/login/login/&response_type=code&scope=snsapi_base#wechat_redirect' window.location = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww63ca87d5f8647514&redirect_uri=https%3A%2F%2Ftest.tangguo.ren/h5/pages/login/login/&response_type=code&scope=snsapi_base#wechat_redirect'
}, },
// 页面跳转 // 页面跳转
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<image v-else :src="userInfo.avatarUrl" class="avatar"></image> <image v-else :src="userInfo.avatarUrl" class="avatar"></image>
<view class="name-class"> <view class="name-class">
<view class="name">{{userInfo.nickName}}</view> <view class="name">{{userInfo.nickName}}</view>
<view class="class-name">{{userInfo.deptName}}</view> <view class="class-name">{{userInfo.dept.deptName}}</view>
</view> </view>
<image src="/static/images/mine/detail-icon-white.png" class="more"></image> <image src="/static/images/mine/detail-icon-white.png" class="more"></image>
</view> </view>
...@@ -29,16 +29,20 @@ ...@@ -29,16 +29,20 @@
</view> </view>
<!-- 我发的动态 --> <!-- 我发的动态 -->
<scroll-view class="my-dynamics" scroll-y :show-scrollbar="false" v-if="list.length >0"> <scroll-view class="my-dynamics" scroll-y :show-scrollbar="false" v-if="list.length >0" @scrolltolower="loadMore">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<dynamic-item :form="item" @refresh="getList"></dynamic-item> <dynamic-item :form="item" @refresh="handleRefresh" :deleteable="true"></dynamic-item>
</template> </template>
</scroll-view> </scroll-view>
<scroll-view class="my-dynamics" scroll-y :show-scrollbar="false" v-if="list.length==0">
<list-empty></list-empty>
</scroll-view>
</view> </view>
</template> </template>
<script> <script>
import DynamicItem from '@/components/Dynamic-Item.vue'; import DynamicItem from '@/components/Dynamic-Item.vue';
import ListEmpty from '@/components/ListEmpty.vue';
import { import {
getInfo getInfo
} from '@/api/login.js'; } from '@/api/login.js';
...@@ -55,18 +59,21 @@ ...@@ -55,18 +59,21 @@
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
} },
total:0
} }
}, },
components: { components: {
DynamicItem DynamicItem,
ListEmpty
}, },
onLoad() { onLoad() {
this.getUserInfo(); this.getUserInfo();
}, },
onShow() { onShow() {
this.getStatistics(); this.getStatistics();
this.list = [];
this.queryParams.pageNum = 1;
this.getList() this.getList()
}, },
methods: { methods: {
...@@ -83,12 +90,30 @@ ...@@ -83,12 +90,30 @@
this.analysisData = res.data this.analysisData = res.data
}) })
}, },
handleRefresh(){
this.getStatistics();
this.list = [];
this.queryParams.pageNum = 1;
this.getList()
},
// 获取当前用户动态列表 // 获取当前用户动态列表
getList() { getList() {
uni.showLoading({
title:'加载中...'
})
userDynamics(this.queryParams).then(res => { userDynamics(this.queryParams).then(res => {
this.list = res.rows this.list = [...this.list,...res.rows];
this.total = res.total;
}).finally(()=>{
uni.hideLoading()
}) })
} },
loadMore() {
if(this.list.length < this.total){
this.queryParams.pageNum += 1;
this.getList()
}
},
} }
} }
</script> </script>
......
...@@ -6,13 +6,16 @@ ...@@ -6,13 +6,16 @@
</view> </view>
</view> </view>
<scroll-view class="scroll-view-pk" v-if="list.length>0"> <scroll-view class="scroll-view-pk" scroll-y :show-scrollbar="false" v-if="list.length>0" @scrolltolower="loadMore">
<view class="list-item" v-for="(item,index) in list"> <view class="list-item" v-for="(item,index) in list">
<image src="/static/images/default-avatar.png" class="avatar"></image> <image src="/static/images/default-avatar.png" class="avatar"></image>
<view class="name">{{item.nickName}}</view> <view class="name">{{item.nickName}}</view>
<view class="datetime">{{item.createTime}}</view> <view class="datetime">{{item.createTime}}</view>
</view> </view>
</scroll-view> </scroll-view>
<scroll-view class="scroll-view-pk" scroll-y :show-scrollbar="false" v-if="list.length==0">
<list-empty></list-empty>
</scroll-view>
</view> </view>
</template> </template>
...@@ -21,6 +24,7 @@ ...@@ -21,6 +24,7 @@
import { import {
voteList voteList
} from '@/api/api.js' } from '@/api/api.js'
import ListEmpty from '@/components/ListEmpty.vue';
export default { export default {
data() { data() {
return { return {
...@@ -30,11 +34,15 @@ ...@@ -30,11 +34,15 @@
momentId: '', momentId: '',
optionCode:undefined optionCode:undefined
}, },
total:0,
activeIndex: 0, activeIndex: 0,
voteOptions: [], voteOptions: [],
list:[] list:[]
} }
}, },
components:{
ListEmpty
},
onLoad(options) { onLoad(options) {
let { let {
momentId, momentId,
...@@ -49,16 +57,29 @@ ...@@ -49,16 +57,29 @@
}, },
methods: { methods: {
getList() { getList() {
uni.showLoading({
title:'加载中...'
})
voteList(this.queryParams).then(res => { voteList(this.queryParams).then(res => {
console.log(res) this.list = [...this.list,...res.rows];
this.list = res.data this.total = res.total;
}).finally(()=>{
uni.hideLoading()
}) })
}, },
handleChange(item,index){ handleChange(item,index){
this.activeIndex = index this.activeIndex = index
this.queryParams.optionCode = item.code; this.queryParams.optionCode = item.code;
this.queryParams.pageNum = 1;
this.list = []
this.getList() this.getList()
} },
loadMore() {
if(this.list.length < this.total){
this.queryParams.pageNum += 1;
this.getList()
}
},
} }
} }
</script> </script>
...@@ -67,6 +88,7 @@ ...@@ -67,6 +88,7 @@
@import '@/static/styles/common.scss'; @import '@/static/styles/common.scss';
.pk-detail-page { .pk-detail-page {
background-color: white;
.pk-tab-box { .pk-tab-box {
height: 92rpx; height: 92rpx;
display: flex; display: flex;
......
...@@ -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({
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);
}
if(!this.form.voteTitle){
uni.showToast({ uni.showToast({
title:'请上传PK图片' title: '请输入PK标题',
icon: 'error'
}) })
return; return;
} }
if(this.voteOptionsOpposing.length == 0){ if (!this.form.voteOptions[0].name || !this.form.voteOptions[1].name) {
uni.showToast({ uni.showToast({
title:'请上传PK图片' title: '请输入PK选项',
icon: 'error'
}) })
return; return;
} }
} }
crateNewDynamic(this.form).then(res => {
if(this.form.voteOptionType == 'IMAGE'){ if (res.code == 200) {
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=>{
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'
}) })
} }
}) })
......
...@@ -9,13 +9,14 @@ ...@@ -9,13 +9,14 @@
<image src="/static/images/topic.png" class="topic-img"></image> <image src="/static/images/topic.png" class="topic-img"></image>
</view> </view>
</view> </view>
<scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-if="list.length>0"> <scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-if="list.length>0"
@scrolltolower="loadMore">
<template v-for="(item,index) in list"> <template v-for="(item,index) in list">
<dynamic-item :form="item"></dynamic-item> <dynamic-item :form="item"></dynamic-item>
</template> </template>
</scroll-view> </scroll-view>
<scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-else> <scroll-view class="scroll-view-topic" scroll-y :show-scrollbar="false" v-else>
<list-empty></list-empty>
</scroll-view> </scroll-view>
<view class="publisb-box"> <view class="publisb-box">
<view class="publish-btn" @click="handleToPublish"> <view class="publish-btn" @click="handleToPublish">
...@@ -28,113 +29,143 @@ ...@@ -28,113 +29,143 @@
<script> <script>
import DynamicItem from '@/components/Dynamic-Item.vue'; import DynamicItem from '@/components/Dynamic-Item.vue';
import {topicDynamics} from '@/api/api.js'; import ListEmpty from '@/components/ListEmpty.vue';
import {
topicDynamics
} from '@/api/api.js';
export default { export default {
data() { data() {
return { return {
list:[], list: [],
topicName:'', topicName: '',
queryParams:{ queryParams: {
pageNum:1, pageNum: 1,
pageSize:10, pageSize: 10,
topicId:'' topicId: ''
} },
total: 0
} }
}, },
components:{ components: {
DynamicItem DynamicItem,
ListEmpty
}, },
onLoad(options) { onLoad(options) {
let {topicId,topicName} = options; let {
topicId,
topicName
} = options;
this.topicName = topicName this.topicName = topicName
if(topicId){ if (topicId) {
this.queryParams.topicId = topicId this.queryParams.topicId = topicId
this.getDetail() this.getDetail()
} }
}, },
methods: { methods: {
getDetail(){ getDetail() {
topicDynamics(this.queryParams).then(res=>{ uni.showLoading({
console.log(res) title: '加载中...'
this.list = res.rows })
topicDynamics(this.queryParams).then(res => {
this.list = [...this.list, ...res.rows];
this.total = res.total;
}).finally(() => {
uni.hideLoading()
}) })
}, },
handleToPublish(){ handleToPublish() {
uni.navigateTo({ uni.navigateTo({
url:`/pages/publish/publish?topicId=${this.queryParams.topicId}&topicName=${this.topicName}` url: `/pages/publish/publish?topicId=${this.queryParams.topicId}&topicName=${this.topicName}`
}) })
} },
loadMore() {
if (this.list.length < this.total) {
this.queryParams.pageNum += 1;
this.getList()
}
},
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
@import '@/static/styles/common.scss'; @import '@/static/styles/common.scss';
.topic-detail-page{
background-color: white; .topic-detail-page {
.topic-box{ background-color: white;
padding: 32rpx 34rpx 0 32rpx;
.topic-container{ .topic-box {
width: 92vw; padding: 32rpx 34rpx 0 32rpx;
height: 180rpx;
border-radius: 12rpx; .topic-container {
background: linear-gradient(89.31deg, rgba(230,246,254,1) 1.2%,rgba(186,239,255,1) 99.53%); width: 92vw;
text-align: center; height: 180rpx;
padding: 0 30rpx; border-radius: 12rpx;
box-sizing: border-box; background: linear-gradient(89.31deg, rgba(230, 246, 254, 1) 1.2%, rgba(186, 239, 255, 1) 99.53%);
display: flex; text-align: center;
align-items: center; padding: 0 30rpx;
justify-content: space-between; box-sizing: border-box;
.topic-title-num{ display: flex;
width: calc(100% - 180rpx); align-items: center;
text-align: left; justify-content: space-between;
.title{
color: rgba(16, 16, 16, 1); .topic-title-num {
font-size: 36rpx; width: calc(100% - 180rpx);
text-align: left;
.title {
color: rgba(16, 16, 16, 1);
font-size: 36rpx;
}
.num {
color: rgba(162, 170, 184, 1);
font-size: 24rpx;
margin-top: 12rpx;
}
} }
.num{
color: rgba(162, 170, 184, 1); .topic-img {
font-size: 24rpx; width: 160rpx;
margin-top: 12rpx; height: 160rpx;
} }
} }
.topic-img{
width: 160rpx;
height: 160rpx;
}
} }
}
.scroll-view-topic {
.scroll-view-topic{ @include scroll-view-container(calc(100vh - 340rpx))
@include scroll-view-container(calc(100vh - 340rpx)) }
}
.publisb-box {
.publisb-box{ height: 122rpx;
height:124rpx ; background-color: white;
background-color: rgba(244, 244, 244, 1); border-top: 1px solid #eee;
display: flex;
justify-content: center;
align-items: center;
.publish-btn{
width: 240rpx;
height: 80rpx;
border-radius: 12rpx;
background-color: rgba(255, 255, 255, 1);
text-align: center;
border: 1px solid rgba(230, 230, 230, 1);
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
.icon{ align-items: center;
width: 36rpx;
height: 36rpx; .publish-btn {
margin-right: 16rpx; width: 240rpx;
} height: 80rpx;
.text{ border-radius: 12rpx;
color: rgba(187, 187, 187, 1); background-color: rgba(255, 255, 255, 1);
font-size: 32rpx; text-align: center;
border: 1px solid rgba(230, 230, 230, 1);
display: flex;
align-items: center;
justify-content: center;
.icon {
width: 36rpx;
height: 36rpx;
margin-right: 16rpx;
}
.text {
color: rgba(187, 187, 187, 1);
font-size: 32rpx;
}
} }
} }
} }
} </style>
</style> \ No newline at end of file
...@@ -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="搜索" 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
}) })
......
...@@ -193,7 +193,6 @@ ...@@ -193,7 +193,6 @@
.results-item{ .results-item{
width: 100%; width: 100%;
height: 12rpx; height: 12rpx;
background-color: rgba(238, 238, 238, 1);
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 1);
font-size: 28rpx; font-size: 28rpx;
...@@ -201,10 +200,12 @@ ...@@ -201,10 +200,12 @@
.left-item{ .left-item{
border-radius: 6rpx 0 0 6rpx; border-radius: 6rpx 0 0 6rpx;
margin-right: 10rpx; margin-right: 10rpx;
background-color: rgba(255, 100, 95, 1);
} }
.right-item{ .right-item{
border-radius: 0 6rpx 6rpx 0; border-radius: 0 6rpx 6rpx 0;
margin-left: 10rpx; margin-left: 10rpx;
background-color: rgba(52, 132, 253, 1);
} }
} }
......
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