Commit b71ac8c1 by chenwq1

refactor(boutique): 重构页面结构和逻辑

- 移除不再使用的 portrait 页面
- 优化横竖屏组件的逻辑,合并相关功能
- 更新组件引用,确保逻辑一致性
- 改进加载状态处理,使用骨架屏替代全屏加载
- 调整数据处理方式,增强代码可读性和维护性
- 更新 manifest.json 版本号
1 parent 11bcfe9c
Showing 284 changed files with 4292 additions and 238 deletions
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import { updateResolutionConfig } from "@/config/resolution-adapt/index.uts"; import { updateResolutionConfig } from "@/config/resolution-adapt/index.uts";
// #ifdef APP // #ifdef APP
import { layoutService } from "@/services/LayoutService.uts"; import { layoutService } from "@/services/LayoutService.uts";
import { recordService } from "@/services/recorder";
import { lockOrientation } from "@/utils/plus-screen.uts"; import { lockOrientation } from "@/utils/plus-screen.uts";
// #endif // #endif
...@@ -30,18 +29,8 @@ export default { ...@@ -30,18 +29,8 @@ export default {
} }
// #endif // #endif
console.log("App Launch"); console.log("App Launch");
// 启动时仅做分辨率配置,避免后台定时器/录音模拟导致对象被长时间持有
setTimeout(() => {
// 模拟接待开始
console.log("Simulating reception start...");
recordService.startAudio();
// 模拟接待结束
console.log("Simulating reception end...");
setTimeout(() => {
recordService.stopAudio();
}, 10_000);
updateResolutionConfig(); updateResolutionConfig();
}, 1000);
}, },
onShow () { onShow () {
console.log("App Show"); console.log("App Show");
......
...@@ -5,35 +5,10 @@ ...@@ -5,35 +5,10 @@
:key="index" :key="index"
class="entrance-item" class="entrance-item"
@click="handleClick(item)"> @click="handleClick(item)">
<!-- App 端需用相对路径,便于打包时基于当前文件解析并打入包内 --> <!-- uView Next 图片图标:name 传图片路径(包含 /) -->
<image v-if="item.icon === 'daily-report'" <un-icon class="entrance-icon"
class="entrance-icon" :name="getIconUrl(item.icon)"
mode="aspectFit" size="48" />
src="../static/images/boutique/tools/daily-report.png" />
<image v-else-if="item.icon === 'create-order'"
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/create-order.png" />
<image v-else-if="item.icon === 'equity-order'"
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/equity-order.png" />
<image v-else-if="item.icon === 'defeat-order'"
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/defeat-order.png" />
<image v-else-if="item.icon === 'order-management'"
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/order-management.png" />
<image v-else-if="item.icon === 'wage-appeal'"
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/wage-appeal.png" />
<image v-else
class="entrance-icon"
mode="aspectFit"
src="../static/images/boutique/tools/daily-report.png" />
<text class="entrance-name">{{ item.label }}</text> <text class="entrance-name">{{ item.label }}</text>
</view> </view>
</view> </view>
...@@ -91,6 +66,17 @@ const entranceList = computed((): EntranceItem[] => { ...@@ -91,6 +66,17 @@ const entranceList = computed((): EntranceItem[] => {
function handleClick(_item: EntranceItem): void { function handleClick(_item: EntranceItem): void {
uni.showToast({ title: "敬请期待", icon: "none" }); uni.showToast({ title: "敬请期待", icon: "none" });
} }
function getIconUrl(icon: string): string {
// App 端需用相对路径,便于打包时基于当前文件解析并打入包内
if (icon === "daily-report") return "../static/images/boutique/tools/daily-report.png";
if (icon === "create-order") return "../static/images/boutique/tools/create-order.png";
if (icon === "equity-order") return "../static/images/boutique/tools/equity-order.png";
if (icon === "defeat-order") return "../static/images/boutique/tools/defeat-order.png";
if (icon === "order-management") return "../static/images/boutique/tools/order-management.png";
if (icon === "wage-appeal") return "../static/images/boutique/tools/wage-appeal.png";
return "../static/images/boutique/tools/daily-report.png";
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"appid": "__UNI__B602BFA", "appid": "__UNI__B602BFA",
"description": "", "description": "",
"versionName": "1.0.0", "versionName": "1.0.0",
"versionCode": "112", "versionCode": "113",
"uni-app-x": { "uni-app-x": {
"flex-direction": "row" "flex-direction": "row"
}, },
......
{ {
"pages": [ "pages": [
// pages 数组中第一项表示应用启动页
{ {
"path": "pages/common/login/index", "path": "pages/common/login/index",
"style": { "style": {
...@@ -32,12 +31,6 @@ ...@@ -32,12 +31,6 @@
} }
}, },
{ {
"path": "pages/boutique/portrait",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/test/index", "path": "pages/test/index",
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
......
<template> <template>
<view class="page-container"> <view class="page-container container">
<HomeFrame ref="homeRef" <HomeFrame ref="homeRef"
:show-footer="true" :show-footer="true"
:swiper-custom="true" :swiper-custom="true"
@start="handleStart"> @start="handleStart">
<template #swiperCustom> <template #swiperCustom>
<view v-if="loadComplete" class="swiper-custom-wrap"> <view v-if="logic.loadComplete.value" class="content-wrap">
<swiper v-if="packageList.length > 0" <scroll-view class="pkg-scroll"
class="package-swiper" direction="vertical"
:current="currentSwiperIndex" :show-scrollbar="true">
@change="onSwiperChange"> <view v-if="logic.packageList.value.length > 0" class="pkg-list">
<swiper-item v-for="(item, idx) in packageList" <view v-for="(item, idx) in logic.packageList.value"
:key="idx" :key="idx"
class="pkg-card"
@tap="toDetail(idx)"> @tap="toDetail(idx)">
<view class="swiper-custom-content"> <image v-if="logic.getPkg(item, 'bannerImg')"
<image class="bg" class="pkg-cover"
mode="aspectFill" mode="aspectFill"
:src="getBanner(item)" /> :src="logic.getPkg(item, 'bannerImg')" />
<view class="pkg-main">
<view class="pkg-name">
{{ logic.getPkg(item, "name") }}
</view> </view>
</swiper-item> <view class="pkg-brief">
</swiper> {{ logic.getPkg(item, "briefIntroduction") }}
<view v-if="packageList.length > 0" class="swiper-dots">
<view v-for="(_, i) in packageList"
:key="i"
class="dot"
:class="[{ active: i === currentSwiperIndex }]" />
</view> </view>
<view v-else class="swiper-empty"> <view class="pkg-price-row">
<text class="empty-text">敬请期待</text> <text class="label">市场价</text>
<text class="value">¥{{ logic.getPkg(item, "marketPrice") }}</text>
<text class="label">套餐价</text>
<text class="value strong">¥{{ logic.getPkg(item, "packagePrice") }}</text>
</view> </view>
</view> </view>
<view v-else class="swiper-loading">
<text>加载中...</text>
</view> </view>
</template> </view>
<view v-else class="pkg-empty">
<template #detail> <text class="empty-text">{{ logic.swiperNoDataObject.text }}</text>
<view class="detail-content"> </view>
<text class="detail-title">详情页</text> </scroll-view>
</view>
<view v-else class="loading-wrap">
<un-skeleton :animate="true"
avatar
:loading="true"
rows="8"
title>
</un-skeleton>
</view> </view>
</template> </template>
</HomeFrame> </HomeFrame>
<CenterPopup ref="customerTypeRef"
:list="logic.typeList"
title="请选择当前洽谈的客户类型"
@choose="onChooseCustomerType" />
<PackageDetailPopup ref="packageRef" @close="closePackageDetail">
<view class="package-detail-box">
<view class="package-box">
<view class="package-name">
套餐内容
</view>
<view class="package-content">
<rich-text :nodes="logic.chooseItem.value.content != null ? (logic.chooseItem.value.content as string) : ''"></rich-text>
</view>
</view>
<view class="package-box package-detail">
<view class="package-name">
套餐介绍
</view>
<view class="package-content">
<rich-text :nodes="logic.chooseItem.value.scriptIntroduction != null ? (logic.chooseItem.value.scriptIntroduction as string) : ''">
</rich-text>
</view>
</view>
</view>
</PackageDetailPopup>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import type { BoutiqueLogic } from "@/pages/boutique/useBoutiqueLogic.uts";
import { ref } from "vue"; import { ref } from "vue";
import CenterPopup from "@/components/CenterPopup.uvue";
import HomeFrame from "@/components/HomeFrame/index.uvue"; import HomeFrame from "@/components/HomeFrame/index.uvue";
import type { BoutiqueLogic } from "@/pages/boutique/useBoutiqueLogic.uts"; import PackageDetailPopup from "@/pages/boutique/components/PackageDetailPopup.uvue";
type NavigateToFailLike = { const props = defineProps<{
errCode: number; logic: BoutiqueLogic;
errMsg: string; }>();
errSubject: string;
message: null | string;
};
const props = defineProps<{ logic: BoutiqueLogic }>();
const logic = props.logic;
const homeRef = ref(null); const homeRef = ref(null);
const customerTypeRef = ref(null);
const packageRef = ref(null);
const loadComplete = props.logic.loadComplete; function callExposedMethod(comp: any, methodName: string): void {
const packageList = props.logic.packageList; if (comp == null) return;
const currentSwiperIndex = props.logic.currentSwiperIndex; const obj = comp as UTSJSONObject;
const fn = obj[methodName];
function getBanner(item: any): string { if (fn != null && typeof fn === "function") {
return props.logic.getPkg(item, "bannerImg") as string; (fn as () => void)();
}
} }
function onSwiperChange(e: any): void { function handleStart(): void {
props.logic.onSwiperChange(e); callExposedMethod(customerTypeRef.value as any, "open");
} }
function toDetail(_index: number): void { function onChooseCustomerType(index: number): void {
uni.showToast({ title: "套餐详情", icon: "none" }); logic.chooseCustomerType(homeRef.value as any, index);
} }
function handleStart(): void { function toDetail(index: number): void {
uni.navigateTo({ const item = logic.packageList.value[index];
url: "/pages/reception/record", if (item != null) {
fail: (e: any) => { logic.chooseItem.value = item as UTSJSONObject;
const err = e as NavigateToFailLike; callExposedMethod(packageRef.value as any, "open");
const msg = err.message !== null && err.message !== "" ? err.message : "";
console.error("[navigateTo] /pages/reception/record fail:", msg, JSON.stringify(e));
uni.showToast({ title: "跳转失败", icon: "none" });
} }
}); }
function closePackageDetail(): void {
logic.chooseItem.value = {};
} }
function updateHome(): void { function updateHome(): void {
const h = homeRef.value as null | UTSJSONObject; // 竖屏进入时也保持旧行为:如果需要自动跳转详情,复用逻辑层 jumpPage
if (h == null) return; logic.jumpPage(homeRef.value as any, "");
const fn = h["updateApp"];
if (fn != null && typeof fn === "function") {
(fn as () => void)();
}
} }
defineExpose({ defineExpose({
...@@ -110,75 +142,88 @@ defineExpose({ ...@@ -110,75 +142,88 @@ defineExpose({
height: 100%; height: 100%;
} }
.swiper-custom-wrap { .loading-wrap {
width: 100%; padding: 24px;
height: 100%;
} }
.package-swiper { .content-wrap {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.swiper-custom-content { .pkg-scroll {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative;
} }
.bg { .pkg-list {
position: absolute; padding: 24px;
display: flex;
flex-direction: column;
}
.pkg-card {
background: #ffffff;
border-radius: 16px;
overflow: hidden;
margin-bottom: 20px;
}
.pkg-cover {
width: 100%; width: 100%;
height: 100%; height: 180px;
top: 0;
left: 0;
z-index: -1;
} }
.swiper-dots { .pkg-main {
padding: 16px;
display: flex; display: flex;
flex-direction: row; flex-direction: column;
justify-content: center;
padding: 12px 0;
} }
.dot { .pkg-name {
width: 8px; font-size: 18px;
height: 8px; font-weight: 600;
border-radius: 4px; color: #111111;
background: #ccc;
margin: 0 4px;
} }
.dot.active { .pkg-brief {
background: #4673ff; margin-top: 8px;
font-size: 14px;
color: #666666;
} }
.swiper-empty, .pkg-price-row {
.swiper-loading { margin-top: 12px;
width: 100%;
height: 100%;
display: flex; display: flex;
flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: center;
} }
.empty-text { .label {
font-size: 12px;
color: #999999;
margin-right: 6px;
}
.value {
font-size: 14px; font-size: 14px;
color: #999; color: #333333;
margin-right: 14px;
} }
.detail-content { .strong {
width: 100%; color: #e53935;
height: 100%; font-weight: 600;
}
.pkg-empty {
padding: 48px 24px;
display: flex; display: flex;
align-items: center;
justify-content: center; justify-content: center;
} }
.detail-title { .empty-text {
font-size: 24px; color: #999999;
color: #333; font-size: 14px;
} }
</style> </style>
<template>
<!-- 兼容旧路由:统一跳转到单入口 /pages/boutique/index,由入口页内部决定横竖屏 -->
<view class="redirect-placeholder"></view>
</template>
<script setup lang="uts">
import { ComponentPublicInstance, ref } from "vue";
import { storage } from "@/utils/storage.uts";
// 不显式导入 onLoad/onShow,避免与编译器生成的 BasePage 构造函数中的 onLoad 冲突(error18)
// import { onLoad, onShow } from "@dcloudio/uni-app";
const homeRef = ref(null);
function redirect(): void {
uni.reLaunch({ url: "/pages/boutique/index" });
}
onLoad((_options: OnLoadOptions) => {
uni.hideLoading();
redirect();
});
onShow(() => {
const userInfo = storage.get("userInfo");
if (userInfo == null) {
storage.remove("userInfo");
storage.remove("sessionId");
uni.reLaunch({ url: "/pages/common/login/index" });
return;
}
const userInfoObj = userInfo as UTSJSONObject;
const shopMerchantId = userInfoObj.shopMerchantId as null | string;
const shopMerchantName = userInfoObj.shopMerchantName as null | string;
if (shopMerchantId == null || shopMerchantId == "" || shopMerchantName == null || shopMerchantName == "") {
storage.remove("userInfo");
storage.remove("sessionId");
uni.reLaunch({ url: "/pages/common/login/index" });
return;
}
if (homeRef.value != null) {
(homeRef.value as ComponentPublicInstance).$callMethod("updateApp");
}
});
</script>
<style scoped lang="scss">
.redirect-placeholder {
width: 100%;
height: 100%;
}
</style>
import { ref, type Ref } from "vue"; import { ref, type Ref } from "vue";
import { getBoutiquePackageList as apiGetBoutiquePackageList, getBoutiqueMaterialConfig } from "@/api/boutique-api.uts"; import { getBoutiquePackageList as apiGetBoutiquePackageList, getBoutiqueMaterialConfig } from "@/api/boutique-api.uts";
import { getEmployeeList } from "@/api/common-api.uts"; import { getEmployeeListApi } from "@/api/common-api.uts";
import { getBoutiqueMockData, getMockData } from "@/api/system-api.uts"; import { getBoutiqueMockData, getMockData } from "@/api/system-api.uts";
import { dispatch, store } from "@/store/index.uts"; import { dispatch, store } from "@/store/index.uts";
import { storage } from "@/utils/storage.uts"; import { storage } from "@/utils/storage.uts";
...@@ -116,7 +116,12 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -116,7 +116,12 @@ export function useBoutiqueLogic(): BoutiqueLogic {
tabId.value = 1; tabId.value = 1;
const carItem = list.length > 0 ? list[carIndex] : null; const carItem = list.length > 0 ? list[carIndex] : null;
currentCarId.value = carItem != null ? ((carItem as UTSJSONObject).carModelId ?? "") as string : ""; if (carItem != null) {
const cid = (carItem as UTSJSONObject).carModelId as null | string;
currentCarId.value = cid != null ? cid : "";
} else {
currentCarId.value = "";
}
// 通知 HomeFrame 进入详情(具体 id/type 等仍在横屏组件内维护) // 通知 HomeFrame 进入详情(具体 id/type 等仍在横屏组件内维护)
if (homeFrameRef != null) { if (homeFrameRef != null) {
...@@ -153,6 +158,9 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -153,6 +158,9 @@ export function useBoutiqueLogic(): BoutiqueLogic {
if (!ensureLoginOrRelauch()) return; if (!ensureLoginOrRelauch()) return;
if (requested.value) return; if (requested.value) return;
// 用页面骨架屏承接加载态,不再弹全屏 showLoading
loadComplete.value = false;
await getMockData(true); await getMockData(true);
const userInfo = storage.get("userInfo") as null | UTSJSONObject; const userInfo = storage.get("userInfo") as null | UTSJSONObject;
...@@ -162,20 +170,17 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -162,20 +170,17 @@ export function useBoutiqueLogic(): BoutiqueLogic {
customerType.value = -1; customerType.value = -1;
getEmployeeList({ merchantId: shopMerchantId, sceneList: [1], appQGFlag: 1 }) try {
.then((res: any) => { const res = await getEmployeeListApi({ merchantId: shopMerchantId, sceneList: [1], appQGFlag: 1 } as UTSJSONObject);
dispatch("setEmployeeList", res); dispatch("setEmployeeList", res);
}) } catch (_e) {}
.catch(() => {});
uni.showLoading({ title: "加载中", mask: true });
getBoutiqueMaterialConfig({ merchantId: shopMerchantId } as UTSJSONObject) try {
.then((res: any) => { const res: any = await getBoutiqueMaterialConfig({ merchantId: shopMerchantId } as UTSJSONObject);
uni.hideLoading();
const resp = res as null | UTSJSONObject; const resp = res as null | UTSJSONObject;
const materials = (resp != null && resp.materials != null ? resp.materials : _emptyArr) as any[]; const materials = (resp != null && resp.materials != null ? resp.materials : _emptyArr) as any[];
const hidePackage = (resp != null ? resp.hidePackage : false) ?? false; const hidePackageAny = resp != null ? (resp.hidePackage as any) : null;
const hidePackage = hidePackageAny != null ? (hidePackageAny as boolean) : false;
const boutiqueMediaConfig = {} as UTSJSONObject; const boutiqueMediaConfig = {} as UTSJSONObject;
const carBannerListTemp: any[] = _emptyArr.slice(); const carBannerListTemp: any[] = _emptyArr.slice();
const boutiqueCarListTemp: any[] = _emptyArr.slice(); const boutiqueCarListTemp: any[] = _emptyArr.slice();
...@@ -192,9 +197,13 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -192,9 +197,13 @@ export function useBoutiqueLogic(): BoutiqueLogic {
if (hidePackage == false) configItems.unshift({ key: "packages", configIndex: 0 }); if (hidePackage == false) configItems.unshift({ key: "packages", configIndex: 0 });
const retrofitting: any[] = _emptyArr.slice(); const retrofitting: any[] = _emptyArr.slice();
const seriesName = m.seriesName as null | string;
const brandName = m.brandName as null | string;
const modelPic = m.modelDisplayPicurl as null | string;
carBannerListTemp.push({ carBannerListTemp.push({
title: (m.seriesName ?? m.brandName ?? "") as string, title: seriesName != null ? seriesName : brandName != null ? brandName : "",
url: (m.modelDisplayPicurl ?? "") as string, url: modelPic != null ? modelPic : "",
name: mCarModelName, name: mCarModelName,
carModelId: mCarModelId, carModelId: mCarModelId,
seriesId: m.seriesId seriesId: m.seriesId
...@@ -232,22 +241,22 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -232,22 +241,22 @@ export function useBoutiqueLogic(): BoutiqueLogic {
const userState = (store.state as UTSJSONObject).user as UTSJSONObject; const userState = (store.state as UTSJSONObject).user as UTSJSONObject;
userState.boutiqueMediaConfig = boutiqueMediaConfig; userState.boutiqueMediaConfig = boutiqueMediaConfig;
userState.boutiqueCarList = boutiqueCarListTemp; userState.boutiqueCarList = boutiqueCarListTemp;
}) } catch (error) {
.catch((error) => {
uni.hideLoading();
uni.showToast({ title: error != null ? (error as any).toString() : "加载失败", icon: "none" }); uni.showToast({ title: error != null ? (error as any).toString() : "加载失败", icon: "none" });
}); }
const baseConfigData = await getBoutiqueMockData(true); const baseConfigData = await getBoutiqueMockData(true);
const ml = baseConfigData.moduleList != null ? baseConfigData.moduleList : _emptyArr; const ml = baseConfigData.moduleList != null ? baseConfigData.moduleList : _emptyArr;
const tl = baseConfigData.toolList != null ? baseConfigData.toolList : _emptyArr; const tl = baseConfigData.toolList != null ? baseConfigData.toolList : _emptyArr;
const dc = baseConfigData.defaultCarId ?? ""; const dcAny = baseConfigData.defaultCarId as any;
const dc = dcAny != null ? (dcAny as any).toString() : "";
dispatch("setBoutiqueBaseConfig", baseConfigData); dispatch("setBoutiqueBaseConfig", baseConfigData);
moduleList.value = ml as any[]; moduleList.value = ml as any[];
toolList.value = tl as any[]; toolList.value = tl as any[];
defaultCarId.value = dc as string; defaultCarId.value = dc as string;
requested.value = true; requested.value = true;
loadComplete.value = true;
}; };
const getBoutiquePackageList = async (): Promise<void> => { const getBoutiquePackageList = async (): Promise<void> => {
...@@ -274,7 +283,8 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -274,7 +283,8 @@ export function useBoutiqueLogic(): BoutiqueLogic {
arr = raw as any[]; arr = raw as any[];
} else { } else {
const obj = raw as UTSJSONObject; const obj = raw as UTSJSONObject;
const listVal = obj["list"] ?? obj["data"]; let listVal = obj["list"];
if (listVal == null) listVal = obj["data"];
arr = (listVal != null && Array.isArray(listVal) ? listVal : _emptyArr) as any[]; arr = (listVal != null && Array.isArray(listVal) ? listVal : _emptyArr) as any[];
} }
} }
...@@ -282,12 +292,24 @@ export function useBoutiqueLogic(): BoutiqueLogic { ...@@ -282,12 +292,24 @@ export function useBoutiqueLogic(): BoutiqueLogic {
for (const element of arr) { for (const element of arr) {
const e = element as UTSJSONObject; const e = element as UTSJSONObject;
if (e != null) { if (e != null) {
let scriptIntro = e.scriptIntroduction as any;
if (scriptIntro == null) scriptIntro = "";
let content = e.content as any;
if (content == null) content = "";
// eslint-disable-next-line unicorn/prefer-string-replace-all // eslint-disable-next-line unicorn/prefer-string-replace-all
e.scriptIntroduction = ((e.scriptIntroduction ?? "") as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>"); e.scriptIntroduction = (scriptIntro as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
// eslint-disable-next-line unicorn/prefer-string-replace-all // eslint-disable-next-line unicorn/prefer-string-replace-all
e.content = ((e.content ?? "") as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>"); e.content = (content as string).replace(/<\/?br\s*\/?>|\\n|\n/g, "<br>");
const pkgType = (e.type != null ? (e.type as any).toString() : "2") as string; const pkgType = (e.type != null ? (e.type as any).toString() : "2") as string;
const defaultBanner = (packageTypeBanner[pkgType] ?? packageTypeBanner["2"]) as string | null; let defaultBanner = "" as string;
const b1 = packageTypeBanner[pkgType] as null | string;
if (b1 != null && b1 != "") {
defaultBanner = b1;
} else {
const b2 = packageTypeBanner["2"] as null | string;
defaultBanner = b2 != null ? b2 : "";
}
if ((e.bannerImg == null || (e.bannerImg as string) == "") && defaultBanner != null) { if ((e.bannerImg == null || (e.bannerImg as string) == "") && defaultBanner != null) {
e.bannerImg = defaultBanner; e.bannerImg = defaultBanner;
} }
......
...@@ -67,13 +67,13 @@ ...@@ -67,13 +67,13 @@
<scroll-view class="list" <scroll-view class="list"
direction="vertical" direction="vertical"
:show-scrollbar="true"> :show-scrollbar="true">
<AccountList v-show="stepIndex == 0" <AccountList v-if="stepIndex == 0"
ref="accountRef" ref="accountRef"
@choose-account="chooseAccount" /> @choose-account="chooseAccount" />
<MerchantList v-show="stepIndex == 1" <MerchantList v-else-if="stepIndex == 1"
ref="merchantRef" ref="merchantRef"
@choose-merchant="chooseMerchant" /> @choose-merchant="chooseMerchant" />
<Scene v-show="stepIndex == 2" <Scene v-else
ref="sceneRef" /> ref="sceneRef" />
</scroll-view> </scroll-view>
</view> </view>
......
<template> <template>
<view class="box" v-if="flag"> <!-- 保持单根节点,确保父组件 v-show 生效 -->
<view>
<view v-if="!flag" class="skeleton-wrap">
<un-skeleton :loading="true" :animate="true" title avatar rows="6"></un-skeleton>
</view>
<view v-else class="box">
<template v-if="loginUserInfoList.length > 0"> <template v-if="loginUserInfoList.length > 0">
<view <view
v-for="(item, index) in loginUserInfoList" v-for="(item, index) in loginUserInfoList"
...@@ -23,6 +28,7 @@ ...@@ -23,6 +28,7 @@
<no-data /> <no-data />
</template> </template>
</view> </view>
</view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
...@@ -166,7 +172,7 @@ function selectAccountLogin(id: string, merchantName: string, userInfo: AccountI ...@@ -166,7 +172,7 @@ function selectAccountLogin(id: string, merchantName: string, userInfo: AccountI
console.log(`选择账号${merchantName}登录!`) console.log(`选择账号${merchantName}登录!`)
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: false
}) })
const params: UTSJSONObject = { const params: UTSJSONObject = {
...@@ -292,7 +298,7 @@ function getListSelectAccount(autoLogin: boolean): void { ...@@ -292,7 +298,7 @@ function getListSelectAccount(autoLogin: boolean): void {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
mask: true mask: false
}) })
const params: UTSJSONObject = {} const params: UTSJSONObject = {}
...@@ -394,6 +400,10 @@ onMounted(() => { ...@@ -394,6 +400,10 @@ onMounted(() => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.skeleton-wrap {
padding: 24px;
}
.box { .box {
display: flex; display: flex;
align-items: center; align-items: center;
......
<template> <template>
<view v-if="!flag" class="skeleton-wrap">
<un-skeleton :loading="true" :animate="true" title avatar rows="6"></un-skeleton>
</view>
<view v-if="flag" class="box"> <view v-if="flag" class="box">
<template v-if="loginUserInfoList.length > 0"> <template v-if="loginUserInfoList.length > 0">
<view <view
...@@ -161,7 +164,7 @@ function getSceneArr(shopMerchantId: string): Promise<number[]> { ...@@ -161,7 +164,7 @@ function getSceneArr(shopMerchantId: string): Promise<number[]> {
function chooseMerchantItem(item: MerchantItem): void { function chooseMerchantItem(item: MerchantItem): void {
console.log('选择4s店' + item.merchantName + '!') console.log('选择4s店' + item.merchantName + '!')
uni.showLoading({ title: '加载中', mask: true }) uni.showLoading({ title: '加载中', mask: false })
const list = loginUserInfoList.value const list = loginUserInfoList.value
let i = 0 let i = 0
...@@ -187,7 +190,7 @@ function getMerchantList(): void { ...@@ -187,7 +190,7 @@ function getMerchantList(): void {
return return
} }
uni.showLoading({ title: '加载中', mask: true }) uni.showLoading({ title: '加载中', mask: false })
const isSuper = currentUserInfo['isSuper'] as boolean | null const isSuper = currentUserInfo['isSuper'] as boolean | null
const params: UTSJSONObject = { const params: UTSJSONObject = {
...@@ -285,6 +288,10 @@ defineExpose({ ...@@ -285,6 +288,10 @@ defineExpose({
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.skeleton-wrap {
padding: 24px;
}
.box { .box {
display: flex; display: flex;
align-items: center; align-items: center;
......
<template> <template>
<view class="box"> <view v-if="loading" class="skeleton-wrap">
<un-skeleton :loading="true" :animate="true" title avatar rows="3"></un-skeleton>
</view>
<view v-else class="box">
<view v-for="(item, index) in sceneList" <view v-for="(item, index) in sceneList"
:key="index" :key="index"
class="items" class="items"
...@@ -35,6 +38,8 @@ const sceneList = ref<SceneItem[]>([ ...@@ -35,6 +38,8 @@ const sceneList = ref<SceneItem[]>([
{ sceneName: "二手车", sceneDesc: "二手车业务", sceneType: 7, actived: false } { sceneName: "二手车", sceneDesc: "二手车业务", sceneType: 7, actived: false }
]); ]);
const loading = ref<boolean>(true);
let userInfo: null | UTSJSONObject = null; let userInfo: null | UTSJSONObject = null;
let jumpTimer: number = 0; let jumpTimer: number = 0;
...@@ -63,7 +68,8 @@ function jump(info: UTSJSONObject, data: any | null): void { ...@@ -63,7 +68,8 @@ function jump(info: UTSJSONObject, data: any | null): void {
return; return;
} }
uni.showLoading({ title: "加载中", mask: true }); // 这里的全屏 loading 会挡住后续页面的骨架屏;改为不加 mask
uni.showLoading({ title: "加载中", mask: false });
console.log(`调用 getMerchantBrand, merchantId: ${ shopMerchantId}`); console.log(`调用 getMerchantBrand, merchantId: ${ shopMerchantId}`);
apiGetMerchantBrand({ merchantId: shopMerchantId }).then((res: any): void => { apiGetMerchantBrand({ merchantId: shopMerchantId }).then((res: any): void => {
...@@ -102,6 +108,10 @@ function jump(info: UTSJSONObject, data: any | null): void { ...@@ -102,6 +108,10 @@ function jump(info: UTSJSONObject, data: any | null): void {
} }
console.log(`准备跳转: ${ url}`); console.log(`准备跳转: ${ url}`);
// 跳转到精品页时,用页面内骨架屏承接加载态,避免全屏 loading 挡住骨架
if (url == "/pages/boutique/index") {
uni.hideLoading();
}
uni.reLaunch({ url }); uni.reLaunch({ url });
}).catch((error) => { }).catch((error) => {
uni.hideLoading(); uni.hideLoading();
...@@ -127,6 +137,9 @@ function jump(info: UTSJSONObject, data: any | null): void { ...@@ -127,6 +137,9 @@ function jump(info: UTSJSONObject, data: any | null): void {
} }
} }
console.log(`准备跳转(catch): ${ url}`); console.log(`准备跳转(catch): ${ url}`);
if (url == "/pages/boutique/index") {
uni.hideLoading();
}
uni.reLaunch({ url }); uni.reLaunch({ url });
}); });
} }
...@@ -134,6 +147,7 @@ function jump(info: UTSJSONObject, data: any | null): void { ...@@ -134,6 +147,7 @@ function jump(info: UTSJSONObject, data: any | null): void {
function init(info: any): void { function init(info: any): void {
// 将 any 转换为 UTSJSONObject // 将 any 转换为 UTSJSONObject
userInfo = info as UTSJSONObject; userInfo = info as UTSJSONObject;
loading.value = false;
console.log("进入选择场景页!"); console.log("进入选择场景页!");
const openSceneArr = userInfo.openSceneArr; const openSceneArr = userInfo.openSceneArr;
console.log(`init - openSceneArr type: ${ typeof openSceneArr}`); console.log(`init - openSceneArr type: ${ typeof openSceneArr}`);
...@@ -185,7 +199,8 @@ function selectScene(item: SceneItem, index: number): void { ...@@ -185,7 +199,8 @@ function selectScene(item: SceneItem, index: number): void {
userInfo.sceneType = sceneType; userInfo.sceneType = sceneType;
uni.showLoading({ title: "加载中", mask: true }); // 用页面内骨架/内容承接加载态,避免全屏遮罩挡住后续页面骨架
uni.showLoading({ title: "加载中", mask: false });
if (isSuper == true) { if (isSuper == true) {
jump(userInfo, null); jump(userInfo, null);
...@@ -213,6 +228,10 @@ defineExpose({ ...@@ -213,6 +228,10 @@ defineExpose({
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.skeleton-wrap {
padding: 24px;
}
.box { .box {
display: flex; display: flex;
align-items: center; align-items: center;
......
export { useUpload } from "./useUpload";
export { useCountDown } from "./useCountDown";
export { useCodeTimer } from "./useCodeTimer";
export { useStorage } from "./useStorage";
export { useTheme, initTheme } from "./useTheme";
import type { UnUseCodeTimer, UnCodeTimerOptions } from "../types/index";
export declare function useCodeTimer(options: UnCodeTimerOptions): UnUseCodeTimer;
import type { UnUseCountDown, UnCountDownOptions } from "../types/index";
export declare function useCountDown(options: UnCountDownOptions): UnUseCountDown;
declare class Storage {
private prefix;
constructor(prefix?: string);
/**
* 获取带前缀的键名
* @param key - 原始键名
* @returns 带前缀的键名
*/
getKeyWithPrefix(key: string): string;
/**
* 检查数据是否过期
* @param expire - 过期时间戳(毫秒)
* @returns 是否已过期
*/
isExpired(expire: number): boolean;
/**
* 转换过期时间为毫秒
* @param expire - 过期时间(秒或毫秒)
* @returns 过期时间(毫秒)
*/
getExpireTime(expire?: number): number;
/**
* 存储数据
* @param key - 存储键名
* @param value - 存储的值
* @param expire - 过期时间(秒),可选
*/
set(key: string, value: any, expire?: number): void;
/**
* 获取数据
* @param key - 存储键名
* @param defaultValue - 默认值,可选
* @returns 存储的值或默认值
*/
get<T = any>(key: string, defaultValue?: any): T;
/**
* 检查键是否存在且未过期
* @param key - 存储键名
* @returns boolean
*/
has(key: string): boolean;
/**
* 删除数据
* @param key - 存储键名
*/
remove(key: string): void;
/**
* 清空命名空间内的所有存储数据
*/
clear(): void;
/**
* 获取所有存储的键名
* @returns string[]
*/
keys(): string[];
/**
* 获取命名空间内的项数量
*/
get size(): number;
/**
* 删除数据(别名)
* @param key - 存储键名
*/
delete(key: string): void;
}
/**
* 基于uniapp的数据存储
* @param prefix - 存储键的前缀,默认空字符串
* @returns Storage 实例
*/
export declare function useStorage(prefix?: string): Storage;
export {};
import { UnUseTheme } from "../types/index";
export declare const themeStore: UTSJSONObject;
export declare const initTheme: any;
export declare const initTheme: (app: VueApp, themeJson: UTSJSONObject) => void;
export declare function useTheme(): UnUseTheme;
import type { UnUseUpload } from "../types/index";
export declare function useUpload(): UnUseUpload;
export * from "./types/index";
export * from "./utils/index";
export * from "./utils/dayjs";
export * from "./utils/request";
export * from "./utils/validator";
export * from "./utils/calendar";
export * from "./utils/area";
export * from "./utils/uarray";
export * from "./utils/ustyle";
export * from "./utils/ucolor";
export * from "./utils/openLink";
export * from "./composables/index";
import type { UnCascaderOption } from "../types/index";
export declare const AreaList: any;
export declare const useAreaCascaderData: () => UnCascaderOption[];
/**
* 农历1900-2100的润大小信息表
* @Array Of Property
* @return Hex
*/
export type InfoType = {
lunarY: number;
lunarM: number;
lunarD: number;
isLeap: boolean;
};
export type LunarInfoType = {
lYear: number;
lMonth: number;
lDay: number;
IMonthCn: string;
IDayCn: string;
cYear: number;
cMonth: number;
cDay: number;
gzYear?: string;
gzMonth?: string;
gzDay?: string;
isToday: boolean;
isLeap: boolean;
nWeek?: number;
ncWeek?: string;
isTerm?: boolean;
Term?: string;
astro?: string;
};
export interface LunarInfoType {
lYear: number;
lMonth: number;
lDay: number;
IMonthCn: string;
IDayCn: string;
cYear: number;
cMonth: number;
cDay: number;
gzYear?: string;
gzMonth?: string;
gzDay?: string;
isToday: boolean;
isLeap: boolean;
nWeek?: number;
ncWeek?: string;
isTerm?: boolean;
Term?: string;
astro?: string;
}
export declare class Lunar {
private lunarYearDaysMap;
private lunarMonthDaysMap;
constructor();
/**
* 传入农历数字月份返回汉语通俗表示法
* @param lunar month
* @return Cn string
* @eg:let cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
*/
toChinaMonth(m: number, leap?: boolean): string;
/**
* 传入农历日期数字返回汉字表示法
* @param lunar day
* @return Cn string
* @eg:let cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
*/
toChinaDay(d: number): string;
/**
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
* @param lunar Year
* @return Number (0-12)
* @eg:let leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
*/
leapMonth(year: number): number;
/**
* 返回农历y年闰月的天数 若该年没有闰月则返回0
* @param lunar Year
* @return Number (0、29、30)
* @eg:let leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
*/
leapDays(year: number): number;
lunarMonthDays(year: number): number[];
lunarYearDays(year: number): number;
/**
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
* @param y solar year
* @param m solar month
* @param d solar day
* @return JSON object
* @eg:console.log(calendar.solar2lunar(1987,11,01));
*/
solar2lunar(y: number, m: number, d: number): LunarInfoType;
solar_date(y: number, m: number, d: number): InfoType;
}
type UnitType = 'year' | 'month' | 'week' | 'date' | 'day' | 'hour' | 'quarter' | 'minute' | 'second' | 'millisecond' | 'timeZoneOffset';
export declare class Dayjs {
private innerDate;
private static defaultFormat;
constructor(config?: string | number | Date | Dayjs | null);
format(formatStr?: string): string;
private toDayjs;
private cloneDate;
add(amount: number, unit: UnitType): Dayjs;
subtract(amount: number, unit: UnitType): Dayjs;
set(unit: UnitType, value: number): Dayjs;
get(unit: UnitType): number;
startOf(unit: UnitType): Dayjs;
endOf(unit: UnitType): Dayjs;
diff(date: Dayjs, unit?: UnitType, floating?: boolean): number;
private monthDiff;
isAfter(date: string | number | Date | Dayjs, unit?: UnitType): boolean;
isSame(date: string | number | Date | Dayjs, unit?: UnitType): boolean;
isBefore(date: string | number | Date | Dayjs, unit?: UnitType): boolean;
isSameOrBefore(date: string | number | Date | Dayjs, unit?: UnitType): boolean;
isSameOrAfter(date: string | number | Date | Dayjs, unit?: UnitType): boolean;
isBetween(date1: string | number | Date | Dayjs, date2: string | number | Date | Dayjs, unit?: UnitType, inclusivity?: '()' | '[]' | '(]' | '[)'): boolean;
clone(): Dayjs;
isValid(): boolean;
valueOf(): number;
toDate(): Date;
toISOString(): string;
toJSON(): string;
unix(): number;
year<T extends Dayjs | number>(value?: number | null): T;
month<T extends Dayjs | number>(value?: number | null): T;
date<T extends Dayjs | number>(value?: number | null): T;
day<T extends Dayjs | number>(value?: number | null): T;
hour<T extends Dayjs | number>(value?: number | null): T;
minute<T extends Dayjs | number>(value?: number | null): T;
second<T extends Dayjs | number>(value?: number | null): T;
millisecond<T extends Dayjs | number>(value?: number | null): T;
quarter(): number;
isToday(): boolean;
isYesterday(): boolean;
isTomorrow(): boolean;
utcOffset(): number;
daysInMonth(): number;
}
export declare function locale(language: string): void;
export declare function dayjs(config?: string | number | Date | Dayjs | null): Dayjs;
export declare function unix(timestamp: number): Dayjs;
export declare function parseTime(timeStr: string): Dayjs;
export declare function isDayjs(d: any): boolean;
export declare function now(): Dayjs;
export {};
export declare function parseObject<T>(data: T): UTSJSONObject;
export declare function uuid(): string;
export declare function padZero(num: number | string, length?: number): string;
/**
* 将hex颜色转换为rgba颜色
* @param hex hex颜色值,支持#333、#333333等格式
* @param alpha 透明度,0-1之间的值,默认为1
* @returns rgba颜色字符串,格式为rgba(r, g, b, a)
*/
export declare function hexToRgba(hex: string, alpha?: number): string;
export declare function getClientRect(selector: string, component?: any | null, fields?: NodeField | null): Promise<NodeInfo>;
export declare function getClientRectAll(selector: string, component?: any | null, fields?: NodeField | null): Promise<NodeInfo[]>;
export declare function toNumber(value: string | number, defaultValue?: number): number;
export declare function sleep(timer?: number): Promise<void>;
/**
* @description 取一个区间数
* @param {Number} min 最小值
* @param {Number} max 最大值
*/
export declare function random(min: number, max: number): number;
export declare function randomStr(length?: number): string;
export declare function getPx(value: string | number, unit?: boolean): any;
export declare function range(min?: number, max?: number, value?: number): number;
export declare function clamp(min?: number, max?: number, value?: number): number;
/**
* 驼峰命名转短横线命名
* @param {string} str 驼峰命名的字符串
* @returns 短横线命名的字符串
*/
export declare function camelToKebab(str: string): string;
/**
* 短横线命名转驼峰命名
* @param {string} str 短横线命名字符串
* @returns 驼峰命名字符串
*/
export declare function kebabToCamel(str: string): string;
/**
* 将驼峰命名转换为下划线命名
* @param str 需要转换的驼峰命名字符串
* @returns 转换后的下划线命名字符串
*/
export declare function camelToSnake(str: string): string;
/**
* 将驼峰命名转换为下划线命名
* @param str 需要转换的驼峰命名字符串
* @returns 转换后的下划线命名字符串
*/
export declare function snakeToCamel(str: string): string;
export declare function numberToChinese(amount: number): string;
export declare function throttle(func: () => void, wait?: number, immediate?: boolean): void;
export declare function debounce(func: () => void, wait?: number, immediate?: boolean): void;
/**
* @description 运行期判断平台
* @returns {string} 返回所在平台(小写)
* @link 运行期判断平台 https://uniapp.dcloud.io/frame?id=判断平台
*/
export declare function getOsName(): string;
export declare function getSystemInfo(): any;
export declare function getWindowInfo(): any;
export declare function openPage(url: string, linkType?: string): void;
/**
* @description 去除空格
* @param String str 需要去除空格的字符串
* @param String pos both(左右)|left|right|all 默认both
*/
export declare function trim(str: string, pos?: string): string;
export declare function buildQuery(params: UTSJSONObject): string;
/**
* @description 添加单位,如果有rpx,upx,%,px等单位结尾或者值为auto,直接返回,否则加上px单位结尾
* @param {string|number} value 需要添加单位的值
* @param {string} unit 添加的单位名 比如px
*/
export declare function addUnit(value?: string | number | null, unit?: string): string;
/**
* 返回对象的所有键名
* @example keys({a: 1, b: 2}) // ['a', 'b']
*/
export declare function keys(value: any): string[];
/**
* 验证电子邮箱格式
*/
export declare function isEmail(value: string): boolean;
/**
* 验证手机格式
*/
export declare function isMobile(value: string): boolean;
/**
* 验证URL格式
*/
export declare function isUrl(value: string): boolean;
/**
* 验证十进制数字
*/
export declare function isNumber(value: string | number): boolean;
/**
* 验证字符串
*/
export declare function isString(value: string): boolean;
/**
* 验证身份证号码
*/
export declare function isIdCard(value: string): boolean;
/**
* 金额,只允许2位小数
*/
export declare function isAmount(value: string | number): boolean;
/**
* 检查值是否为 null
*/
export declare function isNull(value?: any | null): boolean;
/**
* 检查值是否为数组
*/
export declare function isArray(value: any): boolean;
/**
* 检查值是否为对象
*/
export declare function isObject(value: any): boolean;
/**
* 检查值是否为布尔值
*/
export declare function isBoolean(value: any): boolean;
/**
* 检查值是否为函数
*/
export declare function isFunction(value: any): boolean;
/**
* 判断是否为空
*/
export declare function isEmpty(value?: any): boolean;
/**
* 中文
*/
export declare function isChinese(value: string): boolean;
/**
* 验证是否包含某个值
*/
export declare function isContains(value: string, param: string): boolean;
export declare function isVideo(value: string): boolean;
export declare function isImage(value: string): boolean;
import type { UnRequestSuccess, UnRequestOptions } from "../types/index";
type RequestInterceptorFulfilled = (value: UnRequestOptions) => UnRequestOptions | Promise<UnRequestOptions>;
type ResponseInterceptorFulfilled = (value: UnRequestSuccess) => UnRequestSuccess | Promise<UnRequestSuccess>;
type InterceptorRejected = (error: any) => any | Promise<any>;
type RequestInterceptor = {
use: (fulfilled: RequestInterceptorFulfilled, rejected?: InterceptorRejected) => void;
};
type ResponseInterceptor = {
use: (fulfilled: ResponseInterceptorFulfilled, rejected?: InterceptorRejected) => void;
};
type InterceptorManager = {
request: RequestInterceptor;
response: ResponseInterceptor;
};
declare class Request {
interceptors: InterceptorManager;
private requestInterceptors;
private responseInterceptors;
private defaultOptions;
constructor();
private createInterceptors;
private runRequestInterceptors;
private runResponseInterceptors;
private mergeOption;
private mergeUrl;
private http;
private uploadFile;
private downloadFile;
setConfig(options: UnRequestOptions): void;
request(options: UnRequestOptions): Promise<UnRequestSuccess>;
get(url: string, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
head(url: string, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
post(url: string, data?: any | null, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
put(url: string, data?: any | null, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
delete(url: string, data?: any | null, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
options(url: string, data?: any | null, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
upload(url: string, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
download(url: string, options?: UnRequestOptions | null): Promise<UnRequestSuccess>;
}
declare const http: Request;
export { http };
export declare class UArray<T> extends Array<T> {
constructor(len: number);
}
export declare class UColor {
private r;
private g;
private b;
private a;
private format;
constructor(input?: string);
private parseInput;
private parseHex;
private parseRgb;
private parseHsl;
private parseKeyword;
private hslToRgb;
private hsvToRgb;
private rgbToHsl;
private rgbToHsv;
toRgbString(): string;
toHslString(): string;
toHex(a?: boolean): string;
toHexString(a?: boolean): string;
toRgb(): number[];
toHsl(): number[];
toHsv(): number[];
getFormat(): string;
setAlpha(alpha: number): void;
getAlpha(): number;
fromString(color: string): void;
fromHsl(h: number, s: number, l: number): void;
fromHsv(h: number, s: number, v: number): void;
fromRgb(r: number, g: number, b: number, a: number): void;
fromHex(hex: string): void;
}
export declare class UStyle extends Map<string, string | number | null> {
constructor();
set(key: string, value: string | number | null): UStyle;
}
export declare class UStyle {
set(key: string, value: any): this;
get(key: string): any;
clear(): void;
has(key: string): boolean;
delete(key: string): boolean;
forEach(callbackfn: (value: any, key: string, map: UStyle) => void, thisArg?: any): void;
get size(): number;
}
export type UnValidateError = {
field: string;
message: string;
};
export type UnValidateResult = {
valid: boolean;
errors: UnValidateError[];
};
/**
* 表单校验类
*/
export declare class FormValidator {
private messages;
private rules;
constructor(rule: any);
private formatRules;
/**
* 获取错误消息
*/
private getMessage;
/**
* 检查值是否为空
*/
private isEmptyValue;
/**
* 验证类型
*/
private validateType;
/**
* 验证长度
*/
private validateLength;
/**
* 验证正则表达式
*/
private validatePattern;
/**
* 验证空白字符
*/
private validateWhitespace;
/**
* 验证两次输入是否一致
*/
private validateSame;
/**
* 验证必填项
*/
private validateRequired;
/**
* 执行单个规则验证 UnValidateError | null
*/
private validateRule;
/**
* 验证单个字段
*/
validateField(formData: any, field: string, trigger: string): Promise<UnValidateResult>;
/**
* 验证表单数据
*/
validate(data: any): Promise<UnValidateResult>;
}
<div align="center">
<img alt="logo" src="http://uviewui.com/common/logo.png" width="120" height="120" style="margin-bottom: 10px;">
<h1 style="margin: 30px 0 30px;font-weight: bold;font-size:40px;">uView Next 4.0</h1>
<h3>支持uni-app、uniapp x、鸿蒙、微信小程序,全端兼容的UI框架</h3>
</div>
## 📖 简介
uView Next 4.0 并非对 3.x 版本的简单迭代适配,而是基于 Vue3 + UTS 技术栈、采用组合式 API 完成的架构级重构。它以全新设计理念重塑组件体系,通过精简 DOM 节点数量、优化排版渲染链路提升性能,完美兼容 uni-app、uni-app X、鸿蒙、微信小程序生态,真正实现一次开发、全端覆盖的跨端开发目标。
## 📚 文档
- [📄 **官方文档** https://uview-unix.d3u.cn](https://uview-unix.d3u.cn)
## 🔑 技术支持与服务
我们致力于为开发者提供全方位的技术支持体系,确保您在开发过程中获得专业、及时的帮助,让开发更顺畅:
- **官方交流群**:加入官方交流群[点此跳转](https://uview-unix.d3u.cn/components/addQQGroup.html),与核心开发者和社区用户实时交流,快速获取日常使用问题的解决方案
- **文档社区**:参与官方文档的讨论与改进,分享您的使用经验和最佳实践,共同完善uView Unix生态
- **商业支持**:为付费客户提供优先级技术支持服务,确保关键业务项目的顺利推进
- **企业定制服务**:为企业客户提供专属的定制开发服务,满足您的个性化业务需求和技术要求
## ✨ 特性
- 🌍 **全端兼容**:完美支持安卓、iOS、鸿蒙、微信小程序、H5
- 🚀 **原生渲染**:完美支持 UniApp/UniAppX 生态,性能媲美原生应用,流畅体验
- 🧩 **组件丰富**:80+ 高质量组件,覆盖各类业务场景,开箱即用
- 🔧 **工具集合**:实用JS工具库,简化开发流程,大幅提升开发效率
- 📖 **详尽文档**:清晰教程 + 交互演示,显著降低学习成本
- 📦 **按需引入**:智能按需加载,有效减小打包体积,优化性能
- 🔄 **持续迭代**:快速响应用户反馈,不断更新优化功能体验
## 📱 预览
您可以通过**微信**扫码,查看最佳的演示效果。
<img width="200" height="200" src="https://uview-unix.d3u.cn/h5_qrcode.png" alt=""/>
<br>
<br>
APP下载
<img width="200" height="200" src="https://uview-unix.d3u.cn/app_qrcode.png" alt=""/>
## 🔗 重要链接
- [🌐 官方文档](https://uview-unix.d3u.cn/)
- [📝 更新日志](https://uview-unix.d3u.cn/components/changelog.html)
- [👥 关于我们](https://uview-unix.d3u.cn/cooperation/about.html)
### 📦 快速安装
请通过[官网安装文档](https://uview-unix.d3u.cn/components/downloadSetting.html)了解更详细的内容
### 🚀 快速上手
请通过[快速上手](https://uview-unix.d3u.cn/components/quickstart.html)了解更详细的内容
{
"name": "un-action-sheet",
"description": "本组件用于从底部弹出一个操作菜单,供用户选择并返回结果。本组件功能类似于uni的uni.showActionSheetAPI,配置更加灵活,所有平台都表现一致。",
"example": "<un-action-sheet ref=\"uActionSheet\"",
"tutorial": "https://uview.d3u.cn/components/actionSheet.html",
"attributes": [
{
"name": "[event]select",
"description": "点击ActionSheet列表项时触发",
"type": "Function"
},
{
"name": "[event]close",
"description": "点击取消按钮时触发",
"type": "Function"
},
{
"name": "[event]getuserinfo",
"description": "用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 wx.getUserInfo 返回的一致,openType=\"getUserInfo\"时有效",
"type": "Function"
},
{
"name": "[event]contact",
"description": "客服消息回调,openType=\"contact\"时有效",
"type": "Function"
},
{
"name": "[event]getphonenumber",
"description": "获取用户手机号回调,openType=\"getPhoneNumber\"时有效",
"type": "Function"
},
{
"name": "[event]chooseavatar",
"description": "选择头像回调,openType=\"chooseAvatar\"时有效",
"type": "Function"
},
{
"name": "[event]error",
"description": "当使用开放能力时,发生错误的回调,openType=\"error\"时有效",
"type": "Function"
},
{
"name": "[event]launchapp",
"description": "打开 APP 成功的回调,openType=\"launchApp\"时有效",
"type": "Function"
},
{
"name": "[event]opensetting",
"description": "在打开授权设置页后回调,openType=\"openSetting\"时有效",
"type": "Function"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "description",
"type": "string",
"values": []
},
{
"name": "actions",
"type": "{}",
"values": []
},
{
"name": "cancelText",
"type": "string",
"values": []
},
{
"name": "closeOnClickAction",
"type": "boolean",
"values": []
},
{
"name": "safeAreaInsetBottom",
"type": "boolean",
"values": []
},
{
"name": "openType",
"type": "string",
"values": []
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": []
},
{
"name": "round",
"type": "string | number",
"values": []
},
{
"name": "height",
"type": "string | number",
"values": []
},
{
"name": "lang",
"type": "string",
"values": []
},
{
"name": "sessionFrom",
"type": "string",
"values": []
},
{
"name": "sendMessageTitle",
"type": "string",
"values": []
},
{
"name": "sendMessagePath",
"type": "string",
"values": []
},
{
"name": "sendMessageImg",
"type": "string",
"values": []
},
{
"name": "showMessageCard",
"type": "boolean",
"values": []
},
{
"name": "appParameter",
"type": "string",
"values": []
},
{
"name": "titleStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
},
{
"name": "closeable",
"type": "boolean",
"values": [],
"defaultValue": "false"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-album",
"description": "本组件提供一个类似相册的功能,让开发者开发起来更加得心应手。减少重复的模板代码",
"example": "<un-album :urls=\"urls2\"",
"tutorial": "https://uview.d3u.cn/components/album.html",
"attributes": [
{
"name": "[event]albumWidth",
"description": "某些特殊的情况下,需要让文字与相册的宽度相等,这里事件的形式对外发送 (回调参数 width )",
"type": "Function"
},
{
"name": "urls",
"type": "{}",
"values": []
},
{
"name": "singleSize",
"type": "string | number",
"values": []
},
{
"name": "multipleSize",
"type": "string | number",
"values": []
},
{
"name": "space",
"type": "string | number",
"values": []
},
{
"name": "singleMode",
"type": "string",
"values": []
},
{
"name": "multipleMode",
"type": "string",
"values": []
},
{
"name": "maxCount",
"type": "string | number",
"values": []
},
{
"name": "previewFullImage",
"type": "boolean",
"values": []
},
{
"name": "rowCount",
"type": "string | number",
"values": []
},
{
"name": "showMore",
"type": "boolean",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-alert",
"description": "警告提示,展现需要关注的信息。",
"example": "<un-alert :title=\"title\" type = \"warning\" :closable=\"closable\" :description = \"description\"></un-alert>",
"tutorial": "https://uview.d3u.cn/components/alertTips.html",
"attributes": [
{
"name": "[event]click",
"description": "点击组件时触发",
"type": "Function"
},
{
"name": "[event]close",
"description": "点击关闭按钮时触发",
"type": "Function"
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "type",
"type": "string",
"values": []
},
{
"name": "description",
"type": "string",
"values": []
},
{
"name": "closable",
"type": "boolean",
"values": []
},
{
"name": "showIcon",
"type": "boolean",
"values": []
},
{
"name": "center",
"type": "boolean",
"values": []
},
{
"name": "fontSize",
"type": "string | number",
"values": []
},
{
"name": "effect",
"type": "\"light\" | \"dark\" | \"plain\"",
"values": [
{
"name": "light",
"description": ""
},
{
"name": "dark",
"description": ""
},
{
"name": "plain"
}
],
"defaultValue": "'light'"
},
{
"name": "round",
"type": "string | number",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-amount",
"description": "用于展示金额、价格等,可以转换为人民币大写,支持动画效果",
"example": "<un-amount v-model=\"123456.789\" :show-separator=\"true\" />",
"tutorial": "https://uviewui.com/components/amount.html",
"attributes": [
{
"name": "symbol",
"type": "string",
"values": []
},
{
"name": "reverse",
"type": "boolean",
"values": []
},
{
"name": "precision",
"type": "number",
"values": []
},
{
"name": "roundUp",
"type": "boolean",
"values": []
},
{
"name": "transition",
"type": "boolean",
"values": []
},
{
"name": "duration",
"type": "number",
"values": []
},
{
"name": "separatorDigits",
"type": "number",
"values": []
},
{
"name": "separator",
"type": "string",
"values": []
},
{
"name": "showSymbol",
"type": "boolean",
"values": []
},
{
"name": "showDecimal",
"type": "boolean",
"values": []
},
{
"name": "showSeparator",
"type": "boolean",
"values": []
},
{
"name": "capital",
"type": "boolean",
"values": []
},
{
"name": "fontSize",
"type": "String",
"values": []
},
{
"name": "fontSizeRatio",
"type": "String|Number",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "colorRatio",
"type": "String",
"values": []
},
{
"name": "value",
"type": "string | number",
"values": [],
"defaultValue": "0"
},
{
"name": "modelValue",
"type": "string | number",
"values": [],
"defaultValue": "null"
},
{
"name": "size",
"type": "string",
"values": [],
"defaultValue": "''"
},
{
"name": "symbolSize",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "decimalSize",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "symbolColor",
"type": "string",
"values": [],
"defaultValue": "''"
},
{
"name": "decimalColor",
"type": "string",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-avatar-group",
"description": "本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。",
"example": "<un-avatar-group gap=\"0.4\" ></un-avatar-group>",
"tutorial": "https://uview.d3u.cn/components/avatar.html",
"attributes": [
{
"name": "[event]showMore",
"description": "头像组更多点击",
"type": "Function"
},
{
"name": "maxCount",
"type": "string | number",
"values": []
},
{
"name": "showMore",
"type": "boolean",
"values": []
},
{
"name": "gap",
"type": "string | number",
"values": []
},
{
"name": "extraValue",
"type": "string | number",
"values": []
},
{
"name": "extraStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-avatar",
"description": "本组件一般用于展示头像的地方,如个人中心,或者评论列表页的用户头像展示等场所。",
"example": "<un-avatar :src=\"src\" mode=\"square\"></un-avatar>",
"tutorial": "https://uview.d3u.cn/components/avatar.html",
"attributes": [
{
"name": "[event]click",
"description": "点击组件时触发 index: 用户传递的标识符",
"type": "Function"
},
{
"name": "src",
"type": "string",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "size",
"type": "string | number",
"values": []
},
{
"name": "mode",
"type": "string",
"values": []
},
{
"name": "text",
"type": "string",
"values": []
},
{
"name": "bgColor",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "fontSize",
"type": "string | number",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "mpAvatar",
"type": "boolean",
"values": []
},
{
"name": "randomBgColor",
"type": "boolean",
"values": []
},
{
"name": "defaultUrl",
"type": "string",
"values": []
},
{
"name": "colorIndex",
"type": "string | number",
"values": []
},
{
"name": "name",
"type": "string",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-back-top",
"description": "本组件一个用于长页面,滑动一定距离后,出现返回顶部按钮,方便快速返回顶部的场景。",
"example": "<un-back-top :scrollTop=\"scrollTop\"></un-back-top>",
"tutorial": "https://uviewui.com/components/backTop.html",
"attributes": [
{
"name": "[event]click",
"description": "",
"type": "Event"
},
{
"name": "mode",
"type": "string",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "text",
"type": "string",
"values": []
},
{
"name": "duration",
"type": "string | number",
"values": []
},
{
"name": "scrollTop",
"type": "string | number",
"values": []
},
{
"name": "top",
"type": "string | number",
"values": []
},
{
"name": "bottom",
"type": "string | number",
"values": []
},
{
"name": "right",
"type": "string | number",
"values": []
},
{
"name": "width",
"type": "string | number",
"values": []
},
{
"name": "height",
"type": "string | number",
"values": []
},
{
"name": "zIndex",
"type": "string | number",
"values": []
},
{
"name": "iconSize",
"type": "string | number",
"values": []
},
{
"name": "iconColor",
"type": "string",
"values": []
},
{
"name": "textSize",
"type": "string | number",
"values": []
},
{
"name": "textColor",
"type": "string",
"values": []
},
{
"name": "bgColor",
"type": "string",
"values": []
},
{
"name": "customStyle",
"type": "string | object",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-badge",
"description": "该组件一般用于图标右上角显示未读的消息数量,提示用户点击,有圆点和圆包含文字两种形式。",
"example": "<un-badge :type=\"type\" :count=\"count\"></un-badge>",
"tutorial": "https://uviewui.com/components/badge.html",
"attributes": [
{
"name": "isDot",
"type": "boolean",
"values": []
},
{
"name": "value",
"type": "string | number",
"values": []
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "max",
"type": "string | number",
"values": []
},
{
"name": "type",
"type": "string",
"values": []
},
{
"name": "showZero",
"type": "boolean",
"values": []
},
{
"name": "bgColor",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "numberType",
"type": "string",
"values": []
},
{
"name": "offset",
"type": "Array<string | number>",
"values": []
},
{
"name": "inverted",
"type": "boolean",
"values": []
},
{
"name": "fixed",
"type": "Boolean",
"values": []
},
{
"name": "customStyle",
"type": "string | object",
"values": []
},
{
"name": "position",
"type": "\"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\"",
"values": [
{
"name": "top-left",
"description": ""
},
{
"name": "top-right",
"description": ""
},
{
"name": "bottom-left",
"description": ""
},
{
"name": "bottom-right"
}
],
"defaultValue": "'top-right'"
},
{
"name": "absolute",
"type": "boolean",
"values": [],
"defaultValue": "false"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-button",
"description": "Button 按钮",
"example": "<un-button>月落</un-button>",
"tutorial": "https://www.uviewui.com/components/button.html",
"attributes": [
{
"name": "[event]click",
"description": "非禁止并且非加载中,才能点击",
"type": "Function"
},
{
"name": "[event]getphonenumber",
"description": "open-type=\"getPhoneNumber\"时有效",
"type": "Function"
},
{
"name": "[event]getuserinfo",
"description": "用户点击该按钮时,会返回获取到的用户信息,从返回参数的detail中获取到的值同uni.getUserInfo",
"type": "Function"
},
{
"name": "[event]error",
"description": "当使用开放能力时,发生错误的回调",
"type": "Function"
},
{
"name": "[event]opensetting",
"description": "在打开授权设置页并关闭后回调",
"type": "Function"
},
{
"name": "[event]launchapp",
"description": "打开 APP 成功的回调",
"type": "Function"
},
{
"name": "[event]chooseavatar",
"description": "选择头像回调,openType=\"chooseAvatar\"时有效",
"type": "Function"
},
{
"name": "[event]agreeprivacyauthorization",
"description": "用户同意隐私协议事件回调",
"type": "Function"
},
{
"name": "hairline",
"type": "boolean",
"values": []
},
{
"name": "type",
"type": "string",
"values": []
},
{
"name": "size",
"type": "string",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "block",
"type": "boolean",
"values": []
},
{
"name": "flex",
"type": "boolean",
"values": []
},
{
"name": "plain",
"type": "boolean",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "loading",
"type": "boolean",
"values": []
},
{
"name": "loadingMode",
"type": "string",
"values": []
},
{
"name": "loadingSize",
"type": "string | number",
"values": []
},
{
"name": "loadingIcon",
"type": "string",
"values": []
},
{
"name": "openType",
"type": "string",
"values": []
},
{
"name": "formType",
"type": "string",
"values": []
},
{
"name": "appParameter",
"type": "string",
"values": []
},
{
"name": "hoverClass",
"type": "string",
"values": []
},
{
"name": "hoverStopPropagation",
"type": "boolean",
"values": []
},
{
"name": "lang",
"type": "string",
"values": []
},
{
"name": "sessionFrom",
"type": "string",
"values": []
},
{
"name": "sendMessageTitle",
"type": "string",
"values": []
},
{
"name": "sendMessagePath",
"type": "string",
"values": []
},
{
"name": "sendMessageImg",
"type": "string",
"values": []
},
{
"name": "showMessageCard",
"type": "boolean",
"values": []
},
{
"name": "dataName",
"type": "string",
"values": []
},
{
"name": "throttleTime",
"type": "string | number",
"values": []
},
{
"name": "hoverStartTime",
"type": "string | number",
"values": []
},
{
"name": "hoverStayTime",
"type": "string | number",
"values": []
},
{
"name": "text",
"type": "string | number",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "iconColor",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "customStyle",
"type": "string | object",
"values": []
},
{
"name": "iconPosition",
"type": "string",
"values": [],
"defaultValue": "'left'"
},
{
"name": "round",
"type": "string | number",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-calendar-month",
"description": "此组件用于单个选择日期,范围选择日期等,日历视图组件。",
"example": "<un-calendar-month mode=\"multiple\"",
"tutorial": "https://uview.d3u.cn/components/calendar.html",
"attributes": [
{
"name": "[event]change",
"description": "日期选择发生变化时触发",
"type": "Function()"
},
{
"name": "[event]select",
"description": "选择日期时触发",
"type": "Function()"
},
{
"name": "[event]monthSwitch",
"description": "月份切换时触发",
"type": "Function()"
},
{
"name": "showTitle",
"type": "boolean",
"values": []
},
{
"name": "mode",
"type": "string",
"values": []
},
{
"name": "selectedHighlight",
"type": "boolean",
"values": []
},
{
"name": "firstDayOfWeek",
"type": "number",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "startText",
"type": "string",
"values": []
},
{
"name": "endText",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "rowHeight",
"type": "string | number",
"values": []
},
{
"name": "showLunar",
"type": "boolean",
"values": []
},
{
"name": "showMark",
"type": "boolean",
"values": []
},
{
"name": "readonly",
"type": "boolean",
"values": []
},
{
"name": "minDate",
"type": "string | number",
"values": []
},
{
"name": "maxDate",
"type": "string | number",
"values": []
},
{
"name": "disabledDate",
"type": "Array<any>",
"values": []
},
{
"name": "selected",
"type": "{}",
"values": [],
"defaultValue": "[]"
},
{
"name": "showOtherMonthDays",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "extend",
"type": "{}",
"values": [],
"defaultValue": "[]"
},
{
"name": "current",
"type": "string",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-calendar-view",
"description": "此组件用于单个选择日期,范围选择日期等,日历视图组件。",
"example": "<un-calendar-view :defaultDate=\"defaultDateMultiple\" mode=\"multiple\"",
"tutorial": "https://uview.d3u.cn/components/calendar.html",
"attributes": [
{
"name": "[event]change",
"description": "日期选择发生变化时触发",
"type": "Function()"
},
{
"name": "[event]select",
"description": "选择日期时触发",
"type": "Function()"
},
{
"name": "[event]monthSwitch",
"description": "月份切换时触发",
"type": "Function()"
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "showTitle",
"type": "boolean",
"values": []
},
{
"name": "showSubtitle",
"type": "boolean",
"values": []
},
{
"name": "mode",
"type": "string",
"values": []
},
{
"name": "selectedHighlight",
"type": "boolean",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "startText",
"type": "string",
"values": []
},
{
"name": "endText",
"type": "string",
"values": []
},
{
"name": "firstDayOfWeek",
"type": "number",
"values": []
},
{
"name": "showOtherMonthDays",
"type": "boolean",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "swiperDirection",
"type": "\"vertical\" | \"horizontal\"",
"values": []
},
{
"name": "monthNum",
"type": "string | number",
"values": []
},
{
"name": "defaultDate",
"type": "Array<any>",
"values": []
},
{
"name": "maxCount",
"type": "string | number",
"values": []
},
{
"name": "rowHeight",
"type": "string | number",
"values": []
},
{
"name": "showLunar",
"type": "boolean",
"values": []
},
{
"name": "showMark",
"type": "boolean",
"values": []
},
{
"name": "readonly",
"type": "boolean",
"values": []
},
{
"name": "allRangeDates",
"type": "boolean",
"values": []
},
{
"name": "maxRange",
"type": "string | number",
"values": []
},
{
"name": "rangePrompt",
"type": "string",
"values": []
},
{
"name": "showRangePrompt",
"type": "boolean",
"values": []
},
{
"name": "allowSameDay",
"type": "boolean",
"values": []
},
{
"name": "switchMode",
"type": "\"none\" | \"year\" | \"month\" | \"year-month\"",
"values": []
},
{
"name": "viewMode",
"type": "\"swiper\" | \"scroll\" | \"single\"",
"values": []
},
{
"name": "weekdays",
"type": "string",
"values": []
},
{
"name": "minDate",
"type": "string | number",
"values": []
},
{
"name": "maxDate",
"type": "string | number",
"values": []
},
{
"name": "disabledDate",
"type": "Array<any>",
"values": []
},
{
"name": "extend",
"type": "Array<CalendarExtend>",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-calendar",
"description": "此组件用于单个选择日期,范围选择日期等,日历被包裹在底部弹起的容器中.",
"example": "<un-calendar :defaultDate=\"defaultDateMultiple\" :show=\"show\" mode=\"multiple\"",
"tutorial": "https://uview.d3u.cn/components/calendar.html",
"attributes": [
{
"name": "[event]confirm",
"description": "点击确定按钮时触发\t\t选择日期相关的返回参数",
"type": "Function()"
},
{
"name": "[event]close",
"description": "日历关闭时触发\t\t\t可定义页面关闭时的回调事件",
"type": "Function()"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "showTitle",
"type": "boolean",
"values": []
},
{
"name": "showSubtitle",
"type": "boolean",
"values": []
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": []
},
{
"name": "firstDayOfWeek",
"type": "number",
"values": []
},
{
"name": "showOtherMonthDays",
"type": "boolean",
"values": []
},
{
"name": "mode",
"type": "string",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "startText",
"type": "string",
"values": []
},
{
"name": "endText",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "viewMode",
"type": "string",
"values": []
},
{
"name": "minDate",
"type": "string | number",
"values": []
},
{
"name": "maxDate",
"type": "string | number",
"values": []
},
{
"name": "defaultDate",
"type": "Array<any>",
"values": []
},
{
"name": "swiperDirection",
"type": "\"vertical\" | \"horizontal\"",
"values": []
},
{
"name": "maxCount",
"type": "string | number",
"values": []
},
{
"name": "rowHeight",
"type": "string | number",
"values": []
},
{
"name": "formatter",
"type": "Function",
"values": []
},
{
"name": "showLunar",
"type": "boolean",
"values": []
},
{
"name": "showMark",
"type": "boolean",
"values": []
},
{
"name": "readonly",
"type": "boolean",
"values": []
},
{
"name": "maxRange",
"type": "string | number",
"values": []
},
{
"name": "rangePrompt",
"type": "string",
"values": []
},
{
"name": "showRangePrompt",
"type": "boolean",
"values": []
},
{
"name": "monthNum",
"type": "string | number",
"values": []
},
{
"name": "allowSameDay",
"type": "boolean",
"values": []
},
{
"name": "disabledDate",
"type": "Array<any>",
"values": []
},
{
"name": "weekdays",
"type": "string",
"values": []
},
{
"name": "buttonDisabled",
"type": "boolean",
"values": []
},
{
"name": "showConfirm",
"type": "boolean",
"values": []
},
{
"name": "round",
"type": "string | number",
"values": []
},
{
"name": "confirmText",
"type": "string",
"values": []
},
{
"name": "confirmDisabledText",
"type": "string",
"values": []
},
{
"name": "selectedHighlight",
"type": "boolean",
"values": []
},
{
"name": "extend",
"type": "Array<CalendarExtend>",
"values": [],
"defaultValue": "[]"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-canvas",
"attributes": [
{
"name": "[event]onTouchstart",
"description": "",
"type": "Event"
},
{
"name": "[event]onTouchmove",
"description": "",
"type": "Event"
},
{
"name": "[event]onTouchend",
"description": "",
"type": "Event"
},
{
"name": "[event]onTouchcancel",
"description": "",
"type": "Event"
},
{
"name": "[event]onLongtap",
"description": "",
"type": "Event"
},
{
"name": "[event]onError",
"description": "",
"type": "Event"
},
{
"name": "type",
"type": "\"2d\" | \"webgl\"",
"values": [
{
"name": "2d",
"description": ""
},
{
"name": "webgl"
}
],
"defaultValue": "'webgl'"
},
{
"name": "width",
"type": "string | number",
"values": [],
"defaultValue": "375"
},
{
"name": "height",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "disableScroll",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "customStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-card",
"description": "卡片组件一般用于多个列表条目,且风格统一的场景",
"example": "<un-card padding=\"30\" title=\"card\"></un-card>",
"tutorial": "https://uview.d3u.cn/components/card.html",
"attributes": [
{
"name": "[event]click",
"description": "整个卡片任意位置被点击时触发",
"type": "Function"
},
{
"name": "[event]headClick",
"description": "卡片头部被点击时触发",
"type": "Function"
},
{
"name": "[event]bodyClick",
"description": "卡片主体部分被点击时触发",
"type": "Function"
},
{
"name": "[event]footClick",
"description": "卡片底部部分被点击时触发",
"type": "Function"
},
{
"name": "[event]headerClick",
"description": "",
"type": "Event"
},
{
"name": "[event]footerClick",
"description": "",
"type": "Event"
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "titleColor",
"type": "string",
"values": []
},
{
"name": "titleSize",
"type": "string | number",
"values": []
},
{
"name": "subTitle",
"type": "string",
"values": []
},
{
"name": "subTitleColor",
"type": "string",
"values": []
},
{
"name": "subTitleSize",
"type": "string | number",
"values": []
},
{
"name": "border",
"type": "boolean",
"values": []
},
{
"name": "index",
"type": "string | number",
"values": []
},
{
"name": "shadow",
"type": "boolean",
"values": []
},
{
"name": "round",
"type": "string | number",
"values": []
},
{
"name": "headerStyle",
"type": "string | object",
"values": []
},
{
"name": "bodyStyle",
"type": "string | object",
"values": []
},
{
"name": "footerStyle",
"type": "string | object",
"values": []
},
{
"name": "headerBorderBottom",
"type": "boolean",
"values": []
},
{
"name": "footerBorderTop",
"type": "boolean",
"values": []
},
{
"name": "extra",
"type": "string",
"values": []
},
{
"name": "thumb",
"type": "string",
"values": []
},
{
"name": "thumbWidth",
"type": "string | number",
"values": []
},
{
"name": "thumbCircle",
"type": "boolean",
"values": []
},
{
"name": "extraColor",
"type": "string",
"values": [],
"defaultValue": "null"
},
{
"name": "extraSize",
"type": "string | number",
"values": [],
"defaultValue": "null"
},
{
"name": "bgColor",
"type": "string",
"values": [],
"defaultValue": "null"
},
{
"name": "thumbRadius",
"type": "string | number",
"values": [],
"defaultValue": "null"
},
{
"name": "padding",
"type": "string | number",
"values": [],
"defaultValue": "null"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-cascader-picker",
"description": "级联选择器(弹出层),用于多级数据的选择,支持单选和多选模式",
"example": "<un-cascader-picker :show=\"show\" :options=\"options\"",
"tutorial": "https://uview.d3u.cn/components/cascader-picker.html",
"attributes": [
{
"name": "[event]confirm",
"description": "确认选择时触发",
"type": "Function"
},
{
"name": "[event]cancel",
"description": "取消选择时触发",
"type": "Function"
},
{
"name": "[event]change",
"description": "选择内容变化时触发",
"type": "Function"
},
{
"name": "[event]close",
"description": "关闭选择器时触发",
"type": "Function"
},
{
"name": "[event]update:modelValue",
"description": "",
"type": "Event"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "titleStyle",
"type": "string | object",
"values": []
},
{
"name": "options",
"type": "{}",
"values": []
},
{
"name": "modelValue",
"type": "Array<string | number>",
"values": []
},
{
"name": "value",
"type": "Array<string | number>",
"values": []
},
{
"name": "placeholder",
"type": "string",
"values": []
},
{
"name": "itemHeight",
"type": "string",
"values": []
},
{
"name": "confirmText",
"type": "string",
"values": []
},
{
"name": "cancelText",
"type": "string",
"values": []
},
{
"name": "confirmDisabled",
"type": "boolean",
"values": []
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": []
},
{
"name": "showToolbar",
"type": "boolean",
"values": []
},
{
"name": "showTabbar",
"type": "boolean",
"values": []
},
{
"name": "activeColor",
"type": "string",
"values": []
},
{
"name": "activeBgColor",
"type": "string",
"values": []
},
{
"name": "activeBold",
"type": "boolean",
"values": []
},
{
"name": "activeLabelColor",
"type": "string",
"values": []
},
{
"name": "customStyle",
"type": "string | object",
"values": []
},
{
"name": "round",
"type": "string | number",
"values": []
},
{
"name": "safeAreaInsetBottom",
"type": "boolean",
"values": []
},
{
"name": "zIndex",
"type": "string | number",
"values": []
},
{
"name": "loading",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "confirmColor",
"type": "string",
"values": [],
"defaultValue": "''"
},
{
"name": "cancelColor",
"type": "string",
"values": [],
"defaultValue": "''"
},
{
"name": "visibleItemCount",
"type": "string | number",
"values": [],
"defaultValue": "5"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-cascader",
"description": "级联选择器,用于多级数据的选择,支持单选和多选模式",
"example": "<un-cascader :show=\"show\" :options=\"options\"",
"tutorial": "https://uview.d3u.cn/components/cascader.html",
"attributes": [
{
"name": "[event]change",
"description": "选择改变时触发",
"type": "Function"
},
{
"name": "[event]close",
"description": "关闭时触发",
"type": "Function"
},
{
"name": "[event]confirm",
"description": "确认选择时触发",
"type": "Function"
},
{
"name": "[event]selected",
"description": "选择时触发",
"type": "Function"
},
{
"name": "[event]update:modelValue",
"description": "",
"type": "Event"
},
{
"name": "[event]select",
"description": "",
"type": "Event"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "height",
"type": "string | number",
"values": []
},
{
"name": "titleStyle",
"type": "string | object",
"values": []
},
{
"name": "options",
"type": "{}",
"values": []
},
{
"name": "modelValue",
"type": "Array<string | number>",
"values": []
},
{
"name": "value",
"type": "Array<string | number>",
"values": []
},
{
"name": "placeholder",
"type": "string",
"values": []
},
{
"name": "closeable",
"type": "boolean",
"values": []
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": []
},
{
"name": "bgColor",
"type": "string",
"values": []
},
{
"name": "activeColor",
"type": "string",
"values": []
},
{
"name": "activeBgColor",
"type": "string",
"values": []
},
{
"name": "activeBold",
"type": "boolean",
"values": []
},
{
"name": "iconColor",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "fontSize",
"type": "string",
"values": []
},
{
"name": "round",
"type": "string | number",
"values": []
},
{
"name": "zIndex",
"type": "string | number",
"values": []
},
{
"name": "safeAreaInsetBottom",
"type": "boolean",
"values": []
},
{
"name": "itemHeight",
"type": "string",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-cell-group",
"description": "cellGroup用于将多个cell组件组合在一起,形成一个列表组。",
"example": "<un-cell-group title=\"设置喜好\">",
"tutorial": "https://uviewui.com/components/cell.html",
"attributes": [
{
"name": "[event]click",
"description": "点击cell列表时触发",
"type": "Function"
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "border",
"type": "boolean",
"values": []
},
{
"name": "backgroundColor",
"type": "string",
"values": []
},
{
"name": "round",
"type": "string",
"values": []
},
{
"name": "borderColor",
"type": "string",
"values": []
},
{
"name": "borderOffset",
"type": "{}",
"values": [],
"defaultValue": "null"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-cell",
"description": "cell单元格一般用于一组列表的情况,比如个人中心页,设置页等。",
"example": "该组件需要搭配cell-group组件使用,见官方文档示例",
"tutorial": "https://uviewui.com/components/cell.html",
"attributes": [
{
"name": "[event]click",
"description": "点击cell列表时触发",
"type": "Function"
},
{
"name": "title",
"type": "string | number",
"values": []
},
{
"name": "label",
"type": "string | number",
"values": []
},
{
"name": "value",
"type": "string | number",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "border",
"type": "boolean",
"values": []
},
{
"name": "borderColor",
"type": "string",
"values": []
},
{
"name": "center",
"type": "boolean",
"values": []
},
{
"name": "url",
"type": "string",
"values": []
},
{
"name": "linkType",
"type": "string",
"values": []
},
{
"name": "clickable",
"type": "boolean",
"values": []
},
{
"name": "isLink",
"type": "boolean",
"values": []
},
{
"name": "required",
"type": "boolean",
"values": []
},
{
"name": "rightIcon",
"type": "string",
"values": []
},
{
"name": "arrowDirection",
"type": "string",
"values": []
},
{
"name": "iconStyle",
"type": "string | object",
"values": []
},
{
"name": "rightIconStyle",
"type": "string | object",
"values": []
},
{
"name": "titleStyle",
"type": "string | object",
"values": []
},
{
"name": "size",
"type": "string",
"values": []
},
{
"name": "stop",
"type": "boolean",
"values": []
},
{
"name": "name",
"type": "string | number",
"values": []
},
{
"name": "borderOffset",
"type": "{}",
"values": [],
"defaultValue": "null"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-checkbox-group",
"description": "多选框组用于有多个选择,用户可以选择其中多个的场景。搭配un-checkbox使用",
"example": "<un-checkbox-group v-model=\"value\"></un-checkbox-group>",
"tutorial": "https://uview.d3u.cn/components/checkbox.html",
"attributes": [
{
"name": "[event]change",
"description": "任一个checkbox状态发生变化时触发",
"type": "Function"
},
{
"name": "[event]update:modelValue",
"description": "",
"type": "Event"
},
{
"name": "modelValue",
"type": "Array<string | number>",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "activeColor",
"type": "string",
"values": []
},
{
"name": "inactiveColor",
"type": "string",
"values": []
},
{
"name": "name",
"type": "string",
"values": []
},
{
"name": "size",
"type": "string | number",
"values": []
},
{
"name": "placement",
"type": "string",
"values": []
},
{
"name": "label",
"type": "string",
"values": []
},
{
"name": "labelColor",
"type": "string",
"values": []
},
{
"name": "labelSize",
"type": "string | number",
"values": []
},
{
"name": "labelDisabled",
"type": "boolean",
"values": []
},
{
"name": "iconColor",
"type": "string",
"values": []
},
{
"name": "iconSize",
"type": "string | number",
"values": []
},
{
"name": "borderBottom",
"type": "boolean",
"values": []
},
{
"name": "iconPlacement",
"type": "string",
"values": []
},
{
"name": "activeLabelColor",
"type": "string",
"values": []
},
{
"name": "plain",
"type": "boolean",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-checkbox",
"description": "单选框用于有一个选择,用户只能选择其中一个的场景。搭配un-checkbox-group使用",
"example": "<un-checkbox :labelDisabled=\"false\">门掩黄昏,无计留春住</un-checkbox>",
"tutorial": "https://uview.d3u.cn/components/checkbox.html",
"attributes": [
{
"name": "[event]change",
"description": "某个checkbox状态发生变化时触发(选中状态)",
"type": "Function"
},
{
"name": "[event]update:checked",
"description": "",
"type": "Event"
},
{
"name": "name",
"type": "string | number | boolean",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "labelDisabled",
"type": "boolean",
"values": []
},
{
"name": "activeColor",
"type": "string",
"values": []
},
{
"name": "inactiveColor",
"type": "string",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "iconSize",
"type": "string | number",
"values": []
},
{
"name": "labelSize",
"type": "string | number",
"values": []
},
{
"name": "label",
"type": "string | number",
"values": []
},
{
"name": "size",
"type": "string | number",
"values": []
},
{
"name": "iconColor",
"type": "string",
"values": []
},
{
"name": "labelColor",
"type": "string",
"values": []
},
{
"name": "activeLabelColor",
"type": "string",
"values": []
},
{
"name": "checked",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "indeterminate",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "iconPlacement",
"type": "string",
"values": [],
"defaultValue": "null"
},
{
"name": "customStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-circle-progress",
"description": "展示操作或任务的当前进度,比如上传文件,是一个圆形的进度条。支持动态增加和减少进度值。",
"example": "<un-circle-progress active-color=\"#2979ff\" :value=\"80\"></un-circle-progress>",
"tutorial": "https://uview.d3u.cn/components/circleProgress.html",
"attributes": [
{
"name": "value",
"type": "number",
"values": []
},
{
"name": "size",
"type": "number",
"values": []
},
{
"name": "max",
"type": "number",
"values": []
},
{
"name": "clockwise",
"type": "boolean",
"values": []
},
{
"name": "duration",
"type": "number",
"values": []
},
{
"name": "type",
"type": "string",
"values": []
},
{
"name": "inactiveColor",
"type": "string",
"values": [],
"defaultValue": "'#ececec'"
},
{
"name": "activeColor",
"type": "string",
"values": [],
"defaultValue": "'#19be6b'"
},
{
"name": "strokeWidth",
"type": "number",
"values": [],
"defaultValue": "14"
},
{
"name": "startAngle",
"type": "number",
"values": [],
"defaultValue": "-Math.PI / 2"
},
{
"name": "bgColor",
"type": "string",
"values": [],
"defaultValue": "null"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-close",
"description": "用于关闭操作,通常用于标签、弹窗等场景",
"attributes": [
{
"name": "[event]click",
"description": "",
"type": "Event"
},
{
"name": "closable",
"type": "boolean",
"values": []
},
{
"name": "closeInside",
"type": "boolean",
"values": []
},
{
"name": "closeColor",
"type": "string",
"values": []
},
{
"name": "closeSize",
"type": "string | number",
"values": []
},
{
"name": "size",
"type": "string | number",
"values": [],
"defaultValue": "16"
},
{
"name": "bgColor",
"type": "string",
"values": [],
"defaultValue": "null"
},
{
"name": "type",
"type": "\"primary\" | \"error\" | \"success\" | \"warning\" | \"info\"",
"values": [
{
"name": "primary",
"description": ""
},
{
"name": "error",
"description": ""
},
{
"name": "success",
"description": ""
},
{
"name": "warning",
"description": ""
},
{
"name": "info",
"description": ""
}
],
"defaultValue": "null"
},
{
"name": "showIcon",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "iconName",
"type": "string",
"values": [],
"defaultValue": "'close'"
},
{
"name": "iconScale",
"type": "number",
"values": [],
"defaultValue": "0.6"
},
{
"name": "iconColor",
"type": "string",
"values": [],
"defaultValue": "'#ffffff'"
},
{
"name": "shape",
"type": "\"circle\" | \"square\"",
"values": [
{
"name": "circle",
"description": ""
},
{
"name": "square",
"description": ""
}
],
"defaultValue": "'circle'"
},
{
"name": "round",
"type": "string | number",
"values": [],
"defaultValue": "null"
},
{
"name": "customStyle",
"type": "string | object",
"values": [],
"defaultValue": "null"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-code-input",
"description": "该组件一般用于验证用户短信验证码的场景,也可以结合uView的键盘组件使用",
"example": "<un-code-input v-model=\"value4\" :focus=\"true\"></un-code-input>",
"tutorial": "https://uview.d3u.cn/components/codeInput.html",
"attributes": [
{
"name": "[event]change",
"description": "输入内容发生改变时触发,具体见上方说明\t\t\tvalue:当前输入的值",
"type": "Function"
},
{
"name": "[event]finish",
"description": "输入字符个数达maxlength值时触发,见上方说明\tvalue:当前输入的值",
"type": "Function"
},
{
"name": "[event]update:modelValue",
"description": "",
"type": "Event"
},
{
"name": "confirmType",
"type": "string",
"values": []
},
{
"name": "confirmHold",
"type": "boolean",
"values": []
},
{
"name": "maxlength",
"type": "string | number",
"values": []
},
{
"name": "type",
"type": "\"number\" | \"text\"",
"values": []
},
{
"name": "dot",
"type": "boolean",
"values": []
},
{
"name": "mode",
"type": "\"box\" | \"line\"",
"values": []
},
{
"name": "hairline",
"type": "boolean",
"values": []
},
{
"name": "space",
"type": "string | number",
"values": []
},
{
"name": "value",
"type": "String | Number",
"values": []
},
{
"name": "focus",
"type": "boolean",
"values": []
},
{
"name": "bold",
"type": "boolean",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "fontSize",
"type": "string | number",
"values": []
},
{
"name": "size",
"type": "string | number",
"values": []
},
{
"name": "disabledKeyboard",
"type": "boolean",
"values": []
},
{
"name": "borderColor",
"type": "string",
"values": []
},
{
"name": "bgColor",
"type": "string",
"values": []
},
{
"name": "disabledDot",
"type": "boolean",
"values": []
},
{
"name": "modelValue",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "adjustPosition",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "round",
"type": "string | number",
"values": [],
"defaultValue": "4"
},
{
"name": "customStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-col",
"description": "该组件一般用于Layout 布局 通过基础的 12 分栏,迅速简便地创建布局",
"example": "<un-col span=\"3\" offset=\"3\" > <view class=\"demo-layout bg-purple\"></view> </un-col>",
"tutorial": "https://uview.d3u.cn/components/Layout.html",
"attributes": [
{
"name": "[event]click",
"description": "col被点击,会阻止事件冒泡到row",
"type": "Function"
},
{
"name": "span",
"type": "string | number",
"values": []
},
{
"name": "offset",
"type": "string | number",
"values": []
},
{
"name": "justify",
"type": "string",
"values": []
},
{
"name": "align",
"type": "string",
"values": []
},
{
"name": "textAlign",
"type": "string",
"values": [],
"defaultValue": "'left'"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-collapse-item",
"description": "通过折叠面板收纳内容区域(搭配u-collapse使用)",
"example": "<u-collapse-item :title=\"item.head\" v-for=\"(item, index) in itemList\" :key=\"index\">{{item.body}}</u-collapse-item>",
"tutorial": "https://uview.d3u.cn/components/collapse.html",
"attributes": [
{
"name": "[event]open",
"description": "",
"type": "Event"
},
{
"name": "[event]close",
"description": "",
"type": "Event"
},
{
"name": "title",
"type": "string",
"values": []
},
{
"name": "value",
"type": "string",
"values": []
},
{
"name": "label",
"type": "string",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "isLink",
"type": "boolean",
"values": []
},
{
"name": "clickable",
"type": "boolean",
"values": []
},
{
"name": "border",
"type": "boolean",
"values": []
},
{
"name": "align",
"type": "string",
"values": []
},
{
"name": "name",
"type": "string | number",
"values": []
},
{
"name": "icon",
"type": "string",
"values": []
},
{
"name": "duration",
"type": "number",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-collapse",
"description": "通过折叠面板收纳内容区域",
"example": "<u-collapse></u-collapse>",
"tutorial": "https://uview.d3u.cn/components/collapse.html",
"attributes": [
{
"name": "[event]change",
"description": "当前激活面板展开时触发(如果是手风琴模式,参数activeNames类型为String,否则为Array)",
"type": "Function"
},
{
"name": "[event]open",
"description": "",
"type": "Event"
},
{
"name": "[event]close",
"description": "",
"type": "Event"
},
{
"name": "value",
"type": "Array<string | number>",
"values": []
},
{
"name": "modelValue",
"type": "Array<string | number>",
"values": []
},
{
"name": "accordion",
"type": "boolean",
"values": []
},
{
"name": "border",
"type": "boolean",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-color-picker-view",
"description": "用于颜色选择的组件,支持多种颜色格式和预设颜色",
"example": "<un-color-picker-view v-model=\"color\" />",
"attributes": [
{
"name": "[event]change",
"description": "颜色值变化时触发",
"type": "Function"
},
{
"name": "[event]formatChange",
"description": "颜色格式变化时触发",
"type": "Function"
},
{
"name": "[event]update:modelValue",
"description": "",
"type": "Event"
},
{
"name": "modelValue",
"type": "string",
"values": []
},
{
"name": "showAlphaSlider",
"type": "boolean",
"values": []
},
{
"name": "showHueSlider",
"type": "boolean",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "showPresets",
"type": "boolean",
"values": []
},
{
"name": "presets",
"type": "{}",
"values": []
},
{
"name": "customStyle",
"type": "any",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-color-picker",
"description": "用于颜色选择的组件,支持多种颜色格式和预设颜色",
"example": "<un-color-picker :show=\"show\"",
"attributes": [
{
"name": "[event]change",
"description": "颜色值变化时触发",
"type": "Function"
},
{
"name": "[event]formatChange",
"description": "颜色格式变化时触发",
"type": "Function"
},
{
"name": "[event]confirm",
"description": "",
"type": "Event"
},
{
"name": "[event]close",
"description": "",
"type": "Event"
},
{
"name": "[event]open",
"description": "",
"type": "Event"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "closeable",
"type": "boolean",
"values": []
},
{
"name": "value",
"type": "string",
"values": []
},
{
"name": "defaultValue",
"type": "string",
"values": []
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": []
},
{
"name": "showAlphaSlider",
"type": "boolean",
"values": []
},
{
"name": "showHueSlider",
"type": "boolean",
"values": []
},
{
"name": "disabled",
"type": "boolean",
"values": []
},
{
"name": "showPresets",
"type": "boolean",
"values": []
},
{
"name": "presets",
"type": "{}",
"values": []
},
{
"name": "showConfirm",
"type": "boolean",
"values": []
},
{
"name": "round",
"type": "any",
"values": []
},
{
"name": "confirmText",
"type": "string",
"values": []
},
{
"name": "confirmDisabledText",
"type": "String",
"values": []
},
{
"name": "title",
"type": "string",
"values": [],
"defaultValue": "'请选择颜色'"
},
{
"name": "confirmShape",
"type": "string",
"values": [],
"defaultValue": "'circle'"
},
{
"name": "zIndex",
"type": "number",
"values": [],
"defaultValue": "100"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-count-down",
"description": "该组件一般使用于某个活动的截止时间上,通过数字的变化,给用户明确的时间感受,提示用户进行某一个行为操作。",
"example": "<un-count-down :time=\"time\"></un-count-down>",
"tutorial": "https://uviewui.com/components/countDown.html",
"attributes": [
{
"name": "[event]finish",
"description": "倒计时结束时触发",
"type": "Function"
},
{
"name": "[event]change",
"description": "倒计时变化时触发",
"type": "Function"
},
{
"name": "[event]start",
"description": "开始倒计时",
"type": "Function"
},
{
"name": "[event]pause",
"description": "暂停倒计时",
"type": "Function"
},
{
"name": "[event]reset",
"description": "重设倒计时,若 auto-start 为 true,重设后会自动开始倒计时",
"type": "Function"
},
{
"name": "time",
"type": "string | number",
"values": []
},
{
"name": "format",
"type": "string",
"values": []
},
{
"name": "autoStart",
"type": "boolean",
"values": []
},
{
"name": "millisecond",
"type": "boolean",
"values": []
},
{
"name": "keepAlive",
"type": "Boolean",
"values": []
},
{
"name": "uniqueKey",
"type": "string",
"values": []
},
{
"name": "padZero",
"type": "boolean",
"values": []
},
{
"name": "keepRunning",
"type": "boolean",
"values": [],
"defaultValue": "false"
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-count-to",
"description": "该组件一般用于需要滚动数字到某一个值的场景,目标要求是一个递增的值。",
"example": "<un-count-to ref=\"uCountTo\" :end-val=\"endVal\" :autoplay=\"autoplay\"></un-count-to>",
"tutorial": "https://uview.d3u.cn/components/countTo.html",
"attributes": [
{
"name": "[event]end",
"description": "数值滚动到目标值时触发",
"type": "Function"
},
{
"name": "startVal",
"type": "string | number",
"values": []
},
{
"name": "endVal",
"type": "string | number",
"values": []
},
{
"name": "duration",
"type": "string | number",
"values": []
},
{
"name": "autoplay",
"type": "boolean",
"values": []
},
{
"name": "decimals",
"type": "string | number",
"values": []
},
{
"name": "useEasing",
"type": "boolean",
"values": []
},
{
"name": "decimal",
"type": "string",
"values": []
},
{
"name": "color",
"type": "string",
"values": []
},
{
"name": "fontSize",
"type": "string | number",
"values": []
},
{
"name": "bold",
"type": "boolean",
"values": []
},
{
"name": "separator",
"type": "string",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-cropper",
"description": "封装的图片裁剪组件,支持图片选择、裁剪、旋转等功能,适用于头像上传、图片编辑等场景",
"example": "<un-cropper",
"tutorial": "https://uview.d3u.cn/components/cropper.html",
"attributes": [
{
"name": "[event]change",
"description": "选择图片时触发,返回原始图片路径",
"type": "Function"
},
{
"name": "[event]open",
"description": "打开裁剪弹窗时触发",
"type": "Function"
},
{
"name": "[event]close",
"description": "关闭裁剪弹窗时触发",
"type": "Function"
},
{
"name": "[event]confirm",
"description": "确认裁剪时触发,返回裁剪后的图片临时路径",
"type": "Function"
},
{
"name": "[event]error",
"description": "",
"type": "Event"
},
{
"name": "show",
"type": "boolean",
"values": []
},
{
"name": "shape",
"type": "string",
"values": []
},
{
"name": "cancelText",
"type": "string",
"values": []
},
{
"name": "confirmText",
"type": "string",
"values": []
},
{
"name": "autoChoose",
"type": "boolean",
"values": []
},
{
"name": "rectWidth",
"type": "string | number",
"values": []
},
{
"name": "rectHeight",
"type": "string | number",
"values": []
},
{
"name": "width",
"type": "string | number",
"values": []
},
{
"name": "height",
"type": "string | number",
"values": []
},
{
"name": "fileType",
"type": "string",
"values": []
},
{
"name": "quality",
"type": "string | number",
"values": []
},
{
"name": "showGrid",
"type": "boolean",
"values": []
},
{
"name": "openType",
"type": "string",
"values": []
},
{
"name": "zIndex",
"type": "string | number",
"values": []
},
{
"name": "watermark",
"type": "UnWatermarkOption",
"values": []
}
]
}
\ No newline at end of file \ No newline at end of file
{
"name": "un-curtain",
"attributes": [
{
"name": "[event]open",
"description": "",
"type": "Event"
},
{
"name": "[event]close",
"description": "",
"type": "Event"
},
{
"name": "show",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "closeable",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "closeIconColor",
"type": "string",
"values": [],
"defaultValue": "'#ffffff'"
},
{
"name": "closeIconSize",
"type": "number",
"values": [],
"defaultValue": "24"
},
{
"name": "closeIconPos",
"type": "string",
"values": [],
"defaultValue": "'outset-bottom-center'"
},
{
"name": "closeIcon",
"type": "string",
"values": [],
"defaultValue": "'close-circle'"
},
{
"name": "overlay",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "overlayStyle",
"type": "object",
"values": [],
"defaultValue": "{}"
},
{
"name": "closeOnClickOverlay",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "zIndex",
"type": "string | number",
"values": [],
"defaultValue": "100"
},
{
"name": "safeAreaInsetBottom",
"type": "boolean",
"values": [],
"defaultValue": "true"
},
{
"name": "safeAreaInsetTop",
"type": "boolean",
"values": [],
"defaultValue": "false"
},
{
"name": "bgColor",
"type": "string",
"values": [],
"defaultValue": "'transparent'"
},
{
"name": "overlayOpacity",
"type": "string | number",
"values": [],
"defaultValue": "0.5"
},
{
"name": "width",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "height",
"type": "string | number",
"values": [],
"defaultValue": "''"
},
{
"name": "customStyle",
"type": "string | object",
"values": [],
"defaultValue": "''"
}
]
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!