From 9fa028fdac3517c2c2b167e52782f83185daa131 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 10 六月 2022 11:29:05 +0800
Subject: [PATCH] 2022-06-10

---
 src/templates/zshare/verifycard/index.jsx |   86 ++++++++++++++++++++++++++++++-------------
 1 files changed, 60 insertions(+), 26 deletions(-)

diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx
index b98a3c2..92034c5 100644
--- a/src/templates/zshare/verifycard/index.jsx
+++ b/src/templates/zshare/verifycard/index.jsx
@@ -3,6 +3,8 @@
 import { is, fromJS } from 'immutable'
 import { Form, Tabs, Row, Col, Radio, Button, Select, Popconfirm, notification, Modal, message, InputNumber, Tooltip, Typography } from 'antd'
 import { QuestionCircleOutlined, CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined, BorderOutlined } from '@ant-design/icons'
+import Toast from 'antd-mobile/es/components/toast'
+import Dialog from 'antd-mobile/es/components/dialog'
 import moment from 'moment'
 
 import Api from '@/api'
@@ -37,6 +39,7 @@
 
   state = {
     initsql: '',            // sql楠岃瘉鏃跺彉閲忓0鏄庡強璧嬪��
+    appType: sessionStorage.getItem('appType'),
     notes: [],              // 鐭俊妯℃澘
     setting: null,
     visible: false,
@@ -1273,35 +1276,66 @@
   }
 
   showError = (errorType) => {
+    const { verify, appType } = this.state
+
     if (errorType === 'S') {
-      notification.success({
-        top: 92,
-        message: '鎵ц鎴愬姛锛�',
-        duration: 2
-      })
+      let time = verify.stime || 2
+      if (appType === 'mob') {
+        Toast.show({ icon: 'success', content: '鎵ц鎴愬姛锛�', duration: time * 1000 })
+      } else {
+        notification.success({
+          top: 92,
+          message: '鎵ц鎴愬姛锛�',
+          duration: time
+        })
+      }
+      
     } else if (errorType === 'Y') {
-      Modal.success({
-        title: '鎵ц鎴愬姛锛�'
-      })
+      if (appType === 'mob') {
+        Dialog.alert({content: '鎵ц鎴愬姛锛�', confirmText: '鐭ラ亾浜�'})
+      } else {
+        Modal.success({
+          title: '鎵ц鎴愬姛锛�'
+        })
+      }
     } else if (errorType === 'F') {
-      notification.error({
-        className: 'notification-custom-error',
-        top: 92,
-        message: '鎵ц澶辫触锛�',
-        duration: 10
-      })
+      if (appType === 'mob') {
+        let time = verify.ftime || 3
+        Toast.show({ icon: 'fail', content: '鎵ц澶辫触锛�', duration: time * 1000 })
+      } else {
+        notification.error({
+          className: 'notification-custom-error',
+          top: 92,
+          message: '鎵ц澶辫触锛�',
+          duration: verify.ftime || 10
+        })
+      }
     } else if (errorType === 'N') {
-      notification.error({
-        top: 92,
-        message: '鎵ц澶辫触锛�',
-        duration: 10
-      })
+      if (appType === 'mob') {
+        let time = verify.ntime || 3
+        Toast.show({ content: '鎵ц澶辫触锛�', duration: time * 1000 })
+      } else {
+        notification.error({
+          top: 92,
+          message: '鎵ц澶辫触锛�',
+          duration: verify.ntime || 10
+        })
+      }
     } else if (errorType === 'E') {
-      Modal.error({
-        title: '鎵ц澶辫触锛�'
-      })
+      if (appType === 'mob') {
+        Dialog.alert({content: '鎵ц澶辫触锛�', confirmText: '鐭ラ亾浜�'})
+      } else {
+        Modal.error({
+          title: '鎵ц澶辫触锛�'
+        })
+      }
     } else if (errorType === 'NM') {
-      message.error('鎵ц澶辫触锛�')
+      if (appType === 'mob') {
+        let time = verify.ntime || 3
+        Toast.show({ content: '鎵ц澶辫触锛�', duration: time * 1000 })
+      } else {
+        message.error('鎵ц澶辫触锛�')
+      }
     }
   }
 
@@ -1454,7 +1488,7 @@
 
   render() {
     const { card } = this.props
-    const { verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes } = this.state
+    const { verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, appType } = this.state
     const formItemLayout = {
       labelCol: {
         xs: { span: 24 },
@@ -1742,7 +1776,7 @@
                 </Col>
                 <Col span={8}>
                   <Form.Item label={'鍋滅暀鏃堕棿'}>
-                    <InputNumber defaultValue={verify.ntime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
+                    <InputNumber defaultValue={verify.ntime || (appType === 'mob' ? 3 : 10)} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ntime')}} />
                   </Form.Item>
                 </Col>
               </Row>
@@ -1757,7 +1791,7 @@
                 </Col>
                 <Col span={8}>
                   <Form.Item label={'鍋滅暀鏃堕棿'}>
-                    <InputNumber defaultValue={verify.ftime || 10} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
+                    <InputNumber defaultValue={verify.ftime || (appType === 'mob' ? 3 : 10)} min={1} max={10000} precision={0} onChange={(val) => {this.timeChange(val, 'ftime')}} />
                   </Form.Item>
                 </Col>
               </Row>

--
Gitblit v1.8.0