@ -37,13 +37,13 @@ Component({
type : 1 ,
type : 1 ,
// 拍摄位置名称映射
// 拍摄位置名称映射
typeNameMap : {
typeNameMap : {
1 : { name : '正面睁眼' , group : '正面' , index : 1 , total : 3 } ,
1 : { name : '正面睁眼' , group : '正面' , index : 1 , total : 3 , tip : '平视,目光看向镜头方向,自然睁眼,不眯眼、不瞪眼。' } ,
2 : { name : '正面闭眼' , group : '正面' , index : 2 , total : 3 } ,
2 : { name : '正面闭眼' , group : '正面' , index : 2 , total : 3 , tip : '正对镜头,面部居中,自然放松,双眼轻轻闭合,不皱眉、不挤眼。' } ,
3 : { name : '正面仰头' , group : '正面' , index : 3 , total : 3 } ,
3 : { name : '正面仰头' , group : '正面' , index : 3 , total : 3 , tip : '拍摄时,正对镜头,面部居中,头部自然向上仰至约45°,双眼同步平视,保持自然睁眼、不眯眼。' } ,
4 : { name : '左侧-90°' , group : '侧面' , index : 1 , total : 4 } ,
4 : { name : '左侧-90°' , group : '侧面' , index : 1 , total : 4 , tip : '身体与头部完全转向右侧,呈标准90°侧面,仅可见左侧眼睛。' } ,
5 : { name : '右侧-90°' , group : '侧面' , index : 2 , total : 4 } ,
5 : { name : '右侧-90°' , group : '侧面' , index : 2 , total : 4 , tip : '身体与头部完全转向左侧,呈标准90°侧面,仅可见右侧眼睛。' } ,
6 : { name : '左侧-45°' , group : '侧面' , index : 3 , total : 4 } ,
6 : { name : '左侧-45°' , group : '侧面' , index : 3 , total : 4 , tip : '身体与头部转向右前方45°。' } ,
7 : { name : '右侧-45°' , group : '侧面' , index : 4 , total : 4 } ,
7 : { name : '右侧-45°' , group : '侧面' , index : 4 , total : 4 , tip : '身体与头部转向左前方45°' } ,
8 : { name : '左上' , group : '眼球运动' , index : 1 , total : 8 } ,
8 : { name : '左上' , group : '眼球运动' , index : 1 , total : 8 } ,
9 : { name : '向上' , group : '眼球运动' , index : 2 , total : 8 } ,
9 : { name : '向上' , group : '眼球运动' , index : 2 , total : 8 } ,
10 : { name : '右上' , group : '眼球运动' , index : 3 , total : 8 } ,
10 : { name : '右上' , group : '眼球运动' , index : 3 , total : 8 } ,
@ -84,31 +84,31 @@ Component({
} ,
} ,
8 : {
8 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo8 ' ,
exampleSrc : 'note-demo12 ' ,
} ,
} ,
9 : {
9 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo9 ' ,
exampleSrc : 'note-demo8 ' ,
} ,
} ,
10 : {
10 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo10 ' ,
exampleSrc : 'note-demo13 ' ,
} ,
} ,
11 : {
11 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo11 ' ,
exampleSrc : 'note-demo10 ' ,
} ,
} ,
12 : {
12 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo12 ' ,
exampleSrc : 'note-demo11 ' ,
} ,
} ,
13 : {
13 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo13 ' ,
exampleSrc : 'note-demo14 ' ,
} ,
} ,
14 : {
14 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
exampleSrc : 'note-demo14 ' ,
exampleSrc : 'note-demo9 ' ,
} ,
} ,
15 : {
15 : {
src : 'note-camera1' ,
src : 'note-camera1' ,
@ -155,9 +155,17 @@ Component({
} )
} )
} ,
} ,
handleHideCamera() {
handleHideCamera() {
if ( this . properties . onlyCamera ) {
this . setData ( {
visible : false ,
} )
}
else {
this . setData ( {
this . setData ( {
visible : false ,
visible : false ,
selectShow : true ,
} )
} )
}
} ,
} ,
handlePicture() {
handlePicture() {
this . handleCancel ( )
this . handleCancel ( )
@ -168,7 +176,7 @@ Component({
success : ( res ) = > {
success : ( res ) = > {
if ( res . tempFiles && res . tempFiles . length > 0 ) {
if ( res . tempFiles && res . tempFiles . length > 0 ) {
const tempFile = res . tempFiles [ 0 ]
const tempFile = res . tempFiles [ 0 ]
const maxSize = 10 * 1024 * 1024 // 10M
const maxSize = 10 * 1024 * 1024
if ( tempFile . size > maxSize ) {
if ( tempFile . size > maxSize ) {
wx . showToast ( {
wx . showToast ( {
title : '图片大小不能超过10M' ,
title : '图片大小不能超过10M' ,
@ -182,6 +190,9 @@ Component({
} ,
} ,
fail : ( err ) = > {
fail : ( err ) = > {
console . error ( '选择图片失败:' , err )
console . error ( '选择图片失败:' , err )
if ( err . errMsg ? . includes ( 'cancel' ) ) {
this . setData ( { selectShow : true } )
}
} ,
} ,
} )
} )
} ,
} ,
@ -221,7 +232,7 @@ Component({
} )
} )
wx . cropImage ( {
wx . cropImage ( {
src : res.tempImagePath ,
src : res.tempImagePath ,
cropScale : '9: 16' ,
cropScale : '16:9 ' ,
success : ( cropRes ) = > {
success : ( cropRes ) = > {
// 裁剪成功后上传图片
// 裁剪成功后上传图片
this . uploadImage ( cropRes . tempFilePath || res . tempImagePath )
this . uploadImage ( cropRes . tempFilePath || res . tempImagePath )