-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ciaochaos/dev-redux
QRBTF 1.3
- Loading branch information
Showing
44 changed files
with
2,239 additions
and
117 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types' | ||
import '../Qrcode.css'; | ||
|
||
const FrameworkParam = ({ paramName, children, ...other }) => ( | ||
<table className="Qr-table" {...other}> | ||
<tbody> | ||
<tr> | ||
<td>{ paramName }</td> | ||
<td> | ||
{ children } | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
) | ||
|
||
export default FrameworkParam; |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types' | ||
import '../../Qrcode.css'; | ||
import FrameworkParam from "../FrameworkParam"; | ||
|
||
const ParamCorrectLevel = ({value, onChange}) => ( | ||
<FrameworkParam paramName={"容错率"}> | ||
<select | ||
className="Qr-select" | ||
value={value} | ||
onChange={onChange}> | ||
<option value={1}>7%</option> | ||
<option value={0}>15%</option> | ||
<option value={3}>25%</option> | ||
<option value={2}>30%</option> | ||
</select> | ||
</FrameworkParam> | ||
) | ||
|
||
ParamCorrectLevel.propTypes = { | ||
value: PropTypes.number.isRequired, | ||
onChange: PropTypes.func.isRequired | ||
} | ||
|
||
export default ParamCorrectLevel; |
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,60 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types' | ||
import '../../Qrcode.css'; | ||
import FrameworkParam from "../FrameworkParam"; | ||
import {getExactValue} from "../../../utils/util"; | ||
import ParamIconSrcViewer from "../../../containers/param/disposable/ParamIconSrcViewer"; | ||
|
||
const IconParams = ({ icon, onBlur, onKeyPress }) => { | ||
const { enabled, src, scale } = icon; | ||
const components = []; | ||
|
||
if (getExactValue(enabled, 0) == 1) { | ||
components.push( | ||
<FrameworkParam paramName={"图标源"}> | ||
<ParamIconSrcViewer icon={icon} onChange={onBlur}/> | ||
</FrameworkParam> | ||
); | ||
} | ||
|
||
if (getExactValue(enabled, 0) != 0) { | ||
components.push( | ||
<FrameworkParam paramName={"图标缩放"}> | ||
<input | ||
type="number" | ||
className="Qr-input small-input" | ||
defaultValue={scale} | ||
onBlur={(e) => onBlur({...icon, scale: e.target.value})} | ||
onKeyPress={(e) => onKeyPress(e, {...icon, scale: e.target.value})} | ||
/> | ||
</FrameworkParam> | ||
) | ||
} | ||
return components; | ||
} | ||
|
||
const ParamIcon = ({icon, onBlur, onKeyPress}) => ( | ||
<React.Fragment> | ||
<FrameworkParam paramName={"图标"}> | ||
<select | ||
className="Qr-select" | ||
defaultValue={icon.enabled} | ||
onChange={(e) => onBlur({...icon, enabled: e.target.value})}> | ||
<option value={0}>无</option> | ||
<option value={1}>自定义</option> | ||
<option value={2}>微信 — 小</option> | ||
<option value={3}>微信</option> | ||
<option value={4}>微信支付</option> | ||
<option value={5}>支付宝</option> | ||
</select> | ||
</FrameworkParam> | ||
<IconParams icon={icon} onBlur={onBlur} onKeyPress={onKeyPress}/> | ||
</React.Fragment> | ||
) | ||
|
||
ParamIcon.propTypes = { | ||
icon: PropTypes.object.isRequired, | ||
onChange: PropTypes.func.isRequired | ||
} | ||
|
||
export default ParamIcon; |
Oops, something went wrong.