Browse Source

feat(桌台码): 桌台码

桌台码
tags/小炒逻辑变更前
txb 2 years ago
parent
commit
003c93adbf
2 changed files with 21 additions and 24 deletions
  1. +2
    -1
      src/pages/store/storeDesktopNumber/components/CreateForm.jsx
  2. +19
    -23
      src/pages/store/storeDesktopNumber/index.jsx

+ 2
- 1
src/pages/store/storeDesktopNumber/components/CreateForm.jsx View File

@@ -38,12 +38,13 @@ const CreateForm = (props) => {
<ProForm
layout="Horizontal"
onValuesChange={(_, values) => {
}}
onFinish={async (value) => props.onFinish(value)}>
<ProFormGroup >
<ProFormDigitRange label="桌号范围" placeholder="请输入桌号范围" name="numbers" min={1} rules={[{ required: true }]}/>
<ProFormSelect label="排除桌号" mode="tags" placeholder="请输入排除的桌号" name="excludeNumber" width="md" />
<ProFormText name="code" label="桌台码前缀" placeholder="请输入桌台码前缀" rules={[{ max: 2 }]} />
<ProFormSelect label="适用店铺" mode="multiple" placeholder="请选择店铺" name="storeIds" width="md" valueEnum={props.storeInfoList}/>
</ProFormGroup>
</ProForm>


+ 19
- 23
src/pages/store/storeDesktopNumber/index.jsx View File

@@ -31,13 +31,13 @@ const storeDesktopNumber = () => {

}, [])

const showQRCode = (record, store) => {
const showQRCode = (record) => {
var config = {
title: `${store.name} ${record.number}号桌`,
title: `${record.storeName} ${record.desktopNumber}号桌`,
okText: '下载',
cancelText: '取消',
onOk() {
changeCanvasToPic(`${store.name} ${record.number}号桌`);
changeCanvasToPic(`${record.storeName} ${record.desktopNumber}号桌`);
},
content: (
// <QRCode
@@ -50,13 +50,13 @@ const storeDesktopNumber = () => {

<Card
style={{ width: 300, height: 450, backgroundImage: 'url(http://bpic.588ku.com/back_pic/05/42/90/125a6c515c035ab.jpg%21r650/fw/800)', backgroundSize: 'cover' }}
title={(<h2 style={{ fontWeight: 600 }}>{`${store.name}`}</h2>)}
title={(<h2 style={{ fontWeight: 600 }}>{`${record.storeName}`}</h2>)}
headStyle={{ border: '0px', textAlign: 'center' }}
cover={
<QRCode
id="qrCode"
// value={`https://www.black-pa.com:5500?number=${number}`}
value={`${record.host}?storeId=${store.id}&number=${record.number}`}
value={`${record.host}?storeId=${record.storeId}&number=${record.desktopNumber}`}
size={174} // 二维码的大小
fgColor="#000000" // 二维码的颜色
style={{ margin: 'auto', marginTop: '60px' }}
@@ -64,7 +64,7 @@ const storeDesktopNumber = () => {
/>
}>
<div style={{ textAlign: 'center' }}>
<h2 style={{ fontWeight: 600 }}>{`${record.number}号桌`}</h2>
<h2 style={{ fontWeight: 600 }}>{`${record.desktopNumber}号桌`}</h2>
</div>
</Card>
),
@@ -96,7 +96,7 @@ const storeDesktopNumber = () => {
},
{
title: '桌号',
dataIndex: 'number',
dataIndex: 'desktopNumber',
align: 'center',
search: false,
render: item => (
@@ -110,19 +110,16 @@ const storeDesktopNumber = () => {
{
title: '适用店铺',
align: 'center',
dataIndex: 'storeList',
search: false,
render: tags => (
<>
{tags.map(tag => {
return (
<Tag color={'green'} key={tag.id}>
{tag.name}
</Tag>
);
})}
</>
),
dataIndex: 'storeName',
// render: tags => (
// <>
// {return (
// <Tag color={'green'} key={tag.storeId}>
// {tag.storeName}
// </Tag>
// );}
// </>
// ),
}, {
title: '创建时间',
dataIndex: 'createAt',
@@ -133,9 +130,8 @@ const storeDesktopNumber = () => {
dataIndex: 'option',
valueType: 'option',
render: (_, record) => [
record.storeList.map(item => {
return (<a onClick={() => { showQRCode(record, item) }} type="link">{item.name}</a>);
}), <a onClick={() => {
<a onClick={() => { showQRCode(record) }} type="link">{record.storeName}</a>,
<a onClick={() => {
DeleteDesktopNumber([record.id]).then((r) => {
if (r.data) {
message.success('删除成功');


Loading…
Cancel
Save