广州矛调粤政易端
xusd
7 days ago d27794814b69d18aeb8ee96a46cae91d5613570c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * @Company: hugeInfo
 * @Author: ldh
 * @Date: 2022-08-16 08:50:50
 * @LastEditTime: 2023-02-16 10:06:22
 * @LastEditors: lwh
 * @Version: 1.0.0
 * @Description: 底部选择器
 */
import React from 'react';
import { Drawer, Button, List, Picker } from 'dingtalk-design-mobile';
import { CloseBoldOutlined } from 'dd-icons';
import './index.less';
 
/**
 * visible: bool, // 显隐
 * onClose: func, // 关闭方法
 * title: string, // 弹窗标题
 * body// 自定义内容
 */
 
const years = new Array(new Date().getFullYear() - (new Date().getFullYear() - 10)).fill(0).map((item, i) => ({ label: String(new Date().getFullYear() - 9 + i) + '年' }))
const ModalBottomDownYear = ({
  visible,
  title = "",
  onClose,
  onOkClick,
  onCancel,
  onChange,
}) => {
  return (
    // <Drawer
    //   size="large"
    //   visible={visible}
    //   title={title}
    //   actions={[{
    //     text: '确定',
    //     type: 'ok',
    //     onClick: () => { onOkClick(); }
    //   }, {
    //     text: '取消',
    //     type: 'cancel',
    //     onClick: () => { onCancel(); }
    //   }]} onVisibleChange={onClose} >
    //   <div className="modalBottomDownYear">
    //     <div className='modalBottomDownYear-head'>
    //       <CloseBoldOutlined />
    //       <div className='modalBottomDownYear-head-text'>确定</div>
    //     </div>
    //     <div className='modalBottomDownYear-main'>
    //       {
    //         years.map((item, idx) => (
    //           <div className='modalBottomDownYear-main-title' key={idx}>{item.label}</div>
    //         ))
    //       }
    //       <div className='modalBottomDownYear-main-focus'></div>
    //     </div>
    //     <div className='modalBottomDownYear-bottom'></div>
    //   </div>
    // </Drawer>
    <Picker
      data={years}
      cols={1}
      visible={true}
      title="季度"
      okText="确定"
      value={2022}
      onChange={(e) => { console.log(e); }}
      extra="请选择(可选)"
    >
      <List.Item arrow="horizontal">标题文字</List.Item>
    </Picker>
  );
};
 
export default ModalBottomDownYear;