|
@@ -1,7 +1,7 @@
|
|
import React,{Component} from "react";
|
|
import React,{Component} from "react";
|
|
-import {View,Text,Button} from '@tarojs/components'
|
|
|
|
|
|
+import {View,Text,ScrollView} from '@tarojs/components'
|
|
import Taro from '@tarojs/taro';
|
|
import Taro from '@tarojs/taro';
|
|
-import { AtModal, AtModalHeader, AtModalContent, AtModalAction,AtNoticebar,AtList, AtListItem } from 'taro-ui'
|
|
|
|
|
|
+import {AtNoticebar} from 'taro-ui'
|
|
import './index.less';
|
|
import './index.less';
|
|
import {getPublicReleaseUnread} from '../../../utils/servers/servers';
|
|
import {getPublicReleaseUnread} from '../../../utils/servers/servers';
|
|
|
|
|
|
@@ -19,7 +19,7 @@ class MessageNoticebar extends Component{
|
|
isOpend:false,
|
|
isOpend:false,
|
|
isOpened:false,
|
|
isOpened:false,
|
|
str:'',
|
|
str:'',
|
|
- list:[],
|
|
|
|
|
|
+ list:[]
|
|
}
|
|
}
|
|
this.onClose = this.onClose.bind(this);
|
|
this.onClose = this.onClose.bind(this);
|
|
this.getPublicReleaseUnread = this.getPublicReleaseUnread.bind(this);
|
|
this.getPublicReleaseUnread = this.getPublicReleaseUnread.bind(this);
|
|
@@ -82,25 +82,13 @@ class MessageNoticebar extends Component{
|
|
getPublicReleaseUnread({}).then(v=>{
|
|
getPublicReleaseUnread({}).then(v=>{
|
|
if(v.error.length === 0){
|
|
if(v.error.length === 0){
|
|
if(v.data.length === 0){return;}
|
|
if(v.data.length === 0){return;}
|
|
- // v.data=[
|
|
|
|
- // {
|
|
|
|
- // content:'订单开票完成: 订单编号-456778796184780800操作人:湖南科德-平台事业发展部-财务专员',
|
|
|
|
- // createTimeFormattedDate:'2021-05-06 16:20:20',
|
|
|
|
- // noticeTypeName:'订单开票完成'
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // content:'订单开票完成:订单编号-456778796184780800,操作人:湖南科德-平台事业发展部-财务专员',
|
|
|
|
- // createTimeFormattedDate:'2021-05-06 16:20:20',
|
|
|
|
- // noticeTypeName:'订单开票完成'
|
|
|
|
- // }
|
|
|
|
- // ];
|
|
|
|
let str = this.state.isOpend ? this.state.str : '';
|
|
let str = this.state.isOpend ? this.state.str : '';
|
|
for(let i of v.data){
|
|
for(let i of v.data){
|
|
str+=i.content+'\t\t\t\t\t'
|
|
str+=i.content+'\t\t\t\t\t'
|
|
}
|
|
}
|
|
Taro.eventCenter.trigger('getMessageNoticebar',{
|
|
Taro.eventCenter.trigger('getMessageNoticebar',{
|
|
str,
|
|
str,
|
|
- list: this.state.isOpend ? this.state.list.concat(v.data) : v.data
|
|
|
|
|
|
+ list: this.state.isOpend ? v.data.concat(this.state.list) : v.data
|
|
});
|
|
});
|
|
}else{
|
|
}else{
|
|
Taro.showToast({title:v.error[0].message,icon:'none'})
|
|
Taro.showToast({title:v.error[0].message,icon:'none'})
|
|
@@ -147,23 +135,25 @@ class MessageNoticebar extends Component{
|
|
<View className='messageNoticebarContent'>
|
|
<View className='messageNoticebarContent'>
|
|
<View className='messageContent'>
|
|
<View className='messageContent'>
|
|
<View className='title'>未读消息</View>
|
|
<View className='title'>未读消息</View>
|
|
- <View className='list'>
|
|
|
|
- {
|
|
|
|
- this.state.list.map((v,k)=>(
|
|
|
|
- <View key={k} className='item'>
|
|
|
|
- <View className='itemHead'>
|
|
|
|
- <View className='content'>
|
|
|
|
- <Text>{v.content}</Text>
|
|
|
|
|
|
+ <ScrollView scrollY scrollWithAnimation scrollTop>
|
|
|
|
+ <View className='list'>
|
|
|
|
+ {
|
|
|
|
+ this.state.list.map((v,k)=>(
|
|
|
|
+ <View key={k} className='item'>
|
|
|
|
+ <View className='itemHead'>
|
|
|
|
+ <View className='content'>
|
|
|
|
+ <Text>{v.content}</Text>
|
|
|
|
+ </View>
|
|
|
|
+ </View>
|
|
|
|
+ <View className='itemBottom'>
|
|
|
|
+ <View className='noticeTypeName'>{v.noticeTypeName}</View>
|
|
|
|
+ <View className='createTimeFormattedDate'>{v.createTimeFormattedDate}</View>
|
|
|
|
+ </View>
|
|
</View>
|
|
</View>
|
|
- </View>
|
|
|
|
- <View className='itemBottom'>
|
|
|
|
- <View className='noticeTypeName'>{v.noticeTypeName}</View>
|
|
|
|
- <View className='createTimeFormattedDate'>{v.createTimeFormattedDate}</View>
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- ))
|
|
|
|
- }
|
|
|
|
- </View>
|
|
|
|
|
|
+ ))
|
|
|
|
+ }
|
|
|
|
+ </View>
|
|
|
|
+ </ScrollView>
|
|
<View className='operation' onClick={()=>{
|
|
<View className='operation' onClick={()=>{
|
|
this.setState({
|
|
this.setState({
|
|
isOpened:false,
|
|
isOpened:false,
|