|
@@ -1,17 +1,20 @@
|
|
|
import React, { useEffect, useState } from 'react'
|
|
|
|
|
|
-import { View, Image, Text } from '@tarojs/components'
|
|
|
-import { AtInput, AtIcon, AtActionSheet, AtActionSheetItem } from 'taro-ui'
|
|
|
+import { View, Image, Text, Input } from '@tarojs/components'
|
|
|
+import { AtInput, AtIcon, AtActionSheet, AtActionSheetItem , AtToast } from 'taro-ui'
|
|
|
import Taro from '@tarojs/taro';
|
|
|
|
|
|
import { baseUrl } from '@/service/config'
|
|
|
|
|
|
import { queryCertificate, queryCertificateFile , queryInfoByCompanyOrPerson} from '../../api/auth'
|
|
|
|
|
|
+import Tip from '@/utils/tip';
|
|
|
+
|
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
+
|
|
|
+
|
|
|
import './index.scss'
|
|
|
-import Tip from '@/utils/tip';
|
|
|
|
|
|
|
|
|
const SheetItem = [
|
|
@@ -40,6 +43,10 @@ const AuthOpra: React.FC = (props) => {
|
|
|
|
|
|
// 编号前缀
|
|
|
const [ NoPrefix, setNoPrefix ] = useState<string>('')
|
|
|
+
|
|
|
+ const [ isOpened, setIsOpened ] = useState<boolean>(false)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
useEffect( () => {
|
|
|
|
|
@@ -48,7 +55,11 @@ const AuthOpra: React.FC = (props) => {
|
|
|
|
|
|
}, [])
|
|
|
|
|
|
- const onChange = (e: React.SetStateAction<string> ) => setLabel(e)
|
|
|
+ const onChange = (e) => {
|
|
|
+ console.log(e, 'e');
|
|
|
+
|
|
|
+ setLabel(e.detail.value)
|
|
|
+ }
|
|
|
|
|
|
// 查询证书
|
|
|
const QueryCertificate = async ( ) => {
|
|
@@ -56,11 +67,17 @@ const AuthOpra: React.FC = (props) => {
|
|
|
query: label,
|
|
|
typeId: type
|
|
|
}
|
|
|
-
|
|
|
+ if (label.length === 0) return
|
|
|
+
|
|
|
const data = await queryInfoByCompanyOrPerson($par)
|
|
|
|
|
|
if (data === null || !data.hasOwnProperty('startTime')) {
|
|
|
- Tip.toast('没有查询到对应合同', 'none')
|
|
|
+ // Tip.toast(`暂未查询到该公司品牌认证信息\r\n请联系相关工作人员`, 'none')
|
|
|
+ setIsOpened(true)
|
|
|
+ const timeID = setTimeout(() => {
|
|
|
+ setIsOpened(false)
|
|
|
+ clearTimeout(timeID)
|
|
|
+ }, 2500);
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -126,7 +143,15 @@ const AuthOpra: React.FC = (props) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ // 模仿微信弹窗
|
|
|
+ const WxToast = () => {
|
|
|
+ return (
|
|
|
+ <View className='cus-wx-toast' >
|
|
|
+ <View>暂未查询到该公司品牌认证信息</View>
|
|
|
+ <View>请联系相关工作人员</View>
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
// 渲染输入框
|
|
|
const renderInputArea = () => {
|
|
@@ -141,13 +166,13 @@ const AuthOpra: React.FC = (props) => {
|
|
|
</View>
|
|
|
</View>
|
|
|
} */}
|
|
|
- <AtInput
|
|
|
+ <Input
|
|
|
name='value'
|
|
|
value={label}
|
|
|
- onChange={onChange}
|
|
|
+ onInput={onChange}
|
|
|
className='Atinput'
|
|
|
- placeholderStyle='color: #666666;'
|
|
|
- placeholder='请输入门店名称/证书编号'
|
|
|
+ placeholderStyle='color: #666666; text-align: center;'
|
|
|
+ placeholder='请输入公司名称'
|
|
|
/>
|
|
|
|
|
|
<View className='button' onClick={QueryCertificate}>
|
|
@@ -176,8 +201,11 @@ const AuthOpra: React.FC = (props) => {
|
|
|
src={require(`../../assets/authOpra/type${type === 1 ? 0 : 5}.png`)}
|
|
|
/>
|
|
|
{ renderInputArea()}
|
|
|
-
|
|
|
- {/* 扫描 */}
|
|
|
+ {
|
|
|
+ isOpened ? <WxToast /> : null
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
{/* <View className='scan-button' onClick={dispatchWxCamera}>
|
|
|
<View>
|
|
@@ -185,7 +213,7 @@ const AuthOpra: React.FC = (props) => {
|
|
|
</View>
|
|
|
<Text >扫描</Text>
|
|
|
</View> */}
|
|
|
-
|
|
|
+ {/* <AtToast isOpened={isOpened} onClose={() => setIsOpened(false)} text='暂未查询到该公司品牌认证信息请联系相关工作人员'></AtToast> */}
|
|
|
</View>
|
|
|
)
|
|
|
}
|