Explorar o código

消息提醒界面增加滚动条

test01 %!s(int64=3) %!d(string=hai) anos
pai
achega
d0cb48ae35

+ 1 - 1
src/app.config.js

@@ -41,7 +41,7 @@ export default {
   requiredBackgroundModes:['location'],
   plugins: {
     chooseLocation: {
-      version: "1.0.6",
+      version: "1.0.8",
       provider: "wx76a9a06e5b4e693e"
     }
   },

+ 2 - 2
src/app.jsx

@@ -58,8 +58,8 @@ class App extends Component {
         'token': token,
       },
       url: "wss://bm.jishutao.com/webSocketServer",
-      //  172.16.0.255:8080
-      //  uat.jishutao.com
+      // url: 'wss://172.16.0.255:8080/webSocketServer'
+      // url: 'wss://uat.jishutao.com/webSocketServer'
     })
 
     //连接成功

+ 22 - 32
src/components/common/messageNoticebar/index.jsx

@@ -1,7 +1,7 @@
 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 { AtModal, AtModalHeader, AtModalContent, AtModalAction,AtNoticebar,AtList, AtListItem  } from 'taro-ui'
+import {AtNoticebar} from 'taro-ui'
 import './index.less';
 import  {getPublicReleaseUnread} from '../../../utils/servers/servers';
 
@@ -19,7 +19,7 @@ class MessageNoticebar extends Component{
       isOpend:false,
       isOpened:false,
       str:'',
-      list:[],
+      list:[]
     }
     this.onClose = this.onClose.bind(this);
     this.getPublicReleaseUnread = this.getPublicReleaseUnread.bind(this);
@@ -82,25 +82,13 @@ class MessageNoticebar extends Component{
     getPublicReleaseUnread({}).then(v=>{
       if(v.error.length === 0){
         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 : '';
         for(let i of v.data){
           str+=i.content+'\t\t\t\t\t'
         }
         Taro.eventCenter.trigger('getMessageNoticebar',{
           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{
         Taro.showToast({title:v.error[0].message,icon:'none'})
@@ -147,23 +135,25 @@ class MessageNoticebar extends Component{
           <View className='messageNoticebarContent'>
             <View className='messageContent'>
               <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 className='itemBottom'>
-                        <View className='noticeTypeName'>{v.noticeTypeName}</View>
-                        <View className='createTimeFormattedDate'>{v.createTimeFormattedDate}</View>
-                      </View>
-                    </View>
-                  ))
-                }
-              </View>
+                      ))
+                    }
+                </View>
+              </ScrollView>
               <View className='operation' onClick={()=>{
                 this.setState({
                   isOpened:false,

+ 1 - 0
src/components/common/messageNoticebar/index.less

@@ -44,6 +44,7 @@
       .list{
         padding: 25px 20px;
         min-height: 120px;
+        max-height: 700px;
         .item{
           padding-bottom: 20px;
           border-bottom: 1px #e0dede solid;