瀏覽代碼

提升代码兼容

yanqiliang 3 月之前
父節點
當前提交
038b1bb34f
共有 1 個文件被更改,包括 4 次插入4 次删除
  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'>