This commit is contained in:
2025-03-12 11:39:31 +08:00
parent b8a44a2716
commit 55954a4a9b
125 changed files with 30973 additions and 30045 deletions

View File

@@ -1,266 +1,278 @@
<template>
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
<image class="uni-header-image" src="/static/extuiIndex.png"></image>
</view>
<view v-if="!hasLeftWin" class="uni-hello-text">
<text class="hello-text">以下是uni-app扩展组件示例更多组件见插件市场</text>
<u-link class="hello-link" :href="'https://ext.dcloud.net.cn/'" :text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"></u-link>
</view>
<view :class="{'pc-hide': hideList.indexOf(item.url) !== -1 && hasLeftWin}" class="uni-panel"
v-for="item in lists" :key="item.url">
<view :class="{'left-win-active': leftWinActive === item.url && hasLeftWin}" class="uni-panel-h"
@click="goDetailPage(item.url)">
<text class="uni-panel-text">{{item.name}}</text>
<text class="uni-panel-icon uni-icon">&#xe470;</text>
</view>
</view>
</view>
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
<image class="uni-header-image" src="/static/extuiIndex.png"></image>
</view>
<view v-if="!hasLeftWin" class="uni-hello-text">
<text class="hello-text"
>以下是uni-app扩展组件示例更多组件见插件市场</text
>
<u-link
class="hello-link"
:href="'https://ext.dcloud.net.cn/'"
:text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"
></u-link>
</view>
<view
:class="{ 'pc-hide': hideList.indexOf(item.url) !== -1 && hasLeftWin }"
class="uni-panel"
v-for="item in lists"
:key="item.url"
>
<view
:class="{ 'left-win-active': leftWinActive === item.url && hasLeftWin }"
class="uni-panel-h"
@click="goDetailPage(item.url)"
>
<text class="uni-panel-text">{{ item.name }}</text>
<text class="uni-panel-icon uni-icon">&#xe470;</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
hasLeftWin: {
type: Boolean
},
leftWinActive: {
type: String
}
},
data() {
return {
hideList: [
'load-more'
],
lists: [{
name: "uni-badge 数字角标",
url: "badge"
},
{
name: "uni-breadcrumb 面包屑",
url: "breadcrumb"
},
{
name: "uni-calendar 日历",
url: "calendar"
},
{
name: "uni-card 卡片",
url: "card"
},
{
name: "uni-collapse 折叠面板",
url: "collapse"
},
export default {
props: {
hasLeftWin: {
type: Boolean,
},
leftWinActive: {
type: String,
},
},
data() {
return {
hideList: ["load-more"],
lists: [
{
name: "uni-badge 数字角标",
url: "badge",
},
{
name: "uni-breadcrumb 面包屑",
url: "breadcrumb",
},
{
name: "uni-calendar 日历",
url: "calendar",
},
{
name: "uni-card 卡片",
url: "card",
},
{
name: "uni-collapse 折叠面板",
url: "collapse",
},
// #ifndef APP-NVUE
{
name: "uni-combox 组合框",
url: "combox"
},
// #endif
{
name: "uni-countdown 倒计时",
url: "countdown"
},
{
name: "uni-data-checkbox 数据选择器",
url: "data-checkbox"
},
{
name: "uni-data-picker 数据驱动的picker选择器",
url: "data-picker"
},
{
name: "uni-data-select 数据驱动的下拉框",
url: "data-select"
},
{
name: "uni-dateformat 日期格式化",
url: "dateformat"
},
{
name: "uni-datetime-picker 日期选择器",
url: "datetime-picker"
},
{
name: "uni-drawer 抽屉",
url: "drawer"
},
{
name: "uni-easyinput 增强输入框",
url: "easyinput"
},
{
name: "uni-fab 悬浮按钮",
url: "fab"
},
{
name: "uni-fav 收藏按钮",
url: "fav"
},
// #ifndef APP-NVUE
{
name: "uni-file-picker 文件选择上传",
url: "file-picker"
},
// #endif
{
name: "uni-forms 表单",
url: "forms"
},
{
name: "uni-goods-nav 商品导航",
url: "goods-nav"
},
{
name: "uni-grid 宫格",
url: "grid"
},
{
name: "uni-group 分组",
url: "group"
},
{
name: "uni-icons 图标",
url: "icons"
},
{
name: "uni-indexed-list 索引列表",
url: "indexed-list"
},
{
name: "uni-link 超链接",
url: "link"
},
{
name: "uni-list 列表",
url: "list"
},
// #ifndef MP-JD
{
name: "uni-load-more 加载更多",
url: "load-more"
},
// #endif
{
name: "uni-nav-bar 自定义导航栏",
url: "nav-bar"
},
{
name: "uni-notice-bar 通告栏",
url: "notice-bar"
},
{
name: "uni-number-box 数字输入框",
url: "number-box"
},
{
name: "uni-pagination 分页器",
url: "pagination"
},
{
name: "uni-popup 弹出层",
url: "popup"
},
{
name: "uni-rate 评分",
url: "rate"
},
{
name: "uni-row 布局-行",
url: "row"
},
{
name: "uni-search-bar 搜索栏",
url: "search-bar"
},
{
name: "uni-section 标题栏",
url: "section"
},
{
name: "uni-segmented-control 分段器",
url: "segmented-control"
},
{
name: "uni-steps 步骤条",
url: "steps"
},
{
name: "uni-swipe-action 滑动操作",
url: "swipe-action"
},
{
name: "uni-swiper-dot 轮播图指示点",
url: "swiper-dot"
},
// #ifndef APP-NVUE || MP-TOUTIAO || MP-BAIDU
{
name: "uni-table 表格",
url: "table"
},
// #endif
{
name: "uni-tag 标签",
url: "tag"
},
{
name: "uni-title 章节标题",
url: "title"
},
{
name: "uni-tooltip 文字提示",
url: "tooltip"
},
{
name: "uni-transition 过渡动画",
url: "transition"
},
]
};
},
onLoad() {},
onReady() {
// #ifdef APP-NVUE
uni.preloadPage({
url: "/pages/extUI/calendar/calendar",
success() {
console.log("preloadPage /pages/extUI/calendar/calendar")
},
fail() {}
})
// #endif
},
onShareAppMessage() {
return {
title: '欢迎体验uni-app',
path: '/pages/tabBar/extUI/extUI'
}
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: '/pages/about/about'
});
},
methods: {
goDetailPage(path) {
const url = '/pages/extUI/' + path + '/' + path
if (this.hasLeftWin) {
uni.reLaunch({
url: url
})
} else {
uni.navigateTo({
url: url
})
}
}
}
}
// #ifndef APP-NVUE
{
name: "uni-combox 组合框",
url: "combox",
},
// #endif
{
name: "uni-countdown 倒计时",
url: "countdown",
},
{
name: "uni-data-checkbox 数据选择器",
url: "data-checkbox",
},
{
name: "uni-data-picker 数据驱动的picker选择器",
url: "data-picker",
},
{
name: "uni-data-select 数据驱动的下拉框",
url: "data-select",
},
{
name: "uni-dateformat 日期格式化",
url: "dateformat",
},
{
name: "uni-datetime-picker 日期选择器",
url: "datetime-picker",
},
{
name: "uni-drawer 抽屉",
url: "drawer",
},
{
name: "uni-easyinput 增强输入框",
url: "easyinput",
},
{
name: "uni-fab 悬浮按钮",
url: "fab",
},
{
name: "uni-fav 收藏按钮",
url: "fav",
},
// #ifndef APP-NVUE
{
name: "uni-file-picker 文件选择上传",
url: "file-picker",
},
// #endif
{
name: "uni-forms 表单",
url: "forms",
},
{
name: "uni-goods-nav 商品导航",
url: "goods-nav",
},
{
name: "uni-grid 宫格",
url: "grid",
},
{
name: "uni-group 分组",
url: "group",
},
{
name: "uni-icons 图标",
url: "icons",
},
{
name: "uni-indexed-list 索引列表",
url: "indexed-list",
},
{
name: "uni-link 超链接",
url: "link",
},
{
name: "uni-list 列表",
url: "list",
},
// #ifndef MP-JD
{
name: "uni-load-more 加载更多",
url: "load-more",
},
// #endif
{
name: "uni-nav-bar 自定义导航栏",
url: "nav-bar",
},
{
name: "uni-notice-bar 通告栏",
url: "notice-bar",
},
{
name: "uni-number-box 数字输入框",
url: "number-box",
},
{
name: "uni-pagination 分页器",
url: "pagination",
},
{
name: "uni-popup 弹出层",
url: "popup",
},
{
name: "uni-rate 评分",
url: "rate",
},
{
name: "uni-row 布局-行",
url: "row",
},
{
name: "uni-search-bar 搜索栏",
url: "search-bar",
},
{
name: "uni-section 标题栏",
url: "section",
},
{
name: "uni-segmented-control 分段器",
url: "segmented-control",
},
{
name: "uni-steps 步骤条",
url: "steps",
},
{
name: "uni-swipe-action 滑动操作",
url: "swipe-action",
},
{
name: "uni-swiper-dot 轮播图指示点",
url: "swiper-dot",
},
// #ifndef APP-NVUE || MP-TOUTIAO || MP-BAIDU
{
name: "uni-table 表格",
url: "table",
},
// #endif
{
name: "uni-tag 标签",
url: "tag",
},
{
name: "uni-title 章节标题",
url: "title",
},
{
name: "uni-tooltip 文字提示",
url: "tooltip",
},
{
name: "uni-transition 过渡动画",
url: "transition",
},
],
};
},
onLoad() {},
onReady() {
// #ifdef APP-NVUE
uni.preloadPage({
url: "/pages/extUI/calendar/calendar",
success() {
console.log("preloadPage /pages/extUI/calendar/calendar");
},
fail() {},
});
// #endif
},
onShareAppMessage() {
return {
title: "欢迎体验uni-app",
path: "/pages/tabBar/extUI/extUI",
};
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: "/pages/about/about",
});
},
methods: {
goDetailPage(path) {
const url = "/pages/extUI/" + path + "/" + path;
if (this.hasLeftWin) {
uni.reLaunch({
url: url,
});
} else {
uni.navigateTo({
url: url,
});
}
},
},
};
</script>
<style>
@import '../../../common/uni-nvue.css';
@import "../../../common/uni-nvue.css";
</style>

