Browse Source

提升代码兼容

yanqiliang 3 months ago
parent
commit
038b1bb34f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/pages/doctorScreen/Index.jsx

+ 4 - 4
src/pages/doctorScreen/Index.jsx

@@ -156,11 +156,11 @@ class DoctorScreen extends React.Component {
                     autoplayInterval={8000}
                     loop={true}
                     style={{ height: '100%' }}
-                    total={this.state.waitPat.length}
+                    total={this.state.waitPat?.length}
                     indicator={false}
                     defaultIndex={1}
                   >
-                    {this.state.waitPat.map((patlist, index) => {
+                    {this.state.waitPat?.map((patlist, index) => {
                       return <Swiper.Item key={index} style={{ height: '100%', background: '#fff' }}>
                         {patlist?.map((item, index) => {
                           return (<Grid columns={14} gap={8} key={index} className='mt'>
@@ -200,11 +200,11 @@ class DoctorScreen extends React.Component {
                     loop={true}
                     direction='vertical'
                     style={{ height: '100%' }}
-                    total={this.state.reWaitPat.length}
+                    total={this.state.reWaitPat?.length}
                     indicator={false}
                     defaultIndex={1}
                   >
-                    {this.state.reWaitPat.map((patlist, index) => {
+                    {this.state.reWaitPat?.map((patlist, index) => {
                       return <Swiper.Item key={index} style={{ height: '100%', background: '#fff' }}>
                         {patlist.map((item, index) => {
                           return (<Grid columns={1} gap={8} key={index} className='mt'>