2020-09-27

This commit is contained in:
peihaoyu 2020-09-27 15:41:09 +08:00
parent 641fbe6b98
commit a054fb6ba4
11 changed files with 868 additions and 0 deletions

View File

@ -0,0 +1,52 @@
<template>
<view>
<!-- <view class="cu-avatar round" :style="size" style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg)"></view> -->
<view class="header-photo" :style="photoStyle">
{{userName.slice(0,1)}}
</view>
</view>
</template>
<script>
export default {
props: {
size: {
type: String,
default: "90"
},
userId: {
type: String,
default: ""
},
userName: {
type: String,
default: "H"
}
},
computed: {
photoStyle() {
return `font-size: ${this.size}rpx; width: ${2*this.size}rpx; height: ${2*this.size}rpx; line-height: ${2*this.size}rpx;`
}
},
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped>
.header-photo{
background-image: url("@/static/img/photo-bc.jpg");
background-size: 100% 100%;
font-family: "宋体";
color: #FFFFFF;
border-radius: 50%;
text-align: center;
margin: 20rpx;
}
</style>

View File

@ -0,0 +1,189 @@
<template>
<view class="content">
<m-search
:show="false"
placeholder="搜索"
button="none"
backgroundColor="#efecec"
v-model="searchStr"
></m-search>
<view class="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
</view>
<view class="list cu-card article dynamic" v-else-if="noData === false">
<view class="cu-item" style="padding:0" v-for="(item,index) in noticeListQuery" :key="index">
<view class="cu-list menu solid-bottom" @click="goToDetails(item)">
<view class="cu-item arrow" style="min-height: 90rpx;padding-top: 10rpx;">
<view class="action">
<view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长建议'">{{item.type}}</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text>
</view>
</view>
</view>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;">
<text class="text-gray">文章标签</text>
<text class="">{{item.label}}</text>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;" @tap="goToUserInfo(item)">
<text class="text-gray">发表人</text>
<text class="">{{item.releaseName}}</text>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;">
<text class="text-gray">发表时间</text>
<text class="">{{item.releaseTime}}</text>
</view>
<view class="cu-item flex flex-direction bg-white solid-top">
<button class="cu-btn bg-white text-orange lg" style="color: #1296DB;font-weight: 400;"
@tap.stop="verifyArticle(item,'1')">
通过
</button>
<button class="cu-btn bg-white text-orange lg" style="color: red;font-weight: 400;"
@tap.stop="verifyArticle(item,'2')">
驳回
</button>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
import mSearch from '@/components/mehaotian-search/mehaotian-search.vue';
import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js';
export default {
components: {
mSearch,
noData
},
data() {
return {
//
noData: false,
//
searchStr: '',
//
noticeList: [],
};
},
computed: {
//
noticeListQuery(){
return this.noticeList.filter(notice => {
return notice.title.indexOf(this.searchStr) != -1 || notice.type.indexOf(this.searchStr) != -1
|| notice.real_name.indexOf(this.searchStr) != -1
})
}
},
onLoad() {
},
onShow() {
this.getAllData();
},
onPullDownRefresh () {
this.getAllData();
},
methods: {
/**
* 审核通过/驳回
* @param {Object} item
*/
verifyArticle(item, operating) {
const OPERATING = {
"1": "通过",
"2": "驳回"
};
let _this = this;
uni.showModal({
title: "审核",
content: `确认${OPERATING[operating]}?`,
success(res) {
if (res.confirm) {
request.post('/admin/verifyArticle',{
articleId: item.articleId,
operating: operating
}).then(res=>{
console.log("审核结果",res);
if (res.data > 0) {
uni.showToast({
icon: "loading",
title: `${OPERATING[operating]}成功`
});
setTimeout(() => {
_this.getAllData();
},1000)
} else {
uni.showToast({
icon: "none",
title: "服务器出小差了,请稍后再试"
})
}
},err=>{
console.log("err",err);
})
}
}
})
},
/**
* 跳转个人主页页面
* @param {Object} item
*/
goToUserInfo(item) {
if (item.user_id === uni.getStorageSync("userInfo").user_id) {
uni.switchTab({
url: '/pages/tabbar/my/my'
});
} else {
uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.releaseId}`
})
}
},
/**
* 跳转详情页面
* @param {Object} item
*/
goToDetails(item) {
uni.navigateTo({
url: '/pages/tabbar/homepage/data-details?noticeId='+item.articleId
})
},
/**
* 获取文章管理数据
*/
getAllData() {
request.post('/admin/getVerifyList',{})
.then(res=>{
this.noticeList = res.data.sort(sortBy("release_time",false));
uni.startPullDownRefresh();
this.noData = this.noticeList.length === 0 ? true : false;
console.log("文章管理数据",this.noticeList);
},err=>{
console.log("err",err);
})
}
}
};
</script>
<style scoped>
.content {
min-height: 85vh;
padding-bottom: 100rpx;
}
.text-gray{
display: inline-block;
width: 4rem;
}
.cu-card>.cu-item{
margin: 20rpx!important;
}
</style>

View File

@ -0,0 +1,177 @@
<template>
<view class="content">
<m-search
:show="false"
placeholder="搜索"
button="none"
backgroundColor="#efecec"
v-model="searchStr"
></m-search>
<view class="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
</view>
<view class="list cu-card article dynamic" v-else-if="noData === false">
<view class="cu-item" style="padding:0" v-for="(item,index) in noticeListQuery" :key="index">
<view class="cu-list menu solid-bottom" @click="goToDetails(item)">
<view class="cu-item arrow" style="min-height: 90rpx;padding-top: 10rpx;">
<view class="action">
<view class="action">
<view class='cu-tag radius bg-orange light margin-right-xs' v-if="item.type === '校园通知'">{{item.type}}</view>
<view class='cu-tag radius bg-blue light margin-right-xs' v-if="item.type === '家长建议'">{{item.type}}</view>
<view class='cu-tag radius bg-green light margin-right-xs' v-if="item.type === '学生想法'">{{item.type}}</view>
<text class="text-black text-lg">{{item.title}}</text>
</view>
</view>
</view>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;">
<text class="text-gray">文章标签</text>
<text class="">{{item.label}}</text>
<text class="cancel" @tap="cancelCollection(item)">取消收藏</text>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;">
<text class="text-gray">发表人</text>
<text class="" @tap="goToUserInfo(item)">{{item.real_name}}</text>
</view>
<view class="text-content" style="margin:10rpx 0 0 0;">
<text class="text-gray">发表时间</text>
<text class="">{{item.release_time}}</text>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
import mSearch from '@/components/mehaotian-search/mehaotian-search.vue';
import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js';
export default {
components: {
mSearch,
noData
},
data() {
return {
//
noData: false,
//
searchStr: '',
//
noticeList: [],
};
},
computed: {
//
noticeListQuery(){
return this.noticeList.filter(notice => {
return notice.title.indexOf(this.searchStr) != -1 || notice.type.indexOf(this.searchStr) != -1
|| notice.real_name.indexOf(this.searchStr) != -1
})
}
},
onLoad() {
},
onShow() {
this.getAllData();
},
onPullDownRefresh () {
this.getAllData();
},
methods: {
/**
* 跳转个人主页页面
* @param {Object} item
*/
goToUserInfo(item) {
uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.user_id}`
})
},
/**
* 更新方法
*/
update() {
this.getAllData();
},
/**
* 取消收藏
* @param {Object} item
*/
cancelCollection(item) {
let _this = this;
uni.showModal({
title: '取消收藏',
content: '确认取消收藏?',
success(res) {
if (res.confirm) {
request.post("/hs/cancelCollection",{
userId: uni.getStorageSync("userInfo").user_id,
noticeId: item.id
}).then(res => {
console.log("取消收藏",res);
if (res.data === 1) {
_this.getAllData();
}
},err => {
console.log("err",err);
})
} else if (res.cancel) {
console.log("取消");
}
}
})
},
/**
* 跳转详情页面
* @param {Object} item
*/
goToDetails(item) {
uni.navigateTo({
url: '/pages/tabbar/homepage/data-details?noticeId='+item.id
})
},
/**
* 获取收藏数据
*/
getAllData() {
request.post('/hs/getCollectionList',{
userId: uni.getStorageSync("userInfo").user_id
})
.then(res=>{
this.noticeList = res.data;
uni.startPullDownRefresh();
this.noData = this.noticeList.length === 0 ? true : false;
console.log("收藏页面数据",res.data);
},err=>{
console.log("err",err);
})
}
}
};
</script>
<style scoped>
.cancel{
float: right;
margin-right: 32rpx;
padding: 0 5rpx;
color: red;
border: 1rpx solid red;
border-radius: 10rpx;
}
.content {
min-height: 85vh;
padding-bottom: 100rpx;
}
.text-gray{
display: inline-block;
width: 4rem;
}
.cu-card>.cu-item{
margin: 20rpx!important;
}
</style>

