提交 905b5874 编写于 作者: lizhongyi_'s avatar lizhongyi_

调整utsAndroid.uvue条件编译,避免iOS编译失败

上级 226f44fc
<template> <template>
<!-- #ifdef APP-ANDROID --> <!-- #ifdef APP-ANDROID -->
<scroll-view style="flex: 1"> <scroll-view style="flex: 1">
<view> <view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
</template> </template>
<script> <script>
// #ifdef APP-ANDROID
import { import {
getAppContextTest, getAppContextTest,
getUniActivityTest, getUniActivityTest,
...@@ -77,6 +78,8 @@ ...@@ -77,6 +78,8 @@
getDeviceInfoTest, getDeviceInfoTest,
privacyStateTest privacyStateTest
} from '@/uni_modules/uts-platform-api' } from '@/uni_modules/uts-platform-api'
// #endif
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
import { import {
UTSAcvitiyLifeCycleCallback, UTSAcvitiyLifeCycleCallback,
...@@ -86,11 +89,11 @@ ...@@ -86,11 +89,11 @@
UTSActivityComponentCallback, UTSActivityComponentCallback,
onCallbackChange onCallbackChange
} from '@/uni_modules/uts-syntaxcase' } from '@/uni_modules/uts-syntaxcase'
// #endif
import File from 'java.io.File'; import File from 'java.io.File';
import Intent from 'android.content.Intent'; import Intent from 'android.content.Intent';
// #endif
/** /**
* 测试在页面生命周期之外,使用api * 测试在页面生命周期之外,使用api
...@@ -111,6 +114,7 @@ ...@@ -111,6 +114,7 @@
}, },
onLoad: function () { onLoad: function () {
// #ifdef APP-ANDROID
let that = this let that = this
initAppLifecycle(function (eventLog) { initAppLifecycle(function (eventLog) {
// 展示捕捉到的声明周期日志 // 展示捕捉到的声明周期日志
...@@ -119,8 +123,10 @@ ...@@ -119,8 +123,10 @@
let nextLineFlag = that.text + '\n' let nextLineFlag = that.text + '\n'
that.text = nextLineFlag that.text = nextLineFlag
}) })
// #endif
}, },
methods: { methods: {
// #ifdef APP-ANDROID
privacyStateClick() { privacyStateClick() {
privacyStateTest(function (ret, desc) { privacyStateTest(function (ret, desc) {
if (ret) { if (ret) {
...@@ -314,6 +320,7 @@ ...@@ -314,6 +320,7 @@
} }
}) })
}, },
// #endif
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
// #ifdef UNI-APP-X // #ifdef UNI-APP-X
activityCallback() { activityCallback() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册