提交 883a4615 authored 作者: 羊富学's avatar 羊富学

AI认证优化

上级 0fcc9bff
...@@ -53,7 +53,7 @@ App({ ...@@ -53,7 +53,7 @@ App({
} }
// console.log('到这里extraData',extraData) // console.log('到这里extraData',extraData)
wx.setStorageSync('extraData', strData) wx.setStorageSync('extraData', strData)
wx.setStorageSync('fenggu', JSON.parse(strData)?.company || '') // wx.setStorageSync('fenggu', JSON.parse(strData)?.company || '')
// 启动摄像头预览 // 启动摄像头预览
// this.ctx.startPreview(); // this.ctx.startPreview();
...@@ -68,7 +68,7 @@ App({ ...@@ -68,7 +68,7 @@ App({
} else { } else {
wx.setStorageSync('extraData', JSON.stringify({})) wx.setStorageSync('extraData', JSON.stringify({}))
wx.setStorageSync('fenggu', '') // wx.setStorageSync('fenggu', '')
// wx.setStorage({ // wx.setStorage({
// key: 'extraData', // key: 'extraData',
// data: extraData, // data: extraData,
......
{ {
"pages": [ "pages": [
"pages/entryPage/entryPage",
"pages/index/index", "pages/index/index",
"pages/attention/attention", "pages/attention/attention",
"pages/cameraTakePhoto/cameraTakePhoto", "pages/cameraTakePhoto/cameraTakePhoto",
...@@ -9,7 +8,8 @@ ...@@ -9,7 +8,8 @@
"pages/fenggu/AICheck/AICheck", "pages/fenggu/AICheck/AICheck",
"pages/fenggu/takephoto/takephoto", "pages/fenggu/takephoto/takephoto",
"pages/fenggu/success/success", "pages/fenggu/success/success",
"pages/fenggu/example/example" "pages/fenggu/example/example",
"pages/result/result"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
...@@ -7,6 +7,7 @@ var take_Count = 0; ...@@ -7,6 +7,7 @@ var take_Count = 0;
Page({ Page({
// 页面的初始数据 // 页面的初始数据
data: { data: {
progressNumber:0, //拍照页面进度展示
image: '', image: '',
windowWidth: '', windowWidth: '',
windowHeight: '', windowHeight: '',
...@@ -523,6 +524,12 @@ Page({ ...@@ -523,6 +524,12 @@ Page({
*/ */
takePhoto: function () { takePhoto: function () {
// console.log('takePhoto') // console.log('takePhoto')
// 设置拍照进度条
this.setData({
progressNumber:50,
})
var that = this var that = this
Counter++; Counter++;
that.ctx.setZoom({ that.ctx.setZoom({
...@@ -738,6 +745,10 @@ Page({ ...@@ -738,6 +745,10 @@ Page({
//新增代码 //新增代码
takePhoto2: function () { takePhoto2: function () {
// console.log('takePhoto2') // console.log('takePhoto2')
// 设置拍照进度条
this.setData({
progressNumber:100,
})
const that = this; const that = this;
function isIOS() { function isIOS() {
let system = wx.getSystemInfoSync().system let system = wx.getSystemInfoSync().system
......
<view style='width:{{windowWidth}}px; height:{{windowHeight}}px; overflow:auto;'> <!-- <view style='width:{{windowWidth}}px; height:{{windowHeight}}px; overflow:auto;'>
<camera wx:if='{{isShowCamera}}' flash="on" class="camera-box" devic-position="back" frame-size="large"> <camera wx:if='{{isShowCamera}}' flash="on" class="camera-box" devic-position="back" frame-size="large">
<view class="daojishi"> <view class="daojishi">
<view wx:if="{{dongtaishuju_chuan == 1}}"> <view wx:if="{{dongtaishuju_chuan == 1}}">
...@@ -8,28 +8,16 @@ ...@@ -8,28 +8,16 @@
</view> </view>
<view wx:if="{{dongtaishuju_chuan == 2}}"> <view wx:if="{{dongtaishuju_chuan == 2}}">
<text style="font-size: xx-large;">{{snsMsgWait_twotime}}</text> <text style="font-size: xx-large;">{{snsMsgWait_twotime}}</text>
<!-- <view class="text_hint">
<text>\n加油,你可以的!</text>
</view> -->
</view> </view>
<view wx:if="{{dongtaishuju_chuan == 3}}"> <view wx:if="{{dongtaishuju_chuan == 3}}">
<text style="font-size: xx-large;">{{snsMsgWait_three}}</text> <text style="font-size: xx-large;">{{snsMsgWait_three}}</text>
<!-- <view class="text_hint">
<text>\n加油,相信自己!</text>
</view> -->
</view> </view>
</view> </view>
<cover-view class='camerabgImage'> <cover-view class='camerabgImage'>
<cover-view class="active"> <cover-view class="active">
<view style="height: 100%;width: 100%;"> <view style="height: 100%;width: 100%;">
<!-- <cover-view wx:if="{{status_zhi}}">
<cover-view wx:if="{{status == 'true' }}" class="text_bext" style="width: 600rpx;height: 20%;">请继续等待拍照进行二次认证</cover-view>
<cover-view wx:else=" " class="text_bext" style="width: 600rpx;height: 20%;">请将整个结构三维码置于识别框内</cover-view>
</cover-view> -->
<!-- <cover-view wx:else=""> -->
<cover-image wx:if="{{status == 'true'}}" class="text_2" style="width:600rpx;height: 80rpx; " src="/assets/imgs/等待动图2.gif"></cover-image> <cover-image wx:if="{{status == 'true'}}" class="text_2" style="width:600rpx;height: 80rpx; " src="/assets/imgs/等待动图2.gif"></cover-image>
<cover-view wx:else=" " class="text" style="width: 600rpx;height: 20%;">请将整个结构三维码置于识别框内</cover-view> <cover-view wx:else=" " class="text" style="width: 600rpx;height: 20%;">请将整个结构三维码置于识别框内</cover-view>
<!-- </cover-view> -->
<cover-image wx:if="{{status == 'true' }}" class="active-image" src="/assets/imgs/shanshuo.gif"></cover-image> <cover-image wx:if="{{status == 'true' }}" class="active-image" src="/assets/imgs/shanshuo.gif"></cover-image>
<cover-image wx:if="{{status == 'true' }}" class="active-image2-2 " src="/assets/imgs/ding.png"></cover-image> <cover-image wx:if="{{status == 'true' }}" class="active-image2-2 " src="/assets/imgs/ding.png"></cover-image>
<cover-image wx:else=" " class="active-image2" src="/assets/imgs/shanshuo.gif"></cover-image> <cover-image wx:else=" " class="active-image2" src="/assets/imgs/shanshuo.gif"></cover-image>
...@@ -45,20 +33,38 @@ ...@@ -45,20 +33,38 @@
<cover-image wx:if="{{state=='right' || state_x =='right'}}" src="/assets/imgs/jtleft.gif"></cover-image> <cover-image wx:if="{{state=='right' || state_x =='right'}}" src="/assets/imgs/jtleft.gif"></cover-image>
<cover-image wx:if="{{state=='on' || state_x =='on'}}" src="/assets/imgs/jtdown.gif"></cover-image> <cover-image wx:if="{{state=='on' || state_x =='on'}}" src="/assets/imgs/jtdown.gif"></cover-image>
<cover-image wx:if="{{state=='down' || state_x =='down'}}" src="/assets/imgs/jton.gif"></cover-image> <cover-image wx:if="{{state=='down' || state_x =='down'}}" src="/assets/imgs/jton.gif"></cover-image>
<!-- <cover-image wx:if="{{state_x =='left'}}" src="/assets/imgs/jtright.gif"></cover-image>
<cover-image wx:if="{{ state_x =='right'}}" src="/assets/imgs/jtleft.gif"></cover-image>
<cover-image wx:if="{{state_x =='on'}}" src="/assets/imgs/jtdown.gif"></cover-image>
<cover-image wx:if="{{ state_x =='down'}}" src="/assets/imgs/jton.gif"></cover-image> -->
<cover-image wx:else=""></cover-image> <cover-image wx:else=""></cover-image>
</cover-view> </cover-view>
</camera> </camera>
<!-- <image src="{{mybase64}}"></image> -->
</view> </view>
<view style="position:fixed; top: 999999999px;"> <view style="position:fixed; top: 999999999px;">
<!-- <camera frame-size="small" resolution="high"> -->
<canvas canvas-id="myCanvas" style='width:{{frame.width}}px; height:{{frame.height}}px;'></canvas> <canvas canvas-id="myCanvas" style='width:{{frame.width}}px; height:{{frame.height}}px;'></canvas>
<image src="{{src}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> <image src="{{src}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image>
<!-- <image src="{{kongfileimage}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> --> </view> -->
<!-- <image src="{{bigfileimage}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> -->
<!-- </camera> --> <view class="ai-check-box">
<view class="photo-box">
<camera wx:if='{{isShowCamera}}' style="height: 100%;width: 100%;" flash="on" devic-position="back" frame-size="large">
</camera>
<view class="content">
<text style='font-size:34rpx'>请将识别框对准结构三维码</text>
<image src="/assets/imgs/拍照框.png" mode="widthFix" style="margin:100rpx 0; width: 50%;"/>
<view class="progress-box">
<text >请保持结构三维码在识别框内等待进度条完成</text>
<progress percent="{{progressNumber}}" active stroke-width="10" show-info color="#0270FF" border-radius='100' active-mode='forwards' style="margin-top: 20rpx;"/>
</view>
</view>
</view>
<view class="bottom-box">
<view class="prompt">将识别框对准结构三维码等待AI自动识别结构特征</view>
<view class="btn-box">
<text class="text">*AI识别仅有实物标签可通过验证*</text>
<view class="btn">查看视频教程</view>
</view>
</view>
</view>
<view style="visibility:hidden; position:fixed;">
<canvas canvas-id="myCanvas" style='width:{{frame.width}}px; height:{{frame.height}}px;'></canvas>
<image src="{{src}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image>
</view> </view>
\ No newline at end of file
/*
.camera-box { .camera-box {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
} }
.camera-box .camerabgImage .active { .camera-box .camerabgImage .active {
/* position: absolute; */
margin-top: 58%; margin-top: 58%;
/* width: 60%; */
width: 100%; width: 100%;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
...@@ -27,7 +25,6 @@ ...@@ -27,7 +25,6 @@
width: 350rpx; width: 350rpx;
height: 350rpx; height: 350rpx;
margin: 25px 25px; margin: 25px 25px;
/* position: absolute; */
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
...@@ -50,7 +47,6 @@ ...@@ -50,7 +47,6 @@
font-weight: 00rpx; font-weight: 00rpx;
color:#6309f5; color:#6309f5;
line-height: 99rpx; line-height: 99rpx;
/* margin: auto; */
width: 100%; width: 100%;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
...@@ -59,9 +55,7 @@ ...@@ -59,9 +55,7 @@
.text_bext{ .text_bext{
font-size: 36rpx; font-size: 36rpx;
font-weight: 00rpx; font-weight: 00rpx;
/* color:#6309f5; */
line-height: 76rpx; line-height: 76rpx;
/* margin: auto; */
width: 100%; width: 100%;
margin-right: auto; margin-right: auto;
margin-left: auto; margin-left: auto;
...@@ -71,21 +65,16 @@ ...@@ -71,21 +65,16 @@
background-color: rgb(237, 239, 247); background-color: rgb(237, 239, 247);
} }
.text_2 { .text_2 {
/* font-size: 25rpx; */
/* height: 100%; */
font-weight: 00rpx; font-weight: 00rpx;
color:#6309f5; color:#6309f5;
margin: auto; margin: auto;
/* line-height: 40rpx; */
} }
.bexit{ .bexit{
width: 450rpx; width: 450rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
/* margin-top: 15%; */
font-size: 36rpx; font-size: 36rpx;
/* color: aliceblue; */
margin: 100rpx auto; margin: 100rpx auto;
border:2rpx; border:2rpx;
border-radius: 70rpx; border-radius: 70rpx;
...@@ -98,7 +87,6 @@ ...@@ -98,7 +87,6 @@
border-radius: 50%; border-radius: 50%;
background: #fff; background: #fff;
border: 6rpx solid#fff; border: 6rpx solid#fff;
/* margin: 0 auto */
margin-top: 320rpx; margin-top: 320rpx;
margin-left: 100rpx; margin-left: 100rpx;
} }
...@@ -132,4 +120,73 @@ ...@@ -132,4 +120,73 @@
.text_hint{ .text_hint{
height: 100%; height: 100%;
margin-top: 83%; margin-top: 83%;
} */
page {
width: 100%;
height: 100%;
}
.ai-check-box {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
width: 100%;
box-sizing: border-box;
}
.photo-box {
position: relative;
flex: 1;
height: 70%;
width: 100%;
box-sizing: border-box;
}
.photo-box .content {
position: absolute;
top: 0;
left: 0;
z-index: 999;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
color: #fff;
}
.bottom-box {
height: 30%;
width: 100%;
color: #fff;
background-color: black;
border-top: 10rpx solid #0270FF;
}
.bottom-box .prompt {
margin: 60rpx 0;
font-size: 32rpx;
text-align: center;
} }
.bottom-box .btn-box {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
}
.btn-box .text {
color: #aaa;
font-size: 28rpx;
}
.btn-box .btn {
margin-top: 10rpx;
width: 70%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 34rpx;
background-color: #0270FF;
border-radius: 20rpx;
}
\ No newline at end of file
...@@ -45,12 +45,12 @@ Page({ ...@@ -45,12 +45,12 @@ Page({
url:`/pages/anti/anti?cpid=${options.cpid}` url:`/pages/anti/anti?cpid=${options.cpid}`
}) })
} }
else if(wx.getStorageSync('fenggu') == "fenggu"){ // else if(wx.getStorageSync('fenggu') == "fenggu"){
console.log('丰谷页面') // console.log('丰谷页面')
wx.reLaunch({ // wx.reLaunch({
url:'/pages/fenggu/AICheck/AICheck' // url:'/pages/fenggu/AICheck/AICheck'
}) // })
} // }
// wx.clearStorageSync(); // 清空本地缓存数据 // wx.clearStorageSync(); // 清空本地缓存数据
wx.getSystemInfo({ wx.getSystemInfo({
success: (res) => { success: (res) => {
...@@ -107,7 +107,7 @@ Page({ ...@@ -107,7 +107,7 @@ Page({
}) })
// console.log('status_zhi',status_zhi) // console.log('status_zhi',status_zhi)
} }
if(this.data.showmodel === true && !fenggu.test(options.cpid)){ if(this.data.showmodel === true){
wx.showModal({ wx.showModal({
title: '注意事项:', title: '注意事项:',
content: this.data.content, content: this.data.content,
......
<!--index.wxml--> <!-- <web-view wx:if="{{zhongfen}}" src="{{webviewUrl}}" binderror="webviewError" bindmessage="webviewMessage"></web-view>
<web-view wx:if="{{zhongfen}}" src="{{webviewUrl}}" binderror="webviewError" bindmessage="webviewMessage"></web-view>
<veiw class="page"> <veiw class="page">
<image class="background" src="../../assets/imgs/index/backgtound.png"></image> <image class="background" src="../../assets/imgs/index/backgtound.png"></image>
<image class="carmera" src='../../assets/imgs/index/takephotob.png' class='takephotoe' bindtap='takePhoto'></image> <image class="carmera" src='../../assets/imgs/index/takephotob.png' class='takephotoe' bindtap='takePhoto'></image>
<image class='takephoto_txt' src="../../assets/imgs/index/begintakephoto.png" bindtap="takePhoto" mode="widthFix"></image> <image class='takephoto_txt' src="../../assets/imgs/index/begintakephoto.png" bindtap="takePhoto" mode="widthFix"></image>
<!-- <view >
<button bindtap="attention" class="attention_wxss" >注意事项</button>
</view> -->
<view class="{{showCover ? 'cover' : ''}}"></view> <view class="{{showCover ? 'cover' : ''}}"></view>
</veiw> </veiw> -->
\ No newline at end of file
<view class="full" style="position:relative;">
<!-- 背景图片 -->
<image class="full" src="/assets/imgs/index/首页背景.jpg" mode='scaleToFill'></image>
<!-- 内容盒子 -->
<view class="index-content full">
<image class="title-image" src="/assets/imgs/index/首页标题.png" mode='widthFix' style="width: 90%;"></image>
<image src="https://ai.tj5.cc:35437/static/fenggu/AI.png" mode="widthFix" style="margin-top: 40rpx; width: 80%;"/>
<!-- 按钮 -->
<view class="btns">
<image bindtap="takePhoto" src="https://ai.tj5.cc:35437/static/fenggu/comerz.png" mode="widthFix" style="width: 50%;" />
<view class="btn video-btn" >查看视频教程</view>
</view>
<!-- 底部文字 -->
<text class="bottom-text">海南天鉴防伪科技有限公司提供技术支持</text>
</view>
</view>
\ No newline at end of file
/**index.wxss**/ page {
.page { height: 100%;
height: 100vh; width: 100%;
/* border-top: 1rpx solid white; */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
} }
.container {
.takephotoe { position: relative;
display: block; }
width: 350rpx; .full {
height: 350rpx; height: 100%;
border-radius: 999px; width: 100%;
margin-bottom: 15%; box-sizing: border-box;
/* box-shadow: 0 0 50rpx #ffd8a2; */
/* position: absolute; left: 50%; top: 50%;
margin-left: -177rpx; margin-top: -335rpx; */
} }
.takephoto_txt { .index-content {
/* display: block; */ position: absolute;
width: 275rpx; top: 0;
height: 84rpx; left: 0;
margin-bottom: 305rpx; text-align: center;
}
.title-image {
margin-top: 120rpx;
} }
.background { .btns {
height: 100vh; display: flex;
flex-direction: column;
align-items: center;
width: 100%; width: 100%;
position: absolute;
z-index: -1;
} }
.attention_wxss{ .btns .video-btn {
background-color: rgb(165, 165,165); margin-top: 20rpx;
margin-left:auto; width: 50%;
color: #fff;
height: 80rpx;
line-height: 80rpx;
font-size: 34rpx;
border-radius: 80rpx;
background-color: #0270FF;
} }
.text-container { .bottom-text {
width: 200rpx; position: absolute;
height: 120rpx; left: 50%;
background-color: #fff; bottom: 50rpx;
padding: 10rpx; transform: translate(-50%,0);
border-radius: 4rpx; width: 100%;
color: #fff;
text-align: center;
} }
\ No newline at end of file
// pages/result/result.js
Page({
/**
* 页面的初始数据
*/
data: {
aiState: 0, //展示成功或失败页面,
time1: '', //本次认证时间
time2: '' //认证耗时
},
onLoad(options) {
const {
aiState,
time1,
time2
} = options
console.log(options,time1);
this.setData({
aiState: aiState || 0,
time1: time1 || '',
time2: time2 && (new Date().getTime() - time2) / 1000 || ''
})
},
// 返回首页
handleBack() {
wx.reLaunch({
url: `/pages/index/index`
})
},
// 重新拍照
handleGoTakePhoto(){
wx.reLaunch({
url: `/pages/cameraTakePhoto/cameraTakePhoto`
})
},
onReady() {
},
onShow() {
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="result-container">
<!-- 验证通过页面 -->
<view wx:if="{{aiState == 1}}" class="success-content full">
<view class="content-text">
<image src="/assets/imgs/成功.png" mode="widthFix" style="width: 40%;" />
<view class="query-text">
<text>本次认证时间:{{time1}}</text>
<text>本次认证耗时:{{time2}}</text>
</view>
<image src="/assets/imgs/通过.png" mode="widthFix" style="width: 50%;" />
<view class="btn" bind:tap="handleBack">返回主页面</view>
</view>
<image src="/assets/imgs/验证成功底部.png" mode="widthFix" style="width: 100%;" />
</view>
<!-- 验证失败页面 -->
<view wx:else class="error-content full">
<view class="content-text">
<image src="/assets/imgs/未通过.png" mode="widthFix" style="width: 30%;" />
<text style="margin: 40rpx 0;font-size: 34rpx;font-weight: 700;">未通过,请重新认证</text>
<view style="padding:0 60rpx; text-align: center;font-size: 30rpx;line-height: 48rpx;">请保证相机稳定,检查标签码是否有破损,并前往光照适宜的环境进行验证</view>
<view class="btns" >
<view class="btn" bind:tap="handleGoTakePhoto">重新验证</view>
<view class="btn">继续查看视频教程</view>
</view>
</view>
<image src="/assets/imgs/验证成功底部.png" mode="widthFix" style="width: 100%;" />
</view>
</view>
\ No newline at end of file
.result-container {
position: relative;
width: 100vw;
height: 100vh;
box-sizing: border-box;
overflow: hidden;
}
.full {
position: relative;
width: 100%;
height: 100%;
box-sizing: border-box
}
.btn {
width: 60%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
border-radius: 20rpx;
}
.success-content,.error-content {
display: flex;
flex-direction: column;
}
.content-text {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.success-content .query-text {
margin: 40rpx 0;
display: flex;
flex-direction: column;
align-items: center;
}
.success-content .btn {
margin-top: 40rpx;
color: #008AF4;
border: 4rpx solid #008AF4;
}
.error-content .btns {
margin-top: 40rpx;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
font-size: 34rpx;
}
.error-content .btns .btn:first-child {
background-color: #FFB44C;
}
.error-content .btns .btn:last-child {
margin-top: 20rpx;
color: #FFB44C;
border:4rpx solid #FFB44C;
}
\ No newline at end of file
...@@ -82,16 +82,16 @@ Page({ ...@@ -82,16 +82,16 @@ Page({
county: '', county: '',
labelInfoUrl: '', labelInfoUrl: '',
reason: '', reason: '',
extraData:'', extraData: '',
all_info:'', all_info: '',
zoom_number:'' zoom_number: ''
}, },
onLoad: function (options) { onLoad: function (options) {
this.onHide(); this.onHide();
const openid = wx.getStorageSync('openid') const openid = wx.getStorageSync('openid')
const extraData = JSON.parse(wx.getStorageSync('extraData')) const extraData = JSON.parse(wx.getStorageSync('extraData'))
const param = wx.getStorageSync('fenggu') const param = wx.getStorageSync('fenggu')
console.log(78787878,param) console.log(78787878, param)
let labelInfo = extraData let labelInfo = extraData
console.log('labelInfo', labelInfo) console.log('labelInfo', labelInfo)
var userid = labelInfo.uid var userid = labelInfo.uid
...@@ -299,7 +299,7 @@ Page({ ...@@ -299,7 +299,7 @@ Page({
}) })
if (labelInfo) { if (labelInfo) {
console.log('获取标签号labelInfo',labelInfo) console.log('获取标签号labelInfo', labelInfo)
const labelCode = labelInfo.cpid_jm || labelInfo.cpid const labelCode = labelInfo.cpid_jm || labelInfo.cpid
this.setData({ this.setData({
labelCode, labelCode,
...@@ -308,10 +308,10 @@ Page({ ...@@ -308,10 +308,10 @@ Page({
filePath: options.path, filePath: options.path,
datajson datajson
}) })
}else{ } else {
console.log('标签号为空') console.log('标签号为空')
this.setData({ this.setData({
filePath:options.path filePath: options.path
}) })
} }
this.uploadImg() this.uploadImg()
...@@ -410,8 +410,7 @@ Page({ ...@@ -410,8 +410,7 @@ Page({
if (this.data.recognizeLabelCode === labelCodejson || this.data.datajson === labelCodejson) { if (this.data.recognizeLabelCode === labelCodejson || this.data.datajson === labelCodejson) {
console.log('一致') console.log('一致')
cb(1); cb(1);
} } else if (this.data.recognizeLabelCode === '码解析失败' && this.data.datajson === '码解析失败') {
else if (this.data.recognizeLabelCode === '码解析失败' && this.data.datajson === '码解析失败') {
console.log('解析失败') console.log('解析失败')
cb(2); cb(2);
this.setData({ this.setData({
...@@ -452,8 +451,8 @@ Page({ ...@@ -452,8 +451,8 @@ Page({
'province': this.data.province || '', 'province': this.data.province || '',
'city': this.data.city || '', 'city': this.data.city || '',
'county': this.data.county || '', 'county': this.data.county || '',
'all_info':this.data.all_info || '', 'all_info': this.data.all_info || '',
'zoom_number':this.data.zoom_number || '' 'zoom_number': this.data.zoom_number || ''
}, },
success: (res) => { success: (res) => {
...@@ -502,8 +501,8 @@ Page({ ...@@ -502,8 +501,8 @@ Page({
'province': this.data.province || '', 'province': this.data.province || '',
'city': this.data.city || '', 'city': this.data.city || '',
'county': this.data.county || '', 'county': this.data.county || '',
'all_info':this.data.all_info || '', 'all_info': this.data.all_info || '',
'zoom_number':this.data.zoom_number || '' 'zoom_number': this.data.zoom_number || ''
}, },
success: (res) => { success: (res) => {
console.log('all入库成功', res); console.log('all入库成功', res);
...@@ -550,8 +549,8 @@ Page({ ...@@ -550,8 +549,8 @@ Page({
'province': this.data.province || '', 'province': this.data.province || '',
'city': this.data.city || '', 'city': this.data.city || '',
'county': this.data.county || '', 'county': this.data.county || '',
'all_info':this.data.all_info || '', 'all_info': this.data.all_info || '',
'zoom_number':this.data.zoom_number || '' 'zoom_number': this.data.zoom_number || ''
}, },
success: (res) => { success: (res) => {
console.log('success,调用upload接口超时', res) console.log('success,调用upload接口超时', res)
...@@ -627,7 +626,7 @@ Page({ ...@@ -627,7 +626,7 @@ Page({
// if (!res.data) { // if (!res.data) {
// // console.log('网络请求没有返回任何数据') // // console.log('网络请求没有返回任何数据')
// console.log('请求超时2'); // console.log('请求超时2');
// const dtime2 = util.formatTime(new Date()); // const dtime2 = util.formatTime(new Date());
// // console.log('dtime2_2', dtime2) // // console.log('dtime2_2', dtime2)
// cb(2); // cb(2);
...@@ -762,6 +761,7 @@ Page({ ...@@ -762,6 +761,7 @@ Page({
} }
} }
const phone_score = res.data.confidence[4] const phone_score = res.data.confidence[4]
function mysort(a) { function mysort(a) {
var n = a.length; var n = a.length;
var newa = []; var newa = [];
...@@ -789,10 +789,10 @@ Page({ ...@@ -789,10 +789,10 @@ Page({
// let score = res.data.confidence // let score = res.data.confidence
let succ = '' let succ = ''
// ai通过状态 // ai通过状态
let aiState = 0; let aiState = 0;
this.setData({ this.setData({
isLoading: this.data.param ==='fenggu' ? true:false, isLoading: true,
imagefile: imagefile, imagefile: imagefile,
phone_score: phone_score, phone_score: phone_score,
}) })
...@@ -904,18 +904,24 @@ Page({ ...@@ -904,18 +904,24 @@ Page({
} else { } else {
notice = '算法不确定具体分类' notice = '算法不确定具体分类'
} }
if(wx.getStorageSync('fenggu') ==='fenggu'){ // if(wx.getStorageSync('fenggu') ==='fenggu'){
if (aiState === 1 ) { // if (aiState === 1 ) {
wx.redirectTo({ // wx.redirectTo({
url:`/pages/fenggu/success/success?time1${this.data.dtime || this.data.people_time}&time2=${this.data.people_replytime/1000 || this.data.datemill/1000}` // url:`/pages/fenggu/success/success?time1${this.data.dtime || this.data.people_time}&time2=${this.data.people_replytime/1000 || this.data.datemill/1000}`
}) // })
} else { // } else {
wx.navigateTo({ // wx.navigateTo({
url:`/pages/fenggu/AICheck/AICheck?sameCodeState=${this.data.sameCodeState}` // url:`/pages/fenggu/AICheck/AICheck?sameCodeState=${this.data.sameCodeState}`
}) // })
} // }
return // return
} // }
// 跳转到结果页面
wx.reLaunch({
url: `/pages/result/result?time1=${util.formatTime(new Date()) || this.data.people_time}&time2=${new Date().getTime()}&aiState=${aiState}`
})
return
//更新数据 //更新数据
this.setData({ this.setData({
isLoading: false, isLoading: false,
...@@ -925,7 +931,7 @@ Page({ ...@@ -925,7 +931,7 @@ Page({
notice: notice, notice: notice,
aiState: aiState, aiState: aiState,
}); });
wx.setStorage({ wx.setStorage({
key: 'notice', key: 'notice',
data: notice data: notice
...@@ -1090,7 +1096,7 @@ Page({ ...@@ -1090,7 +1096,7 @@ Page({
var datemill = timeec - this.data.timesc var datemill = timeec - this.data.timesc
// console.log('本次认证时间', datemill / 1000) // console.log('本次认证时间', datemill / 1000)
var dtime = util.formatTime(new Date) var dtime = util.formatTime(new Date)
this.setData({ this.setData({
notice, notice,
datemill, datemill,
...@@ -1155,7 +1161,7 @@ Page({ ...@@ -1155,7 +1161,7 @@ Page({
} }
}.bind(this), 1000); }.bind(this), 1000);
} }
this.callBackAIStatus(state) this.callBackAIStatus(state)
const postdata = { const postdata = {
'result': notice, 'result': notice,
...@@ -1185,11 +1191,11 @@ Page({ ...@@ -1185,11 +1191,11 @@ Page({
'province': this.data.province || '', 'province': this.data.province || '',
'city': this.data.city || '', 'city': this.data.city || '',
'county': this.data.county || '', 'county': this.data.county || '',
'all_info':this.data.all_info || '', 'all_info': this.data.all_info || '',
'zoom_number':this.data.zoom_number || '' 'zoom_number': this.data.zoom_number || ''
} }
console.log('this.data.image_file_myapi',) console.log('this.data.image_file_myapi', )
wx.request({ wx.request({
// url: 'https://ai.china315net.com:35437/api/all/', // url: 'https://ai.china315net.com:35437/api/all/',
url: 'https://ai.tj5.cc:35437/api/all/', url: 'https://ai.tj5.cc:35437/api/all/',
...@@ -1412,7 +1418,8 @@ Page({ ...@@ -1412,7 +1418,8 @@ Page({
}, },
success: (res) => { success: (res) => {
console.log('回调成功') console.log('回调成功')
w } w
}
}) })
} }
}, },
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<image class="loadings" src="/assets/imgs/wating/loadingg.gif" style="width:420rpx; height: 420rpx;"></image> <image class="loadings" src="/assets/imgs/wating/loadingg.gif" style="width:420rpx; height: 420rpx;"></image>
<image class="loadingtrue" src="/assets/imgs/wating/truee.png" style="width: 260rpx; height: 50rpx;"></image> <image class="loadingtrue" src="/assets/imgs/wating/truee.png" style="width: 260rpx; height: 50rpx;"></image>
</view> </view>
<view class="res" wx:if="{{!isLoading}}"> <!-- wx:if="{{!isLoading}}" -->
<view class="res" wx:if="{{false}}">
<!-- 码不同 --> <!-- 码不同 -->
<block wx:if="{{sameCodeState ===0 }}"> <block wx:if="{{sameCodeState ===0 }}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image> <image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/result/result",
"pathName": "pages/result/result",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "小", "name": "小",
"pathName": "pages/index/index", "pathName": "pages/index/index",
...@@ -50,13 +57,6 @@ ...@@ -50,13 +57,6 @@
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
{
"name": "",
"pathName": "pages/fenggu/AICheck/AICheck",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "", "name": "",
"pathName": "pages/fenggu/success/success", "pathName": "pages/fenggu/success/success",
...@@ -73,5 +73,6 @@ ...@@ -73,5 +73,6 @@
} }
] ]
} }
} },
"libVersion": "3.3.4"
} }
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论