success
This commit is contained in:
+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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user