ShopModal.tsx 1.14 KB
import React, {useEffect, useState} from 'react';
import {Modal, Button, List} from 'antd';
import { useStore } from '../index';
import styles from '../index.less';

export default function Index() {
  const { statusData, setStatusData } = useStore();
  function handleCancel() {
    setStatusData({visible: false, data: []});
  }

  return (
    <Modal
      destroyOnClose
      title={<div className={styles.lineWrap}><span className={styles.line} /><span className={styles.lineText}>适用门店</span></div>}
      visible={statusData.visible}
      maskClosable={false}
      onCancel={handleCancel}
      footer={[]}
      className={styles.modal}
    >
      <List
        size="large"
        style={{height: '300px', overflow: 'scroll'}}
        dataSource={statusData?.data || []}
        renderItem={(item: any) => <List.Item style={{justifyContent: 'center'}}>{item.shopName}</List.Item>}
      />
      <div
        style={{
            textAlign: 'center',
            marginTop: 12,
            height: 32,
            lineHeight: '32px',
          }}
      ><Button type="primary" onClick={handleCancel}>返回</Button>
      </div>
    </Modal>
  );
}