提交 c0027983 编写于 作者: 杜庆泉's avatar 杜庆泉

修复 vue2 web 模式编译失败的问题

上级 534539fb
...@@ -11,13 +11,15 @@ ...@@ -11,13 +11,15 @@
</view> </view>
</template> </template>
<script> <script>
import { // #ifndef H5
checkHasIntegration import {
} from "@/uni_modules/uts-tencentgeolocation"; checkHasIntegration
} from "@/uni_modules/uts-tencentgeolocation";
import { import {
checkHasLottieIntegration checkHasLottieIntegration
} from "@/uni_modules/uts-animation-view"; } from "@/uni_modules/uts-animation-view";
// #endif
export default { export default {
data() { data() {
...@@ -50,17 +52,20 @@ ...@@ -50,17 +52,20 @@
url: `/pages/${e.url}` url: `/pages/${e.url}`
}) })
}, },
gotoLottie: function(e) { gotoLottie: function(e) {
if (checkHasLottieIntegration()) { // #ifndef H5
uni.navigateTo({ if (checkHasLottieIntegration()) {
url: '/pages/SDKIntegration/Lottie/index' uni.navigateTo({
}) url: '/pages/SDKIntegration/Lottie/index'
} else { })
uni.showToast({ } else {
icon: 'none', uni.showToast({
title: '需要在自定义基座中运行' icon: 'none',
}) title: '需要在自定义基座中运行'
} })
}
// #endif
}, },
gotoTencentLocation: function(e) { gotoTencentLocation: function(e) {
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
</view> </view>
</template> </template>
<script> <script>
// #ifndef H5
import { import {
checkHasIntegration, checkHasIntegration,
requestPremission, requestPremission,
...@@ -29,7 +30,7 @@ ...@@ -29,7 +30,7 @@
watchPosition, watchPosition,
clearWatch clearWatch
} from "@/uni_modules/uts-tencentgeolocation"; } from "@/uni_modules/uts-tencentgeolocation";
// #endif
export default { export default {
data() { data() {
return { return {
......
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
</template> </template>
<script> <script>
// #ifdef APP-ANDROID
import { showToast } from '@/uni_modules/uts-toast' import { showToast } from '@/uni_modules/uts-toast'
// #endif
export default { export default {
......
...@@ -49,7 +49,8 @@ ...@@ -49,7 +49,8 @@
<button @click="testAll">点击测试所有</button> <button @click="testAll">点击测试所有</button>
</view> </view>
</template> </template>
<script> <script>
// #ifndef H5
import { import {
MAX, MAX,
testSync, testSync,
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
Test, Test,
request, request,
} from "../../uni_modules/uts-syntaxcase"; } from "../../uni_modules/uts-syntaxcase";
// #endif
let test let test
let id = 0 let id = 0
export default { export default {
......
<template> <template>
<view> <view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view class="uni-hello-text"> <view class="uni-hello-text">
逐一点击执行,观察测试反馈 逐一点击执行,观察测试反馈
...@@ -39,10 +40,12 @@ ...@@ -39,10 +40,12 @@
</view> </view>
</view> </view>
<button @tap="getDeviceInfoClick">获取设备基础信息</button> <button @tap="getDeviceInfoClick">获取设备基础信息</button>
</view> </view>
</template> </template>
<script> <script>
// #ifdef APP-ANDROID
import { import {
getAppContextTest, getAppContextTest,
getUniActivityTest, getUniActivityTest,
...@@ -60,7 +63,7 @@ ...@@ -60,7 +63,7 @@
getDeviceInfoTest, getDeviceInfoTest,
privacyStateTest privacyStateTest
} from '@/uni_modules/uts-platform-api' } from '@/uni_modules/uts-platform-api'
// #endif
/** /**
* 测试在页面生命周期之外,使用api * 测试在页面生命周期之外,使用api
*/ */
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<script> <script>
// #ifdef APP-IOS
import { import {
getCurrentVCTest, getCurrentVCTest,
getKeyWindowTest, getKeyWindowTest,
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
tepeofTest, tepeofTest,
dataConvertTest, dataConvertTest,
} from "@/uni_modules/uts-platform-api" } from "@/uni_modules/uts-platform-api"
// #endif
export default { export default {
data() { data() {
return { return {
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
</template> </template>
<script> <script>
// #ifdef APP
import { showAlert,showPrompt } from '@/uni_modules/uts-alert' import { showAlert,showPrompt } from '@/uni_modules/uts-alert'
// #endif
export default { export default {
data() { data() {
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
</template> </template>
<script> <script>
// #ifdef APP
import { showAlert,showPrompt } from '@/uni_modules/uts-alert' import { showAlert,showPrompt } from '@/uni_modules/uts-alert'
// #endif
export default { export default {
data() { data() {
......
...@@ -11,11 +11,12 @@ ...@@ -11,11 +11,12 @@
</template> </template>
<script> <script>
// #ifndef H5
import { import {
onUserCaptureScreen, onUserCaptureScreen,
offUserCaptureScreen offUserCaptureScreen
} from "@/uni_modules/uts-screenshot-listener"; } from "@/uni_modules/uts-screenshot-listener";
// #endif
export default { export default {
data() { data() {
return { return {
......
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
</view> </view>
</view> </view>
</template>· </template>·
<script> <script>
import { gotoDemoActivity } from "@/uni_modules/uts-nativepage"; // #ifdef APP-ANDROID
import { gotoDemoActivity } from "@/uni_modules/uts-nativepage";
// #endif
import { getBatteryInfo } from "@/uni_modules/uts-getbatteryinfo"; import { getBatteryInfo } from "@/uni_modules/uts-getbatteryinfo";
export default { export default {
...@@ -95,14 +97,16 @@ ...@@ -95,14 +97,16 @@
} }
}) })
}, },
testGotoDemoActivity() { testGotoDemoActivity() {
// #ifdef APP-ANDROID
let ret = gotoDemoActivity(); let ret = gotoDemoActivity();
if (!ret) { if (!ret) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '需要在自定义基座中运行' title: '需要在自定义基座中运行'
}) })
} }
// #endif
} }
} }
} }
......
...@@ -19,9 +19,10 @@ ...@@ -19,9 +19,10 @@
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</template> </template>
<script lang="ts"> <script lang="ts">
import { runTests, Result } from '../../uni_modules/uts-tests' // #ifdef APP
import { runTests, Result } from '../../uni_modules/uts-tests'
// #endif
export default { export default {
data() { data() {
return { return {
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
</view> </view>
</view> </view>
</template> </template>
<script> <script>
// #ifdef APP
import { import {
runTests runTests
} from '../../uni_modules/uts-tests' } from '../../uni_modules/uts-tests'
// #endif
export default { export default {
data() { data() {
return { return {
......
export function addViewToDecorView() { }
export function removeViewToDecorView() { }
export function initAppLifecycle() { }
export function getLogoPath() {}
export function playAssetAudio(){}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册