YingXingAI/pages/message/adminList/adminList.vue

235 lines
5.3 KiB
Vue

<template>
<view>
<u-navbar title="管理列表" :border-bottom="false"></u-navbar>
<scroll-view scroll-y="true" class="scroll">
<view class="flex-col list" v-if='list.length'>
<view class="flex-row list_item" v-for="(item, i) in list" @click="GoChat(item)" :key="i">
<u-avatar class="image" :show-sex="vuex_msgList.indexOf(item.fromUserId+'admin,')>=0" sex-icon=""
sex-bg-color="red" :src="$u.http.config.imgUrl+item.fromUserHead"></u-avatar>
<view class="right-section flex-col">
<view class="top-group justify-between view_1">
<view class="flex-row">
<text class="text_1">{{item.fromUserName}}</text>
<view class="right-text-wrapper flex-col items-end">
<text class="text_3">{{item.schoolName}}</text>
</view>
</view>
<text
v-if='new Date(item.sendDate) - 0 + (3600000*24)> new Date()&&new Date(item.sendDate).getDate()==new Date().getDate()'
class="text_5">{{ item.sendDate.slice(10,16)}}</text>
<text v-else class="text_5">{{ item.sendDate.slice(0,10)}}</text>
</view>
<view class="bottom-group justify-between">
<text class="text_7">{{item.message}}</text>
<text class="text_9" v-if="item.messageState == 0">未读</text>
<text class="text_9" v-if="item.messageState == 1">已读</text>
<text class="text_10" v-if="item.messageState == 2">待回复</text>
<text class="text_10" v-if="item.messageState == 3">回复中...</text>
<text class="text_10" v-if="item.messageState == 4">已回复</text>
</view>
</view>
</view>
</view>
<view v-else style='padding-top:30vh'>
<!-- <u-empty text="暂无消息列表" mode="message"></u-empty> -->
<no-data text="暂无消息列表"></no-data>
</view>
</scroll-view>
<u-toast ref="uToast" />
</view>
</template>
<script>
import NoData from 'components/NoData.vue'
export default {
components: {
NoData
},
data() {
return {
list: [],
};
},
onLoad() {},
onShow() {
this.getList()
},
methods: {
// 去聊天
GoChat(data) {
//管理员聊天绑定
this.$u.api.toBind({
manageUser: this.vuex_user.id,
lockUser: data.fromUserId
}).then(res => {
uni.navigateTo({
url: '../dialogBox/dialogBox?id=admin' + '&shoolid=' + data.schoolId + '&fromid=' + data
.fromUserId
});
}).catch(err=>{
/* uni.showToast({
title: '已有老师回复',
duration: 2000,
icon:'none'
}); */
this.$refs.uToast.show({
title: '已有老师回复',
type: 'warning',
});
})
},
getList() {
this.$u.api.getAdminList().then(res => {
this.list = res
})
},
//返回上一级
router() {
uni.switchTab({
url: '../../message/msgList/msgList'
})
},
}
};
</script>
<style lang="scss" scoped>
::v-deep .u-avatar__sex {
width: 0.1rem !important;
height: 0.1rem !important;
border: none;
}
.scroll {
background-color: rgb(246, 247, 250);
width: 100%;
height: calc(100vh - 0.44rem);
}
.list_item {
padding-left: 0.2rem;
background: #fff;
box-shadow: 0px 0.005rem rgb(234, 234, 234);
border-bottom: 1px solid rgb(234, 234, 234);
}
.image {
align-self: center;
width: 0.4rem;
height: 0.4rem;
border-radius: 50%;
}
.right-section {
margin-left: 0.14rem;
padding: 0.13rem 0.015rem 0.15rem;
flex: 1 1 auto;
height: 0.66rem;
}
.list_item:last-child .right-section {
border: none;
}
.top-group {
margin-top: 0.09rem;
width: 0.4rem;
height: 0.4rem;
}
.bottom-group {
margin-top: 0.05rem;
}
.text_5 {
text-align: right;
margin-right: 0.1rem;
margin-top: 0.02rem;
color: rgb(193, 196, 204);
font-size: 0.12rem;
line-height: 0.095rem;
letter-spacing: 0.012rem;
white-space: nowrap;
min-width: 0.5rem;
}
.text_7 {
margin-top: 0.035rem;
color: rgb(177, 179, 182);
font-size: 0.12rem;
line-height: 0.12rem;
letter-spacing: 0.012rem;
white-space: nowrap;
text-align: right;
}
.text_9 {
margin-right: 0.085rem;
margin-bottom: 0.035rem;
color: rgb(46, 155, 255);
font-size: 0.11rem;
line-height: 0.11rem;
letter-spacing: 0.011rem;
white-space: nowrap;
min-width: 0.5rem;
text-align: right;
}
.text_10 {
color: rgb(177, 179, 182);
font-size: 0.11rem;
line-height: 0.11rem;
letter-spacing: 0.011rem;
white-space: nowrap;
min-width: 0.5rem;
text-align: right;
margin-right: 0.1rem;
margin-top: 0.035rem;
}
.text_1 {
margin: 0.02rem 0;
color: rgb(2, 2, 2);
font-size: 0.15rem;
line-height: 0.14rem;
letter-spacing: 0.015rem;
white-space: nowrap;
max-width: 0.65rem;
overflow: hidden;
text-overflow: ellipsis;
}
.right-text-wrapper {
margin-left: 0.045rem;
padding: 0.035rem 0.08rem;
color: rgb(115, 129, 255);
font-size: 0.11rem;
line-height: 0.11rem;
letter-spacing: 0.011rem;
white-space: nowrap;
background-color: rgba(115, 129, 255, 0.1);
border-radius: 0.09rem;
height: 0.18rem;
}
.text_3 {
margin-right: 0.03rem;
}
.list {
padding-top: 0.01rem;
}
.view_1 {
margin-top: initial;
width: initial;
height: initial;
}
</style>