Browse Source

fix bug proof number field

master
Anna Ho 1 year ago
parent
commit
3f72a7aae5
3 changed files with 22 additions and 16 deletions
  1. +12
    -0
      src/assets/style/styles.css
  2. +1
    -1
      src/auth/utils.js
  3. +9
    -15
      src/pages/Proof/Create_FromApp/ProofForm.js

+ 12
- 0
src/assets/style/styles.css View File

@@ -11,6 +11,18 @@ body,
font-family: "Noto Sans HK", "Noto Sans SC";
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}

/* body{
padding-top: 53px;
font-family: 微軟正黑體;


+ 1
- 1
src/auth/utils.js View File

@@ -11,7 +11,7 @@ const hostPort = '8090';
export const hostPath = `http://${hostname}:${hostPort}`;
//export const apiPath = `http://192.168.0.112:8090/api`;
export const apiPath = `${hostPath}/api`;
// export const apiPath = `/api`;
//export const apiPath = `/api`;
export const paymentPath = `http://pnspsdev.gld.gov.hk/payment`;
export const iAmSmartPath = `https://<iAM_Smart_domain>`;



+ 9
- 15
src/pages/Proof/Create_FromApp/ProofForm.js View File

@@ -236,14 +236,12 @@ const FormPanel = ({ formData }) => {
<TextField
fullWidth
size="small"
type="text"
type="number"
value={formik.values["noOfPages"]}
onChange={(event) => {
const re = /^[0-9\b]+$/;
if (event.target.value === '' || re.test(event.target.value)) {
const value = event.target.value;
formik.setFieldValue("length", value);
formik.setFieldValue("fee", 6552 * value);
}
const value = parseInt(event.target.value);
formik.setFieldValue("noOfPages", value);
formik.setFieldValue("fee", 6552 * value);
}}
variant="outlined"
sx={
@@ -273,15 +271,11 @@ const FormPanel = ({ formData }) => {
<TextField
fullWidth
size="small"
type="text"
type="number"
onChange={(event) => {
const re = /^[0-9\b]+$/;
if (event.target.value === '' || re.test(event.target.value)) {
const value = event.target.value;
formik.setFieldValue("length", value);
formik.setFieldValue("fee", columnPrice.value * value);
}
let value = parseInt(event.target.value);
formik.setFieldValue("length", value);
formik.setFieldValue("fee", columnPrice.value * value);
}}
name="length"
value={formik.values["length"]}


Loading…
Cancel
Save