page.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. import React from 'react';
  2. import './index.less';
  3. import Page from '@src/containers/Page';
  4. import Assets from '@src/components/Assets';
  5. import { asyncSMessage } from '@src/services/AsyncTools';
  6. import { formatDate, getMap } from '@src/services/Tools';
  7. import UserLayout from '../../../layouts/User';
  8. import UserAction from '../../../components/UserAction';
  9. import menu from '../index';
  10. import Tabs from '../../../components/Tabs';
  11. import More from '../../../components/More';
  12. import Button from '../../../components/Button';
  13. import Switch from '../../../components/Switch';
  14. import TotalSort from '../../../components/TotalSort';
  15. import { RealAuth, TextbookFeedbackModal, FinishModal, CommentModal, FeedbackErrorDataModal } from '../../../components/OtherModal';
  16. import Examination from '../../../components/Examination';
  17. import VipRenew from '../../../components/VipRenew';
  18. import Modal from '../../../components/Modal';
  19. import UserTable from '../../../components/UserTable';
  20. import UserPagination from '../../../components/UserPagination';
  21. import { My } from '../../../stores/my';
  22. import { User } from '../../../stores/user';
  23. import { Order } from '../../../stores/order';
  24. import { Textbook } from '../../../stores/textbook';
  25. import { DataType, ServiceKey, RecordSource, TextbookFeedbackTarget } from '../../../../Constant';
  26. import { Main } from '../../../stores/main';
  27. import { Question } from '../../../stores/question';
  28. const ServiceKeyMap = getMap(ServiceKey, 'value', 'label');
  29. const RecordSourceMap = getMap(RecordSource, 'value', 'label');
  30. const dataHistoryColumns = [
  31. { title: '更新时间', key: 'time', width: 120 },
  32. { title: '位置', key: 'position', width: 120 },
  33. { title: '原内容', key: 'originContent', width: 120 },
  34. { title: '更改为', key: 'content', width: 120 },
  35. { title: '更新至', key: 'version', width: 90 },
  36. ];
  37. const textbookHistoryColumns = [
  38. {
  39. title: '更新时间',
  40. key: 'createTime',
  41. width: 120,
  42. render: (text) => {
  43. return <div className="sub">
  44. <div className="t-2 t-s-12">{text.split(' ')[0]}</div>
  45. <div className="t-6 t-s-12">{text.split(' ')[1]}</div>
  46. </div>;
  47. },
  48. },
  49. { title: '版本', key: 'version', width: 120 },
  50. { title: '更新内容', key: 'content', width: 330 },
  51. ];
  52. const openColumns = [
  53. { title: '商品名称', key: 'title', width: 240 },
  54. { title: '获取方式', key: 'source', width: 240 },
  55. { title: '开通期限', key: 'endTime', width: 240 },
  56. { title: '操作', key: 'handler', width: 90 },
  57. ];
  58. export default class extends Page {
  59. constructor(props) {
  60. props.size = 10;
  61. super(props);
  62. }
  63. initState() {
  64. return {
  65. tab: 'data',
  66. sortMap: {},
  67. filterMap: {},
  68. feedbackError: { position: ['', '', ''] },
  69. };
  70. }
  71. initData() {
  72. const data = Object.assign(this.state, this.state.search);
  73. if (data.order) {
  74. data.sortMap = { [data.order]: data.direction };
  75. }
  76. data.filterMap = this.state.search;
  77. this.setState(data);
  78. const { tab } = this.state;
  79. switch (tab) {
  80. case 'textbook':
  81. this.refreshTextbook();
  82. break;
  83. case 'examination':
  84. this.refreshExamination();
  85. break;
  86. case 'vip':
  87. this.refreshVip();
  88. break;
  89. case 'cal':
  90. break;
  91. case 'data':
  92. default:
  93. this.refreshData();
  94. break;
  95. }
  96. }
  97. refreshTextbook() {
  98. Main.getService('textbook').then(result => {
  99. this.setState({ service: result });
  100. });
  101. Textbook.getInfo().then(result => {
  102. const { latest } = result;
  103. result.day = parseInt((new Date().getTime() - new Date(result.latest.startDate).getTime()) / 86400000, 10);
  104. result.expireDay =
  105. result.expireTime && parseInt((new Date(result.expireTime).getTime() - new Date().getTime()) / 86400000, 10);
  106. const list = [];
  107. list.push({ subject: 'quant', number: latest.quantNumber, time: latest.quantTime, version: latest.quantVersion });
  108. list.push({ subject: 'rc', number: latest.rcNumber, time: latest.rcTime, version: latest.rcVersion });
  109. list.push({ subject: 'ir', number: latest.irNumber, time: latest.irTime, version: latest.irVersion });
  110. this.setState({ data: result, list });
  111. });
  112. }
  113. textbookHistory({ page, size, subject }) {
  114. Textbook.allHistory(subject).then(result => {
  115. this.setState({
  116. showUpdate: true,
  117. updateList: result.map(row => {
  118. row.version = row[`${subject}Version`];
  119. row.content = row[`${subject}Content`];
  120. row.createTime = formatDate(row.createTime, 'YYYY-MM-DD HH:mm:ss');
  121. return row;
  122. }),
  123. // 不显示分页
  124. updateTotal: 0,
  125. maxHeight: 730,
  126. updatePage: page,
  127. updateData: { page, size, subject, columns: textbookHistoryColumns, type: 'textbook' },
  128. });
  129. });
  130. }
  131. refreshExamination() {
  132. Main.getService('qx_cat').then(result => {
  133. this.setState({ service: result });
  134. });
  135. Question.getExaminationInfo(result => {
  136. result.expireDay =
  137. result.expireTime && parseInt((new Date().getTime() - new Date(result.expireTime).getTime()) / 86400000, 10);
  138. this.setState({ data: result });
  139. });
  140. }
  141. refreshVip() {
  142. Main.getService('vip').then(result => {
  143. this.setState({ service: result });
  144. });
  145. My.getVipInfo().then(result => {
  146. this.setState({ data: result });
  147. });
  148. }
  149. recordList({ page, size, service, isUse, isExpire }) {
  150. Order.listRecord({ page, size, productType: 'service', service, isUse, isExpire }).then(result => {
  151. this.setState({
  152. showUpdate: true,
  153. updateList: result.list.map(row => {
  154. row.title = ServiceKeyMap[service];
  155. row.source = RecordSourceMap[row.source];
  156. row.handler = (
  157. <a
  158. onClick={() => {
  159. this.open(row.id);
  160. }}
  161. >
  162. 立即开通
  163. </a>
  164. );
  165. row.endTime = `${formatDate(row.endTime, 'YYYY-MM-DD')} 前`;
  166. return row;
  167. }),
  168. updateTotal: result.list.length,
  169. updatePage: page,
  170. updateData: { page, size, service, isUse, columns: isUse ? [] : openColumns, type: 'record' },
  171. });
  172. });
  173. }
  174. refreshData() {
  175. const dataTypeSelect = DataType.map(row => {
  176. row.title = row.label;
  177. row.key = row.value;
  178. return row;
  179. });
  180. dataTypeSelect.unshift({
  181. title: '全部',
  182. key: '',
  183. });
  184. this.setState({ dataTypeSelect });
  185. Main.dataStruct().then(result => {
  186. const structs = result
  187. .filter(row => row.level === 1)
  188. .map(row => {
  189. row.title = `${row.titleZh}${row.titleEn}`;
  190. row.key = `${row.id}`;
  191. return row;
  192. });
  193. structs.unshift({
  194. title: '全部',
  195. key: '',
  196. });
  197. this.setState({
  198. structs,
  199. });
  200. });
  201. My.listData(Object.assign({}, this.state.search)).then(result => {
  202. // result = {
  203. // list: [
  204. // {
  205. // title: '123123',
  206. // latestTime: '',
  207. // id: 1,
  208. // number: 10,
  209. // version: '1231',
  210. // },
  211. // ],
  212. // };
  213. this.setState({
  214. list: result.list.map(row => {
  215. row.time = formatDate(row.time, 'YYYY-MM-DD HH:mm:ss');
  216. return row;
  217. }),
  218. total: result.total,
  219. page: this.state.search.page,
  220. });
  221. });
  222. }
  223. dataHistory({ dataId, page, size }) {
  224. My.listDataHistory({ page, size: 10000, dataId }).then(result => {
  225. result.list = result.list.map(row => {
  226. row.time = formatDate(row.time, 'YYYY-MM-DD\nHH:mm:ss');
  227. return row;
  228. });
  229. this.setState({
  230. showUpdate: true,
  231. // 不显示分页
  232. updateTotal: 0,
  233. maxHeight: 730,
  234. updateList: result.list,
  235. updatePage: page,
  236. updateData: { page, size, dataId, columns: dataHistoryColumns, type: 'data' },
  237. });
  238. });
  239. }
  240. onFilter(value) {
  241. this.search(value);
  242. }
  243. onSort(value) {
  244. const { sortMap } = this.state;
  245. const keys = Object.keys(value);
  246. const index = keys.length > 1 && sortMap[keys[0]] ? 1 : 0;
  247. this.search({ order: keys.length ? keys[index] : null, direction: keys.length ? value[keys[index]] : null });
  248. }
  249. onTabChange(tab) {
  250. const data = { tab };
  251. this.refreshQuery(data);
  252. }
  253. subscribe(value) {
  254. My.subscribeData(value)
  255. .then(() => {
  256. const { info } = this.props.user;
  257. info.dataEmailSubscribe = value;
  258. User.infoHandle(info);
  259. })
  260. .catch(err => {
  261. asyncSMessage(err.message, 'warn');
  262. });
  263. }
  264. open(recordId) {
  265. Order.useRecord(recordId).then(() => {
  266. this.refresh();
  267. });
  268. }
  269. buyTextbook() {
  270. User.needLogin()
  271. .then(() => {
  272. return Order.speedPay({ productType: 'service', service: 'textbook' });
  273. })
  274. .then((order) => {
  275. return User.needPay(order);
  276. })
  277. .then(() => {
  278. this.refresh();
  279. });
  280. }
  281. buyQxCat() {
  282. User.needLogin()
  283. .then(() => {
  284. return Order.speedPay({ productType: 'service', service: 'qx_cat' });
  285. })
  286. .then((order) => {
  287. return User.needPay(order);
  288. })
  289. .then(() => {
  290. this.refresh();
  291. });
  292. }
  293. renderView() {
  294. const { config } = this.props;
  295. return <UserLayout active={config.key} menu={menu} center={this.renderDetail()} />;
  296. }
  297. renderDetail() {
  298. const {
  299. tab,
  300. comment = {},
  301. feedback = {},
  302. feedbackError = {},
  303. showComment,
  304. showFinish,
  305. showUpdate,
  306. showFeedback,
  307. showFeedbackError,
  308. updateList,
  309. updateTotal,
  310. maxHeight,
  311. updateData = {},
  312. showExamination,
  313. showReal,
  314. showVip,
  315. } = this.state;
  316. const { info } = this.props.user;
  317. return (
  318. <div className="table-layout">
  319. <Tabs
  320. border
  321. type="division"
  322. theme="theme"
  323. size="small"
  324. space={2.5}
  325. width={100}
  326. active={tab}
  327. tabs={[
  328. { key: 'data', title: '资料' },
  329. { key: 'textbook', title: '机经' },
  330. { key: 'examination', title: '模考' },
  331. { key: 'vip', title: 'VIP' },
  332. { key: 'cal', title: '考分计算器' },
  333. ]}
  334. onChange={key => this.onTabChange(key)}
  335. />
  336. {this[`renderTab${tab}`]()}
  337. <Modal
  338. show={showUpdate}
  339. maskClosable
  340. close={false}
  341. body={false}
  342. width={630}
  343. onClose={() => this.setState({ showUpdate: false, updateList: [] })}
  344. >
  345. <UserTable
  346. size="small"
  347. theme="top"
  348. columns={updateData.columns}
  349. data={updateList}
  350. current={updateData.page}
  351. pageSize={updateData.size}
  352. onChange={page => {
  353. updateData.page = page;
  354. if (updateData.type === 'data') {
  355. this.dataHistory(updateData);
  356. } else if (updateData.type === 'textbook') {
  357. this.textbookHistory(updateData);
  358. } else if (updateData.type === 'record') {
  359. this.recordList(updateData);
  360. }
  361. }}
  362. total={updateTotal}
  363. maxHeight={maxHeight}
  364. />
  365. </Modal>
  366. <CommentModal
  367. show={showComment}
  368. defaultData={comment}
  369. onConfirm={() => this.setState({ showComment: false, showFinish: true })}
  370. onCancel={() => this.setState({ showComment: false })}
  371. onClose={() => this.setState({ showComment: false })}
  372. />
  373. <FeedbackErrorDataModal
  374. show={showFeedbackError}
  375. defaultData={feedbackError}
  376. onConfirm={() => this.setState({ showFeedbackError: false, showFinish: true })}
  377. onCancel={() => this.setState({ showFeedbackError: false })}
  378. onClose={() => this.setState({ showFeedbackError: false })}
  379. />
  380. <TextbookFeedbackModal
  381. show={showFeedback}
  382. defaultData={feedback}
  383. onConfirm={() => this.setState({ showFeedback: false, showFinish: true })}
  384. onCancel={() => this.setState({ showFeedback: false })}
  385. onClose={() => this.setState({ showFeedback: false })}
  386. />
  387. <FinishModal
  388. show={showFinish}
  389. onConfirm={() => this.setState({ showFinish: false })}
  390. />
  391. <Examination
  392. show={showExamination}
  393. data={info}
  394. onConfirm={() => this.setState({ showExamination: false })}
  395. onCancel={() => this.setState({ showExamination: false })}
  396. onClose={() => this.setState({ showExamination: false })}
  397. />
  398. <RealAuth show={showReal} data={info} onConfirm={() => this.setState({ showReal: false })} />
  399. <VipRenew
  400. show={showVip}
  401. data={info}
  402. onReal={() => this.setState({ showVip: false, showReal: true })}
  403. onPrepare={() => this.setState({ showVip: false, showExamination: true })}
  404. onClose={() => this.setState({ showVip: false })}
  405. />
  406. </div>
  407. );
  408. }
  409. renderTabdata() {
  410. const { list = [], filterMap = {}, sortMap = {}, structs, dataTypeSelect, total, page } = this.state;
  411. const { info } = this.props.user;
  412. return (
  413. <div className="tab-1-layout">
  414. <UserAction
  415. selectList={[
  416. {
  417. label: '学科',
  418. key: 'structId',
  419. select: structs,
  420. },
  421. {
  422. label: '资料形式',
  423. key: 'dataType',
  424. select: dataTypeSelect,
  425. },
  426. ]}
  427. sortList={[
  428. { right: true, label: '销量', key: 'sale_number' },
  429. { right: true, label: '更新时间', key: 'latest_time' },
  430. ]}
  431. sortMap={sortMap}
  432. filterMap={filterMap}
  433. onFilter={value => this.onFilter(value)}
  434. onSort={value => this.onSort(value)}
  435. right={
  436. <div className="email">
  437. 邮箱订阅{' '}
  438. <Switch
  439. checked={info.dataEmailSubscribe}
  440. onChange={() => {
  441. this.subscribe(!info.dataEmailSubscribe);
  442. }}
  443. />
  444. </div>
  445. }
  446. />
  447. <div className="data-layout">
  448. {list.map(item => {
  449. return (
  450. <div className="data-item">
  451. <Assets name="sun_blue" src={item.cover} />
  452. <div className="fixed">
  453. <div className="btns">
  454. <Button
  455. size="small"
  456. radius
  457. onClick={() => {
  458. openLink(item.resource);
  459. }}
  460. >
  461. 阅读
  462. </Button>
  463. <div
  464. className="white"
  465. onClick={() => {
  466. openLink(item.resource);
  467. }}
  468. >
  469. 下载
  470. </div>
  471. </div>
  472. </div>
  473. <div className="title">
  474. <span>版本{item.version}</span>
  475. {item.title}
  476. </div>
  477. <div className="date">{formatDate(item.latestTime, 'YYYY-MM-DD HH:mm:ss')}</div>
  478. <More
  479. menu={[
  480. { label: '纠错', key: 'feedback' },
  481. { label: '评价', key: 'comment' },
  482. { label: '更新', key: 'update' },
  483. ]}
  484. onClick={value => {
  485. const { key } = value;
  486. if (key === 'comment') {
  487. this.setState({ showComment: true, comment: { channel: 'course_data', position: item.id } });
  488. } else if (key === 'update') {
  489. this.dataHistory({ dataId: item.id, page: 1, size: 10 });
  490. } else if (key === 'feedback') {
  491. this.setState({ showFeedbackError: true, feedbackError: { dataId: item.id, title: item.title, position: ['', '', ''] } });
  492. }
  493. }}
  494. />
  495. </div>
  496. );
  497. })}
  498. </div>
  499. {total > 0 && list.length > 0 && (
  500. <UserPagination total={total} current={page} pageSize={this.state.search.size} onChange={p => this.onChangePage(p)} />
  501. )}
  502. </div>
  503. );
  504. }
  505. renderTabtextbook() {
  506. const { data = {}, list = [], service } = this.state;
  507. const { latest = {}, day } = data;
  508. return (
  509. <div className="tab-2-layout">
  510. <UserAction
  511. left={
  512. <div className="total-log">
  513. <span>最新换库</span>
  514. <span>{latest.startDate ? formatDate(latest.startDate, 'YYYY-MM-DD') : ''}</span>
  515. <span>
  516. 已换库<b>{day}</b>天
  517. </span>
  518. </div>
  519. }
  520. right={
  521. !data.hasService &&
  522. data.unUseRecord && (
  523. <div className="email" >
  524. <span onClick={() => {
  525. this.recordList({ page: 1, size: 10, service: 'textbook', isUse: false, isExpire: false });
  526. }} >待开通</span>
  527. </div>
  528. )
  529. }
  530. />
  531. {data.hasService && (
  532. <div className="data-layout">
  533. {list.map(item => {
  534. return (
  535. <div className="data-item">
  536. <Assets name="sun_blue" />
  537. <div className="title">
  538. 已更新至<b>{item.num}</b>题
  539. </div>
  540. <div className="date">{item.date}</div>
  541. <More
  542. menu={[
  543. { label: '更新', key: 'update' },
  544. { label: '反馈', key: 'feedback' },
  545. { label: '评价', key: 'comment' },
  546. ]}
  547. onClick={value => {
  548. const { key } = value;
  549. if (key === 'comment') {
  550. this.setState({ showComment: true, comment: { channel: 'library' } });
  551. } else if (key === 'update') {
  552. this.textbookHistory({ page: 1, size: 100, subject: item.subject });
  553. } else if (key === 'feedback') {
  554. this.setState({ showFeedback: true, feedback: { questionSubject: item.subject, target: TextbookFeedbackTarget[0].value } });
  555. }
  556. }}
  557. />
  558. </div>
  559. );
  560. })}
  561. </div>
  562. )}
  563. {!data.hasService && !data.unUseRecord && (
  564. <div className="tip-layout">
  565. <div className="t1">还未购买本月机经</div>
  566. <div className="desc">¥ {service && service.package && service.package[0].price}</div>
  567. <Button radius size="lager" width={150} onClick={() => {
  568. this.buyTextbook();
  569. }}>
  570. 立即购买
  571. </Button>
  572. </div>
  573. )}
  574. {/* {data.hasService && (
  575. <div className="tip-layout">
  576. <div className="t1">使用中</div>
  577. <div className="t2">距离到期还有 {data.expireDay} 天</div>
  578. </div>
  579. )} */}
  580. {!data.hasService && data.unUseRecord && (
  581. <div className="tip-layout">
  582. <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
  583. <Button
  584. radius
  585. size="lager"
  586. width={150}
  587. onClick={() => {
  588. this.open(data.unUseRecord.id);
  589. }}
  590. >
  591. 立即开通
  592. </Button>
  593. </div>
  594. )}
  595. </div>
  596. );
  597. }
  598. renderTabexamination() {
  599. const { data = {}, service } = this.state;
  600. return (
  601. <div className="tab-3-layout">
  602. <UserAction
  603. right={
  604. !data.hasService &&
  605. data.unUseRecord && (
  606. <div
  607. className="email"
  608. onClick={() => {
  609. this.recordList({ page: 1, size: 10, service: 'qx_cat', isUse: false, isExpire: false });
  610. }}
  611. >
  612. 待开通
  613. </div>
  614. )
  615. }
  616. />
  617. {!data.hasService && !data.unUseRecord && !data.expireTime && (
  618. <div className="tip-layout">
  619. <div className="t1">未购买</div>
  620. <div className="desc">¥ {service && service.package && service.package[0].price}</div>
  621. <Button radius size="lager" width={150} onClick={() => {
  622. this.buyExamination();
  623. }}>
  624. 立即购买
  625. </Button>
  626. </div>
  627. )}
  628. {!data.hasService && data.unUseRecord && (
  629. <div className="tip-layout">
  630. <div className="t2">请于{formatDate(data.unUseRecord.endTime, 'YYYY-MM-DD')}前开通</div>
  631. <Button
  632. radius
  633. size="lager"
  634. width={150}
  635. onClick={() => {
  636. this.open(data.unUseRecord.id);
  637. }}
  638. >
  639. 立即开通
  640. </Button>
  641. </div>
  642. )}
  643. {data.hasService && (
  644. <div className="tip-layout">
  645. <div className="t1">使用中</div>
  646. <div className="t2">距离到期还有 {data.expireDay} 天</div>
  647. </div>
  648. )}
  649. {!data.hasService && !data.unUseRecord && data.expireTime && (
  650. <div className="tip-layout">
  651. <div className="t3">已过期</div>
  652. <div className="date">
  653. {formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}
  654. </div>
  655. <div className="desc">¥ {service && service.package && service.package[0].price}</div>
  656. <Button radius size="lager" width={150} onClick={() => {
  657. this.buyQxCat();
  658. }}>
  659. 立即购买
  660. </Button>
  661. </div>
  662. )}
  663. </div>
  664. );
  665. }
  666. renderTabvip() {
  667. const { data } = this.state;
  668. return (
  669. <div className="tab-4-layout">
  670. {!data.hasService && !data.unUseRecord && !data.expireTime && (
  671. <div className="tip-layout">
  672. <div className="t2">未购买</div>
  673. <Button radius size="lager" width={150} onClick={() => {
  674. this.setState({ showVip: true });
  675. }}>
  676. 立即购买
  677. </Button>
  678. </div>
  679. )}
  680. {data.hasService && (
  681. <div className="tip-layout">
  682. <div className="t1">使用中</div>
  683. <div className="desc">{formatDate(data.expireTime, 'YYYY-MM-DD')} 到期</div>
  684. <Button radius size="lager" width={150} onClick={() => {
  685. this.setState({ showVip: true });
  686. }}>
  687. 续费
  688. </Button>
  689. </div>
  690. )}
  691. {!data.hasService && !data.unUseRecord && data.expireTime && (
  692. <div className="tip-layout">
  693. <div className="t1">已过期</div>
  694. <div className="desc">
  695. {formatDate(data.startTime, 'YYYY-MM-DD')} ~ {formatDate(data.expireTime, 'YYYY-MM-DD')}
  696. </div>
  697. <Button radius size="lager" width={150} onClick={() => {
  698. this.setState({ showVip: true });
  699. }}>
  700. 立即购买
  701. </Button>
  702. </div>
  703. )}
  704. </div>
  705. );
  706. }
  707. renderTabcal() {
  708. const { data = {} } = this.state;
  709. return (
  710. <div className="tab-5-layout">
  711. <TotalSort
  712. value={data.value || 650}
  713. onChange={value => {
  714. data.value = value;
  715. this.setState({ data });
  716. }}
  717. />
  718. </div>
  719. );
  720. }
  721. }