Pārlūkot izejas kodu

fix:各种问题

lvkun 3 gadi atpakaļ
vecāks
revīzija
ab07937f2a

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 432 - 478
package-lock.json


+ 1 - 0
package.json

@@ -41,6 +41,7 @@
     "@tarojs/react": "3.0.18",
     "@tarojs/runtime": "3.0.18",
     "@tarojs/taro": "^3.0.18",
+    "dayjs": "^1.10.6",
     "lodash": "4.17.15",
     "react": "^16.10.0",
     "react-dom": "^16.10.0",

+ 51 - 25
project.config.json

@@ -1,26 +1,52 @@
 {
-	"miniprogramRoot": "dist/",
-	"projectname": "agent-auth-react",
-	"description": "",
-	"appid": "touristappid",
-	"setting": {
-		"urlCheck": true,
-		"es6": false,
-		"postcss": false,
-		"preloadBackgroundData": false,
-		"minified": false,
-		"newFeature": true,
-		"autoAudits": false,
-		"coverView": true,
-		"showShadowRootInWxmlPanel": false,
-		"scopeDataCheck": false,
-		"useCompilerModule": false
-	},
-	"compileType": "miniprogram",
-	"simulatorType": "wechat",
-	"simulatorPluginLibVersion": {},
-	"condition": {},
-	"compilerOptions": {
-		"paths": { "@": ["./src"] }
-	}
-}
+  "miniprogramRoot": "dist/",
+  "projectname": "agent-auth-react",
+  "description": "",
+  "appid": "wxa2a88149778755c4",
+  "setting": {
+    "urlCheck": false,
+    "es6": false,
+    "enhance": false,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": false,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "enableEngineNative": false,
+    "useIsolateContext": true,
+    "useCompilerModule": false,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "compileType": "miniprogram",
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "compilerOptions": {
+    "paths": {
+      "@": [
+        "./src"
+      ]
+    }
+  },
+  "condition": {}
+}

+ 48 - 0
project.private.config.json

@@ -0,0 +1,48 @@
+{
+  "setting": {},
+  "condition": {
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "name": "pages/AuthOpra/index",
+          "pathName": "pages/AuthOpra/index",
+          "query": "type=0&__key_=16258148111122",
+          "scene": null
+        },
+        {
+          "name": "pages/AuthQuery/index",
+          "pathName": "pages/AuthQuery/index",
+          "query": "__key_=16260581158361",
+          "scene": null
+        },
+        {
+          "name": "pages/AuthOpra/index",
+          "pathName": "pages/AuthOpra/index",
+          "query": "type=1&__key_=16260702285962",
+          "scene": null
+        },
+        {
+          "name": "pages/AuthQuery/index",
+          "pathName": "pages/AuthQuery/index",
+          "query": "__key_=16273498749021",
+          "scene": null
+        },
+        {
+          "name": "pages/ScanResult/index",
+          "pathName": "pages/ScanResult/index",
+          "query": "__key_=16273582146504",
+          "scene": null
+        }
+      ]
+    }
+  }
+}

+ 12 - 0
src/api/auth.ts

@@ -30,3 +30,15 @@ export const queryCertificateFile = (data: queryCertificateFileType) => {
 }
 
 
+
+
+/**
+ * @description 查詢某一個公司,根據法人或者公司名稱
+ */
+
+ export const queryInfoByCompanyOrPerson = ( {query, typeId} ) => {
+    return request({
+        url: `/verify/certificate/queryInfoByCompanyOrPerson/${typeId}/${query}`,
+        method: 'GET'
+    })
+}

+ 12 - 1
src/api/user.ts

@@ -83,4 +83,15 @@ export const getManual = (data: getManualType[]) => {
         method: 'POST',
         data
     })
-}
+}
+
+/**
+ * @description 查询所有分类
+ */
+
+ export const getQueryAllCustomerType = () => {
+    return request({
+        url: `/verify/certificate/queryAllCustomerType`,
+        method: 'GET'
+    })
+}

