提交 7220d5c9 authored 作者: 常超凡's avatar 常超凡

h

上级 e99b8668
// pages/fenggu/AICheck/AICheck.js
Page({
data:{
showMask:false,
typeTab:''
},
takePhoto: function (e) {
const values = 'fenggu'
wx.navigateTo({
......@@ -17,5 +21,13 @@ Page({
// 联系客服
handleServe() {
console.log(999)
},
onLoad(option){
if (option.sameCodeState) {
this.setData({
showMask:true,
typeTab:true
})
}
}
})
<view class="AICheck">
<image src="/assets/fenggu/ai认证背景.jpg" class="bgImage" />
<image src="https://ai.tj5.cc:35437/static/fenggu/AIbackground.jpg" class="bgImage" />
<view class="content-box">
<image src="/assets/fenggu/logo.png" mode="widthFix" class="logo-img" />
<image src="https://ai.tj5.cc:35437/static/fenggu/logo.png" mode="widthFix" class="logo-img" />
<image src="/assets/fenggu/AI.png" mode="widthFix" class="ai-img"/>
<image src="/assets/fenggu/开始认证.png" bindtap="takePhoto" mode="widthFix" style="width: 400rpx;"/>
<image src="https://ai.tj5.cc:35437/static/fenggu/AI.png" mode="widthFix" class="ai-img"/>
<image src="https://ai.tj5.cc:35437/static/fenggu/comerz.png" bindtap="takePhoto" mode="widthFix" style="width: 400rpx;"/>
</view>
<view wx:if="{{showMask}}" class="mask">
<!-- 未通过 -->
<view class="fali mask-card" wx:if="{{false}}">
<image src="/assets/fenggu/未通过卡片.png" mode="widthFix" />
<view class="fali mask-card" wx:if="{{typeTab}}">
<image src="https://ai.tj5.cc:35437/static/fenggu/faile.png" mode="widthFix" />
<view class="content">
<view class="top">
<view class="reason">
<text>未通过</text>
<text>请重新认证!</text>
</view>
<image bind:tap="closeMask" src="/assets/fenggu/关闭.png" mode="widthFix" style="width: 50rpx;" />
<image bind:tap="closeMask" src="https://ai.tj5.cc:35437/static/fenggu/close.png" mode="widthFix" style="width: 50rpx;" />
</view>
<view class="text">
请保证相机稳定,检查标签码<text style="font-weight: 700;">是否有破损,并前往光照适宜的环境进行验证。</text>
</view>
<view class="btn-box">
<text class="link">验证流程有疑问?点击跳转</text>
<view class="btn" style="background-color: #FFB44C;">重新验证</view>
<view bindtap="takePhoto" class="btn" style="background-color: #FFB44C;">重新验证</view>
</view>
</view>
</view>
<!-- 不是标签 -->
<view class="fali mask-card" wx:if="{{true}}" >
<view class="fali mask-card" wx:if="{{false}}" >
<image src="/assets/fenggu/不是标签卡片.png" mode="widthFix" />
<view class="content">
<view class="top">
......
// pages/fenggu/example/example.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="example">
<image src="/assets/fenggu/示例1.jpg" mode="widthFix" style="width: 100%;"/>
<image src="/assets/fenggu/示例2.jpg" mode="widthFix" style="width: 100%;"/>
<image src="/assets/fenggu/示例3.jpg" mode="widthFix" style="width: 100%;"/>
<image src="/assets/fenggu/示例4.jpg" mode="widthFix" style="width: 100%;"/>
</view>
\ No newline at end of file
.example {
display: flex;
flex-direction: column;
}
\ No newline at end of file
// pages/fenggu/success/success.js
// var util = require('../../../utils/util')
Page({
/**
* 页面的初始数据
*/
data: {
time1:`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`,
time2:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// console.log(new Data)
// this.setData({
// time1:options.time1,
// time2:options.time2,
// })
},
/**
......
......@@ -11,7 +11,7 @@
<view class="title tshadow">认证成功</view>
<view class="success-info">
<text class="tshadow" style="font-size: 34rpx;">该产品为丰谷酒业正品标识,请放心使用!</text>
<text style="font-size: 22rpx;">本次认证时间:2024年1月19日14:31:06 本次认证耗时:0.388S</text>
<text style="font-size: 22rpx;">本次认证时间:{{time1}} </text>
</view>
</view>
</view>
......
......@@ -5,35 +5,547 @@ Page({
* 页面的初始数据
*/
data: {
// 验证步骤
stepIndex: 0,
// tab切换(AI验证,示范切换)
tabIndex: 1
},
takePhoto() {
// wx.getStorageSync('photoFrame')
const ctx = wx.createCameraContext()
const listener = ctx.onCameraFrame((e) => {
console.log(e.data)
wx.setStorageSync({
key:'photoFrame',
data:JSON.stringify(e.data)
})
})
listener.start()
// ctx.takePhoto({
// quality: 'high',
// success: (res) => {
// console.log(res)
// this.setData({
// src: res.tempImagePath
// })
// }
// })
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.takePhoto()
this.getIsCodeImg()
},
// 视频流判断是否有三维码
getIsCodeImg() {
let nNumber = 0
const ctx = wx.createCameraContext()
const listener = ctx.onCameraFrame((frame) => {
nNumber++
if (nNumber % 25 == 0) {
wx.canvasPutImageData({
canvasId: 'myCanvas',
x: 0,
y: 0,
width: frame.width, //288 288
height: frame.width, //512 381
data: new Uint8ClampedArray(new Uint8Array(frame.data)),
success:() => {
wx.canvasToTempFilePath({
canvasId: 'myCanvas',
x: 0,
y: (frame.height - frame.width) / 2,
width: frame.width, //288
height: frame.width, //352
fileType: 'jpg',
destWidth: frame.width,
destHeight: frame.width,
// 精度修改
quality: 'high',
success: (res) => {
// console.log('成功成功成功')
//进行编码
const base = wx.getFileSystemManager().readFileSync(res.tempFilePath, 'base64')
// console.log('base',base)
wx.request({
url: 'https://ai.tj5.cc:35437/object/',
// url: 'https://tj5.cc:4433/object/',
// url:'https://ai.china315net.com:35437/object/',
method: "POST",
data: {
base
},
success: (res) => {
var result = res.data.result;
var minindex = -1;
var mindistance = 2;
for (var i = 0; i < result.length; i++) {
var sublist = result[i];
var distance = Math.abs(sublist[0] - 0.5) + Math.abs(sublist[1] - 0.5);
if (distance < mindistance) {
mindistance = distance;
minindex = i;
}
}
var result_zy = result[minindex][0]
var result_sx = result[minindex][1]
var result_w = result[minindex][2]
var result_zoom = parseFloat((0.85 / result_w).toFixed(1))
let state = ''
let status = ''
let state_x = ''
if (result_zy > 0.588) { //0.568
state = 'left'
} else if (result_zy < 0.405) { //0.425
state = 'right'
} else if (result_sx > 0.577) { //0.547
state = 'on'
} else if (result_sx < 0.401) { //0.411
state = 'down'
} else {
let text = '大框参数已经完善'
var take_Count = 0;
// console.log('大框参数已经完善', text)
let singe_state = true
take_Count++,
wx.removeStorageSync('singe_state')
// console.log('that.data.takephoto', that.data.takephoto)
if (this.data.takephoto !== 'succes' && this.data.take_photo_1 === '') {
// console.log('大框参数完成进行拍照')
this.takePhoto();
let takephoto = 'succes'
let d_takephoto = '大框拍照完成'
// console.log('d_takephoto', d_takephoto)
that.setData({
takephoto,
text,
d_takephoto,
})
// console.log('that.data.takephoto', that.data.takephoto)
// console.log('that.data.all_state', that.data.all_state)
}
//新修改
else if (this.data.takephoto === 'succes' && that.data.all_state === false) {
// console.log('进入小框判断')
var result = res.data.result;
var d_result_zy = result[minindex][0];
var d_result_sx = result[minindex][1];
if (d_result_zy > 0.546) { //0.546
state_x = 'left'
} else if (d_result_zy < 0.445) { //0.445
state_x = 'right'
} else if (d_result_sx > 0.571) { //0.531
state_x = 'on'
} else if (d_result_sx < 0.450) { //0.410
state_x = 'down'
} else {
// console.log('全部完成')
// console.log('this.data.all_state', this.data.all_state)
this.setData({
all_finish: true
});
this.takePhoto2()
this.setData({
all_state: true
})
this.listener.stop()
// if (this.data.all_state === false) {
// console.log('全部完成后进行放大拍照')
// that.takePhoto2()
// that.setData({
// all_state: true
// })
// that.listener.stop()
// }
}
} else {
console.log('拍照失败')
// that.takePhoto2()
}
}
this.setData({
state: state,
status: status,
state_x: state_x
})
},
fail: (error) => {
console.log('目标检测失败', error)
}
})
},
fail: (error) => {
console.log('转换临时文件失败:', error);
}
}, that)
},
fail: (error) => {
console.log('绘制图像数据失败', error)
}
})
}
})
listener.start()
},
takePhoto: function () {
// console.log('takePhoto')
var that = this
Counter++;
that.ctx.setZoom({
zoom: 1.0,
success: (res) => {
setTimeout(() => {
that.ctx.takePhoto({
quality: 'high', //高质量
flash: 'off',
success: (res) => {
/*储存 */
wx.setStorage({
key: 'res.tempImagePath',
data: res.tempImagePath,
})
// console.log('res.tempImagePath', res.tempImagePath)
const base = wx.getFileSystemManager().readFileSync(res.tempImagePath, 'base64')
// console.log('base', base)
this.setData({
kongfileimage: res.tempImagePath
})
// console.log('开始解析')
//解码API
wx.request({
// url:'https://ai.china315net.com:35437/api/upload/',
// url: 'https://ai.tj5.cc:35437/api/upload/',
// url:'https://tj5.cc:4433/api/upload/',
url: 'https://ai.tj5.cc:35437/api/small_upload/',
// url:'https://tj5.cc:4433/api/small_upload/',
method: 'POST',
data: {
base,
'labelCodejson': this.data.labelCode
},
success: (res) => {
// console.log('base', base)
// console.log('res.statusCode ', res.statusCode)
// console.log('接口访问')
var dtime = util.formatTime(new Date)
wx.setStorage({
key: 'dtime',
data: dtime
})
// console.log('当前时间', dtime)
var res_data = res.data
// console.log('res_data', res_data)
var succes_data = res_data.succes
// console.log('succes_data', succes_data)
if (res_data === '码解析失败' || succes_data === 'loser' || res.statusCode !== 200) {
// console.log('计算res_data长度',res_data.length)
// console.log('网络请求值不等于200 ')
const datajson = '码解析失败'
// console.log('datajson1',datajson)
wx.setStorage({
key: 'datajson',
data: datajson
})
} else {
var img_reader = res_data.img_reader
// console.log('img_reader', img_reader)
wx.setStorage({
key: 'img_reader',
data: img_reader
})
var img_method = res_data.img_method
// console.log('img_method', img_method)
wx.setStorage({
key: 'img_method',
data: img_method
})
var points = res_data.points
// console.log('points', points)
wx.setStorage({
key: 'points',
data: points
})
var datajson = res_data.codeinfo;
// console.log('原图解析内容datajson', datajson)
wx.setStorage({
key: 'datajson',
data: datajson
})
}
},
fail: (res) => {
// console.log('调用upload接口超时', res)
if (res.errMsg.indexOf('timeout') !== -1) {
// console.log('请求超时')
const datajson = '码解析失败'
// console.log('datajson1',datajson)
wx.setStorage({
key: 'datajson',
data: datajson
})
}
},
complete: (res) => {
if (!res.data) {
// console.log('网络请求没有返回任何数据')
const datajson = '码解析失败'
// console.log('datajson1',datajson)
wx.setStorage({
key: 'datajson',
data: datajson
})
}
},
timeout: 3000
})
//新增请求接口
wx.request({
url: 'https://ai.tj5.cc:35437/classify16/',
// url: 'https://tj5.cc:4433/classify16/',
method: "POST",
data: {
'image_type': 20,
'base': base,
},
success: (res) => {
let result_value = res.data.result
let yuan_file = res.data.image_path
// console.log('yuan_file', yuan_file)
wx.setStorage({
key: 'yuan_file',
data: yuan_file
})
if (result_value == 14) {
// console.log('等于14分类')
let hint_phone = result_value
this.setData({
hint_phone
})
wx.setStorage({
key: 'hint_phone',
data: hint_phone
})
// console.log('hint_phone', hint_phone)
} else {
// console.log('不等于14分类')
let hint_phone = result_value
wx.setStorage({
key: 'hint_phone',
data: hint_phone
})
// console.log('hint_phone', hint_phone)
}
},
fail: error => {
console.log('调用upload失败', error)
}
});
var dtime_2 = util.formatTime(new Date)
wx.setStorage({
key: 'dtime_2',
data: dtime_2
})
}
})
}, 350);
}
})
let once_takephoto = 'true'
this.setData({
takephoto_count: Counter,
once_takephoto: once_takephoto
})
},
//源代码
// takePhoto2: function () {
// var that = this
// that.ctx.setZoom({
// // flash: 'on',
// zoom: 4.0,
// success: (res) => {
// console.log('setZoom 成功', res)
// const takephoto2_state = res.errMsg
// this.setData({
// takephoto2_state
// })
// console.log('takephoto2_state', takephoto2_state)
// setTimeout(() => {
// that.ctx.takePhoto({
// quality: 'high', //高质量
// success: (res) => {
// console.log('到相机里面')
// console.log('res.data', res)
// console.log('res.tempfile', res.tempImagePath)
// /*储存 */
// wx.setStorage({
// key: 'originalImagePath',
// data: res.tempImagePath,
// })
// console.log('image', res.tempImagePath)
// this.setData({
// bigfileimage: res.tempImagePath
// })
// let file = res.tempImagePath
// const base = wx.getFileSystemManager().readFileSync(file, 'base64')
// console.log('file', file)
// console.log('base', base)
// wx.navigateTo({
// url: '../upload/upload?path=' + that.data.bigfileimage + '&char=0'
// })
// console.log('传值成功')
// console.log('res.tempImagePath', that.data.bigfileimage)
// }
// })
// },350);
// }
// })
// },
//新增代码
takePhoto2: function () {
// console.log('takePhoto2')
const that = this;
function isIOS() {
let system = wx.getSystemInfoSync().system
return system.indexOf('iOS') !== -1
}
if (isIOS()) {
// console.log('当前设备是ios')
// console.log('this.data.result_zoom', this.data.result_zoom)
if (this.data.result_zoom === 0) {
this.setData({
result_zoom: 4
})
}
// console.log('this.data.result_zoom', this.data.result_zoom)
that.ctx.setZoom({
zoom: this.data.result_zoom,
success: res => {
// console.log('setZoom成功', res);
const takephoto2_state = res.errMsg;
this.setData({
takephoto2_state,
});
// console.log('takephoto2_state', takephoto2_state);
setTimeout(() => {
that.ctx.takePhoto({
quality: 'high',
flash: 'on',
success: res => {
// console.log('到相机里面');
// console.log('res.data', res);
// console.log('res.tempfile', res.tempImagePath);
/*储存 */
wx.setStorage({
key: 'originalImagePath',
data: res.tempImagePath,
});
this.setData({
bigfileimage: res.tempImagePath,
});
wx.navigateTo({
url: '../upload/upload?path=' + that.data.bigfileimage + '&char=0'
});
},
fail: err => {
console.error('拍照失败', err);
that.takePhoto2()
// console.log('拍照完成')
}
});
})
},
fail: err => {
console.error('设置缩放失败', err);
}
});
} else {
// console.log('当前设备是安卓')
// console.log('this.data.result_zoom', this.data.result_zoom)
if (this.data.result_zoom === 0) {
this.setData({
result_zoom: 6
})
}
// const one_zoom = Math.floor(this.data.result_zoom * 0.85)
const one_zoom = parseFloat((this.data.result_zoom * 0.82).toFixed(1));
// console.log('one_zoom', one_zoom)
const benchmarkLevel = (wx.getStorageSync('benchmarkLevel') || 0)
const phone_model = (wx.getStorageSync('phone_model') || '')
// wx.removeStorageSync(String(benchmarkLevel));
// console.log('benchmarkLevel', benchmarkLevel)
// console.log('phone_model', phone_model)
let timeS;
// if(){
// }
// console.log('手机型号',phone_model)
let phone_list= ['NOH-AN00','NOH-AN01','OCE-AN10','JAD-AL00','LNA-AL00','NOP-AN00','NOH-AL10','ABR-AL80','MNA-AL00','JAD-AL50','ABR-AL00','ABR-AL90','ABR-AL60','ABR-AL60','NOH-AN50']
if(phone_list.includes(phone_model)){
// console.log('特殊手机型号')
timeS = 850
}
else if (benchmarkLevel > 40) {
timeS = 350;
} else if (benchmarkLevel > 30) {
timeS = 380;
} else if (benchmarkLevel > 20) {
timeS = 410
} else if (benchmarkLevel > 10) {
timeS = 450;
} else {
timeS = 450;
}
this.takePhotoZoom(one_zoom, timeS)
}
},
takePhotoZoom: function (one_zoom,timeS) {
console.log('one_zoom',one_zoom)
console.log('timeS',timeS)
var that = this
that.ctx.setZoom({
zoom: one_zoom,
success: (res) => {
console.log('res.zoom 成功', res.zoom)
setTimeout(() => {
that.ctx.takePhoto({
quality: 'high', //高质量
flash: 'off',
success: (res) => {
console.log('放大拍照日志res', res)
/*储存 */
wx.setStorage({
key: 'originalImagePath',
data: res.tempImagePath,
})
wx.setStorage({
key: 'one_zoom',
data: one_zoom
});
this.setData({
bigfileimage: res.tempImagePath,
result_zoom: this.data.result_zoom
})
wx.navigateTo({
url: '../upload/upload?path=' + that.data.bigfileimage + '&char=0'
})
},
fail: (err) => {
console.error('拍照失败2', err);
that.takePhoto2()
}
})
}, timeS);
},
fail: err => {
console.error('设置缩放失败', err);
}
})
},
// ai验证,示范tab切换
tabChange(e) {
const tindex = e.target.dataset?.tindex || 1
// this.setData({
// tabIndex:tindex
// })
// 跳转示例页面
if (tindex == 2) {
wx.navigateTo({
url: '/pages/fenggu/example/example'
})
}
},
/**
* 生命周期函数--监听页面初次渲染完成
......
<view class="takephoto">
<view class="step" style="height: 200rpx; align-items: center;">
<view class="step-box" style="border-radius: 10rpx;overflow: hidden;">
<view class="step-item step-active">三维码校准完成</view>
<view class="step-item" style="margin: 0 5rpx;">拍照中</view>
<view class="step-item">验证</view>
<view class="step-item {{stepIndex > 0 ? 'step-active' : ''}}">三维码校准完成</view>
<view class="step-item {{stepIndex > 1 ? 'step-active' : ''}}" style="margin: 0 5rpx;">拍照中</view>
<view class="step-item {{stepIndex > 2 ? 'step-active' : ''}}">验证</view>
</view>
</view>
<view class="photo" style="flex:1;background-color: black;">
<view class="photo" style="position: relative;flex:1;background-color: black;">
<!-- <camera style="height: 100%;width: 100%;" flash="on" devic-position="back" frame-size="large">
</camera> -->
<!-- 拍照框(正方形) -->
<image src="/assets/fenggu/拍照框.png" mode="widthFix" class="focus"/>
</view>
<view class="bottom" style="height: 400rpx;align-items: center;">
<view class="tabs" style="padding: 6rpx;background-color: black;">
<view class="tabItem tab-active">AI验证</view>
<view class="tabItem">示范</view>
<view class="tabs" bind:tap="tabChange" style="padding: 6rpx;background-color: black;">
<view class="tabItem tab-active" data-tindex='1'>AI验证</view>
<view class="tabItem" data-tindex='2'>示范</view>
</view>
</view>
</view>
\ No newline at end of file
.takephoto {
position: relative;
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
font-size: 30rpx;
background-color: #333;
box-sizing: border-box;
position: relative;
display: flex;
flex-direction: column;
width: 100vw;
height: 100vh;
font-size: 30rpx;
background-color: #333;
box-sizing: border-box;
}
.takephoto .focus {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 400rpx;
z-index: 9999;
}
.step,.step-box,.bottom,.tabs {
display: flex;
justify-content: center;
text-align: center;
display: flex;
justify-content: center;
text-align: center;
}
.step .step-item {
padding: 0 20rpx;
height: 80rpx;
min-width: 150rpx;
line-height: 80rpx;
color: #fff;
background-color: #ADADAD;
padding: 0 20rpx;
height: 80rpx;
min-width: 150rpx;
line-height: 80rpx;
color: #fff;
background-color: #ADADAD;
}
.bottom .tabs .tabItem{
height: 80rpx;
line-height: 80rpx;
min-width: 200rpx;
color: #FAF38E;
border-radius: 10rpx;
height: 80rpx;
line-height: 80rpx;
min-width: 200rpx;
color: #FAF38E;
border-radius: 10rpx;
}
.bottom .tabs .tab-active {
color: #fff;
background-color: #333;
color: #fff;
background-color: #333;
}
.step-active {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABMCAIAAABSySbyAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAA5NJREFUeJzV2utW2kAQB3DfpLUIHiveoFCx2pZ6vADlUn2kCnITCQICDZE33c4qFMh9k9k53XP2kx/M/7fZmd2EbFReGIxfs/UBfzEERrLD3v9mm1XLuPMeHwKN4y67feFjIzygqLNIlRQQrbHLER7gWOPpKQG7DVaZIgF+6ixWowac9efpEQDfBzwEJWCrym5mSICKwRIP8/RkgIzGbrEApem8fMkAUL65CR4goy3T0wAO2vy24wBM008D4OU7QwJ8G6ylJwDAfJUNJEB5yg7b1IBjbZE+PCA/4e2MEgCXKxl4gJOeOb1swNEDT4UDgG08ek8KiNzxklumDwmwlq9sALT/4hQJAOW716QGpLrr6cMArkY25SsVAN3TPP1hALblKxUAxy1z+jCA7TopAKb/xxAPkB06ppcE2KnzRw4cAJyiPjqUrzxA2lq+gQEXI/4fKQGwfvJ/8ACfu27pZQCO2q8pUQDQ/necy1cGAKYf7rl9+gCA82eP9OiA3QZ/5EADeE4/OiD96Lx+RAFwKz3TIwOq7HrinF4IAN0z9UgN2G+9vjtBAcA+4mf9IALg8HzpUr6iANjJN13bPzog3ly8ekABxF13XxmATM8rvX/A1Zht+kuPBYD2fz3GAyQ6ftNjAeItH+l9AuAcsm337CsP4LH7igJW3zzTAGD39eieQgBoxv7TowBOn/yl9wOA9SM0/eEBsXuWczo8BwAk/O2+iAC++7ocfoQAeZ1t1agB9s++wQBnfYH2jwKA04pAendAZcZ/RxBNHxKwfPEfHlDQ+WmWEgC7TcH21UMwQBLKV7D/hAQkTG+ewwDm008LECtfd8Bp/zU9IQDav/D0OwFKBttrUwOEy9cFkIP1UyMFRGsrv9uFB6S6i/RUgGRHZPd1BxSNRflSAaB8s4NA6W0BJ08r6UkAMVg/ou3fCQDlu9ukBpxo7CZYAVgBF2MWqZEC4LBYMfAA6e56evmATx2eHgdQfvtsgxAAlzsf4gHM5SsfAIfnoo4EKE5ZtE4NeCtfHED2mV+JEsB/99XxALAXvrOmlwn4V744ADiNUAJg+i9HqABITwmIN1lJVxmQ0dbSKwaA01thojIg2TGnVwkA5ZuzTL9KgL0W/1ZNYcCXnk16ZQD8sw279aMM4KBln14NADxq58YqA/bbjukVAMDm9bWvMiB271i+agAOXdePAoCrkcqAeMMj/X8NgO6ZHUgH/AUJ74OazCuVeQAAAABJRU5ErkJggg==');
background-size: auto 100%;
background-repeat: repeat-x;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABMCAIAAABSySbyAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAA5NJREFUeJzV2utW2kAQB3DfpLUIHiveoFCx2pZ6vADlUn2kCnITCQICDZE33c4qFMh9k9k53XP2kx/M/7fZmd2EbFReGIxfs/UBfzEERrLD3v9mm1XLuPMeHwKN4y67feFjIzygqLNIlRQQrbHLER7gWOPpKQG7DVaZIgF+6ixWowac9efpEQDfBzwEJWCrym5mSICKwRIP8/RkgIzGbrEApem8fMkAUL65CR4goy3T0wAO2vy24wBM008D4OU7QwJ8G6ylJwDAfJUNJEB5yg7b1IBjbZE+PCA/4e2MEgCXKxl4gJOeOb1swNEDT4UDgG08ek8KiNzxklumDwmwlq9sALT/4hQJAOW716QGpLrr6cMArkY25SsVAN3TPP1hALblKxUAxy1z+jCA7TopAKb/xxAPkB06ppcE2KnzRw4cAJyiPjqUrzxA2lq+gQEXI/4fKQGwfvJ/8ACfu27pZQCO2q8pUQDQ/necy1cGAKYf7rl9+gCA82eP9OiA3QZ/5EADeE4/OiD96Lx+RAFwKz3TIwOq7HrinF4IAN0z9UgN2G+9vjtBAcA+4mf9IALg8HzpUr6iANjJN13bPzog3ly8ekABxF13XxmATM8rvX/A1Zht+kuPBYD2fz3GAyQ6ftNjAeItH+l9AuAcsm337CsP4LH7igJW3zzTAGD39eieQgBoxv7TowBOn/yl9wOA9SM0/eEBsXuWczo8BwAk/O2+iAC++7ocfoQAeZ1t1agB9s++wQBnfYH2jwKA04pAendAZcZ/RxBNHxKwfPEfHlDQ+WmWEgC7TcH21UMwQBLKV7D/hAQkTG+ewwDm008LECtfd8Bp/zU9IQDav/D0OwFKBttrUwOEy9cFkIP1UyMFRGsrv9uFB6S6i/RUgGRHZPd1BxSNRflSAaB8s4NA6W0BJ08r6UkAMVg/ou3fCQDlu9ukBpxo7CZYAVgBF2MWqZEC4LBYMfAA6e56evmATx2eHgdQfvtsgxAAlzsf4gHM5SsfAIfnoo4EKE5ZtE4NeCtfHED2mV+JEsB/99XxALAXvrOmlwn4V744ADiNUAJg+i9HqABITwmIN1lJVxmQ0dbSKwaA01thojIg2TGnVwkA5ZuzTL9KgL0W/1ZNYcCXnk16ZQD8sw279aMM4KBln14NADxq58YqA/bbjukVAMDm9bWvMiB271i+agAOXdePAoCrkcqAeMMj/X8NgO6ZHUgH/AUJ74OazCuVeQAAAABJRU5ErkJggg==');
background-size: auto 100%;
background-repeat: repeat-x;
}
......@@ -27,9 +27,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options.cpid', options.cpid)
// 使用正则表达式来匹配数字和字母
var reg = /^[0-9a-zA-Z]+$/;
var fenggu = /^http:\/\/q.fg9.vip\/m\/q\/[0-9a-zA-Z]+$/;
// const labelcode = extraData.cpid
if (options.cpid && options.cpid.length > 14 && reg.test(options.cpid)) {
console.log('中汾页面');
......@@ -37,7 +38,6 @@ Page({
zhongfen:true,
showmodel:false
})
console.log('this.data.zhongfen',this.data.zhongfen)
// this.setData({
// webviewUrl: `https://tjfnew.china315net.com/dist/zhongfen/route.ashx?cpid=${options.cpid}`,
// });
......@@ -45,6 +45,12 @@ Page({
url:`/pages/anti/anti?cpid=${options.cpid}`
})
}
else if(fenggu.test(options.cpid) ){
console.log('丰谷页面')
wx.navigateTo({
url:'/pages/fenggu/AICheck/AICheck'
})
}
// wx.clearStorageSync(); // 清空本地缓存数据
wx.getSystemInfo({
success: (res) => {
......@@ -101,7 +107,7 @@ Page({
})
// console.log('status_zhi',status_zhi)
}
if(this.data.showmodel === true){
if(this.data.showmodel === true && !fenggu.test(options.cpid)){
wx.showModal({
title: '注意事项:',
content: this.data.content,
......
......@@ -789,9 +789,10 @@ Page({
// let score = res.data.confidence
let succ = ''
// ai通过状态
let aiState = 0;
this.setData({
isLoading: false,
isLoading: this.data.param ==='fenggu' ? true:false,
imagefile: imagefile,
phone_score: phone_score,
})
......@@ -903,7 +904,18 @@ Page({
} else {
notice = '算法不确定具体分类'
}
console.log('最终结果', notice)
if(this.data.param ==='fenggu'){
if (aiState === 1 ) {
wx.navigateTo({
url:`/pages/fenggu/success/success?time1${this.data.dtime || this.data.people_time}&time2=${this.data.people_replytime/1000 || this.data.datemill/1000}`
})
} else {
wx.navigateTo({
url:`/pages/fenggu/AICheck/AICheck?sameCodeState=${this.data.sameCodeState}`
})
}
return
}
//更新数据
this.setData({
isLoading: false,
......@@ -913,6 +925,7 @@ Page({
notice: notice,
aiState: aiState,
});
wx.setStorage({
key: 'notice',
data: notice
......
......@@ -5,79 +5,6 @@
<image class="loadingtrue" src="/assets/imgs/wating/truee.png" style="width: 260rpx; height: 50rpx;"></image>
</view>
<view class="res" wx:if="{{!isLoading}}">
<!-- 认证通过 -->
<!-- <block wx:if="{{aiState === 1 || (true_state === true && peo_state === 1 )}}"> -->
<!-- <image class="img" src="/assets/imgs/success/truee.png" bindtap="popup"></image> -->
<!-- <view class="modal-mask" bindtap="" wx:if="{{showModal}}"></view> -->
<!-- <image class="msg-img" src="/assets/imgs/success/successmag.png" bindtap="back"></image> -->
<!-- <view class="detail">
<view class="left">
<view class="title">
本次认证时间
</view>
<view class="value">{{dtime || people_time}}</view>
</view>
<view class="right">
<view class="title">
本次认证耗时
</view>
<view class="value">{{datemill/1000 || peeople_replytime/1000}}s</view>
</view>
</view> -->
<!-- 倒计时出现 -->
<!-- <view class="modal-dialog" wx:if="{{showModal}}" >
<p class="gunabi" bindtap="hidepopup" mode="widthFix,heightFix">关闭</p>
<text class="seconds">{{sendTime}}s</text>
<image class="img_on" src="https://ai.tj5.cc:35437/static/succes_on.gif"></image>
<image class="img_down" src="https://ai.tj5.cc:35437/static/succes_down.gif"></image>
</view> -->
<!-- <navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator> -->
<!-- </block> -->
<!-- 码不同 -->
<!-- <block wx:if="{{recognizeLabelCode !== labelCode&& recognizeLabelCode!=='码解析失败' || datajson !== labelCode && datajson!=='码解析失败' }}"> -->
<!-- <block wx:if="{{sameCodeState ===0 }}"> -->
<!-- <image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image> -->
<!-- <image class="msg-img" src="/assets/imgs/fail/fialmsgjson.png" bindtap="back"></image> -->
<!-- <view class="text_text" style="color: aliceblue;" ><text>点击拍照按钮重新认证</text></view> -->
<!-- <navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator> -->
<!-- <text style="color: aliceblue;"> 码不同</text>
<text style="color: aliceblue;">\n解析号码labelcode:{{recognizeLabelCode}}</text>
<text style="color: aliceblue;">\n解析号码datajson:{{datajson}}</text>
<text style="color: aliceblue;">\n标签号码:{{labelCodejson}}</text> -->
<!-- <image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
<image class="msg-img" src="/assets/imgs/different/different.png" bindtap="back"></image>
<view class="text_text" style="color: aliceblue;"><text>点击拍照按钮重新认证</text></view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator> -->
<!-- </block> -->
<!-- 认证未通过 -->
<!-- <block wx:if="{{ sameCodeState === 1 && aiState === 0 || recognizeLabelCode ==='码解析失败' && datajson==='码解析失败'}}"> -->
<!-- <block wx:if="{{ sameCodeState === 2 }}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
<image class="msg-img" src="/assets/imgs/fail/ffailmsg.png" bindtap="back"></image>
<view class="text_text" style="color: aliceblue;"><text>点击拍照按钮重新认证</text></view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</block> -->
<!-- <block wx:if="{{ (sameCodeState === 1 && aiState === 0 ) || (fail_state === true && sameCodeState === 0 ) }}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
<image class="msg-img" src="/assets/imgs/fail/ffailmsg.png" bindtap="back"></image>
<view class="text_text" style="color: aliceblue;"><text>点击拍照按钮重新认证</text></view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</block> -->
<!-- 优化 -->
<!-- 码不同 -->
<block wx:if="{{sameCodeState ===0 }}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
......@@ -86,13 +13,6 @@
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</block>
<!-- 未通过 -->
<!-- <block wx:if="{{sameCodeState === 2 || (sameCodeState === 1 && aiState === 0) || (fail_state === true && sameCodeState === 0)}}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
<image class="msg-img" src="/assets/imgs/fail/ffailmsg.png" bindtap="back"></image>
<view class="text_text" style="color: aliceblue;"><text>点击拍照按钮重新认证</text></view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</block> -->
<!-- 新增 -->
<block wx:if="{{sameCodeState === 2 || (fail_state === true && sameCodeState === 1) }}">
<image class="img" src="/assets/imgs/fail/takephotoo.png" bindtap="back"></image>
<block wx:if="{{aiState === 0 || (fail_state === true && sameCodeState === 0 ) }}">
......@@ -109,9 +29,6 @@
</block>
<!-- 通过 -->
<block wx:if="{{aiState ===1 || (true_state === true && peo_state === 1) }}">
<!-- <view wx:if="{{labelInfoUrl === true}}">
<web-view src="{{h5url}}"></web-view>
</view> -->
<image class="img" src="/assets/imgs/success/truee.png" bindtap="popup"></image>
<image class="msg-img" src="/assets/imgs/success/successmag.png" bindtap="back"></image>
<view class="detail">
......@@ -128,7 +45,6 @@
</block>
</view>
</view>
<!-- <image src="{{filePath}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> -->
......@@ -3,7 +3,8 @@
"projectname": "online",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
"urlCheck": false,
"bigPackageSizeSupport": false
},
"condition": {
"miniprogram": {
......@@ -16,8 +17,8 @@
},
{
"name": "",
"pathName": "pages/upload/upload",
"query": "",
"pathName": "pages/index/index",
"query": "cpid='EH013852089694401'",
"launchMode": "default",
"scene": null
},
......@@ -55,6 +56,20 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/fenggu/success/success",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/fenggu/takephoto/takephoto",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论