提交 90b925ec authored 作者: 常超凡's avatar 常超凡

初始化

上级
# Auto detect text files and perform LF normalization
* text=auto
# Windows
[Dd]esktop.ini
Thumbs.db
$RECYCLE.BIN/
# macOS
.DS_Store
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
# Node.js
node_modules/
# WX_takePhoto
小程序框内拍照
简书:https://www.jianshu.com/p/e22fba276e52
// app.ts
App({
globalDate: {
global: 1,
userLocationAuth: false,
cameraAuth: false,
extraData:null
},
onLaunch() {
// 展示本地存储能力
const logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
this.ctx = wx.createCameraContext();
// 登录
wx.login({
success(res) {
var openid = res.code
console.log('openid', openid)
// 发送 res.code 到后台换取 openId, sessionKey, unionId
wx.setStorage({
key: 'openid',
data: openid
})
wx.navigateTo({
url: '../miniprogram/pages/upload/upload'
})
}
})
},
onShow(options) {
// wx.clearStorageSync(); // 清空本地缓存数据
// console.log('options', options)
if (options.referrerInfo.extraData) {
console.log('进来了')
let extraData = options.referrerInfo.extraData;
console.log('extraData', extraData)
if (typeof (extraData) === 'string') {
extraData = JSON.parse(options.referrerInfo.extraData)
}
// console.log('到这里extraData',extraData)
wx.setStorage({
key: 'extraData',
data: extraData,
})
// 启动摄像头预览
// this.ctx.startPreview();
// console.log('labelInfoUrl.success', labelInfoUrl.success)
}else{
console.log('options.referrerInfo.extraData',options.referrerInfo.extraData)
console.log('options.extraData',options.extraData)
console.log('没有获取到数据')
wx.setStorage({
key: 'extraData',
data: extraData,
})
}
},
})
\ No newline at end of file
{
"pages": [
"pages/index/index",
"pages/attention/attention",
"pages/cameraTakePhoto/cameraTakePhoto",
"pages/upload/upload"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "AI验证",
"navigationBarTextStyle": "black",
"backgroundColor": "#fff",
"backgroundColorTop": "#Afff",
"backgroundColorBottom": "#Afff"
},
"sitemapLocation": "sitemap.json",
"permission":{
"scope.userLocation": {
"desc": "位置信息将用于定位"
}
},
"requiredPrivateInfos": [
"getLocation"
]
}
\ No newline at end of file
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}
// componets/loading/index.js.js
let styleList = []
let bg = '#edf0f7'
for (var i = 0; i <= 35; i++) {
if (i <= 8) {
bg = '#edf0f7'
} else if (i > 8 && i <= 16) {
bg = '#d5dbe9'
} else if (i > 16 && i <= 24) {
bg = '#677ab4'
} else if (i > 24 && i <= 35) {
bg = '#304999'
}
styleList.push({
'transform': i * 10 + 'deg',
'bg': bg
})
}
let timer
Component({
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
default: false
},
msg: {
type: String,
default: ''
},
speed: {
type: Number,
default: 1000
}
},
/**
* 组件的初始数据
*/
data: {
styleList: styleList
},
created() {
this.setData({
styleList: styleList
})
this.loading()
},
attached() {},
/**
* 组件的方法列表
*/
methods: {
loading() {
// console.log(this.properties.speed)
let index = 0
timer = setInterval(() => {
var item = 'styleList[' + index + '].bg'
if (index <= 36) {
this.setData({
[item]: 'white'
})
index += 1
} else {
clearInterval(timer)
}
}, 100);
},
stop() {
clearInterval(timer)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="loading-row">
<view class="loading-cell">
<view class="circle-line" id='box'>
<image class="msg" src="/assets/imgs/checking/chengkingText.png"></image>
<view class="line-box" wx:for="{{styleList}}" style="transform:rotate({{item.transform}});">
<text class="line" style="background-color:{{item.bg}};"></text>
</view>
</view>
</view>
<!-- <button bindtap="loading">点击执行</button>
<button bindtap="stop">点击停止</button> -->
</view>
\ No newline at end of file
.loading-row {
width: 100%;
display: flex;
justify-content: space-around;
}
.loading-cell {
width: 100%;
text-align: center;
}
.circle-line {
width: 500rpx;
height: 500rpx;
/* padding-top: 150rpx; */
display: inline-block;
position: relative;
}
.msg {
display: block;
width: 227rpx;
height: 53rpx;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 38rpx;
}
.circle-line .line-box {
display: block;
width: 50%;
height: 5px;
opacity: .7;
position: absolute;
top: calc(50% - 2.5px);
left: 0px;
transform-origin: center right;
animation: circle 1.5s linear infinite;
}
.circle-line .line {
content: '';
display: block;
width: 15px;
height: 5px;
position: absolute;
top: 0;
/* 中心距离 */
right: 70px;
}
/* 第二个 */
.circle-line-spin {
width: 100px;
height: 100px;
display: inline-block;
position: relative;
animation: circle-line 1.5s linear infinite;
}
.circle-line-spin text {
display: block;
width: 50%;
height: 5px;
opacity: .7;
position: absolute;
top: calc(50% - 2.5px);
left: 0px;
transform-origin: center right;
}
@keyframes circle-line {
from {
transform: rotate(-360deg);
}
to {
transform: rotate(10deg);
}
}
.circle-line-spin text::before {
content: '';
display: block;
width: 15px;
height: 5px;
position: absolute;
top: 0;
right: 10px;
background-color: #a8c992;
}
.circle-line-spin text:nth-child(1) {
transform: rotate(0deg);
animation-delay: 0.2s;
}
.circle-line-spin text:nth-child(2) {
transform: rotate(45deg);
animation-delay: 0.4s;
}
.circle-line-spin text:nth-child(3) {
transform: rotate(90deg);
animation-delay: 0.6s;
}
.circle-line-spin text:nth-child(4) {
transform: rotate(135deg);
animation-delay: 0.8s;
}
.circle-line-spin text:nth-child(5) {
transform: rotate(180deg);
animation-delay: 1s;
}
.circle-line-spin text:nth-child(6) {
transform: rotate(225deg);
animation-delay: 1.2s;
}
.circle-line-spin text:nth-child(7) {
transform: rotate(270deg);
animation-delay: 1.4s;
}
.circle-line-spin text:nth-child(8) {
transform: rotate(315deg);
animation-delay: 1.6s;
}
\ No newline at end of file
Page({
data:{
notice:''
},
bindViewTaptype() {
wx.reLaunch({
url: '../index/index',
})
},
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="page">
<view class="background">
<text class="text1">\n\n
1、将整个结构三维码放到识别框中,等待认证(认证过程中保持一定的距离,码的清晰完整)\n\n</text>
<text>2、确保标签与背景保持在同一平面内,便于聚焦\n\n</text>
<text>3、在正常的灯光下进行认证(不能过于黑暗,刻意曝光导致模型识别不到码)\n\n</text>
<text>4、认证时避免剧烈晃动(晃动后拍出来的图像会模糊,不易识别)\n\n</text>
<text>5、认证过程中请保持稳定,等待认证结果显示时移动手机\n\n</text>
<text>6、每次只能认证微信扫描进入主页的一枚(否则会提示码不同)\n\n</text>
<text>祝您使用愉快!\n</text>
</view>
<view class="button2" style="background-color: rgb(165, 165, 165);">
<button bindtap="bindViewTaptype">返回认证</button>
</view>
</view>
\ No newline at end of file
.background{
/* font-size: large; */
color:whitesmoke;
margin: .5rem;
}
.button2{
margin-top: 20%;
margin-left: auto;
margin-right: auto;
width: 184px;
line-height: 0;
}
.page{
background-color: rgb(158, 158, 158);
width: 100%;
height: 100vh;
}
\ No newline at end of file
差异被折叠。
<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">
<view class="daojishi">
<view wx:if="{{dongtaishuju_chuan == 1}}">
<text style="font-size: xx-large;">{{snsMsgWait_one}}</text>
<view class="text_hint">
</view>
</view>
<view wx:if="{{dongtaishuju_chuan == 2}}">
<text style="font-size: xx-large;">{{snsMsgWait_twotime}}</text>
<!-- <view class="text_hint">
<text>\n加油,你可以的!</text>
</view> -->
</view>
<view wx:if="{{dongtaishuju_chuan == 3}}">
<text style="font-size: xx-large;">{{snsMsgWait_three}}</text>
<!-- <view class="text_hint">
<text>\n加油,相信自己!</text>
</view> -->
</view>
</view>
<cover-view class='camerabgImage'>
<cover-view class="active">
<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-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-image2-2 " src="/assets/imgs/ding.png"></cover-image>
<cover-image wx:else=" " class="active-image2" src="/assets/imgs/shanshuo.gif"></cover-image>
</view>
<view class="advision" style="display:{{isShowads}};">
<image class="" src=""></image>
<view class="" bindtap="cancelAd"></view>
</view>
</cover-view>
</cover-view>
<cover-view class="singboard" style="margin-top: -350px;">
<cover-image wx:if="{{state=='left' || state_x =='left'}}" src="/assets/imgs/jtright.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=='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-view>
</camera>
<!-- <image src="{{mybase64}}"></image> -->
</view>
<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>
<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> -->
<!-- <image src="{{bigfileimage}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> -->
<!-- </camera> -->
</view>
\ No newline at end of file
.camera-box {
width: 100vw;
height: 100vh;
}
.camera-box .camerabgImage .active {
/* position: absolute; */
margin-top: 58%;
/* width: 60%; */
width: 100%;
margin-left: auto;
margin-right: auto;
}
.active-image {
display: block;
width: 240rpx;
height: 240rpx;
margin-top: 45px;
position: absolute;
margin-left: 260rpx;
margin-right: auto;
background-position: center;
background-repeat: repeat-x;
z-index: 1;
}
.camera-box .camerabgImage .active-image2 {
width: 350rpx;
height: 350rpx;
margin: 25px 25px;
/* position: absolute; */
margin-left: auto;
margin-right: auto;
}
.active-image2_small{
width: 240rpx;
height: 240rpx;
margin: 45px 80px;
position: absolute;
}
.active-image2-2 {
width: 350rpx;
height: 350rpx;
margin: 20px 25px;
position: relative;
margin-right: auto;
margin-left: auto;
}
.text {
font-size: 38rpx;
font-weight: 00rpx;
color:#6309f5;
line-height: 99rpx;
/* margin: auto; */
width: 100%;
margin-right: auto;
margin-left: auto;
text-align: center;
}
.text_bext{
font-size: 36rpx;
font-weight: 00rpx;
/* color:#6309f5; */
line-height: 76rpx;
/* margin: auto; */
width: 100%;
margin-right: auto;
margin-left: auto;
text-align: center;
border: 2rpx;
border-radius: 68rpx;
background-color: rgb(237, 239, 247);
}
.text_2 {
/* font-size: 25rpx; */
/* height: 100%; */
font-weight: 00rpx;
color:#6309f5;
margin: auto;
/* line-height: 40rpx; */
}
.bexit{
width: 450rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
/* margin-top: 15%; */
font-size: 36rpx;
/* color: aliceblue; */
margin: 100rpx auto;
border:2rpx;
border-radius: 70rpx;
background-color: rgb(237, 239, 247);
}
.camera-box .camerabgImage .btn {
width: 108rpx;
height: 110rpx;
border-radius: 50%;
background: #fff;
border: 6rpx solid#fff;
/* margin: 0 auto */
margin-top: 320rpx;
margin-left: 100rpx;
}
.camera-box .camerabgImage .btn .button {
width: 102rpx;
height: 102rpx;
border-radius: 50%;
border: 4rpx solid#000
}
.indicate{
margin-left: auto;
margin-top: -350rpx;
position: absolute;
}
.div{
width: 100%;
margin: auto;
}
.daojishi{
text-align: center;
width: 100%;
position: fixed;
margin-top:100px;
font-weight: 00rpx;
color:rgb(218, 13, 13);
font-size: x-large;
}
.text_hint{
height: 100%;
margin-top: 83%;
}
//index.js
//获取应用实例
const app = getApp()
var counter = 0;
Page({
/**
* 页面的初始数据
*/
data: {
userInfo: {},
src: "../../assets/imgs/takephoto.jpg",
takephoto_txt: "点击图标开始认证识别",
dongtaishuju: 0,
phone_model: '',
benchmarkLevel: 0,
content: "1.识别时请将整个结构三维码放到识别框中,保持画面清晰稳定直到显示认证结果\r\n2.确保标签与背景保持在同一平面内,便于手机相机聚焦\r\n3.AI验证的标签需要与扫描进入主页的这枚标签一致(否则会提示码不同)",
showCover: true,
status_zhi: '',
extraData: '',
all_info: '',
cpid: '',
showmodel:true,
zhongfen:false
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('options.cpid', options.cpid)
// 使用正则表达式来匹配数字和字母
var reg = /^[0-9a-zA-Z]+$/;
// const labelcode = extraData.cpid
if (options.cpid && options.cpid.length > 14 && reg.test(options.cpid)) {
console.log('中汾页面');
this.setData({
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}`,
});
}
// wx.clearStorageSync(); // 清空本地缓存数据
wx.getSystemInfo({
success: (res) => {
console.log('获取用户信息res', res)
let all_info = res
// console.log('all_info',all_info)
wx.setStorage({
key: 'all_info',
data: all_info
});
let phone_model = res.model;
let benchmarkLevel = res.benchmarkLevel;
// console.log('benchmarkLevel',benchmarkLevel)
// console.log('phone_model',phone_model)
wx.setStorage({
key: 'phone_model',
data: phone_model
});
wx.setStorage({
key: 'benchmarkLevel',
data: benchmarkLevel
})
},
})
},
webviewError: function (e) {
console.log('webview 加载错误', e);
},
webviewMessage: function (e) {
console.log('webview 收到消息', e);
},
/**
* 生命周期函数--监听被展示时调用
*/
onShow: function (options) {
const extraData = wx.getStorageSync('extraData')
// this.setData('extraData',extraData)
// console.log('extraData', extraData)
// console.log('extraData.success', extraData.success)
if (typeof extraData.success !== 'undefined') {
console.log('盛意标签');
var status_zhi = ''
wx.setStorage({
'key': 'status_zhi',
data: status_zhi
})
// console.log('status_zhi',status_zhi)
} else {
console.log('不是盛意标签')
var status_zhi = true
wx.setStorage({
'key': 'status_zhi',
data: status_zhi
})
// console.log('status_zhi',status_zhi)
}
if(this.data.showmodel === true){
wx.showModal({
title: '注意事项:',
content: this.data.content,
showCancel: false, // 是否显示取消按钮,默认值 true
// cancelText: '非常自信', // 取消按钮的文字,默认值 '取消'
confirmText: '我已知晓', // 确定按钮的文字,默认值 '确定'
success: function (res) {
if (res.confirm) {
console.log('用户点击确定')
}
},
fail: function (res) {
console.log(res)
}
})
}
},
/**ss
* 跳转到拍照界面
*/
takePhoto: function (e) {
wx.navigateTo({
// url: '../takePhoto/takePhoto'
url: '../cameraTakePhoto/cameraTakePhoto',
})
counter++;
this.setData({
dongtaishuju: counter
});
if (this.data.dongtaishuju > 3) {
this.setData({
dongtaishuju: 0
})
}
wx.setStorage({
'key': 'dongtaishuju',
'data': this.data.dongtaishuju
})
// console.log('this.data.dongtaishuju',this.data.dongtaishuju)
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {},
attention() {
wx.reLaunch({
url: '../attention/attention',
})
},
})
\ No newline at end of file
{}
\ No newline at end of file
<!--index.wxml-->
<web-view wx:if="{{zhongfen}}" src="{{webviewUrl}}" binderror="webviewError" bindmessage="webviewMessage"></web-view>
<veiw class="page">
<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='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>
</veiw>
\ No newline at end of file
/**index.wxss**/
.page {
height: 100vh;
/* border-top: 1rpx solid white; */
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.takephotoe {
display: block;
width: 350rpx;
height: 350rpx;
border-radius: 999px;
margin-bottom: 15%;
/* box-shadow: 0 0 50rpx #ffd8a2; */
/* position: absolute; left: 50%; top: 50%;
margin-left: -177rpx; margin-top: -335rpx; */
}
.takephoto_txt {
/* display: block; */
width: 275rpx;
height: 84rpx;
margin-bottom: 305rpx;
}
.background {
height: 100vh;
width: 100%;
position: absolute;
z-index: -1;
}
.attention_wxss{
background-color: rgb(165, 165,165);
margin-left:auto;
}
.text-container {
width: 200rpx;
height: 120rpx;
background-color: #fff;
padding: 10rpx;
border-radius: 4rpx;
}
\ No newline at end of file
差异被折叠。
{
"usingComponents": {
"loading": "/componets/loading/index.js"
}
}
<view class="page">
<image class="bg" src="/assets/imgs/wating/loadingbg.jpg"></image>
<view wx:if="{{isLoading }}" speed="{{180}}">
<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>
</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>
<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 === 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 ) }}">
<image class="msg-img" src="/assets/imgs/fail/ffailmsg.png" bindtap="back"></image>
</block>
<block wx:if="{{aiState === 2}}">
<image class="msg-img" src="/assets/imgs/fail/slur.png" bindtap="back"></image>
</block>
<block wx:if="{{aiState === 3}}">
<image class="msg-img" src="/assets/imgs/fail/incomplete.png" bindtap="back"></image>
</block>
<view class="text_text" style="color: aliceblue;"><text>点击拍照按钮重新认证</text></view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</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">
<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">{{ people_replytime/1000 || datemill/1000}}s</view>
</view>
</view>
<navigator class="bexit" open-type="exit" target="miniProgram">点击按钮返回主页</navigator>
</block>
</view>
</view>
<!-- <image src="{{filePath}}" mode="widthFix" style='width: {{windowWidth}}px; height: {{windowWidth}}px;border: 1px solid red; '></image> -->
/* pages/upload/upload.wxss */
.page{
height: 100vh;
position: relative;
overflow: hidden;
}
.bg{
width: 100%;
height: 100vh;
position: absolute;
z-index: -1;
}
.sfbg{
width: 100%;
height: 100vh;
position: absolute;
z-index: -1;
}
.loading{
position: absolute;
top: 150rpx;
left: 50%;
transform: translateX(-50%);
}
.loadings{
position: absolute;
margin-top: 300rpx;
left: 24%;
/* transform: translateX(-50%); */
}
.loadingtrue{
position: absolute;
margin-top: 840rpx;
left: 33%;
}
.loadingfk{
position: absolute;
margin-top: 55rpx;
left: 260rpx;
}
.loadingtext{
position: absolute;
margin-top: 185rpx;
left: 295rpx;
}
.img{
display: block;
width: 280rpx;
height: 280rpx;
margin: 150rpx auto 30rpx;
}
.msg-img{
display: block;
width: 462rpx;
height: 102rpx;
margin: auto;
margin-top: 150rpx;
}
.detail{
width: 70%;
margin:30rpx auto 0rpx;
display: flex;
text-align: center;
color: gray;
}
.left,
.right{
flex: 1;
}
.detail .title{
font-size: 34rpx;
font-weight: 600;
line-height: 2;
}
.detail .value{
line-height: 1.5;
font-size: 34rpx;
}
.text_text{
margin-left: 225rpx;
margin-top: 5%;
font-size: 32rpx;
}
.texit{
width: 400rpx;
height: 70rpx;
margin-top: 15%;
font-size: 36rpx;
margin-left: 215rpx;
color: aliceblue;
border: 2rpx;
text-align: center;
border-radius: 15%;
background-color: rgb(42,84,244);
}
.bexit{
width: 450rpx;
height: 80rpx;
line-height: 80rpx;
text-align: center;
margin-top: 15%;
font-size: 36rpx;
color: aliceblue;
margin: 100rpx auto;
border:2rpx;
border-radius: 70rpx;
background-color: rgb(42,84,244);
}
.gunabi{
position:absolute;
width: 120rpx;
height:80rpx;
background-size:100%;
text-align: center;
top: 10px;
right: 50px;
font-size: 22px;
line-height: 50rpx;
color:#ffff ;
}
.modal-mask{
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background-color: #000;
opacity: 0.5;
z-index: 1;
}
.modal-dialog{
overflow: hidden;
position: fixed;
top: 5%;
background: rgb(4,4,4);
border-radius: 30rpx;
right: 5%;
height: 1200rpx;
width:90%;
z-index: 2;
}
.img_on{
/* margin: auto; */
margin-top: 180rpx;
margin-left: 140rpx;
margin-right: auto;
width:200px;
height: 100px;
}
.img_down{
/* margin: auto; */
margin-left: 60rpx;
margin-right: auto;
margin-top: 70rpx;
}
.seconds{
color: #ffff;
position:absolute;
width: 120rpx;
height:80rpx;
background-size:100%;
text-align: center;
top: 10px;
right: 10px;
font-size: 22px;
line-height: 50rpx;
}
{
"description": "项目配置文件。",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"urlCheck": false,
"es6": true,
"enhance": true,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"minifyWXML": true,
"showES6CompileOption": false,
"useCompilerPlugins": false
},
"compileType": "miniprogram",
"libVersion": "2.25.3",
"appid": "wx70052f70b0eb4bff",
"projectname": "lezhi",
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
},
"condition": {
"miniprogram": {
"list": [
{
"name": "小",
"pathName": "pages/index/index",
"query": "scene=4e50",
"scene": "1047"
}
]
}
}
}
\ No newline at end of file
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "online",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
},
"condition": {
"miniprogram": {
"list": [
{
"name": "小",
"pathName": "pages/index/index",
"query": "scene=4e50",
"scene": "1047"
},
{
"name": "",
"pathName": "pages/upload/upload",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/cameraTakePhoto/cameraTakePhoto",
"query": "status_zhi=true",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/app/app",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
}
}
\ No newline at end of file
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
const formatTime = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const millisecond = date.getMilliseconds()
// return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second,millisecond].map(formatNumber).join(':')
return [year, month, day].map(formatNumber).join('-') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
const formatNumber = n => {
n = n.toString()
return n[1] ? n : '0' + n
}
module.exports = {
formatTime: formatTime,
formatDate: formatDate
}
const formatDate = date =>{
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return hour*60+60*minute+second
}
\ No newline at end of file
const data = worker.getCameraFrameData()
console.log('data',data)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论