BIN
src/assets/AuthResult/book.png


BIN
src/assets/AuthResult/zhengshu.jpg


BIN
src/assets/authOpra/type4.png


BIN
src/assets/authOpra/type5.png


BIN
src/assets/home/bg.png


BIN
src/assets/home/qrcode.png


+ 2 - 1
src/components/NavBar/data.d.ts

@@ -4,6 +4,7 @@ declare namespace NavBar {
         fontSize?: number,
         color?: string,
         background?: string,
-        icon?: React.ReactElement
+        icon?: React.ReactElement,
+        fixed: boolean
     }
 }

+ 6 - 2
src/components/NavBar/index.scss

@@ -1,4 +1,8 @@
+@import "~taro-ui/dist/style/components/icon.scss";
 .custom-navbar {
+    position: fixed;
+    top: 0;
+    left: 0;
  .empty {
 
  }
@@ -11,8 +15,8 @@
      .icon {
          position: absolute;
          top: 50%;
-         left: 5%;
-         transform: translate(-50%, -50%);
+         left: 32rpx;
+         transform: translateY(-50%);
      }
  }
 }

+ 10 - 7
src/components/NavBar/index.tsx

@@ -10,7 +10,8 @@ const NavBar: React.FC<NavBar.NavBarProps> = (
         fontSize,
         color,
         icon,
-        background
+        background,
+        fixed
     }
     ) => {
 
@@ -31,18 +32,20 @@ const NavBar: React.FC<NavBar.NavBarProps> = (
 
     useEffect( () => {
         getNavBarHeight()
-        text().then( res => {
-            console.log(res, 'res');
-            
-        })
     }, [])
 
+    const goBack = () => {
+        Taro.navigateBack({
+            delta: 1
+        })
+    }
+
     return (
-        <view className='custom-navbar' style={{ background }}>
+        <view className='custom-navbar' style={{ background, position: fixed ? 'fixed' : 'initial' }}>
             <view className='empty' style={{height: statusBarHeight + 2 + 'px'}} />
             <view className='NavBar' style={{height:  (boundingData.top - statusBarHeight) * 2 + boundingData.height + 'px' }}>
                <text> { title } </text>
-               <view className='icon'>
+               <view className='icon' onClick={goBack}>
                     {icon}
                </view>
             </view>

+ 5 - 0
src/pages/AuthOpra/index.scss

@@ -28,6 +28,11 @@
         justify-content: center;
         align-items: center;
     }
+    .at-input__container {
+        width: 100%;
+        display: flex;
+        text-align: center;
+    }
     .at-input  {
         padding: 0;
         border: none;

+ 75 - 31
src/pages/AuthOpra/index.tsx

@@ -3,9 +3,16 @@ import React, { useEffect, useState } from 'react'
 import { View, Image, Text } from '@tarojs/components'
 import { AtInput, AtIcon, AtActionSheet, AtActionSheetItem   } from 'taro-ui'
 import Taro from '@tarojs/taro';
+
+import { baseUrl } from '@/service/config'
+
+import { queryCertificate, queryCertificateFile , queryInfoByCompanyOrPerson} from '../../api/auth'
+
+import dayjs  from 'dayjs'
+
 import './index.scss'
+import Tip from '@/utils/tip';
 
-import { queryCertificate, queryCertificateFile } from '../../api/auth'
 
 const SheetItem = [
     {
@@ -28,36 +35,74 @@ const AuthOpra: React.FC = (props) => {
     
     const [label, setLabel] = useState<string>('')
 
-
     // 弹窗
     const [visible, setVisible] = useState<boolean>(false)
+    
+    // 编号前缀
+    const [ NoPrefix, setNoPrefix ] = useState<string>('')
+
+    useEffect( () => {
+        
+        setType(Number(Taro.getCurrentInstance().router?.params.type))
+        setNoPrefix(Taro.getCurrentInstance().router?.params.No as string)
+    
+    }, []) 
 
     const onChange = (e: React.SetStateAction<string> ) => setLabel(e)
 
     // 查询证书
-    const QueryCertificate = async (): Promise<void> => {
-        Taro.navigateTo({
-             url: '/pages/AuthResult/index'
-        });
-    //   const data = await queryCertificate({label, typeId: type})
-      
-    //   console.log(data);
-      
-    }  
+    const QueryCertificate = async ( )  => {
+        const $par = {
+            query: label,
+            typeId: type
+        }
+        
+        const data = await queryInfoByCompanyOrPerson($par)
+
+        if (data === null || !data.hasOwnProperty('startTime')) {
+            Tip.toast('没有查询到对应合同', 'none')
+            return
+        }
+
+        const $records = {
+            ...data,
+            startTime: dayjs(data.startTime).format('YYYY年MM月DD日'),
+            endTime: dayjs(data.endTime).format('YYYY年MM月DD日'),
+            No: NoPrefix + dayjs(data.startTime).format('YYYYMMDD') + '001'
+        }
+
+        goAuthResultPage($records)
+
+    }
 
     // 上传证书url
-    const QueryCertificateFile = async (fileUrl: string, typeId: number): Promise<void> => {
-        const data = await queryCertificateFile({fileUrl, typeId})
+    const QueryCertificateFile = async (fileUrl: string, typeId: number) => {
+
+        const data = await queryCertificateFile({fileUrl: String(fileUrl), typeId})
         console.log(data);
+
+        goAuthResultPage(data)
+        
+    }
+
+    // 去证书结果页面
+    const goAuthResultPage = (data?) => {
+        const encode = encodeURIComponent( JSON.stringify(data) )
+        Taro.navigateTo({
+            url: `/pages/AuthResult/index?result=${encode}`
+        })
     }
 
     // 调起微信的拍照或者相册选择证书
     const dispatchWxCamera = () => {
         Taro.chooseImage({
+            count: 1,
+            sizeType: ['original', 'compressed'],
+            sourceType: ['album', 'camera'],
             success: res => {
                 const tempFilePaths = res.tempFilePaths
                 Taro.uploadFile({
-                    url: 'http://training.luojigou.vip/training/file/uploadFile',
+                    url:  baseUrl + '/verify/certificate/uploadFileTemp',
                     filePath: tempFilePaths[0],
                     name: 'file',
                     header: {
@@ -66,21 +111,20 @@ const AuthOpra: React.FC = (props) => {
                     formData: {
                         'user': 'test'
                     },
-                    success: (uploadFileRes) => {
-                        QueryCertificateFile(uploadFileRes.data, type)
+                    success: (uploadFileRes) => {;
+                        
+                        QueryCertificateFile(JSON.parse(uploadFileRes.data).data, type)
                     }
                 });
             }
         })
     }  
 
-
-    
-    useEffect( () => {
-
-        setType(Number(Taro.getCurrentInstance().router?.params.type))
-
-    }, []) 
+    // 改变体验馆查询的分类
+    const explorationType = (records) => {
+        console.log(records);
+        
+    }
 
     
 
@@ -88,15 +132,15 @@ const AuthOpra: React.FC = (props) => {
     const renderInputArea = () => {
         return (
             <View className='renderInputArea'>
-                {
+                {/* {
                     type === 1 && 
                     <View className='select' onClick={() => setVisible(true)}>
                         <View >
                             <Text>请选择逻辑狗思维体验馆</Text>
-                            {/* <AtIcon value='play' size='30' customStyle={{color: '#000'}}></AtIcon> */}
+                            <AtIcon value='play' size='30' customStyle={{color: '#000'}}></AtIcon>
                         </View>
                     </View>
-                }
+                } */}
                 <AtInput
                   name='value'
                   value={label}
@@ -110,10 +154,10 @@ const AuthOpra: React.FC = (props) => {
                     立即查询
                 </View>
 
-                <AtActionSheet isOpened={visible}>
+                <AtActionSheet isOpened={visible} onClose={() => setVisible(false)} >
                     {
                         SheetItem.map( item => (
-                            <AtActionSheetItem key={item.typeId}>
+                            <AtActionSheetItem key={item.typeId} onClick={() => explorationType(item)} >
                                 {item.label}
                             </AtActionSheetItem>
                         ))
@@ -129,18 +173,18 @@ const AuthOpra: React.FC = (props) => {
             <Image
               mode='aspectFill'
               className='AuthOpra-bg'
-              src={require(`../../assets/authOpra/type${type}.png`)}
+              src={require(`../../assets/authOpra/type${type === 1 ? 0 : 5}.png`)}
             />
             { renderInputArea()}
 
             {/* 扫描 */}
 
-            <View className='scan-button' onClick={dispatchWxCamera}>
+            {/* <View className='scan-button' onClick={dispatchWxCamera}>
                 <View>
                     <Image style={{width: 15, height: 15, marginRight: 13, display: 'block'}} src={require('../../assets/authOpra/scan-icon.png')}></Image>
                 </View>
                 <Text >扫描</Text>    
-            </View>
+            </View> */}
 
         </View>
     )

+ 50 - 11
src/pages/AuthQuery/index.tsx

@@ -1,26 +1,59 @@
-import React from 'react'
+import React, { useEffect, useState } from 'react'
 
-import { AtGrid } from "taro-ui"
-import { Image, View } from '@tarojs/components' 
+import { Image, View } from '@tarojs/components'
 
 import Taro from '@tarojs/taro'
 
+import { getQueryAllCustomerType } from '@/api/user'
+
+import NavBar from '@/components/NavBar/index'
+
+import { AtIcon } from 'taro-ui'
+
 import './index.scss'
 
 import bg from '../../assets/authQuery/auth-bg.png'
 import step from '../../assets/authQuery/three-step.png'
 
-console.log(bg);
-
+const gridList = [{id: 0, No: 'GT'}, {id: 3, No: 'GX'}]
 
-const gridList = new Array(5).fill(0)
+interface CustomerType {
+    id: number,
+    name: string,
+    
+    pId: number
+}
 
 const CateGrid: React.FC = () => {
 
-    const goPage = (index: number): void => {
+    useEffect(() => {
+        GetQueryAllCustomerType()
+    }, [])
+
+    const [ customerType, setCustomerType ] = useState<CustomerType[]>([])
+
+    const goPage = (records ): void => {
+        let type:number
+        if (records.id === 0) {
+            type = customerType[0].id
+        } else {
+            type = customerType[1].id
+        }
+
         Taro.navigateTo({
-             url: `/pages/AuthOpra/index?type=${index}`
+             url: `/pages/AuthOpra/index?type=${type}&No=${records.No}`
         });
+
+    }
+
+    /**
+     * @description 获取产品分类
+     */
+
+    const GetQueryAllCustomerType = async () => {
+      const data =  await getQueryAllCustomerType()
+      console.log(data);
+      setCustomerType(data)
     }
 
     return (
@@ -28,10 +61,10 @@ const CateGrid: React.FC = () => {
             { 
                 gridList.map((item, index) => (
                     <Image 
-                      key={item} 
+                      key={item.id} 
                       className='gridImg' 
-                      src={require(`../../assets/authQuery/auth${index}.png`)}
-                      onClick={() => goPage(index)}
+                      src={require(`../../assets/authQuery/auth${item.id}.png`)}
+                      onClick={() => goPage(item)}
                     />
                 ))
             }
@@ -43,6 +76,12 @@ const CateGrid: React.FC = () => {
 const AuthQuery: React.FC = () => {
     return (
         <View className='AuthQuery'>
+            <NavBar 
+              fixed 
+              title='' 
+              icon={<AtIcon value='chevron-left' size='30rpx' color='#fff'  />
+            }
+            />
             <Image className='AuthQuery-img' src={bg} />
             <Image className='step'  src={step} mode='aspectFill' />
             <CateGrid />

+ 6 - 4
src/pages/AuthResult/index.scss

@@ -1,7 +1,8 @@
 .AuthResult {
     width: 100vw;
-    min-height: 100vh;
+    height: 120vh;
     background: #FFFFFF;
+    padding-bottom: 400px;
     .bg {
         width: 100vw;
         height: 376px;    
@@ -11,7 +12,6 @@
 
 .company {
     width: 686px;
-    height: 726px;
     background: #FFFFFF;
     box-shadow: 0px 12px 22px 0px rgba(175, 207, 220, 0.24);
     border-radius: 20px;
@@ -20,6 +20,7 @@
     position: relative;
     z-index: 1;
 
+
     .header {
         font-size: 28px;
         font-family: PingFangSC-Semibold, PingFang SC;
@@ -45,6 +46,8 @@
         color: #002F95;
         text-align: center;
         margin-top: 38px;
+        padding: 0 32rpx;
+        box-sizing: border-box;
     }
     .company-desc {
         font-size: 28px;
@@ -61,7 +64,7 @@
         height: 444px;
         position: relative;
         .business-license {
-            width: 258px;
+            width: 512px;
             height: 362px;
             position: absolute;
             top: 50%;
@@ -106,7 +109,6 @@
     .chapter-img {
         width: 614px;
         height: 428px;
-        
         margin-top: 22px;
     
     }

+ 164 - 10
src/pages/AuthResult/index.tsx

@@ -1,32 +1,181 @@
-import React from 'react'
+import React, { useEffect, useState } from 'react'
 
-import { View, Image, Text } from '@tarojs/components'
+import { View, Image, Text , Canvas} from '@tarojs/components'
+
+import Taro from '@tarojs/taro'
+
+import NavBar from '@/components/NavBar'
+
+import { AtIcon } from 'taro-ui'
 
 import './index.scss'
+import Tip from '@/utils/tip'
+
+const imgUrl = require('@/assets/AuthResult/zhengshu.jpg')
+
+// {
+//     "website": "91110105MA00BL6M2J",
+//     "address": "北京市,北京市,房山区",
+//     "filePath": "https://agent-crm.luojigou.vip/crm-api/20210721/Flv4ikdcbhDqQ4G68w8Jr7EudMid.jpg",
+//     "detailAddress": "北京市房山区218路88888",
+//     "company": "北京呵呵小哥科技有限公司",
+//     "faren": "呵呵大哥",
+//     "startTime": '2021年09月08日',
+//     "endTime": '2021年09月08日',
+//     "No": 'jx20200622001'
+// }
 
 const AuthResult: React.FC = () => {
     
+    const [ result, setResult ] = useState<Record<string, any>>({})
+
+    const [ canvasUrl, setCanvasUrl ] = useState<string>('')
+    
+    useEffect(() => { 
+      const _result = JSON.parse(decodeURIComponent(Taro.getCurrentInstance().router?.params.result as string)) 
+      setResult(_result)
+      console.log(_result, 'result');
+      
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+    }, [])
+
+    Taro.useReady( () => {
+
+        setTimeout(() => {
+ 
+        Tip.loading('生成证书中')
+        const query = Taro.createSelectorQuery()
+        query.select('#myCanvas')
+          .fields({ node: true, size: true })
+          .exec((res) => {
+            console.log(res, 'resresres');
+            
+            const width = res[0].width;     // 获取canvas的最终宽度与高度
+
+            const height = res[0].height;
+
+            const canvas = res[0].node 
+            
+            setTimeout(() => {
+
+                const ctx = canvas.getContext('2d')
+
+                const dpr = Taro.getSystemInfoSync().pixelRatio;  // 获取设备的像素比
+
+                console.log(dpr, 'dpr');
+                
+                canvas.width = width * dpr;
+                canvas.height = height * dpr;
+    
+                ctx.scale(dpr, dpr);
+    
+                const bgImg = canvas.createImage()
+                
+                bgImg.src = imgUrl
+
+                bgImg.onload = () => {
+                    
+                    ctx.drawImage( bgImg, 0, 0, width ,  height);
+
+                    // 证书编号
+                    ctx.font =  "600 " + "4px" + " PingFangSC-Semibold, PingFang SC";
+
+                    ctx.fillStyle = "greey";
+
+                    ctx.fillText(result.No, 148, 52 )
+
+                    // 公司名称
+                    ctx.font = "600 " + "10px" + " PingFangSC-Semibold, PingFang SC";
+
+                    ctx.fillStyle = "greey";
+
+                    const title: string = result.company
+
+                    const titleX = 307 / 2 - (9.6 * title.length / 2 )
+
+                    ctx.fillText( title, titleX, 118);
+
+                    // 统一社会信用代码
+                        
+                    ctx.font = " 600 " + "4px" + " PingFangSC-Semibold, PingFang SC";
+
+                    ctx.fillStyle = "#666";  // canvas 文字颜色
+                    
+                    ctx.fillText( result.website, 123, 128);  // canvas 文字
+
+                    // 法人
+                    ctx.font = " 600 " + "4px" + "PingFangSC-Semibold, PingFang SC";
+                    ctx.fillStyle = "#666";
+                    ctx.fillText( result.faren, 190, 128);
+                    
+
+                    // 注册地址
+                    ctx.font = " 600 " + "4px" + "PingFangSC-Semibold, PingFang SC";
+                    ctx.fillStyle = "#666";  
+                    ctx.fillText( result.address.split(',').join('') + result.detailAddress, 110, 136);
+
+                    // 地区
+                    ctx.font = " 600 " + "4px" + " PingFangSC-Semibold, PingFang SC";
+                    ctx.fillStyle = "#666";  
+                    ctx.fillText( result.address.split(',').join('') , 146, 144);
+
+                    // 起始年
+                    ctx.font = " 600 " + "4px" + " PingFangSC-Semibold, PingFang SC";
+                    ctx.fillStyle = "#666";
+                    ctx.fillText( result.startTime, 112, 151);
+
+                    // 结束年
+                    ctx.font = " 600 " + "4px" + " PingFangSC-Semibold, PingFang SC";
+                    ctx.fillStyle = "#666";  
+                    ctx.fillText( result.endTime, 178, 151);
+      
+                    setCanvasUrl(canvas.toDataURL())
+                    Tip.loaded()
+                } 
+            }, 1000);
+          })
+        }, 0);
+    })
+
+    const openImagePriview = (url) => {
+        console.log(url, 'url');
+        
+        Taro.previewImage({
+            current: url,
+            urls: [url]
+        })
+    }
+
+
     return (
         <View className='AuthResult'>
+            <NavBar 
+              icon={<AtIcon value='chevron-left' size='30rpx' color='#fff'  />}
+              title=''
+              fixed
+            />
             <Image className='bg' src={require('../../assets/AuthResult/bg.png')} />
 
             {/* 合作商卡片 */}
-            <View className='company'>
+            <View className='company' style={{height: result.filePath ? '726rpx' : '', paddingBottom: result.filePath ? '' : '50rpx'}}>
                 <View className='header'>
                     已通过中德智慧官方认证合作商
                 </View>
                 <View className='line'></View>
 
                 <View className='company-name'>
-                    上海金桥国际龙有限公司
+                    {result.company}
                 </View>
                 <View className='company-desc'>
-                    上海金桥国际龙有限公司
-                </View>
-                <View className='certificate'>
-                    <Image className='business-license' src={require('../../assets/AuthResult/book1.png')} />
-                    <Image className='chapter' src={require('../../assets/AuthResult/chapter.png')} />
+                    {/* {result.business_scope} */}
                 </View>
+                {
+                   result.filePath && <View className='certificate' onClick={() => openImagePriview(result.filePath)}>
+                     <Image className='business-license' mode='aspectFill' src={result.filePath} />
+                     <Image className='chapter' src={require('../../assets/AuthResult/chapter.png')} />
+                    </View>
+                }
+               
             </View>
 
             {/* 证书 */}
@@ -35,7 +184,12 @@ const AuthResult: React.FC = () => {
                     <Image className='dog' src={require('../../assets/AuthResult/dog.png')} />
                     <Text>中德智慧教育官方授权品牌认证证书</Text>
                 </View>
-                <Image className='chapter-img' src={require('../../assets/AuthResult/book.png')} />
+                <Canvas 
+                  type='2d' 
+                  id='myCanvas' 
+                  style={{width: '307px', height: '214px', marginTop: '11px'}}
+                  onClick={()=> openImagePriview(canvasUrl)}
+                />
             </View>
         </View>
     )

+ 2 - 1
src/pages/ScanQrcode/index.config.ts

@@ -1,3 +1,4 @@
 export default {
-    navigationBarTitleText: '查询真伪',
+    navigationBarTitleText: '',
+    navigationStyle: 'custom'
 }

+ 8 - 1
src/pages/ScanQrcode/index.scss

@@ -4,7 +4,6 @@
     width: 100vw;
     height: 100vh;
     background: #F9F9F9;
-    padding: 0 24px;
     overflow: hidden;
     box-sizing: border-box;
 }
@@ -14,6 +13,9 @@
     display: flex;
     justify-content: space-between;
     align-items: center;
+    
+    padding: 0 24px;
+    box-sizing: border-box;
     .left {
         font-size: 44px;
         font-family: PingFangSC-Medium, PingFang SC;
@@ -29,6 +31,7 @@
 }
 
 .Atinput-box {
+    padding: 0 24px;
     width: 702px;
     height: 114px;
     background: #FFFFFF;
@@ -40,6 +43,7 @@
     padding: 32px 48px;
     box-sizing: border-box;
     margin: 66px 0;
+    margin-left: 32px;
     .placeholder-class {
         color: #666666;
         font-size: 28px;
@@ -74,6 +78,7 @@
     box-shadow: 0px 4px 20px 0px rgba(0, 47, 149, 0.52);
     border-radius: 176px;
     margin: 0 auto;
+    padding: 0 24px;
     font-size: 32px;
     font-family: PingFangSC-Medium, PingFang SC;
     font-weight: 500;
@@ -86,6 +91,7 @@
 
 .verify {
     margin-top: 134px;
+    padding: 0 24px;
     .header {
         display: flex;
         justify-content: flex-start;
@@ -158,6 +164,7 @@
     justify-content: center;
     align-items: center;
     margin: 0 auto;
+    margin-top: -100px;
     Image {
 
     }

+ 23 - 8
src/pages/ScanQrcode/index.tsx

@@ -1,10 +1,12 @@
 import React, { useState, useEffect, useCallback } from 'react'
 import { View, Text, Image, Icon } from '@tarojs/components'
-import { AtInput, AtCurtain } from 'taro-ui'
+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'
@@ -87,8 +89,8 @@ const ScanQrcode: React.FC = () => {
         Taro.scanCode({
             success: res => {
                 console.log(res);
-                const { rawData } = res
-                AuthQrcode(rawData)
+                const { result } = res
+                AuthQrcode(result)
             },
             fail: () => {
                 Tip.toast('图片不是条形码或者二维码',  'none', 3000 )
@@ -98,10 +100,16 @@ const ScanQrcode: React.FC = () => {
 
     // 查询二维码
     const AuthQrcode = useCallback(async (params: string = ''): Promise<void> => {
-
+        console.log(params, 'params');
+        
+        if (params.length === 0) return
         Taro.setStorageSync('goodsTypePdfId',  params || code)
         
-        const data = await authQrcode(params || code)
+        Tip.loading('查询中')
+
+        const data = await authQrcode( params || code)
+
+        Tip.loaded()
 
         const {errorCode: ErrorCode, goodsParentType, isNewCode } = data as unknown as authQrcodeType
         setErrorCode(ErrorCode)
@@ -118,6 +126,7 @@ const ScanQrcode: React.FC = () => {
         if (errorCode !== -1) {
             openModal()
         }
+        
     }, [code, errorCode])
 
 
@@ -130,13 +139,19 @@ const ScanQrcode: React.FC = () => {
 
     return (
         <View className='ScanQrcode'>
+            <NavBar 
+              icon={<AtIcon value='chevron-left' size='30rpx' color='#000'  />}  
+              title='' 
+              background='#fff'
+              fixed={false}
+            />
             <View className='header'>
                 <Text className='left'>输入/扫描数字条形码 </Text>
                 <Text className='right' onClick={goPage}>查询记录</Text>
             </View>
             <View className='Atinput-box'>
                 <AtInput 
-                  name='qrcode' 
+                  name='qrcode'
                   className='Atinput'
                   onChange={onChange}
                   value={code}
@@ -145,12 +160,12 @@ const ScanQrcode: React.FC = () => {
                 />
                 <Image className='scan-icon' onClick={scanQrcode} src={require('../../assets/ScanQrcode/scan-icon.png')}></Image>
             </View>
-            <View className='query-btn' onClick={() => AuthQrcode()}>立即查询</View>
+            <View className='query-btn' onClick={() => AuthQrcode(code)}>立即查询</View>
 
             {/* 验证方法 */}
 
             <View className='verify'>
-                <View className='header'> 
+                <View className='header'>  
                     <View className='flag'></View>
                     <Text>验证方法</Text>
                 </View>

+ 5 - 8
src/pages/ScanResult/index.tsx

@@ -12,11 +12,11 @@ import type { itemListType, RenderAtFloatLayoutRrops } from './data'
 import { getBaby, getManual } from '../../api/user'
 
 const itemList: itemListType[] = [
-    {
-        label: '家长指导手册',
-        desc: '家长指导手册',
-        clickText: '领取礼品'
-    },
+    // {
+    //     label: '家长指导手册',
+    //     desc: '家长指导手册',
+    //     clickText: '领取礼品'
+    // },
     {
         label: '逻辑狗老师',
         desc: '一对一辅导',
@@ -122,10 +122,7 @@ const ScanResult: React.FC = ({}) => {
     // 渲染登录按钮
     const RenderButton =  (item: itemListType, index: number) => {
         
-
-
         // 打开客服会话 
-
         const handleContact = (e) => {
             console.log(e);
         }

+ 1 - 1
src/pages/index/index.scss

@@ -15,7 +15,7 @@
 .item-img {
     width: 730px;
     height: 240px;
-    margin-bottom: 16px;
+    margin-bottom: 8px;
     margin-left: 10px;
 }
 

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

@@ -11,10 +11,10 @@ import './index.scss'
 
 import { getUserPhoneNumber } from '../../api/user'
 
-
-
 import Tip from '../../utils/tip'
 
+console.log(Taro, 'Taro.getStorageSync');
+
 const Index: React.FC = () => { 
 
   const [token, setToken] = useState<string>('')
@@ -103,4 +103,4 @@ const Index: React.FC = () => {
 
 }
 
-export default Index
+export default Index

+ 6 - 1
src/service/config.ts

@@ -1,11 +1,14 @@
+
 /**
  *  错误的key
  * 
  *  后台返回的状态码从这里修改 一般有 code status state
  * 
  */
+
 export const errorKey: string = 'status'
 
+
 /**
  *  错误码
  */
@@ -26,7 +29,9 @@ export const errorCode: number = 200
 export let baseUrl = '2'
 
 if (process.env.NODE_ENV === 'development') {
-    baseUrl = 'http://verify.test.luojigou.vip:8899'
+    // baseUrl = 'http://verify.test.luojigou.vip:8899'
+    // baseUrl = 'http://192.168.1.86:8091'
+    baseUrl = 'https://verify.luojigou.vip/'
     // baseUrl = 'http://192.168.1.21:8091'
 } else {
     baseUrl = 'http://192.168.1.21:8091'

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels