Bladeren bron

feat:上线

lvkun 3 jaren geleden
bovenliggende
commit
b99c02ca06

+ 6 - 0
project.private.config.json

@@ -41,6 +41,12 @@
           "pathName": "pages/ScanResult/index",
           "query": "__key_=16273582146504",
           "scene": null
+        },
+        {
+          "name": "pages/AuthOpra/index",
+          "pathName": "pages/AuthOpra/index",
+          "query": "type=1&No=GT&__key_=16297091822202",
+          "scene": null
         }
       ]
     }

+ 38 - 4
src/pages/AuthOpra/index.scss

@@ -1,6 +1,11 @@
 @import "~taro-ui/dist/style/components/input.scss";
 @import "~taro-ui/dist/style/components/icon.scss";
 @import "~taro-ui/dist/style/components/action-sheet.scss";
+@import "~taro-ui/dist/style/components/toast.scss";
+.AuthOpra {
+    width: 100vw;
+    height: 100vh;
+}
    .AuthOpra-bg {
         width: 100vw;
         height: 362px;
@@ -24,9 +29,11 @@
         background: #F4F4F4;
         border-radius: 45px;
         border: none;
-        display: flex;
-        justify-content: center;
-        align-items: center;
+        text-align: center;
+        // display: flex;
+        // justify-content: center;
+        // align-items: center;
+        // text-align: center;
     }
     .at-input__container {
         width: 100%;
@@ -94,4 +101,31 @@
         font-weight: 500;
         color: #002F95;
     }
-}
+}
+
+.cus-wx-toast {
+    width: 460px;
+    height: 140px;
+    // line-height: 200px;
+    position: fixed;
+    top: 50%;
+    left: 50%;
+    transform: translate(-50%, -50%);
+    z-index: 1000;
+    background: rgba(0, 0, 0, 0.6);
+    border-radius: 40px;
+    padding: 20px 40px;
+    box-sizing: border-box;
+    font-size: 30px;
+    font-family: PingFangSC-Medium, PingFang SC;
+    font-weight: 500;
+    color: #FFFFFF;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    View {
+        text-align: center;
+        width: 420px;
+    }
+}

+ 42 - 14
src/pages/AuthOpra/index.tsx

@@ -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>
     )
 }

+ 4 - 7
src/pages/ScanQrcode/index.tsx

@@ -3,12 +3,11 @@ import { View, Text, Image, Icon } from '@tarojs/components'
 import { AtInput, AtCurtain , AtIcon } from 'taro-ui'
 
 import Taro from '@tarojs/taro'
+
 import './index.scss'
 
 import NavBar from '@/components/NavBar'
 
-
-
 import type { modalProps, authQrcodeType } from './data'
 
 import { authQrcode } from '../../api/qrcode'
@@ -44,7 +43,6 @@ const Modal: React.FC<modalProps> = ({visable, closeModal, errorCode}) => {
                             <View className='desc' >请填写正确的数字条形码~</View>
                         </View>
                     </View>
-                    
                 )
         }
     }
@@ -93,7 +91,7 @@ const ScanQrcode: React.FC = () => {
                 AuthQrcode(result)
             },
             fail: () => {
-                Tip.toast('图片不是条形码或者二维码',  'none', 3000 )
+                // Tip.toast('图片不是条形码或者二维码',  'none', 3000 )
             }
         })
     } 
@@ -139,8 +137,8 @@ const ScanQrcode: React.FC = () => {
 
     return (
         <View className='ScanQrcode'>
-            <NavBar 
-              icon={<AtIcon value='chevron-left' size='30rpx' color='#000'  />}  
+            <NavBar
+              icon={<AtIcon value='chevron-left' size='30rpx' color='#000'  />}
               title='' 
               background='#fff'
               fixed={false}
@@ -163,7 +161,6 @@ const ScanQrcode: React.FC = () => {
             <View className='query-btn' onClick={() => AuthQrcode(code)}>立即查询</View>
 
             {/* 验证方法 */}
-
             <View className='verify'>
                 <View className='header'>  
                     <View className='flag'></View>

+ 1 - 1
src/pages/ScanResult/index.tsx

@@ -159,7 +159,7 @@ const ScanResult: React.FC = ({}) => {
                             </View>
                             {/* buttong */}
                             {
-                                RenderButton(item, index)
+                                RenderButton(item, 1)
                             }
                         </View>
                     ))

+ 1 - 4
src/pages/ShopCate/index.tsx

@@ -19,16 +19,13 @@ const ShopCate: React.FC = () => {
     const [shopList, setShopList] = useState<shopListType[]>([])
 
     // 跳转页面
-
     const goPage = (): void => {
-        Taro.navigateTo({
+        Taro.redirectTo({
              url: '/pages/ScanResult/index'
         });
     }
 
-
     // 获取商品
-
     const GetGoodsList = useCallback(async (): Promise<void> => {
 
         Tip.loading('努力加载中~')

+ 3 - 0
src/pages/index/index.tsx

@@ -38,6 +38,8 @@ const Index: React.FC = () => {
 
   // 跳转页面
   const goPage = ( index: number ): void => {
+    console.log(index, 'indexindexindexindexindexindex');
+    
     if (!Taro.getStorageSync('token')) {
       Tip.toast('登录错误')
       return
@@ -47,6 +49,7 @@ const Index: React.FC = () => {
         Taro.navigateTo({
            url: '/pages/ScanQrcode/index'
         });
+        break
       case 1:
         Taro.navigateTo({
            url: '/pages/AuthQuery/index'