提交 e6aefb2f 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix: 冲突合并

上级 ed467a40
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
</view> </view>
</view> </view>
<view class="uni-list uni-common-pl"> <view class="uni-list uni-common-pl">
<radio-group @change="radioChange">
<radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.value"
:class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"
:checked="index === current">
<radio-group @change="radioChange" class="radio-group"> <radio-group @change="radioChange" class="radio-group">
<radio <radio
class="uni-list-cell uni-list-cell-pd radio" class="uni-list-cell uni-list-cell-pd radio"
...@@ -44,42 +40,6 @@ ...@@ -44,42 +40,6 @@
</view> </view>
</template> </template>
<script lang="uts"> <script lang="uts">
type ItemType = {
value : string
name : string
}
export default {
data() {
return {
title: 'loading',
items: [
{
value: 'null',
name: '无标题',
},
{
value: '三秒后自动关闭',
name: '普通标题',
},
{
value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',
name: '长标题',
},
] as ItemType[],
current: 0,
maskSelect: false,
titleSelect: "null"
}
},
onLoad(){
uni.showLoading({
title:'onLoad 调用示例,1秒后消失'
})
setTimeout(function() {
uni.hideLoading()
}, 1000);
},
methods: {
type ItemType = { type ItemType = {
value : string value : string
name : string name : string
......
<template> <template>
<list-view id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower"> <list-view id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower">
<list-item v-for="index in item_count" class="item" @click="itemClick(index)"> <list-item v-for="index in item_count" class="item" @click="itemClick(index)">
<list-view id="listview" style="flex: 1;" show-scrollbar=false @scrolltolower="onScrollTolower">
<list-item v-for="index in item_count" class="item">
<text >item-------<text>{{index}}</text></text> <text >item-------<text>{{index}}</text></text>
</list-item> </list-item>
</list-view> </list-view>
......
<template> <template>
<list-view id="list-view" ref="list-view" show-scrollbar=false class="page" :scroll-into-view="scrollIntoView" <list-view id="list-view" ref="list-view" show-scrollbar=false class="page" :scroll-into-view="scrollIntoView"
@scroll="onScroll" @scrollend="onScrollEnd" rebound="false"> @scroll="onScroll" @scrollend="onScrollEnd" rebound="false">
<list-item style="padding: 10px; margin: 5px 0;align-items: center;" type = 20> <list-item style="padding: 10px; margin: 5px 0;align-items: center;">
<button @click="gotoStickyHeader('C')" size="mini">跳转到id为C的sticky-header位置上</button> <button @click="gotoStickyHeader('C')" size="mini">跳转到id为C的sticky-header位置上</button>
</list-item> </list-item>
<sticky-section v-for="(sectionText) in data" :padding="sectionPadding" :push-pinned-header="true"> <sticky-section v-for="(sectionText) in data" :padding="sectionPadding" :push-pinned-header="true">
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<text class="text">{{sectionText}}--item--content----{{i}}</text> <text class="text">{{sectionText}}--item--content----{{i}}</text>
</list-item> </list-item>
</sticky-section> </sticky-section>
<list-item style="padding: 10px; margin: 5px 0;align-items: center;" type= 30> <list-item style="padding: 10px; margin: 5px 0;align-items: center;">
<!-- <text style="color: #aaa">到底了</text> --> <!-- <text style="color: #aaa">到底了</text> -->
<button @click="toTop" size="mini">回到顶部</button> <button @click="toTop" size="mini">回到顶部</button>
</list-item> </list-item>
......
...@@ -9,7 +9,6 @@ const pages = [ ...@@ -9,7 +9,6 @@ const pages = [
// '/pages/component/image/image-large', // 截图过大 // '/pages/component/image/image-large', // 截图过大
'/pages/component/image/image-mode', '/pages/component/image/image-mode',
// '/pages/component/image/image-path', // 网络资源加载,单独测试例截图 // '/pages/component/image/image-path', // 网络资源加载,单独测试例截图
// '/pages/component/image/image-path', // 网络资源加载
'/pages/component/image/image', '/pages/component/image/image',
// '/pages/component/input/input', // 自动获取焦点,单独测试例截图 // '/pages/component/input/input', // 自动获取焦点,单独测试例截图
// '/pages/component/list-view/list-view', // '/pages/component/list-view/list-view',
...@@ -112,7 +111,6 @@ const pages = [ ...@@ -112,7 +111,6 @@ const pages = [
// '/pages/template/drop-card/drop-card', // '/pages/template/drop-card/drop-card',
'/pages/template/half-screen/half-screen', '/pages/template/half-screen/half-screen',
// '/pages/template/list-news/list-news', // 网络资源加载,单独测试例截图 // '/pages/template/list-news/list-news', // 网络资源加载,单独测试例截图
// '/pages/template/list-news/list-news', // 网络资源加载
// '/pages/template/long-list/long-list', // 动态内容 // '/pages/template/long-list/long-list', // 动态内容
'/pages/template/navbar-lite/navbar-lite', '/pages/template/navbar-lite/navbar-lite',
'/pages/template/pull-zoom-image/pull-zoom-image', '/pages/template/pull-zoom-image/pull-zoom-image',
...@@ -144,7 +142,6 @@ const notFullPages = [ ...@@ -144,7 +142,6 @@ const notFullPages = [
] ]
let page; let page;
describe("page screenshot test", () => {
describe("page screenshot test", () => { describe("page screenshot test", () => {
beforeAll(async () => { beforeAll(async () => {
console.log("page screenshot test start"); console.log("page screenshot test start");
...@@ -165,13 +162,10 @@ describe("page screenshot test", () => { ...@@ -165,13 +162,10 @@ describe("page screenshot test", () => {
if (notFullPages.includes(pages[pageIndex])) { if (notFullPages.includes(pages[pageIndex])) {
fullPage = false; fullPage = false;
} }
test.each(pages)("%s", async () => {
const image = await program.screenshot({ const image = await program.screenshot({
fullPage: fullPage fullPage: fullPage
}); });
expect(image).toMatchImageSnapshot(); expect(image).toMatchImageSnapshot();
await page.waitFor(500); await page.waitFor(500);
}); });
});
});
}); });
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex: 1"> <scroll-view style="flex: 1">
<!-- #endif --> <!-- #endif -->
<view class="uni-container"> <view class="uni-container">
<view class="uni-header-logo"> <view class="uni-header-logo">
<image class="uni-header-image" src="/static/templateIndex.png"></image> <image class="uni-header-image" src="/static/templateIndex.png"></image>
</view> </view>
<view class="uni-text-box"> <view class="uni-text-box">
<text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text> <text class="hello-text">以下是部分模板示例,更多模板见插件市场:</text>
<u-link <u-link href="https://ext.dcloud.net.cn" :text="'https://ext.dcloud.net.cn'" :inWhiteList="true"></u-link>
href="https://ext.dcloud.net.cn" </view>
:text="'https://ext.dcloud.net.cn'" <view class="uni-panel" v-for="(item, index) in list" :key="item.id">
:inWhiteList="true" <view class="uni-panel-h" :class="item.open ? 'uni-panel-h-on' : ''" @click="triggerCollapse(index, item)">
></u-link> <text class="uni-panel-text" :class="item.enable == false ? 'text-disabled' : ''">{{ item.name }}</text>
</view> <image :src="
<view class="uni-panel" v-for="(item, index) in list" :key="item.id"> item.pages.length > 0
<view ? item.open
class="uni-panel-h" ? arrowUpIcon
:class="item.open ? 'uni-panel-h-on' : ''" : arrowDownIcon
@click="triggerCollapse(index, item)" : arrowRightIcon
> " class="uni-icon">
<text </image>
class="uni-panel-text" </view>
:class="item.enable == false ? 'text-disabled' : ''" <view v-if="item.open">
>{{ item.name }}</text <view class="uni-navigate-item" :hover-class="page.enable == false ? '' : 'is--active'"
> v-for="(page, key) in item.pages" :key="key" @click="goDetailPage(page)">
<image <text class="uni-navigate-text" :class="page.enable == false ? 'text-disabled' : ''">{{ page.name }}</text>
:src=" <image :src="arrowRightIcon" class="uni-icon"></image>
item.pages.length > 0 </view>
? item.open </view>
? arrowUpIcon </view>
: arrowDownIcon </view>
: arrowRightIcon <!-- #ifdef APP -->
" </scroll-view>
class="uni-icon" <!-- #endif -->
> </template>
</image>
</view> <script lang="uts">
<view v-if="item.open"> type Page = {
<view name : string
class="uni-navigate-item" enable ?: boolean
:hover-class="page.enable == false ? '' : 'is--active'" url : string
v-for="(page, key) in item.pages"
:key="key"
@click="goDetailPage(page)"
>
<text
class="uni-navigate-text"
:class="page.enable == false ? 'text-disabled' : ''"
>{{ page.name }}</text
>
<image :src="arrowRightIcon" class="uni-icon"></image>
</view>
</view>
</view>
</view>
<!-- #ifdef APP -->
</scroll-view>
<!-- #endif -->
</template>
<script lang="uts">
type Page = {
name : string
enable ?: boolean
url : string
} }
type ListItem = { type ListItem = {
id : string id : string
name : string name : string
open : boolean open : boolean
pages : Page[] pages : Page[]
url ?: string url ?: string
enable ?: boolean enable ?: boolean
} }
export default { export default {
data() { data() {
return { return {
list: [ list: [
{ {
id: 'long-list', id: 'long-list',
url: 'long-list', url: 'long-list',
name: '左右滑动长列表', name: '左右滑动长列表',
open: false, open: false,
enable: true, enable: true,
pages: [ pages: [
{ {
name: '顶部搜索框随时下移长列表', name: '顶部搜索框随时下移长列表',
url: 'long-list' url: 'long-list'
}, },
{ {
name: '顶部banner长列表', name: '顶部banner长列表',
url: 'long-list2' url: 'long-list2'
}, },
] as Page[], ] as Page[],
}, },
{ {
id: 'list-news', id: 'list-news',
url: 'list-news', url: 'list-news',
name: '列表到详情', name: '列表到详情',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'scroll-fold-nav', id: 'scroll-fold-nav',
url: 'scroll-fold-nav', url: 'scroll-fold-nav',
name: '随滚动折叠的导航栏', name: '随滚动折叠的导航栏',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'swiper-list', id: 'swiper-list',
url: 'swiper-list', url: 'swiper-list',
name: 'swiper-list', name: 'swiper-list',
open: false, open: false,
pages: [ pages: [
{ {
name: '下划线样式', name: '下划线样式',
url: 'swiper-list' url: 'swiper-list'
}, },
{ {
name: '字体放大样式', name: '字体放大样式',
url: 'swiper-list2' url: 'swiper-list2'
}, },
] as Page[], ] as Page[],
}, },
{ {
id: 'custom-refresher', id: 'custom-refresher',
url: 'custom-refresher', url: 'custom-refresher',
name: '自定义下拉刷新', name: '自定义下拉刷新',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'pull-zoom-image', id: 'pull-zoom-image',
url: 'pull-zoom-image', url: 'pull-zoom-image',
name: '下拉缩放顶部封面图', name: '下拉缩放顶部封面图',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'swiper-vertical-video', id: 'swiper-vertical-video',
url: 'swiper-vertical-video', url: 'swiper-vertical-video',
name: '竖滑视频', name: '竖滑视频',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'scroll-sticky', id: 'scroll-sticky',
url: 'scroll-sticky', url: 'scroll-sticky',
name: 'scroll-view自定义滚动吸顶', name: 'scroll-view自定义滚动吸顶',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'half-screen', id: 'half-screen',
url: 'half-screen', url: 'half-screen',
name: '半屏弹窗', name: '半屏弹窗',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'drop-card', id: 'drop-card',
url: 'drop-card', url: 'drop-card',
name: '划走式卡片', name: '划走式卡片',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'navbar-lite', id: 'navbar-lite',
url: 'navbar-lite', url: 'navbar-lite',
name: '自定义导航栏', name: '自定义导航栏',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'custom-tab-bar', id: 'custom-tab-bar',
url: 'custom-tab-bar', url: 'custom-tab-bar',
name: '自定义TabBar', name: '自定义TabBar',
open: false, open: false,
enable: true, enable: true,
pages: [] as Page[], pages: [] as Page[],
}, },
{ {
id: 'calendar', id: 'calendar',
url: 'calendar', url: 'calendar',
name: '日历', name: '日历',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, { }, {
id: 'schema', id: 'schema',
url: 'schema', url: 'schema',
name: '打开外部链接', name: '打开外部链接',
open: false, open: false,
pages: [] as Page[], pages: [] as Page[],
}, { },
id: 'share', ] as ListItem[],
url: 'share', arrowUpIcon: '/static/icons/arrow-up.png',
name: '分享示例', arrowDownIcon: '/static/icons/arrow-down.png',
open: false, arrowRightIcon: '/static/icons/arrow-right.png',
pages: [] as Page[], }
} },
] as ListItem[], methods: {
arrowUpIcon: '/static/icons/arrow-up.png', triggerCollapse(index : number, item : ListItem) {
arrowDownIcon: '/static/icons/arrow-down.png', if (item.pages.length == 0) {
arrowRightIcon: '/static/icons/arrow-right.png', const page : Page = {
} name: item.name,
}, enable: item.enable,
methods: { url: item.url!,
triggerCollapse(index : number, item : ListItem) { }
if (item.pages.length == 0) { this.goDetailPage(page)
const page : Page = { return
name: item.name, }
enable: item.enable, for (var i = 0; i < this.list.length; ++i) {
url: item.url!, if (index == i) {
} this.list[i].open = !this.list[i].open
this.goDetailPage(page) } else {
return this.list[i].open = false
} }
for (var i = 0; i < this.list.length; ++i) { }
if (index == i) { },
this.list[i].open = !this.list[i].open goDetailPage(e : Page) {
} else { if (e.enable == false) {
this.list[i].open = false uni.showToast({
} icon: 'none',
} title: '暂不支持',
}, })
goDetailPage(e : Page) { return
if (e.enable == false) { }
uni.showToast({ const url =
icon: 'none', e.url.indexOf('platform') > -1
title: '暂不支持', ? e.url
}) : `/pages/template/${e.url}/${e.url}`
return uni.navigateTo({
} url,
const url = })
e.url.indexOf('platform') > -1 },
? e.url },
: `/pages/template/${e.url}/${e.url}` }
uni.navigateTo({ </script>
url,
}) <style>
}, @import "../../common/uni-uvue.css";
},
}
type ListItem = {
id: string
name: string
open: boolean
pages: Page[]
url?: string
enable?: boolean
}
export default {
data() {
return {
list: [
{
id: 'long-list',
url: 'long-list',
name: '左右滑动长列表',
open: false,
enable: true,
pages: [
{
name: '顶部搜索框随时下移长列表',
url:'long-list'
},
{
name: '顶部banner长列表',
url:'long-list2'
},
] as Page[],
},
{
id: 'list-news',
url: 'list-news',
name: '列表到详情',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-fold-nav',
url: 'scroll-fold-nav',
name: '随滚动折叠的导航栏',
open: false,
pages: [] as Page[],
},
{
id: 'swiper-list',
url: 'swiper-list',
name: 'swiper-list',
open: false,
pages: [
{
name: '下划线样式',
url:'swiper-list'
},
{
name: '字体放大样式',
url:'swiper-list2'
},
] as Page[],
},
{
id: 'custom-refresher',
url: 'custom-refresher',
name: '自定义下拉刷新',
open: false,
pages: [] as Page[],
},
{
id: 'pull-zoom-image',
url: 'pull-zoom-image',
name: '下拉缩放顶部封面图',
open: false,
pages: [] as Page[],
},
{
id: 'swiper-vertical-video',
url: 'swiper-vertical-video',
name: '竖滑视频',
open: false,
pages: [] as Page[],
},
{
id: 'scroll-sticky',
url: 'scroll-sticky',
name: 'scroll-view自定义滚动吸顶',
open: false,
pages: [] as Page[],
},
{
id: 'half-screen',
url: 'half-screen',
name: '半屏弹窗',
open: false,
pages: [] as Page[],
},
{
id: 'drop-card',
url: 'drop-card',
name: '划走式卡片',
open: false,
pages: [] as Page[],
},
{
id: 'navbar-lite',
url: 'navbar-lite',
name: '自定义导航栏',
open: false,
pages: [] as Page[],
},
{
id: 'custom-tab-bar',
url: 'custom-tab-bar',
name: '自定义TabBar',
open: false,
enable: true,
pages: [] as Page[],
},
{
id: 'calendar',
url: 'calendar',
name: '日历',
open: false,
pages: [] as Page[],
},{
id: 'schema',
url: 'schema',
name: '打开外部链接',
open: false,
pages: [] as Page[],
},
] as ListItem[],
arrowUpIcon: '/static/icons/arrow-up.png',
arrowDownIcon: '/static/icons/arrow-down.png',
arrowRightIcon: '/static/icons/arrow-right.png',
}
},
methods: {
triggerCollapse(index: number, item: ListItem) {
if (item.pages.length == 0) {
const page: Page = {
name: item.name,
enable: item.enable,
url: item.url!,
}
this.goDetailPage(page)
return
}
for (var i = 0; i < this.list.length; ++i) {
if (index == i) {
this.list[i].open = !this.list[i].open
} else {
this.list[i].open = false
}
}
},
goDetailPage(e: Page) {
if (e.enable == false) {
uni.showToast({
icon: 'none',
title: '暂不支持',
})
return
}
const url =
e.url.indexOf('platform') > -1
? e.url
: `/pages/template/${e.url}/${e.url}`
uni.navigateTo({
url,
})
},
},
}
</script>
<style>
@import "../../common/uni-uvue.css";
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册