mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
智慧宿舍系统小程序
This commit is contained in:
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/color.d.ts
generated
vendored
Normal file
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/color.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export declare const RED = "#ee0a24";
|
||||
export declare const BLUE = "#1989fa";
|
||||
export declare const WHITE = "#fff";
|
||||
export declare const GREEN = "#07c160";
|
||||
export declare const ORANGE = "#ff976a";
|
||||
export declare const GRAY = "#323233";
|
||||
export declare const GRAY_DARK = "#969799";
|
||||
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/color.js
generated
vendored
Normal file
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/color.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export const RED = '#ee0a24';
|
||||
export const BLUE = '#1989fa';
|
||||
export const WHITE = '#fff';
|
||||
export const GREEN = '#07c160';
|
||||
export const ORANGE = '#ff976a';
|
||||
export const GRAY = '#323233';
|
||||
export const GRAY_DARK = '#969799';
|
||||
8
wechat/miniprogram/node_modules/@vant/weapp/dist/common/component.d.ts
generated
vendored
Normal file
8
wechat/miniprogram/node_modules/@vant/weapp/dist/common/component.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
import { VantComponentOptions } from '../definitions/index';
|
||||
declare function VantComponent<
|
||||
Data extends WechatMiniprogram.Component.DataOption,
|
||||
Props extends WechatMiniprogram.Component.PropertyOption,
|
||||
Methods extends WechatMiniprogram.Component.MethodOption
|
||||
>(vantOptions: VantComponentOptions<Data, Props, Methods>): void;
|
||||
export { VantComponent };
|
||||
45
wechat/miniprogram/node_modules/@vant/weapp/dist/common/component.js
generated
vendored
Normal file
45
wechat/miniprogram/node_modules/@vant/weapp/dist/common/component.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import { basic } from '../mixins/basic';
|
||||
function mapKeys(source, target, map) {
|
||||
Object.keys(map).forEach((key) => {
|
||||
if (source[key]) {
|
||||
target[map[key]] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
function VantComponent(vantOptions) {
|
||||
const options = {};
|
||||
mapKeys(vantOptions, options, {
|
||||
data: 'data',
|
||||
props: 'properties',
|
||||
mixins: 'behaviors',
|
||||
methods: 'methods',
|
||||
beforeCreate: 'created',
|
||||
created: 'attached',
|
||||
mounted: 'ready',
|
||||
destroyed: 'detached',
|
||||
classes: 'externalClasses',
|
||||
});
|
||||
// add default externalClasses
|
||||
options.externalClasses = options.externalClasses || [];
|
||||
options.externalClasses.push('custom-class');
|
||||
// add default behaviors
|
||||
options.behaviors = options.behaviors || [];
|
||||
options.behaviors.push(basic);
|
||||
// add relations
|
||||
const { relation } = vantOptions;
|
||||
if (relation) {
|
||||
options.relations = relation.relations;
|
||||
options.behaviors.push(relation.mixin);
|
||||
}
|
||||
// map field to form-field behavior
|
||||
if (vantOptions.field) {
|
||||
options.behaviors.push('wx://form-field');
|
||||
}
|
||||
// add default options
|
||||
options.options = {
|
||||
multipleSlots: true,
|
||||
addGlobalClass: true,
|
||||
};
|
||||
Component(options);
|
||||
}
|
||||
export { VantComponent };
|
||||
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/index.wxss
generated
vendored
Normal file
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/index.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}.van-clearfix:after{display:table;clear:both;content:""}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
21
wechat/miniprogram/node_modules/@vant/weapp/dist/common/relation.d.ts
generated
vendored
Normal file
21
wechat/miniprogram/node_modules/@vant/weapp/dist/common/relation.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance;
|
||||
export declare function useParent(
|
||||
name: string,
|
||||
onEffect?: (this: TrivialInstance) => void
|
||||
): {
|
||||
relations: {
|
||||
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||
};
|
||||
mixin: string;
|
||||
};
|
||||
export declare function useChildren(
|
||||
name: string,
|
||||
onEffect?: (this: TrivialInstance, target: TrivialInstance) => void
|
||||
): {
|
||||
relations: {
|
||||
[x: string]: WechatMiniprogram.Component.RelationOption;
|
||||
};
|
||||
mixin: string;
|
||||
};
|
||||
export {};
|
||||
64
wechat/miniprogram/node_modules/@vant/weapp/dist/common/relation.js
generated
vendored
Normal file
64
wechat/miniprogram/node_modules/@vant/weapp/dist/common/relation.js
generated
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
export function useParent(name, onEffect) {
|
||||
const path = `../${name}/index`;
|
||||
return {
|
||||
relations: {
|
||||
[path]: {
|
||||
type: 'ancestor',
|
||||
linked() {
|
||||
onEffect && onEffect.call(this);
|
||||
},
|
||||
linkChanged() {
|
||||
onEffect && onEffect.call(this);
|
||||
},
|
||||
unlinked() {
|
||||
onEffect && onEffect.call(this);
|
||||
},
|
||||
},
|
||||
},
|
||||
mixin: Behavior({
|
||||
created() {
|
||||
Object.defineProperty(this, 'parent', {
|
||||
get: () => this.getRelationNodes(path)[0],
|
||||
});
|
||||
Object.defineProperty(this, 'index', {
|
||||
// @ts-ignore
|
||||
get: () => {
|
||||
var _a, _b;
|
||||
return (_b =
|
||||
(_a = this.parent) === null || _a === void 0
|
||||
? void 0
|
||||
: _a.children) === null || _b === void 0
|
||||
? void 0
|
||||
: _b.indexOf(this);
|
||||
},
|
||||
});
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
export function useChildren(name, onEffect) {
|
||||
const path = `../${name}/index`;
|
||||
return {
|
||||
relations: {
|
||||
[path]: {
|
||||
type: 'descendant',
|
||||
linked(target) {
|
||||
onEffect && onEffect.call(this, target);
|
||||
},
|
||||
linkChanged(target) {
|
||||
onEffect && onEffect.call(this, target);
|
||||
},
|
||||
unlinked(target) {
|
||||
onEffect && onEffect.call(this, target);
|
||||
},
|
||||
},
|
||||
},
|
||||
mixin: Behavior({
|
||||
created() {
|
||||
Object.defineProperty(this, 'children', {
|
||||
get: () => this.getRelationNodes(path) || [],
|
||||
});
|
||||
},
|
||||
}),
|
||||
};
|
||||
}
|
||||
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/clearfix.wxss
generated
vendored
Normal file
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/clearfix.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-clearfix:after{display:table;clear:both;content:""}
|
||||
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/ellipsis.wxss
generated
vendored
Normal file
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/ellipsis.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{-webkit-line-clamp:2}.van-multi-ellipsis--l2,.van-multi-ellipsis--l3{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{-webkit-line-clamp:3}
|
||||
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/hairline.wxss
generated
vendored
Normal file
1
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/hairline.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom:after,.van-hairline--left:after,.van-hairline--right:after,.van-hairline--surround:after,.van-hairline--top-bottom:after,.van-hairline--top:after,.van-hairline:after{position:absolute;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;content:" ";pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid #ebedf0;-webkit-transform:scale(.5);transform:scale(.5)}.van-hairline--top:after{border-top-width:1px}.van-hairline--left:after{border-left-width:1px}.van-hairline--right:after{border-right-width:1px}.van-hairline--bottom:after{border-bottom-width:1px}.van-hairline--top-bottom:after{border-width:1px 0}.van-hairline--surround:after{border-width:1px}
|
||||
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/clearfix.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/clearfix.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/ellipsis.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/ellipsis.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/hairline.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/mixins/hairline.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/theme.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/theme.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/var.wxss
generated
vendored
Normal file
0
wechat/miniprogram/node_modules/@vant/weapp/dist/common/style/var.wxss
generated
vendored
Normal file
30
wechat/miniprogram/node_modules/@vant/weapp/dist/common/utils.d.ts
generated
vendored
Normal file
30
wechat/miniprogram/node_modules/@vant/weapp/dist/common/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="miniprogram-api-typings" />
|
||||
export declare function range(num: number, min: number, max: number): number;
|
||||
export declare function nextTick(cb: (...args: any[]) => void): void;
|
||||
export declare function getSystemInfoSync(): WechatMiniprogram.SystemInfo;
|
||||
export declare function addUnit(value?: string | number): string | undefined;
|
||||
export declare function requestAnimationFrame(
|
||||
cb: () => void
|
||||
): number | WechatMiniprogram.NodesRef;
|
||||
export declare function pickExclude(obj: unknown, keys: string[]): {};
|
||||
export declare function getRect(
|
||||
context: WechatMiniprogram.Component.TrivialInstance,
|
||||
selector: string
|
||||
): Promise<WechatMiniprogram.BoundingClientRectCallbackResult>;
|
||||
export declare function getAllRect(
|
||||
context: WechatMiniprogram.Component.TrivialInstance,
|
||||
selector: string
|
||||
): Promise<WechatMiniprogram.BoundingClientRectCallbackResult[]>;
|
||||
export declare function groupSetData(
|
||||
context: WechatMiniprogram.Component.TrivialInstance,
|
||||
cb: () => void
|
||||
): void;
|
||||
export declare function toPromise(
|
||||
promiseLike: Promise<unknown> | unknown
|
||||
): Promise<unknown>;
|
||||
export declare function getCurrentPage<T>(): T &
|
||||
WechatMiniprogram.OptionalInterface<WechatMiniprogram.Page.ILifetime> &
|
||||
WechatMiniprogram.Page.InstanceProperties &
|
||||
WechatMiniprogram.Page.InstanceMethods<WechatMiniprogram.IAnyObject> &
|
||||
WechatMiniprogram.Page.Data<WechatMiniprogram.IAnyObject> &
|
||||
WechatMiniprogram.IAnyObject;
|
||||
89
wechat/miniprogram/node_modules/@vant/weapp/dist/common/utils.js
generated
vendored
Normal file
89
wechat/miniprogram/node_modules/@vant/weapp/dist/common/utils.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
||||
import { canIUseGroupSetData, canIUseNextTick } from './version';
|
||||
export function range(num, min, max) {
|
||||
return Math.min(Math.max(num, min), max);
|
||||
}
|
||||
export function nextTick(cb) {
|
||||
if (canIUseNextTick()) {
|
||||
wx.nextTick(cb);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
cb();
|
||||
}, 1000 / 30);
|
||||
}
|
||||
}
|
||||
let systemInfo;
|
||||
export function getSystemInfoSync() {
|
||||
if (systemInfo == null) {
|
||||
systemInfo = wx.getSystemInfoSync();
|
||||
}
|
||||
return systemInfo;
|
||||
}
|
||||
export function addUnit(value) {
|
||||
if (!isDef(value)) {
|
||||
return undefined;
|
||||
}
|
||||
value = String(value);
|
||||
return isNumber(value) ? `${value}px` : value;
|
||||
}
|
||||
export function requestAnimationFrame(cb) {
|
||||
const systemInfo = getSystemInfoSync();
|
||||
if (systemInfo.platform === 'devtools') {
|
||||
return setTimeout(() => {
|
||||
cb();
|
||||
}, 1000 / 30);
|
||||
}
|
||||
return wx
|
||||
.createSelectorQuery()
|
||||
.selectViewport()
|
||||
.boundingClientRect()
|
||||
.exec(() => {
|
||||
cb();
|
||||
});
|
||||
}
|
||||
export function pickExclude(obj, keys) {
|
||||
if (!isPlainObject(obj)) {
|
||||
return {};
|
||||
}
|
||||
return Object.keys(obj).reduce((prev, key) => {
|
||||
if (!keys.includes(key)) {
|
||||
prev[key] = obj[key];
|
||||
}
|
||||
return prev;
|
||||
}, {});
|
||||
}
|
||||
export function getRect(context, selector) {
|
||||
return new Promise((resolve) => {
|
||||
wx.createSelectorQuery()
|
||||
.in(context)
|
||||
.select(selector)
|
||||
.boundingClientRect()
|
||||
.exec((rect = []) => resolve(rect[0]));
|
||||
});
|
||||
}
|
||||
export function getAllRect(context, selector) {
|
||||
return new Promise((resolve) => {
|
||||
wx.createSelectorQuery()
|
||||
.in(context)
|
||||
.selectAll(selector)
|
||||
.boundingClientRect()
|
||||
.exec((rect = []) => resolve(rect[0]));
|
||||
});
|
||||
}
|
||||
export function groupSetData(context, cb) {
|
||||
if (canIUseGroupSetData()) {
|
||||
context.groupSetData(cb);
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
}
|
||||
export function toPromise(promiseLike) {
|
||||
if (isPromise(promiseLike)) {
|
||||
return promiseLike;
|
||||
}
|
||||
return Promise.resolve(promiseLike);
|
||||
}
|
||||
export function getCurrentPage() {
|
||||
const pages = getCurrentPages();
|
||||
return pages[pages.length - 1];
|
||||
}
|
||||
11
wechat/miniprogram/node_modules/@vant/weapp/dist/common/validator.d.ts
generated
vendored
Normal file
11
wechat/miniprogram/node_modules/@vant/weapp/dist/common/validator.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export declare function isFunction(val: unknown): val is Function;
|
||||
export declare function isPlainObject(
|
||||
val: unknown
|
||||
): val is Record<string, unknown>;
|
||||
export declare function isPromise<T = unknown>(val: unknown): val is Promise<T>;
|
||||
export declare function isDef(value: unknown): boolean;
|
||||
export declare function isObj(x: unknown): x is Record<string, unknown>;
|
||||
export declare function isNumber(value: string): boolean;
|
||||
export declare function isBoolean(value: unknown): value is boolean;
|
||||
export declare function isImageUrl(url: string): boolean;
|
||||
export declare function isVideoUrl(url: string): boolean;
|
||||
31
wechat/miniprogram/node_modules/@vant/weapp/dist/common/validator.js
generated
vendored
Normal file
31
wechat/miniprogram/node_modules/@vant/weapp/dist/common/validator.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export function isFunction(val) {
|
||||
return typeof val === 'function';
|
||||
}
|
||||
export function isPlainObject(val) {
|
||||
return val !== null && typeof val === 'object' && !Array.isArray(val);
|
||||
}
|
||||
export function isPromise(val) {
|
||||
return isPlainObject(val) && isFunction(val.then) && isFunction(val.catch);
|
||||
}
|
||||
export function isDef(value) {
|
||||
return value !== undefined && value !== null;
|
||||
}
|
||||
export function isObj(x) {
|
||||
const type = typeof x;
|
||||
return x !== null && (type === 'object' || type === 'function');
|
||||
}
|
||||
export function isNumber(value) {
|
||||
return /^\d+(\.\d+)?$/.test(value);
|
||||
}
|
||||
export function isBoolean(value) {
|
||||
return typeof value === 'boolean';
|
||||
}
|
||||
const IMAGE_REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i;
|
||||
const VIDEO_REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv)/i;
|
||||
export function isImageUrl(url) {
|
||||
return IMAGE_REGEXP.test(url);
|
||||
}
|
||||
export function isVideoUrl(url) {
|
||||
return VIDEO_REGEXP.test(url);
|
||||
}
|
||||
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/version.d.ts
generated
vendored
Normal file
7
wechat/miniprogram/node_modules/@vant/weapp/dist/common/version.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export declare function canIUseModel(): boolean;
|
||||
export declare function canIUseFormFieldButton(): boolean;
|
||||
export declare function canIUseAnimate(): boolean;
|
||||
export declare function canIUseGroupSetData(): boolean;
|
||||
export declare function canIUseNextTick(): boolean;
|
||||
export declare function canIUseCanvas2d(): boolean;
|
||||
export declare function canIUseGetUserProfile(): boolean;
|
||||
48
wechat/miniprogram/node_modules/@vant/weapp/dist/common/version.js
generated
vendored
Normal file
48
wechat/miniprogram/node_modules/@vant/weapp/dist/common/version.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
import { getSystemInfoSync } from './utils';
|
||||
function compareVersion(v1, v2) {
|
||||
v1 = v1.split('.');
|
||||
v2 = v2.split('.');
|
||||
const len = Math.max(v1.length, v2.length);
|
||||
while (v1.length < len) {
|
||||
v1.push('0');
|
||||
}
|
||||
while (v2.length < len) {
|
||||
v2.push('0');
|
||||
}
|
||||
for (let i = 0; i < len; i++) {
|
||||
const num1 = parseInt(v1[i], 10);
|
||||
const num2 = parseInt(v2[i], 10);
|
||||
if (num1 > num2) {
|
||||
return 1;
|
||||
}
|
||||
if (num1 < num2) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
function gte(version) {
|
||||
const system = getSystemInfoSync();
|
||||
return compareVersion(system.SDKVersion, version) >= 0;
|
||||
}
|
||||
export function canIUseModel() {
|
||||
return gte('2.9.3');
|
||||
}
|
||||
export function canIUseFormFieldButton() {
|
||||
return gte('2.10.3');
|
||||
}
|
||||
export function canIUseAnimate() {
|
||||
return gte('2.9.0');
|
||||
}
|
||||
export function canIUseGroupSetData() {
|
||||
return gte('2.4.0');
|
||||
}
|
||||
export function canIUseNextTick() {
|
||||
return wx.canIUse('nextTick');
|
||||
}
|
||||
export function canIUseCanvas2d() {
|
||||
return gte('2.9.0');
|
||||
}
|
||||
export function canIUseGetUserProfile() {
|
||||
return !!wx.getUserProfile;
|
||||
}
|
||||
Reference in New Issue
Block a user