View File

@ -0,0 +1,228 @@
<template>
<view class="page">
<view class="top">
<view class="title">
等待帮助
</view>
<view class="no-data" v-if="notHelpNoData">
暂无等待帮助
</view>
<view class="help-list" v-if="!notHelpNoData">
<view class="one-help" v-for="(item,index) in notHelpList" :key="index">
<view class="cu-item maigin-bottom">
<view class="action">
<text class="text-black">提问内容</text>
</view>
</view>
<view class="cu-item content maigin-bottom">
<textarea v-model="item.question"
auto-height="true"
maxlength=2000
disabled="true"
></textarea>
</view>
<view class="cu-item time maigin-bottom">
提问时间{{item.create_time}}
</view>
<view class="cu-item maigin-bottom">
<view class="action">
<text class="text-black">解决方案</text>
</view>
</view>
<view class="cu-item content maigin-bottom">
<textarea v-model="item.answer"
auto-height="true"
maxlength=2000
placeholder="请输入解决方案"
></textarea>
</view>
<view class="button">
<button type="default" @tap="answerHelp(item)">提交</button>
</view>
</view>
</view>
</view>
<view class="bottom">
<view class="title">
历史帮助
</view>
<view class="no-data" v-if="historyHelpNoData">
暂无历史帮助
</view>
<view class="help-list" v-if="!historyHelpNoData">
<view class="one-help" v-for="(item,index) in historyHelpList" :key="index">
<view class="cu-item maigin-bottom">
<view class="action">
<text class="text-black">提问内容</text>
</view>
</view>
<view class="cu-item content maigin-bottom">
<textarea v-model="item.question"
auto-height="true"
maxlength=2000
disabled="true"
></textarea>
</view>
<view class="cu-item time maigin-bottom">
提问时间{{item.create_time}}
</view>
<view class="cu-item maigin-bottom">
<view class="action">
<text class="text-black">解决方案</text>
</view>
</view>
<view class="cu-item content maigin-bottom">
<view class="no-answer" v-if="item.answer === ''">
暂无解决方案
</view>
<textarea v-model="item.answer"
auto-height="true"
maxlength=2000
disabled="true"
v-if="item.answer !== ''"
></textarea>
</view>
<view class="cu-item time maigin-bottom" v-if="item.answer_time !== ''">
回答时间{{item.answer_time}}
</view>
<view class="cu-item time maigin-bottom" @tap="goToUserInfo(item)" v-if="item.real_name !== ''">
回答人{{item.real_name}}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
export default {
data() {
return {
//
notHelpList: [],
//
historyHelpList: [],
//
notHelpNoData: false,
//
historyHelpNoData: false
}
},
onLoad() {
this.getHistoryHelp();
},
onPullDownRefresh () {
uni.startPullDownRefresh();
},
methods: {
/**
* 跳转个人主页页面
* @param {Object} item
*/
goToUserInfo(item) {
uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.answer_id}`
})
},
/**
* 提交帮助
*/
answerHelp(item) {
if (this.answer === "") {
uni.showToast({
icon: "none",
title: "请输入解决方案"
})
} else {
request.post("/admin/answerHelp",{
answerId: uni.getStorageSync("userInfo").user_id,
answer: item.answer,
id: item.id
}).then(res => {
console.log("提交解决方案",res);
if (res.data === 1) {
uni.showToast({
icon: "loading",
title: "提交成功"
});
this.getHistoryHelp();
}
},err => {
console.log("err",err);
})
}
},
/**
* 获取帮助答复列表
*/
getHistoryHelp() {
request.post("/admin/getHelpAnswerList",{
userId: uni.getStorageSync("userInfo").user_id
}).then(res => {
this.notHelpList = [];
this.historyHelpList = [];
res.data.forEach(item => {
if (item.answer_id === undefined) {
this.notHelpList.push(item);
} else {
this.historyHelpList.push(item);
}
})
this.notHelpNoData = res.data.length === 0 ? true : false;
this.historyHelpNoData = res.data.length === 0 ? true : false;
console.log("历史帮助列表",res);
},err => {
console.log("err",err);
})
}
}
}
</script>
<style scoped>
.no-data{
text-align: center;
padding: 40rpx 0;
}
.one-help{
margin-bottom: 20rpx;
border-bottom: 5rpx dashed #969696;
}
.time{
font-size: 30rpx;
color: #b0b0b0;
}
.title{
text-align: center;
font-family: "楷体";
font-size: 48rpx;
font-weight: bold;
color: #969696;
padding-top: 20rpx;
}
.button{
padding: 40rpx 200rpx;
}
.maigin-bottom{
margin-bottom: 20rpx;
}
.content {
background-color: #F1F1F1;
width: 100%;
padding: 20rpx;
border-radius: 10rpx;
}
textarea{
line-height: 1.5;
width: 100%;
height: 100%;
}
.top, .bottom{
padding: 20rpx;
background-color: #FFFFFF;
margin-bottom: 20rpx;
}
</style>

View File

@ -0,0 +1,222 @@
<template>
<view class="content">
<m-search
:show="false"
placeholder="搜索"
button="none"
backgroundColor="#efecec"
v-model="searchStr"
></m-search>
<view class="noData" v-if="noData === true">
<noData :custom="true"><view class="title" @tap="update()">暂无数据,点击重新加载</view></noData>
</view>
<view class="list cu-card article dynamic" v-else-if="noData === false">
<view class="cu-item one" style="padding:0" v-for="(item,index) in followList" :key="index" @tap="goToUserInfo(item)">
<view class="one-left-two">
<avatar :userName="item.real_name" size="50"></avatar>
<view class="one-right">
<view class="name">
{{item.real_name}}
</view>
<view class="other-info">
<view class="other-info-left">
关注:{{item.followNumber}}
</view>
<view class="other-info-middle">
粉丝:{{item.fansNumber}}
</view>
<view class="other-info-right">
积分:{{item.integral}}
</view>
</view>
</view>
</view>
<view class="follow-flag ed" @tap.stop="peopleManagement(item, '1')" v-if="item.frozen_state === '0'">
冻结
</view>
<view class="follow-flag" @tap.stop="peopleManagement(item, '0')" v-if="item.frozen_state === '1'">
解冻
</view>
</view>
</view>
</view>
</template>
<script>
import request from '@/util/request.js';
import mSearch from '@/components/mehaotian-search/mehaotian-search.vue';
import noData from '@/components/noData/noData.vue';
import { sortBy } from '@/static/js/public.js';
import avatar from "@/pages/components/avatar/avatar.vue";
export default {
components: {
mSearch,
noData,
avatar
},
data() {
return {
//
noData: false,
//
searchStr: '',
//
followList: [],
flag: true
}
},
onPullDownRefresh () {
this.getFollowPeopleList();
},
onShow() {
this.getFollowPeopleList();
},
mounted() {
this.getFollowPeopleList();
},
methods: {
/**
* 冻结/解冻
* @param {Object} item
* @param {Object} operation 冻结/解冻
*/
peopleManagement(item, operating) {
const OPERATING = {
"0": "解冻",
"1": "冻结",
};
let _this = this;
uni.showModal({
title: `${OPERATING[operating]}`,
content: `确认${OPERATING[operating]}?`,
success(res) {
if (res.confirm) {
request.post('/admin/peopleManagement',{
userId: item.user_id,
operating: operating
}).then(res=>{
console.log("人员操作结果",res);
if (res.data > 0) {
uni.showToast({
icon: "loading",
title: `${OPERATING[operating]}成功`
});
setTimeout(() => {
_this.getFollowPeopleList();
},1000)
} else {
uni.showToast({
icon: "none",
title: "服务器出小差了,请稍后再试"
})
}
},err=>{
console.log("err",err);
})
}
}
})
},
/**
* 跳转个人主页页面
* @param {Object} item
*/
goToUserInfo(item) {
uni.navigateTo({
url: `/pages/person-info-page/person-info-page?userId=${item.user_id}`
})
},
/**
* 获取人员管理列表
*/
getFollowPeopleList() {
request.post("/admin/getPersonnelManagement",{
userId: uni.getStorageSync("userInfo").user_id
}).then(res => {
console.log("人员管理列表",res);
uni.startPullDownRefresh();
this.followList = res.data;
this.noData = this.followList.length === 0 ? true : false;
},err => {
console.log("err",err)
})
}
}
}
</script>
<style scoped>
.other-info-middle{
padding: 0 20rpx;
}
.other-info{
display: flex;
color: #9a9a9a;
font-size: 30rpx;
}
.one-right{
margin-left: 20rpx;
}
.one-left-two{
display: flex;
flex-flow: nowrap;
justify-content: center;
align-items: center;
}
.follow-flag{
border-radius: 10rpx;
background-color: #afafaf;
color: #FFFFFF;
font-size: 30rpx;
padding: 6rpx 14rpx;
}
.ed{
background-color: #269FDE;
color: #FFFFFF;
font-size: 30rpx;
}
.one-right .grade{
font-size: 34rpx;
color: #909090;
}
.one-right .name{
padding-bottom: 12rpx;
font-weight: bold;
}
.one-right .grade-right{
margin-left: 16rpx;
}
.one-left{
font-size: 80rpx;
font-family: 'Courier New', Courier, monospace;
color: #1296DB;
border: 5rpx solid #1296DB;
border-radius: 50%;
width: 140rpx;
height: 140rpx;
text-align: center;
line-height: 140rpx;
margin: 20rpx;
}
.one{
padding-right: 24rpx!important;
}
.one, .grade{
display: flex!important;
flex-flow: nowrap;
align-items: center;
justify-content: space-between;
}
.grade .r, .grade .l{
font-size: 14rpx;
padding: 5rpx;
border-radius: 5rpx;
color: #FFFFFF;
}
.grade .l{
background-color: #9DC75F;
}
.grade .r{
background-color: #2D5315;
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB