feat(): 改为vite

This commit is contained in:
2026-03-16 17:58:57 +08:00
parent cd734d8524
commit 1ccbd4e872
74 changed files with 46574 additions and 2145 deletions
+69
View File
@@ -0,0 +1,69 @@
/// <reference types="@dcloudio/types" />
declare namespace Android {
class ActivityCompat implements PlusAndroidInstanceObject {
checkSelfPermission(context: Context, permission: string): number;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
class Build implements PlusAndroidClassObject {
readonly VERSION: {
SDK_INT: number;
ECLAIR_0_1: number;
};
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
class BluetoothAdapter implements PlusAndroidInstanceObject {
readonly ACTION_DISCOVERY_FINISHED =
"android.bluetooth.device.extra.DEVICE";
startDiscovery(): boolean;
cancelDiscovery(): boolean;
isDiscovering(): boolean;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
getDefaultAdapter(): BluetoothAdapter;
getBondedDevices(): Set<BluetoothDevice>;
}
class BluetoothDevice implements PlusAndroidInstanceObject {
readonly ACTION_FOUND = "android.bluetooth.device.action.FOUND";
readonly EXTRA_DEVICE = "android.bluetooth.device.extra.DEVICE";
getName(): string;
getAddress(): string;
createRfcommSocketToServiceRecord(uuid: UUID): BluetoothSocket;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
interface Set<E> extends PlusAndroidClassObject {
iterator(): Iterator<E>;
}
interface BluetoothSocket extends PlusAndroidClassObject {
isConnected(): boolean;
}
interface UUID extends PlusAndroidClassObject {
fromString(name: string): UUID;
}
class Context implements PlusAndroidInstanceObject {
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
class Intent implements PlusAndroidInstanceObject {
getParcelableExtra<T>(name: string): T;
getAction(): string;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
class BroadcastReceiver {}
class IntentFilter implements PlusAndroidInstanceObject {
addAction(action: string): void;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
class Activity implements PlusAndroidInstanceObject {
registerReceiver(receiver: BroadcastReceiver, filter: IntentFilter): Intent;
unregisterReceiver(receiver: BroadcastReceiver): void;
plusGetAttribute(name?: string | undefined): unknown;
plusSetAttribute(name?: string | undefined, value?: unknown): void;
}
}
+1074
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
interface Config {
/** 环境 */
ENV?: string;
/** api 基础地址 */
API_BASE_URL?: string;
/** appId */
APP_ID?: string;
/** static 目录基础地址 */
STATIC_BASE_URL?: string;
/** 上传文件地址 */
UPLOAD_URL?: string;
/** 文件地址 */
FILE_BASE_URL?: string;
}
+4
View File
@@ -0,0 +1,4 @@
/// <reference types="vite/client" />
declare module "uview-ui";
declare module "uview-plus";
+5
View File
@@ -0,0 +1,5 @@
declare global {
function setInterval(handler: TimerHandler, timeout?: number): number;
}
export {};
+49
View File
@@ -0,0 +1,49 @@
import * as QQMapWX from "@jonny1994/qqmap-wx-jssdk";
export * from "@jonny1994/qqmap-wx-jssdk";
/**
* 行政区划列表
* @example
* cidx: [103, 118]
* fullname: "张家口市"
* id: "130700"
* location: {lat: 40.82444, lng: 114.88755}
* name: "张家口"
* pinyin: ["zhang", "jia", "kou"]
*/
export interface GetCityListSuccessResultResult {
/**
* 行政区划唯一标识
* @example "110000"
*/
id: number;
/**
* 简称,如“内蒙古”
*/
name?: string;
/**
* 全称,如“内蒙古自治区”
* @example "北京市"
*/
fullname: string;
/**
* 中心点坐标
* @example {lat: 39.90469, lng: 116.40717}
*/
location: QQMapWX.ResultLocation;
/**
* 行政区划拼音,每一下标为一个字的全拼,如:[“nei”,“meng”,“gu”]
*/
pinyin: string[];
/**
* 子级行政区划在下级数组中的下标位置
* @example [0, 15]
*/
cidx?: number[];
}
export interface GetCityListSuccessResult extends QQMapWX.CommonResult {
/**
* 结果数组,第0项,代表一级行政区划,第1项代表二级行政区划,以此类推;使用getchildren接口时,仅为指定父级行政区划的子级
*/
result: GetCityListSuccessResultResult[];
}
+124
View File
@@ -0,0 +1,124 @@
/// <reference types="@dcloudio/types" />
declare namespace UniNamespace {
type LocaldataItem = {
text: string;
value: string;
children?: LocaldataItem[];
};
type LocaldataNodeclickValue = {
text: string;
value: string;
parent_value?: string;
};
type LocaldataChangeValue = { text: string; value: string };
type Event<T> = { detail: T };
type InputEvent = Event<{ value: string }>;
type PickerEvent = Event<{ value: string }>;
type PickerViewEvent = Event<{ value: unknown[] }>;
type ScrollEvent = Event<{ scrollTop: number }>;
type SwiperEvent = Event<{ current: number }>;
type UniDataPickerEvent = Event<{ value: LocaldataChangeValue[] }>;
interface WriteBLECharacteristicValueOptions2 {
/**
* 蓝牙设备 id,参考 device 对象
*/
deviceId: string;
/**
* 蓝牙特征值对应服务的 uuid
*/
serviceId: string;
/**
* 蓝牙特征值的 uuid
*/
characteristicId: string;
/**
* 蓝牙设备特征值对应的二进制值
*/
value: ArrayBuffer;
/**
* 成功则返回本机蓝牙适配器状态
*/
success?: (result: StopBluetoothDevicesDiscoverySuccess) => void;
/**
* 接口调用失败的回调函数
*/
fail?: (result: unknown) => void;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: (result: unknown) => void;
}
interface BluetoothError {
code: number;
}
interface StopBluetoothDevicesDiscoveryOptions2 {
/**
* 成功则返回本机蓝牙适配器状态
*/
success?: (result: StopBluetoothDevicesDiscoverySuccess) => void;
/**
* 接口调用失败的回调函数
*/
fail?: (result: BluetoothError) => void;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: () => void;
}
}
// type DataType = string | AnyObject | ArrayBuffer;
interface Uni {
// request<T extends DataType, D extends DataType>(
// options: RequestOptionsGeneric<D>
// ): Promise<RequestSuccessCallbackResultGeneric<T>>;
request(
options: UniApp.RequestOptions,
): Promise<UniApp.RequestSuccessCallbackResult>;
writeBLECharacteristicValue(
options: UniNamespace.WriteBLECharacteristicValueOptions2,
): void;
stopBluetoothDevicesDiscovery(
options: UniNamespace.StopBluetoothDevicesDiscoveryOptions,
): void;
}
// interface RequestOptionsGeneric<T extends DataType>
// extends UniApp.RequestOptions {
// data?: T;
// }
// interface RequestSuccessCallbackResultGeneric<T extends DataType>
// extends UniApp.RequestSuccessCallbackResult {
// data: T;
// errMsg?: string;
// }
// interface PlusIoDirectoryEntry extends PlusIoFileEntry {
// file(
// succesCB?: (result: PlusIoFile) => void,
// errorCB?: (result: any) => void
// ): void;
// }
interface PlusIo {
resolveLocalFileSystemURL(
url?: string,
succesCB?: (result: PlusIoFileEntry) => void,
errorCB?: (result: any) => void,
): void;
}
// interface PlusIoFileEvent {
// target?: PlusIoFileReader;
// }
interface PlusIoFileReader {
onload?: (result: PlusIoFileEvent) => void;
}