success
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -0,0 +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"}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"version": "1",
|
||||
"env": {
|
||||
"compiler_version": "4.87"
|
||||
},
|
||||
"files": {
|
||||
"pages/index/index.kt": {
|
||||
"class": "GenPagesIndexIndex",
|
||||
"md5": "0ba1bdcb867acacda8a20ff033971ed372d8a0d5"
|
||||
},
|
||||
"index.kt": {
|
||||
"class": "",
|
||||
"md5": "3d228610d7ea1f50297ff2c98f1d707625ffc2ff"
|
||||
}
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
package uni.UNI644401D
|
||||
import io.dcloud.uniapp.*
|
||||
import io.dcloud.uniapp.extapi.*
|
||||
import io.dcloud.uniapp.framework.*
|
||||
import io.dcloud.uniapp.runtime.*
|
||||
import io.dcloud.uniapp.vue.*
|
||||
import io.dcloud.uniapp.vue.shared.*
|
||||
import io.dcloud.unicloud.*
|
||||
import io.dcloud.uts.*
|
||||
import io.dcloud.uts.Map
|
||||
import io.dcloud.uts.Set
|
||||
import io.dcloud.uts.UTSAndroid
|
||||
import kotlin.properties.Delegates
|
||||
import io.dcloud.uniapp.extapi.exit as uni_exit
|
||||
import io.dcloud.uniapp.extapi.showToast as uni_showToast
|
||||
val runBlock1 = run {
|
||||
__uniConfig.getAppStyles = fun(): Map<String, Map<String, Map<String, Any>>> {
|
||||
return GenApp.styles
|
||||
}
|
||||
}
|
||||
var firstBackTime: Number = 0
|
||||
open class GenApp : BaseApp {
|
||||
constructor(__ins: ComponentInternalInstance) : super(__ins) {
|
||||
onLaunch(fun(_: OnLaunchOptions) {
|
||||
console.log("App Launch", " at App.uvue:7")
|
||||
}
|
||||
, __ins)
|
||||
onAppShow(fun(_: OnShowOptions) {
|
||||
console.log("App Show", " at App.uvue:10")
|
||||
}
|
||||
, __ins)
|
||||
onAppHide(fun() {
|
||||
console.log("App Hide", " at App.uvue:13")
|
||||
}
|
||||
, __ins)
|
||||
onLastPageBackPress(fun() {
|
||||
console.log("App LastPageBackPress", " at App.uvue:17")
|
||||
if (firstBackTime == 0) {
|
||||
uni_showToast(ShowToastOptions(title = "再按一次退出应用", position = "bottom"))
|
||||
firstBackTime = Date.now()
|
||||
setTimeout(fun(){
|
||||
firstBackTime = 0
|
||||
}, 2000)
|
||||
} else if (Date.now() - firstBackTime < 2000) {
|
||||
firstBackTime = Date.now()
|
||||
uni_exit(null)
|
||||
}
|
||||
}
|
||||
, __ins)
|
||||
onExit(fun() {
|
||||
console.log("App Exit", " at App.uvue:34")
|
||||
}
|
||||
, __ins)
|
||||
}
|
||||
companion object {
|
||||
val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
|
||||
_nCS(_uA(
|
||||
styles0
|
||||
))
|
||||
}
|
||||
val styles0: Map<String, Map<String, Map<String, Any>>>
|
||||
get() {
|
||||
return _uM("uni-row" to _pS(_uM("flexDirection" to "row")), "uni-column" to _pS(_uM("flexDirection" to "column")))
|
||||
}
|
||||
}
|
||||
}
|
||||
val GenAppClass = CreateVueAppComponent(GenApp::class.java, fun(): VueComponentOptions {
|
||||
return VueComponentOptions(type = "app", name = "", inheritAttrs = true, inject = Map(), props = Map(), propsNeedCastKeys = _uA(), emits = Map(), components = Map(), styles = GenApp.styles)
|
||||
}
|
||||
, fun(instance): GenApp {
|
||||
return GenApp(instance)
|
||||
}
|
||||
)
|
||||
val GenPagesIndexIndexClass = CreateVueComponent(GenPagesIndexIndex::class.java, fun(): VueComponentOptions {
|
||||
return VueComponentOptions(type = "page", name = "", inheritAttrs = GenPagesIndexIndex.inheritAttrs, inject = GenPagesIndexIndex.inject, props = GenPagesIndexIndex.props, propsNeedCastKeys = GenPagesIndexIndex.propsNeedCastKeys, emits = GenPagesIndexIndex.emits, components = GenPagesIndexIndex.components, styles = GenPagesIndexIndex.styles)
|
||||
}
|
||||
, fun(instance, renderer): GenPagesIndexIndex {
|
||||
return GenPagesIndexIndex(instance, renderer)
|
||||
}
|
||||
)
|
||||
fun createApp(): UTSJSONObject {
|
||||
val app = createSSRApp(GenAppClass)
|
||||
return _uO("app" to app)
|
||||
}
|
||||
fun main(app: IApp) {
|
||||
definePageRoutes()
|
||||
defineAppConfig()
|
||||
(createApp()["app"] as VueApp).mount(app, GenUniApp())
|
||||
}
|
||||
open class UniAppConfig : io.dcloud.uniapp.appframe.AppConfig {
|
||||
override var name: String = "SkinCamera"
|
||||
override var appid: String = "__UNI__644401D"
|
||||
override var versionName: String = "1.0.0"
|
||||
override var versionCode: String = "100"
|
||||
override var uniCompilerVersion: String = "4.87"
|
||||
constructor() : super() {}
|
||||
}
|
||||
fun definePageRoutes() {
|
||||
__uniRoutes.push(UniPageRoute(path = "pages/index/index", component = GenPagesIndexIndexClass, meta = UniPageMeta(isQuit = true), style = _uM("navigationBarTitleText" to "uni-app x")))
|
||||
}
|
||||
val __uniLaunchPage: Map<String, Any?> = _uM("url" to "pages/index/index", "style" to _uM("navigationBarTitleText" to "uni-app x"))
|
||||
fun defineAppConfig() {
|
||||
__uniConfig.entryPagePath = "/pages/index/index"
|
||||
__uniConfig.globalStyle = _uM("navigationBarTextStyle" to "black", "navigationBarTitleText" to "uni-app x", "navigationBarBackgroundColor" to "#F8F8F8", "backgroundColor" to "#F8F8F8")
|
||||
__uniConfig.getTabBarConfig = fun(): Map<String, Any>? {
|
||||
return null
|
||||
}
|
||||
__uniConfig.tabBar = __uniConfig.getTabBarConfig()
|
||||
__uniConfig.conditionUrl = ""
|
||||
__uniConfig.uniIdRouter = _uM()
|
||||
__uniConfig.ready = true
|
||||
}
|
||||
open class GenUniApp : UniAppImpl() {
|
||||
open val vm: GenApp?
|
||||
get() {
|
||||
return getAppVm() as GenApp?
|
||||
}
|
||||
open val `$vm`: GenApp?
|
||||
get() {
|
||||
return getAppVm() as GenApp?
|
||||
}
|
||||
}
|
||||
fun getApp(): GenUniApp {
|
||||
return getUniApp() as GenUniApp
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
package uni.UNI644401D
|
||||
import io.dcloud.uniapp.*
|
||||
import io.dcloud.uniapp.extapi.*
|
||||
import io.dcloud.uniapp.framework.*
|
||||
import io.dcloud.uniapp.runtime.*
|
||||
import io.dcloud.uniapp.vue.*
|
||||
import io.dcloud.uniapp.vue.shared.*
|
||||
import io.dcloud.unicloud.*
|
||||
import io.dcloud.uts.*
|
||||
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.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)
|
||||
}
|
||||
@Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
|
||||
override fun `$render`(): Any? {
|
||||
val _ctx = this
|
||||
val _cache = this.`$`.renderCache
|
||||
return _cE("scroll-view", _uM("class" to "page-scroll-view"), _uA(
|
||||
_cE("view", null, _uA(
|
||||
_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(
|
||||
"onError",
|
||||
"flash",
|
||||
"position"
|
||||
)),
|
||||
if (isTrue(_ctx.imagePath)) {
|
||||
_cE("image", _uM("key" to 0, "mode" to "aspectFit", "src" to _ctx.imagePath), null, 8, _uA(
|
||||
"src"
|
||||
))
|
||||
} else {
|
||||
_cC("v-if", true)
|
||||
}
|
||||
))
|
||||
))
|
||||
}
|
||||
open var yanse: String by `$data`
|
||||
open var widthNum: Number by `$data`
|
||||
open var heightNum: Number by `$data`
|
||||
open var flash: String by `$data`
|
||||
open var device: String by `$data`
|
||||
open var imagePath: String by `$data`
|
||||
open var videoPath: String by `$data`
|
||||
@Suppress("USELESS_CAST")
|
||||
override fun data(): Map<String, Any?> {
|
||||
return _uM("yanse" to "red", "widthNum" to 750, "heightNum" to 200, "flash" to "on", "device" to "front", "imagePath" to "", "videoPath" to "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4")
|
||||
}
|
||||
open var onError = ::gen_onError_fn
|
||||
open fun gen_onError_fn(res: Any) {
|
||||
console.log(res, " at pages/index/index.uvue:54")
|
||||
}
|
||||
open var _takePhoto = ::gen__takePhoto_fn
|
||||
open fun gen__takePhoto_fn() {
|
||||
takePhoto(TakePhotoOption(success = fun(res: TakePhotoSuccessCallbackResult){
|
||||
console.log("takePhoto", res, " at pages/index/index.uvue:59")
|
||||
this.imagePath = res.tempImagePath
|
||||
}
|
||||
, fail = fun(res: GeneralCallbackResult){
|
||||
console.log("takePhoto", res, " at pages/index/index.uvue:64")
|
||||
}
|
||||
))
|
||||
}
|
||||
companion object {
|
||||
val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
|
||||
_nCS(_uA(
|
||||
styles0
|
||||
), _uA(
|
||||
GenApp.styles
|
||||
))
|
||||
}
|
||||
val styles0: Map<String, Map<String, Map<String, Any>>>
|
||||
get() {
|
||||
return _uM("video" to _pS(_uM("width" to "100%", "height" to 200)))
|
||||
}
|
||||
var inheritAttrs = true
|
||||
var inject: Map<String, Map<String, Any?>> = _uM()
|
||||
var emits: Map<String, Any?> = _uM()
|
||||
var props = _nP(_uM())
|
||||
var propsNeedCastKeys: UTSArray<String> = _uA()
|
||||
var components: Map<String, CreateVueComponent> = _uM()
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user