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

Merge branch 'dev' into alpha

...@@ -11,14 +11,12 @@ ...@@ -11,14 +11,12 @@
</view> </view>
</template> </template>
<script> <script>
// #ifndef H5
import { import {
checkHasIntegration checkHasIntegration
} from "@/uni_modules/uts-tencentgeolocation"; } 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 {
...@@ -53,7 +51,6 @@ ...@@ -53,7 +51,6 @@
}) })
}, },
gotoLottie: function(e) { gotoLottie: function(e) {
// #ifndef H5
if (checkHasLottieIntegration()) { if (checkHasLottieIntegration()) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/SDKIntegration/Lottie/index' url: '/pages/SDKIntegration/Lottie/index'
...@@ -64,8 +61,6 @@ ...@@ -64,8 +61,6 @@
title: '需要在自定义基座中运行' title: '需要在自定义基座中运行'
}) })
} }
// #endif
}, },
gotoTencentLocation: function(e) { gotoTencentLocation: function(e) {
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
</template> </template>
<script> <script>
// #ifndef H5
import { import {
checkHasIntegration, checkHasIntegration,
requestPremission, requestPremission,
...@@ -30,7 +29,7 @@ ...@@ -30,7 +29,7 @@
watchPosition, watchPosition,
clearWatch clearWatch
} from "@/uni_modules/uts-tencentgeolocation"; } from "@/uni_modules/uts-tencentgeolocation";
// #endif
export default { export default {
data() { data() {
return { return {
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
import { showToast } from '@/uni_modules/uts-toast' import { showToast } from '@/uni_modules/uts-toast'
export default { export default {
data() { data() {
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
</template> </template>
<script> <script>
// #ifdef APP-ANDROID
import { import {
getAppContextTest, getAppContextTest,
getUniActivityTest, getUniActivityTest,
...@@ -63,7 +62,6 @@ ...@@ -63,7 +62,6 @@
getDeviceInfoTest, getDeviceInfoTest,
privacyStateTest privacyStateTest
} from '@/uni_modules/uts-platform-api' } from '@/uni_modules/uts-platform-api'
// #endif
/** /**
* 测试在页面生命周期之外,使用api * 测试在页面生命周期之外,使用api
*/ */
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
</template> </template>
<script> <script>
// #ifndef APP-ANDROID
import { import {
getCurrentVCTest, getCurrentVCTest,
getKeyWindowTest, getKeyWindowTest,
...@@ -45,7 +44,6 @@ ...@@ -45,7 +44,6 @@
tepeofTest, tepeofTest,
dataConvertTest, dataConvertTest,
} from "@/uni_modules/uts-platform-api" } from "@/uni_modules/uts-platform-api"
// #endif
export default { export default {
......
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
</view> </view>
</template>· </template>·
<script> <script>
// #ifdef APP-ANDROID
import { gotoDemoActivity } from "@/uni_modules/uts-nativepage"; 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 {
...@@ -98,7 +96,6 @@ ...@@ -98,7 +96,6 @@
}) })
}, },
testGotoDemoActivity() { testGotoDemoActivity() {
// #ifdef APP-ANDROID
let ret = gotoDemoActivity(); let ret = gotoDemoActivity();
if (!ret) { if (!ret) {
uni.showToast({ uni.showToast({
...@@ -106,7 +103,6 @@ ...@@ -106,7 +103,6 @@
title: '需要在自定义基座中运行' title: '需要在自定义基座中运行'
}) })
} }
// #endif
} }
} }
} }
......
...@@ -17,11 +17,9 @@ ...@@ -17,11 +17,9 @@
</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 {
......
...@@ -93,8 +93,13 @@ export function getAppTempPathTest() : boolean { ...@@ -93,8 +93,13 @@ export function getAppTempPathTest() : boolean {
if (UTSAndroid.getAppCachePath()!.contains("uni.UNI70BE9D0/apps/__UNI__70BE9D0/temp")) { if (UTSAndroid.getAppCachePath()!.contains("uni.UNI70BE9D0/apps/__UNI__70BE9D0/temp")) {
return true return true
} }
let cachePath = UTSAndroid.getAppCachePath()!
// 2.0的路径 // 2.0的路径
if (UTSAndroid.getAppCachePath()!.contains("cache/temp")) { if (cachePath.contains("io.dcloud.uniappx/cache")) {
return true
}
// 2.0 自定义基座的情况
if (cachePath.contains("uni.UNI70BE9D0/cache")) {
return true return true
} }
......
...@@ -32,9 +32,9 @@ export function testGlobal(): Result { ...@@ -32,9 +32,9 @@ export function testGlobal(): Result {
expect(isNaN(parseInt("345", 2))).toEqual(true) expect(isNaN(parseInt("345", 2))).toEqual(true)
expect(isNaN(parseInt("hello"))).toEqual(true) expect(isNaN(parseInt("hello"))).toEqual(true)
expect(parseInt("6.022e23")).toEqual(6) expect(parseInt("6.022e23")).toEqual(6)
expect(parseInt("9223372036854775807")).toEqual(9.223372036854778e+18) expect(parseInt("9223372036854775807")).toEqualNumber(9.223372036854778e+18)
expect(parseInt("9223372036854775807000")).toEqual(9.223372036854777e+21) expect(parseInt("9223372036854775807000")).toEqualNumber(9.223372036854777e+21)
expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqual(9.223372036854776e+86) expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqualNumber(9.223372036854776e+86)
expect(parseInt("50") / 100).toEqualNumber(0.5); expect(parseInt("50") / 100).toEqualNumber(0.5);
expect(parseInt("500") / 100).toEqualNumber(5); expect(parseInt("500") / 100).toEqualNumber(5);
......
...@@ -98,7 +98,13 @@ export function testNumber() : Result { ...@@ -98,7 +98,13 @@ export function testNumber() : Result {
expect(a.toString(2).substring(0,32)).toEqual("10010110011101101001100101010000"); expect(a.toString(2).substring(0,32)).toEqual("10010110011101101001100101010000");
expect(a.toString(2).substring(100)).toEqual("000000000000000000000000000"); expect(a.toString(2).substring(100)).toEqual("000000000000000000000000000");
const b = 1e22 const b = 1e22
expect(b.toString(12)).toEqual("27373a86ba1a194a65054"); const bStr12 = b.toString(12)
/**
* 移动端: 27373a86ba1a194a65054
* 浏览器端:27373a86ba1a195400000
*/
expect(bStr12.length).toEqual(21);
expect(bStr12.substring(0,14)).toEqual("27373a86ba1a19");
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册