Commit 7528c134f6e7e71371365c057d48108f2bec3911

Authored by 杜志良
1 parent d6c39a10

feat(cas): 售后公共组件迁移,急救待办页面完善

src/components/CardView/index.tsx 0 → 100644
  1 +import type React from 'react';
  2 +import './style.less';
  3 +
  4 +interface Props {
  5 + style?: React.CSSProperties;
  6 + children: React.ReactNode;
  7 +}
  8 +
  9 +export default function CardView({ style, children }: Props) {
  10 + return (
  11 + <div className="card-view" style={style}>
  12 + {children}
  13 + </div>
  14 + );
  15 +}
src/components/CardView/style.less 0 → 100644
  1 +.card-view {
  2 + padding: 15px;
  3 + border-bottom: 1px solid #eee;
  4 + background-color: #fff;
  5 +}
src/components/RowText/index.tsx 0 → 100644
  1 +import React from 'react';
  2 +import type { CSSProperties } from 'react';
  3 +import { Row } from '@feewee/h5app-common';
  4 +
  5 +import './style.less';
  6 +
  7 +interface ComponentProps {
  8 + title: string;
  9 + content: string | number;
  10 + rowStyle?: CSSProperties;
  11 + titleStyle?: CSSProperties;
  12 + contentStyle?: CSSProperties;
  13 +}
  14 +
  15 +export default function RowText({ title, content, rowStyle, titleStyle, contentStyle }: ComponentProps) {
  16 + return (
  17 + <Row className="row-wrapper" style={rowStyle}>
  18 + <span className="label" style={titleStyle}>
  19 + {title}:
  20 + </span>
  21 + <span className="content" style={contentStyle}>
  22 + {content}
  23 + </span>
  24 + </Row>
  25 + );
  26 +}
src/components/RowText/style.less 0 → 100644
  1 +.row-wrapper {
  2 + margin-bottom: 10px;
  3 +}
  4 +
  5 +.label {
  6 + color: #666;
  7 + font-size: 14px;
  8 + line-height: 14px;
  9 + font-weight: 500;
  10 +}
  11 +
  12 +.content {
  13 + color: #666;
  14 + font-size: 14px;
  15 + line-height: 14px;
  16 + font-weight: 500;
  17 + flex: 1;
  18 +}
  19 +
  20 +.labelBold {
  21 + color: #333;
  22 + font-size: 15px;
  23 + font-weight: bold;
  24 +}
  25 +
  26 +.contentBold {
  27 + .labelBold;
  28 + flex: 1;
  29 +}
src/routes/rescue/handle/page.tsx
1 -import { helper, ListRow, Radio, IconFont, Space, PageProvider, Form, Input, TextArea, Uploader } from '@feewee/h5app-common';  
2 -import { useSafeState } from 'ahooks';  
3 import { useEffect } from 'react'; 1 import { useEffect } from 'react';
  2 +import { useSafeState } from 'ahooks';
  3 +import { helper, ListRow, Radio, IconFont, Space, PageProvider, Form, Input, TextArea, Uploader } from '@feewee/h5app-common';
4 import { useNavigate } from '@modern-js/runtime/router'; 4 import { useNavigate } from '@modern-js/runtime/router';
5 5
  6 +import CardView from '@/components/CardView';
  7 +import RowText from '@/components/RowText';
  8 +
6 const RadioGroup = Radio.Group; 9 const RadioGroup = Radio.Group;
7 10
8 const Index = () => { 11 const Index = () => {
@@ -11,26 +14,38 @@ const Index = () =&gt; { @@ -11,26 +14,38 @@ const Index = () =&gt; {
11 14
12 return ( 15 return (
13 <PageProvider tittle="急救处理" loading={false} onBackClick={() => helper.checkBack(() => navigate(-1))}> 16 <PageProvider tittle="急救处理" loading={false} onBackClick={() => helper.checkBack(() => navigate(-1))}>
14 - <ListRow title="车牌号" extra="aa" />  
15 - <ListRow title="车主" extra="aa" />  
16 - <ListRow title="车辆" extra="aa" />  
17 - <ListRow title="急救发起时间" extra="aa" />  
18 - <ListRow title="救援位置" extra="aa" /> 17 + <div className="bg-color">
  18 + <CardView style={{ marginBottom: 10 }}>
  19 + <RowText title="车牌号" content="aa" titleStyle={{ fontSize: 15, color: '#333' }} contentStyle={{ fontSize: 15, color: '#333' }} />
  20 + <RowText title="车主" content="aa" />
  21 + <RowText title="车辆" content="aa" />
  22 + <RowText title="急救发起时间" content="aa" />
  23 + <RowText title="救援位置" content="aa" rowStyle={{ marginBottom: 0 }} />
  24 + </CardView>
  25 +
  26 + <div className="p-[15px] mb-[10px] border-b-[#eee] bg-white">
  27 + <RowText title="车牌号" content="aa" titleStyle={{ fontSize: 15, color: '#333' }} contentStyle={{ fontSize: 15, color: '#333' }} />
  28 + <RowText title="车主" content="aa" />
  29 + <RowText title="车辆" content="aa" />
  30 + <RowText title="急救发起时间" content="aa" />
  31 + <RowText title="救援位置" content="aa" rowStyle={{ marginBottom: 0 }} />
  32 + </div>
19 33
20 - <Form form={form} labelPosition="left" initialValues={{ type: 1 }}>  
21 - <Form.Item name="type" label="救援方式">  
22 - <RadioGroup>  
23 - <Radio value={1}>拖车</Radio>  
24 - <Radio value={2}>现场维修</Radio>  
25 - </RadioGroup>  
26 - </Form.Item>  
27 - <Form.Item name="remark" label="备注" labelPosition="top">  
28 - <TextArea placeholder="请输入备注" maxLength={256} showCount autoSize />  
29 - </Form.Item>  
30 - <Form.Item name="attachments" label="附件" labelPosition="top">  
31 - <Uploader showTitle={false} url="/api2/file/upload" style={{ padding: 0 }} />  
32 - </Form.Item>  
33 - </Form> 34 + <Form form={form} labelPosition="left" initialValues={{ type: 1 }}>
  35 + <Form.Item name="type" label="救援方式">
  36 + <RadioGroup>
  37 + <Radio value={1}>拖车</Radio>
  38 + <Radio value={2}>现场维修</Radio>
  39 + </RadioGroup>
  40 + </Form.Item>
  41 + <Form.Item name="remark" label="备注" labelPosition="top">
  42 + <TextArea placeholder="请输入备注" maxLength={256} showCount autoSize />
  43 + </Form.Item>
  44 + <Form.Item name="attachments" label="附件" labelPosition="top">
  45 + <Uploader showTitle={false} url="/api2/file/upload" style={{ padding: 0 }} />
  46 + </Form.Item>
  47 + </Form>
  48 + </div>
34 </PageProvider> 49 </PageProvider>
35 ); 50 );
36 }; 51 };
src/style/global.scss
@@ -51,3 +51,7 @@ body { @@ -51,3 +51,7 @@ body {
51 height: 100%; 51 height: 100%;
52 } 52 }
53 } 53 }
  54 +
  55 +.bg-color {
  56 + background-color: #f4f6fa;
  57 +}