-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
244 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# 配置要求:必须以TARO_APP_开头否则不可以通过process.env.TARO_APP_XX获得 | ||
|
||
# 域名 | ||
TARO_APP_DOMAIN="https://805807.cn:8080" | ||
TARO_APP_DOMAIN="https://805807.cn:8057" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# 配置要求:必须以TARO_APP_开头否则不可以通过process.env.TARO_APP_XX获得 | ||
|
||
# 域名 | ||
TARO_APP_DOMAIN="https://805807.cn:8080" | ||
TARO_APP_DOMAIN="https://805807.cn:8057" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/pages/main/Manage/components/work-manage/components/calendar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable react/no-children-prop */ | ||
import { Calendar, Cell } from '@taroify/core' | ||
import { useState } from 'react' | ||
import { timeFormat } from 'src/utils' | ||
|
||
export function CustomCalendar({ onChange }) { | ||
const [open, setOpen] = useState(false) | ||
const [value, setValue] = useState<Date>() | ||
const [formatValue, setFormatValue] = useState<string>() | ||
|
||
return ( | ||
<> | ||
<Cell required title='选择截止时间' isLink children={formatValue} onClick={() => setOpen(true)} /> | ||
<Calendar | ||
type='single' | ||
value={value} | ||
onChange={setValue} | ||
poppable | ||
showPopup={open} | ||
showConfirm={false} | ||
onClose={setOpen} | ||
onConfirm={(newValue) => { | ||
const timestamp = new Date(newValue).getTime() | ||
const timeStr = timeFormat(timestamp, 'YYYY/MM/DD hh:mm:ss') | ||
onChange(timestamp) | ||
setFormatValue(timeStr) | ||
setOpen(false) | ||
}} | ||
/> | ||
</> | ||
) | ||
} |
45 changes: 45 additions & 0 deletions
45
src/pages/main/Manage/components/work-manage/components/upload.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* eslint-disable react/no-children-prop */ | ||
import { Uploader } from '@taroify/core' | ||
import { chooseImage, getImageInfo } from '@tarojs/taro' | ||
import { useState } from 'react' | ||
|
||
export const handleFiles = (_files) => | ||
Promise.all(_files.map(({ path: src }) => getImageInfo({ src }))) | ||
|
||
export function CustomUploader({ onChange: onFileChange }) { | ||
const [files, setFiles] = useState<Uploader.File[]>([]) | ||
const onUpload = () => { | ||
chooseImage({ | ||
sizeType: ['original', 'compressed'], | ||
sourceType: ['album', 'camera'], | ||
}).then(async ({ tempFiles }) => { | ||
const preFiles = await handleFiles(files) | ||
const curFiles = await handleFiles(tempFiles) | ||
const _httpFiles = [...preFiles, ...curFiles] | ||
const _files = [ | ||
...files, | ||
...tempFiles.map(({ path, type, originalFileObj }) => ({ | ||
type, | ||
url: path, | ||
name: originalFileObj?.name, | ||
})), | ||
] | ||
setFiles(_files) | ||
onFileChange(_httpFiles) | ||
}) | ||
} | ||
|
||
return ( | ||
<Uploader | ||
value={files} | ||
multiple | ||
onUpload={onUpload} | ||
onChange={(_files) => { | ||
handleFiles(_files).then((newFiles) => { | ||
setFiles(_files as any) | ||
onFileChange(newFiles) | ||
}) | ||
}} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.