提交 313080e6 authored 作者: 常超凡's avatar 常超凡

新的提交

上级 06316cc9
......@@ -22,71 +22,12 @@ Page({
onLoad(options) {
this.cameraContext = wx.createCameraContext()
this.cameraContext.setZoom({
zoom: 2
zoom: 1
})
this.cameraFrame()
// this.cameraFrameApi()
},
// 视频流(后端校验二维码)
cameraFrameApi() {
let flag = true
const that = this
const listener = this.cameraContext.onCameraFrame((frame) => {
if (flag) {
flag = false
that.setData({
width: frame.width,
height: frame.height,
})
wx.canvasPutImageData({
canvasId: 'myCanvas',
width: frame.width,
height: frame.height,
data: new Uint8ClampedArray(frame.data),
success(rew) {
console.log(rew, 99);
wx.canvasToTempFilePath({
canvasId: 'myCanvas',
x: frame.width / 2 - 150,
y: frame.height / 2 - 150,
width: 300,
height: 300,
destWidth: 300,
destHeight: 300,
quality: 'high',
fileType: 'jpg',
success(path) {
console.log(path.tempFilePath, 66);
const base = wx.getFileSystemManager().readFileSync(path.tempFilePath, 'base64')
that.setData({
src: 'data:image/jpeg;base64,' + base
})
wx.request({
url: 'https://ai.tj5.cc:35437/object/',
method: "POST",
data: {
base
},
success(g) {
console.log(g, 'cccc');
flag = true
}
})
},
fail(rr) {
console.log(rr, 5555);
}
})
},
fail(err) {
console.log(err);
}
})
}
})
listener.start()
},
// 视频流(前端判断二维码)
cameraFrame() {
......@@ -101,7 +42,7 @@ Page({
await wx.canvasPutImageData({
canvasId: 'myCanvas',
x:0,
y:0,
y:-frame.height/5,
width: frame.width,
height: frame.height,
data: new Uint8ClampedArray(frame.data),
......@@ -117,19 +58,22 @@ Page({
})
const base = fileSystem.readFileSync(fileData.tempFilePath, 'base64')
const qr_result = await that.handleCodeAnalysis(base)
console.log('qr_result',flag,5555,qr_result.data.codeinfo);
// 前端校验取消
// const data = new Uint8ClampedArray(frame.data);
// // const nData = data.slice(data.length / 4, data.length / 4 * 3)
// const qr_result = qrcode.decodefrank(frame.width, frame.height, data)
if (qr_result?.codeinfo) {
// console.log('qe_result',qr_result)
// console.log('qr_result.data.codeinfo',qr_result.data.codeinfo)
if (qr_result.data.codeinfo) {
that.setData({
height: frame.height,
width: frame.width
})
// 原图(默认放大两倍)
const photo1 = await that.handleTakePoto()
const photo1 = await that.handleTakePoto(that.cameraContext, 1)
// 放大图(四倍)
const photo2 = await that.handleTakePoto(that.cameraContext, 4)
const photo2 = await that.handleTakePoto(that.cameraContext, 4,{flash:'on'})
// 原图base64
const base64_1 = fileSystem.readFileSync(photo1.tempImagePath, 'base64')
......@@ -151,7 +95,9 @@ Page({
})
})
} else {
setTimeout(() => {
flag = true
},750)
}
}
......@@ -161,6 +107,7 @@ Page({
// 后端接口解析二维码
handleCodeAnalysis(base64) {
// console.log('base',base64)
return new Promise((resolve, reject) => {
wx.request({
url: 'https://www.7856.work:4433/api/Bym_upload/',
......@@ -185,6 +132,7 @@ Page({
zoom
})
return await context.takePhoto({
flash:param?.flash || 'off',
quality: param?.quality || 'high',
selfieMirror: param?.selfieMirror || false,
})
......
<!--pages/beiyinmei/beiyinmei.wxml-->
<view wx:if="{{!showPage}}" style="height: 100vh;width: 100vw;position: relative;z-index: 99;">
<camera device-position="back" frame-size="medium" flash="off" style="width: 100%; height: 100%;" mode="normal">
<camera device-position="back" frame-size="medium" flash="auto" style="width: 100%; height: 100%;" mode="normal">
<view class="prompt">
<image src="/assets/imgs/拍照框.png" style="width: 40%;" mode="widthFix" />
<image src="/assets/imgs/拍照框.png" style="width: 25%;" mode="widthFix" />
<text>请把二维码放置拍照框内</text>
</view>
</camera>
......@@ -23,6 +23,6 @@
</view>
</view>
<view style="visibility: hidden;position: fixed;top: 9999px;left: 0px;">
<view style="visibility: hidden;position: fixed;top: 99999px;left: 0px;">
<canvas canvas-id="myCanvas" id="myCanvas" style="width:400px;height: 400px;" />
</view>
......@@ -7,7 +7,7 @@ var take_Count = 0;
Page({
// 页面的初始数据
data: {
progressNumber:0, //拍照页面进度展示
progressNumber: 0, //拍照页面进度展示
image: '',
windowWidth: '',
windowHeight: '',
......@@ -64,7 +64,7 @@ Page({
},
onLoad: function (options) {
const param = options.param;
console.log('param1',param)
console.log('param1', param)
wx.setStorage({
key: 'param',
data: param
......@@ -72,22 +72,23 @@ Page({
var that = this
this.Sounds();
const dongtaishuju_chuan = wx.getStorageSync('dongtaishuju')
switch (dongtaishuju_chuan) {
case 1:
this.Countone_Time();
break;
case 2:
this.Counttwo_Time();
break;
case 3:
this.Countthree_Time();
break;
default:
console.log('不等于1,2,3次')
this.setData({
longtime_state: true
})
}
//注释长时间不拍照
// switch (dongtaishuju_chuan) {
// case 1:
// this.Countone_Time();
// break;
// case 2:
// this.Counttwo_Time();
// break;
// case 3:
// this.Countthree_Time();
// break;
// default:
// console.log('不等于1,2,3次')
// this.setData({
// longtime_state: true
// })
// }
var nCounter = 0
const labelInfo = JSON.parse(wx.getStorageSync('extraData'))
......@@ -139,50 +140,53 @@ Page({
height: frame.height, //512 381
data: clamped,
success: (res) => {
var inter = setInterval(function () {
that.setData({
smsFlag: true,
sendTime: that.data.snsMsgWait,
snsMsgWait: that.data.snsMsgWait - 1
});
if (that.data.snsMsgWait === -6 && !that.data.take_state && that.data.longtime_state === true) {
let fail_text = '长时间不拍照1'
// console.log('fail_text', fail_text)
that.setData({
longTimeTakephoto: true
})
// console.log('that.data.takephoto',that.data.takephoto)
if (fail_text !== '' && that.data.takephoto !== 'succes') {
// console.log('进行第一次拍照')
that.takePhoto()
let take_photo_1 = '长时间不拍照2'
let takephoto = 'succes'
that.setData({
take_photo_1,
takephoto
});
}
// console.log('that.data.takephoto',that.data.takephoto)
if (fail_text !== '' && that.data.takephoto === 'succes' && that.data.all_state !== true) {
setTimeout(() => {
// console.log('进行第二次拍照')
that.takePhoto2()
}, 3500)
let take_state = true
that.setData({
take_state,
all_state: true
});
}
}
if (that.data.snsMsgWait < 0) {
clearInterval(inter)
that.setData({
snsMsgWait: -5,
snsFlag: false
})
}
}, 1000);
// var inter = setInterval(function () {
// that.setData({
// smsFlag: true,
// sendTime: that.data.snsMsgWait,
// snsMsgWait: that.data.snsMsgWait - 1
// });
// console.log('that.data.snsMsgWait', that.data.snsMsgWait)
// console.log('that.data.take_state', that.data.take_state)
// console.log('that.data.longtime_state', that.data.longtime_state)
// if (that.data.snsMsgWait === -6 && !that.data.take_state && that.data.longtime_state === true) {
// let fail_text = '长时间不拍照1'
// // console.log('fail_text', fail_text)
// that.setData({
// longTimeTakephoto: true
// })
// // console.log('that.data.takephoto',that.data.takephoto)
// if (fail_text !== '' && that.data.takephoto !== 'succes') {
// // console.log('进行第一次拍照')
// that.takePhoto()
// let take_photo_1 = '长时间不拍照2'
// let takephoto = 'succes'
// that.setData({
// take_photo_1,
// takephoto
// });
// }
// // console.log('that.data.takephoto',that.data.takephoto)
// if (fail_text !== '' && that.data.takephoto === 'succes' && that.data.all_state !== true) {
// setTimeout(() => {
// // console.log('进行第二次拍照')
// that.takePhoto2()
// }, 3500)
// let take_state = true
// that.setData({
// take_state,
// all_state: true
// });
// }
// }
// if (that.data.snsMsgWait < 0) {
// clearInterval(inter)
// that.setData({
// snsMsgWait: -5,
// snsFlag: false
// })
// }
// }, 1000);
// 转换临时文件
wx.canvasToTempFilePath({
canvasId: 'myCanvas',
......@@ -199,22 +203,26 @@ Page({
// console.log('成功成功成功')
//进行编码
const base = wx.getFileSystemManager().readFileSync(res.tempFilePath, 'base64')
console.log('base',base)
// console.log('base',base)
that.setData({
src: res.tempFilePath
});
wx.request({
url: 'https://ai.tj5.cc:35437/object/',
// url: 'https://tj5.cc:4433/object/',
// url: 'https://ai.tj5.cc:35437/object/',
url: 'https://www.7856.work:4433/clear_fuzzy_detect/', //目标检测+判断清晰模糊接口
// url:'https://ai.china315net.com:35437/object/',
method: "POST",
data: {
base
},
success: (res) => {
console.log('res.data', res.data)
var result = res.data.result;
var coord = res.data.coord[0][5]
console.log('coord', coord)
var minindex = -1;
var mindistance = 2;
console.log('length', result.length)
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);
......@@ -254,7 +262,12 @@ Page({
})
status = 'true'
// console.log('that.data.takephoto', that.data.takephoto)
if (text == text && that.data.takephoto !== 'succes' && that.data.take_photo_1 === '') {
if (coord != 0) {
wx.showToast({
title: '当前位置模糊,请找合适的位置',
})
}
if (text == text && that.data.takephoto !== 'succes' && that.data.take_photo_1 === '' && coord === 0) {
// console.log('大框参数完成进行拍照')
that.takePhoto();
let takephoto = 'succes'
......@@ -436,35 +449,35 @@ Page({
res_errMsg: res_errMsg
})
wx.removeStorageSync('res_errMsg')
//倒计时
var inter = setInterval(function () {
that.setData({
smsFlag: true,
sendTime: that.data.snsMsgWait_1,
snsMsgWait_1: that.data.snsMsgWait_1 - 1
});
if (that.data.snsMsgWait_1 === -6 && res_errMsg != '') {
// console.log('长时间未响应')
setTimeout(() => {
that.takePhoto2()
}, 2500)
that.setData({
longtime_state: true
})
}
if (that.data.snsMsgWait_1 < 0) {
clearInterval(inter)
that.setData({
snsMsgWait_1: -5,
snsFlag: false
})
// console.log('that.data.snsMsgWait_2', that.data.snsMsgWait_1)
}
}.bind(that), 1000);
let camera_state = res.errMsg
that.setData({
camera_state
})
//倒计时注释倒计时
// var inter = setInterval(function () {
// that.setData({
// smsFlag: true,
// sendTime: that.data.snsMsgWait_1,
// snsMsgWait_1: that.data.snsMsgWait_1 - 1
// });
// if (that.data.snsMsgWait_1 === -6 && res_errMsg != '') {
// // console.log('长时间未响应')
// setTimeout(() => {
// that.takePhoto2()
// }, 2500)
// that.setData({
// longtime_state: true
// })
// }
// if (that.data.snsMsgWait_1 < 0) {
// clearInterval(inter)
// that.setData({
// snsMsgWait_1: -5,
// snsFlag: false
// })
// // console.log('that.data.snsMsgWait_2', that.data.snsMsgWait_1)
// }
// }.bind(that), 1000);
// let camera_state = res.errMsg
// that.setData({
// camera_state
// })
},
fail: function (res) {
console.log("" + res);
......@@ -527,7 +540,7 @@ Page({
// 设置拍照进度条
this.setData({
progressNumber:50,
progressNumber: 50,
})
var that = this
......@@ -620,7 +633,7 @@ Page({
if (res.errMsg.indexOf('timeout') !== -1) {
// console.log('请求超时')
const datajson = '码解析失败'
console.log('datajson1',datajson)
console.log('datajson1', datajson)
wx.setStorage({
key: 'datajson',
data: datajson
......@@ -631,7 +644,7 @@ Page({
if (!res.data) {
// console.log('网络请求没有返回任何数据')
const datajson = '码解析失败'
console.log('datajson1',datajson)
console.log('datajson1', datajson)
wx.setStorage({
key: 'datajson',
data: datajson
......@@ -646,12 +659,12 @@ Page({
// url: 'https://tj5.cc:4433/classify16/',
method: "POST",
data: {
'image_type': 20,
'image_type': 50,
'base': base,
},
success: (res) => {
let result_value = res.data.result
console.log('result_value',result_value)
console.log('result_value', result_value)
let yuan_file = res.data.image_path
// console.log('yuan_file', yuan_file)
wx.setStorage({
......@@ -671,7 +684,7 @@ Page({
// console.log('hint_phone', hint_phone)
} else {
console.log('不等于14分类')
console.log('result_value',result_value)
console.log('result_value', result_value)
let hint_phone = result_value
wx.setStorage({
key: 'hint_phone',
......@@ -750,9 +763,10 @@ Page({
// console.log('takePhoto2')
// 设置拍照进度条
this.setData({
progressNumber:100,
progressNumber: 100,
})
const that = this;
function isIOS() {
let system = wx.getSystemInfoSync().system
return system.indexOf('iOS') !== -1
......@@ -829,12 +843,11 @@ Page({
// }
// 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)){
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) {
} else if (benchmarkLevel > 40) {
timeS = 350;
} else if (benchmarkLevel > 30) {
timeS = 380;
......@@ -849,9 +862,9 @@ Page({
}
},
takePhotoZoom: function (one_zoom,timeS) {
console.log('one_zoom',one_zoom)
console.log('timeS',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,
......@@ -917,105 +930,107 @@ Page({
console.log('播放结束')
})
},
Countone_Time: function () {
console.log('1')
var inter = setInterval(function () {
this.setData({
smsFlag: true,
snsMsgWait_one: this.data.snsMsgWait_one - 1
});
// console.log('this.data.snsMsgWait_one', this.data.snsMsgWait_one)
if (this.data.snsMsgWait_one == 0) {
this.setData({
longTimeOnce: true
})
clearInterval(inter)
// console.log('this.data.all_state', this.data.all_state)
// console.log('this.data.singe_state', this.data.singe_state)
// console.log('longTimeOnce',this.data.longTimeOnce)
if (this.data.singe_state === true && this.data.all_state === false && this.data.longTimeOnce === true) {
console.log('倒计时0拍照one')
setTimeout(() => {
this.takePhoto2();
this.setData({
all_state: true
})
// console.log('all_state', this.data.all_state)
}, 350);
}
}
}.bind(this), 1200);
},
Counttwo_Time: function () {
console.log('2')
var inter = setInterval(function () {
this.setData({
smsFlag: true,
snsMsgWait_twotime: this.data.snsMsgWait_twotime - 1
});
// console.log('this.data.snsMsgWait_twotime', this.data.snsMsgWait_twotime)
if (this.data.snsMsgWait_twotime == 0) {
clearInterval(inter)
// console.log('this.data.all_state', this.data.all_state)
// console.log('this.data.singe_state', this.data.singe_state)
this.setData({
longTimeTwo: true
})
// console.log('this.data.singe_state',this.data.singe_state)
// console.log('this.data.all_state',this.data.all_state)
// console.log('this.data.longtimeTwo',this.data.longTimeTwo)
if (this.data.singe_state == true && this.data.all_state == false && this.data.longTimeTwo === true) {
console.log('倒计时0拍照two')
setTimeout(() => {
// console.log('this.data.take_state', this.data.take_state)
if (this.data.take_state == true) {
//注释长时间不拍照,换种方式提示
// Countone_Time: function () {
// console.log('1')
// var inter = setInterval(function () {
// this.setData({
// smsFlag: true,
// snsMsgWait_one: this.data.snsMsgWait_one - 1
// });
// // console.log('this.data.snsMsgWait_one', this.data.snsMsgWait_one)
// if (this.data.snsMsgWait_one == 0) {
// this.setData({
// longTimeOnce: true
// })
// clearInterval(inter)
// // console.log('this.data.all_state', this.data.all_state)
// // console.log('this.data.singe_state', this.data.singe_state)
// // console.log('longTimeOnce',this.data.longTimeOnce)
// if (this.data.singe_state === true && this.data.all_state === false && this.data.longTimeOnce === true) {
// console.log('倒计时0拍照one')
// setTimeout(() => {
// this.takePhoto2();
// this.setData({
// all_state: true
// })
// // console.log('all_state', this.data.all_state)
// }, 350);
// }
// }
// }.bind(this), 1200);
// },
// Counttwo_Time: function () {
// console.log('2')
// var inter = setInterval(function () {
// this.setData({
// smsFlag: true,
// snsMsgWait_twotime: this.data.snsMsgWait_twotime - 1
// });
// // console.log('this.data.snsMsgWait_twotime', this.data.snsMsgWait_twotime)
// if (this.data.snsMsgWait_twotime == 0) {
// clearInterval(inter)
// // console.log('this.data.all_state', this.data.all_state)
// // console.log('this.data.singe_state', this.data.singe_state)
// this.setData({
// longTimeTwo: true
// })
// // console.log('this.data.singe_state',this.data.singe_state)
// // console.log('this.data.all_state',this.data.all_state)
// // console.log('this.data.longtimeTwo',this.data.longTimeTwo)
// if (this.data.singe_state == true && this.data.all_state == false && this.data.longTimeTwo === true) {
// console.log('倒计时0拍照two')
// setTimeout(() => {
// // console.log('this.data.take_state', this.data.take_state)
// if (this.data.take_state == true) {
// // console.log('不进行拍照')
// } else {
// this.takePhoto2();
// this.setData({
// all_state: true
// })
// }
// // console.log('倒计时0拍照twoall_state', this.data.all_state)
// }, 350);
// }
// }
// }.bind(this), 1200);
// },
// Countthree_Time: function () {
// console.log('3')
// var inter = setInterval(function () {
// this.setData({
// smsFlag: true,
// snsMsgWait_three: this.data.snsMsgWait_three - 1
// });
// // console.log('this.data.snsMsgWait_three', this.data.snsMsgWait_three)
// if (this.data.snsMsgWait_three == 0) {
// clearInterval(inter)
// this.setData({
// longTimeThree: true
// })
// // console.log('this.data.singe_state',this.data.singe_state)
// // console.log('this.data.all_state',this.data.all_state)
// // console.log('this.data.longtimeThree',this.data.longTimeThree)
// if (this.data.singe_state == true && this.data.all_state == false && this.data.longTimeThree === true) {
// console.log('倒计时0拍照three')
// setTimeout(() => {
// // console.log('this.data.take_state', this.data.take_state)
// if (this.data.take_state == true) {
// console.log('不进行拍照')
} else {
this.takePhoto2();
this.setData({
all_state: true
})
}
// console.log('倒计时0拍照twoall_state', this.data.all_state)
}, 350);
}
}
}.bind(this), 1200);
},
Countthree_Time: function () {
console.log('3')
var inter = setInterval(function () {
this.setData({
smsFlag: true,
snsMsgWait_three: this.data.snsMsgWait_three - 1
});
// console.log('this.data.snsMsgWait_three', this.data.snsMsgWait_three)
if (this.data.snsMsgWait_three == 0) {
clearInterval(inter)
this.setData({
longTimeThree: true
})
// console.log('this.data.singe_state',this.data.singe_state)
// console.log('this.data.all_state',this.data.all_state)
// console.log('this.data.longtimeThree',this.data.longTimeThree)
if (this.data.singe_state == true && this.data.all_state == false && this.data.longTimeThree === true) {
console.log('倒计时0拍照three')
setTimeout(() => {
// console.log('this.data.take_state', this.data.take_state)
if (this.data.take_state == true) {
console.log('不进行拍照')
} else {
this.takePhoto2();
this.setData({
all_state: true
})
}
// console.log('all_state', this.data.all_state)
}, 350);
}
}
}.bind(this), 1200);
},
// } else {
// this.takePhoto2();
// this.setData({
// all_state: true
// })
// }
// // console.log('all_state', this.data.all_state)
// }, 350);
// }
// }
// }.bind(this), 1200);
// },
handleOpenVideo() {
wx.navigateTo({
url: '/pages/video/video',
......
......@@ -48,7 +48,7 @@
</camera>
<view class="content">
<text style='font-size:34rpx'>请将识别框对准结构三维码</text>
<image src="/assets/imgs/拍照框.png" mode="widthFix" style="margin:100rpx 0; width: 50%;"/>
<image src="/assets/imgs/拍照框.png" mode="widthFix" style="margin:75rpx 0; width: 35%;"/>
<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;"/>
......
......@@ -18,6 +18,7 @@
<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" bind:tap="handleOpenVideo">查看视频教程</view>
<navigator class="btn video-btn" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</view>
<!-- 底部文字 -->
......
......@@ -8,21 +8,25 @@ Page({
aiState: 0, //展示成功或失败页面,
time1: '', //本次认证时间
time2: '', //认证耗时
bg_color:''
bg_color:'',
Labeldiff:0 //展示码不同页面
},
onLoad(options) {
const {
aiState,
time1,
time2
time2,
Labeldiff
} = options
console.log(options,time1);
// console.log(options,time1);
console.log('options.Labeldiff',options.Labeldiff)
this.setData({
aiState: aiState || 0,
time1: time1 || '',
time2: time2 && (new Date().getTime() - time2) / 1000 || '',
bg_color: getApp().page_bg
bg_color: getApp().page_bg,
Labeldiff:Labeldiff || 0
})
},
// 返回首页
......
......@@ -15,6 +15,19 @@
</view>
<image src="/assets/imgs/验证成功底部.png" mode="widthFix" style="width: 100%;" />
</view>
<!-- 码不同页面 -->
<view wx:if="{{Labeldiff == 1 }}" 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" bind:tap="handleOpenVideo">继续查看视频教程</view>
</view>
</view>
<image src="/assets/imgs/验证成功底部.png" mode="widthFix" style="width: 100%;" />
</view>
<!-- 验证失败页面 -->
<view wx:else class="error-content full">
<view class="content-text">
......
......@@ -25,6 +25,7 @@ Page({
openid: '',
aiState: 0,
sameCodeState: 0,
Labeldiff:0,
filePath: '',
datajson: '',
labelCodejson: '',
......@@ -321,32 +322,33 @@ Page({
const base = wx.getFileSystemManager().readFileSync(this.data.filePath, 'base64')
//增加不需要进行码判断
this.checkAiResult(base);
// console.log('base', base)
// if (this.data.labelCode) {
// // console.log('开始检查标签相似')
// this.checkIsSameCode(base, (state) => {
// this.setData({
// sameCodeState: state
// })
// if (state === 1) {
// this.checkAiResult(base);
// } else {
// this.setData({
// isLoading: false,
// })
// }
// })
// console.log("sameCodeState", this.data.sameCodeState)
// } else {
// console.log('进入不需要检查标签相似')
// this.setData({
// sameCodeState: 1,
// userimage: false,
// userinfo_name: false
// })
// this.checkAiResult(base);
// }
// console.log('base', base)
//判断标签序号
if (this.data.labelCode) {
// console.log('开始检查标签相似')
this.checkIsSameCode(base, (state) => {
this.setData({
sameCodeState: state
})
if (state === 1) {
this.checkAiResult(base);
} else {
this.setData({
isLoading: false,
})
}
})
console.log("sameCodeState", this.data.sameCodeState)
} else {
console.log('进入不需要检查标签相似')
this.setData({
sameCodeState: 1,
userimage: false,
userinfo_name: false
})
this.checkAiResult(base);
}
},
//检查标签是否相同
checkIsSameCode(base, cb) {
......@@ -464,6 +466,7 @@ Page({
});
} else {
console.log('码不同')
const Labeldiff = 1
cb(0);
// console.log('码不同', this.data.sameCodeState)
const dtime2 = util.formatTime(new Date());
......@@ -506,6 +509,10 @@ Page({
},
success: (res) => {
console.log('all入库成功', res);
wx.reLaunch({
url: `/pages/result/result?Labeldiff=${Labeldiff}`
})
return
},
fail: (error) => {
console.log('入库失败', error);
......@@ -739,17 +746,18 @@ Page({
// url:'https://www.7856.work:4433/api/classify16/',
method: 'POST',
data: {
'image_type': 20,
'image_type': 50,
'base': base,
},
success: (res) => {
console.log('base',base)
console.log('打印分类接口返回数据res.data', res.data)
let imagefile = res.data.image_path
const classScore = res.data.result
const max_score = Math.max.apply(null, res.data.confidence)
const max_score_value = max_score.toFixed(3)
const Score_list = res.data.confidence
// console.log('Score_list', Score_list)
console.log('Score_list', Score_list)
for (var i = 0; i < Score_list.length; i++) {
Score_list[i] = Score_list[i].toFixed(3);
}
......@@ -931,7 +939,7 @@ Page({
key: 'notice',
data: notice
})
console.log('notice调用人工服务',notice)
console.log('notice结果展示',notice)
if (notice != '手机边框') {
if (aiState !== 1) {
Count++;
......@@ -1223,7 +1231,7 @@ Page({
// 跳转到结果页面
wx.reLaunch({
url: `/pages/result/result?time1=${util.formatTime(new Date()) || this.data.people_time}&time2=${new Date().getTime()}&aiState=${aiState}`
url: `/pages/result/result?time1=${util.formatTime(new Date()) || this.data.people_time}&time2=${new Date().getTime()}&aiState=${aiState}&Labeldiff=${this.dataLabeldiff}`
})
return
},
......
......@@ -4,7 +4,7 @@
"setting": {
"compileHotReLoad": true,
"urlCheck": false,
"bigPackageSizeSupport": false
"bigPackageSizeSupport": true
},
"condition": {
"miniprogram": {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论