2 Commits
Author SHA1 Message Date
xsl 9a220464aa success 2026-03-13 13:28:03 +08:00
xsl d6b48a4b47 chang to skin 2026-03-13 11:33:24 +08:00
60 changed files with 149 additions and 125 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
<!-- #endif -->
<view>
<button @click="_takePhoto">拍照</button>
<xf-camera style="height:750rpx; background-color: red;" @error="onError" :flash="flash"
:position="device"></xf-camera>
<skin-camera style="height:750rpx; background-color: red;" @error="onError" :flash="flash"
:position="device"></skin-camera>
<image v-if="imagePath" mode="aspectFit" :src="imagePath"></image>
</view>
<!-- #ifdef APP -->
@@ -13,7 +13,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -17,7 +17,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
{"version":3,"sources":["pages/index/index.uvue"],"sourcesContent":["<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<xf-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></xf-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script>\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\t// let permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t// \t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// // 请求权限\n\t\t\t// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t// \tif (allRight) {\n\t\t\t// \t\t// 权限请求成功\n\t\t\t// \t} else {\n\t\t\t// \t\t//用户拒绝了部分权限\n\t\t\t// \t}\n\t\t\t// }, function (_ : boolean, _ : string[]) {\n\t\t\t// \t//用户拒绝了部分权限\n\t\t\t// })\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tconsole.log(res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgBC,OAKO,6BAA6B,CAJnC;OAIM,6BAA6B,CAHnC;OAGM,6BAA6B,CAFnC;OAEM,6BAA6B,CADnC;AAII;;eAaJ,sBAAM,CAaN;;;;;;eAhDD,IASc,eAAA,IATD,WAAM,qBAAkB;YAEpC,IAKO,QAAA,IAAA,EAAA;gBAJN,IAAuC,UAAA,IAA9B,aAAO,KAAA,UAAU,GAAE,MAAE,CAAA,EAAA;oBAAA;iBAAA;gBAC9B,IAAA,kBAAA,IACgC,EAAA,IADrB,WAA6C,IAA7C,IAAA,YAAA,UAAA,sBAAA,SAA+C,aAAO,KAAA,OAAO,EAAG,WAAO,KAAA,KAAK,EACrF,cAAU,KAAA,MAAM;;;;;2BACL,KAAA,SAAS,GAAtB;oBAAA,IAAkE,SAAA,gBAA1C,UAAK,aAAa,SAAK,KAAA,SAAS;;;;;;;;;aAmBvD;aACA;aACA;aAEA;aACA;aACA;aACA;;;mBAPA,WAAO,OACP,cAAU,GAAG,EACb,eAAW,GAAG,EAEd,WAAO,MACP,YAAQ,SACR,eAAW,IACX,eAAW;;aAkBZ;aAAA,eAAQ,KAAM,GAAG,EAAA;QAChB,QAAQ,GAAG,CAAC,KAAG;IAChB;aACA;aAAA,oBAAU;QACT,UASK,gBARJ,UAAS,IAAC,KAAM,+BAAiC;YAChD,QAAQ,GAAG,CAAC,aAAa,KAAG;YAC5B,IAAI,CAAC,SAAQ,GAAI,IAAI,aAAa;QAEnC;UACA,OAAM,IAAC,KAAM,sBAAwB;YACpC,QAAQ,GAAG,CAAC,aAAa,KAAG;QAC7B;;IAEF;;;;;;;;;;;;;;;;;;;;AAEF"}
{"version":3,"sources":["pages/index/index.uvue"],"sourcesContent":["<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<skin-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></skin-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script>\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\tlet permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t\t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// 请求权限\n\t\t\tUTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t\tif (allRight) {\n\t\t\t\t\t// 权限请求成功\n\t\t\t\t} else {\n\t\t\t\t\t//用户拒绝了部分权限\n\t\t\t\t}\n\t\t\t}, function (_ : boolean, _ : string[]) {\n\t\t\t\t//用户拒绝了部分权限\n\t\t\t})\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tconsole.log(res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>"],"names":[],"mappings":";;;;;;;;;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;;;;;;;;;;;;;;AAEF"}
+5 -5
View File
@@ -4,13 +4,13 @@
"compiler_version": "4.87"
},
"files": {
"index.kt": {
"md5": "3d228610d7ea1f50297ff2c98f1d707625ffc2ff",
"class": ""
},
"pages/index/index.kt": {
"class": "GenPagesIndexIndex",
"md5": "0ba1bdcb867acacda8a20ff033971ed372d8a0d5"
},
"index.kt": {
"class": "",
"md5": "3d228610d7ea1f50297ff2c98f1d707625ffc2ff"
"md5": "12fc17b12c330ffd7c1f37c11fd8fd0ff8fb9d77"
}
}
}
+14 -3
View File
@@ -12,14 +12,25 @@ import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlin.properties.Delegates
import uts.sdk.modules.SkinCameraUTS.XfCameraComponent
import uts.sdk.modules.SkinCameraUTS.SkinCameraComponent
import uts.sdk.modules.SkinCameraUTS.takePhoto
import uts.sdk.modules.SkinCameraUTS.TakePhotoOption
import uts.sdk.modules.SkinCameraUTS.TakePhotoSuccessCallbackResult
import uts.sdk.modules.SkinCameraUTS.GeneralCallbackResult
open class GenPagesIndexIndex : BasePage {
constructor(__ins: ComponentInternalInstance, __renderer: String?) : super(__ins, __renderer) {
onLoad(fun(_: OnLoadOptions) {}, __ins)
onLoad(fun(_: OnLoadOptions) {
var permissionNeed = _uA(
"android.permission.CAMERA",
"android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"
)
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!!, permissionNeed, fun(allRight: Boolean, _: UTSArray<String>) {
if (allRight) {}
}
, fun(_: Boolean, _: UTSArray<String>) {})
}
, __ins)
}
@Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
override fun `$render`(): Any? {
@@ -30,7 +41,7 @@ open class GenPagesIndexIndex : BasePage {
_cE("button", _uM("onClick" to _ctx._takePhoto), "拍照", 8, _uA(
"onClick"
)),
_cE(XfCameraComponent.name, _uM("style" to _nS(_uM("height" to "750rpx", "background-color" to "red")), "onError" to _ctx.onError, "flash" to _ctx.flash, "position" to _ctx.device), null, 44, _uA(
_cE(SkinCameraComponent.name, _uM("style" to _nS(_uM("height" to "750rpx", "background-color" to "red")), "onError" to _ctx.onError, "flash" to _ctx.flash, "position" to _ctx.device), null, 44, _uA(
"onError",
"flash",
"position"
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"app-service.js","sources":["uni_modules/Skin-cameraUTS?uts-proxy","pages/index/index.uvue","App.uvue"],"sourcesContent":["","<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<xf-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></xf-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script lang=\"uts\">\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\t// let permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t// \t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// // 请求权限\n\t\t\t// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t// \tif (allRight) {\n\t\t\t// \t\t// 权限请求成功\n\t\t\t// \t} else {\n\t\t\t// \t\t//用户拒绝了部分权限\n\t\t\t// \t}\n\t\t\t// }, function (_ : boolean, _ : string[]) {\n\t\t\t// \t//用户拒绝了部分权限\n\t\t\t// })\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tuni.__log__('log','at pages/index/index.uvue:54',res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tuni.__log__('log','at pages/index/index.uvue:59','takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tuni.__log__('log','at pages/index/index.uvue:64','takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>","<script lang=\"uts\">\r\n\r\n\r\n\r\n\texport default {\r\n\t\tonLaunch() {\r\n\t\t\tuni.__log__('log','at App.uvue:7','App Launch')\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tuni.__log__('log','at App.uvue:10','App Show')\r\n\t\t},\r\n\t\tonHide() {\r\n\t\t\tuni.__log__('log','at App.uvue:13','App Hide')\r\n\t\t},\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\tonExit() {\r\n\t\t\tuni.__log__('log','at App.uvue:34','App Exit')\r\n\t\t},\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n\t.uni-row {\r\n\t\tflex-direction: row;\r\n\t}\r\n\r\n\t.uni-column {\r\n\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I,QAAQ,OAAM,iBAAgB,YAAY;AAAA,IAC9C;AAAA,IACD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,IACD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,IAmBD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,GACF;;;;;;;;;;;;;","sourceRoot":"/Users/feast/Documents/CameraProj/SkinCamera"}
{"version":3,"file":"app-service.js","sources":["uni_modules/Skin-cameraUTS?uts-proxy","pages/index/index.uvue","App.uvue"],"sourcesContent":["","<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<skin-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></skin-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script lang=\"uts\">\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\t// let permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t// \t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// // 请求权限\n\t\t\t// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t// \tif (allRight) {\n\t\t\t// \t\t// 权限请求成功\n\t\t\t// \t} else {\n\t\t\t// \t\t//用户拒绝了部分权限\n\t\t\t// \t}\n\t\t\t// }, function (_ : boolean, _ : string[]) {\n\t\t\t// \t//用户拒绝了部分权限\n\t\t\t// })\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tuni.__log__('log','at pages/index/index.uvue:54',res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tuni.__log__('log','at pages/index/index.uvue:59','takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tuni.__log__('log','at pages/index/index.uvue:64','takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>","<script lang=\"uts\">\r\n\r\n\r\n\r\n\texport default {\r\n\t\tonLaunch() {\r\n\t\t\tuni.__log__('log','at App.uvue:7','App Launch')\r\n\t\t},\r\n\t\tonShow() {\r\n\t\t\tuni.__log__('log','at App.uvue:10','App Show')\r\n\t\t},\r\n\t\tonHide() {\r\n\t\t\tuni.__log__('log','at App.uvue:13','App Hide')\r\n\t\t},\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\tonExit() {\r\n\t\t\tuni.__log__('log','at App.uvue:34','App Exit')\r\n\t\t},\r\n\t}\r\n</script>\r\n\r\n<style>\r\n\t/*每个页面公共css */\r\n\t.uni-row {\r\n\t\tflex-direction: row;\r\n\t}\r\n\r\n\t.uni-column {\r\n\t\tflex-direction: column;\r\n\t}\r\n</style>"],"names":["defineComponent"],"mappings":";;AACA,QAAM,EAAE,sBAAsB,mBAAmB,sBAAsB,oBAAoB,uBAAuB,iBAAgB,IAAK;AACvI,QAAM,OAAO;AACb,QAAM,aAAa;AACnB,QAAM,aAAa;AACnB,QAAM,SAAS;AACf,QAAM,iBAAiB;AACvB,QAAM,MAAoB,mCAAmB,MAAM,cAAc;AACjE,QAAM,MAAoB,sCAAsB,MAAM,cAAc;AAE7D,QAAM,sBAAsB,CAAE;AAG9B,QAAM,YAA0B,qCAAqB,OAAO,EAAE,YAAY,YAAY,QAAQ,MAAM,MAAM,SAAS,KAAK,OAAO,KAAK,MAAM,iBAAiB,WAAW,OAAO,QAAQ,CAAC,EAAC,QAAO,WAAU,QAAO,sDAAqD,CAAC,GAAG,QAAQ,GAAE,CAAC;;;;ACWzR,QAAA,cAAeA,oBAAA;AAAA,IACd,OAAI;AACH,aAAO;AAAA,QACN,OAAO;AAAA,QACP,UAAU;AAAA,QACV,WAAW;AAAA,QAEX,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,WAAW;AAAA,QACX,WAAW;AAAA;IAEZ;AAAA,IACD,SAAM;AAAA,IAaL;AAAA,IACD,SAAS;AAAA,MACR,QAAQ,MAAS,MAAA;AAChB,YAAI,QAAQ,OAAM,gCAA+B,GAAG;AAAA,MACpD;AAAA,MACD,aAAU;AACT,kBAAU;AAAA,UACT,SAAS,CAAC,MAAoC,SAAA;AAC7C,gBAAI,QAAQ,OAAM,gCAA+B,aAAa,GAAG;AACjE,iBAAK,YAAY,IAAI;AAAA,UAErB;AAAA,UACD,MAAM,CAAC,MAA2B,SAAA;AACjC,gBAAI,QAAQ,OAAM,gCAA+B,aAAa,GAAG;AAAA,UAClE;AAAA,QACmB,CAAA;AAAA,MACrB;AAAA,IACD;AAAA,GACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChEA,QAAA,YAAeA,oBAAA;AAAA,IACd,WAAQ;AACP,UAAI,QAAQ,OAAM,iBAAgB,YAAY;AAAA,IAC9C;AAAA,IACD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,IACD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,IAmBD,SAAM;AACL,UAAI,QAAQ,OAAM,kBAAiB,UAAU;AAAA,IAC7C;AAAA,GACF;;;;;;;;;;;;;","sourceRoot":"/Users/feast/Documents/CameraProj/SkinCamera"}
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@
"md5": "5a79003477b0c0436ccfb8782f8b1be9"
},
"utssdk/app-android/index.vue": {
"md5": "4b27b0ce87deb69b8ab88a79f6e6ef70"
"md5": "b01794e3f083baf1b8aceebeab658367"
}
}
}
+1 -1
View File
@@ -1 +1 @@
{"dir":"/Volumes/Elements/srv_release/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/682599b0-1e0f-11f1-9581-8972781ecb49/wgtRoot/__UNI__644401D/"}
{"dir":"/Volumes/Elements/srv_release/bdserver.dcloud.net.cn/service/storage/app/package/IOS/queue/4c5045b0-1e94-11f1-8555-e529708e47ad/wgtRoot/__UNI__644401D/"}
@@ -23,7 +23,7 @@
"md5": "f5a5d7ae3ae1349af9816e625de9299f"
},
"utssdk/app-ios/index.vue": {
"md5": "7396593a50cbeff49fcd3c16e279ddf6"
"md5": "d0eb186ea281ac8fa064d51ff53209b1"
}
}
}
Binary file not shown.
Binary file not shown.
@@ -21,18 +21,18 @@
}
},
onLoad() {
// let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
// "android.permission.WRITE_EXTERNAL_STORAGE"]
// // 请求权限
// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
// if (allRight) {
// // 权限请求成功
// } else {
// //用户拒绝了部分权限
// }
// }, function (_ : boolean, _ : string[]) {
// //用户拒绝了部分权限
// })
let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"]
// 请求权限
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
if (allRight) {
// 权限请求成功
} else {
//用户拒绝了部分权限
}
}, function (_ : boolean, _ : string[]) {
//用户拒绝了部分权限
})
},
methods: {
onError(res : any) {
@@ -60,7 +60,7 @@ const _cache = this.$.renderCache
return _cE("scroll-view", _uM({ class: "page-scroll-view" }), [
_cE("view", null, [
_cE("button", _uM({ onClick: _ctx._takePhoto }), "拍照", 8 /* PROPS */, ["onClick"]),
_cE(XfCameraComponent.name, _uM({
_cE(SkinCameraComponent.name, _uM({
style: _nS(_uM({"height":"750rpx","background-color":"red"})),
onError: _ctx.onError,
flash: _ctx.flash,
@@ -78,4 +78,4 @@ const _cache = this.$.renderCache
}
const GenPagesIndexIndexStyles = [_uM([["video", _pS(_uM([["width", "100%"], ["height", 200]]))]])]
import { XfCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy'
import { SkinCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy'
@@ -13,7 +13,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -17,7 +17,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -13,7 +13,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -17,7 +17,7 @@
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
+15 -14
View File
@@ -12,18 +12,19 @@ const __sfc__ = defineComponent({
};
},
onLoad() {
// let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
// "android.permission.WRITE_EXTERNAL_STORAGE"]
// // 请求权限
// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
// if (allRight) {
// // 权限请求成功
// } else {
// //用户拒绝了部分权限
// }
// }, function (_ : boolean, _ : string[]) {
// //用户拒绝了部分权限
// })
let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"];
// 请求权限
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight: boolean, _: string[]) {
if (allRight) {
// 权限请求成功
}
else {
//用户拒绝了部分权限
}
}, function (_: boolean, _: string[]) {
//用户拒绝了部分权限
});
},
methods: {
onError(res: any) {
@@ -50,7 +51,7 @@ function GenPagesIndexIndexRender(this: InstanceType<typeof __sfc__>): any | nul
return _cE("scroll-view", _uM({ class: "page-scroll-view" }), [
_cE("view", null, [
_cE("button", _uM({ onClick: _ctx._takePhoto }), "拍照", 8 /* PROPS */, ["onClick"]),
_cE(XfCameraComponent.name, _uM({
_cE(SkinCameraComponent.name, _uM({
style: _nS(_uM({ "height": "750rpx", "background-color": "red" })),
onError: _ctx.onError,
flash: _ctx.flash,
@@ -67,4 +68,4 @@ function GenPagesIndexIndexRender(this: InstanceType<typeof __sfc__>): any | nul
]);
}
const GenPagesIndexIndexStyles = [_uM([["video", _pS(_uM([["width", "100%"], ["height", 200]]))]])];
import { XfCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy';
import { SkinCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy';
@@ -11,7 +11,7 @@ export default {
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -14,7 +14,7 @@ export default {
/**
* 组件名称,也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明,只有声明过的事件,才能被正常发送
*/
@@ -11,14 +11,25 @@ import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlin.properties.Delegates
import uts.sdk.modules.SkinCameraUTS.XfCameraComponent
import uts.sdk.modules.SkinCameraUTS.SkinCameraComponent
import uts.sdk.modules.SkinCameraUTS.takePhoto
import uts.sdk.modules.SkinCameraUTS.TakePhotoOption
import uts.sdk.modules.SkinCameraUTS.TakePhotoSuccessCallbackResult
import uts.sdk.modules.SkinCameraUTS.GeneralCallbackResult
open class GenPagesIndexIndex : BasePage {
constructor(__ins: ComponentInternalInstance, __renderer: String?) : super(__ins, __renderer) {
onLoad(fun(_: OnLoadOptions) {}, __ins)
onLoad(fun(_: OnLoadOptions) {
var permissionNeed = _uA(
"android.permission.CAMERA",
"android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"
)
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!!, permissionNeed, fun(allRight: Boolean, _: UTSArray<String>) {
if (allRight) {}
}
, fun(_: Boolean, _: UTSArray<String>) {})
}
, __ins)
}
@Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
override fun `$render`(): Any? {
@@ -29,7 +40,7 @@ open class GenPagesIndexIndex : BasePage {
_cE("button", _uM("onClick" to _ctx._takePhoto), "拍照", 8, _uA(
"onClick"
)),
_cE(XfCameraComponent.name, _uM("style" to _nS(_uM("height" to "750rpx", "background-color" to "red")), "onError" to _ctx.onError, "flash" to _ctx.flash, "position" to _ctx.device), null, 44, _uA(
_cE(SkinCameraComponent.name, _uM("style" to _nS(_uM("height" to "750rpx", "background-color" to "red")), "onError" to _ctx.onError, "flash" to _ctx.flash, "position" to _ctx.device), null, 44, _uA(
"onError",
"flash",
"position"
@@ -9,8 +9,8 @@
],
"components": [
{
"name": "xf-camera",
"class": "uts.sdk.modules.SkinCameraUTS.XfCameraComponent"
"name": "skin-camera",
"class": "uts.sdk.modules.SkinCameraUTS.SkinCameraComponent"
}
]
}
@@ -491,7 +491,7 @@ open class CameraManager {
}
}
}
open class XfCameraComponent : UTSComponent<CameraView> {
open class SkinCameraComponent : UTSComponent<CameraView> {
constructor(proxy: PageProxy, componentData: IComponentData) : super(proxy, componentData)
open var mode: String = "normal"
open var resolution: String = "medium"
@@ -531,13 +531,13 @@ open class XfCameraComponent : UTSComponent<CameraView> {
)
}
companion object {
var name = "xf-camera"
var name = "skin-camera"
init {
io.dcloud.uniapp.UniSDKEngine.registerUniComponent("xf-camera", XfCameraComponent::class.java, XfCameraElement::class.java)
io.dcloud.uniapp.UniSDKEngine.registerUniComponent("skin-camera", SkinCameraComponent::class.java, SkinCameraElement::class.java)
}
}
}
open class XfCameraElement : DomNode {
open class SkinCameraElement : DomNode {
constructor(data: INodeData, pageNode: PageNode) : super(data, pageNode)
}
open class CameraFrameListener {
+3 -3
View File
@@ -8,7 +8,7 @@
const is_uni_modules = true;
const pkg = /* @__PURE__ */ initUTSPackageName(name, is_uni_modules);
const cls = /* @__PURE__ */ initUTSIndexClassName(name, is_uni_modules);
const XfCameraComponent = {};
const SkinCameraComponent = {};
const takePhoto = /* @__PURE__ */ initUTSProxyFunction(false, { moduleName, moduleType, errMsg, main: true, package: pkg, class: cls, name: "takePhotoByJs", keepAlive: false, params: [{ "name": "options", "type": "UTSSDKModulesSkinCameraUTSTakePhotoOptionJSONObject" }], return: "" });
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
@@ -53,13 +53,13 @@
return target;
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
resolveEasycom(vue.resolveDynamicComponent("xf-camera"), XfCameraComponent);
resolveEasycom(vue.resolveDynamicComponent("skin-camera"), SkinCameraComponent);
return vue.openBlock(), vue.createElementBlock("scroll-view", { class: "page-scroll-view" }, [
vue.createElementVNode("view", null, [
vue.createElementVNode("button", {
onClick: _cache[0] || (_cache[0] = (...args) => $options._takePhoto && $options._takePhoto(...args))
}, "拍照"),
vue.createElementVNode("xf-camera", {
vue.createElementVNode("skin-camera", {
style: { "height": "750rpx", "background-color": "red" },
onError: _cache[1] || (_cache[1] = (...args) => $options.onError && $options.onError(...args)),
flash: $data.flash,
@@ -2,9 +2,9 @@
"deploymentTarget": "11",
"components": [
{
"name": "xf-camera",
"class": "UTSSDKModulesSkinCameraUTSXfCameraComponent",
"delegateClass": "XfCameraComponentRegister"
"name": "skin-camera",
"class": "UTSSDKModulesSkinCameraUTSSkinCameraComponent",
"delegateClass": "SkinCameraComponentRegister"
}
]
}
@@ -931,9 +931,9 @@ public class CameraManager : NSObject {
self.cameraView = nil
}
}
@objc(XfCameraComponent)
@objc(SkinCameraComponent)
@objcMembers
public class XfCameraComponent : UTSComponent<UIView> {
public class SkinCameraComponent : UTSComponent<UIView> {
public var mode: String = "normal"
public var resolution: String = "medium"
public var position: String = "back"
@@ -984,23 +984,23 @@ public class XfCameraComponent : UTSComponent<UIView> {
}
}
@objc
public protocol XfCameraElement : JSExport {
public protocol SkinCameraElement : JSExport {
}
@objc(XfCameraElementImpl)
@objc(SkinCameraElementImpl)
@objcMembers
public class XfCameraElementImpl : UniElementImpl, XfCameraElement {
public var targetComponent: XfCameraComponent {
public class SkinCameraElementImpl : UniElementImpl, SkinCameraElement {
public var targetComponent: SkinCameraComponent {
get {
return self.component as! XfCameraComponent
return self.component as! SkinCameraComponent
}
}
}
@objc(XfCameraComponentRegister)
@objc(SkinCameraComponentRegister)
@objcMembers
public class XfCameraComponentRegister : NSObject {
public class SkinCameraComponentRegister : NSObject {
public static func registerComponent() {
UniSDKEngine.shared.registerUniComponent(type: "xf-camera", nodeClazz: XfCameraElementImpl.constructor, componentCls: XfCameraComponent.self)
UniSDKEngine.shared.registerExtComponent(type: "xf-camera")
UniSDKEngine.shared.registerUniComponent(type: "skin-camera", nodeClazz: SkinCameraElementImpl.constructor, componentCls: SkinCameraComponent.self)
UniSDKEngine.shared.registerExtComponent(type: "skin-camera")
}
}
@objc(UTSSDKModulesSkinCameraUTSCameraFrameListener)
+14 -14
View File
@@ -21,18 +21,18 @@
}
},
onLoad() {
// let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
// "android.permission.WRITE_EXTERNAL_STORAGE"]
// // 请求权限
// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
// if (allRight) {
// // 权限请求成功
// } else {
// //用户拒绝了部分权限
// }
// }, function (_ : boolean, _ : string[]) {
// //用户拒绝了部分权限
// })
let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"]
// 请求权限
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
if (allRight) {
// 权限请求成功
} else {
//用户拒绝了部分权限
}
}, function (_ : boolean, _ : string[]) {
//用户拒绝了部分权限
})
},
methods: {
onError(res : any) {
@@ -60,7 +60,7 @@ const _cache = this.$.renderCache
return _cE("scroll-view", _uM({ class: "page-scroll-view" }), [
_cE("view", null, [
_cE("button", _uM({ onClick: _ctx._takePhoto }), "拍照", 8 /* PROPS */, ["onClick"]),
_cE(XfCameraComponent.name, _uM({
_cE(SkinCameraComponent.name, _uM({
style: _nS(_uM({"height":"750rpx","background-color":"red"})),
onError: _ctx.onError,
flash: _ctx.flash,
@@ -78,4 +78,4 @@ const _cache = this.$.renderCache
}
const GenPagesIndexIndexStyles = [_uM([["video", _pS(_uM([["width", "100%"], ["height", 200]]))]])]
import { XfCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy'
import { SkinCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy'
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@
/**
* 使
*/
name: "xf-camera",
name: "skin-camera",
/**
*
*/
@@ -17,7 +17,7 @@
/**
* 使
*/
name: "xf-camera",
name: "skin-camera",
/**
*
*/
@@ -13,7 +13,7 @@
/**
* 使
*/
name: "xf-camera",
name: "skin-camera",
/**
*
*/
@@ -17,7 +17,7 @@
/**
* 使
*/
name: "xf-camera",
name: "skin-camera",
/**
*
*/
+15 -14
View File
@@ -12,18 +12,19 @@ const __sfc__ = defineComponent({
};
},
onLoad() {
// let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
// "android.permission.WRITE_EXTERNAL_STORAGE"]
// // 请求权限
// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {
// if (allRight) {
// // 权限请求成功
// } else {
// //用户拒绝了部分权限
// }
// }, function (_ : boolean, _ : string[]) {
// //用户拒绝了部分权限
// })
let permissionNeed = ["android.permission.CAMERA", "android.permission.RECORD_AUDIO",
"android.permission.WRITE_EXTERNAL_STORAGE"];
// 请求权限
UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight: boolean, _: string[]) {
if (allRight) {
// 权限请求成功
}
else {
//用户拒绝了部分权限
}
}, function (_: boolean, _: string[]) {
//用户拒绝了部分权限
});
},
methods: {
onError(res: any) {
@@ -50,7 +51,7 @@ function GenPagesIndexIndexRender(this: InstanceType<typeof __sfc__>): any | nul
return _cE("scroll-view", _uM({ class: "page-scroll-view" }), [
_cE("view", null, [
_cE("button", _uM({ onClick: _ctx._takePhoto }), "拍照", 8 /* PROPS */, ["onClick"]),
_cE(XfCameraComponent.name, _uM({
_cE(SkinCameraComponent.name, _uM({
style: _nS(_uM({ "height": "750rpx", "background-color": "red" })),
onError: _ctx.onError,
flash: _ctx.flash,
@@ -67,5 +68,5 @@ function GenPagesIndexIndexRender(this: InstanceType<typeof __sfc__>): any | nul
]);
}
const GenPagesIndexIndexStyles = [_uM([["video", _pS(_uM([["width", "100%"], ["height", 200]]))]])];
import { XfCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy';
import { SkinCameraComponent } from '@/uni_modules/Skin-cameraUTS?uts-proxy';
//# sourceMappingURL=index.uvue.map
@@ -1 +1 @@
{"version":3,"sources":["pages/index/index.uvue"],"names":[],"mappings":"AAgBC,OAAO,EACN,SAAS,EACT,eAAe,EACf,8BAA8B,EAC9B,qBAAoB,EACrB,MAAO,8BAA6B,CAAA;AAGpC,MAAK,OAAQ,GAAE,eAAA,CAAA;IACd,IAAI;QACH,OAAO;YACN,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,GAAG;YACb,SAAS,EAAE,GAAG;YAEd,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,OAAO;YACf,SAAS,EAAE,EAAE;YACb,SAAS,EAAE,mEAAkE;SAC9E,CAAA;IACD,CAAC;IACD,MAAM;QACL,wFAAuF;QACvF,oDAAmD;QACnD,UAAS;QACT,iIAAgI;QAChI,mBAAkB;QAClB,cAAa;QACb,YAAW;QACX,gBAAe;QACf,KAAI;QACJ,4CAA2C;QAC3C,eAAc;QACd,KAAI;IACL,CAAC;IACD,OAAO,EAAE;QACR,OAAO,CAAC,GAAE,EAAI,GAAG;YAChB,OAAO,CAAC,GAAG,CAAC,GAAG,EAAA,+BAAA,CAAA,CAAA;QAChB,CAAC;QACD,UAAU;YACT,SAAS,CAAC;gBACT,OAAO,EAAE,CAAC,GAAE,EAAI,8BAA8B,EAAE,EAAC;oBAChD,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,EAAA,+BAAA,CAAA,CAAA;oBAC5B,IAAI,CAAC,SAAQ,GAAI,GAAG,CAAC,aAAa,CAAA;oBAClC,mBAAkB;gBACnB,CAAC;gBACD,IAAI,EAAE,CAAC,GAAE,EAAI,qBAAqB,EAAE,EAAC;oBACpC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,EAAA,+BAAA,CAAA,CAAA;gBAC7B,CAAA;aACD,IAAK,eAAe,CAAA,CAAA;QACrB,CAAA;KACD;CACD,CAAA,CAAA;;;;;WAlEA,GAAA,CASc,aAAA,EAAA,GAAA,CAAA,EATD,KAAK,EAAC,kBAAkB,EAAA,CAAA,EAAA;QAEpC,GAAA,CAKO,MAAA,EAAA,IAAA,EAAA;YAJN,GAAA,CAAuC,QAAA,EAAA,GAAA,CAAA,EAA9B,OAAK,EAAE,IAAA,CAAA,UAAU,EAAA,CAAA,EAAE,IAAE,EAAA,CAAA,CAAA,WAAA,EAAA,CAAA,SAAA,CAAA,CAAA;YAC9B,GAAA,CAAA,iBAAA,CAAA,IACgC,EAAA,GAAA,CAAA;gBADrB,KAA6C,EAAA,GAAA,CAA7C,GAAA,CAAA,EAAA,QAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,KAAA,EAAA,CAA6C,CAAA;gBAAE,OAAK,EAAE,IAAA,CAAA,OAAO;gBAAG,KAAK,EAAE,IAAA,CAAA,KAAK;gBACrF,QAAQ,EAAE,IAAA,CAAA,MAAM;;mBACL,IAAA,CAAA,SAAS,CAAA;kBAAtB,GAAA,CAAkE,OAAA,EAAA,GAAA,CAAA;;oBAA1C,IAAI,EAAC,WAAW;oBAAE,GAAG,EAAE,IAAA,CAAA,SAAS","file":"pages/index/index.uvue","sourcesContent":["<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<xf-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></xf-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script>\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\t// let permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t// \t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// // 请求权限\n\t\t\t// UTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t// \tif (allRight) {\n\t\t\t// \t\t// 权限请求成功\n\t\t\t// \t} else {\n\t\t\t// \t\t//用户拒绝了部分权限\n\t\t\t// \t}\n\t\t\t// }, function (_ : boolean, _ : string[]) {\n\t\t\t// \t//用户拒绝了部分权限\n\t\t\t// })\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tconsole.log(res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>"]}
{"version":3,"sources":["pages/index/index.uvue"],"names":[],"mappings":"AAgBC,OAAO,EACN,SAAS,EACT,eAAe,EACf,8BAA8B,EAC9B,qBAAoB,EACrB,MAAO,8BAA6B,CAAA;AAGpC,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AAA,CAAA;;;;;WAlEA,GAAA,CASc,aAAA,EAAA,GAAA,CAAA,EATD,KAAK,EAAC,kBAAkB,EAAA,CAAA,EAAA;QAEpC,GAAA,CAKO,MAAA,EAAA,IAAA,EAAA;YAJN,GAAA,CAAuC,QAAA,EAAA,GAAA,CAAA,EAA9B,OAAK,EAAE,IAAA,CAAA,UAAU,EAAA,CAAA,EAAE,IAAE,EAAA,CAAA,CAAA,WAAA,EAAA,CAAA,SAAA,CAAA,CAAA;YAC9B,GAAA,CAAA,mBAAA,CAAA,IACkC,EAAA,GAAA,CAAA;gBADrB,KAA6C,EAAA,GAAA,CAA7C,GAAA,CAAA,EAAA,QAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,KAAA,EAAA,CAA6C,CAAA;gBAAE,OAAK,EAAE,IAAA,CAAA,OAAO;gBAAG,KAAK,EAAE,IAAA,CAAA,KAAK;gBACvF,QAAQ,EAAE,IAAA,CAAA,MAAM;;mBACL,IAAA,CAAA,SAAS,CAAA;kBAAtB,GAAA,CAAkE,OAAA,EAAA,GAAA,CAAA;;oBAA1C,IAAI,EAAC,WAAW;oBAAE,GAAG,EAAE,IAAA,CAAA,SAAS","file":"pages/index/index.uvue","sourcesContent":["<template>\n\n\t<scroll-view class=\"page-scroll-view\">\n\n\t\t<view>\n\t\t\t<button @click=\"_takePhoto\">拍照</button>\n\t\t\t<skin-camera style=\"height:750rpx; background-color: red;\" @error=\"onError\" :flash=\"flash\"\n\t\t\t\t:position=\"device\"></skin-camera>\n\t\t\t<image v-if=\"imagePath\" mode=\"aspectFit\" :src=\"imagePath\"></image>\n\t\t</view>\n\n\t</scroll-view>\n\n</template>\n\n<script>\n\timport {\n\t\ttakePhoto,\n\t\tTakePhotoOption,\n\t\tTakePhotoSuccessCallbackResult,\n\t\tGeneralCallbackResult\n\t} from '@/uni_modules/Skin-cameraUTS'\n\t\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tyanse: \"red\",\n\t\t\t\twidthNum: 750,\n\t\t\t\theightNum: 200,\n\t\t\t\t\n\t\t\t\tflash: \"on\",\n\t\t\t\tdevice: \"front\",\n\t\t\t\timagePath: \"\",\n\t\t\t\tvideoPath: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4\"\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\tlet permissionNeed = [\"android.permission.CAMERA\", \"android.permission.RECORD_AUDIO\",\n\t\t\t\t\t\t\t\t\"android.permission.WRITE_EXTERNAL_STORAGE\"]\n\t\t\t// 请求权限\n\t\t\tUTSAndroid.requestSystemPermission(UTSAndroid.getUniActivity()!, permissionNeed, function (allRight : boolean, _ : string[]) {\n\t\t\t\tif (allRight) {\n\t\t\t\t\t// 权限请求成功\n\t\t\t\t} else {\n\t\t\t\t\t//用户拒绝了部分权限\n\t\t\t\t}\n\t\t\t}, function (_ : boolean, _ : string[]) {\n\t\t\t\t//用户拒绝了部分权限\n\t\t\t})\n\t\t},\n\t\tmethods: {\n\t\t\tonError(res : any) {\n\t\t\t\tconsole.log(res)\n\t\t\t},\n\t\t\t_takePhoto() {\n\t\t\t\ttakePhoto({\n\t\t\t\t\tsuccess: (res : TakePhotoSuccessCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t\tthis.imagePath = res.tempImagePath;\n\t\t\t\t\t\t// _previewImage();\n\t\t\t\t\t},\n\t\t\t\t\tfail: (res : GeneralCallbackResult) => {\n\t\t\t\t\t\tconsole.log('takePhoto', res)\n\t\t\t\t\t}\n\t\t\t\t} as TakePhotoOption)\n\t\t\t}\n\t\t}\n\t}\n</script>\n\n<style>\n\t.video {\n\t\twidth: 100%;\n\t\theight: 200px;\n\t}\n</style>"]}
@@ -11,7 +11,7 @@ export default {
/**
* 组件名称也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明只有声明过的事件才能被正常发送
*/
File diff suppressed because one or more lines are too long
@@ -14,7 +14,7 @@ export default {
/**
* 组件名称也就是开发者使用的标签
*/
name: "xf-camera",
name: "skin-camera",
/**
* 组件涉及的事件声明只有声明过的事件才能被正常发送
*/
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
@@ -9,8 +9,8 @@
],
"components": [
{
"name": "xf-camera",
"class": "uts.sdk.modules.SkinCameraUTS.XfCameraComponent"
"name": "skin-camera",
"class": "uts.sdk.modules.SkinCameraUTS.SkinCameraComponent"
}
]
}
+3 -3
View File
@@ -8,7 +8,7 @@
const is_uni_modules = true;
const pkg = /* @__PURE__ */ initUTSPackageName(name, is_uni_modules);
const cls = /* @__PURE__ */ initUTSIndexClassName(name, is_uni_modules);
const XfCameraComponent = {};
const SkinCameraComponent = {};
const takePhoto = /* @__PURE__ */ initUTSProxyFunction(false, { moduleName, moduleType, errMsg, main: true, package: pkg, class: cls, name: "takePhotoByJs", keepAlive: false, params: [{ "name": "options", "type": "UTSSDKModulesSkinCameraUTSTakePhotoOptionJSONObject" }], return: "" });
function resolveEasycom(component, easycom) {
return typeof component === "string" ? easycom : component;
@@ -53,13 +53,13 @@
return target;
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
resolveEasycom(vue.resolveDynamicComponent("xf-camera"), XfCameraComponent);
resolveEasycom(vue.resolveDynamicComponent("skin-camera"), SkinCameraComponent);
return vue.openBlock(), vue.createElementBlock("scroll-view", { class: "page-scroll-view" }, [
vue.createElementVNode("view", null, [
vue.createElementVNode("button", {
onClick: _cache[0] || (_cache[0] = (...args) => $options._takePhoto && $options._takePhoto(...args))
}, "拍照"),
vue.createElementVNode("xf-camera", {
vue.createElementVNode("skin-camera", {
style: { "height": "750rpx", "background-color": "red" },
onError: _cache[1] || (_cache[1] = (...args) => $options.onError && $options.onError(...args)),
flash: $data.flash,
@@ -2,9 +2,9 @@
"deploymentTarget": "11",
"components": [
{
"name": "xf-camera",
"class": "UTSSDKModulesSkinCameraUTSXfCameraComponent",
"delegateClass": "XfCameraComponentRegister"
"name": "skin-camera",
"class": "UTSSDKModulesSkinCameraUTSSkinCameraComponent",
"delegateClass": "SkinCameraComponentRegister"
}
]
}