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

add system api page

上级 c7f2fa4f
{
"name" : "HelloUTSTemplate",
"name" : "HelloUTS",
"appid" : "__UNI__70BE9D0",
"description" : "",
"versionName" : "1.0.0",
......
......@@ -36,12 +36,8 @@
"enablePullDownRefresh": false
}
},{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"tabBar": {
"color": "#7A7E83",
......
<template>
<view>当前电量:{{ capacity }}</view>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { getBatteryCapacity } from '../../uni_modules/test-uts-battery'
const capacity = ref(getBatteryCapacity())
</script>
\ No newline at end of file
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>
<template>
<view>
<text> advance</text>
</view>
<button @click="testUtsSync">点击测试uts同步方法</button>
<view>测试return:
{{ format(testUtsSyncResult) }}
</view>
<button @click="testUtsSyncWithCallback">
点击测试uts带callback的同步方法
</button>
<view>测试return:{{ format(testUtsSyncWithCallbackResult.return) }}</view>
<view>测试success:{{ format(testUtsSyncWithCallbackResult.success) }}</view>
<view>测试complete:{{ format(testUtsSyncWithCallbackResult.complete) }}</view>
<button @click="testUtsAsync">点击测试uts异步方法</button>
<view>测试return:{{ format(testUtsAsyncResult.return) }}</view>
<view>测试success:{{ format(testUtsAsyncResult.success) }}</view>
<view>测试complete:{{ format(testUtsAsyncResult.complete) }}</view>
<button @click="testUtsClassConstructor">点击测试uts class构造函数</button>
<view>测试callback:{{ format(testUtsClassConstructorResult.callback) }}</view>
<button @click="testUtsClassStaticProp">点击测试uts class静态属性</button>
<view>测试value:{{ format(testUtsClassStaticPropResult) }}</view>
<button @click="testUtsClassStaticSyncWithCallback">
点击测试uts class静态方法
</button>
<view>测试return:{{ format(testUtsClassStaticSyncWithCallbackResult.return) }}</view>
<view>测试success:{{ format(testUtsClassStaticSyncWithCallbackResult.success) }}</view>
<view>测试complete:{{ format(testUtsClassStaticSyncWithCallbackResult.complete) }}</view>
<button @click="testUtsClassStaticAsync">点击测试uts class静态异步方法</button>
<view>测试return:{{ format(testUtsClassStaticAsyncResult.return) }}</view>
<view>测试success:{{ format(testUtsClassStaticAsyncResult.success) }}</view>
<view>测试complete:{{ format(testUtsClassStaticAsyncResult.complete) }}</view>
<button @click="testUtsClassProp">点击测试uts class实例属性</button>
<view>测试value:{{ format(testUtsClassPropResult) }}</view>
<button @click="testUtsClassSyncWithCallback">
点击测试uts class实例方法
</button>
<view>测试return:{{ format(testUtsClassSyncWithCallbackResult.return) }}</view>
<view>测试success:{{ format(testUtsClassSyncWithCallbackResult.success) }}</view>
<view>测试complete:{{ format(testUtsClassSyncWithCallbackResult.complete) }}</view>
<button @click="testUtsClassAsync">点击测试uts class实例异步方法</button>
<view>测试return:{{ format(testUtsClassAsyncResult.return) }}</view>
<view>测试success:{{ format(testUtsClassAsyncResult.success) }}</view>
<view>测试complete:{{ format(testUtsClassAsyncResult.complete) }}</view>
<button @click="testAll">点击测试所有</button>
</template>
<script lang="ts" setup>
import { ref, reactive } from "vue";
import {
MAX,
testSync,
testSyncWithCallback,
testAsync,
Test,
} from "../../../uni_modules/uts-advance";
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
console.log("MAX", MAX);
const testUtsSyncResult = ref<boolean | null>(null);
interface Result {
return: boolean | null;
success: boolean | null;
fail: boolean | null;
complete: boolean | null;
}
const testUtsSyncWithCallbackResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
const testUtsAsyncResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
function testAll() {
testUtsSync();
testUtsSyncWithCallback();
testUtsAsync();
testUtsClassConstructor();
testUtsClassStaticProp();
testUtsClassStaticSyncWithCallback();
testUtsClassStaticAsync();
testUtsClassProp();
testUtsClassSyncWithCallback();
testUtsClassAsync();
}
function testUtsSync() {
testUtsSyncResult.value = false;
try {
if (testSync("dcloud").msg === "hello dcloud") {
testUtsSyncResult.value = true;
}
} catch (e) {
console.error("testUtsSync", e);
}
}
function testUtsSyncWithCallback() {
try {
testUtsSyncWithCallbackResult.return = false;
testUtsSyncWithCallbackResult.success = false;
// testUtsSyncWithCallbackResult.fail = false;
testUtsSyncWithCallbackResult.complete = false;
if (
testSyncWithCallback({
type: "success",
success(res) {
console.log("testSyncWithCallback.success.callback", res);
testUtsSyncWithCallbackResult.success = true;
},
fail(res) {
console.log("testSyncWithCallback.fail.callback", res);
// testUtsSyncWithCallbackResult.fail = true;
},
complete(res) {
console.log("testSyncWithCallback.complete.callback", res);
testUtsSyncWithCallbackResult.complete = true;
},
}).name === "testSyncWithCallback"
) {
testUtsSyncWithCallbackResult.return = true;
}
} catch (e) { }
}
async function testUtsAsync() {
testUtsAsyncResult.return = false;
testUtsAsyncResult.success = false;
// testUtsAsyncResult.fail = false;
testUtsAsyncResult.complete = false;
try {
const res = await testAsync({
type: "success",
success(res) {
console.log("testAsync.success.callback", res);
testUtsAsyncResult.success = true;
},
fail(res) {
console.log("testAsync.fail.callback", res);
},
complete(res) {
console.log("testAsync.complete.callback", res);
testUtsAsyncResult.complete = true;
},
});
if (res.name === "testAsync") {
testUtsAsyncResult.return = true;
}
} catch (e) { }
}
function format(v: boolean | null) {
return v == null ? "--" : v ? "通过" : "未通过";
}
let test: Test
let id = 0
const testUtsClassConstructorResult = reactive<{ callback: boolean | null }>({
callback: null
});
function testUtsClassConstructor() {
testUtsClassConstructorResult.callback = false
id++
test = new Test(id, {
name: 'name' + id, callback: (res) => {
console.log(res)
testUtsClassConstructorResult.callback = true
}
})
}
const testUtsClassStaticPropResult = ref<boolean | null>(null);
function testUtsClassStaticProp() {
testUtsClassStaticPropResult.value = false
if (Test.type === 'Test') {
testUtsClassStaticPropResult.value = true
}
}
const testUtsClassStaticSyncWithCallbackResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
function testUtsClassStaticSyncWithCallback() {
try {
testUtsClassStaticSyncWithCallbackResult.return = false;
testUtsClassStaticSyncWithCallbackResult.success = false;
// testUtsClassStaticSyncWithCallbackResult.fail = false;
testUtsClassStaticSyncWithCallbackResult.complete = false;
if (
Test.testClassStaticSyncWithCallback({
type: "success",
success(res) {
console.log("testStaticSyncWithCallback.success.callback", res);
testUtsClassStaticSyncWithCallbackResult.success = true;
},
fail(res) {
console.log("testStaticSyncWithCallback.fail.callback", res);
// testUtsClassStaticSyncWithCallbackResult.fail = true;
},
complete(res) {
console.log("testStaticSyncWithCallback.complete.callback", res);
testUtsClassStaticSyncWithCallbackResult.complete = true;
},
}).name === "testSyncWithCallback"
) {
testUtsClassStaticSyncWithCallbackResult.return = true;
}
} catch (e) { }
}
const testUtsClassStaticAsyncResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
async function testUtsClassStaticAsync() {
testUtsClassStaticAsyncResult.return = false;
testUtsClassStaticAsyncResult.success = false;
// testUtsClassStaticAsyncResult.fail = false;
testUtsClassStaticAsyncResult.complete = false;
try {
const res = await Test.testClassStaticAsync({
type: "success",
success(res) {
console.log("testAsync.success.callback", res);
testUtsClassStaticAsyncResult.success = true;
},
fail(res) {
console.log("testAsync.fail.callback", res);
},
complete(res) {
console.log("testAsync.complete.callback", res);
testUtsClassStaticAsyncResult.complete = true;
},
});
if (res.name === "testAsync") {
testUtsClassStaticAsyncResult.return = true;
}
} catch (e) { }
}
<style>
const testUtsClassPropResult = ref<boolean | null>(null);
function testUtsClassProp() {
if (!test) {
testUtsClassConstructor()
}
testUtsClassPropResult.value = false
if (test.id > 0) {
testUtsClassPropResult.value = true
}
}
</style>
const testUtsClassSyncWithCallbackResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
function testUtsClassSyncWithCallback() {
if (!test) {
testUtsClassConstructor()
}
try {
testUtsClassSyncWithCallbackResult.return = false;
testUtsClassSyncWithCallbackResult.success = false;
// testUtsClassSyncWithCallbackResult.fail = false;
testUtsClassSyncWithCallbackResult.complete = false;
if (
test.testClassSyncWithCallback({
type: "success",
success(res) {
console.log("testSyncWithCallback.success.callback", res);
testUtsClassSyncWithCallbackResult.success = true;
},
fail(res) {
console.log("testSyncWithCallback.fail.callback", res);
// testUtsClassSyncWithCallbackResult.fail = true;
},
complete(res) {
console.log("testSyncWithCallback.complete.callback", res);
testUtsClassSyncWithCallbackResult.complete = true;
},
}).name === "testSyncWithCallback"
) {
testUtsClassSyncWithCallbackResult.return = true;
}
} catch (e) { }
}
const testUtsClassAsyncResult = reactive<Result>({
return: null,
success: null,
fail: null,
complete: null,
});
async function testUtsClassAsync() {
if (!test) {
testUtsClassConstructor()
}
testUtsClassAsyncResult.return = false;
testUtsClassAsyncResult.success = false;
// testUtsClassAsyncResult.fail = false;
testUtsClassAsyncResult.complete = false;
try {
const res = await test.testClassAsync({
type: "success",
success(res) {
console.log("testAsync.success.callback", res);
testUtsClassAsyncResult.success = true;
},
fail(res) {
console.log("testAsync.fail.callback", res);
},
complete(res) {
console.log("testAsync.complete.callback", res);
testUtsClassAsyncResult.complete = true;
},
});
if (res.name === "testAsync") {
testUtsClassAsyncResult.return = true;
}
} catch (e) { }
}
</script>
<template>
<view>
<text>systemAPI</text>
<page-head :title="title"></page-head>
<view class="uni-btn-v uni-common-mt">
<button type="primary" @tap="testGetBatteryCapacity">获取电池电量</button>
</view>
</view>
</template>
<script>
import {
getBatteryCapacity
} from "../../../uni_modules/uts-osapi";
export default {
data() {
return {
title: '系统API示例',
}
},
onUnload:function(){
},
methods: {
testGetBatteryCapacity: function () {
var capacity = getBatteryCapacity()
console.log(capacity);
uni.showToast({
title:"当前电量:"+capacity,
icon:'none'
});
},
}
}
......@@ -19,4 +36,5 @@
<style>
</style>
import { log } from "./utils.uts";
type AsyncOptions = {
type: string;
success: (res: string) => void;
fail: (res: string) => void;
complete: (res: string) => void;
};
/**
* 导出一个属性
*/
export const MAX = 100;
/**
* 导出一个同步方法
* @returns
*/
export function testSync(msg: string) {
console.log("log test");
log("log test1");
return {
msg: `hello ${msg}`,
};
}
/**
* 导出一个同步方法(触发了数组越界异常)
*/
export function testSyncError() {
const arr: string[] = [];
console.log(arr[1]);
}
/**
* 导出一个带callback的同步方法
* @param opts
*/
export function testSyncWithCallback(opts: AsyncOptions) {
if (opts.type == "success") {
opts.success("success");
} else {
opts.fail("fail");
}
opts.complete("complete");
return { name: "testSyncWithCallback" };
}
/**
* 导出一个异步方法
* @returns
*/
export async function testAsync(opts: AsyncOptions) {
if (opts.type == "success") {
opts.success("success");
} else {
opts.fail("fail");
}
opts.complete("complete");
return { name: "testAsync" };
}
type TestOptions = {
name: string;
callback: (res: string) => void;
};
export class Test {
id: number;
name: string;
static type: string = "Test";
constructor(id: number, options: TestOptions) {
this.id = id;
this.name = options.name;
options.callback("Test.constructor");
}
static testClassStaticSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
static async testClassStaticAsync(opts: AsyncOptions): Promise<UtsJSONObject> {
const res = await testAsync(opts);
return res;
}
testClassSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
async testClassAsync(opts: AsyncOptions): Promise<UtsJSONObject> {
const res = await testAsync(opts);
return res;
}
}
export function log(msg: string) {
console.log(msg);
}
{
"id": "uts-advance",
"displayName": "uts-advance",
"version": "1.0.0",
"description": "uts-advance",
"keywords": [
"uts-advance"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "native-uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
},
"type": "uts",
"uts": {
"android": {
"libs": [],
"dependencies": []
},
"ios": {
"libs": []
}
}
}
}
\ No newline at end of file
# uts-advance
\ No newline at end of file
......@@ -31,7 +31,7 @@ type JsonParamOptions = {
export function callWithoutParam(opts: NoParamOptions) {
setTimeout(function() {
opts.success();
}, 1000);
}, 500);
return { name: "doSthWithCallback" };
}
......@@ -39,7 +39,7 @@ export function callWithoutParam(opts: NoParamOptions) {
export function callWithStringParam(opts: StringParamOptions) {
setTimeout(function() {
opts.success(opts.input);
}, 1000);
}, 500);
return { name: "doSthWithCallback" };
}
......@@ -49,7 +49,7 @@ export function callWithJSONParam(opts: JsonParamOptions) {
opts.input.errCode = 10;
setTimeout(function() {
opts.success(opts.input);
}, 1000);
}, 500);
return { name: "doSthWithCallback" };
}
......
import Context from "android.content.Context";
import BatteryManager from "android.os.BatteryManager";
import { getAppContext } from "io.dcloud.uts.android";
export function getBatteryCapacity(): string {
const context = getAppContext();
if (context != null) {
const manager = context.getSystemService(
Context.BATTERY_SERVICE
) as BatteryManager;
const currentLevel: number = manager.getIntProperty(
BatteryManager.BATTERY_PROPERTY_CAPACITY
);
return '' + currentLevel + '%';
}
return "0%";
}
{
"id": "uts-osapi",
"displayName": "uts-osapi",
"version": "1.0.0",
"description": "uts-osapi",
"keywords": [
"uts-osapi"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "native-uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
},
"type": "uts",
"uts": {
"android": {
"libs": [],
"dependencies": []
},
"ios": {
"libs": []
}
}
}
}
\ No newline at end of file
# uts-osapi
\ No newline at end of file
var _style_0 = {};
exports.styles = [_style_0];
Promise.resolve("./app.css.js").then(() => {
});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,(function(){function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}function t(e){return!(!e||void 0===e.length)}function n(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],a(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}i(t.promise,r)}else(1===e._state?i:u)(t.promise,e._value)}))):e._deferreds.push(t)}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void a(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;n>t;t++)o(e,e._deferreds[t]);e._deferreds=null}function a(e,t){var n=!1;try{e((function(e){n||(n=!0,i(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}var s=setTimeout;r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,r)),r},r.prototype.finally=e,r.all=function(e){return new r((function(n,r){function o(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var c=t.then;if("function"==typeof c)return void c.call(t,(function(t){o(e,t)}),r)}i[e]=t,0==--u&&n(i)}catch(e){r(e)}}if(!t(e))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);for(var u=i.length,c=0;i.length>c;c++)o(c,i[c])}))},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(n,o){if(!t(e))return o(new TypeError("Promise.race accepts an array"));for(var i=0,u=e.length;u>i;i++)r.resolve(e[i]).then(n,o)}))},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){s(e,0)},r._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();"Promise"in l?l.Promise.prototype.finally||(l.Promise.prototype.finally=e):l.Promise=r}));var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function r(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(n)}for(var o=[],i=0;i<256;++i)o[i]=(i+256).toString(16).substr(1);function u(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var u=(e=e||{}).random||(e.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var c=0;c<16;++c)t[i+c]=u[c];return t||function(e,t){var n=t||0,r=o;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(u)}var c=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},l=/-(\w)/g,f=s((function(e){return e.replace(l,(function(e,t){return t?t.toUpperCase():""}))})),d=s((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;function m(e,t){if(a(e))return e;if(t&&(n=t,r=e,c.call(n,r)))return[e];var n,r,o=[];return e.replace(p,(function(e,t,n,r){return o.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),o}function v(e,t){var n,r=m(t,e);for(n=r.shift();null!=n;){if(null==(e=e[n]))return;n=r.shift()}return e}var h=new Map;function g(e){if(!function(e){if(e){var t=e.tagName;return 0===t.indexOf("UNI-")||"BODY"===t}return!1}(e))throw Error("no such element");var t,n,r={elementId:(t=e,n=t._id,n||(n=u(),t._id=n,h.set(n,{id:n,element:t})),n),tagName:e.tagName.toLocaleLowerCase().replace("uni-","")},o=e.__vue__;return o&&(o.$parent&&o.$parent.$el===e&&(o=o.$parent),o&&!o.$options.isReserved&&(r.nodeId=function(e){if(e._$weex)return e._uid;if(e._$id)return e._$id;var t=function(e){for(var t=e.$parent;t;){if(t._$id)return t;t=t.$parent}}(e);if(!e.$parent)return"-1";var n=e.$vnode,r=n.context;return r&&r!==t&&r._$id?r._$id+";"+t._$id+","+n.data.attrs._i:t._$id+","+n.data.attrs._i}(o))),"video"===r.tagName&&(r.videoId=r.nodeId),r}var _={input:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},textarea:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},"scroll-view":{scrollTo:function(e,t,n){var r=e.__vue__.$refs.main;r.scrollLeft=t,r.scrollTop=n},scrollTop:function(e){return e.__vue__.$refs.main.scrollTop},scrollLeft:function(e){return e.__vue__.$refs.main.scrollLeft},scrollWidth:function(e){return e.__vue__.$refs.main.scrollWidth},scrollHeight:function(e){return e.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(e,t){e.__vue__.current=t}},"movable-view":{moveTo:function(e,t,n){e.__vue__._animationTo(t,n)}},switch:{tap:function(e){e.click()}},slider:{slideTo:function(e,t){var n=e.__vue__,r=n.$refs["uni-slider"],o=r.offsetWidth,i=r.getBoundingClientRect().left;n.value=t,n._onClick({x:(t-n.min)*o/(n.max-n.min)+i})}}},y={getWindow:function(e){return window},getDocument:function(e){return document},getEl:function(e){var t=h.get(e);if(!t)throw Error("element destroyed");return t.element},getOffset:function(e){var t=e.getBoundingClientRect();return Promise.resolve({left:t.left+window.pageXOffset,top:t.top+window.pageYOffset})},querySelector:function(e,t){return"page"===t&&(t="body"),Promise.resolve(g(e.querySelector(t)))},querySelectorAll:function(e,t){var n=[],r=document.querySelectorAll(t);return[].forEach.call(r,(function(e){try{n.push(g(e))}catch(e){}})),Promise.resolve({elements:n})},queryProperties:function(e,t){return Promise.resolve({properties:t.map((function(t){var n=v(e,t);return"document.documentElement.scrollTop"===t&&0===n&&(n=v(e,"document.body.scrollTop")),n}))})},queryAttributes:function(e,t){return Promise.resolve({attributes:t.map((function(t){return String(e.getAttribute(t))}))})},queryStyles:function(e,t){var n=getComputedStyle(e);return Promise.resolve({styles:t.map((function(e){return n[e]}))})},queryHTML:function(e,t){return Promise.resolve({html:(n="outer"===t?e.outerHTML:e.innerHTML,n.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(e){return-1<e.indexOf("<body")?"<page>":"</body>"===e?"</page>":0!==e.indexOf("<uni-")&&0!==e.indexOf("</uni-")?"":e.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});var n},dispatchTapEvent:function(e){return e.click(),Promise.resolve()},dispatchLongpressEvent:function(e){return Promise.resolve()},dispatchTouchEvent:function(e,t,n){n||(n={}),n.touches||(n.touches=[]),n.changedTouches||(n.changedTouches=[]),n.touches.length||n.touches.push({identifier:Date.now(),target:e});var r=w(n.touches),o=w(n.changedTouches),i=w([]);return e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,touches:r,targetTouches:i,changedTouches:o})),Promise.resolve()},callFunction:function(t,n,r){var o=v(_,n);return o?Promise.resolve({result:o.apply(null,e([t],r))}):Promise.reject(Error(n+" not exists"))},triggerEvent:function(e,t,n){var r=e.__vue__;return r.$trigger&&r.$trigger(t,{},n),Promise.resolve()}};function w(e){var t,n=e.map((function(e){return function(e){if(document.createTouch)return document.createTouch(window,e.target,e.identifier,e.pageX,e.pageY,e.screenX,e.screenY);return new Touch(e)}(e)}));return document.createTouchList?(t=document).createTouchList.apply(t,n):n}["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){return d(f(e))}));var E=Object.assign({},function(e){return{"Page.getElement":function(t){return e.querySelector(e.getDocument(t.pageId),t.selector)},"Page.getElements":function(t){return e.querySelectorAll(e.getDocument(t.pageId),t.selector)},"Page.getWindowProperties":function(t){return e.queryProperties(e.getWindow(t.pageId),t.names)}}}(y),function(e){var t=function(t){return e.getEl(t.elementId,t.pageId)};return{"Element.getElement":function(n){return e.querySelector(t(n),n.selector)},"Element.getElements":function(n){return e.querySelectorAll(t(n),n.selector)},"Element.getDOMProperties":function(n){return e.queryProperties(t(n),n.names)},"Element.getProperties":function(n){var r=t(n),o=r.__vue__||r.attr||{};return e.queryProperties(o,n.names)},"Element.getOffset":function(n){return e.getOffset(t(n))},"Element.getAttributes":function(n){return e.queryAttributes(t(n),n.names)},"Element.getStyles":function(n){return e.queryStyles(t(n),n.names)},"Element.getHTML":function(n){return e.queryHTML(t(n),n.type)},"Element.tap":function(n){return e.dispatchTapEvent(t(n))},"Element.longpress":function(n){return e.dispatchLongpressEvent(t(n))},"Element.touchstart":function(n){return e.dispatchTouchEvent(t(n),"touchstart",n)},"Element.touchmove":function(n){return e.dispatchTouchEvent(t(n),"touchmove",n)},"Element.touchend":function(n){return e.dispatchTouchEvent(t(n),"touchend",n)},"Element.callFunction":function(n){return e.callFunction(t(n),n.functionName,n.args)},"Element.triggerEvent":function(n){return e.triggerEvent(t(n),n.type,n.detail)}}}(y));function b(e){return UniViewJSBridge.publishHandler("onAutoMessageReceive",e)}UniViewJSBridge.subscribe("sendAutoMessage",(function(e){var t=e.id,n=e.method,r=e.params,o={id:t},i=E[n];if(!i)return o.error={message:n+" unimplemented"},b(o);try{i(r).then((function(e){e&&(o.result=e)})).catch((function(e){o.error={message:e.message}})).finally((function(){b(o)}))}catch(e){o.error={message:e.message},b(o)}}));
此差异已折叠。
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var v=Object.create;var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var I=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Q(t))!w.call(e,n)&&n!==a&&m(e,n,{get:()=>t[n],enumerable:!(o=P(t,n))||o.enumerable});return e};var O=(e,t,a)=>(a=e!=null?v(b(e)):{},I(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e));var B=E((L,C)=>{C.exports=Vue});var d={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let t={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},a=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),o=a[1];o&&(a[1]=t[o]||o),a.length=a.length>2?2:a.length,this.locale=a.join("-")},localize(e){let t=this.locale,a=t.split("-")[0],o=this.fallbackLocale,n=s=>Object.assign({},this.localization[s],(this.localizationTemplate||{})[s]);return n("messages")[e]||n(t)[e]||n(a)[e]||n(o)[e]||e}}},h={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:t,runtime:a,data:o={},useGlobalEvent:n}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=a,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=n,this.data=JSON.parse(JSON.stringify(o)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let s=this,r=function(l){let A=l.data&&l.data.__message;!A||s.__onMessageCallback&&s.__onMessageCallback(A.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",r);else{let l=new BroadcastChannel(this.__page);l.onmessage=r}},postMessage(e={},t=!1){let a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:t}})),o=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(a,o):new BroadcastChannel(o).postMessage(a);else{let n=plus.webview.getWebviewById(o);n&&n.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:a})})`)}},onMessage(e){this.__onMessageCallback=e}}};var i=O(B());var f=(e,t)=>{let a=e.__vccOpts||e;for(let[o,n]of t)a[o]=n;return a};var x={page:{"":{flex:1}},"flex-r":{"":{flexDirection:"row",flexWrap:"nowrap"}},"flex-c":{"":{flexDirection:"column",flexWrap:"nowrap"}},"flex-fill":{"":{flex:1}},"a-i-c":{"":{alignItems:"center"}},"j-c-c":{"":{justifyContent:"center"}},target:{"":{paddingTop:10,paddingBottom:10}},"text-area":{"":{paddingLeft:10,paddingRight:10,flex:1}},name:{"":{fontSize:16,lines:1,textOverflow:"ellipsis"}},address:{"":{fontSize:14,color:"#808080",lines:1,textOverflow:"ellipsis",marginTop:2}},"goto-area":{"":{width:50,height:50,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,backgroundColor:"#007aff",borderRadius:50,marginRight:10}},"goto-icon":{"":{width:34,height:34}},"goto-text":{"":{fontSize:14,color:"#FFFFFF"}}},z={mixins:[h,d],data(){return{longitude:"",latitude:"",markers:[],name:"",address:"",localizationTemplate:{en:{"map.title.amap":"AutoNavi Maps","map.title.baidu":"Baidu Maps","map.title.tencent":"Tencent Maps","map.title.apple":"Apple Maps","map.title.google":"Google Maps","location.title":"My Location","select.cancel":"Cancel"},zh:{"map.title.amap":"\u9AD8\u5FB7\u5730\u56FE","map.title.baidu":"\u767E\u5EA6\u5730\u56FE","map.title.tencent":"\u817E\u8BAF\u5730\u56FE","map.title.apple":"\u82F9\u679C\u5730\u56FE","map.title.google":"\u8C37\u6B4C\u5730\u56FE","location.title":"\u6211\u7684\u4F4D\u7F6E","select.cancel":"\u53D6\u6D88"}}}},onLoad(){let e=this.data;this.latitude=e.latitude,this.longitude=e.longitude,this.name=e.name||"",this.address=e.address||""},onReady(){this.mapContext=this.$refs.map1,this.markers=[{id:"location",latitude:this.latitude,longitude:this.longitude,title:this.name,zIndex:"1",iconPath:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAABICAMAAACORiZjAAAByFBMVEUAAAD/PyL/PyL/PyL/PyL/PyL/PyL/PyL/PyL/PiL/PyL/PyL/PyP/PyL/PyL/PyL/PyL/PiL/PyL8PiP/PyL4OyP/PyL3OyX9Pyb0RUP0RkPzOiXsPj3YLi7TKSnQJiX0RkTgMCj0QjvkNC3vPDPwOy/9PyXsNSTyRUTgNDPdMjHrPTzuQD7iNTTxQ0HTJyTZKyf1RULlNjDZKyTfLSLeLSX0Qzz3Qzv8PSTMJCTmOjnPJSXLIiLzRkXWLCvgNDPZLyzVKijRJSTtPzvcMS7jNjPZLCnyREHpOzjiNDDtPzvzQz/VKSXkNTDsPDXyQjz2RT7pMyTxOinjMST5QjTmOjnPJSLdLyr0RD//YF7/////R0b/Tk3/XVv/WFb/VVP/S0v/Pz//W1n/UVD/REP/Xlz/Ojr/QUH/Skn/U1L/ODf7VlX5UU/oOzrqNzf/+/v5UlHvQUD2TEv0SUj3Tk3/2dn8W1r6TEv7R0b7REPvPTzzPDvwNjXkMjLnMDDjLS3dKir/xcX/vr7/qqn/pqX/mZn/fn7/ZWT/8PD/4eH/3t3/zs7/ra3/kpL/iIj/e3r5PDz4NjbxMTHsMTDlLCz/9vb/6ej/ubjhOGVRAAAAWXRSTlMABQ4TFgoIHhApI0RAGhgzJi89Ozg2LVEg4s5c/v366tmZiYl2X0pE/vn08eTe1sWvqqiOgXVlUE399/b08u3n4tzZ1dTKyMTDvLmzqqKal35taFxH6sC3oms+ongAAAOtSURBVEjHjZV3W9pQGMXJzQACQRARxVF3HdVW26od7q111NqhdbRSbQVElnvvbV1tv25Jgpr3kpCcP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eqVUEy9rkmU31imBZ1x7PNV6RelkeD16Relmfbm81VQTLevs2A74iDWXpXzznwwEj9YCszcbCcOqiSY4jYTh1Jx1B04o+/wH6/wOSPFj1xgAAAABJRU5ErkJggg==",width:26,height:36}],this.updateMarker()},methods:{goto(){var e=weex.config.env.platform==="iOS";this.openSysMap(this.latitude,this.longitude,this.name,e)},updateMarker(){this.mapContext.moveToLocation(),this.mapContext.translateMarker({markerId:"location",destination:{latitude:this.latitude,longitude:this.longitude},duration:0},e=>{})},openSysMap(e,t,a,o){let n=weex.requireModule("mapSearch");var s=[{title:this.localize("map.title.tencent"),getUrl:function(){var A;return A="https://apis.map.qq.com/uri/v1/routeplan?type=drive&to="+encodeURIComponent(a)+"&tocoord="+encodeURIComponent(e+","+t)+"&referer=APP",A}},{title:this.localize("map.title.google"),getUrl:function(){var A;return A="https://www.google.com/maps/?daddr="+encodeURIComponent(a)+"&sll="+encodeURIComponent(e+","+t),A}}],r=[{title:this.localize("map.title.amap"),pname:"com.autonavi.minimap",action:o?"iosamap://":"amapuri://",getUrl:function(){var A;return o?A="iosamap://path":A="amapuri://route/plan/",A+="?sourceApplication=APP&dname="+encodeURIComponent(a)+"&dlat="+e+"&dlon="+t+"&dev=0",A}},{title:this.localize("map.title.baidu"),pname:"com.baidu.BaiduMap",action:"baidumap://",getUrl:function(){var A="baidumap://map/direction?destination="+encodeURIComponent("latlng:"+e+","+t+"|name:"+a)+"&mode=driving&src=APP&coord_type=gcj02";return A}},{title:this.localize("map.title.tencent"),pname:"com.tencent.map",action:"qqmap://",getUrl:()=>{var A;return A="qqmap://map/routeplan?type=drive"+(o?"&from="+encodeURIComponent(this.localize("location.title")):"")+"&to="+encodeURIComponent(a)+"&tocoord="+encodeURIComponent(e+","+t)+"&referer=APP",A}},{title:this.localize("map.title.google"),pname:"com.google.android.apps.maps",action:"comgooglemapsurl://",getUrl:function(){var A;return o?A="comgooglemapsurl://maps.google.com/":A="https://www.google.com/maps/",A+="?daddr="+encodeURIComponent(a)+"&sll="+encodeURIComponent(e+","+t),A}}],l=[];r.forEach(function(A){var g=plus.runtime.isApplicationExist({pname:A.pname,action:A.action});g&&l.push(A)}),o&&l.unshift({title:this.localize("map.title.apple"),navigateTo:function(){n.openSystemMapNavigation({longitude:t,latitude:e,name:a})}}),l.length===0&&(l=l.concat(s)),plus.nativeUI.actionSheet({cancel:this.localize("select.cancel"),buttons:l},function(A){var g=A.index,c;g>0&&(c=l[g-1],c.navigateTo?c.navigateTo():plus.runtime.openURL(c.getUrl(),function(){},c.pname))})}}};function R(e,t,a,o,n,s){return(0,i.openBlock)(),(0,i.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,i.createElementVNode)("view",{class:"page flex-c"},[(0,i.createElementVNode)("map",{class:"flex-fill map",ref:"map1",longitude:n.longitude,latitude:n.latitude,markers:n.markers},null,8,["longitude","latitude","markers"]),(0,i.createElementVNode)("view",{class:"flex-r a-i-c target"},[(0,i.createElementVNode)("view",{class:"text-area"},[(0,i.createElementVNode)("u-text",{class:"name"},(0,i.toDisplayString)(n.name),1),(0,i.createElementVNode)("u-text",{class:"address"},(0,i.toDisplayString)(n.address),1)]),(0,i.createElementVNode)("view",{class:"goto-area",onClick:t[0]||(t[0]=(...r)=>s.goto&&s.goto(...r))},[(0,i.createElementVNode)("u-image",{class:"goto-icon",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIEAYAAAD9yHLdAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAADzVJREFUeNrt3WmMFMUfxvGqRREjEhXxIAooUQTFGPGIeLAcshoxRhM1Eu+YjZGIJh4vTIzHC1GJiiCeiUckEkWDVzxQxHgRvNB4LYiigshyxFXYg4B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oAgIEOfDjj6q33BK6E6BICBDkwOTJWnm0tITuBCgSAgQZ9uKLCo633grdCVBEBAgyqLVV13fccEPoToAiI0CQLc4442bO1BXlv/0Wuh2gyAgQZIP/hkBjjDFTp4ZuBwABgkx5+GGtPPwXPwEIiQBBBmzZojp9euhOAPyLAEHcnHHGzZ2rlcfKlaHbAfAvAgRxs8YaO3Nm6DYAbIsAQcRWrFD94IPQnQDYFgGCiM2erQsFnQvdCYBtESCIkzPOuDlzQrcBYPsIEMTFGWfcunV67YPvLAdiRoAgLtZYY+fN06kr//0eAGJEgCBC8+eH7gDAzhEgiNCiRaE7ALBzBAgi0tam10CWLAndCYCdI0AQB2eccd9+qyvO/UeXAIgZAYI4WGON9V9NCyALCBBExF95DiALCBDEwRlnHAECZAkBgjhYY41dvz50GwBKR4AgIi0toTsAUDoCBHFwxhnX2hq6DQClI0BQgk2bKn4X1lhj//479JYCKB0BghL8+mtl/77/uPZffgm9pQCAMnPOOec+/9yVW7trd+2ffRZ6+wAAFaID/dlnlz1AnHPOnXVW6O0DAFSYDvhTppRn5XHXXaG3BwBQZUqBK65QbWwsLTVWr1a9/PLQ/QPoPhu6AWSbAqFXL43GjFEdMiT5Ww0NqgsW6Iui2tpC9w0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyK7/ATO6t9N2I5PTAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTAzLTAxVDExOjQ1OjU1KzA4OjAw5vcxUwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wMy0wMVQxMTo0NTo1NSswODowMJeqie8AAABSdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uX2lnaGV6d2JubWhiL25hdmlnYXRpb25fbGluZS5zdmc29Ka/AAAAAElFTkSuQmCC"})])])])])}var p=f(z,[["render",R],["styles",[x]]]);var u=plus.webview.currentWebview();if(u){let e=parseInt(u.id),t="template/__uniappopenlocation",a={};try{a=JSON.parse(u.__query__)}catch(n){}p.mpType="page";let o=Vue.createPageApp(p,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:a});o.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...p.styles||[]])),o.mount("#root")}})();
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var T=Object.create;var y=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of M(t))!D.call(e,s)&&s!==a&&y(e,s,{get:()=>t[s],enumerable:!(r=x(t,s))||r.enumerable});return e};var V=(e,t,a)=>(a=e!=null?T(C(e)):{},L(t||!e||!e.__esModule?y(a,"default",{value:e,enumerable:!0}):a,e));var A=I((J,v)=>{v.exports=Vue});var _={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let t={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},a=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),r=a[1];r&&(a[1]=t[r]||r),a.length=a.length>2?2:a.length,this.locale=a.join("-")},localize(e){let t=this.locale,a=t.split("-")[0],r=this.fallbackLocale,s=n=>Object.assign({},this.localization[n],(this.localizationTemplate||{})[n]);return s("messages")[e]||s(t)[e]||s(a)[e]||s(r)[e]||e}}},b={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:t,runtime:a,data:r={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=a,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(r)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let n=this,c=function(o){let u=o.data&&o.data.__message;!u||n.__onMessageCallback&&n.__onMessageCallback(u.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",c);else{let o=new BroadcastChannel(this.__page);o.onmessage=c}},postMessage(e={},t=!1){let a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:t}})),r=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(a,r):new BroadcastChannel(r).postMessage(a);else{let s=plus.webview.getWebviewById(r);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:a})})`)}},onMessage(e){this.__onMessageCallback=e}}};var i=V(A());var d=(e,t)=>{let a=e.__vccOpts||e;for(let[r,s]of t)a[r]=s;return a};var f=e=>e>9?e:"0"+e;function E({date:e=new Date,mode:t="date"}){return t==="time"?f(e.getHours())+":"+f(e.getMinutes()):e.getFullYear()+"-"+f(e.getMonth()+1)+"-"+f(e.getDate())}var O={data(){return{safeAreaInsets:{left:0,right:0,top:0,bottom:0}}},onLoad(){this.initSafeAreaInsets()},created(){this.initSafeAreaInsets()},methods:{initSafeAreaInsets(){if(this.__initSafeAreaInsets)return;this.__initSafeAreaInsets=!0;let e=plus.webview.currentWebview();e.addEventListener("resize",()=>{setTimeout(()=>{this.updateSafeAreaInsets(e)},20)}),this.updateSafeAreaInsets(e)},updateSafeAreaInsets(e){let t=e.getSafeAreaInsets(),a=this.safeAreaInsets;Object.keys(a).forEach(r=>{a[r]=t[r]})}}},N={content:{"":{position:"absolute",top:0,left:0,bottom:0,right:0}},"uni-mask":{"":{position:"absolute",top:0,left:0,bottom:0,right:0,backgroundColor:"rgba(0,0,0,0.4)",opacity:0,transitionProperty:"opacity",transitionDuration:200,transitionTimingFunction:"linear"}},"uni-mask-android":{"":{backgroundColor:"rgba(0,0,0,0.6)"}},"uni-mask-visible":{"":{opacity:1}},"uni-picker":{"":{position:"absolute",left:0,bottom:0,right:0,backgroundColor:"#ffffff",color:"#000000",flexDirection:"column",transform:"translateY(295px)"}},"uni-picker-header":{"":{height:45,borderBottomWidth:0,backgroundColor:"#E6E6E6",fontSize:20}},"uni-picker-action":{"":{position:"absolute",textAlign:"center",top:0,height:45,paddingTop:0,paddingRight:14,paddingBottom:0,paddingLeft:14,fontSize:17,lineHeight:45}},"uni-picker-action-cancel":{"":{left:0,color:"#888888"}},"uni-picker-action-confirm":{"":{right:0,color:"#007aff"}},"uni-picker-content":{"":{flex:1}},"uni-picker-item":{"":{lineHeight:34,textAlign:"center",color:"#000000"}},"@TRANSITION":{"uni-mask":{property:"opacity",duration:200,timingFunction:"linear"}}};function k(){if(this.mode===l.TIME)return"00:00";if(this.mode===l.DATE){let e=new Date().getFullYear()-61;switch(this.fields){case h.YEAR:return e;case h.MONTH:return e+"-01";default:return e+"-01-01"}}return""}function w(){if(this.mode===l.TIME)return"23:59";if(this.mode===l.DATE){let e=new Date().getFullYear()+61;switch(this.fields){case h.YEAR:return e;case h.MONTH:return e+"-12";default:return e+"-12-31"}}return""}var S=weex.requireModule("animation"),l={SELECTOR:"selector",MULTISELECTOR:"multiSelector",TIME:"time",DATE:"date",REGION:"region"},h={YEAR:"year",MONTH:"month",DAY:"day"},z={name:"Picker",mixins:[_,O],props:{pageId:{type:Number,default:0},range:{type:Array,default(){return[]}},rangeKey:{type:String,default:""},value:{type:[Number,String,Array],default:0},mode:{type:String,default:l.SELECTOR},fields:{type:String,default:h.DAY},start:{type:String,default:k},end:{type:String,default:w},disabled:{type:[Boolean,String],default:!1},visible:{type:Boolean,default:!1}},data(){return{valueSync:null,timeArray:[],dateArray:[],valueArray:[],oldValueArray:[],fontSize:16,height:261,android:weex.config.env.platform.toLowerCase()==="android"}},computed:{rangeArray(){var e=this.range;switch(this.mode){case l.SELECTOR:return[e];case l.MULTISELECTOR:return e;case l.TIME:return this.timeArray;case l.DATE:{let t=this.dateArray;switch(this.fields){case h.YEAR:return[t[0]];case h.MONTH:return[t[0],t[1]];default:return[t[0],t[1],t[2]]}}}return[]},startArray(){return this._getDateValueArray(this.start,k.bind(this)())},endArray(){return this._getDateValueArray(this.end,w.bind(this)())},textMaxLength(){return Math.floor(Math.min(weex.config.env.deviceWidth,weex.config.env.deviceHeight)/(this.fontSize*weex.config.env.scale+1)/this.rangeArray.length)}},watch:{value(){this._setValueSync()},mode(){this._setValueSync()},range(){this._setValueSync()},valueSync(){this._setValueArray()},valueArray(e){if(this.mode===l.TIME||this.mode===l.DATE){let t=this.mode===l.TIME?this._getTimeValue:this._getDateValue,a=this.valueArray,r=this.startArray,s=this.endArray;if(this.mode===l.DATE){let n=this.dateArray,c=n[2].length,o=Number(n[2][a[2]])||1,u=new Date(`${n[0][a[0]]}/${n[1][a[1]]}/${o}`).getDate();u<o&&(a[2]-=u+c-o)}t(a)<t(r)?this._cloneArray(a,r):t(a)>t(s)&&this._cloneArray(a,s)}e.forEach((t,a)=>{t!==this.oldValueArray[a]&&(this.oldValueArray[a]=t,this.mode===l.MULTISELECTOR&&this.$emit("columnchange",{column:a,value:t}))})},visible(e){e?setTimeout(()=>{S.transition(this.$refs.picker,{styles:{transform:"translateY(0)"},duration:200})},20):S.transition(this.$refs.picker,{styles:{transform:`translateY(${283+this.safeAreaInsets.bottom}px)`},duration:200})}},created(){this._createTime(),this._createDate(),this._setValueSync()},methods:{getTexts(e,t){let a=this.textMaxLength;return e.map(r=>{let s=String(typeof r=="object"?r[this.rangeKey]||"":this._l10nItem(r,t));if(a>0&&s.length>a){let n=0,c=0;for(let o=0;o<s.length;o++){let u=s.charCodeAt(o);if(u>127||u===94?n+=1:n+=.65,n<=a-1&&(c=o),n>=a)return o===s.length-1?s:s.substr(0,c+1)+"\u2026"}}return s||" "}).join(`
`)},_createTime(){var e=[],t=[];e.splice(0,e.length);for(let a=0;a<24;a++)e.push((a<10?"0":"")+a);t.splice(0,t.length);for(let a=0;a<60;a++)t.push((a<10?"0":"")+a);this.timeArray.push(e,t)},_createDate(){var e=[],t=new Date().getFullYear();for(let s=t-61,n=t+61;s<=n;s++)e.push(String(s));var a=[];for(let s=1;s<=12;s++)a.push((s<10?"0":"")+s);var r=[];for(let s=1;s<=31;s++)r.push((s<10?"0":"")+s);this.dateArray.push(e,a,r)},_getTimeValue(e){return e[0]*60+e[1]},_getDateValue(e){return e[0]*31*12+(e[1]||0)*31+(e[2]||0)},_cloneArray(e,t){for(let a=0;a<e.length&&a<t.length;a++)e[a]=t[a]},_setValueSync(){let e=this.value;switch(this.mode){case l.MULTISELECTOR:Array.isArray(e)||(e=[]),Array.isArray(this.valueSync)||(this.valueSync=[]);let t=this.valueSync.length=Math.max(e.length,this.range.length);for(let a=0;a<t;a++){let r=Number(e[a]),s=Number(this.valueSync[a]),n=isNaN(r)?isNaN(s)?0:s:r,c=this.range[a]?this.range[a].length-1:0;this.valueSync.splice(a,1,n<0||n>c?0:n)}break;case l.TIME:case l.DATE:this.valueSync=String(e);break;default:{let a=Number(e);this.valueSync=a<0?0:a;break}}},_setValueArray(){var e=this.valueSync,t;switch(this.mode){case l.MULTISELECTOR:t=[...e];break;case l.TIME:t=this._getDateValueArray(e,E({mode:l.TIME}));break;case l.DATE:t=this._getDateValueArray(e,E({mode:l.DATE}));break;default:t=[e];break}this.oldValueArray=[...t],this.valueArray=[...t]},_getValue(){var e=this.valueArray;switch(this.mode){case l.SELECTOR:return e[0];case l.MULTISELECTOR:return e.map(t=>t);case l.TIME:return this.valueArray.map((t,a)=>this.timeArray[a][t]).join(":");case l.DATE:return this.valueArray.map((t,a)=>this.dateArray[a][t]).join("-")}},_getDateValueArray(e,t){let a=this.mode===l.DATE?"-":":",r=this.mode===l.DATE?this.dateArray:this.timeArray,s=3;switch(this.fields){case h.YEAR:s=1;break;case h.MONTH:s=2;break}let n=String(e).split(a),c=[];for(let o=0;o<s;o++){let u=n[o];c.push(r[o].indexOf(u))}return c.indexOf(-1)>=0&&(c=t?this._getDateValueArray(t):c.map(()=>0)),c},_change(){this.$emit("change",{value:this._getValue()})},_cancel(){this.$emit("cancel")},_pickerViewChange(e){this.valueArray=this._l10nColumn(e.detail.value,!0)},_l10nColumn(e,t){if(this.mode===l.DATE){let a=this.locale;if(!a.startsWith("zh"))switch(this.fields){case h.YEAR:return e;case h.MONTH:return[e[1],e[0]];default:switch(a){case"es":case"fr":return[e[2],e[1],e[0]];default:return t?[e[2],e[0],e[1]]:[e[1],e[2],e[0]]}}}return e},_l10nItem(e,t){if(this.mode===l.DATE){let a=this.locale;if(a.startsWith("zh"))return e+["\u5E74","\u6708","\u65E5"][t];if(this.fields!==h.YEAR&&t===(this.fields!==h.MONTH&&(a==="es"||a==="fr")?1:0)){let r;switch(a){case"es":r=["enero","febrero","marzo","abril","mayo","junio","\u200B\u200Bjulio","agosto","septiembre","octubre","noviembre","diciembre"];break;case"fr":r=["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"];break;default:r=["January","February","March","April","May","June","July","August","September","October","November","December"];break}return r[Number(e)-1]}}return e}}};function R(e,t,a,r,s,n){let c=(0,i.resolveComponent)("picker-view-column"),o=(0,i.resolveComponent)("picker-view");return(0,i.openBlock)(),(0,i.createElementBlock)("div",{class:"content"},[(0,i.createElementVNode)("div",{ref:"mask",class:"uni-mask",style:(0,i.normalizeStyle)({opacity:a.visible?1:0,"background-color":s.android?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.4)"}),onClick:t[0]||(t[0]=(...u)=>n._cancel&&n._cancel(...u))},null,4),(0,i.createElementVNode)("div",{style:(0,i.normalizeStyle)(`padding-bottom:${e.safeAreaInsets.bottom}px;height:${s.height+e.safeAreaInsets.bottom}px;`),ref:"picker",class:"uni-picker"},[(0,i.createElementVNode)("div",{class:"uni-picker-header"},[(0,i.createElementVNode)("u-text",{style:(0,i.normalizeStyle)(`left:${e.safeAreaInsets.left}px`),class:"uni-picker-action uni-picker-action-cancel",onClick:t[1]||(t[1]=(...u)=>n._cancel&&n._cancel(...u))},(0,i.toDisplayString)(e.localize("cancel")),5),(0,i.createElementVNode)("u-text",{style:(0,i.normalizeStyle)(`right:${e.safeAreaInsets.right}px`),class:"uni-picker-action uni-picker-action-confirm",onClick:t[2]||(t[2]=(...u)=>n._change&&n._change(...u))},(0,i.toDisplayString)(e.localize("done")),5)]),a.visible?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,style:(0,i.normalizeStyle)(`margin-left:${e.safeAreaInsets.left}px`),height:"216","indicator-style":"height: 34px;border-color:#C8C9C9;border-top-width:0.5px;border-bottom-width:0.5px;",value:n._l10nColumn(s.valueArray),class:"uni-picker-content",onChange:n._pickerViewChange},{default:(0,i.withCtx)(()=>[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(n._l10nColumn(n.rangeArray),(u,p)=>((0,i.openBlock)(),(0,i.createBlock)(c,{length:u.length,key:p},{default:(0,i.withCtx)(()=>[(0,i.createCommentVNode)(" iOS\u6E32\u67D3\u901F\u5EA6\u6709\u95EE\u9898\u4F7F\u7528\u5355\u4E2Atext\u4F18\u5316 "),(0,i.createElementVNode)("u-text",{class:"uni-picker-item",style:(0,i.normalizeStyle)({fontSize:s.fontSize+"px","line-height":"34px","text-align":"center",color:"#000"})},(0,i.toDisplayString)(n.getTexts(u,p)),5),(0,i.createCommentVNode)(` <text v-for="(item,index) in range" :key="index" class="uni-picker-item uni-picker-item-line" :style="{fontSize: fontSize + 'px'}">{{ typeof item==='object'?item[rangeKey]||'':_l10nItem(item) }}</text> `)]),_:2},1032,["length"]))),128))]),_:1},8,["style","value","onChange"])):(0,i.createCommentVNode)("v-if",!0)],4)])}var Y=d(z,[["render",R],["styles",[N]]]),B={page:{"":{flex:1}}},j={mixins:[b],components:{picker:Y},data(){return{range:[],rangeKey:"",value:0,mode:"selector",fields:"day",start:"",end:"",disabled:!1,visible:!1}},onLoad(){this.data===null?this.postMessage({event:"created"},!0):this.showPicker(this.data),this.onMessage(e=>{this.showPicker(e)})},onReady(){this.$nextTick(()=>{this.visible=!0})},methods:{showPicker(e={}){let t=e.column;for(let a in e)a!=="column"&&(typeof t=="number"?this.$set(this.$data[a],t,e[a]):this.$data[a]=e[a])},close(e,{value:t=-1}={}){this.visible=!1,setTimeout(()=>{this.postMessage({event:e,value:t})},210)},onClose(){this.close("cancel")},columnchange({column:e,value:t}){this.$set(this.value,e,t),this.postMessage({event:"columnchange",column:e,value:t},!0)}}};function F(e,t,a,r,s,n){let c=(0,i.resolveComponent)("picker");return(0,i.openBlock)(),(0,i.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,i.createElementVNode)("view",{class:"page"},[(0,i.createVNode)(c,{range:s.range,rangeKey:s.rangeKey,value:s.value,mode:s.mode,fields:s.fields,start:s.start,end:s.end,disabled:s.disabled,visible:s.visible,onChange:t[0]||(t[0]=o=>n.close("change",o)),onCancel:t[1]||(t[1]=o=>n.close("cancel",o)),onColumnchange:n.columnchange},null,8,["range","rangeKey","value","mode","fields","start","end","disabled","visible","onColumnchange"])])])}var g=d(j,[["render",F],["styles",[B]]]);var m=plus.webview.currentWebview();if(m){let e=parseInt(m.id),t="template/__uniapppicker",a={};try{a=JSON.parse(m.__query__)}catch(s){}g.mpType="page";let r=Vue.createPageApp(g,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:a});r.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...g.styles||[]])),r.mount("#root")}})();
因为 它太大了无法显示 source diff 。你可以改为 查看blob
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var w=Object.create;var g=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var k=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var M=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!B.call(e,s)&&s!==t&&g(e,s,{get:()=>a[s],enumerable:!(n=y(a,s))||n.enumerable});return e};var N=(e,a,t)=>(t=e!=null?w(O(e)):{},M(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e));var D=k((x,_)=>{_.exports=Vue});var I=Object.prototype.toString,p=e=>I.call(e),d=e=>p(e).slice(8,-1);function T(){return typeof __channelId__=="string"&&__channelId__}function v(e,a){switch(d(a)){case"Function":return"function() { [native code] }";default:return a}}function F(e,a,t){return T()?(t.push(a.replace("at ","uni-app:///")),console[e].apply(console,t)):t.map(function(s){let i=p(s).toLowerCase();if(["[object object]","[object array]","[object module]"].indexOf(i)!==-1)try{s="---BEGIN:JSON---"+JSON.stringify(s,v)+"---END:JSON---"}catch(l){s=i}else if(s===null)s="---NULL---";else if(s===void 0)s="---UNDEFINED---";else{let l=d(s).toUpperCase();l==="NUMBER"||l==="BOOLEAN"?s="---BEGIN:"+l+"---"+s+"---END:"+l+"---":s=String(s)}return s}).join("---COMMA---")+" "+a}function m(e,a,...t){let n=F(e,a,t);n&&console[e](n)}var b=(e,a)=>{let t=e.__vccOpts||e;for(let[n,s]of a)t[n]=s;return t};var C={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let a={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},t=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),n=t[1];n&&(t[1]=a[n]||n),t.length=t.length>2?2:t.length,this.locale=t.join("-")},localize(e){let a=this.locale,t=a.split("-")[0],n=this.fallbackLocale,s=i=>{let l=Object.assign({},this.localization[i],(this.localizationTemplate||{})[i]);return m("log","at mixins/i18n.js:78","********** o :>> ",l),l};return s("messages")[e]||s(a)[e]||s(t)[e]||s(n)[e]||e}}},E={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:a,runtime:t,data:n={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=t,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(n)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let i=this,l=function(c){let h=c.data&&c.data.__message;!h||i.__onMessageCallback&&i.__onMessageCallback(h.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",l);else{let c=new BroadcastChannel(this.__page);c.onmessage=l}},postMessage(e={},a=!1){let t=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:a}})),n=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(t,n):new BroadcastChannel(n).postMessage(t);else{let s=plus.webview.getWebviewById(n);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:t})})`)}},onMessage(e){this.__onMessageCallback=e}}};var r=N(D());var R={content:{"":{flex:1,alignItems:"center",justifyContent:"center",backgroundColor:"#000000"}},barcode:{"":{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:1}},"set-flash":{"":{alignItems:"center",justifyContent:"center",transform:"translateY(80px)",zIndex:2}},"image-flash":{"":{width:26,height:26,marginBottom:2}},"image-flash-text":{"":{fontSize:10,color:"#FFFFFF"}}},o=plus.barcode,A={qrCode:[o.QR,o.AZTEC,o.MAXICODE],barCode:[o.EAN13,o.EAN8,o.UPCA,o.UPCE,o.CODABAR,o.CODE128,o.CODE39,o.CODE93,o.ITF,o.RSS14,o.RSSEXPANDED],datamatrix:[o.DATAMATRIX],pdf417:[o.PDF417]},L={[o.QR]:"QR_CODE",[o.EAN13]:"EAN_13",[o.EAN8]:"EAN_8",[o.DATAMATRIX]:"DATA_MATRIX",[o.UPCA]:"UPC_A",[o.UPCE]:"UPC_E",[o.CODABAR]:"CODABAR",[o.CODE39]:"CODE_39",[o.CODE93]:"CODE_93",[o.CODE128]:"CODE_128",[o.ITF]:"CODE_25",[o.PDF417]:"PDF_417",[o.AZTEC]:"AZTEC",[o.RSS14]:"RSS_14",[o.RSSEXPANDED]:"RSSEXPANDED"},P={mixins:[E,C],data:{filters:[0,2,1],backgroud:"#000000",frameColor:"#118ce9",scanbarColor:"#118ce9",enabledFlash:!1,flashImage0:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABjklEQVRoQ+1ZbVHEQAx9TwE4ABTcOQAknANQAKcAUAAOAAXgAHAACsDCKQiTmbYDzJZtNt2bFrJ/m6+Xl2yyU2LmhzOPH/8PgIjcADirxNyapNoffMwMiMgzgMPBHmyCLySPLCoBwJKtAbJbYaBmD1yRvBwAtBMxl5DF+DZkiwCIyBLAzsgBbki+Wm2WAlCaL6zOMvKnJO+sNksB7ALQbO1ZHfbIv5FUVs2nCIB6EZETALdmj2mFY5I6X8ynGEADQllYmL1+VzBfnV/VvQB0aj45ARyQ/Ci14QLQsOBZLe5JaikWnzEA7AN4L4hgA2Dpyb76dANwsOCq/TZhASAYKGie0a7R1lDPI0ebtF0NUi+4yfdAtxr3PEMnD6BbD0QkNfACQO05EAwMuaBqDrIVycdmTpwDuP4R0OR7QFftVRP0g+49cwOQq4DJMxAAchmofY3m/EcJBQOZbTRKKJeBKKEoIePvpFRJ1VzmciUccyCa+C81cerBkuuB7sGTE/zt+yhN7AnAqxsAvBn06n8CkyPwMZKwm+UAAAAASUVORK5CYII=",flashImage1:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUAAAA3kvI3lfY2k/VAl+43k/U3k/Q4k/M3kvI3k/M4k/Q4lPU2lPU2k/Vdq843k/WWSpNKAAAAD3RSTlMAwD+QINCAcPBgUDDgoBAE044kAAAAdklEQVQ4y2OgOrD/DwffUSTkERIfyZXAtOMbca7iVoKDDSgSbAijJqBI8J2HiX9FM2s+TOITmgQrTEIATYIJJuEA5mJ68S+Gg/0hEi0YEoxQK2gs0WyPQyKBGYeEAhPtJRaw45AIccXpwVEJekuwQyQWMFAfAACeDBJY9aXa3QAAAABJRU5ErkJggg==",autoDecodeCharSet:!1,autoZoom:!0,localizationTemplate:{en:{fail:"Recognition failure","flash.on":"Tap to turn light on","flash.off":"Tap to turn light off"},zh:{fail:"\u8BC6\u522B\u5931\u8D25","flash.on":"\u8F7B\u89E6\u7167\u4EAE","flash.off":"\u8F7B\u89E6\u5173\u95ED"}}},onLoad(){let e=this.data,a=e.scanType;this.autoDecodeCharSet=e.autoDecodeCharSet,this.autoZoom=e.autoZoom;let t=[];Array.isArray(a)&&a.length&&a.forEach(n=>{let s=A[n];s&&(t=t.concat(s))}),t.length||(t=t.concat(A.qrCode).concat(A.barCode).concat(A.datamatrix).concat(A.pdf417)),this.filters=t,this.onMessage(n=>{this.gallery()})},onUnload(){this.cancel()},onReady(){setTimeout(()=>{this.cancel(),this.start()},50)},methods:{start(){this.$refs.barcode.start({sound:this.data.sound})},scan(e){o.scan(e,(a,t,n,s)=>{this.scanSuccess(a,t,n,s)},()=>{plus.nativeUI.toast(this.localize("fail"))},this.filters,this.autoDecodeCharSet)},cancel(){this.$refs.barcode.cancel()},gallery(){plus.gallery.pick(e=>{this.scan(e)},e=>{e.code!==(weex.config.env.platform.toLowerCase()==="android"?12:-2)&&plus.nativeUI.toast(this.localize("fail"))},{multiple:!1,system:!1,filename:"_doc/uniapp_temp/gallery/",permissionAlert:!0})},onmarked(e){var a=e.detail;this.scanSuccess(a.code,a.message,a.file,a.charSet)},scanSuccess(e,a,t,n){this.postMessage({event:"marked",detail:{scanType:L[e],result:a,charSet:n||"utf8",path:t||""}})},onerror(e){this.postMessage({event:"fail",message:JSON.stringify(e)})},setFlash(){this.enabledFlash=!this.enabledFlash,this.$refs.barcode.setFlash(this.enabledFlash)}}};function Q(e,a,t,n,s,i){return(0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("view",{class:"content"},[(0,r.createElementVNode)("barcode",{class:"barcode",ref:"barcode",autostart:"false",backgroud:e.backgroud,frameColor:e.frameColor,scanbarColor:e.scanbarColor,filters:e.filters,autoDecodeCharset:e.autoDecodeCharSet,autoZoom:e.autoZoom,onMarked:a[0]||(a[0]=(...l)=>i.onmarked&&i.onmarked(...l)),onError:a[1]||(a[1]=(...l)=>i.onerror&&i.onerror(...l))},null,40,["backgroud","frameColor","scanbarColor","filters","autoDecodeCharset","autoZoom"]),(0,r.createElementVNode)("view",{class:"set-flash",onClick:a[2]||(a[2]=(...l)=>i.setFlash&&i.setFlash(...l))},[(0,r.createElementVNode)("u-image",{class:"image-flash",src:e.enabledFlash?e.flashImage1:e.flashImage0,resize:"stretch"},null,8,["src"]),(0,r.createElementVNode)("u-text",{class:"image-flash-text"},(0,r.toDisplayString)(e.enabledFlash?e.localize("flash.off"):e.localize("flash.on")),1)])])])}var u=b(P,[["render",Q],["styles",[R]]]);var f=plus.webview.currentWebview();if(f){let e=parseInt(f.id),a="template/__uniappscan",t={};try{t=JSON.parse(f.__query__)}catch(s){}u.mpType="page";let n=Vue.createPageApp(u,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:a,__pageQuery:t});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...u.styles||[]])),n.mount("#root")}})();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>View</title>
<link rel="stylesheet" href="app.css" />
<script>var __uniConfig = {"globalStyle":{}}</script>
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
</head>
<body>
<div id="app"></div>
<script src="uni-app-view.umd.js"></script>
</body>
</html>
;(function(){
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"HelloUTS","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"3.5.5","entryPagePath":"pages/tabBar/Primer/Primer","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"tabBar":{"position":"bottom","color":"#7A7E83","selectedColor":"#007AFF","borderStyle":"black","blurEffect":"none","fontSize":"10px","iconWidth":"24px","spacing":"3px","height":"50px","backgroundColor":"#F8F8F8","list":[{"pagePath":"pages/tabBar/Primer/Primer","iconPath":"/static/tabbar_easy.png","selectedIconPath":"/static/tabbar_easy_select.png","text":"入门"},{"pagePath":"pages/tabBar/Advance/Advance","iconPath":"/static/tabbar_high.png","selectedIconPath":"/static/tabbar_high_select.png","text":"进阶"},{"pagePath":"pages/tabBar/SystemAPI/SystemAPI","iconPath":"/static/tabbar_api.png","selectedIconPath":"/static/tabbar_api_select.png","text":"系统API"},{"pagePath":"pages/tabBar/SDKIntegration/SDKIntegration","iconPath":"/static/tabbar_sdk.png","selectedIconPath":"/static/tabbar_sdk_select.png","text":"三方SDK"}],"selectedIndex":0,"shown":true},"locales":{}};
const __uniRoutes = [{"path":"pages/tabBar/Primer/Primer","meta":{"isQuit":true,"isEntry":true,"isTabBar":true,"tabBarIndex":0,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/Advance/Advance","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":1,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/SystemAPI/SystemAPI","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":2,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/SDKIntegration/SDKIntegration","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":3,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
__uniConfig.styles=[];//styles
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:16})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:u,window:u,document:u,frames:u,self:u,location:u,navigator:u,localStorage:u,history:u,Caches:u,screen:u,alert:u,confirm:u,prompt:u,fetch:u,XMLHttpRequest:u,WebSocket:u,webkit:u,print:u}}}});
})();
\ No newline at end of file
(function(){})();
\ No newline at end of file
var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,a)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,__spreadValues=(e,t)=>{for(var a in t||(t={}))__hasOwnProp.call(t,a)&&__defNormalProp(e,a,t[a]);if(__getOwnPropSymbols)for(var a of __getOwnPropSymbols(t))__propIsEnum.call(t,a)&&__defNormalProp(e,a,t[a]);return e};if("undefined"==typeof Promise||Promise.prototype.finally||(Promise.prototype.finally=function(e){const t=this.constructor;return this.then((a=>t.resolve(e()).then((()=>a))),(a=>t.resolve(e()).then((()=>{throw a}))))}),"undefined"!=typeof uni&&uni&&uni.requireGlobal){const e=uni.requireGlobal();ArrayBuffer=e.ArrayBuffer,Int8Array=e.Int8Array,Uint8Array=e.Uint8Array,Uint8ClampedArray=e.Uint8ClampedArray,Int16Array=e.Int16Array,Uint16Array=e.Uint16Array,Int32Array=e.Int32Array,Uint32Array=e.Uint32Array,Float32Array=e.Float32Array,Float64Array=e.Float64Array,BigInt64Array=e.BigInt64Array,BigUint64Array=e.BigUint64Array}uni.restoreGlobal&&uni.restoreGlobal(Vue,weex,plus,setTimeout,clearTimeout,setInterval,clearInterval),function(e,t){"use strict";function a(t,a){return"Function"===e.toRawType(a)?"function() { [native code] }":a}function n(t,n,c){if("string"==typeof __channelId__&&__channelId__)return c.push(n.replace("at ","uni-app:///")),console[t].apply(console,c);return c.map((function(t){const n=e.toTypeString(t).toLowerCase();if(-1!==["[object object]","[object array]","[object module]"].indexOf(n))try{t="---BEGIN:JSON---"+JSON.stringify(t,a)+"---END:JSON---"}catch(c){t=n}else if(null===t)t="---NULL---";else if(void 0===t)t="---UNDEFINED---";else{const a=e.toRawType(t).toUpperCase();t="NUMBER"===a||"BOOLEAN"===a?"---BEGIN:"+a+"---"+t+"---END:"+a+"---":String(t)}return t})).join("---COMMA---")+" "+n}function c(e,t,...a){const c=n(e,t,a);c&&console[e](c)}var l=(e,t)=>{const a=e.__vccOpts||e;for(const[n,c]of t)a[n]=c;return a};var s=l({name:"page-head",props:{title:{type:String,default:""}}},[["render",function(e,a,n,c,l,s){return t.openBlock(),t.createElementBlock("view",{class:"common-page-head"},[t.createElementVNode("view",{class:"common-page-head-title"},t.toDisplayString(n.title),1)])}]]);function r(t,a){return e.isString(t)?a:t}let o,i=1;const u={};function p(t){if("function"==typeof t){const e=i++;return u[e]=t,e}return e.isPlainObject(t)&&Object.keys(t).forEach((e=>{t[e]=p(t[e])})),t}function m(){var e;return o||(e="UTS-Proxy",o=weex.requireModule(e)),o}function d(e){if(e.errMsg)throw new Error(e.errMsg);return e.params}function y(e){return d(m().invokeSync(e,(()=>{})))}function v(t,{package:a,class:n,name:c,id:l,companion:s}){const r=({id:e,name:t,params:l,keepAlive:s})=>{const r=u[e];r?(r(...l),s||delete u[e]):console.error(`${a}${n}.${c} ${t} is not found`)},o=l?{id:l,name:c}:{package:a,class:n,name:c,companion:s};return(...a)=>{const n=e.extend({},o,{params:a.map((e=>p(e)))});return t?new Promise(((e,t)=>{m().invokeAsync(n,(a=>{"return"!==a.type?r(a):a.errMsg?t(a.errMsg):e(a.params)}))})):d(m().invokeSync(n,r))}}function g(e,t){return v(e,t)}const b=g;const f="uts.modules.utsHelloworld",A="IndexKt",h=b(!1,{package:f,class:A,name:"callWithoutParam"}),S=b(!1,{package:f,class:A,name:"callWithStringParam"}),k=b(!1,{package:f,class:A,name:"callWithJSONParam"});var w=l({data:()=>({title:"UTS入门示例",stringParam:"hello world"}),onUnload:function(){},methods:{testDoSthWithCallback:function(){h({success:function(){uni.showToast({title:"成功调用uts插件uts-helloworld的callWithoutParam",icon:"none"})}})},testDoSthWithString:function(){S({input:this.stringParam,success:function(e){uni.showToast({title:"uts插件uts-helloworld的callWithStringParam方法收到了你输入的字符串:"+e,icon:"none"})}})},testDoSthWithJSON:function(){c("log","at pages/tabBar/Primer/Primer.vue:51",this.jsonParam);var e={inputText:this.stringParam};k({input:e,success:function(e){c("log","at pages/tabBar/Primer/Primer.vue:59",e),uni.showToast({title:"执行结果:"+JSON.stringify(e),icon:"none"})}})}}},[["render",function(e,a,n,c,l,o){const i=r(t.resolveDynamicComponent("page-head"),s);return t.openBlock(),t.createElementBlock("view",null,[t.createVNode(i,{title:l.title},null,8,["title"]),t.withDirectives(t.createElementVNode("input",{class:"uni-input","onUpdate:modelValue":a[0]||(a[0]=e=>l.stringParam=e)},null,512),[[t.vModelText,l.stringParam]]),t.createElementVNode("view",{class:"uni-btn-v uni-common-mt"},[t.createElementVNode("button",{type:"primary",onClick:a[1]||(a[1]=(...e)=>o.testDoSthWithCallback&&o.testDoSthWithCallback(...e))},"uts异步方法(无参数)"),t.createElementVNode("button",{type:"primary",onClick:a[2]||(a[2]=(...e)=>o.testDoSthWithString&&o.testDoSthWithString(...e))},"uts异步方法(字符串参数)"),t.createElementVNode("button",{type:"primary",onClick:a[3]||(a[3]=(...e)=>o.testDoSthWithJSON&&o.testDoSthWithJSON(...e))},"uts异步方法(json参数)")])])}]]);const N="uts.modules.utsAdvance",E="IndexKt",C=b(!1,{package:N,class:E,name:"testSync"}),_=b(!1,{package:N,class:E,name:"testSyncWithCallback"}),V=b(!0,{package:N,class:E,name:"testAsync"}),B=function({package:t,class:a,methods:n,props:c,staticProps:l,staticMethods:s}){const r={package:t,class:a},o={};return new Proxy(class{constructor(...t){const a={},l=v(!1,e.extend({name:"constructor",params:t},r)).apply(null,t);return new Proxy(this,{get(t,s){if(!a[s])if(e.hasOwn(n,s))a[s]=(o=!!n[s].async,i=e.extend({id:l,name:s},r),v(o,i));else if(c.includes(s))return y({id:l,name:s});var o,i;return a[s]}})}},{get:(t,a,n)=>e.hasOwn(s,a)?(o[a]||(o[a]=g(!!s[a].async,e.extend({name:a,companion:!0},r))),o[a]):l.includes(a)?y(e.extend({name:a,companion:!0},r)):Reflect.get(t,a,n)})}(__spreadValues({package:N,class:"Test"},{methods:{testClassSyncWithCallback:{async:!1},testClassAsync:{async:!0}},staticMethods:{testClassStaticSyncWithCallback:{async:!1},testClassStaticAsync:{async:!0}},props:["id","name"],staticProps:["type"]})),P=t.defineComponent({__name:"Advance",setup(e){c("log","at pages/tabBar/Advance/Advance.vue:54","MAX",100);const a=t.ref(null),n=t.reactive({return:null,success:null,fail:null,complete:null}),l=t.reactive({return:null,success:null,fail:null,complete:null});function s(){r(),o(),i(),y(),g(),f(),h(),k(),N(),P()}function r(){a.value=!1;try{"hello dcloud"===C("dcloud").msg&&(a.value=!0)}catch(e){c("error","at pages/tabBar/Advance/Advance.vue:93","testUtsSync",e)}}function o(){try{n.return=!1,n.success=!1,n.complete=!1,"testSyncWithCallback"===_({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:106","testSyncWithCallback.success.callback",e),n.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:110","testSyncWithCallback.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:114","testSyncWithCallback.complete.callback",e),n.complete=!0}}).name&&(n.return=!0)}catch(e){}}async function i(){l.return=!1,l.success=!1,l.complete=!1;try{"testAsync"===(await V({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:132","testAsync.success.callback",e),l.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:136","testAsync.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:139","testAsync.complete.callback",e),l.complete=!0}})).name&&(l.return=!0)}catch(e){}}function u(e){return null==e?"--":e?"通过":"未通过"}let p,m=0;const d=t.reactive({callback:null});function y(){d.callback=!1,m++,p=new B(m,{name:"name"+m,callback:e=>{c("log","at pages/tabBar/Advance/Advance.vue:161",e),d.callback=!0}})}const v=t.ref(null);function g(){v.value=!1,"Test"===B.type&&(v.value=!0)}const b=t.reactive({return:null,success:null,fail:null,complete:null});function f(){try{b.return=!1,b.success=!1,b.complete=!1,"testSyncWithCallback"===B.testClassStaticSyncWithCallback({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:189","testStaticSyncWithCallback.success.callback",e),b.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:193","testStaticSyncWithCallback.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:197","testStaticSyncWithCallback.complete.callback",e),b.complete=!0}}).name&&(b.return=!0)}catch(e){}}const A=t.reactive({return:null,success:null,fail:null,complete:null});async function h(){A.return=!1,A.success=!1,A.complete=!1;try{"testAsync"===(await B.testClassStaticAsync({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:221","testAsync.success.callback",e),A.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:225","testAsync.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:228","testAsync.complete.callback",e),A.complete=!0}})).name&&(A.return=!0)}catch(e){}}const S=t.ref(null);function k(){p||y(),S.value=!1,p.id>0&&(S.value=!0)}const w=t.reactive({return:null,success:null,fail:null,complete:null});function N(){p||y();try{w.return=!1,w.success=!1,w.complete=!1,"testSyncWithCallback"===p.testClassSyncWithCallback({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:268","testSyncWithCallback.success.callback",e),w.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:272","testSyncWithCallback.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:276","testSyncWithCallback.complete.callback",e),w.complete=!0}}).name&&(w.return=!0)}catch(e){}}const E=t.reactive({return:null,success:null,fail:null,complete:null});async function P(){p||y(),E.return=!1,E.success=!1,E.complete=!1;try{"testAsync"===(await p.testClassAsync({type:"success",success(e){c("log","at pages/tabBar/Advance/Advance.vue:303","testAsync.success.callback",e),E.success=!0},fail(e){c("log","at pages/tabBar/Advance/Advance.vue:307","testAsync.fail.callback",e)},complete(e){c("log","at pages/tabBar/Advance/Advance.vue:310","testAsync.complete.callback",e),E.complete=!0}})).name&&(E.return=!0)}catch(e){}}return(e,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("button",{onClick:r},"点击测试uts同步方法"),t.createElementVNode("view",null,"测试return: "+t.toDisplayString(u(a.value)),1),t.createElementVNode("button",{onClick:o}," 点击测试uts带callback的同步方法 "),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(n.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(n.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(n.complete)),1),t.createElementVNode("button",{onClick:i},"点击测试uts异步方法"),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(l.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(l.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(l.complete)),1),t.createElementVNode("button",{onClick:y},"点击测试uts class构造函数"),t.createElementVNode("view",null,"测试callback:"+t.toDisplayString(u(d.callback)),1),t.createElementVNode("button",{onClick:g},"点击测试uts class静态属性"),t.createElementVNode("view",null,"测试value:"+t.toDisplayString(u(v.value)),1),t.createElementVNode("button",{onClick:f}," 点击测试uts class静态方法 "),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(b.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(b.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(b.complete)),1),t.createElementVNode("button",{onClick:h},"点击测试uts class静态异步方法"),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(A.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(A.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(A.complete)),1),t.createElementVNode("button",{onClick:k},"点击测试uts class实例属性"),t.createElementVNode("view",null,"测试value:"+t.toDisplayString(u(S.value)),1),t.createElementVNode("button",{onClick:N}," 点击测试uts class实例方法 "),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(w.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(w.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(w.complete)),1),t.createElementVNode("button",{onClick:P},"点击测试uts class实例异步方法"),t.createElementVNode("view",null,"测试return:"+t.toDisplayString(u(E.return)),1),t.createElementVNode("view",null,"测试success:"+t.toDisplayString(u(E.success)),1),t.createElementVNode("view",null,"测试complete:"+t.toDisplayString(u(E.complete)),1),t.createElementVNode("button",{onClick:s},"点击测试所有")],64))}}),D=b(!1,{package:"uts.modules.utsOsapi",class:"IndexKt",name:"getBatteryCapacity"});var W=l({data:()=>({title:"系统API示例"}),onUnload:function(){},methods:{testGetBatteryCapacity:function(){c("log","at pages/tabBar/SystemAPI/SystemAPI.vue:25",D()),uni.showToast({title:"122",icon:"none"})}}},[["render",function(e,a,n,c,l,o){const i=r(t.resolveDynamicComponent("page-head"),s);return t.openBlock(),t.createElementBlock("view",null,[t.createVNode(i,{title:l.title},null,8,["title"]),t.createElementVNode("view",{class:"uni-btn-v uni-common-mt"},[t.createElementVNode("button",{type:"primary",onClick:a[0]||(a[0]=(...e)=>o.testGetBatteryCapacity&&o.testGetBatteryCapacity(...e))},"获取电池电量")])])}]]);var O=l({data:()=>({}),methods:{}},[["render",function(e,a,n,c,l,s){return t.openBlock(),t.createElementBlock("view",null,[t.createElementVNode("text",null,"sdk集成")])}]]);__definePage("pages/tabBar/Primer/Primer",w),__definePage("pages/tabBar/Advance/Advance",P),__definePage("pages/tabBar/SystemAPI/SystemAPI",W),__definePage("pages/tabBar/SDKIntegration/SDKIntegration",O);const I={onLaunch:function(){c("log","at App.vue:4","App Launch")},onShow:function(){c("log","at App.vue:7","App Show")},onHide:function(){c("log","at App.vue:10","App Hide")}};const{app:U,Vuex:x,Pinia:T}={app:t.createVueApp(I)};uni.Vuex=x,uni.Pinia=T,U.provide("__globalStyles",__uniConfig.styles),U._component.mpType="app",U._component.render=()=>{},U.mount("#app")}(uni.VueShared,Vue);
此差异已折叠。
{
"@platforms": [
"android",
"iPhone",
"iPad"
],
"id": "__UNI__70BE9D0",
"name": "HelloUTS",
"version": {
"name": "1.0.0",
"code": "100"
},
"description": "",
"developer": {
"name": "",
"email": "",
"url": ""
},
"permissions": {
"UniNView": {
"description": "UniNView原生渲染"
}
},
"plus": {
"useragent": {
"value": "uni-app",
"concatenate": true
},
"splashscreen": {
"target": "id:1",
"autoclose": true,
"waiting": true,
"delay": 0
},
"popGesture": "close",
"launchwebview": {
"id": "1",
"kernel": "WKWebview"
},
"statusbar": {
"immersed": "supportedDevice",
"style": "light",
"background": "#F8F8F8"
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"distribute": {
"google": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"apple": {},
"plugins": {
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
}
}
}
},
"uniStatistics": {
"enable": false
},
"allowsInlineMediaPlayback": true,
"safearea": {
"background": "#F8F8F8",
"bottom": {
"offset": "auto"
}
},
"uni-app": {
"control": "uni-v3",
"vueVersion": "3",
"compilerVersion": "3.5.5",
"nvueCompiler": "uni-app",
"renderer": "auto",
"nvue": {
"flex-direction": "column"
},
"nvueLaunchMode": "normal"
},
"tabBar": {
"position": "bottom",
"color": "#7A7E83",
"selectedColor": "#007AFF",
"borderStyle": "rgba(0,0,0,0.4)",
"blurEffect": "none",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"height": "50px",
"backgroundColor": "#F8F8F8",
"list": [
{
"pagePath": "pages/tabBar/Primer/Primer",
"iconPath": "/static/tabbar_easy.png",
"selectedIconPath": "/static/tabbar_easy_select.png",
"text": "入门"
},
{
"pagePath": "pages/tabBar/Advance/Advance",
"iconPath": "/static/tabbar_high.png",
"selectedIconPath": "/static/tabbar_high_select.png",
"text": "进阶"
},
{
"pagePath": "pages/tabBar/SystemAPI/SystemAPI",
"iconPath": "/static/tabbar_api.png",
"selectedIconPath": "/static/tabbar_api_select.png",
"text": "系统API"
},
{
"pagePath": "pages/tabBar/SDKIntegration/SDKIntegration",
"iconPath": "/static/tabbar_sdk.png",
"selectedIconPath": "/static/tabbar_sdk_select.png",
"text": "三方SDK"
}
],
"selectedIndex": 0,
"shown": true,
"child": [
"lauchwebview"
],
"selected": 0
}
},
"launch_path": "__uniappview.html"
}
\ No newline at end of file
因为 它太大了无法显示 source diff 。你可以改为 查看blob
package uts.modules.utsAdvance;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
fun log(msg: String) {
console.log(msg, "at uni_modules/uts-advance/app-android/utils.uts:2");
}
open class AsyncOptions {
open lateinit var type: String;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
val MAX = 100;
fun testSync(msg: String): UtsJSONObject {
console.log("log test", "at uni_modules/uts-advance/app-android/index.uts:18");
log("log test1");
return object : UtsJSONObject() {
var msg = """hello ${msg}"""
};
}
fun testSyncError() {
val arr: MutableList<String> = mutableListOf();
console.log(arr[1], "at uni_modules/uts-advance/app-android/index.uts:29");
}
fun testSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
if (opts.type == "success") opts.success("success");
else opts.fail("fail");
opts.complete("complete");
return object : UtsJSONObject() {
var name = "testSyncWithCallback"
};
}
suspend fun testAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
if (opts.type == "success") opts.success("success");
else opts.fail("fail");
opts.complete("complete");
return@async object : UtsJSONObject() {
var name = "testAsync"
};
}
open class TestOptions {
open lateinit var name: String;
open lateinit var callback: UTSCallback;
}
open class Test {
open var id: Number;
open var name: String;
constructor(id: Number, options: TestOptions){
this.id = id;
this.name = options.name;
options.callback("Test.constructor");
}
open fun testClassSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
open suspend fun testClassAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
val res = testAsync(opts).await();
return@async res;
}
companion object {
var type: String = "Test";
fun testClassStaticSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
suspend fun testClassStaticAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
val res = testAsync(opts).await();
return@async res;
}
}
}
{
"id": "uts-advance",
"displayName": "uts-advance",
"version": "1.0.0",
"description": "uts-advance",
"keywords": [
"uts-advance"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "native-uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
},
"type": "uts",
"uts": {
"android": {
"libs": [],
"dependencies": []
},
"ios": {
"libs": []
}
}
}
}
\ No newline at end of file
package uts.modules.utsHelloworld;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
open class NoParamOptions {
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
open class StringParamOptions {
open lateinit var input: String;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
open class inputJSON {
open lateinit var inputText: String;
open lateinit var errCode: Number;
}
open class JsonParamOptions {
open lateinit var input: inputJSON;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
fun callWithoutParam(opts: NoParamOptions): UtsJSONObject {
setTimeout(fun() {
opts.success();
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
fun callWithStringParam(opts: StringParamOptions): UtsJSONObject {
setTimeout(fun() {
opts.success(opts.input);
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
fun callWithJSONParam(opts: JsonParamOptions): UtsJSONObject {
opts.input.errCode = 10;
setTimeout(fun() {
opts.success(opts.input);
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
{
"id": "uts-helloworld",
"displayName": "uts-helloworld",
"version": "1.0.0",
"description": "uts-helloworld",
"keywords": [
"uts-helloworld"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "native-uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
},
"type": "uts",
"uts": {
"android": {
"libs": [],
"dependencies": []
},
"ios": {
"libs": []
}
}
}
}
\ No newline at end of file
package uts.modules.utsOsapi;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
import android.content.Context;
import android.os.BatteryManager;
import io.dcloud.uts.android.getAppContext;
fun getBatteryCapacity(): String {
val context = getAppContext();
if (context != null) {
val manager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager;
val currentLevel: Number = manager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
return "" + currentLevel + "**456464%";
}
return "0%";
}
{
"id": "uts-osapi",
"displayName": "uts-osapi",
"version": "1.0.0",
"description": "uts-osapi",
"keywords": [
"uts-osapi"
],
"repository": "",
"engines": {
"HBuilderX": "^3.1.0"
},
"dcloudext": {
"type": "native-uts",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "",
"data": "",
"permissions": ""
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "u",
"aliyun": "u"
},
"client": {
"Vue": {
"vue2": "u",
"vue3": "u"
},
"App": {
"app-vue": "u",
"app-nvue": "u"
},
"H5-mobile": {
"Safari": "u",
"Android Browser": "u",
"微信浏览器(Android)": "u",
"QQ浏览器(Android)": "u"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
},
"小程序": {
"微信": "u",
"阿里": "u",
"百度": "u",
"字节跳动": "u",
"QQ": "u",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
},
"快应用": {
"华为": "u",
"联盟": "u"
}
}
},
"type": "uts",
"uts": {
"android": {
"libs": [],
"dependencies": []
},
"ios": {
"libs": []
}
}
}
}
\ No newline at end of file
var _style_0 = {};
exports.styles = [_style_0];
Promise.resolve("./app.css.js").then(() => {
});
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,(function(){function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}function t(e){return!(!e||void 0===e.length)}function n(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],a(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}i(t.promise,r)}else(1===e._state?i:u)(t.promise,e._value)}))):e._deferreds.push(t)}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void a(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;n>t;t++)o(e,e._deferreds[t]);e._deferreds=null}function a(e,t){var n=!1;try{e((function(e){n||(n=!0,i(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}var s=setTimeout;r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,r)),r},r.prototype.finally=e,r.all=function(e){return new r((function(n,r){function o(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var c=t.then;if("function"==typeof c)return void c.call(t,(function(t){o(e,t)}),r)}i[e]=t,0==--u&&n(i)}catch(e){r(e)}}if(!t(e))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);for(var u=i.length,c=0;i.length>c;c++)o(c,i[c])}))},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(n,o){if(!t(e))return o(new TypeError("Promise.race accepts an array"));for(var i=0,u=e.length;u>i;i++)r.resolve(e[i]).then(n,o)}))},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){s(e,0)},r._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();"Promise"in l?l.Promise.prototype.finally||(l.Promise.prototype.finally=e):l.Promise=r}));var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function r(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(n)}for(var o=[],i=0;i<256;++i)o[i]=(i+256).toString(16).substr(1);function u(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var u=(e=e||{}).random||(e.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var c=0;c<16;++c)t[i+c]=u[c];return t||function(e,t){var n=t||0,r=o;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(u)}var c=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},l=/-(\w)/g,f=s((function(e){return e.replace(l,(function(e,t){return t?t.toUpperCase():""}))})),d=s((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;function m(e,t){if(a(e))return e;if(t&&(n=t,r=e,c.call(n,r)))return[e];var n,r,o=[];return e.replace(p,(function(e,t,n,r){return o.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),o}function v(e,t){var n,r=m(t,e);for(n=r.shift();null!=n;){if(null==(e=e[n]))return;n=r.shift()}return e}var h=new Map;function g(e){if(!function(e){if(e){var t=e.tagName;return 0===t.indexOf("UNI-")||"BODY"===t}return!1}(e))throw Error("no such element");var t,n,r={elementId:(t=e,n=t._id,n||(n=u(),t._id=n,h.set(n,{id:n,element:t})),n),tagName:e.tagName.toLocaleLowerCase().replace("uni-","")},o=e.__vue__;return o&&(o.$parent&&o.$parent.$el===e&&(o=o.$parent),o&&!o.$options.isReserved&&(r.nodeId=function(e){if(e._$weex)return e._uid;if(e._$id)return e._$id;var t=function(e){for(var t=e.$parent;t;){if(t._$id)return t;t=t.$parent}}(e);if(!e.$parent)return"-1";var n=e.$vnode,r=n.context;return r&&r!==t&&r._$id?r._$id+";"+t._$id+","+n.data.attrs._i:t._$id+","+n.data.attrs._i}(o))),"video"===r.tagName&&(r.videoId=r.nodeId),r}var _={input:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},textarea:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},"scroll-view":{scrollTo:function(e,t,n){var r=e.__vue__.$refs.main;r.scrollLeft=t,r.scrollTop=n},scrollTop:function(e){return e.__vue__.$refs.main.scrollTop},scrollLeft:function(e){return e.__vue__.$refs.main.scrollLeft},scrollWidth:function(e){return e.__vue__.$refs.main.scrollWidth},scrollHeight:function(e){return e.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(e,t){e.__vue__.current=t}},"movable-view":{moveTo:function(e,t,n){e.__vue__._animationTo(t,n)}},switch:{tap:function(e){e.click()}},slider:{slideTo:function(e,t){var n=e.__vue__,r=n.$refs["uni-slider"],o=r.offsetWidth,i=r.getBoundingClientRect().left;n.value=t,n._onClick({x:(t-n.min)*o/(n.max-n.min)+i})}}},y={getWindow:function(e){return window},getDocument:function(e){return document},getEl:function(e){var t=h.get(e);if(!t)throw Error("element destroyed");return t.element},getOffset:function(e){var t=e.getBoundingClientRect();return Promise.resolve({left:t.left+window.pageXOffset,top:t.top+window.pageYOffset})},querySelector:function(e,t){return"page"===t&&(t="body"),Promise.resolve(g(e.querySelector(t)))},querySelectorAll:function(e,t){var n=[],r=document.querySelectorAll(t);return[].forEach.call(r,(function(e){try{n.push(g(e))}catch(e){}})),Promise.resolve({elements:n})},queryProperties:function(e,t){return Promise.resolve({properties:t.map((function(t){var n=v(e,t);return"document.documentElement.scrollTop"===t&&0===n&&(n=v(e,"document.body.scrollTop")),n}))})},queryAttributes:function(e,t){return Promise.resolve({attributes:t.map((function(t){return String(e.getAttribute(t))}))})},queryStyles:function(e,t){var n=getComputedStyle(e);return Promise.resolve({styles:t.map((function(e){return n[e]}))})},queryHTML:function(e,t){return Promise.resolve({html:(n="outer"===t?e.outerHTML:e.innerHTML,n.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(e){return-1<e.indexOf("<body")?"<page>":"</body>"===e?"</page>":0!==e.indexOf("<uni-")&&0!==e.indexOf("</uni-")?"":e.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});var n},dispatchTapEvent:function(e){return e.click(),Promise.resolve()},dispatchLongpressEvent:function(e){return Promise.resolve()},dispatchTouchEvent:function(e,t,n){n||(n={}),n.touches||(n.touches=[]),n.changedTouches||(n.changedTouches=[]),n.touches.length||n.touches.push({identifier:Date.now(),target:e});var r=w(n.touches),o=w(n.changedTouches),i=w([]);return e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,touches:r,targetTouches:i,changedTouches:o})),Promise.resolve()},callFunction:function(t,n,r){var o=v(_,n);return o?Promise.resolve({result:o.apply(null,e([t],r))}):Promise.reject(Error(n+" not exists"))},triggerEvent:function(e,t,n){var r=e.__vue__;return r.$trigger&&r.$trigger(t,{},n),Promise.resolve()}};function w(e){var t,n=e.map((function(e){return function(e){if(document.createTouch)return document.createTouch(window,e.target,e.identifier,e.pageX,e.pageY,e.screenX,e.screenY);return new Touch(e)}(e)}));return document.createTouchList?(t=document).createTouchList.apply(t,n):n}["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){return d(f(e))}));var E=Object.assign({},function(e){return{"Page.getElement":function(t){return e.querySelector(e.getDocument(t.pageId),t.selector)},"Page.getElements":function(t){return e.querySelectorAll(e.getDocument(t.pageId),t.selector)},"Page.getWindowProperties":function(t){return e.queryProperties(e.getWindow(t.pageId),t.names)}}}(y),function(e){var t=function(t){return e.getEl(t.elementId,t.pageId)};return{"Element.getElement":function(n){return e.querySelector(t(n),n.selector)},"Element.getElements":function(n){return e.querySelectorAll(t(n),n.selector)},"Element.getDOMProperties":function(n){return e.queryProperties(t(n),n.names)},"Element.getProperties":function(n){var r=t(n),o=r.__vue__||r.attr||{};return e.queryProperties(o,n.names)},"Element.getOffset":function(n){return e.getOffset(t(n))},"Element.getAttributes":function(n){return e.queryAttributes(t(n),n.names)},"Element.getStyles":function(n){return e.queryStyles(t(n),n.names)},"Element.getHTML":function(n){return e.queryHTML(t(n),n.type)},"Element.tap":function(n){return e.dispatchTapEvent(t(n))},"Element.longpress":function(n){return e.dispatchLongpressEvent(t(n))},"Element.touchstart":function(n){return e.dispatchTouchEvent(t(n),"touchstart",n)},"Element.touchmove":function(n){return e.dispatchTouchEvent(t(n),"touchmove",n)},"Element.touchend":function(n){return e.dispatchTouchEvent(t(n),"touchend",n)},"Element.callFunction":function(n){return e.callFunction(t(n),n.functionName,n.args)},"Element.triggerEvent":function(n){return e.triggerEvent(t(n),n.type,n.detail)}}}(y));function b(e){return UniViewJSBridge.publishHandler("onAutoMessageReceive",e)}UniViewJSBridge.subscribe("sendAutoMessage",(function(e){var t=e.id,n=e.method,r=e.params,o={id:t},i=E[n];if(!i)return o.error={message:n+" unimplemented"},b(o);try{i(r).then((function(e){e&&(o.result=e)})).catch((function(e){o.error={message:e.message}})).finally((function(){b(o)}))}catch(e){o.error={message:e.message},b(o)}}));
此差异已折叠。
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var v=Object.create;var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var I=(e,t,a,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Q(t))!w.call(e,n)&&n!==a&&m(e,n,{get:()=>t[n],enumerable:!(o=P(t,n))||o.enumerable});return e};var O=(e,t,a)=>(a=e!=null?v(b(e)):{},I(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e));var B=E((L,C)=>{C.exports=Vue});var d={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let t={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},a=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),o=a[1];o&&(a[1]=t[o]||o),a.length=a.length>2?2:a.length,this.locale=a.join("-")},localize(e){let t=this.locale,a=t.split("-")[0],o=this.fallbackLocale,n=s=>Object.assign({},this.localization[s],(this.localizationTemplate||{})[s]);return n("messages")[e]||n(t)[e]||n(a)[e]||n(o)[e]||e}}},h={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:t,runtime:a,data:o={},useGlobalEvent:n}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=a,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=n,this.data=JSON.parse(JSON.stringify(o)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let s=this,r=function(l){let A=l.data&&l.data.__message;!A||s.__onMessageCallback&&s.__onMessageCallback(A.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",r);else{let l=new BroadcastChannel(this.__page);l.onmessage=r}},postMessage(e={},t=!1){let a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:t}})),o=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(a,o):new BroadcastChannel(o).postMessage(a);else{let n=plus.webview.getWebviewById(o);n&&n.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:a})})`)}},onMessage(e){this.__onMessageCallback=e}}};var i=O(B());var f=(e,t)=>{let a=e.__vccOpts||e;for(let[o,n]of t)a[o]=n;return a};var x={page:{"":{flex:1}},"flex-r":{"":{flexDirection:"row",flexWrap:"nowrap"}},"flex-c":{"":{flexDirection:"column",flexWrap:"nowrap"}},"flex-fill":{"":{flex:1}},"a-i-c":{"":{alignItems:"center"}},"j-c-c":{"":{justifyContent:"center"}},target:{"":{paddingTop:10,paddingBottom:10}},"text-area":{"":{paddingLeft:10,paddingRight:10,flex:1}},name:{"":{fontSize:16,lines:1,textOverflow:"ellipsis"}},address:{"":{fontSize:14,color:"#808080",lines:1,textOverflow:"ellipsis",marginTop:2}},"goto-area":{"":{width:50,height:50,paddingTop:8,paddingRight:8,paddingBottom:8,paddingLeft:8,backgroundColor:"#007aff",borderRadius:50,marginRight:10}},"goto-icon":{"":{width:34,height:34}},"goto-text":{"":{fontSize:14,color:"#FFFFFF"}}},z={mixins:[h,d],data(){return{longitude:"",latitude:"",markers:[],name:"",address:"",localizationTemplate:{en:{"map.title.amap":"AutoNavi Maps","map.title.baidu":"Baidu Maps","map.title.tencent":"Tencent Maps","map.title.apple":"Apple Maps","map.title.google":"Google Maps","location.title":"My Location","select.cancel":"Cancel"},zh:{"map.title.amap":"\u9AD8\u5FB7\u5730\u56FE","map.title.baidu":"\u767E\u5EA6\u5730\u56FE","map.title.tencent":"\u817E\u8BAF\u5730\u56FE","map.title.apple":"\u82F9\u679C\u5730\u56FE","map.title.google":"\u8C37\u6B4C\u5730\u56FE","location.title":"\u6211\u7684\u4F4D\u7F6E","select.cancel":"\u53D6\u6D88"}}}},onLoad(){let e=this.data;this.latitude=e.latitude,this.longitude=e.longitude,this.name=e.name||"",this.address=e.address||""},onReady(){this.mapContext=this.$refs.map1,this.markers=[{id:"location",latitude:this.latitude,longitude:this.longitude,title:this.name,zIndex:"1",iconPath:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAABICAMAAACORiZjAAAByFBMVEUAAAD/PyL/PyL/PyL/PyL/PyL/PyL/PyL/PyL/PiL/PyL/PyL/PyP/PyL/PyL/PyL/PyL/PiL/Py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Y29LCitcQiItcxxH5kcEncRhmc5UiofowuJxqPO5kZjm9rFROC9JWAXqC8HBgciI1AWcRbqj+fgX0emDg+MRif5OglmgJdlIEvzCJ8D5xQjQORhOlJlTKR4qmwD6B6FtOJ012yyMjrHMwuNTCM1jUG2SHDQPoWMMciZxdBR6PQOOtyF0ikEmEfrom5FqH0J7YOh+LUAE1bbolmrqj5SZOwTDxXJTdBFRqCrsBtoHRnAW7hRXThYE3VA7koVjo2CfUK4O2WdHodx7c7FsZ25sNDtotxp4SF++OIrpcHf+6Ojk7BA/X2wwOfRIeLj5wVGNClYJF4K/sY4SrVBJhj323hHXG/ymScEu091PH0HaS5e0MEslGeLuBCt9fqYWKLNXNIpZGcuXfqlqqaHWLhrFrLpWvqpqpU1ixFs9Ll1WY5ZLo19ECUb3X+VXg/y5wEj4qtYVlXCtRdIvErtyZi0nDJc1aLZxCPtrZ3P9PxLIX2Vy8P8zQAxla1xVZlYba6NbYAAi7KIwSxnKKjDHtoAHfOb/qSD/Z1OKEA4XbXHUr8ozq/XOZKOFxgkx4Mv177Jaz4fhQFnWdr8c4283pVhBRSDg4+zLeOYyu9CcCsIBK5T2fF0mXK7JkYaAEaAoY9Mazqw1FdnBRcWFuA/ZGDOd/R7eH7my3m1MA208k60I3ibHozUps/bICe+PQllbUmjrBaxIqaynG5JwT5UrgmW9ubpjrt5kJMOKlMvavIM2o08cVqRcVvONyNw0Y088YVmvPIJeqVUEy9rkmU31imBZ1x7PNV6RelkeD16Relmfbm81VQTLevs2A74iDWXpXzznwwEj9YCszcbCcOqiSY4jYTh1Jx1B04o+/wH6/wOSPFj1xgAAAABJRU5ErkJggg==",width:26,height:36}],this.updateMarker()},methods:{goto(){var e=weex.config.env.platform==="iOS";this.openSysMap(this.latitude,this.longitude,this.name,e)},updateMarker(){this.mapContext.moveToLocation(),this.mapContext.translateMarker({markerId:"location",destination:{latitude:this.latitude,longitude:this.longitude},duration:0},e=>{})},openSysMap(e,t,a,o){let n=weex.requireModule("mapSearch");var s=[{title:this.localize("map.title.tencent"),getUrl:function(){var A;return A="https://apis.map.qq.com/uri/v1/routeplan?type=drive&to="+encodeURIComponent(a)+"&tocoord="+encodeURIComponent(e+","+t)+"&referer=APP",A}},{title:this.localize("map.title.google"),getUrl:function(){var A;return A="https://www.google.com/maps/?daddr="+encodeURIComponent(a)+"&sll="+encodeURIComponent(e+","+t),A}}],r=[{title:this.localize("map.title.amap"),pname:"com.autonavi.minimap",action:o?"iosamap://":"amapuri://",getUrl:function(){var A;return o?A="iosamap://path":A="amapuri://route/plan/",A+="?sourceApplication=APP&dname="+encodeURIComponent(a)+"&dlat="+e+"&dlon="+t+"&dev=0",A}},{title:this.localize("map.title.baidu"),pname:"com.baidu.BaiduMap",action:"baidumap://",getUrl:function(){var A="baidumap://map/direction?destination="+encodeURIComponent("latlng:"+e+","+t+"|name:"+a)+"&mode=driving&src=APP&coord_type=gcj02";return A}},{title:this.localize("map.title.tencent"),pname:"com.tencent.map",action:"qqmap://",getUrl:()=>{var A;return A="qqmap://map/routeplan?type=drive"+(o?"&from="+encodeURIComponent(this.localize("location.title")):"")+"&to="+encodeURIComponent(a)+"&tocoord="+encodeURIComponent(e+","+t)+"&referer=APP",A}},{title:this.localize("map.title.google"),pname:"com.google.android.apps.maps",action:"comgooglemapsurl://",getUrl:function(){var A;return o?A="comgooglemapsurl://maps.google.com/":A="https://www.google.com/maps/",A+="?daddr="+encodeURIComponent(a)+"&sll="+encodeURIComponent(e+","+t),A}}],l=[];r.forEach(function(A){var g=plus.runtime.isApplicationExist({pname:A.pname,action:A.action});g&&l.push(A)}),o&&l.unshift({title:this.localize("map.title.apple"),navigateTo:function(){n.openSystemMapNavigation({longitude:t,latitude:e,name:a})}}),l.length===0&&(l=l.concat(s)),plus.nativeUI.actionSheet({cancel:this.localize("select.cancel"),buttons:l},function(A){var g=A.index,c;g>0&&(c=l[g-1],c.navigateTo?c.navigateTo():plus.runtime.openURL(c.getUrl(),function(){},c.pname))})}}};function R(e,t,a,o,n,s){return(0,i.openBlock)(),(0,i.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,i.createElementVNode)("view",{class:"page flex-c"},[(0,i.createElementVNode)("map",{class:"flex-fill map",ref:"map1",longitude:n.longitude,latitude:n.latitude,markers:n.markers},null,8,["longitude","latitude","markers"]),(0,i.createElementVNode)("view",{class:"flex-r a-i-c target"},[(0,i.createElementVNode)("view",{class:"text-area"},[(0,i.createElementVNode)("u-text",{class:"name"},(0,i.toDisplayString)(n.name),1),(0,i.createElementVNode)("u-text",{class:"address"},(0,i.toDisplayString)(n.address),1)]),(0,i.createElementVNode)("view",{class:"goto-area",onClick:t[0]||(t[0]=(...r)=>s.goto&&s.goto(...r))},[(0,i.createElementVNode)("u-image",{class:"goto-icon",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIEAYAAAD9yHLdAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAADzVJREFUeNrt3WmMFMUfxvGqRREjEhXxIAooUQTFGPGIeLAcshoxRhM1Eu+YjZGIJh4vTIzHC1GJiiCeiUckEkWDVzxQxHgRvNB4LYiigshyxFXYg4Bb/xfPv1YbFpjtnZmq7v5+3vxSs8vOr4vpfqZ6pmeMAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMKwoRtAtjnnnHN77KHR2LGqhx327y8YZ9zSpcYaa+z8+dZaa21LS+i+AQCBKDgmTVJdv96VZN06/+9C9w8AqBId+K1Vfeih0gJjZ/zfsayEASBvksExbVp5gmNrjz5KkABATlQnOAgSAMiNMMFBkABAZsURHAQJAGRGnMFBkABAtLIRHAQJAEQjm8FBkABAMPkIDoIEAKomn8FBkABAxRQjOAgSACibYgYHQQIA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JEgCBC8+eH7gDAzhEgiNCiRaE7ALBzBAgi0tam10CWLAndCYCdI0AQB2eccd9+qyvO/UeXAIgZAYI4WGON9V9NCyALCBBExF95DiALCBDEwRlnHAECZAkBgjhYY41dvz50GwBKR4AgIi0toTsAUDoCBHFwxhnX2hq6DQClI0BQgk2bKn4X1lhj//479JYCKB0BghL8+mtl/77/uPZffgm9pQCAMnPOOec+/9yVW7trd+2ffRZ6+wAAFaID/dlnlz1AnHPOnXVW6O0DAFSYDvhTppRn5XHXXaG3BwBQZUqBK65QbWwsLTVWr1a9/PLQ/QPoPhu6AWSbAqFXL43GjFEdMiT5Ww0NqgsW6Iui2tpC9w0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAyK7/ATO6t9N2I5PTAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTAzLTAxVDExOjQ1OjU1KzA4OjAw5vcxUwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wMy0wMVQxMTo0NTo1NSswODowMJeqie8AAABSdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uX2lnaGV6d2JubWhiL25hdmlnYXRpb25fbGluZS5zdmc29Ka/AAAAAElFTkSuQmCC"})])])])])}var p=f(z,[["render",R],["styles",[x]]]);var u=plus.webview.currentWebview();if(u){let e=parseInt(u.id),t="template/__uniappopenlocation",a={};try{a=JSON.parse(u.__query__)}catch(n){}p.mpType="page";let o=Vue.createPageApp(p,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:a});o.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...p.styles||[]])),o.mount("#root")}})();
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var T=Object.create;var y=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var L=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of M(t))!D.call(e,s)&&s!==a&&y(e,s,{get:()=>t[s],enumerable:!(r=x(t,s))||r.enumerable});return e};var V=(e,t,a)=>(a=e!=null?T(C(e)):{},L(t||!e||!e.__esModule?y(a,"default",{value:e,enumerable:!0}):a,e));var A=I((J,v)=>{v.exports=Vue});var _={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let t={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},a=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),r=a[1];r&&(a[1]=t[r]||r),a.length=a.length>2?2:a.length,this.locale=a.join("-")},localize(e){let t=this.locale,a=t.split("-")[0],r=this.fallbackLocale,s=n=>Object.assign({},this.localization[n],(this.localizationTemplate||{})[n]);return s("messages")[e]||s(t)[e]||s(a)[e]||s(r)[e]||e}}},b={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:t,runtime:a,data:r={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=a,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(r)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let n=this,c=function(o){let u=o.data&&o.data.__message;!u||n.__onMessageCallback&&n.__onMessageCallback(u.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",c);else{let o=new BroadcastChannel(this.__page);o.onmessage=c}},postMessage(e={},t=!1){let a=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:t}})),r=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(a,r):new BroadcastChannel(r).postMessage(a);else{let s=plus.webview.getWebviewById(r);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:a})})`)}},onMessage(e){this.__onMessageCallback=e}}};var i=V(A());var d=(e,t)=>{let a=e.__vccOpts||e;for(let[r,s]of t)a[r]=s;return a};var f=e=>e>9?e:"0"+e;function E({date:e=new Date,mode:t="date"}){return t==="time"?f(e.getHours())+":"+f(e.getMinutes()):e.getFullYear()+"-"+f(e.getMonth()+1)+"-"+f(e.getDate())}var O={data(){return{safeAreaInsets:{left:0,right:0,top:0,bottom:0}}},onLoad(){this.initSafeAreaInsets()},created(){this.initSafeAreaInsets()},methods:{initSafeAreaInsets(){if(this.__initSafeAreaInsets)return;this.__initSafeAreaInsets=!0;let e=plus.webview.currentWebview();e.addEventListener("resize",()=>{setTimeout(()=>{this.updateSafeAreaInsets(e)},20)}),this.updateSafeAreaInsets(e)},updateSafeAreaInsets(e){let t=e.getSafeAreaInsets(),a=this.safeAreaInsets;Object.keys(a).forEach(r=>{a[r]=t[r]})}}},N={content:{"":{position:"absolute",top:0,left:0,bottom:0,right:0}},"uni-mask":{"":{position:"absolute",top:0,left:0,bottom:0,right:0,backgroundColor:"rgba(0,0,0,0.4)",opacity:0,transitionProperty:"opacity",transitionDuration:200,transitionTimingFunction:"linear"}},"uni-mask-android":{"":{backgroundColor:"rgba(0,0,0,0.6)"}},"uni-mask-visible":{"":{opacity:1}},"uni-picker":{"":{position:"absolute",left:0,bottom:0,right:0,backgroundColor:"#ffffff",color:"#000000",flexDirection:"column",transform:"translateY(295px)"}},"uni-picker-header":{"":{height:45,borderBottomWidth:0,backgroundColor:"#E6E6E6",fontSize:20}},"uni-picker-action":{"":{position:"absolute",textAlign:"center",top:0,height:45,paddingTop:0,paddingRight:14,paddingBottom:0,paddingLeft:14,fontSize:17,lineHeight:45}},"uni-picker-action-cancel":{"":{left:0,color:"#888888"}},"uni-picker-action-confirm":{"":{right:0,color:"#007aff"}},"uni-picker-content":{"":{flex:1}},"uni-picker-item":{"":{lineHeight:34,textAlign:"center",color:"#000000"}},"@TRANSITION":{"uni-mask":{property:"opacity",duration:200,timingFunction:"linear"}}};function k(){if(this.mode===l.TIME)return"00:00";if(this.mode===l.DATE){let e=new Date().getFullYear()-61;switch(this.fields){case h.YEAR:return e;case h.MONTH:return e+"-01";default:return e+"-01-01"}}return""}function w(){if(this.mode===l.TIME)return"23:59";if(this.mode===l.DATE){let e=new Date().getFullYear()+61;switch(this.fields){case h.YEAR:return e;case h.MONTH:return e+"-12";default:return e+"-12-31"}}return""}var S=weex.requireModule("animation"),l={SELECTOR:"selector",MULTISELECTOR:"multiSelector",TIME:"time",DATE:"date",REGION:"region"},h={YEAR:"year",MONTH:"month",DAY:"day"},z={name:"Picker",mixins:[_,O],props:{pageId:{type:Number,default:0},range:{type:Array,default(){return[]}},rangeKey:{type:String,default:""},value:{type:[Number,String,Array],default:0},mode:{type:String,default:l.SELECTOR},fields:{type:String,default:h.DAY},start:{type:String,default:k},end:{type:String,default:w},disabled:{type:[Boolean,String],default:!1},visible:{type:Boolean,default:!1}},data(){return{valueSync:null,timeArray:[],dateArray:[],valueArray:[],oldValueArray:[],fontSize:16,height:261,android:weex.config.env.platform.toLowerCase()==="android"}},computed:{rangeArray(){var e=this.range;switch(this.mode){case l.SELECTOR:return[e];case l.MULTISELECTOR:return e;case l.TIME:return this.timeArray;case l.DATE:{let t=this.dateArray;switch(this.fields){case h.YEAR:return[t[0]];case h.MONTH:return[t[0],t[1]];default:return[t[0],t[1],t[2]]}}}return[]},startArray(){return this._getDateValueArray(this.start,k.bind(this)())},endArray(){return this._getDateValueArray(this.end,w.bind(this)())},textMaxLength(){return Math.floor(Math.min(weex.config.env.deviceWidth,weex.config.env.deviceHeight)/(this.fontSize*weex.config.env.scale+1)/this.rangeArray.length)}},watch:{value(){this._setValueSync()},mode(){this._setValueSync()},range(){this._setValueSync()},valueSync(){this._setValueArray()},valueArray(e){if(this.mode===l.TIME||this.mode===l.DATE){let t=this.mode===l.TIME?this._getTimeValue:this._getDateValue,a=this.valueArray,r=this.startArray,s=this.endArray;if(this.mode===l.DATE){let n=this.dateArray,c=n[2].length,o=Number(n[2][a[2]])||1,u=new Date(`${n[0][a[0]]}/${n[1][a[1]]}/${o}`).getDate();u<o&&(a[2]-=u+c-o)}t(a)<t(r)?this._cloneArray(a,r):t(a)>t(s)&&this._cloneArray(a,s)}e.forEach((t,a)=>{t!==this.oldValueArray[a]&&(this.oldValueArray[a]=t,this.mode===l.MULTISELECTOR&&this.$emit("columnchange",{column:a,value:t}))})},visible(e){e?setTimeout(()=>{S.transition(this.$refs.picker,{styles:{transform:"translateY(0)"},duration:200})},20):S.transition(this.$refs.picker,{styles:{transform:`translateY(${283+this.safeAreaInsets.bottom}px)`},duration:200})}},created(){this._createTime(),this._createDate(),this._setValueSync()},methods:{getTexts(e,t){let a=this.textMaxLength;return e.map(r=>{let s=String(typeof r=="object"?r[this.rangeKey]||"":this._l10nItem(r,t));if(a>0&&s.length>a){let n=0,c=0;for(let o=0;o<s.length;o++){let u=s.charCodeAt(o);if(u>127||u===94?n+=1:n+=.65,n<=a-1&&(c=o),n>=a)return o===s.length-1?s:s.substr(0,c+1)+"\u2026"}}return s||" "}).join(`
`)},_createTime(){var e=[],t=[];e.splice(0,e.length);for(let a=0;a<24;a++)e.push((a<10?"0":"")+a);t.splice(0,t.length);for(let a=0;a<60;a++)t.push((a<10?"0":"")+a);this.timeArray.push(e,t)},_createDate(){var e=[],t=new Date().getFullYear();for(let s=t-61,n=t+61;s<=n;s++)e.push(String(s));var a=[];for(let s=1;s<=12;s++)a.push((s<10?"0":"")+s);var r=[];for(let s=1;s<=31;s++)r.push((s<10?"0":"")+s);this.dateArray.push(e,a,r)},_getTimeValue(e){return e[0]*60+e[1]},_getDateValue(e){return e[0]*31*12+(e[1]||0)*31+(e[2]||0)},_cloneArray(e,t){for(let a=0;a<e.length&&a<t.length;a++)e[a]=t[a]},_setValueSync(){let e=this.value;switch(this.mode){case l.MULTISELECTOR:Array.isArray(e)||(e=[]),Array.isArray(this.valueSync)||(this.valueSync=[]);let t=this.valueSync.length=Math.max(e.length,this.range.length);for(let a=0;a<t;a++){let r=Number(e[a]),s=Number(this.valueSync[a]),n=isNaN(r)?isNaN(s)?0:s:r,c=this.range[a]?this.range[a].length-1:0;this.valueSync.splice(a,1,n<0||n>c?0:n)}break;case l.TIME:case l.DATE:this.valueSync=String(e);break;default:{let a=Number(e);this.valueSync=a<0?0:a;break}}},_setValueArray(){var e=this.valueSync,t;switch(this.mode){case l.MULTISELECTOR:t=[...e];break;case l.TIME:t=this._getDateValueArray(e,E({mode:l.TIME}));break;case l.DATE:t=this._getDateValueArray(e,E({mode:l.DATE}));break;default:t=[e];break}this.oldValueArray=[...t],this.valueArray=[...t]},_getValue(){var e=this.valueArray;switch(this.mode){case l.SELECTOR:return e[0];case l.MULTISELECTOR:return e.map(t=>t);case l.TIME:return this.valueArray.map((t,a)=>this.timeArray[a][t]).join(":");case l.DATE:return this.valueArray.map((t,a)=>this.dateArray[a][t]).join("-")}},_getDateValueArray(e,t){let a=this.mode===l.DATE?"-":":",r=this.mode===l.DATE?this.dateArray:this.timeArray,s=3;switch(this.fields){case h.YEAR:s=1;break;case h.MONTH:s=2;break}let n=String(e).split(a),c=[];for(let o=0;o<s;o++){let u=n[o];c.push(r[o].indexOf(u))}return c.indexOf(-1)>=0&&(c=t?this._getDateValueArray(t):c.map(()=>0)),c},_change(){this.$emit("change",{value:this._getValue()})},_cancel(){this.$emit("cancel")},_pickerViewChange(e){this.valueArray=this._l10nColumn(e.detail.value,!0)},_l10nColumn(e,t){if(this.mode===l.DATE){let a=this.locale;if(!a.startsWith("zh"))switch(this.fields){case h.YEAR:return e;case h.MONTH:return[e[1],e[0]];default:switch(a){case"es":case"fr":return[e[2],e[1],e[0]];default:return t?[e[2],e[0],e[1]]:[e[1],e[2],e[0]]}}}return e},_l10nItem(e,t){if(this.mode===l.DATE){let a=this.locale;if(a.startsWith("zh"))return e+["\u5E74","\u6708","\u65E5"][t];if(this.fields!==h.YEAR&&t===(this.fields!==h.MONTH&&(a==="es"||a==="fr")?1:0)){let r;switch(a){case"es":r=["enero","febrero","marzo","abril","mayo","junio","\u200B\u200Bjulio","agosto","septiembre","octubre","noviembre","diciembre"];break;case"fr":r=["janvier","f\xE9vrier","mars","avril","mai","juin","juillet","ao\xFBt","septembre","octobre","novembre","d\xE9cembre"];break;default:r=["January","February","March","April","May","June","July","August","September","October","November","December"];break}return r[Number(e)-1]}}return e}}};function R(e,t,a,r,s,n){let c=(0,i.resolveComponent)("picker-view-column"),o=(0,i.resolveComponent)("picker-view");return(0,i.openBlock)(),(0,i.createElementBlock)("div",{class:"content"},[(0,i.createElementVNode)("div",{ref:"mask",class:"uni-mask",style:(0,i.normalizeStyle)({opacity:a.visible?1:0,"background-color":s.android?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.4)"}),onClick:t[0]||(t[0]=(...u)=>n._cancel&&n._cancel(...u))},null,4),(0,i.createElementVNode)("div",{style:(0,i.normalizeStyle)(`padding-bottom:${e.safeAreaInsets.bottom}px;height:${s.height+e.safeAreaInsets.bottom}px;`),ref:"picker",class:"uni-picker"},[(0,i.createElementVNode)("div",{class:"uni-picker-header"},[(0,i.createElementVNode)("u-text",{style:(0,i.normalizeStyle)(`left:${e.safeAreaInsets.left}px`),class:"uni-picker-action uni-picker-action-cancel",onClick:t[1]||(t[1]=(...u)=>n._cancel&&n._cancel(...u))},(0,i.toDisplayString)(e.localize("cancel")),5),(0,i.createElementVNode)("u-text",{style:(0,i.normalizeStyle)(`right:${e.safeAreaInsets.right}px`),class:"uni-picker-action uni-picker-action-confirm",onClick:t[2]||(t[2]=(...u)=>n._change&&n._change(...u))},(0,i.toDisplayString)(e.localize("done")),5)]),a.visible?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,style:(0,i.normalizeStyle)(`margin-left:${e.safeAreaInsets.left}px`),height:"216","indicator-style":"height: 34px;border-color:#C8C9C9;border-top-width:0.5px;border-bottom-width:0.5px;",value:n._l10nColumn(s.valueArray),class:"uni-picker-content",onChange:n._pickerViewChange},{default:(0,i.withCtx)(()=>[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(n._l10nColumn(n.rangeArray),(u,p)=>((0,i.openBlock)(),(0,i.createBlock)(c,{length:u.length,key:p},{default:(0,i.withCtx)(()=>[(0,i.createCommentVNode)(" iOS\u6E32\u67D3\u901F\u5EA6\u6709\u95EE\u9898\u4F7F\u7528\u5355\u4E2Atext\u4F18\u5316 "),(0,i.createElementVNode)("u-text",{class:"uni-picker-item",style:(0,i.normalizeStyle)({fontSize:s.fontSize+"px","line-height":"34px","text-align":"center",color:"#000"})},(0,i.toDisplayString)(n.getTexts(u,p)),5),(0,i.createCommentVNode)(` <text v-for="(item,index) in range" :key="index" class="uni-picker-item uni-picker-item-line" :style="{fontSize: fontSize + 'px'}">{{ typeof item==='object'?item[rangeKey]||'':_l10nItem(item) }}</text> `)]),_:2},1032,["length"]))),128))]),_:1},8,["style","value","onChange"])):(0,i.createCommentVNode)("v-if",!0)],4)])}var Y=d(z,[["render",R],["styles",[N]]]),B={page:{"":{flex:1}}},j={mixins:[b],components:{picker:Y},data(){return{range:[],rangeKey:"",value:0,mode:"selector",fields:"day",start:"",end:"",disabled:!1,visible:!1}},onLoad(){this.data===null?this.postMessage({event:"created"},!0):this.showPicker(this.data),this.onMessage(e=>{this.showPicker(e)})},onReady(){this.$nextTick(()=>{this.visible=!0})},methods:{showPicker(e={}){let t=e.column;for(let a in e)a!=="column"&&(typeof t=="number"?this.$set(this.$data[a],t,e[a]):this.$data[a]=e[a])},close(e,{value:t=-1}={}){this.visible=!1,setTimeout(()=>{this.postMessage({event:e,value:t})},210)},onClose(){this.close("cancel")},columnchange({column:e,value:t}){this.$set(this.value,e,t),this.postMessage({event:"columnchange",column:e,value:t},!0)}}};function F(e,t,a,r,s,n){let c=(0,i.resolveComponent)("picker");return(0,i.openBlock)(),(0,i.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,i.createElementVNode)("view",{class:"page"},[(0,i.createVNode)(c,{range:s.range,rangeKey:s.rangeKey,value:s.value,mode:s.mode,fields:s.fields,start:s.start,end:s.end,disabled:s.disabled,visible:s.visible,onChange:t[0]||(t[0]=o=>n.close("change",o)),onCancel:t[1]||(t[1]=o=>n.close("cancel",o)),onColumnchange:n.columnchange},null,8,["range","rangeKey","value","mode","fields","start","end","disabled","visible","onColumnchange"])])])}var g=d(j,[["render",F],["styles",[B]]]);var m=plus.webview.currentWebview();if(m){let e=parseInt(m.id),t="template/__uniapppicker",a={};try{a=JSON.parse(m.__query__)}catch(s){}g.mpType="page";let r=Vue.createPageApp(g,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:t,__pageQuery:a});r.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...g.styles||[]])),r.mount("#root")}})();
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
"use weex:vue";
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
const promise = this.constructor
return this.then(
value => promise.resolve(callback()).then(() => value),
reason => promise.resolve(callback()).then(() => {
throw reason
})
)
}
};
if (typeof uni !== 'undefined' && uni && uni.requireGlobal) {
const global = uni.requireGlobal()
ArrayBuffer = global.ArrayBuffer
Int8Array = global.Int8Array
Uint8Array = global.Uint8Array
Uint8ClampedArray = global.Uint8ClampedArray
Int16Array = global.Int16Array
Uint16Array = global.Uint16Array
Int32Array = global.Int32Array
Uint32Array = global.Uint32Array
Float32Array = global.Float32Array
Float64Array = global.Float64Array
BigInt64Array = global.BigInt64Array
BigUint64Array = global.BigUint64Array
};
(()=>{var w=Object.create;var g=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var k=(e,a)=>()=>(a||e((a={exports:{}}).exports,a),a.exports);var M=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of S(a))!B.call(e,s)&&s!==t&&g(e,s,{get:()=>a[s],enumerable:!(n=y(a,s))||n.enumerable});return e};var N=(e,a,t)=>(t=e!=null?w(O(e)):{},M(a||!e||!e.__esModule?g(t,"default",{value:e,enumerable:!0}):t,e));var D=k((x,_)=>{_.exports=Vue});var I=Object.prototype.toString,p=e=>I.call(e),d=e=>p(e).slice(8,-1);function T(){return typeof __channelId__=="string"&&__channelId__}function v(e,a){switch(d(a)){case"Function":return"function() { [native code] }";default:return a}}function F(e,a,t){return T()?(t.push(a.replace("at ","uni-app:///")),console[e].apply(console,t)):t.map(function(s){let i=p(s).toLowerCase();if(["[object object]","[object array]","[object module]"].indexOf(i)!==-1)try{s="---BEGIN:JSON---"+JSON.stringify(s,v)+"---END:JSON---"}catch(l){s=i}else if(s===null)s="---NULL---";else if(s===void 0)s="---UNDEFINED---";else{let l=d(s).toUpperCase();l==="NUMBER"||l==="BOOLEAN"?s="---BEGIN:"+l+"---"+s+"---END:"+l+"---":s=String(s)}return s}).join("---COMMA---")+" "+a}function m(e,a,...t){let n=F(e,a,t);n&&console[e](n)}var b=(e,a)=>{let t=e.__vccOpts||e;for(let[n,s]of a)t[n]=s;return t};var C={data(){return{locale:"en",fallbackLocale:"en",localization:{en:{done:"OK",cancel:"Cancel"},zh:{done:"\u5B8C\u6210",cancel:"\u53D6\u6D88"},"zh-hans":{},"zh-hant":{},messages:{}},localizationTemplate:{}}},onLoad(){this.initLocale()},created(){this.initLocale()},methods:{initLocale(){if(this.__initLocale)return;this.__initLocale=!0;let e=(plus.webview.currentWebview().extras||{}).data||{};if(e.messages&&(this.localization.messages=e.messages),e.locale){this.locale=e.locale.toLowerCase();return}let a={chs:"hans",cn:"hans",sg:"hans",cht:"hant",tw:"hant",hk:"hant",mo:"hant"},t=plus.os.language.toLowerCase().split("/")[0].replace("_","-").split("-"),n=t[1];n&&(t[1]=a[n]||n),t.length=t.length>2?2:t.length,this.locale=t.join("-")},localize(e){let a=this.locale,t=a.split("-")[0],n=this.fallbackLocale,s=i=>{let l=Object.assign({},this.localization[i],(this.localizationTemplate||{})[i]);return m("log","at mixins/i18n.js:78","********** o :>> ",l),l};return s("messages")[e]||s(a)[e]||s(t)[e]||s(n)[e]||e}}},E={onLoad(){this.initMessage()},methods:{initMessage(){let{from:e,callback:a,runtime:t,data:n={},useGlobalEvent:s}=plus.webview.currentWebview().extras||{};this.__from=e,this.__runtime=t,this.__page=plus.webview.currentWebview().id,this.__useGlobalEvent=s,this.data=JSON.parse(JSON.stringify(n)),plus.key.addEventListener("backbutton",()=>{typeof this.onClose=="function"?this.onClose():plus.webview.currentWebview().close("auto")});let i=this,l=function(c){let h=c.data&&c.data.__message;!h||i.__onMessageCallback&&i.__onMessageCallback(h.data)};if(this.__useGlobalEvent)weex.requireModule("globalEvent").addEventListener("plusMessage",l);else{let c=new BroadcastChannel(this.__page);c.onmessage=l}},postMessage(e={},a=!1){let t=JSON.parse(JSON.stringify({__message:{__page:this.__page,data:e,keep:a}})),n=this.__from;if(this.__runtime==="v8")this.__useGlobalEvent?plus.webview.postMessageToUniNView(t,n):new BroadcastChannel(n).postMessage(t);else{let s=plus.webview.getWebviewById(n);s&&s.evalJS(`__plusMessage&&__plusMessage(${JSON.stringify({data:t})})`)}},onMessage(e){this.__onMessageCallback=e}}};var r=N(D());var R={content:{"":{flex:1,alignItems:"center",justifyContent:"center",backgroundColor:"#000000"}},barcode:{"":{position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:1}},"set-flash":{"":{alignItems:"center",justifyContent:"center",transform:"translateY(80px)",zIndex:2}},"image-flash":{"":{width:26,height:26,marginBottom:2}},"image-flash-text":{"":{fontSize:10,color:"#FFFFFF"}}},o=plus.barcode,A={qrCode:[o.QR,o.AZTEC,o.MAXICODE],barCode:[o.EAN13,o.EAN8,o.UPCA,o.UPCE,o.CODABAR,o.CODE128,o.CODE39,o.CODE93,o.ITF,o.RSS14,o.RSSEXPANDED],datamatrix:[o.DATAMATRIX],pdf417:[o.PDF417]},L={[o.QR]:"QR_CODE",[o.EAN13]:"EAN_13",[o.EAN8]:"EAN_8",[o.DATAMATRIX]:"DATA_MATRIX",[o.UPCA]:"UPC_A",[o.UPCE]:"UPC_E",[o.CODABAR]:"CODABAR",[o.CODE39]:"CODE_39",[o.CODE93]:"CODE_93",[o.CODE128]:"CODE_128",[o.ITF]:"CODE_25",[o.PDF417]:"PDF_417",[o.AZTEC]:"AZTEC",[o.RSS14]:"RSS_14",[o.RSSEXPANDED]:"RSSEXPANDED"},P={mixins:[E,C],data:{filters:[0,2,1],backgroud:"#000000",frameColor:"#118ce9",scanbarColor:"#118ce9",enabledFlash:!1,flashImage0:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAABjklEQVRoQ+1ZbVHEQAx9TwE4ABTcOQAknANQAKcAUAAOAAXgAHAACsDCKQiTmbYDzJZtNt2bFrJ/m6+Xl2yyU2LmhzOPH/8PgIjcADirxNyapNoffMwMiMgzgMPBHmyCLySPLCoBwJKtAbJbYaBmD1yRvBwAtBMxl5DF+DZkiwCIyBLAzsgBbki+Wm2WAlCaL6zOMvKnJO+sNksB7ALQbO1ZHfbIv5FUVs2nCIB6EZETALdmj2mFY5I6X8ynGEADQllYmL1+VzBfnV/VvQB0aj45ARyQ/Ci14QLQsOBZLe5JaikWnzEA7AN4L4hgA2Dpyb76dANwsOCq/TZhASAYKGie0a7R1lDPI0ebtF0NUi+4yfdAtxr3PEMnD6BbD0QkNfACQO05EAwMuaBqDrIVycdmTpwDuP4R0OR7QFftVRP0g+49cwOQq4DJMxAAchmofY3m/EcJBQOZbTRKKJeBKKEoIePvpFRJ1VzmciUccyCa+C81cerBkuuB7sGTE/zt+yhN7AnAqxsAvBn06n8CkyPwMZKwm+UAAAAASUVORK5CYII=",flashImage1:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEUAAAA3kvI3lfY2k/VAl+43k/U3k/Q4k/M3kvI3k/M4k/Q4lPU2lPU2k/Vdq843k/WWSpNKAAAAD3RSTlMAwD+QINCAcPBgUDDgoBAE044kAAAAdklEQVQ4y2OgOrD/DwffUSTkERIfyZXAtOMbca7iVoKDDSgSbAijJqBI8J2HiX9FM2s+TOITmgQrTEIATYIJJuEA5mJ68S+Gg/0hEi0YEoxQK2gs0WyPQyKBGYeEAhPtJRaw45AIccXpwVEJekuwQyQWMFAfAACeDBJY9aXa3QAAAABJRU5ErkJggg==",autoDecodeCharSet:!1,autoZoom:!0,localizationTemplate:{en:{fail:"Recognition failure","flash.on":"Tap to turn light on","flash.off":"Tap to turn light off"},zh:{fail:"\u8BC6\u522B\u5931\u8D25","flash.on":"\u8F7B\u89E6\u7167\u4EAE","flash.off":"\u8F7B\u89E6\u5173\u95ED"}}},onLoad(){let e=this.data,a=e.scanType;this.autoDecodeCharSet=e.autoDecodeCharSet,this.autoZoom=e.autoZoom;let t=[];Array.isArray(a)&&a.length&&a.forEach(n=>{let s=A[n];s&&(t=t.concat(s))}),t.length||(t=t.concat(A.qrCode).concat(A.barCode).concat(A.datamatrix).concat(A.pdf417)),this.filters=t,this.onMessage(n=>{this.gallery()})},onUnload(){this.cancel()},onReady(){setTimeout(()=>{this.cancel(),this.start()},50)},methods:{start(){this.$refs.barcode.start({sound:this.data.sound})},scan(e){o.scan(e,(a,t,n,s)=>{this.scanSuccess(a,t,n,s)},()=>{plus.nativeUI.toast(this.localize("fail"))},this.filters,this.autoDecodeCharSet)},cancel(){this.$refs.barcode.cancel()},gallery(){plus.gallery.pick(e=>{this.scan(e)},e=>{e.code!==(weex.config.env.platform.toLowerCase()==="android"?12:-2)&&plus.nativeUI.toast(this.localize("fail"))},{multiple:!1,system:!1,filename:"_doc/uniapp_temp/gallery/",permissionAlert:!0})},onmarked(e){var a=e.detail;this.scanSuccess(a.code,a.message,a.file,a.charSet)},scanSuccess(e,a,t,n){this.postMessage({event:"marked",detail:{scanType:L[e],result:a,charSet:n||"utf8",path:t||""}})},onerror(e){this.postMessage({event:"fail",message:JSON.stringify(e)})},setFlash(){this.enabledFlash=!this.enabledFlash,this.$refs.barcode.setFlash(this.enabledFlash)}}};function Q(e,a,t,n,s,i){return(0,r.openBlock)(),(0,r.createElementBlock)("scroll-view",{scrollY:!0,showScrollbar:!0,enableBackToTop:!0,bubble:"true",style:{flexDirection:"column"}},[(0,r.createElementVNode)("view",{class:"content"},[(0,r.createElementVNode)("barcode",{class:"barcode",ref:"barcode",autostart:"false",backgroud:e.backgroud,frameColor:e.frameColor,scanbarColor:e.scanbarColor,filters:e.filters,autoDecodeCharset:e.autoDecodeCharSet,autoZoom:e.autoZoom,onMarked:a[0]||(a[0]=(...l)=>i.onmarked&&i.onmarked(...l)),onError:a[1]||(a[1]=(...l)=>i.onerror&&i.onerror(...l))},null,40,["backgroud","frameColor","scanbarColor","filters","autoDecodeCharset","autoZoom"]),(0,r.createElementVNode)("view",{class:"set-flash",onClick:a[2]||(a[2]=(...l)=>i.setFlash&&i.setFlash(...l))},[(0,r.createElementVNode)("u-image",{class:"image-flash",src:e.enabledFlash?e.flashImage1:e.flashImage0,resize:"stretch"},null,8,["src"]),(0,r.createElementVNode)("u-text",{class:"image-flash-text"},(0,r.toDisplayString)(e.enabledFlash?e.localize("flash.off"):e.localize("flash.on")),1)])])])}var u=b(P,[["render",Q],["styles",[R]]]);var f=plus.webview.currentWebview();if(f){let e=parseInt(f.id),a="template/__uniappscan",t={};try{t=JSON.parse(f.__query__)}catch(s){}u.mpType="page";let n=Vue.createPageApp(u,{$store:getApp({allowDefault:!0}).$store,__pageId:e,__pagePath:a,__pageQuery:t});n.provide("__globalStyles",Vue.useCssStyles([...__uniConfig.styles,...u.styles||[]])),n.mount("#root")}})();
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>View</title>
<link rel="stylesheet" href="app.css" />
<script>var __uniConfig = {"globalStyle":{}}</script>
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
</head>
<body>
<div id="app"></div>
<script src="uni-app-view.umd.js"></script>
</body>
</html>
;(function(){
let u=void 0,isReady=false,onReadyCallbacks=[],isServiceReady=false,onServiceReadyCallbacks=[];
const __uniConfig = {"pages":[],"globalStyle":{"backgroundColor":"#F8F8F8","navigationBar":{"backgroundColor":"#F8F8F8","titleText":"uni-app","type":"default","titleColor":"#000000"},"isNVue":false},"nvue":{"compiler":"uni-app","styleCompiler":"uni-app","flex-direction":"column"},"renderer":"auto","appname":"HelloUTS","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":true},"compilerVersion":"3.5.5","entryPagePath":"pages/tabBar/Primer/Primer","entryPageQuery":"","realEntryPagePath":"","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000},"tabBar":{"position":"bottom","color":"#7A7E83","selectedColor":"#007AFF","borderStyle":"black","blurEffect":"none","fontSize":"10px","iconWidth":"24px","spacing":"3px","height":"50px","backgroundColor":"#F8F8F8","list":[{"pagePath":"pages/tabBar/Primer/Primer","iconPath":"/static/tabbar_easy.png","selectedIconPath":"/static/tabbar_easy_select.png","text":"入门"},{"pagePath":"pages/tabBar/Advance/Advance","iconPath":"/static/tabbar_high.png","selectedIconPath":"/static/tabbar_high_select.png","text":"进阶"},{"pagePath":"pages/tabBar/SystemAPI/SystemAPI","iconPath":"/static/tabbar_api.png","selectedIconPath":"/static/tabbar_api_select.png","text":"系统API"},{"pagePath":"pages/tabBar/SDKIntegration/SDKIntegration","iconPath":"/static/tabbar_sdk.png","selectedIconPath":"/static/tabbar_sdk_select.png","text":"三方SDK"}],"selectedIndex":0,"shown":true},"locales":{}};
const __uniRoutes = [{"path":"pages/tabBar/Primer/Primer","meta":{"isQuit":true,"isEntry":true,"isTabBar":true,"tabBarIndex":0,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/Advance/Advance","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":1,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/SystemAPI/SystemAPI","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":2,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}},{"path":"pages/tabBar/SDKIntegration/SDKIntegration","meta":{"isQuit":true,"isTabBar":true,"tabBarIndex":3,"enablePullDownRefresh":false,"navigationBar":{"titleText":"","type":"default"},"isNVue":false}}].map(uniRoute=>(uniRoute.meta.route=uniRoute.path,__uniConfig.pages.push(uniRoute.path),uniRoute.path='/'+uniRoute.path,uniRoute));
__uniConfig.styles=[];//styles
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:16})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:u,window:u,document:u,frames:u,self:u,location:u,navigator:u,localStorage:u,history:u,Caches:u,screen:u,alert:u,confirm:u,prompt:u,fetch:u,XMLHttpRequest:u,WebSocket:u,webkit:u,print:u}}}});
})();
\ No newline at end of file
(function(){})();
\ No newline at end of file
此差异已折叠。
此差异已折叠。
{
"@platforms": [
"android",
"iPhone",
"iPad"
],
"id": "__UNI__70BE9D0",
"name": "HelloUTS",
"version": {
"name": "1.0.0",
"code": "100"
},
"description": "",
"developer": {
"name": "",
"email": "",
"url": ""
},
"permissions": {
"UniNView": {
"description": "UniNView原生渲染"
}
},
"plus": {
"useragent": {
"value": "uni-app",
"concatenate": true
},
"splashscreen": {
"target": "id:1",
"autoclose": true,
"waiting": true,
"delay": 0
},
"popGesture": "close",
"launchwebview": {
"id": "1",
"kernel": "WKWebview"
},
"statusbar": {
"immersed": "supportedDevice",
"style": "light",
"background": "#F8F8F8"
},
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"distribute": {
"google": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"apple": {},
"plugins": {
"audio": {
"mp3": {
"description": "Android平台录音支持MP3格式文件"
}
}
}
},
"uniStatistics": {
"enable": false
},
"allowsInlineMediaPlayback": true,
"safearea": {
"background": "#F8F8F8",
"bottom": {
"offset": "auto"
}
},
"uni-app": {
"control": "uni-v3",
"vueVersion": "3",
"compilerVersion": "3.5.5",
"nvueCompiler": "uni-app",
"renderer": "auto",
"nvue": {
"flex-direction": "column"
},
"nvueLaunchMode": "normal"
},
"tabBar": {
"position": "bottom",
"color": "#7A7E83",
"selectedColor": "#007AFF",
"borderStyle": "rgba(0,0,0,0.4)",
"blurEffect": "none",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"height": "50px",
"backgroundColor": "#F8F8F8",
"list": [
{
"pagePath": "pages/tabBar/Primer/Primer",
"iconPath": "/static/tabbar_easy.png",
"selectedIconPath": "/static/tabbar_easy_select.png",
"text": "入门"
},
{
"pagePath": "pages/tabBar/Advance/Advance",
"iconPath": "/static/tabbar_high.png",
"selectedIconPath": "/static/tabbar_high_select.png",
"text": "进阶"
},
{
"pagePath": "pages/tabBar/SystemAPI/SystemAPI",
"iconPath": "/static/tabbar_api.png",
"selectedIconPath": "/static/tabbar_api_select.png",
"text": "系统API"
},
{
"pagePath": "pages/tabBar/SDKIntegration/SDKIntegration",
"iconPath": "/static/tabbar_sdk.png",
"selectedIconPath": "/static/tabbar_sdk_select.png",
"text": "三方SDK"
}
],
"selectedIndex": 0,
"shown": true,
"child": [
"lauchwebview"
],
"selected": 0
}
},
"launch_path": "__uniappview.html"
}
\ No newline at end of file
此差异已折叠。
package uts.modules.utsAdvance;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
fun log(msg: String) {
console.log(msg, "at uni_modules/uts-advance/app-android/utils.uts:2");
}
open class AsyncOptions {
open lateinit var type: String;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
val MAX = 100;
fun testSync(msg: String): UtsJSONObject {
console.log("log test", "at uni_modules/uts-advance/app-android/index.uts:18");
log("log test1");
return object : UtsJSONObject() {
var msg = """hello ${msg}"""
};
}
fun testSyncError() {
val arr: MutableList<String> = mutableListOf();
console.log(arr[1], "at uni_modules/uts-advance/app-android/index.uts:29");
}
fun testSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
if (opts.type == "success") opts.success("success");
else opts.fail("fail");
opts.complete("complete");
return object : UtsJSONObject() {
var name = "testSyncWithCallback"
};
}
suspend fun testAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
if (opts.type == "success") opts.success("success");
else opts.fail("fail");
opts.complete("complete");
return@async object : UtsJSONObject() {
var name = "testAsync"
};
}
open class TestOptions {
open lateinit var name: String;
open lateinit var callback: UTSCallback;
}
open class Test {
open var id: Number;
open var name: String;
constructor(id: Number, options: TestOptions){
this.id = id;
this.name = options.name;
options.callback("Test.constructor");
}
open fun testClassSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
open suspend fun testClassAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
val res = testAsync(opts).await();
return@async res;
}
companion object {
var type: String = "Test";
fun testClassStaticSyncWithCallback(opts: AsyncOptions): UtsJSONObject {
return testSyncWithCallback(opts);
}
suspend fun testClassStaticAsync(opts: AsyncOptions): Deferred<UtsJSONObject> = CoroutineScope(Dispatchers.Default).async {
val res = testAsync(opts).await();
return@async res;
}
}
}
{"version":3,"sources":["\\\\?\\D:\\Do\\Source\\hello-uts\\uni_modules\\uts-advance\\app-android\\utils.uts","\\\\?\\D:\\Do\\Source\\hello-uts\\uni_modules\\uts-advance\\app-android\\index.uts"],"sourcesContent":["export function log(msg: string) {\n console.log(msg);\n}\n","import { log } from \"./utils.uts\";\ntype AsyncOptions = {\n type: string;\n success: (res: string) => void;\n fail: (res: string) => void;\n complete: (res: string) => void;\n};\n/**\n * 导出一个属性\n */\nexport const MAX = 100;\n\n/**\n * 导出一个同步方法\n * @returns\n */\nexport function testSync(msg: string) {\n console.log(\"log test\");\n log(\"log test1\");\n return {\n msg: `hello ${msg}`,\n };\n}\n/**\n * 导出一个同步方法(触发了数组越界异常)\n */\nexport function testSyncError() {\n const arr: string[] = [];\n console.log(arr[1]);\n}\n/**\n * 导出一个带callback的同步方法\n * @param opts\n */\nexport function testSyncWithCallback(opts: AsyncOptions) {\n if (opts.type == \"success\") {\n opts.success(\"success\");\n } else {\n opts.fail(\"fail\");\n }\n opts.complete(\"complete\");\n return { name: \"testSyncWithCallback\" };\n}\n/**\n * 导出一个异步方法\n * @returns\n */\nexport async function testAsync(opts: AsyncOptions) {\n if (opts.type == \"success\") {\n opts.success(\"success\");\n } else {\n opts.fail(\"fail\");\n }\n opts.complete(\"complete\");\n return { name: \"testAsync\" };\n}\n\ntype TestOptions = {\n name: string;\n callback: (res: string) => void;\n};\n\nexport class Test {\n id: number;\n name: string;\n static type: string = \"Test\";\n constructor(id: number, options: TestOptions) {\n this.id = id;\n this.name = options.name;\n options.callback(\"Test.constructor\");\n }\n static testClassStaticSyncWithCallback(opts: AsyncOptions): UtsJSONObject {\n return testSyncWithCallback(opts);\n }\n static async testClassStaticAsync(opts: AsyncOptions): Promise<UtsJSONObject> {\n const res = await testAsync(opts);\n return res;\n }\n testClassSyncWithCallback(opts: AsyncOptions): UtsJSONObject {\n return testSyncWithCallback(opts);\n }\n async testClassAsync(opts: AsyncOptions): Promise<UtsJSONObject> {\n const res = await testAsync(opts);\n return res;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAO,IAAS,GAAG,CAAC,GAAW,EAAN,MAAM,EAAE;IAC/B,OAAO,CAAC,GAAG,CAAC,GAAG,uDAAC,CAAC;;ACAC,WAAf,YAAY;IACf,kBAAA,IAAI,EAAE,MAAM,CAAC;IACb,kBAAA,OAAO,EAAA,WAAuB,CAAC;IAC/B,kBAAA,IAAI,EAAA,WAAuB,CAAC;IAC5B,kBAAA,QAAQ,EAAA,WAAuB,CAAC;CACjC,AAAC;AAIK,IAAM,GAAG,GAAG,GAAG,AAAC;AAMhB,IAAS,QAAQ,CAAC,GAAW,EAAN,MAAM,iBAAE;IACpC,OAAO,CAAC,GAAG,CAAC,UAAU,wDAAC,CAAC;IACxB,IAAI,WAAW,CAAC,CAAC;IACjB,OAAO;QACL,IAAA,GAAG,GAAE,GAAC,MAAM,EAAE,GAAG,CAAC,GAAC;KACpB,CAAC;;AAKG,IAAS,aAAa,GAAG;IAC9B,IAAM,GAAG,cAAE,MAAM,IAAK,eAAE,AAAC;IACzB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,wDAAC,CAAC;;AAMf,IAAS,oBAAoB,CAAC,IAAkB,EAAZ,YAAY,iBAAE;IACvD,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,EACxB,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;SAExB,IAAI,CAAC,IAAI,CA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;YACxE,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;;QAEpC,YAAa,oBAAoB,CAAC,IAAkB,EAAZ,YAAY,GAAG,QAAO,CAAC,aAAa,8CAAE;YAC5E,IAAM,GAAG,GAAG,AAAM,SAAS,CAAC,IAAI,CAAC,QAAA,AAAC;YAClC,aAAO,GAAG,CAAC;;;CASd"}
\ No newline at end of file
package uts.modules.utsHelloworld;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
open class NoParamOptions {
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
open class StringParamOptions {
open lateinit var input: String;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
open class inputJSON {
open lateinit var inputText: String;
open lateinit var errCode: Number;
}
open class JsonParamOptions {
open lateinit var input: inputJSON;
open lateinit var success: UTSCallback;
open lateinit var fail: UTSCallback;
open lateinit var complete: UTSCallback;
}
fun callWithoutParam(opts: NoParamOptions): UtsJSONObject {
setTimeout(fun() {
opts.success();
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
fun callWithStringParam(opts: StringParamOptions): UtsJSONObject {
setTimeout(fun() {
opts.success(opts.input);
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
fun callWithJSONParam(opts: JsonParamOptions): UtsJSONObject {
opts.input.errCode = 10;
setTimeout(fun() {
opts.success(opts.input);
}
, 500);
return object : UtsJSONObject() {
var name = "doSthWithCallback"
};
}
{"version":3,"sources":["\\\\?\\D:\\Do\\Source\\hello-uts\\uni_modules\\uts-helloworld\\app-android\\index.uts"],"sourcesContent":["type NoParamOptions = {\n success: (res: string) => void;\n fail: (res: string) => void;\n complete: (res: string) => void;\n};\r\n\r\ntype StringParamOptions = {\r\n input:string;\n success: (res: string) => void;\n fail: (res: string) => void;\n complete: (res: string) => void;\n};\r\n\r\n\r\ntype inputJSON = {\r\n\tinputText:string,\r\n\terrCode:number\r\n}\r\ntype JsonParamOptions = {\r\n input:inputJSON;\n success: (res: string) => void;\n fail: (res: string) => void;\n complete: (res: string) => void;\n};\r\n\r\n\r\n/**\n * 导出一个带callback的同步方法\n * @param opts\n */\nexport function callWithoutParam(opts: NoParamOptions) {\r\n\tsetTimeout(function() {\r\n\t\topts.success();\r\n\t}, 500);\n \n return { name: \"doSthWithCallback\" };\n}\r\n\r\nexport function callWithStringParam(opts: StringParamOptions) {\r\n\tsetTimeout(function() {\r\n\t\topts.success(opts.input);\r\n\t}, 500);\n \n return { name: \"doSthWithCallback\" };\n}\r\n\r\n\r\nexport function callWithJSONParam(opts: JsonParamOptions) {\r\n\topts.input.errCode = 10;\r\n\tsetTimeout(function() {\r\n\t\topts.success(opts.input);\r\n\t}, 500);\n \n return { name: \"doSthWithCallback\" };\n}\r\n\r\n\r\n"],"names":[],"mappings":";;;;;;AAAsB,WAAjB,cAAc;IACjB,kBAAA,OAAO,EAAA,WAAuB,CAAC;IAC/B,kBAAA,IAAI,EAAA,WAAuB,CAAC;IAC5B,kBAAA,QAAQ,EAAA,WAAuB,CAAC;CACjC,AAAC;AAEwB,WAArB,kBAAkB;IACrB,kBAAA,KAAK,EAAC,MAAM,CAAC;IACb,kBAAA,OAAO,EAAA,WAAuB,CAAC;IAC/B,kBAAA,IAAI,EAAA,WAAuB,CAAC;IAC5B,kBAAA,QAAQ,EAAA,WAAuB,CAAC;CACjC,AAAC;AAGe,WAAZ,SAAS;IACb,kBAAA,SAAS,EAAC,MAAM,CAAC;IACjB,kBAAA,OAAO,EAAC,MAAM,CAAA;CACd;AACuB,WAAnB,gBAAgB;IACnB,kBAAA,KAAK,EAAC,SAAS,CAAC;IAChB,kBAAA,OAAO,EAAA,WAAuB,CAAC;IAC/B,kBAAA,IAAI,EAAA,WAAuB,CAAC;IAC5B,kBAAA,QAAQ,EAAA,WAAuB,CAAC;CACjC,AAAC;AAOK,IAAS,gBAAgB,CAAC,IAAoB,EAAd,cAAc,iBAAE;IACtD,UAAU,CAAC,MAAW;QACrB,IAAI,CAAC,OAAO,EAAE,CAAC;;IACf,EAAE,GAAG,CAAC,CAAC;IAEP,OAAO;QAAE,IAAA,IAAI,GAAE,mBAAmB;KAAE,CAAC;;AAGhC,IAAS,mBAAmB,CAAC,IAAwB,EAAlB,kBAAkB,iBAAE;IAC7D,UAAU,CAAC,MAAW;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;IACzB,EAAE,GAAG,CAAC,CAAC;IAEP,OAAO;QAAE,IAAA,IAAI,GAAE,mBAAmB;KAAE,CAAC;;AAIhC,IAAS,iBAAiB,CAAC,IAAsB,EAAhB,gBAAgB,iBAAE;IACzD,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;IACxB,UAAU,CAAC,MAAW;QACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;;IACzB,EAAE,GAAG,CAAC,CAAC;IAEP,OAAO;QAAE,IAAA,IAAI,GAAE,mBAAmB;KAAE,CAAC"}
\ No newline at end of file
package uts.modules.utsOsapi;
import kotlinx.coroutines.async;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import io.dcloud.uts.*;
import android.content.Context;
import android.os.BatteryManager;
import io.dcloud.uts.android.getAppContext;
fun getBatteryCapacity(): String {
val context = getAppContext();
if (context != null) {
val manager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager;
val currentLevel: Number = manager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY);
return "" + currentLevel + "%";
}
return "0%";
}
{"version":3,"sources":["\\\\?\\D:\\Do\\Source\\hello-uts\\uni_modules\\uts-osapi\\app-android\\index.uts"],"sourcesContent":["import Context from \"android.content.Context\";\nimport BatteryManager from \"android.os.BatteryManager\";\nimport { getAppContext } from \"io.dcloud.uts.android\";\n\nexport function getBatteryCapacity(): string {\n const context = getAppContext();\n if (context != null) {\n const manager = context.getSystemService(\n Context.BATTERY_SERVICE\n ) as BatteryManager;\n const currentLevel: number = manager.getIntProperty(\n BatteryManager.BATTERY_PROPERTY_CAPACITY\n );\n return '' + currentLevel + '%';\n }\n return \"0%\";\n}\n"],"names":[],"mappings":";;;;;;AAAA,OAAoB,uBAAyB,CAAC;AAC9C,OAA2B,yBAA2B,CAAC;AACvD;AAEO,IAAS,kBAAkB,IAAI,MAAM,CAAC;IACzC,IAAM,OAAO,GAAG,aAAa,EAAE,AAAC;IAChC,IAAI,OAAO,IAAI,IAAI,EAAE;QACjB,IAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CACpC,OAAO,CAAC,eAAe,CAC1B,IAAI,cAAc,AAAC;QACpB,IAAM,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAC/C,cAAc,CAAC,yBAAyB,CAC3C,AAAC;QACF,OAAO,EAAE,GAAG,YAAY,GAAG,GAAG,CAAC;;IAEnC,OAAO,IAAI,CAAC"}
\ No newline at end of file
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function e(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,(function(){function e(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}function t(e){return!(!e||void 0===e.length)}function n(){}function r(e){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],a(e,this)}function o(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,r._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void u(t.promise,e)}i(t.promise,r)}else(1===e._state?i:u)(t.promise,e._value)}))):e._deferreds.push(t)}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof r)return e._state=3,e._value=t,void c(e);if("function"==typeof n)return void a(function(e,t){return function(){e.apply(t,arguments)}}(n,t),e)}e._state=1,e._value=t,c(e)}catch(t){u(e,t)}}function u(e,t){e._state=2,e._value=t,c(e)}function c(e){2===e._state&&0===e._deferreds.length&&r._immediateFn((function(){e._handled||r._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;n>t;t++)o(e,e._deferreds[t]);e._deferreds=null}function a(e,t){var n=!1;try{e((function(e){n||(n=!0,i(t,e))}),(function(e){n||(n=!0,u(t,e))}))}catch(e){if(n)return;n=!0,u(t,e)}}var s=setTimeout;r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,r)),r},r.prototype.finally=e,r.all=function(e){return new r((function(n,r){function o(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var c=t.then;if("function"==typeof c)return void c.call(t,(function(t){o(e,t)}),r)}i[e]=t,0==--u&&n(i)}catch(e){r(e)}}if(!t(e))return r(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);for(var u=i.length,c=0;i.length>c;c++)o(c,i[c])}))},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r((function(t){t(e)}))},r.reject=function(e){return new r((function(t,n){n(e)}))},r.race=function(e){return new r((function(n,o){if(!t(e))return o(new TypeError("Promise.race accepts an array"));for(var i=0,u=e.length;u>i;i++)r.resolve(e[i]).then(n,o)}))},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){s(e,0)},r._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();"Promise"in l?l.Promise.prototype.finally||(l.Promise.prototype.finally=e):l.Promise=r}));var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function r(){if(!t)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(n)}for(var o=[],i=0;i<256;++i)o[i]=(i+256).toString(16).substr(1);function u(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var u=(e=e||{}).random||(e.rng||r)();if(u[6]=15&u[6]|64,u[8]=63&u[8]|128,t)for(var c=0;c<16;++c)t[i+c]=u[c];return t||function(e,t){var n=t||0,r=o;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(u)}var c=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}},l=/-(\w)/g,f=s((function(e){return e.replace(l,(function(e,t){return t?t.toUpperCase():""}))})),d=s((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),p=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;function m(e,t){if(a(e))return e;if(t&&(n=t,r=e,c.call(n,r)))return[e];var n,r,o=[];return e.replace(p,(function(e,t,n,r){return o.push(n?r.replace(/\\(\\)?/g,"$1"):t||e),r})),o}function v(e,t){var n,r=m(t,e);for(n=r.shift();null!=n;){if(null==(e=e[n]))return;n=r.shift()}return e}var h=new Map;function g(e){if(!function(e){if(e){var t=e.tagName;return 0===t.indexOf("UNI-")||"BODY"===t}return!1}(e))throw Error("no such element");var t,n,r={elementId:(t=e,n=t._id,n||(n=u(),t._id=n,h.set(n,{id:n,element:t})),n),tagName:e.tagName.toLocaleLowerCase().replace("uni-","")},o=e.__vue__;return o&&(o.$parent&&o.$parent.$el===e&&(o=o.$parent),o&&!o.$options.isReserved&&(r.nodeId=function(e){if(e._$weex)return e._uid;if(e._$id)return e._$id;var t=function(e){for(var t=e.$parent;t;){if(t._$id)return t;t=t.$parent}}(e);if(!e.$parent)return"-1";var n=e.$vnode,r=n.context;return r&&r!==t&&r._$id?r._$id+";"+t._$id+","+n.data.attrs._i:t._$id+","+n.data.attrs._i}(o))),"video"===r.tagName&&(r.videoId=r.nodeId),r}var _={input:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},textarea:{input:function(e,t){var n=e.__vue__;n.valueSync=t,n.$triggerInput({},{value:t})}},"scroll-view":{scrollTo:function(e,t,n){var r=e.__vue__.$refs.main;r.scrollLeft=t,r.scrollTop=n},scrollTop:function(e){return e.__vue__.$refs.main.scrollTop},scrollLeft:function(e){return e.__vue__.$refs.main.scrollLeft},scrollWidth:function(e){return e.__vue__.$refs.main.scrollWidth},scrollHeight:function(e){return e.__vue__.$refs.main.scrollHeight}},swiper:{swipeTo:function(e,t){e.__vue__.current=t}},"movable-view":{moveTo:function(e,t,n){e.__vue__._animationTo(t,n)}},switch:{tap:function(e){e.click()}},slider:{slideTo:function(e,t){var n=e.__vue__,r=n.$refs["uni-slider"],o=r.offsetWidth,i=r.getBoundingClientRect().left;n.value=t,n._onClick({x:(t-n.min)*o/(n.max-n.min)+i})}}},y={getWindow:function(e){return window},getDocument:function(e){return document},getEl:function(e){var t=h.get(e);if(!t)throw Error("element destroyed");return t.element},getOffset:function(e){var t=e.getBoundingClientRect();return Promise.resolve({left:t.left+window.pageXOffset,top:t.top+window.pageYOffset})},querySelector:function(e,t){return"page"===t&&(t="body"),Promise.resolve(g(e.querySelector(t)))},querySelectorAll:function(e,t){var n=[],r=document.querySelectorAll(t);return[].forEach.call(r,(function(e){try{n.push(g(e))}catch(e){}})),Promise.resolve({elements:n})},queryProperties:function(e,t){return Promise.resolve({properties:t.map((function(t){var n=v(e,t);return"document.documentElement.scrollTop"===t&&0===n&&(n=v(e,"document.body.scrollTop")),n}))})},queryAttributes:function(e,t){return Promise.resolve({attributes:t.map((function(t){return String(e.getAttribute(t))}))})},queryStyles:function(e,t){var n=getComputedStyle(e);return Promise.resolve({styles:t.map((function(e){return n[e]}))})},queryHTML:function(e,t){return Promise.resolve({html:(n="outer"===t?e.outerHTML:e.innerHTML,n.replace(/\n/g,"").replace(/(<uni-text[^>]*>)(<span[^>]*>[^<]*<\/span>)(.*?<\/uni-text>)/g,"$1$3").replace(/<\/?[^>]*>/g,(function(e){return-1<e.indexOf("<body")?"<page>":"</body>"===e?"</page>":0!==e.indexOf("<uni-")&&0!==e.indexOf("</uni-")?"":e.replace(/uni-/g,"").replace(/ role=""/g,"").replace(/ aria-label=""/g,"")})))});var n},dispatchTapEvent:function(e){return e.click(),Promise.resolve()},dispatchLongpressEvent:function(e){return Promise.resolve()},dispatchTouchEvent:function(e,t,n){n||(n={}),n.touches||(n.touches=[]),n.changedTouches||(n.changedTouches=[]),n.touches.length||n.touches.push({identifier:Date.now(),target:e});var r=w(n.touches),o=w(n.changedTouches),i=w([]);return e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,touches:r,targetTouches:i,changedTouches:o})),Promise.resolve()},callFunction:function(t,n,r){var o=v(_,n);return o?Promise.resolve({result:o.apply(null,e([t],r))}):Promise.reject(Error(n+" not exists"))},triggerEvent:function(e,t,n){var r=e.__vue__;return r.$trigger&&r.$trigger(t,{},n),Promise.resolve()}};function w(e){var t,n=e.map((function(e){return function(e){if(document.createTouch)return document.createTouch(window,e.target,e.identifier,e.pageX,e.pageY,e.screenX,e.screenY);return new Touch(e)}(e)}));return document.createTouchList?(t=document).createTouchList.apply(t,n):n}["movable-view","picker","ad","button","checkbox-group","checkbox","form","icon","label","movable-area","navigator","picker-view-column","picker-view","progress","radio-group","radio","rich-text","u-slider","swiper-item","swiper","switch"].map((function(e){return d(f(e))}));var E=Object.assign({},function(e){return{"Page.getElement":function(t){return e.querySelector(e.getDocument(t.pageId),t.selector)},"Page.getElements":function(t){return e.querySelectorAll(e.getDocument(t.pageId),t.selector)},"Page.getWindowProperties":function(t){return e.queryProperties(e.getWindow(t.pageId),t.names)}}}(y),function(e){var t=function(t){return e.getEl(t.elementId,t.pageId)};return{"Element.getElement":function(n){return e.querySelector(t(n),n.selector)},"Element.getElements":function(n){return e.querySelectorAll(t(n),n.selector)},"Element.getDOMProperties":function(n){return e.queryProperties(t(n),n.names)},"Element.getProperties":function(n){var r=t(n),o=r.__vue__||r.attr||{};return e.queryProperties(o,n.names)},"Element.getOffset":function(n){return e.getOffset(t(n))},"Element.getAttributes":function(n){return e.queryAttributes(t(n),n.names)},"Element.getStyles":function(n){return e.queryStyles(t(n),n.names)},"Element.getHTML":function(n){return e.queryHTML(t(n),n.type)},"Element.tap":function(n){return e.dispatchTapEvent(t(n))},"Element.longpress":function(n){return e.dispatchLongpressEvent(t(n))},"Element.touchstart":function(n){return e.dispatchTouchEvent(t(n),"touchstart",n)},"Element.touchmove":function(n){return e.dispatchTouchEvent(t(n),"touchmove",n)},"Element.touchend":function(n){return e.dispatchTouchEvent(t(n),"touchend",n)},"Element.callFunction":function(n){return e.callFunction(t(n),n.functionName,n.args)},"Element.triggerEvent":function(n){return e.triggerEvent(t(n),n.type,n.detail)}}}(y));function b(e){return UniViewJSBridge.publishHandler("onAutoMessageReceive",e)}UniViewJSBridge.subscribe("sendAutoMessage",(function(e){var t=e.id,n=e.method,r=e.params,o={id:t},i=E[n];if(!i)return o.error={message:n+" unimplemented"},b(o);try{i(r).then((function(e){e&&(o.result=e)})).catch((function(e){o.error={message:e.message}})).finally((function(){b(o)}))}catch(e){o.error={message:e.message},b(o)}}));
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册