12 Commits
51 changed files with 870 additions and 370 deletions
+16 -5
View File
@@ -44,9 +44,12 @@ data:
{
"isInDuty": true,
"inDutyCnt": 3,
"currentDuty": "2",
"place": "东三-204",
"otherDutyTime": ""
"currentDuty": "1",
"place": "", // 只有当 currentDuty 为 others 时,place 和 值班时间 才不为空
"otherDutyStart": "",
"otherDutyEnd": "",
"offDutyReason": "",
"dutyRecoverTime": ""
}
```
@@ -59,8 +62,11 @@ data:
"isInDuty": true,
"inDutyCnt": 3,
"currentDuty": "others",
"place": "蓝田",
"otherDutyTime": "9:30-11:30"
"place": "蓝田", // 只有当 currentDuty 为 others 时,place 才不为空
"otherDutyStart": "2024-03-07T11:52:48.523303", // Timestamp
"otherDutyEnd": "2024-03-07T13:52:48.523303",
"offDutyReason": "",
"dutyRecoverTime": ""
}
```
@@ -71,6 +77,11 @@ data:
```json
{
"isInDuty": false,
"inDutyCnt": 0,
"currentDuty": "0", // '0' 代表正常值班时间下班,'others' 代表其他值班时间下班
"place": "",
"otherDutyStart": "",
"otherDutyEnd": "",
"offDutyReason": "学园维修",
"dutyRecoverTime": "下周一"
}
+4 -4
View File
@@ -14,18 +14,19 @@ export default {
'GET /duty/info': {
success: true,
data: {
token: 'token_test',
isInDuty: true,
inDutyCnt: 3,
currentDuty: 'others',
otherDutyTime: '9:30-11:30',
otherDutyStart: '2024-03-07T09:30:48.523303',
otherDutyEnd: '2024-03-07T13:30:48.523303',
place: '蓝田',
offDutyReason: '',
dutyRecoverTime: '',
},
},
'GET /user/info': {
success: true,
data: {
token: 'token_test',
name: '马保国',
phone: 13333333333,
},
@@ -116,7 +117,6 @@ export default {
'GET /member/duty/info': {
success: true,
data: {
token: 'token_test',
isInDuty: true,
inDutyCnt: 6,
currentDuty: '3',
+12 -1
View File
@@ -3,13 +3,24 @@
{
"id": 6830,
"type": 1,
"status": 2,
"status": 3,
"device": "主机",
"deviceModel": "技嘉",
"owner": "武技栏",
"phone": "18888888888",
"createdTime": "2024-03-06T19:49:27.043865",
"isConfirmed": false
},
{
"id": 6831,
"type": 1,
"status": 2,
"device": "ROG",
"deviceModel": "幻 14",
"owner": "晓洋",
"phone": "18888888887",
"createdTime": "2024-03-06T19:49:27.043865",
"isConfirmed": false
}
]
}
+1 -1
View File
@@ -8,7 +8,7 @@
"description": "清灰",
"workers": ["宇航员"],
"createdTime": "2024-03-07T19:52:48.523303",
"status": 5,
"status": 4,
"isConfirmed": false,
"notes": [
{
+1
View File
@@ -10,6 +10,7 @@ export default defineAppConfig({
'pages/user/member/member',
'pages/TicketDetail/TicketDetail',
'pages/TicketList/TicketList',
'pages/404/404',
],
window: {
backgroundTextStyle: 'light',
+1 -17
View File
@@ -2,29 +2,13 @@ import { PropsWithChildren } from 'react';
import { useLaunch } from '@tarojs/taro';
import 'taro-ui/dist/style/index.scss';
import './app.scss';
import { checkLogin, checkToken } from './service/checkLogin';
import wechatUser from './wechat';
import { loginAte } from './service/login';
import { getInfo } from './service/getInfo';
import { pingAte } from './service/pingAte';
function App({ children }: PropsWithChildren<any>) {
useLaunch(() => {
console.log('App launched.');
pingAte((res) => {
if (res) {
checkLogin((success) => {
if (success) {
wechatUser.setToken(checkToken());
getInfo();
} else {
loginAte();
}
});
}
});
pingAte();
});
// children 是将要会渲染的页面
return children;
}

Before

Width:  |  Height:  |  Size: 746 B

After

Width:  |  Height:  |  Size: 746 B

-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1710604932901" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4288" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M512 121.6c217.6 0 390.4 172.8 390.4 390.4S729.6 902.4 512 902.4 121.6 729.6 121.6 512 294.4 121.6 512 121.6m0-89.6C246.4 32 32 249.6 32 512s217.6 480 480 480 480-217.6 480-480S774.4 32 512 32z" p-id="4289"></path><path d="M675.2 512H508.8V284.8c0-25.6-19.2-41.6-41.6-41.6H464c-25.6 0-41.6 19.2-41.6 41.6v272c0 25.6 19.2 41.6 41.6 41.6h214.4c25.6 0 44.8-22.4 44.8-44.8s-22.4-41.6-48-41.6z" p-id="4290"></path></svg>

Before

Width:  |  Height:  |  Size: 746 B

-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709907392895" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9700" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 32C246.4 32 32 246.4 32 512s214.4 480 480 480 480-214.4 480-480S777.6 32 512 32z m160 566.4c19.2 19.2 19.2 51.2 0 73.6-19.2 19.2-51.2 19.2-73.6 0L512 585.6 425.6 672c-19.2 19.2-51.2 19.2-73.6 0-19.2-19.2-19.2-51.2 0-73.6l86.4-86.4-86.4-86.4c-19.2-19.2-19.2-51.2 0-73.6 19.2-19.2 51.2-19.2 73.6 0l86.4 86.4 86.4-86.4c19.2-19.2 51.2-19.2 73.6 0 19.2 19.2 19.2 51.2 0 73.6L585.6 512l86.4 86.4z" p-id="9701" fill="#d4237a"></path></svg>

Before

Width:  |  Height:  |  Size: 768 B

-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709907148592" class="icon" viewBox="0 0 1410 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4262" width="66.09375" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M385.420696 906.172765L1004.039509 20.583293a47.214703 47.214703 0 0 1 44.414648-20.276253c18.634842 1.448304 31.766129 10.524341 39.297309 27.035004a49.049221 49.049221 0 0 1-3.76559 49.145774L435.242346 1001.278045a49.531989 49.531989 0 0 1-31.669576 20.276253 44.800863 44.800863 0 0 1-36.207594-8.207055L18.806738 752.362906a48.469899 48.469899 0 0 1-18.05552-31.669576 47.311256 47.311256 0 0 1 9.076037-36.207594 44.028434 44.028434 0 0 1 31.669575-18.924502 49.918203 49.918203 0 0 1 36.207594 9.848465l307.716272 230.763066z m686.495982-461.622685a47.021595 47.021595 0 0 1-34.75929-13.517502 47.021595 47.021595 0 0 1-13.517502-34.75929c0-14.096823 4.441465-25.683253 13.517502-34.75929a47.021595 47.021595 0 0 1 34.75929-13.517502h289.660752c14.096823 0 25.5867 4.441465 34.75929 13.517502 8.979483 9.076037 13.517502 20.662467 13.517502 34.75929a47.021595 47.021595 0 0 1-13.517502 34.75929 47.021595 47.021595 0 0 1-34.75929 13.517502h-289.660752z m-193.107168 289.660752a47.021595 47.021595 0 0 1-34.75929-13.517502 47.021595 47.021595 0 0 1-13.517502-34.75929c0-14.096823 4.441465-25.683253 13.517502-34.75929a47.021595 47.021595 0 0 1 34.75929-13.517502h482.76792c14.096823 0 25.5867 4.441465 34.75929 13.517502 8.979483 9.076037 13.517502 20.662467 13.517502 34.75929a47.021595 47.021595 0 0 1-13.517502 34.75929 47.021595 47.021595 0 0 1-34.75929 13.517502h-482.76792z m-193.107168 289.660752a47.021595 47.021595 0 0 1-34.75929-13.517502 47.021595 47.021595 0 0 1-13.517502-34.75929c0-14.096823 4.441465-25.683253 13.517502-34.75929a47.021595 47.021595 0 0 1 34.75929-13.517502h675.875088c14.096823 0 25.5867 4.441465 34.75929 13.517502 8.979483 9.076037 13.517502 20.662467 13.517502 34.75929a47.021595 47.021595 0 0 1-13.517502 34.75929 47.021595 47.021595 0 0 1-34.75929 13.517502h-675.875088z" p-id="4263" fill="#8a8a8a"></path></svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709907302076" class="icon" viewBox="0 0 1026 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7483" width="48.09375" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M123.252 739.482L406.85 455.885l-60.34-60.34-287.64 287.64c-30.893 30.894-31.708 80.946-0.814 111.84l177.279 177.278c30.863 30.864 80.945 30.08 111.84-0.814l287.609-287.61-60.34-60.34-283.597 283.597-167.654-167.654z" p-id="7484" fill="#8a8a8a"></path><path d="M717.75 223.245l65.107-65.348 122.58 121.374-62.331 62.572-109.064 44.56a81.444 81.444 0 0 0-27.274 18.404L562.013 553.183l61.064 59.616 144.122-147.742 109.034-44.531a80.337 80.337 0 0 0 26.67-17.8l123.364-123.848-243.863-241.45L656.686 163.69c-7.452 7.452-13.365 16.382-17.408 26.097l-44.56 107.616-136.972 137.574 60.46 60.22 137.605-138.209c7.482-7.482 13.366-16.382 17.438-26.127l44.47-107.646z" p-id="7485" fill="#8a8a8a"></path><path d="M351.156 295.623L746.713 691.18q30.17 30.17 0 60.34t-60.34 0L290.816 355.962q-30.17-30.17 0-60.34t60.34 0zM222.24 728.35a42.667 42.667 0 0 1 60.31 1.055l24.739 25.584a42.667 42.667 0 0 1-61.366 59.254l-24.74-25.644a42.624 42.624 0 0 1 1.027-60.28z" p-id="7486" fill="#8a8a8a"></path></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

-1
View File
@@ -1 +0,0 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709907338992" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8608" width="48" height="48" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M832 0H192C85.952 0 0 86.016 0 192v640a192 192 0 0 0 192 192h640a192 192 0 0 0 192-192V192c0-105.984-85.952-192-192-192z m64 832c0 35.392-28.608 64-64 64H192a64 64 0 0 1-64-64V192c0-35.328 28.672-64 64-64h640a64 64 0 0 1 64 64v640zM669.376 330.88L443.136 557.12l-90.56-90.496c-24.96-25.024-65.472-25.024-90.496 0s-25.024 65.536 0 90.496l135.808 135.744a63.936 63.936 0 0 0 90.496 0l271.488-271.488c25.024-25.024 25.024-65.472 0-90.496s-65.472-25.024-90.496 0z" p-id="8609" fill="#12c53d"></path></svg>

Before

Width:  |  Height:  |  Size: 832 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711724022815" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7442" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 85.333333c235.648 0 426.666667 191.061333 426.666667 426.666667s-191.018667 426.666667-426.666667 426.666667S85.333333 747.605333 85.333333 512 276.352 85.333333 512 85.333333z m0 71.125334c-196.053333 0-355.541333 159.488-355.541333 355.541333 0 196.053333 159.488 355.541333 355.541333 355.541333 196.053333 0 355.541333-159.488 355.541333-355.541333 0-196.053333-159.488-355.541333-355.541333-355.541333zM480 256a32 32 0 0 1 31.701333 27.648L512 288V512h138.666667a32 32 0 0 1 4.352 63.701333l-4.352 0.298667h-170.666667a32 32 0 0 1-31.701333-27.648l-0.298667-4.352v-256a32 32 0 0 1 32-32z" fill="#bfbfbf" p-id="7443"></path></svg>

After

Width:  |  Height:  |  Size: 972 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711724082044" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8459" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M572.341333 512l268.490667-268.501333a42.666667 42.666667 0 0 0-59.274667-61.376c-0.362667 0.341333-0.704 0.693333-1.056 1.045333L512 451.658667 243.509333 183.168a42.666667 42.666667 0 0 0-60.341333 60.330667L451.669333 512 183.168 780.501333a42.666667 42.666667 0 0 0 59.669333 61.002667l0.672-0.672L512 572.341333l268.501333 268.490667C788.832 849.162667 799.754667 853.333333 810.666667 853.333333s21.845333-4.170667 30.165333-12.501333a42.666667 42.666667 0 0 0 0-60.330667L572.341333 512z" p-id="8460" fill="#d81e06"></path></svg>

After

Width:  |  Height:  |  Size: 869 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711724278042" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11057" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M756.821333 256C691.541333 203.264 601.472 170.666667 512 170.666667a341.333333 341.333333 0 1 0 341.333333 341.333333 42.666667 42.666667 0 0 1 85.333334 0c0 235.648-191.018667 426.666667-426.666667 426.666667S85.333333 747.648 85.333333 512 276.352 85.333333 512 85.333333c108.757333 0 217.898667 39.082667 298.666667 104.490667V128a42.666667 42.666667 0 0 1 85.333333 0v170.666667a42.666667 42.666667 0 0 1-42.666667 42.666666h-170.666666a42.666667 42.666667 0 0 1 0-85.333333h74.154666z" p-id="11058" fill="#f0d323"></path></svg>

After

Width:  |  Height:  |  Size: 867 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711724571236" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15667" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M223.579432 955.45963a24.234651 24.234651 0 0 1-3.071998-1.979732 508.995927 508.995927 0 0 1-184.319877-185.616943 34.133311 34.133311 0 0 1 12.561058-46.557836 33.655444 33.655444 0 0 1 46.694369 12.561058 440.25144 440.25144 0 0 0 159.880427 160.767893 15.223457 15.223457 0 0 1 2.525865 1.365333c12.424525 6.826662 24.917317 13.653324 37.751441 19.455987A443.733038 443.733038 0 0 0 701.582313 127.726848l-4.64213-2.662398-4.369064-2.389332H692.16152a444.347437 444.347437 0 0 0-423.867451 0l-1.365333 0.682666-3.618131 1.979732-5.188263 2.935465A440.114907 440.114907 0 0 0 95.852584 290.406206a33.723711 33.723711 0 0 1-46.694369 12.561059 34.133311 34.133311 0 0 1-12.561058-46.694369A512.477525 512.477525 0 0 1 695.233517 47.854901a0.682666 0.682666 0 0 0 0.546133 0c1.365332 0.682666 2.525865 1.365332 3.891198 1.843199a511.658326 511.658326 0 0 1-1.365333 925.35405l-1.228799 0.682666-3.618131 1.570132a505.71913 505.71913 0 0 1-176.947082 45.329037 492.065805 492.065805 0 0 1-37.614908 1.433599 507.835395 507.835395 0 0 1-255.317163-68.607954z" fill="#bfbfbf" p-id="15668"></path><path d="M539.176022 288.358208a231.492112 231.492112 0 0 1 163.498557 283.169944 34.133311 34.133311 0 0 1-41.847439 24.098118 34.133311 34.133311 0 0 1-24.098117-41.779173A162.952425 162.952425 0 1 0 437.117423 669.012887a34.133311 34.133311 0 0 1 24.098117 41.847439 34.133311 34.133311 0 0 1-41.779172 24.098117 231.219046 231.219046 0 1 1 119.739654-446.600235z" fill="#bfbfbf" p-id="15669"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711723813811" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4236" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M800 288a47.84 47.84 0 0 0-33.936 14.064L432 636.112 257.936 462.064a48 48 0 1 0-67.872 67.872l208 208c8.688 8.688 20.688 14.064 33.936 14.064s25.248-5.376 33.936-14.064l368-368A48 48 0 0 0 800 288z" fill="#bfbfbf" p-id="4237"></path></svg>

After

Width:  |  Height:  |  Size: 573 B

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1711724195931" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9893" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M800 288a47.84 47.84 0 0 0-33.936 14.064L432 636.112 257.936 462.064a48 48 0 1 0-67.872 67.872l208 208c8.688 8.688 20.688 14.064 33.936 14.064s25.248-5.376 33.936-14.064l368-368A48 48 0 0 0 800 288z" fill="#14ca20" p-id="9894"></path></svg>

After

Width:  |  Height:  |  Size: 573 B

@@ -109,7 +109,7 @@ export default class DetailFramework extends Component<
marginLeft: '3%',
}}
>
<AtCard isFull title={pt.get().ticketDetail.descTitle}>
<AtCard isFull title={pt.get().ticketDetail.desc.title}>
<View className='at-article__h3'>
{this.state.ticketInfo.description}
</View>
+8 -4
View File
@@ -18,9 +18,9 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
var message = '';
const note = this.props.note;
const td = pt.get().ticketDetail;
const createMessage = td.createTicketMessage;
const createMessage = td.comment.createTicketMessage;
const modifyMessage = td.statusModifyMessage;
const prefix = td.statusModifyPrefix;
const prefix = td.comment.statusModifyPrefix;
switch (note.type) {
case 0:
@@ -44,8 +44,12 @@ export default class NoteCard extends Component<NoteCardProps, {}> {
/>
</View>
<View
className='at-col'
style={{ marginTop: '40rpx', marginBottom: '40rpx' }}
className='at-col at-col--wrap'
style={{
marginTop: '40rpx',
marginBottom: '40rpx',
wordBreak: 'normal',
}}
>
<View className='at-article__p'>{note.op}</View>
<View className='at-article__info'>
@@ -1,9 +1,10 @@
import { AtListItem } from 'taro-ui';
import repair from '@/assets/icons/MyTickets/repair.svg';
import finished from '@/assets/icons/MyTickets/finished.svg';
import tick from '@/assets/icons/MyTickets/tick.svg';
import fail from '@/assets/icons/MyTickets/fail.svg';
import clock from '@/assets/icons/MyTickets/clock.svg';
import create from '@/assets/icons/TicketState/create.svg';
import repair from '@/assets/icons/TicketState/repair.svg';
import success from '@/assets/icons/TicketState/success.svg';
import fail from '@/assets/icons/TicketState/fail.svg';
import refuse from '@/assets/icons/TicketState/refuse.svg';
import retrieve from '@/assets/icons/TicketState/retrieve.svg';
import pt from '@/plain-text';
import Taro from '@tarojs/taro';
import { FixStatus } from '@/common';
@@ -29,14 +30,14 @@ export class TicketListItem {
this.status = status;
this.createAt = createAt;
this.iconMap = new Map<FixStatus, string>([
[0, repair],
[0, create],
[1, repair],
[2, clock],
[3, finished],
[4, clock],
[5, tick],
[6, clock],
[7, fail],
[2, refuse],
[3, retrieve],
[4, success],
[5, retrieve],
[6, fail],
[7, retrieve],
]);
}
+3
View File
@@ -0,0 +1,3 @@
export default definePageConfig({
usingComponents: {},
});
View File
+35
View File
@@ -0,0 +1,35 @@
import { Component, ReactNode } from 'react';
import { View } from '@tarojs/components';
import Taro from '@tarojs/taro';
import pt from '@/plain-text';
import PageFooter from '@/components/PageFooter/PageFooter';
import './404.scss';
export default class NotFoundPage extends Component {
componentDidMount(): void {
Taro.setNavigationBarTitle({
title: pt.get().navBar.notFound,
});
}
render(): ReactNode {
return (
<View>
<View
className='page-title'
style={{ marginTop: '150rpx', marginBottom: '240rpx' }}
>
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
{pt.get().notFound.title.ZhCn}
</View>
<View className='at-article__h2'>{pt.get().notFound.desc.ZhCn}</View>
<View style={{ height: '150rpx' }}></View>
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
{pt.get().notFound.title.EnUs}
</View>
<View className='at-article__h2'>{pt.get().notFound.desc.EnUs}</View>
</View>
<PageFooter />
</View>
);
}
}
+399 -114
View File
@@ -6,6 +6,7 @@ import {
AtActionSheet,
AtActionSheetItem,
AtButton,
AtCheckbox,
AtFloatLayout,
AtForm,
AtMessage,
@@ -22,58 +23,98 @@ import { pickTicket } from '@/service/pickTicket';
import { retrieve } from '@/service/retrieve';
import { changeStatus } from '@/service/changeStatus';
import { getDisable } from '@/service/getDisable';
import { StatusStr } from './TicketNote';
const submitInterval = 5000;
interface TicketDetailState {
id: number;
isMember: boolean;
showOreoModal: boolean;
showCommentLayout: boolean;
showRetrieveModal: boolean;
showStatusSheet: boolean;
showPickModal: boolean;
show: {
modal: {
oreo: boolean;
retrieve: boolean;
pick: boolean;
};
layout: {
comment: boolean;
reminder: boolean;
};
actionSheet: {
status: boolean;
};
};
comment: string;
isOreoLoading: boolean;
isOreoDisable: boolean;
isOreoDisable_main: boolean;
isPickLoading: boolean;
isPickDisable: boolean;
isPickDisable_main: boolean;
isRetrieveLoading: boolean;
isRetrieveDisable: boolean;
isRetrieveDisable_main: boolean;
isStatusLoading: boolean;
isStatusDisable: boolean;
isCommentLoading: boolean;
isCommentDisable: boolean;
isCommentDisable_main: boolean;
isLoading: {
oreo: boolean;
pick: boolean;
retrieve: boolean;
comment: boolean;
status: boolean;
reminder: boolean;
};
isDisable: {
oreo: boolean;
pick: boolean;
retrieve: boolean;
comment: boolean;
status: boolean;
reminder: boolean;
};
isDisable_main: {
oreo: boolean;
pick: boolean;
retrieve: boolean;
comment: boolean;
};
reminderList: Array<number>;
statusToBe: number;
}
export default class TicketDetail extends Component<{}, TicketDetailState> {
state: Readonly<TicketDetailState> = {
id: 0,
isMember: false,
showOreoModal: false,
showCommentLayout: false,
showRetrieveModal: false,
showStatusSheet: false,
showPickModal: false,
show: {
modal: {
oreo: false,
retrieve: false,
pick: false,
},
layout: {
comment: false,
reminder: false,
},
actionSheet: {
status: false,
},
},
comment: '',
isOreoLoading: false,
isOreoDisable: false,
isOreoDisable_main: false,
isPickLoading: false,
isPickDisable: false,
isPickDisable_main: false,
isRetrieveLoading: false,
isRetrieveDisable: false,
isRetrieveDisable_main: false,
isStatusLoading: false,
isStatusDisable: false,
isCommentLoading: false,
isCommentDisable: false,
isCommentDisable_main: false,
isLoading: {
oreo: false,
pick: false,
retrieve: false,
comment: false,
status: false,
reminder: false,
},
isDisable: {
oreo: false,
pick: false,
retrieve: false,
comment: false,
status: false,
reminder: false,
},
isDisable_main: {
oreo: false,
pick: false,
retrieve: false,
comment: false,
},
reminderList: [],
// eslint-disable-next-line react/no-unused-state
statusToBe: 0,
};
componentDidMount(): void {
@@ -88,73 +129,157 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
onAddToOreo(): void {
this.setState({
showOreoModal: true,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
oreo: true,
},
},
});
}
onAddComment(): void {
this.setState({
showCommentLayout: true,
show: {
...this.state.show,
layout: {
...this.state.show.layout,
comment: true,
},
},
});
}
onRetrieved(): void {
this.setState({
showRetrieveModal: true,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
retrieve: true,
},
},
});
}
onPick(): void {
this.setState({
showPickModal: true,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
pick: true,
},
},
});
}
onChangeStatus(): void {
this.setState({
showStatusSheet: true,
show: {
...this.state.show,
actionSheet: {
...this.state.show.actionSheet,
status: true,
},
},
});
}
handleOreoCancel(): void {
this.setState({
showOreoModal: false,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
oreo: false,
},
},
});
}
handleCommentCancel(): void {
this.setState({
showCommentLayout: false,
show: {
...this.state.show,
layout: {
...this.state.show.layout,
comment: false,
},
},
});
}
handleReminderCancel(): void {
this.setState({
show: {
...this.state.show,
layout: {
...this.state.show.layout,
reminder: false,
},
},
});
}
handleRetrieveCancel(): void {
this.setState({
showRetrieveModal: false,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
retrieve: false,
},
},
});
}
handleStatusCancel(): void {
this.setState({
showStatusSheet: false,
show: {
...this.state.show,
actionSheet: {
...this.state.show.actionSheet,
status: false,
},
},
});
}
handlePickCancel(): void {
this.setState({
showPickModal: false,
show: {
...this.state.show,
modal: {
...this.state.show.modal,
pick: false,
},
},
});
}
handleOreoConfirm(): void {
this.setState({
isOreoDisable: true,
showOreoModal: false,
isDisable: {
...this.state.isDisable,
oreo: true,
},
show: {
...this.state.show,
modal: {
...this.state.show.modal,
oreo: false,
},
},
});
addToOreo(this);
setTimeout(() => {
this.setState({
isOreoDisable: false,
isDisable: {
...this.state.isDisable,
oreo: false,
},
});
}, submitInterval);
return;
@@ -162,13 +287,25 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
handleRetrieveConfirm(): void {
this.setState({
isRetrieveDisable: true,
showRetrieveModal: false,
isDisable: {
...this.state.isDisable,
retrieve: true,
},
show: {
...this.state.show,
modal: {
...this.state.show.modal,
retrieve: false,
},
},
});
retrieve(this);
setTimeout(() => {
this.setState({
isRetrieveDisable: false,
isDisable: {
...this.state.isDisable,
retrieve: false,
},
});
}, submitInterval);
return;
@@ -176,27 +313,73 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
handlePickConfirm(): void {
this.setState({
isPickDisable: true,
showPickModal: false,
isDisable: {
...this.state.isDisable,
pick: true,
},
show: {
...this.state.show,
modal: {
...this.state.show.modal,
pick: false,
},
},
});
pickTicket(this);
setTimeout(() => {
this.setState({
isPickDisable: false,
isDisable: {
...this.state.isDisable,
pick: false,
},
});
}, submitInterval);
return;
}
handleStatusChange(status: number): void {
this.setState({
showStatusSheet: false,
isStatusDisable: true,
});
changeStatus(this, status);
if (status == 3 || status == 5 || status == 7) {
this.setState({
isDisable: {
...this.state.isDisable,
status: true,
},
show: {
...this.state.show,
actionSheet: {
...this.state.show.actionSheet,
status: false,
},
layout: {
...this.state.show.layout,
reminder: true,
},
},
// eslint-disable-next-line react/no-unused-state
statusToBe: status,
});
} else {
this.setState({
isDisable: {
...this.state.isDisable,
status: true,
},
show: {
...this.state.show,
actionSheet: {
...this.state.show.actionSheet,
status: false,
},
},
});
changeStatus(this);
}
setTimeout(() => {
this.setState({
isStatusDisable: false,
isDisable: {
...this.state.isDisable,
status: false,
},
});
}, submitInterval);
return;
@@ -211,8 +394,17 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
onCommentSubmit() {
this.setState({
isCommentDisable: true,
showCommentLayout: false,
isDisable: {
...this.state.isDisable,
comment: true,
},
show: {
...this.state.show,
layout: {
...this.state.show.layout,
comment: false,
},
},
});
if (this.state.comment == '') {
Taro.atMessage({
@@ -221,7 +413,10 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
});
setTimeout(() => {
this.setState({
isCommentDisable: false,
isDisable: {
...this.state.isDisable,
comment: false,
},
});
}, submitInterval);
return;
@@ -229,11 +424,81 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
submitComment(this);
setTimeout(() => {
this.setState({
isCommentDisable: false,
isDisable: {
...this.state.isDisable,
comment: false,
},
});
}, submitInterval);
}
handleReminderChange(reminderList: Array<number>) {
this.setState({
reminderList: reminderList,
});
return reminderList;
}
onReminderSubmit() {
if (
this.state.reminderList.includes(1) &&
this.state.reminderList.includes(3)
) {
this.setState({
isDisable: {
...this.state.isDisable,
reminder: true,
},
show: {
...this.state.show,
layout: {
...this.state.show.layout,
reminder: false,
},
},
});
changeStatus(this);
} else {
this.setState({
isDisable: {
...this.state.isDisable,
reminder: true,
},
});
Taro.atMessage({
message: pt.get().ticketDetail.reminder.error,
type: 'error',
});
}
setTimeout(() => {
this.setState({
isDisable: {
...this.state.isDisable,
reminder: false,
},
});
}, submitInterval);
}
reminderOption = [
{
value: 0,
label: pt.get().ticketDetail.reminder.r0,
},
{
value: 1,
label: pt.get().ticketDetail.reminder.r1,
},
{
value: 2,
label: pt.get().ticketDetail.reminder.r2,
},
{
value: 3,
label: pt.get().ticketDetail.reminder.r3,
},
];
render(): ReactNode {
const middleButton = this.state.isMember ? (
<View>
@@ -246,14 +511,14 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
style={{ marginLeft: '20rpx', paddingRight: '10rpx', width: '50%' }}
>
<AtButton
loading={this.state.isPickLoading}
loading={this.state.isLoading.pick}
disabled={
this.state.isPickDisable || this.state.isPickDisable_main
this.state.isDisable.pick || this.state.isDisable_main.pick
}
type='secondary'
onClick={this.onPick.bind(this)}
>
{pt.get().ticketDetail.pick}
{pt.get().ticketDetail.button.pick}
</AtButton>
</View>
<View
@@ -261,14 +526,14 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
style={{ marginLeft: '20rpx', paddingRight: '10rpx', width: '50%' }}
>
<AtButton
loading={this.state.isOreoLoading}
loading={this.state.isLoading.oreo}
disabled={
this.state.isOreoDisable || this.state.isOreoDisable_main
this.state.isDisable.oreo || this.state.isDisable_main.oreo
}
type='primary'
onClick={this.onAddToOreo.bind(this)}
>
{pt.get().ticketDetail.addToOreo}
{pt.get().ticketDetail.button.addToOreo}
</AtButton>
</View>
</View>
@@ -281,12 +546,12 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
style={{ marginLeft: '20rpx', paddingRight: '10rpx', width: '50%' }}
>
<AtButton
loading={this.state.isStatusLoading}
disabled={this.state.isStatusDisable}
loading={this.state.isLoading.status}
disabled={this.state.isDisable.status}
type='primary'
onClick={this.onChangeStatus.bind(this)}
>
{pt.get().ticketDetail.status.button}
{pt.get().ticketDetail.button.status}
</AtButton>
</View>
<View
@@ -295,13 +560,14 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
>
<AtButton
disabled={
this.state.isCommentDisable || this.state.isCommentDisable_main
this.state.isDisable.comment ||
this.state.isDisable_main.comment
}
loading={this.state.isCommentLoading}
loading={this.state.isLoading.comment}
type='secondary'
onClick={this.onAddComment.bind(this)}
>
{pt.get().ticketDetail.addNote}
{pt.get().ticketDetail.button.addNote}
</AtButton>
</View>
</View>
@@ -316,14 +582,15 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
style={{ marginLeft: '20rpx', paddingRight: '10rpx', width: '50%' }}
>
<AtButton
loading={this.state.isRetrieveLoading}
loading={this.state.isLoading.retrieve}
disabled={
this.state.isRetrieveDisable || this.state.isRetrieveDisable_main
this.state.isDisable.retrieve ||
this.state.isDisable_main.retrieve
}
type='primary'
onClick={this.onRetrieved.bind(this)}
>
{pt.get().ticketDetail.tookAway}
{pt.get().ticketDetail.button.tookAway}
</AtButton>
</View>
<View
@@ -332,18 +599,38 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
>
<AtButton
disabled={
this.state.isCommentDisable || this.state.isCommentDisable_main
this.state.isDisable.comment || this.state.isDisable_main.comment
}
loading={this.state.isCommentLoading}
loading={this.state.isLoading.comment}
type='secondary'
onClick={this.onAddComment.bind(this)}
>
{pt.get().ticketDetail.addNote}
{pt.get().ticketDetail.button.addNote}
</AtButton>
</View>
</View>
);
const actionSheetItemList: Array<StatusStr> = [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
];
const sheetItemsRenderer = actionSheetItemList.map((item, idx) => (
<AtActionSheetItem
key={idx}
onClick={this.handleStatusChange.bind(this, idx)}
>
{pt.get().ticketDetail.statusModifyMessage.get(item)}
</AtActionSheetItem>
));
const isInfoShow = {
device: true,
createdTime: true,
@@ -358,7 +645,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
<View>
<AtMessage />
<AtModal
isOpened={this.state.showOreoModal}
isOpened={this.state.show.modal.oreo}
title={pt.get().modal.addToOreo.title}
cancelText={pt.get().modal.cancel}
confirmText={pt.get().modal.confirm}
@@ -367,7 +654,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
content={pt.get().modal.addToOreo.content}
/>
<AtModal
isOpened={this.state.showRetrieveModal}
isOpened={this.state.show.modal.retrieve}
title={pt.get().modal.retrieve.title}
cancelText={pt.get().modal.cancel}
confirmText={pt.get().modal.confirm}
@@ -376,7 +663,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
content={pt.get().modal.retrieve.content}
/>
<AtModal
isOpened={this.state.showPickModal}
isOpened={this.state.show.modal.pick}
title={pt.get().modal.pick.title}
cancelText={pt.get().modal.cancel}
confirmText={pt.get().modal.confirm}
@@ -385,7 +672,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
content={pt.get().modal.pick.content}
/>
<AtFloatLayout
isOpened={this.state.showCommentLayout}
isOpened={this.state.show.layout.comment}
title={pt.get().ticketDetail.comment.title}
onClose={this.handleCommentCancel.bind(this)}
>
@@ -402,37 +689,35 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
</AtButton>
</AtForm>
</AtFloatLayout>
<AtFloatLayout
isOpened={this.state.show.layout.reminder}
title={pt.get().ticketDetail.reminder.title}
onClose={this.handleReminderCancel.bind(this)}
>
<AtForm onSubmit={this.onReminderSubmit.bind(this)}>
<AtCheckbox
options={this.reminderOption}
selectedList={this.state.reminderList}
onChange={this.handleReminderChange.bind(this)}
/>
<AtButton
loading={this.state.isLoading.reminder}
formType='submit'
type='primary'
disabled={this.state.isDisable.reminder}
>
{pt.get().button.buttonText.submit}
</AtButton>
</AtForm>
</AtFloatLayout>
<AtActionSheet
isOpened={this.state.showStatusSheet}
isOpened={this.state.show.actionSheet.status}
cancelText={pt.get().ticketDetail.status.cancel}
title={pt.get().ticketDetail.status.title}
onCancel={this.handleStatusCancel.bind(this)}
onClose={this.handleStatusCancel.bind(this)}
>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 0)}>
{pt.get().ticketDetail.status.status0}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 1)}>
{pt.get().ticketDetail.status.status1}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 2)}>
{pt.get().ticketDetail.status.status2}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 3)}>
{pt.get().ticketDetail.status.status3}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 4)}>
{pt.get().ticketDetail.status.status4}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 5)}>
{pt.get().ticketDetail.status.status5}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 6)}>
{pt.get().ticketDetail.status.status6}
</AtActionSheetItem>
<AtActionSheetItem onClick={this.handleStatusChange.bind(this, 7)}>
{pt.get().ticketDetail.status.status7}
</AtActionSheetItem>
{sheetItemsRenderer}
</AtActionSheet>
<DetailFramework
middleButton={middleButton}
+1 -1
View File
@@ -30,4 +30,4 @@ export class ShowElements {
notelist: JSX.Element;
}
export type StatusStr = '1' | '2' | '3' | '4' | '5';
export type StatusStr = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7';
+1
View File
@@ -95,6 +95,7 @@ export default class TicketListPage extends Component<{}, TicketListState> {
<AtList>{fixListRenderer}</AtList>
<View style={{ marginTop: '40rpx' }}>
<AtPagination
icon
total={this.state.totalPage}
pageSize={this.state.pageSize}
current={this.state.currentPage}
+26 -11
View File
@@ -4,24 +4,26 @@ import { AtTimeline } from 'taro-ui';
import pt from '@/plain-text';
import tick from '@/assets/icons/MainPage/tick.svg';
import cross from '@/assets/icons/MainPage/cross.svg';
import clock from '@/assets/icons/MemberPage/clock.svg';
import clock from '@/assets/icons/MainPage/offduty.svg';
import wechatUser from '@/wechat';
import moment from 'moment';
export class DutyData {
constructor() {
this.isInDuty = false;
this.inDutyCnt = 3;
this.currentDuty = '2';
this.otherDutyTime = '9:30-11:30';
this.offDutyReason = '学园维修';
this.dutyRecoverTime = '下周一';
this.currentDuty = '1';
this.otherDutyStart = '2024-03-07T13:30:48.523303';
this.otherDutyEnd = '2024-03-07T16:00:48.523303';
this.dutyRecoverTime = '明天 13:30';
this.place = '东三-204';
}
isInDuty: boolean;
inDutyCnt?: number;
currentDuty?: 'off' | '1' | '2' | '3' | 'others';
otherDutyTime?: string;
currentDuty?: '0' | '1' | '2' | '3' | 'others';
otherDutyStart?: string;
otherDutyEnd?: string;
offDutyReason?: string;
dutyRecoverTime?: string;
place: string;
@@ -87,8 +89,18 @@ export class DutyInfo extends Component {
<Card isInDuty={data.isInDuty} place={data.place} />
<AtTimeline
items={[
{ title: od.reason(data.offDutyReason as string) },
{ title: od.recoverTime(data.dutyRecoverTime as string) },
{
title:
data.currentDuty == '0'
? pt.get().mainPage.normal.reason
: od.reason(data.offDutyReason as string),
},
{
title:
data.currentDuty == '0'
? pt.get().mainPage.normal.recoverTime
: od.recoverTime(data.dutyRecoverTime as string),
},
]}
/>
</View>
@@ -106,8 +118,11 @@ export class DutyInfo extends Component {
{
title:
data.currentDuty == 'others'
? id.currentDutyText('others') + data.otherDutyTime
: id.currentDutyText(data.currentDuty || 'off'),
? id.currentDutyText('others') +
moment(data.otherDutyStart).format('H:mm') +
' - ' +
moment(data.otherDutyEnd).format('H:mm')
: id.currentDutyText(data.currentDuty || '0'),
},
{ title: id.inDutyCnt(data.inDutyCnt as number) },
]}
+4 -4
View File
@@ -21,13 +21,13 @@ export default class TitleCard extends React.Component {
<View className='page-title'>
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
{wechatUser.getAccess()
? memberPage.mainTitleLine + wechatUser.getInfo().name
: mainPage.mainTitleLine}
? memberPage.titleLine.main.index + wechatUser.getInfo().name
: mainPage.titleLine.main}
</View>
<View className='at-article__h2'>
{wechatUser.getAccess()
? memberPage.subTitleLine
: mainPage.subTitleLine}
? memberPage.titleLine.sub.index
: mainPage.titleLine.sub}
</View>
</View>
</View>
+9 -3
View File
@@ -265,12 +265,18 @@ export default class MainPage extends Component<{}, MainPageState> {
/>
</View>
{wechatUser.getAccess() ? (
<View>
<View style={{ marginTop: '40rpx' }}>
<View
className='at-article__h3'
style={{ marginBottom: '20rpx', fontWeight: 'bold' }}
>
{memberPage.ticketList.hint}
</View>
<AtList>{fixListRenderer}</AtList>
<AtList>
<AtListItem
title={pt.get().mainPage.ticketList.title}
note={pt.get().mainPage.ticketList.note}
title={pt.get().memberPage.ticketList.title}
note={pt.get().memberPage.ticketList.note}
arrow='right'
thumb={clockIcon}
onClick={this.ticketListPage}
+20 -7
View File
@@ -184,9 +184,16 @@ export default class RepairPage extends Component<{}, RepairPageState> {
}
render(): ReactNode {
const ticketsRenderer =
this.state.currentTicketsIdName.length !== 0 ? (
this.state.currentTicketsIdName.map((pair, idx) => (
const hasContinuingticket = this.state.currentTicketsIdName.length !== 0;
const ticketsRenderer = hasContinuingticket ? (
<View>
<View
className='at-article__h3'
style={{ marginBottom: '20rpx', fontWeight: 'bold' }}
>
{pt.get().repairPage.currentTicket.hint}
</View>
{this.state.currentTicketsIdName.map((pair, idx) => (
<AtCard
key={idx}
title={pair.values().next().value} //pair.keys().next().value == ticket['device'] + ' ' + ticket['deviceModel']
@@ -210,10 +217,16 @@ export default class RepairPage extends Component<{}, RepairPageState> {
middleButton={middleButton}
/>
</AtCard>
))
) : (
<View></View>
);
))}
</View>
) : (
<View
className='at-article__h3'
style={{ marginBottom: '20rpx', fontWeight: 'bold' }}
>
{pt.get().repairPage.currentTicket.nohint}
</View>
);
return (
<View style={{ width: '94%', marginLeft: '3%' }}>
<AtMessage />
+8 -2
View File
@@ -28,7 +28,10 @@ export default class AboutPage extends Component {
mode='aspectFit'
/>
</View>
<View className='at-article at-col'>
<View
className='at-article at-col at-col--wrap'
style={{ wordBreak: 'normal' }}
>
<View className='at-article__h1'>
{pt.get().aboutPage.dean.nickname}
</View>
@@ -54,7 +57,10 @@ export default class AboutPage extends Component {
mode='aspectFit'
/>
</View>
<View className='at-article at-col'>
<View
className='at-article at-col at-col--wrap'
style={{ wordBreak: 'normal' }}
>
<View className='at-article__h1'>
{pt.get().aboutPage.fracher.nickname}
</View>
+4 -4
View File
@@ -50,10 +50,10 @@ export default class UserMemberPage extends Component {
<AtMessage />
<View className='page-title' style={{ marginBottom: '40rpx' }}>
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
{pt.get().memberPage.loginMainTitleLine}
{pt.get().memberPage.titleLine.main.login}
</View>
<View className='at-article__h2'>
{pt.get().memberPage.loginSubTitleLine}
{pt.get().memberPage.titleLine.sub.login}
</View>
</View>
<AtButton
@@ -70,10 +70,10 @@ export default class UserMemberPage extends Component {
<AtMessage />
<View className='page-title' style={{ marginBottom: '40rpx' }}>
<View className='at-article__h1' style={{ fontWeight: 'bold' }}>
{pt.get().memberPage.logoutMainTitleLine}
{pt.get().memberPage.titleLine.main.logout}
</View>
<View className='at-article__h2'>
{pt.get().memberPage.logoutSubTitleLine}
{pt.get().memberPage.titleLine.sub.logout}
</View>
</View>
<AtButton type='primary' onClick={this.onLogout.bind(this)}>
+3 -3
View File
@@ -43,9 +43,9 @@ export default class UserPage extends Component {
if (this.state.clicks < 3) {
this.setState({
toastText:
pt.get().userPage.memberEntry.front +
pt.get().userPage.memberEntry.prefix +
(this.state.clicks + 1).toString() + // React State's feature
pt.get().userPage.memberEntry.behind,
pt.get().userPage.memberEntry.affix,
isToastOpen: true,
});
if (this.state.clicks == 0) {
@@ -123,7 +123,7 @@ export default class UserPage extends Component {
className='at-row at-row__justify--center at-row__align--center'
style='height:120rpx;color:#696969;'
>
<Text style={{ fontSize: '32rpx' }}> EVA Eta v1.0.0</Text>
<Text style={{ fontSize: '32rpx' }}> EVA Eta v1.0.2</Text>
</View>
<AtList>
<AtListItem
+21
View File
@@ -0,0 +1,21 @@
export interface NotFoundText {
title: {
ZhCn: string;
EnUs: string;
};
desc: {
ZhCn: string;
EnUs: string;
};
}
export const notFound: NotFoundText = {
title: {
ZhCn: '啊哦...请求出错了...',
EnUs: 'Oops...Network Error...',
},
desc: {
ZhCn: '请确保处于校网环境后,点击右上角 "...-重新进入小程序"!',
EnUs: 'Please make sure you\'re in ZJU\'s school network environment and then click on the top right corner "... - re-enter the applet"!',
},
};
+28 -23
View File
@@ -1,6 +1,12 @@
export interface MainPageText {
mainTitleLine: string;
subTitleLine: string;
normal: {
recoverTime: string;
reason: string;
};
titleLine: {
main: string;
sub: string;
};
cardTitle: {
dutyInfo: string;
stepInfo: string;
@@ -23,11 +29,6 @@ export interface MainPageText {
stepList: Array<{ title: string }>;
tipsList: Array<{ title: string }>;
ticketList: {
title: string;
note: string;
};
dutyCard: {
offDuty: {
title: string;
@@ -36,15 +37,21 @@ export interface MainPageText {
};
inDuty: {
title: string;
currentDutyText: (c: 'off' | '1' | '2' | '3' | 'others') => string;
currentDutyText: (c: '0' | '1' | '2' | '3' | 'others') => string;
inDutyCnt: (n: number) => string;
};
};
}
export const mainPageZhCn: MainPageText = {
mainTitleLine: '您好,这里是E志者协会',
subTitleLine: '维修请至【东三-204】实验室',
normal: {
recoverTime: '明天 13:30',
reason: '正常下班',
},
titleLine: {
main: '您好,这里是E志者协会',
sub: '维修请至【东三-204】实验室',
},
cardTitle: {
dutyInfo: '值班情况',
stepInfo: '维修步骤',
@@ -76,10 +83,6 @@ export const mainPageZhCn: MainPageText = {
{ title: '204 也是实验室,请勿在内饮食~' },
{ title: '我们是志愿服务,不收取任何礼物哦~' },
],
ticketList: {
title: '预填写工单列表',
note: '在这里查看所有的预填写工单!',
},
dutyCard: {
offDuty: {
title: '未值班',
@@ -90,7 +93,7 @@ export const mainPageZhCn: MainPageText = {
title: '值班中',
currentDutyText: (c) => {
switch (c) {
case 'off':
case '0':
return '当前未值班';
case '1':
return '第一班 13:30-16:00';
@@ -108,8 +111,14 @@ export const mainPageZhCn: MainPageText = {
};
export const mainPageEnUs: MainPageText = {
mainTitleLine: 'Hi! This is EVA.',
subTitleLine: 'For maintenance, please go to [204 Lab, E3 building]',
normal: {
recoverTime: 'Tomorrow 13:30',
reason: 'Normal shift',
},
titleLine: {
main: 'Hi! This is EVA.',
sub: 'For maintenance, please go to [204 Lab, E3 building]',
},
cardTitle: {
dutyInfo: 'Duty Situation',
stepInfo: 'Maintenance Steps',
@@ -141,10 +150,6 @@ export const mainPageEnUs: MainPageText = {
{ title: '204 is also a laboratory. Do not eat inside.' },
{ title: 'We are volunteers and do not take any gifts.' },
],
ticketList: {
title: '预填写工单列表',
note: '在这里查看所有的预填写工单!',
},
dutyCard: {
offDuty: {
title: 'Off Duty',
@@ -155,8 +160,8 @@ export const mainPageEnUs: MainPageText = {
title: 'On Duty',
currentDutyText: (c) => {
switch (c) {
case 'off':
return 'Currently not on duty';
case '0':
return 'Normal Shift';
case '1':
return '1st Shift 13:30-16:00';
case '2':
+54 -29
View File
@@ -1,10 +1,16 @@
export interface MemberPageText {
mainTitleLine: string;
subTitleLine: string;
loginMainTitleLine: string;
loginSubTitleLine: string;
logoutMainTitleLine: string;
logoutSubTitleLine: string;
titleLine: {
main: {
index: string;
login: string;
logout: string;
};
sub: {
index: string;
login: string;
logout: string;
};
};
cardTitle: {
dutyInfo: string;
stepInfo: string;
@@ -22,9 +28,6 @@ export interface MemberPageText {
title: string;
placeholder: string;
};
uncompletedTicket: {
extra: string;
};
dutyCard: {
offDuty: {
title: string;
@@ -54,22 +57,33 @@ export interface MemberPageText {
};
stepList: Array<{ title: string }>;
tipsList: Array<{ title: string }>;
ticketList: {
hint: string;
title: string;
note: string;
};
}
export const memberPageZhCn: MemberPageText = {
mainTitleLine: '您好,',
subTitleLine: '祝你满绩每一天',
loginMainTitleLine: '协会成员登录入口',
loginSubTitleLine: '请打开 auth.zjueva.net,登录后点击下方按钮以扫描二维码',
logoutMainTitleLine: '协会成员登出',
logoutSubTitleLine: '登出后须扫码重新登录!',
titleLine: {
main: {
index: '您好,',
login: '协会成员登录入口',
logout: '协会成员登出',
},
sub: {
index: '祝你满绩每一天',
login: '请使用 EVA 统一身份认证,登录后点击下方按钮以扫描二维码',
logout: '登出后须扫码重新登录!',
},
},
cardTitle: {
dutyInfo: '值班情况',
stepInfo: '维修步骤',
tipsInfo: '注意事项',
},
dutyCount: {
button: '更新值班人数',
button: '更新',
text: '当前值班人数:',
},
stuidText: {
@@ -80,9 +94,6 @@ export const memberPageZhCn: MemberPageText = {
title: '密码',
placeholder: '与 EVA 统一身份认证一致',
},
uncompletedTicket: {
extra: '详细信息',
},
dutyCard: {
offDuty: {
title: '空闲',
@@ -135,22 +146,34 @@ export const memberPageZhCn: MemberPageText = {
{ title: '离开 204 前清点好维修物资!' },
{ title: '螺丝上了吗?电源排线插了吗?' },
],
ticketList: {
hint: '七日内未完成工单',
title: '预填写工单列表',
note: '在这里查看所有的预填写工单!',
},
};
export const memberPageEnUs: MemberPageText = {
mainTitleLine: 'Hi! ',
subTitleLine: 'Have a great day!',
loginMainTitleLine: '协会成员登录入口',
loginSubTitleLine: '请打开 auth.zjueva.net,登录后点击下方按钮以扫描二维码',
logoutMainTitleLine: '协会成员登出',
logoutSubTitleLine: '登出后须扫码重新登录!',
titleLine: {
main: {
index: 'Hi! ',
login: 'EVA Member Entry',
logout: 'EVA Member Logout',
},
sub: {
index: 'Have a great day!',
login:
'Please use EVA Auth, log in and click the button below to scan the QR code',
logout: 'After logging out, scan the code again to log back in!',
},
},
cardTitle: {
dutyInfo: 'Duty Situation',
stepInfo: 'Maintenance Steps',
tipsInfo: 'Tips',
},
dutyCount: {
button: 'Update Duty Count',
button: 'Update',
text: 'The duty count: ',
},
stuidText: {
@@ -161,9 +184,6 @@ export const memberPageEnUs: MemberPageText = {
title: 'Password',
placeholder: 'Consistent with EVA Auth',
},
uncompletedTicket: {
extra: 'Details',
},
dutyCard: {
offDuty: {
title: 'Off Duty',
@@ -220,4 +240,9 @@ export const memberPageEnUs: MemberPageText = {
{ title: '204 is a laboratory. Do not eat inside.' },
{ title: 'Are the screws on? Is the power cable plugged in?' },
],
ticketList: {
hint: 'Uncompleted tickets in 7 days',
title: 'Pre-filling ticket list',
note: 'Browse for all pre-filling tickets here!',
},
};
+3
View File
@@ -1,4 +1,5 @@
export interface NavBarTitle {
notFound: string;
ticketDetail: string;
ticketList: string;
user: {
@@ -12,6 +13,7 @@ export interface NavBarTitle {
}
export const navBarTitleZhCn: NavBarTitle = {
notFound: '连接失败',
ticketDetail: '工单详情',
ticketList: '所有工单',
user: {
@@ -25,6 +27,7 @@ export const navBarTitleZhCn: NavBarTitle = {
};
export const navBarTitleEnUs: NavBarTitle = {
notFound: 'Failed',
ticketDetail: 'Ticket Detail',
ticketList: 'All Tickets',
user: {
+6
View File
@@ -4,6 +4,8 @@ export interface RepairPageText {
title: string;
note: string;
extra: string;
hint: string;
nohint: string;
};
typeText: {
computer: string;
@@ -51,6 +53,8 @@ export const repairPageZhCn: RepairPageText = {
title: '',
note: '',
extra: '详细信息',
hint: '我正在进行的工单',
nohint: '暂无进行中的工单',
},
typeText: {
computer: '电脑',
@@ -98,6 +102,8 @@ export const repairPageEnUs: RepairPageText = {
title: '',
note: '',
extra: 'Details',
hint: 'My continuing tickets',
nohint: 'No continuing tickets',
},
typeText: {
computer: 'Computer',
+63 -51
View File
@@ -6,35 +6,39 @@ type StatusStr = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7';
export interface TicketDetailText {
stepItems: Array<StepItem>;
createTicketMessage: string;
statusModifyPrefix: string;
statusModifyMessage: Map<StatusStr, string>;
descTitle: string;
desc: {
title: string;
};
divider: string;
info: {
title: string;
extra: string;
};
tookAway: string;
addToOreo: string;
addNote: string;
pick: string;
button: {
tookAway: string;
addToOreo: string;
addNote: string;
pick: string;
status: string;
};
reminder: {
title: string;
error: string;
r0: string;
r1: string;
r2: string;
r3: string;
};
comment: {
title: string;
placeholder: string;
createTicketMessage: string;
statusModifyPrefix: string;
};
status: {
button: string;
title: string;
cancel: string;
status0: string;
status1: string;
status2: string;
status3: string;
status4: string;
status5: string;
status6: string;
status7: string;
};
}
@@ -45,8 +49,6 @@ export const ticketDetailZhCn: TicketDetailText = {
{ title: '待取回' },
{ title: '工单完成' },
],
createTicketMessage: '创建了维修',
statusModifyPrefix: '将维修状态改为:',
statusModifyMessage: new Map<StatusStr, string>([
['0', '已创建/交接中'],
['1', '维修中'],
@@ -57,32 +59,38 @@ export const ticketDetailZhCn: TicketDetailText = {
['6', '维修翻车待取回'],
['7', '维修翻车已取回'],
]),
descTitle: '问题描述',
divider: '评论 / 状态',
desc: {
title: '问题描述',
},
info: {
title: '机主姓名',
extra: '联系方式',
},
tookAway: '我已取回',
addToOreo: '加入 Oreo',
addNote: '添加评论',
pick: '认领',
divider: '评论 / 状态',
button: {
tookAway: '我已取回',
addToOreo: '加入 Oreo',
addNote: '添加评论',
pick: '认领',
status: '改变状态',
},
comment: {
title: '添加评论',
placeholder: '可以在这里交流机器情况、维修进度、提出问题~',
createTicketMessage: '创建了维修',
statusModifyPrefix: '将维修状态改为:',
},
reminder: {
title: '注意事项!',
error: '请重新确认机器状况!',
r0: '是否进行维修?',
r1: '螺丝是否装回?排线是否插好?',
r2: '维修后机器是否已正常运行?',
r3: '随机附件是否已经归还?',
},
status: {
button: '改变工单状态',
title: '请选择要改变成为的状态',
cancel: '取消',
status0: '已创建/交接中',
status1: '维修中',
status2: '劝退待取回',
status3: '劝退已取回',
status4: '维修成功待取回',
status5: '维修成功已取回',
status6: '维修翻车待取回',
status7: '维修翻车已取回',
},
};
@@ -93,8 +101,6 @@ export const ticketDetailEnUs: TicketDetailText = {
{ title: 'Finished' },
{ title: 'Retrieved' },
],
createTicketMessage: 'Created ticket',
statusModifyPrefix: 'Modified repair status to: ',
statusModifyMessage: new Map<StatusStr, string>([
['0', 'Created / Handovering'],
['1', 'Repairing'],
@@ -105,32 +111,38 @@ export const ticketDetailEnUs: TicketDetailText = {
['6', 'Pending Retrieval (Failed)'],
['7', 'Retrieved (Failed)'],
]),
descTitle: 'Description',
divider: 'Comment / Status',
desc: {
title: 'Description',
},
info: {
title: 'Name',
extra: 'Contact',
},
tookAway: 'Already retrieved',
addToOreo: 'Add to Oreo',
addNote: 'Comment',
pick: 'Pick',
divider: 'Comment / Status',
button: {
tookAway: 'Already retrieved',
addToOreo: 'Add to Oreo',
addNote: 'Comment',
pick: 'Pick',
status: 'Change status',
},
comment: {
title: 'Add Comment',
title: 'Add comment',
placeholder:
'You can exchange information the device, the progress of repairs, and ask questions here.',
createTicketMessage: 'Created ticket',
statusModifyPrefix: 'Modified repair status to: ',
},
reminder: {
title: 'Reminder',
error: 'Please re-confirm the status of the device!',
r0: 'Is the maintenance performed?',
r1: 'Are the srews on? Is the power cable plugged in?',
r2: 'Did the device operate well after maintenance?',
r3: 'Are the attachments reverted?',
},
status: {
button: 'Modify Status',
title: 'Please select the status you want to modify to',
cancel: 'Cancel',
status0: 'Created / Handovering',
status1: 'Repairing',
status2: 'Pending Retrieval (Refused)',
status3: 'Retrieved (Refused)',
status4: 'Pending Retrieval (Finished)',
status5: 'Retrieved (Finished)',
status6: 'Pending Retrieval (Failed)',
status7: 'Retrieved (Failed)',
},
};
+6 -6
View File
@@ -1,7 +1,7 @@
export interface UserPageText {
memberEntry: {
front: string;
behind: string;
prefix: string;
affix: string;
};
ticketColumn: {
title: string;
@@ -27,8 +27,8 @@ export interface UserPageText {
export const userPageZhCn: UserPageText = {
memberEntry: {
front: '再点击 ',
behind: ' 次以进入协会成员登录页面',
prefix: '再点击 ',
affix: ' 次以进入协会成员登录页面',
},
ticketColumn: {
title: '我的工单',
@@ -54,8 +54,8 @@ export const userPageZhCn: UserPageText = {
export const userPageEnUs: UserPageText = {
memberEntry: {
front: 'Click ',
behind: ' more times to enter member login page',
prefix: 'Click ',
affix: ' more times to enter member login page',
},
ticketColumn: {
title: 'My Tickets',
+4
View File
@@ -24,6 +24,7 @@ import {
actIndicatorEnUs,
actIndicatorZhCn,
} from './ActIndicator';
import { NotFoundText, notFound } from './404';
interface TextRecord {
common: CommonText;
@@ -44,6 +45,7 @@ interface TextRecord {
modal: ModalText;
toast: ToastText;
actIndicator: ActIndicatorText;
notFound: NotFoundText;
}
const textZhCn: TextRecord = {
@@ -65,6 +67,7 @@ const textZhCn: TextRecord = {
modal: modalZhCn,
toast: toastZhCn,
actIndicator: actIndicatorZhCn,
notFound: notFound,
};
const textEnUs: TextRecord = {
@@ -86,6 +89,7 @@ const textEnUs: TextRecord = {
modal: modalEnUs,
toast: toastEnUs,
actIndicator: actIndicatorEnUs,
notFound: notFound,
};
// type Lang = 'zh_CN' | 'en_US' | ...;
+12 -3
View File
@@ -6,7 +6,10 @@ import { getUrl } from '.';
export function addToOreo(that: TicketDetail) {
that.setState({
isOreoLoading: true,
isLoading: {
...that.state.isLoading,
oreo: true,
},
});
Taro.request({
url: getUrl('/tickets/addtooreo'),
@@ -19,7 +22,10 @@ export function addToOreo(that: TicketDetail) {
.then((res) => {
console.log(res.data);
that.setState({
isOreoLoading: false,
isLoading: {
...that.state.isLoading,
oreo: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.success,
@@ -29,7 +35,10 @@ export function addToOreo(that: TicketDetail) {
.catch((err) => {
console.log(err.errMsg);
that.setState({
isOreoLoading: false,
isLoading: {
...that.state.isLoading,
oreo: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.error + err.errMsg,
+14 -5
View File
@@ -6,9 +6,12 @@ import { getUrl } from '.';
const reLaunchInterval = 1000;
export function changeStatus(that: TicketDetail, status: number) {
export function changeStatus(that: TicketDetail) {
that.setState({
isStatusLoading: true,
isLoading: {
...that.state.isLoading,
status: true,
},
});
Taro.request({
url: getUrl('/tickets/update'),
@@ -16,13 +19,16 @@ export function changeStatus(that: TicketDetail, status: number) {
data: {
token: wechatUser.getToken(),
id: that.state.id,
status: status,
status: that.state.statusToBe,
},
})
.then((res) => {
console.log(res.data);
that.setState({
isStatusLoading: false,
isLoading: {
...that.state.isLoading,
status: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.success,
@@ -37,7 +43,10 @@ export function changeStatus(that: TicketDetail, status: number) {
.catch((err) => {
console.log(err.errMsg);
that.setState({
isStatusLoading: false,
isLoading: {
...that.state.isLoading,
status: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.error + err.errMsg,
+15 -13
View File
@@ -16,19 +16,21 @@ export function getCurrentTicket(that: RepairPage) {
.then((res) => {
const data = res.data.data;
let newIdNameList: Array<Map<number, string>> = [];
data.list.map((ticket: TicketListItem) => {
if (
ticket['status'] !== 3 &&
ticket['status'] !== 5 &&
ticket['status'] !== 7
) {
newIdNameList.push(
new Map([
[ticket['id'], ticket['device'] + ' ' + ticket['deviceModel']],
]),
);
}
});
if (data.list.length !== 0) {
data.list.map((ticket: TicketListItem) => {
if (
ticket['status'] !== 3 &&
ticket['status'] !== 5 &&
ticket['status'] !== 7
) {
newIdNameList.push(
new Map([
[ticket['id'], ticket['device'] + ' ' + ticket['deviceModel']],
]),
);
}
});
}
that.setState({
currentTicketsIdName: newIdNameList,
});
+4 -22
View File
@@ -20,28 +20,10 @@ export function getDutyInfo(that: MainPage) {
return;
}
const data = res.data.data;
if (data.isInDuty) {
that.setState({
rs: former.trans(true),
dutyData: {
isInDuty: data.isInDuty,
inDutyCnt: data.inDutyCnt,
currentDuty: data.currentDuty,
otherDutyTime: data.otherDutyTime,
place: data.place,
},
});
} else {
that.setState({
rs: former.trans(true),
dutyData: {
isInDuty: data.isInDuty,
offDutyReason: data.offDutyReason,
dutyRecoverTime: data.dutyRecoverTime,
place: data.place,
},
});
}
that.setState({
rs: former.trans(true),
dutyData: data,
});
})
.catch((err) => {
console.log(err.errMsg);
+12 -7
View File
@@ -13,19 +13,24 @@ export function getDisable(that: TicketDetail, id: number) {
})
.then((res) => {
const data = res.data.data;
let isDisable_main = that.state.isDisable_main;
if (data.status === 3 || data.status === 5 || data.status === 7) {
that.setState({
isRetrieveDisable_main: true,
isCommentDisable_main: true,
});
isDisable_main.retrieve = true;
isDisable_main.comment = true;
}
if (wechatUser.getAccess()) {
if (data.workers.includes(wechatUser.getInfo().name)) {
that.setState({
isPickDisable_main: true,
});
isDisable_main.pick = true;
}
}
that.setState({
isDisable_main: {
...that.state.isDisable_main,
retrieve: isDisable_main.retrieve,
comment: isDisable_main.comment,
pick: isDisable_main.pick,
},
});
})
.catch((reason) => {
console.log(reason.errMsg);
+12 -3
View File
@@ -8,7 +8,10 @@ const reLaunchInterval = 1000;
export function pickTicket(that: TicketDetail) {
that.setState({
isPickLoading: true,
isLoading: {
...that.state.isLoading,
pick: true,
},
});
Taro.request({
url: getUrl('/tickets/pick'),
@@ -21,7 +24,10 @@ export function pickTicket(that: TicketDetail) {
.then((res) => {
console.log(res.data);
that.setState({
isPickLoading: false,
isLoading: {
...that.state.isLoading,
pick: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.success,
@@ -36,7 +42,10 @@ export function pickTicket(that: TicketDetail) {
.catch((err) => {
console.log(err.errMsg);
that.setState({
isPickLoading: false,
isLoading: {
...that.state.isLoading,
pick: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.error + err.errMsg,
+16 -3
View File
@@ -1,7 +1,11 @@
import Taro from '@tarojs/taro';
import wechatUser from '@/wechat';
import { getUrl } from '.';
import { checkLogin, checkToken } from './checkLogin';
import { loginAte } from './login';
import { getInfo } from './getInfo';
export function pingAte(callback: (success: boolean) => void) {
export function pingAte() {
Taro.request({
url: getUrl('/ping'),
method: 'GET',
@@ -9,10 +13,19 @@ export function pingAte(callback: (success: boolean) => void) {
})
.then((res) => {
console.log(res.data);
callback(true);
checkLogin((success) => {
if (success) {
wechatUser.setToken(checkToken());
getInfo();
} else {
loginAte();
}
});
})
.catch((err) => {
console.log(err.errMsg);
callback(false);
Taro.reLaunch({
url: '/pages/404/404',
});
});
}
+12 -3
View File
@@ -8,7 +8,10 @@ const reLaunchInterval = 1000;
export function retrieve(that: TicketDetail) {
that.setState({
isRetrieveLoading: true,
isLoading: {
...that.state.isLoading,
retrieve: true,
},
});
Taro.request({
url: getUrl('/tickets/retrieve'),
@@ -21,7 +24,10 @@ export function retrieve(that: TicketDetail) {
.then((res) => {
console.log(res.data);
that.setState({
isRetrieveLoading: false,
isLoading: {
...that.state.isLoading,
retrieve: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.success,
@@ -36,7 +42,10 @@ export function retrieve(that: TicketDetail) {
.catch((err) => {
console.log(err.errMsg);
that.setState({
isRetrieveLoading: false,
isLoading: {
...that.state.isLoading,
retrieve: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.error + err.errMsg,
+12 -3
View File
@@ -8,7 +8,10 @@ const reLaunchInterval = 1000;
export function submitComment(that: TicketDetail) {
that.setState({
isCommentLoading: true,
isLoading: {
...that.state.isLoading,
comment: true,
},
});
Taro.request({
url: getUrl('/report'),
@@ -21,7 +24,10 @@ export function submitComment(that: TicketDetail) {
.then((res) => {
console.log(res.data);
that.setState({
isCommentLoading: false,
isLoading: {
...that.state.isLoading,
comment: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.success,
@@ -36,7 +42,10 @@ export function submitComment(that: TicketDetail) {
.catch((err) => {
console.log(err.errMsg);
that.setState({
isCommentLoading: false,
isLoading: {
...that.state.isLoading,
comment: false,
},
});
Taro.atMessage({
message: pt.get().button.submitText.error + err.errMsg,