Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
best_AI
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
常超凡
best_AI
Commits
bb1ab9c7
提交
bb1ab9c7
authored
2月 27, 2024
作者:
常超凡
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
99
上级
2287733f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
271 行增加
和
347 行删除
+271
-347
cameraTakePhoto.js
pages/cameraTakePhoto/cameraTakePhoto.js
+0
-8
takephoto.js
pages/fenggu/takephoto/takephoto.js
+240
-326
takephoto.wxml
pages/fenggu/takephoto/takephoto.wxml
+8
-1
takephoto.wxss
pages/fenggu/takephoto/takephoto.wxss
+23
-12
没有找到文件。
pages/cameraTakePhoto/cameraTakePhoto.js
浏览文件 @
bb1ab9c7
...
@@ -291,14 +291,6 @@ Page({
...
@@ -291,14 +291,6 @@ Page({
all_state
:
true
all_state
:
true
})
})
that
.
listener
.
stop
()
that
.
listener
.
stop
()
// if (this.data.all_state === false) {
// console.log('全部完成后进行放大拍照')
// that.takePhoto2()
// that.setData({
// all_state: true
// })
// that.listener.stop()
// }
}
}
}
else
{
}
else
{
console
.
log
(
'拍照失败'
)
console
.
log
(
'拍照失败'
)
...
...
pages/fenggu/takephoto/takephoto.js
浏览文件 @
bb1ab9c7
// pages/fenggu/takephoto/takephoto.js
// pages/fenggu/takephoto/takephoto.js
var
util
=
require
(
'../../../utils/util'
)
var
Counter
=
0
;
Page
({
Page
({
/**
/**
...
@@ -9,167 +11,184 @@ Page({
...
@@ -9,167 +11,184 @@ Page({
stepIndex
:
0
,
stepIndex
:
0
,
// tab切换(AI验证,示范切换)
// tab切换(AI验证,示范切换)
tabIndex
:
1
tabIndex
:
1
,
windowWidth
:
''
,
windowHeight
:
''
,
result_zoom
:
0
,
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
this
.
get
IsCodeImg
()
this
.
get
BaseTakePhoto
()
},
},
// 视频流判断是否有三维码
//获取
getIsCodeImg
()
{
getBaseTakePhoto
(){
let
nNumber
=
0
var
that
=
this
const
ctx
=
wx
.
createCameraContext
()
var
nCounter
=
0
const
listener
=
ctx
.
onCameraFrame
((
frame
)
=>
{
const
{
nNumber
++
screenWidth
,
if
(
nNumber
%
25
==
0
)
{
screenHeight
wx
.
canvasPutImageData
({
}
=
wx
.
getSystemInfoSync
()
canvasId
:
'myCanvas'
,
const
windowWidth
=
750
x
:
0
,
const
windowHeight
=
screenHeight
/
screenWidth
*
windowWidth
y
:
0
,
this
.
setData
({
width
:
frame
.
width
,
//288 288
windowWidth
,
height
:
frame
.
width
,
//512 381
windowHeight
,
data
:
new
Uint8ClampedArray
(
new
Uint8Array
(
frame
.
data
)),
})
success
:()
=>
{
// console.log('wind', windowWidth, 'height', windowHeight)
wx
.
canvasToTempFilePath
({
this
.
ctx
=
wx
.
createCameraContext
()
canvasId
:
'myCanvas'
,
this
.
listener
=
this
.
ctx
.
onCameraFrame
((
frame
)
=>
{
x
:
0
,
if
(
nCounter
==
25
)
{
y
:
(
frame
.
height
-
frame
.
width
)
/
2
,
if
(
this
.
data
.
tag
)
return
width
:
frame
.
width
,
//288
this
.
data
.
tag
=
true
height
:
frame
.
width
,
//352
setTimeout
(()
=>
{
fileType
:
'jpg'
,
this
.
data
.
tag
=
false
destWidth
:
frame
.
width
,
},
1000
)
destHeight
:
frame
.
width
,
this
.
setData
({
// 精度修改
[
'frame.width'
]:
frame
.
width
,
quality
:
'high'
,
[
'frame.height'
]:
frame
.
height
,
success
:
(
res
)
=>
{
})
// console.log('成功成功成功')
var
data
=
new
Uint8Array
(
frame
.
data
);
//进行编码
// console.log('data', data)
const
base
=
wx
.
getFileSystemManager
().
readFileSync
(
res
.
tempFilePath
,
'base64'
)
var
clamped
=
new
Uint8ClampedArray
(
data
);
// console.log('base',base)
// console.log('clamped', clamped)
wx
.
request
({
// 实时帧数据添加到Canvas上
url
:
'https://ai.tj5.cc:35437/object/'
,
// console.log('===========')
// url: 'https://tj5.cc:4433/object/',
wx
.
canvasPutImageData
({
// url:'https://ai.china315net.com:35437/object/',
canvasId
:
'myCanvas'
,
method
:
"POST"
,
x
:
0
,
data
:
{
y
:
0
,
base
width
:
frame
.
width
,
//288 288
},
height
:
frame
.
height
,
//512 381
success
:
(
res
)
=>
{
data
:
clamped
,
var
result
=
res
.
data
.
result
;
success
:
(
res
)
=>
{
var
minindex
=
-
1
;
// 转换临时文件
var
mindistance
=
2
;
wx
.
canvasToTempFilePath
({
for
(
var
i
=
0
;
i
<
result
.
length
;
i
++
)
{
canvasId
:
'myCanvas'
,
var
sublist
=
result
[
i
];
x
:
0
,
var
distance
=
Math
.
abs
(
sublist
[
0
]
-
0.5
)
+
Math
.
abs
(
sublist
[
1
]
-
0.5
);
y
:
(
frame
.
height
-
frame
.
width
)
/
2
,
if
(
distance
<
mindistance
)
{
width
:
frame
.
width
,
//288
mindistance
=
distance
;
height
:
frame
.
width
,
//352
minindex
=
i
;
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)
that
.
setData
({
src
:
res
.
tempFilePath
});
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_zy
=
result
[
minindex
][
0
]
var
result_w
=
result
[
minindex
][
2
]
var
result_sx
=
result
[
minindex
][
1
]
var
result_w
=
result
[
minindex
][
2
]
var
result_zoom
=
parseFloat
((
0.85
/
result_w
).
toFixed
(
1
))
var
result_zoom
=
parseFloat
((
0.85
/
result_w
).
toFixed
(
1
))
let
state
=
''
console
.
log
(
'result_zoom'
,
result_zoom
)
let
status
=
''
console
.
log
(
'result_w'
,
result_w
)
let
state_x
=
''
if
(
result_zy
>
0.588
)
{
//0.568
if
(
result_zy
>
0.588
)
{
//0.568
state
=
'left'
state
=
'left'
}
else
if
(
result_zy
<
0.405
)
{
//0.425
}
else
if
(
result_zy
<
0.405
)
{
//0.425
state
=
'right'
state
=
'right'
}
else
if
(
result_sx
>
0.577
)
{
//0.547
}
else
if
(
result_sx
>
0.577
)
{
//0.547
state
=
'on'
state
=
'on'
}
else
if
(
result_sx
<
0.401
)
{
//0.411
}
else
if
(
result_sx
<
0.401
)
{
//0.411
state
=
'down'
state
=
'down'
}
else
{
}
else
{
let
text
=
'大框参数已经完善'
let
text
=
'大框参数已经完善'
var
take_Count
=
0
;
var
take_Count
=
0
;
// console.log('大框参数已经完善', text)
// console.log('大框参数已经完善', text)
let
singe_state
=
true
let
singe_state
=
true
take_Count
++
,
take_Count
++
,
wx
.
removeStorageSync
(
'singe_state'
)
wx
.
removeStorageSync
(
'singe_state'
)
that
.
setData
({
// console.log('that.data.takephoto', that.data.takephoto)
singe_state
,
if
(
this
.
data
.
takephoto
!==
'succes'
&&
this
.
data
.
take_photo_1
===
''
)
{
small_finish
:
true
// console.log('大框参数完成进行拍照')
})
this
.
takePhoto
();
status
=
'true'
let
takephoto
=
'succes'
if
(
text
===
text
&&
that
.
data
.
stepIndex
===
0
)
{
let
d_takephoto
=
'大框拍照完成'
console
.
log
(
'大框参数完成进行拍照'
)
// console.log('d_takephoto', d_takephoto)
that
.
takePhoto
();
that
.
setData
({
let
takephoto
=
'succes'
takephoto
,
that
.
setData
({
text
,
takephoto
,
d_takephoto
,
stepIndex
:
1
})
})
// console.log('that.data.takephoto', that.data.takephoto)
console
.
log
(
'that.data.takephoto'
,
that
.
data
.
takephoto
)
// console.log('that.data.all_state', that.data.all_state)
}
}
//新修改
//新修改
else
if
(
that
.
data
.
takephoto
===
'succes'
&&
that
.
data
.
stepIndex
===
1
)
{
else
if
(
this
.
data
.
takephoto
===
'succes'
&&
that
.
data
.
all_state
===
false
)
{
console
.
log
(
'进入小框判断'
)
// console.log('进入小框判断')
var
result
=
res
.
data
.
result
;
var
result
=
res
.
data
.
result
;
var
d_result_zy
=
result
[
minindex
][
0
];
var
d_result_zy
=
result
[
minindex
][
0
];
var
d_result_sx
=
result
[
minindex
][
1
];
var
d_result_sx
=
result
[
minindex
][
1
];
if
(
d_result_zy
>
0.546
)
{
//0.546
if
(
d_result_zy
>
0.546
)
{
//0.546
state_x
=
'left'
state_x
=
'left'
}
else
if
(
d_result_zy
<
0.445
)
{
//0.445
}
else
if
(
d_result_zy
<
0.445
)
{
//0.445
state_x
=
'right'
state_x
=
'right'
}
else
if
(
d_result_sx
>
0.571
)
{
//0.531
}
else
if
(
d_result_sx
>
0.571
)
{
//0.531
state_x
=
'on'
state_x
=
'on'
}
else
if
(
d_result_sx
<
0.450
)
{
//0.410
}
else
if
(
d_result_sx
<
0.450
)
{
//0.410
state_x
=
'down'
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
{
}
else
{
console
.
log
(
'拍照失败'
)
console
.
log
(
'全部完成'
)
// that.takePhoto2()
that
.
takePhoto2
()
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
)
=>
{
fail
:
(
error
)
=>
{
console
.
log
(
'目标检测失败'
,
error
)
console
.
log
(
'转换临时文件失败:'
,
error
);
}
}
})
},
that
)
},
},
fail
:
(
error
)
=>
{
fail
:
(
error
)
=>
{
console
.
log
(
'转换临时文件失败:'
,
error
);
console
.
log
(
'绘制图像数据失败'
,
error
)
}
}
},
that
)
})
},
}
fail
:
(
error
)
=>
{
})
console
.
log
(
'绘制图像数据失败'
,
error
)
listener
.
start
()
}
},
})
}
nCounter
++
if
(
nCounter
>=
50
)
{
nCounter
=
0
}
},
100
)
this
.
listener
.
start
()
},
takePhoto
:
function
()
{
takePhoto
:
function
()
{
// console.log('takePhoto')
// console.log('takePhoto')
...
@@ -184,108 +203,76 @@ Page({
...
@@ -184,108 +203,76 @@ Page({
flash
:
'off'
,
flash
:
'off'
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
/*储存 */
/*储存 */
wx
.
setStorage
({
key
:
'res.tempImagePath'
,
data
:
res
.
tempImagePath
,
})
// console.log('res.tempImagePath', res.tempImagePath)
const
base
=
wx
.
getFileSystemManager
().
readFileSync
(
res
.
tempImagePath
,
'base64'
)
const
base
=
wx
.
getFileSystemManager
().
readFileSync
(
res
.
tempImagePath
,
'base64'
)
// console.log('base', base)
// console.log('base',base)
this
.
setData
({
kongfileimage
:
res
.
tempImagePath
})
// console.log('开始解析')
// console.log('开始解析')
//解码API
// wx.request({
wx
.
request
({
// url: 'https://ai.tj5.cc:35437/api/small_upload/',
// url:'https://ai.china315net.com:35437/api/upload/',
// method: 'POST',
// url: 'https://ai.tj5.cc:35437/api/upload/',
// data: {
// url:'https://tj5.cc:4433/api/upload/',
// base,
url
:
'https://ai.tj5.cc:35437/api/small_upload/'
,
// 'labelCodejson': this.data.labelCode
// url:'https://tj5.cc:4433/api/small_upload/',
// },
method
:
'POST'
,
// success: (res) => {
data
:
{
// var dtime = util.formatTime(new Date)
base
,
// wx.setStorage({
'labelCodejson'
:
this
.
data
.
labelCode
// key: 'dtime',
},
// data: dtime
success
:
(
res
)
=>
{
// })
// console.log('base', base)
// var res_data = res.data
// console.log('res.statusCode ', res.statusCode)
// var succes_data = res_data.succes
// console.log('接口访问')
// if (res_data === '码解析失败' || succes_data === 'loser' || res.statusCode !== 200) {
var
dtime
=
util
.
formatTime
(
new
Date
)
// const datajson = '码解析失败'
wx
.
setStorage
({
// wx.setStorage({
key
:
'dtime'
,
// key: 'datajson',
data
:
dtime
// data: datajson
})
// })
// console.log('当前时间', dtime)
// } else {
var
res_data
=
res
.
data
// var img_reader = res_data.img_reader
// console.log('res_data', res_data)
// wx.setStorage({
var
succes_data
=
res_data
.
succes
// key: 'img_reader',
// console.log('succes_data', succes_data)
// data: img_reader
if
(
res_data
===
'码解析失败'
||
succes_data
===
'loser'
||
res
.
statusCode
!==
200
)
{
// })
// console.log('计算res_data长度',res_data.length)
// var img_method = res_data.img_method
// console.log('网络请求值不等于200 ')
// wx.setStorage({
const
datajson
=
'码解析失败'
// key: 'img_method',
// console.log('datajson1',datajson)
// data: img_method
wx
.
setStorage
({
// })
key
:
'datajson'
,
// var points = res_data.points
data
:
datajson
// wx.setStorage({
})
// key: 'points',
}
else
{
// data: points
var
img_reader
=
res_data
.
img_reader
// })
// console.log('img_reader', img_reader)
// var datajson = res_data.codeinfo;
wx
.
setStorage
({
// wx.setStorage({
key
:
'img_reader'
,
// key: 'datajson',
data
:
img_reader
// data: datajson
})
// })
var
img_method
=
res_data
.
img_method
// }
// console.log('img_method', img_method)
// },
wx
.
setStorage
({
// fail: (res) => {
key
:
'img_method'
,
// if (res.errMsg.indexOf('timeout') !== -1) {
data
:
img_method
// const datajson = '码解析失败'
})
// wx.setStorage({
var
points
=
res_data
.
points
// key: 'datajson',
// console.log('points', points)
// data: datajson
wx
.
setStorage
({
// })
key
:
'points'
,
// }
data
:
points
// },
})
// complete: (res) => {
var
datajson
=
res_data
.
codeinfo
;
// if (!res.data) {
// console.log('原图解析内容datajson', datajson)
// const datajson = '码解析失败'
wx
.
setStorage
({
// wx.setStorage({
key
:
'datajson'
,
// key: 'datajson',
data
:
datajson
// data: datajson
})
// })
}
// }
},
// },
fail
:
(
res
)
=>
{
// timeout: 3000
// 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
({
wx
.
request
({
url
:
'https://ai.tj5.cc:35437/classify16/'
,
url
:
'https://ai.tj5.cc:35437/classify16/'
,
// url: 'https://tj5.cc:4433/classify16/',
method
:
"POST"
,
method
:
"POST"
,
data
:
{
data
:
{
'image_type'
:
20
,
'image_type'
:
20
,
...
@@ -294,13 +281,11 @@ Page({
...
@@ -294,13 +281,11 @@ Page({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
let
result_value
=
res
.
data
.
result
let
result_value
=
res
.
data
.
result
let
yuan_file
=
res
.
data
.
image_path
let
yuan_file
=
res
.
data
.
image_path
// console.log('yuan_file', yuan_file)
wx
.
setStorage
({
wx
.
setStorage
({
key
:
'yuan_file'
,
key
:
'yuan_file'
,
data
:
yuan_file
data
:
yuan_file
})
})
if
(
result_value
==
14
)
{
if
(
result_value
==
14
)
{
// console.log('等于14分类')
let
hint_phone
=
result_value
let
hint_phone
=
result_value
this
.
setData
({
this
.
setData
({
hint_phone
hint_phone
...
@@ -309,15 +294,12 @@ Page({
...
@@ -309,15 +294,12 @@ Page({
key
:
'hint_phone'
,
key
:
'hint_phone'
,
data
:
hint_phone
data
:
hint_phone
})
})
// console.log('hint_phone', hint_phone)
}
else
{
}
else
{
// console.log('不等于14分类')
let
hint_phone
=
result_value
let
hint_phone
=
result_value
wx
.
setStorage
({
wx
.
setStorage
({
key
:
'hint_phone'
,
key
:
'hint_phone'
,
data
:
hint_phone
data
:
hint_phone
})
})
// console.log('hint_phone', hint_phone)
}
}
},
},
fail
:
error
=>
{
fail
:
error
=>
{
...
@@ -334,58 +316,9 @@ Page({
...
@@ -334,58 +316,9 @@ Page({
},
350
);
},
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
()
{
takePhoto2
:
function
()
{
// console.log('takePhoto2')
// console.log('takePhoto2')
const
that
=
this
;
const
that
=
this
;
...
@@ -394,48 +327,40 @@ Page({
...
@@ -394,48 +327,40 @@ Page({
return
system
.
indexOf
(
'iOS'
)
!==
-
1
return
system
.
indexOf
(
'iOS'
)
!==
-
1
}
}
if
(
isIOS
())
{
if
(
isIOS
())
{
// console.log('当前设备是ios')
console
.
log
(
'ios'
)
// console.log('this.data.result_zoom', this.data.result_zoom)
if
(
this
.
data
.
result_zoom
===
0
)
{
if
(
this
.
data
.
result_zoom
===
0
)
{
this
.
setData
({
this
.
setData
({
result_zoom
:
4
result_zoom
:
4
})
})
}
}
// console.log('this.data.result_zoom',
this.data.result_zoom)
console
.
log
(
'this.data.result_zoom'
,
this
.
data
.
result_zoom
)
that
.
ctx
.
setZoom
({
that
.
ctx
.
setZoom
({
zoom
:
this
.
data
.
result_zoom
,
zoom
:
this
.
data
.
result_zoom
,
success
:
res
=>
{
success
:
res
=>
{
// console.log('setZoom成功', res);
const
takephoto2_state
=
res
.
errMsg
;
const
takephoto2_state
=
res
.
errMsg
;
this
.
setData
({
this
.
setData
({
takephoto2_state
,
takephoto2_state
,
});
});
// console.log('takephoto2_state', takephoto2_state);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
that
.
ctx
.
takePhoto
({
that
.
ctx
.
takePhoto
({
quality
:
'high'
,
quality
:
'high'
,
flash
:
'on'
,
flash
:
'on'
,
success
:
res
=>
{
success
:
res
=>
{
// console.log('到相机里面');
// console.log('res.data', res);
// console.log('res.tempfile', res.tempImagePath);
/*储存 */
wx
.
setStorage
({
wx
.
setStorage
({
key
:
'originalImagePath'
,
key
:
'originalImagePath'
,
data
:
res
.
tempImagePath
,
data
:
res
.
tempImagePath
,
});
});
this
.
setData
({
this
.
setData
({
bigfileimage
:
res
.
tempImagePath
,
bigfileimage
:
res
.
tempImagePath
,
stepIndex
:
2
});
});
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'../upload/upload?path='
+
that
.
data
.
bigfileimage
+
'&char=0'
url
:
'../
../
upload/upload?path='
+
that
.
data
.
bigfileimage
+
'&char=0'
});
});
},
},
fail
:
err
=>
{
fail
:
err
=>
{
console
.
error
(
'拍照失败'
,
err
);
console
.
error
(
'拍照失败'
,
err
);
that
.
takePhoto2
()
that
.
takePhoto2
()
// console.log('拍照完成')
}
}
});
});
})
})
...
@@ -445,29 +370,17 @@ Page({
...
@@ -445,29 +370,17 @@ Page({
}
}
});
});
}
else
{
}
else
{
// console.log('当前设备是安卓')
// console.log('this.data.result_zoom', this.data.result_zoom)
if
(
this
.
data
.
result_zoom
===
0
)
{
if
(
this
.
data
.
result_zoom
===
0
)
{
this
.
setData
({
this
.
setData
({
result_zoom
:
6
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
));
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
benchmarkLevel
=
(
wx
.
getStorageSync
(
'benchmarkLevel'
)
||
0
)
const
phone_model
=
(
wx
.
getStorageSync
(
'phone_model'
)
||
''
)
const
phone_model
=
(
wx
.
getStorageSync
(
'phone_model'
)
||
''
)
// wx.removeStorageSync(String(benchmarkLevel));
// console.log('benchmarkLevel', benchmarkLevel)
// console.log('phone_model', phone_model)
let
timeS
;
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'
]
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
)){
if
(
phone_list
.
includes
(
phone_model
)){
// console.log('特殊手机型号')
timeS
=
850
timeS
=
850
}
}
else
if
(
benchmarkLevel
>
40
)
{
else
if
(
benchmarkLevel
>
40
)
{
...
@@ -514,7 +427,7 @@ Page({
...
@@ -514,7 +427,7 @@ Page({
})
})
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'../upload/upload?path='
+
that
.
data
.
bigfileimage
+
'&char=0'
url
:
'../
../
upload/upload?path='
+
that
.
data
.
bigfileimage
+
'&char=0'
})
})
},
},
fail
:
(
err
)
=>
{
fail
:
(
err
)
=>
{
...
@@ -595,4 +508,6 @@ Page({
...
@@ -595,4 +508,6 @@ Page({
onShareAppMessage
()
{
onShareAppMessage
()
{
}
}
})
})
\ No newline at end of file
pages/fenggu/takephoto/takephoto.wxml
浏览文件 @
bb1ab9c7
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<view class="step-item {{stepIndex > 2 ? 'step-active' : ''}}">验证</view>
<view class="step-item {{stepIndex > 2 ? 'step-active' : ''}}">验证</view>
</view>
</view>
</view>
</view>
<view class="photo" style="position: relative;
flex:1;
background-color: black;">
<view class="photo" style="position: relative;background-color: black;">
<camera style="height: 100%;width: 100%;" flash="on" devic-position="back" frame-size="large">
<camera style="height: 100%;width: 100%;" flash="on" devic-position="back" frame-size="large">
</camera>
</camera>
<!-- 拍照框(正方形) -->
<!-- 拍照框(正方形) -->
...
@@ -18,4 +18,10 @@
...
@@ -18,4 +18,10 @@
<view class="tabItem" data-tindex='2'>示范</view>
<view class="tabItem" data-tindex='2'>示范</view>
</view>
</view>
</view>
</view>
</view>
<view style="position:fixed; top: 999999999px;">
<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
pages/fenggu/takephoto/takephoto.wxss
浏览文件 @
bb1ab9c7
...
@@ -9,29 +9,39 @@
...
@@ -9,29 +9,39 @@
box-sizing: border-box;
box-sizing: border-box;
}
}
.takephoto .focus {
.takephoto .
photo .
focus {
position: absolute;
position: absolute;
top: 50%;
top: 50%;
left: 50%;
left: 50%;
transform: translate(-50%,-50%);
transform: translate(-50%,
-50%);
width: 400rpx;
width: 400rpx;
z-index: 9999;
z-index: 9999
9
;
}
}
.takephoto .focus {
/* .takephoto .focus {
position: absolute;
position: absolute;
top: 50%;
top: 50%;
left: 50%;
left: 50%;
transform: translate(-50%,-50%);
transform: translate(-50%, -50%);
width: 400rpx;
width: 400rpx;
z-index: 99999;
} */
.takephoto .photo {
flex: 1;
height: 400rpx;
}
}
.step,.step-box,.bottom,.tabs {
.step,
.step-box,
.bottom,
.tabs {
display: flex;
display: flex;
justify-content: center;
justify-content: center;
text-align: center;
text-align: center;
}
}
.step .step-item {
.step .step-item {
padding: 0 20rpx;
padding: 0 20rpx;
height: 80rpx;
height: 80rpx;
...
@@ -41,7 +51,7 @@
...
@@ -41,7 +51,7 @@
background-color: #ADADAD;
background-color: #ADADAD;
}
}
.bottom .tabs .tabItem{
.bottom .tabs .tabItem
{
height: 80rpx;
height: 80rpx;
line-height: 80rpx;
line-height: 80rpx;
min-width: 200rpx;
min-width: 200rpx;
...
@@ -59,4 +69,4 @@
...
@@ -59,4 +69,4 @@
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-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-size: auto 100%;
background-repeat: repeat-x;
background-repeat: repeat-x;
}
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论