View File

@@ -1,210 +1,234 @@
<template>
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
<image class="uni-header-image" src="/static/templateIndex.png"></image>
</view>
<view v-if="!hasLeftWin" class="uni-hello-text">
<text class="hello-text">以下是部分模板示例更多模板见插件市场</text>
<u-link class="hello-link" href="https://ext.dcloud.net.cn" :text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"></u-link>
</view>
<view :class="{'pc-hide': hideList.indexOf(item.url) !== -1 && hasLeftWin}" class="uni-panel"
v-for="(item, index) in list" :key="item.id">
<view
:class="{'left-win-active': leftWinActive === item.url && hasLeftWin, 'uni-panel-h-on': item.open}"
class="uni-panel-h" @click="triggerCollapse(index, item.id)">
<text class="uni-panel-text">{{item.name}}</text>
<text class="uni-panel-icon uni-icon"
:class="item.open ? 'uni-panel-icon-on' : ''">{{item.pages ? '&#xe581;' : '&#xe470;'}}</text>
</view>
<view class="uni-panel-c" v-if="item.open ">
<view
:class="{'left-win-active': leftWinActive === item2.url && hasLeftWin, 'pc-hide': hideList.indexOf(item2.url) !== -1 && hasLeftWin}"
class="uni-navigate-item" v-for="(item2,key) in item.pages" :key="key" @click="goDetailPage(item2)">
<text class="uni-navigate-text">{{item2.name ? item2.name : item2}}</text>
<text class="uni-navigate-icon uni-icon">&#xe470;</text>
</view>
</view>
</view>
</view>
<view class="uni-container">
<view v-if="!hasLeftWin" class="uni-header-logo">
<image class="uni-header-image" src="/static/templateIndex.png"></image>
</view>
<view v-if="!hasLeftWin" class="uni-hello-text">
<text class="hello-text">以下是部分模板示例更多模板见插件市场</text>
<u-link
class="hello-link"
href="https://ext.dcloud.net.cn"
:text="'https://ext.dcloud.net.cn'"
:inWhiteList="true"
></u-link>
</view>
<view
:class="{ 'pc-hide': hideList.indexOf(item.url) !== -1 && hasLeftWin }"
class="uni-panel"
v-for="(item, index) in list"
:key="item.id"
>
<view
:class="{
'left-win-active': leftWinActive === item.url && hasLeftWin,
'uni-panel-h-on': item.open,
}"
class="uni-panel-h"
@click="triggerCollapse(index, item.id)"
>
<text class="uni-panel-text">{{ item.name }}</text>
<text
class="uni-panel-icon uni-icon"
:class="item.open ? 'uni-panel-icon-on' : ''"
>{{ item.pages ? "&#xe581;" : "&#xe470;" }}</text
>
</view>
<view class="uni-panel-c" v-if="item.open">
<view
:class="{
'left-win-active': leftWinActive === item2.url && hasLeftWin,
'pc-hide': hideList.indexOf(item2.url) !== -1 && hasLeftWin,
}"
class="uni-navigate-item"
v-for="(item2, key) in item.pages"
:key="key"
@click="goDetailPage(item2)"
>
<text class="uni-navigate-text">{{
item2.name ? item2.name : item2
}}</text>
<text class="uni-navigate-icon uni-icon">&#xe470;</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
hasLeftWin: {
type: Boolean
},
leftWinActive: {
type: String
}
},
data() {
return {
hideList: [
'ucharts',
'nav-city-dropdown'
],
list: [
// #ifdef APP-PLUS || H5 || MP-ALIPAY
{
id: 'navbar',
name: '顶部原生导航标题栏',
open: false,
pages: [
// #ifdef APP-PLUS || H5
{
name: '导航栏带自定义按钮',
url: 'nav-button'
},
{
name: '导航栏带红点和角标',
url: 'nav-dot'
},
{
name: '导航栏带城市选择',
url: 'nav-city-dropdown'
},
{
name: '导航栏带搜索框',
url: 'nav-search-input'
},
// #endif
// #ifdef APP-PLUS || H5 || MP-ALIPAY
{
name: '透明渐变样式',
url: 'nav-transparent'
},
{
name: '导航栏带图片',
url: 'nav-image'
}
// #endif
]
},
// #endif
// #ifndef QUICKAPP-WEBVIEW || MP-KUAISHOU
{
name: '顶部选项卡',
url: 'tabbar'
},
// #endif
{
name: '组件通讯',
url: 'component-communication'
},
// #ifndef MP-QQ || QUICKAPP-WEBVIEW
// {
// name: 'uCharts 图表',
// url: 'ucharts'
// },
// #endif
// #ifndef QUICKAPP-WEBVIEW
{
name: '列表到详情示例',
url: 'list2detail-list'
},
// #endif
// #ifndef VUE3
// #ifdef APP-PLUS
// {
// name: '上下滑动切换视频',
// url: 'swiper-vertical'
// },
// #endif
// #endif
// #ifdef APP-NVUE
{
name: 'swiper-list',
url: 'swiper-list-nvue'
},
// #endif
{
name: 'GlobalData和vuex',
url: 'global'
},
// #ifdef APP-PLUS
{
name: '问题反馈',
url: '/platforms/app-plus/feedback/feedback'
},
{
name: '打开外部应用',
url: 'scheme'
},
// #endif
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ || H5
// {
// name: '微信自定义组件示例vant ui',
// url: 'vant-button'
// }
// #endif
]
}
},
onShareAppMessage() {
return {
title: '欢迎体验uni-app',
path: '/pages/tabBar/template/template'
}
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: '/pages/about/about'
});
},
// #ifdef H5
watch: {
$route: {
immediate: true,
handler(newRoute) {
if (newRoute.matched.length) {
let path = newRoute.path.split('/')[3]
for (const item of this.list) {
if (Array.isArray(item.pages)) {
for (const page of item.pages) {
if (page === path || page.url && page.url === path) {
item.open = true
}
}
}
}
}
}
}
},
// #endif
methods: {
triggerCollapse(e, id) {
if (!this.list[e].pages) {
this.goDetailPage(this.list[e].url);
return;
}
for (var i = 0; i < this.list.length; ++i) {
if (e === i) {
this.list[i].open = !this.list[i].open;
} else {
this.list[i].open = false;
}
}
},
goDetailPage(e) {
let path = e.url ? e.url : e;
let url = ~path.indexOf('platform') ? path : '/pages/template/' + path + '/' + path;
if (this.hasLeftWin) {
uni.reLaunch({
url: url
})
} else {
uni.navigateTo({
url: url
})
}
return false;
}
}
}
export default {
props: {
hasLeftWin: {
type: Boolean,
},
leftWinActive: {
type: String,
},
},
data() {
return {
hideList: ["ucharts", "nav-city-dropdown"],
list: [
// #ifdef APP-PLUS || H5 || MP-ALIPAY
{
id: "navbar",
name: "顶部原生导航标题栏",
open: false,
pages: [
// #ifdef APP-PLUS || H5
{
name: "导航栏带自定义按钮",
url: "nav-button",
},
{
name: "导航栏带红点和角标",
url: "nav-dot",
},
{
name: "导航栏带城市选择",
url: "nav-city-dropdown",
},
{
name: "导航栏带搜索框",
url: "nav-search-input",
},
// #endif
// #ifdef APP-PLUS || H5 || MP-ALIPAY
{
name: "透明渐变样式",
url: "nav-transparent",
},
{
name: "导航栏带图片",
url: "nav-image",
},
// #endif
],
},
// #endif
// #ifndef QUICKAPP-WEBVIEW || MP-KUAISHOU
{
name: "顶部选项卡",
url: "tabbar",
},
// #endif
{
name: "组件通讯",
url: "component-communication",
},
// #ifndef MP-QQ || QUICKAPP-WEBVIEW
// {
// name: 'uCharts 图表',
// url: 'ucharts'
// },
// #endif
// #ifndef QUICKAPP-WEBVIEW
{
name: "列表到详情示例",
url: "list2detail-list",
},
// #endif
// #ifndef VUE3
// #ifdef APP-PLUS
// {
// name: '上下滑动切换视频',
// url: 'swiper-vertical'
// },
// #endif
// #endif
// #ifdef APP-NVUE
{
name: "swiper-list",
url: "swiper-list-nvue",
},
// #endif
{
name: "GlobalData和vuex",
url: "global",
},
// #ifdef APP-PLUS
{
name: "问题反馈",
url: "/platforms/app-plus/feedback/feedback",
},
{
name: "打开外部应用",
url: "scheme",
},
// #endif
// #ifdef APP-PLUS || MP-WEIXIN || MP-QQ || H5
// {
// name: '微信自定义组件示例vant ui',
// url: 'vant-button'
// }
// #endif
],
};
},
onShareAppMessage() {
return {
title: "欢迎体验uni-app",
path: "/pages/tabBar/template/template",
};
},
onNavigationBarButtonTap(e) {
uni.navigateTo({
url: "/pages/about/about",
});
},
// #ifdef H5
watch: {
$route: {
immediate: true,
handler(newRoute) {
if (newRoute.matched.length) {
let path = newRoute.path.split("/")[3];
for (const item of this.list) {
if (Array.isArray(item.pages)) {
for (const page of item.pages) {
if (page === path || (page.url && page.url === path)) {
item.open = true;
}
}
}
}
}
},
},
},
// #endif
methods: {
triggerCollapse(e, id) {
if (!this.list[e].pages) {
this.goDetailPage(this.list[e].url);
return;
}
for (var i = 0; i < this.list.length; ++i) {
if (e === i) {
this.list[i].open = !this.list[i].open;
} else {
this.list[i].open = false;
}
}
},
goDetailPage(e) {
let path = e.url ? e.url : e;
let url = ~path.indexOf("platform")
? path
: "/pages/template/" + path + "/" + path;
if (this.hasLeftWin) {
uni.reLaunch({
url: url,
});
} else {
uni.navigateTo({
url: url,
});
}
return false;
},
},
};
</script>
<style>
@import '../../../common/uni-nvue.css';
@import "../../../common/uni-nvue.css";
</style>