123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <template>
- <view v-show="i === index">
- <view :style="[{'margin-top': CustomBar - 10 + 'px'}]">
- <view class="cu-bar search">
- <view class="search-form bg-white round">
- <text class="cuIcon-search"></text>
- <input type="text" placeholder="搜索" v-model="curWord" confirm-type="search" @input="inputWord"></input>
- </view>
- </view>
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
- <view class="cu-list menu-avatar">
- <view class="cu-item" @click="toDetail(notify)" v-for="(notify, index) in list" :key="index">
- <view class="cu-avatar cuIcon-notification bg-blue round">
- </view>
- <view class="content">
- <view class="text-bold text-grey">
- <view class="ellipsis-description">
- 标题: {{notify.title}}
- </view>
- </view>
-
- <view class=" text-gray text-sm">
- <view class="ellipsis-description">
- 发布者:{{notify.createBy.name}},内容:{{notify.content}}
- </view>
- </view>
- </view>
- <view class="action">
- <view class="text-grey text-xs" >{{notify.createDate}}</view>
- <view :class="notify.readFlag === '1'?'bg-green':'bg-red'" class="cu-tag round sm">
- {{$dictUtils.getDictLabel('oa_notify_read', notify.readFlag ,'')}}</view>
- </view>
- </view>
- </view>
- </mescroll-body>
- </view>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
- import MescrollMoreItemMixin from "@/components/mescroll-uni/mixins/mescroll-more-item.js";
- import notifyService from "@/api/notify/notifyService";
- export default {
- mixins: [MescrollMixin,MescrollMoreItemMixin],
- props:{
- i: Number,
- index: {
- type: Number,
- default(){
- return 0
- }
- },
- tabs: {
- type: Array,
- default(){
- return []
- }
- }
- },
- data() {
- return {
- upOption: {
- noMoreSize: 3,
- empty: {
- tip: '~ 搜索无结果 ~'
- }
- },
- CustomBar: this.CustomBar,
- list: [],
- modalName: null,
- curWord:""
- }
- },
- methods: {
-
- toDetail (item) {
- uni.navigateTo({
- url: '/pages/apps/notification/notificationDetail?id='+item.id
- })
- },
-
- inputWord(e){
-
-
- this.searchTimer && clearTimeout(this.searchTimer)
- this.searchTimer = setTimeout(()=>{
- this.doSearch(this.curWord)
- },300)
- },
-
- doSearch(word){
- this.curWord = word
- this.list = [];
- this.mescroll.resetUpScroll();
- },
-
- upCallback(page) {
-
- notifyService.list({
- isSelf: true,
- current: page.num,
- size: page.size,
- title: this.curWord
- }).then(({data})=>{
- let curPageData = data.records
- this.mescroll.endBySize(curPageData.length, data.total);
-
- if(page.num == 1)
- this.list = [];
-
- this.list=this.list.concat(curPageData);
- }).catch(e=>{
-
- this.mescroll.endErr();
- })
-
- },
- del (id) {
- notifyService.delete(id).then(({data})=>{
- uni.showToast({
- title: data,
- icon:"success"
- })
- this.doSearch(this.curWord)
- })
- }
- }
- }
- </script>
- <style>
- .ellipsis-description {
- font-size: 12px;
- line-height: $line-height-base;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-box-orient: vertical;
- }
-
- .item{
- padding: 20rpx;
- }
- .tip{
- font-size: 30rpx;
- vertical-align: middle;
- }
-
- .word-input{
- display: inline-block;
- width: 60%;
- height: 50rpx;
- line-height: 50rpx;
- font-size: 24rpx;
- margin-left: 30rpx;
- border: 2rpx solid #18B4FE;
- border-radius: 60rpx;
- text-align: center;
- background-color: #fff;
- vertical-align: middle;
- }
-
- .cu-bar .search-form{
- background-color: white;
- }
- </style>
|