提交 599d0e21 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

Merge branch 'dev' of https://gitcode.net/dcloud/hello-uni-app-x into dev

<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="io.dcloud.hellouniappx"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="io.dcloud.hellouniappx">
<application> <!-- 读取日历权限,用于演示权限申请监听API:uni.createRequestPermissionListener -->
<uses-permission android:name="android.permission.READ_CALENDAR"/>
</application> <application>
</application>
</manifest>
\ No newline at end of file </manifest>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<view class="uni-list uni-common-pl"> <view class="uni-list uni-common-pl">
<radio-group @change="_change"> <radio-group @change="_change">
<radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.name" <radio class="uni-list-cell uni-list-cell-pd radio" v-for="(item, index) in items" :key="item.name"
:class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value"> :class="index < items.length - 1 ? 'uni-list-cell-line' : ''" :value="item.value + ''">
{{ item.name }} {{ item.name }}
</radio> </radio>
</radio-group> </radio-group>
......
...@@ -2,43 +2,36 @@ ...@@ -2,43 +2,36 @@
"name": "hello-uniapp x", "name": "hello-uniapp x",
"appid": "__UNI__3584C99", "appid": "__UNI__3584C99",
"description": "", "description": "",
"versionName": "1.0.16", "versionName": "1.0.18",
"versionCode": "10016", "versionCode": "10018",
"uni-app-x": "uni-app-x": {},
{ /* 快应用特有相关 */
}, "quickapp": {},
/* 快应用特有相关 */ /* 小程序特有相关 */
"quickapp": "mp-weixin": {
{
},
/* 小程序特有相关 */
"mp-weixin":
{
"appid": "", "appid": "",
"setting": "setting": {
{
"urlCheck": false "urlCheck": false
}, },
"usingComponents": true "usingComponents": true
}, },
"mp-alipay": "mp-alipay": {
{
"usingComponents": true "usingComponents": true
}, },
"mp-baidu": "mp-baidu": {
{
"usingComponents": true "usingComponents": true
}, },
"mp-toutiao": "mp-toutiao": {
{
"usingComponents": true "usingComponents": true
}, },
"uniStatistics": "uniStatistics": {
{
"enable": false "enable": false
}, },
"app": "app": {},
{ "vueVersion": "3",
}, "h5": {
"vueVersion": "3" "router": {
} "base": "/web/"
\ No newline at end of file }
}
}
...@@ -63,6 +63,12 @@ ...@@ -63,6 +63,12 @@
"navigationBarTitleText": "list-view-multiplex" "navigationBarTitleText": "list-view-multiplex"
} }
}, },
{
"path": "pages/component/list-view/list-view-multiplex-video",
"style": {
"navigationBarTitleText": "list-view-multiplex-video"
}
},
{ {
"path": "pages/component/sticky-section/sticky-section", "path": "pages/component/sticky-section/sticky-section",
"style": { "style": {
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<!-- #endif --> <!-- #endif -->
<page-head title="权限申请监听"></page-head> <page-head title="权限申请监听"></page-head>
<view class="permission-alert" id="permission-alert" :style="{'transform':isPermissionAlertShow ? 'translateY(0)':'translateY(-110px)'}"> <view class="permission-alert" id="permission-alert" :style="{'transform':isPermissionAlertShow ? 'translateY(0)':'translateY(-110px)'}">
<text style="font-size: 20px;margin-bottom: 10px;margin-top: 5px;">日历权限申请说明:</text> <text style="font-size: 20px;margin-bottom: 10px;margin-top: 5px;">访问日历权限申请说明:</text>
<text style="color: darkgray;">uni-app x正在申请日历权限,允许或拒绝均不会获取任何隐私信息。</text> <text style="color: darkgray;">uni-app x正在申请访问日历权限用于演示,允许或拒绝均不会获取任何隐私信息。</text>
</view> </view>
<button type="primary" style="margin: 10px;" @click="requestPermission">点击申请日历权限</button> <button type="primary" style="margin: 10px;" @click="requestPermission">点击申请日历权限</button>
......
...@@ -72,7 +72,6 @@ describe("onLoad", () => { ...@@ -72,7 +72,6 @@ describe("onLoad", () => {
failureThreshold: 0.05, failureThreshold: 0.05,
failureThresholdType: "percent", failureThresholdType: "percent",
}); });
await program.callUniMethod('hideToast')
}); });
it("showLoading", async () => { it("showLoading", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
...@@ -91,7 +90,6 @@ describe("onLoad", () => { ...@@ -91,7 +90,6 @@ describe("onLoad", () => {
failureThreshold: 0.05, failureThreshold: 0.05,
failureThresholdType: "percent", failureThresholdType: "percent",
}); });
await program.callUniMethod('hideLoading')
}); });
it("showModal", async () => { it("showModal", async () => {
page = await program.reLaunch(INTERMEDIATE_PAGE_PATH); page = await program.reLaunch(INTERMEDIATE_PAGE_PATH);
......
...@@ -56,19 +56,25 @@ describe('Button.uvue', () => { ...@@ -56,19 +56,25 @@ describe('Button.uvue', () => {
expect(await btn.property('size')).toBe('mini') expect(await btn.property('size')).toBe('mini')
}) })
it('plain', async () => { it('plain', async () => {
const btn = await page.$('.btn') const btn = await page.$('.btn')
expect(await btn.property('plain')).toBe(false) // TODO
const newValue1 = await btn.property('plain')
expect(newValue1.toString()).toBe(false + '')
await page.setData({ await page.setData({
plain_boolean: true, plain_boolean: true,
}) })
expect(await btn.property('plain')).toBe(true) const newValue2 = await btn.property('plain')
expect(newValue2.toString()).toBe(true + '')
}) })
it('disabled', async () => { it('disabled', async () => {
const btn = await page.$('.btn') const btn = await page.$('.btn')
expect(await btn.property('disabled')).toBe(false) // TODO
const newValue1 = await btn.property('disabled')
expect(newValue1.toString()).toBe(false + '')
await page.setData({ await page.setData({
disabled_boolean: true, disabled_boolean: true,
}) })
expect(await btn.property('disabled')).toBe(true) const newValue2 = await btn.property('disabled')
expect(newValue2.toString()).toBe(true + '')
}) })
}) })
...@@ -42,11 +42,15 @@ describe('Checkbox.uvue', () => { ...@@ -42,11 +42,15 @@ describe('Checkbox.uvue', () => {
}) })
it('checked', async () => { it('checked', async () => {
const cb = await page.$('.cb') const cb = await page.$('.cb')
expect(await cb.property('checked')).toBe(true) // TODO
const newValue1 = await cb.property('checked')
expect(newValue1.toString()).toBe(true + '')
await page.setData({ await page.setData({
checked: false, checked: false,
}) })
expect(await cb.property('checked')).toBe(false) // TODO
const newValue2 = await cb.property('checked')
expect(newValue2.toString()).toBe(false + '')
}) })
it('color', async () => { it('color', async () => {
const cb = await page.$('.cb') const cb = await page.$('.cb')
......
<template>
<list-view class="list">
<list-item class="list-item" v-for="(_,index) in 20">
<text>第{{index + 1}}个视频</text>
<video class="video" :src="src" :controls="true" @pause="onPause"></video>
</list-item>
</list-view>
</template>
<script>
export default {
data() {
return {
src: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4'
}
},
methods: {
onPause(e : UniEvent) {
console.log(JSON.stringify(e));
}
}
}
</script>
<style>
.list {
flex: 1;
}
.list-item {
background-color: white;
margin-bottom: 30px;
}
.video {
width: 100%;
height: 200px;
}
</style>
...@@ -193,6 +193,11 @@ ...@@ -193,6 +193,11 @@
list-view 复用测试(item中嵌入input) list-view 复用测试(item中嵌入input)
</button> </button>
</navigator> </navigator>
<navigator url="/pages/component/list-view/list-view-multiplex-video" hover-class="none">
<button type="primary" class="button">
list-view 复用测试(item中嵌入video)
</button>
</navigator>
</view> </view>
</scroll-view> </scroll-view>
</template> </template>
......
...@@ -15,15 +15,19 @@ describe('PickerView.uvue', () => { ...@@ -15,15 +15,19 @@ describe('PickerView.uvue', () => {
it('value', async () => { it('value', async () => {
const el = await page.$('.picker-view') const el = await page.$('.picker-view')
await page.callMethod('setValue') await page.callMethod('setValue')
await page.waitFor(1000) await page.waitFor(1000)
expect(await el.property('value')).toEqual([0, 0, 0]) const newValue1 = await el.property('value')
// TODO
expect(newValue1.toString()).toEqual('0,0,0')
if (process.env.UNI_PLATFORM === 'app-android') { if (process.env.UNI_PLATFORM === 'app-android') {
expect(await getData('result')).toEqual([0, 0, 0]) expect(await getData('result')).toEqual([0, 0, 0])
} }
await page.callMethod('setValue1') await page.callMethod('setValue1')
await page.waitFor(1000) await page.waitFor(1000)
expect(await el.property('value')).toEqual([10, 10, 10]) const newValue2 = await el.property('value')
// TODO
expect(newValue2.toString()).toEqual('10,10,10')
if (process.env.UNI_PLATFORM === 'app-android') { if (process.env.UNI_PLATFORM === 'app-android') {
expect(await getData('result')).toEqual([10, 10, 10]) expect(await getData('result')).toEqual([10, 10, 10])
} }
......
...@@ -40,11 +40,14 @@ describe('Radio.uvue', () => { ...@@ -40,11 +40,14 @@ describe('Radio.uvue', () => {
}) })
it('checked', async () => { it('checked', async () => {
const radio = await page.$('.r') const radio = await page.$('.r')
expect(await radio.property('checked')).toBe(true) // TODO
const newValue1 = await radio.property('checked')
expect(newValue1.toString()).toBe(true + '')
await page.setData({ await page.setData({
checked: false, checked: false,
}) })
expect(await radio.property('checked')).toBe(false) const newValue2 = await radio.property('checked')
expect(newValue2.toString()).toBe(false + '')
}) })
it('color', async () => { it('color', async () => {
const radio = await page.$('.r') const radio = await page.$('.r')
......
...@@ -15,7 +15,9 @@ describe('slider', () => { ...@@ -15,7 +15,9 @@ describe('slider', () => {
// TODO 暂时仅获取第一个 // TODO 暂时仅获取第一个
const slider1 = await page.$('.slider') const slider1 = await page.$('.slider')
expect(await slider1.property('value')).toBe(sliderValue) // TODO
const newValue = await slider1.property('value')
expect(newValue.toString()).toBe(sliderValue + '')
// const slider100 = await page.$$('.slider') // const slider100 = await page.$$('.slider')
// for (let i = 0; i < slider100.length; i++) { // for (let i = 0; i < slider100.length; i++) {
......
...@@ -15,7 +15,9 @@ describe('slider', () => { ...@@ -15,7 +15,9 @@ describe('slider', () => {
sliderValue: sliderValue, sliderValue: sliderValue,
}) })
await page.waitFor(100) await page.waitFor(100)
expect(await slider.property('value')).toBe(sliderValue) // TODO
const newValue = await slider.property('value')
expect(newValue.toString()).toBe(sliderValue + '')
}) })
it('color', async () => { it('color', async () => {
const slider = await page.$('.slider-custom-color-and-size') const slider = await page.$('.slider-custom-color-and-size')
......
...@@ -29,13 +29,17 @@ describe('switch', () => { ...@@ -29,13 +29,17 @@ describe('switch', () => {
checked: false, checked: false,
}) })
await page.waitFor(100) await page.waitFor(100)
expect(await switch_element.property('checked')).toBe(false) // TODO
const newValue1 = await switch_element.property('checked')
expect(newValue1.toString()).toBe(false + '')
await page.setData({ await page.setData({
checked: true, checked: true,
}) })
await page.waitFor(100) await page.waitFor(100)
expect(await switch_element.property('checked')).toBe(true) // TODO
const newValue2 = await switch_element.property('checked')
expect(newValue2.toString()).toBe(true + '')
}) })
it('color', async () => { it('color', async () => {
const switch_element = await page.$('.switch-color') const switch_element = await page.$('.switch-color')
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
data() { data() {
return { return {
title: '浏览器 canvas', title: '浏览器 canvas',
drawing: null as UniElement | null, drawing: null as HTMLElement | null,
canvasElement: null as HTMLCanvasElement | null, canvasElement: null as HTMLCanvasElement | null,
canvasContext: null as CanvasRenderingContext2D | null, canvasContext: null as CanvasRenderingContext2D | null,
} }
}, },
onReady() { onReady() {
this.drawing = this.$refs['drawing'] as UniElement; this.drawing = this.$refs['drawing'] as HTMLElement;
this.canvasElement = document.createElement('canvas') as HTMLCanvasElement; this.canvasElement = document.createElement('canvas') as HTMLCanvasElement;
this.canvasElement.className = 'canvas' this.canvasElement.className = 'canvas'
this.drawing!.appendChild(this.canvasElement) this.drawing!.appendChild(this.canvasElement)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
export default { export default {
data() { data() {
return { return {
$elementMap: new Map<string, Element>(), $elementMap: new Map<string, UniElement>(),
x: 0 as number, x: 0 as number,
y: 0 as number, y: 0 as number,
// 飘走的卡片计数 // 飘走的卡片计数
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
} else { } else {
// console.log('直接拿'); // console.log('直接拿');
} }
element?.style?.setProperty(propertyName, propertyStyle); element.style.setProperty(propertyName, propertyStyle);
}, },
touchstart(e : TouchEvent) { touchstart(e : TouchEvent) {
// console.log('touchstart') // console.log('touchstart')
......
...@@ -78,7 +78,9 @@ ...@@ -78,7 +78,9 @@
this.halfOffset = offset; this.halfOffset = offset;
} }
} }
e.preventDefault(); // #ifdef WEB
e.preventDefault();
// #endif
}, },
onHalfTouchEnd(_ : TouchEvent) { onHalfTouchEnd(_ : TouchEvent) {
this.halfScreenY = 0; this.halfScreenY = 0;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
export default { export default {
data() { data() {
return { return {
$elementMap: new Map<string, Element>() $elementMap: new Map<string, UniElement>()
} }
}, },
methods: { methods: {
...@@ -64,10 +64,10 @@ ...@@ -64,10 +64,10 @@
}, },
// 工具方法,用于快速设置 Element 的 style // 工具方法,用于快速设置 Element 的 style
setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void { setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void {
let element : Element | null = (this.$data['$elementMap'] as Map<string, Element>).get(refName) let element : UniElement | null = (this.$data['$elementMap'] as Map<string, UniElement>).get(refName)
if (element == null) { if (element == null) {
element = this.$refs[refName] as UniElement; element = this.$refs[refName] as UniElement;
(this.$data['$elementMap'] as Map<string, Element>).set(refName, element) (this.$data['$elementMap'] as Map<string, UniElement>).set(refName, element)
} }
element.style.setProperty(propertyName, propertyStyle); element.style.setProperty(propertyName, propertyStyle);
}, },
......
<template> <template>
<scroll-view @scroll="onScroll" class="scroll-view" rebound="false"> <scroll-view @scroll="onScroll" class="page" show-scrollbar="false">
<!--#ifdef APP--> <view ref="seatbar" class="seatbar"></view>
<view class="height-seat" style="height: 125px;">
<!-- 垫高专用 -->
</view>
<!--#endif-->
<!--#ifdef WEB-->
<view class="height-seat" style="height: 90px;">
<!-- 垫高专用 -->
</view>
<!--#endif-->
<view class="content"> <view class="content">
<view class="content-item"> <view class="content-item">
...@@ -23,197 +14,161 @@ ...@@ -23,197 +14,161 @@
</view> </view>
</view> </view>
<view ref="top-box" class="top-box"> <view ref="navigatorbar" class="navigatorbar">
<view ref="scroll-fold-nav" class="scroll-fold-nav"> <view class="titlebar">
<view class="nav-title">DCloud 为开发者而生</view> <view class="backview" @tap="back">
</view> <image class="back" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
<view @click="back" class="nav-back">
<image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
</view>
<view ref="search" class="search" @click="toSearchPage">
<view class="search-inner">
<image class="search-img" src="/static/template/scroll-fold-nav/search.png" mode="widthFix"></image>
<text class="search-tip-text">请输入你要搜索的内容</text>
</view> </view>
<text class="search-btn">搜索</text> <text ref="title" class="title">DCloud 为开发者而生</text>
</view> </view>
</view> <view ref="searchbar" class="searchbar" @tap="search">
<image class="searchimg" src="/static/template/scroll-fold-nav/search.png" mode="widthFix"></image>
</scroll-view> <text class="searchinput">请输入你要搜索的内容</text>
</template> <text class="searchbutton">搜索</text>
</view>
</view>
</scroll-view>
</template>
<script> <script>
export default { //导航栏高度
data() { const NAVIBARHEIGHT = 88;
//搜索栏高度
const SEARCHBARHEIGHT = 40;
//返回键按钮宽度
const BACKWIDTH = 32;
export default {
data() {
return { return {
statusBarHeight: 35, statusBarHeight: 0,
scrollTop: 0, nviBarHeight: 0,
searchWidth: 700, naviElement: null as UniElement | null,
searchNode: null as UniElement | null, titleElement: null as UniElement | null,
boxNode: null as UniElement | null, searchElement: null as UniElement | null
navNode: null as UniElement | null }
}
}, },
onLoad() { }, onLoad() {
// #ifdef APP
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
// #endif
this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight;
},
onReady() { onReady() {
this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight ?? 35; this.naviElement = this.$refs['navigatorbar'] as UniElement;
this.searchNode = this.$refs['search'] as UniElement; this.searchElement = this.$refs['searchbar'] as UniElement;
this.boxNode = this.$refs['top-box'] as UniElement; this.titleElement = this.$refs['title'] as UniElement;
this.navNode = this.$refs['scroll-fold-nav'] as UniElement; //适配不同状态栏高度
}, this.naviElement?.style?.setProperty('padding-top', this.statusBarHeight+'px');
this.naviElement?.style?.setProperty('height', (NAVIBARHEIGHT+this.statusBarHeight)+'px');
let seatElement = this.$refs['seatbar'] as UniElement;
seatElement.style.setProperty('height', (NAVIBARHEIGHT+this.statusBarHeight)+'px');
},
methods: { methods: {
onScroll(e : ScrollEvent) { onScroll(e : ScrollEvent) {
let scrollTop = e.detail.scrollTop let offset = e.detail.scrollTop>SEARCHBARHEIGHT?SEARCHBARHEIGHT:e.detail.scrollTop;
// #ifdef APP this.naviElement?.style?.setProperty('height', (this.nviBarHeight -offset)+'px');
const originalBoxHeight = 125 this.searchElement?.style?.setProperty('left', BACKWIDTH*offset/SEARCHBARHEIGHT+'px');
// #else this.titleElement?.style?.setProperty('opacity', (1-offset/SEARCHBARHEIGHT));
const originalBoxHeight = 90
// #endif
this.boxNode?.style?.setProperty('height', (originalBoxHeight - (scrollTop > 35 ? 35 : scrollTop)) + 'px');
this.boxNode?.style?.setProperty('background-color', 'rgba(255, 255, 255, ' + (scrollTop * 3 > 100 ? 100 : scrollTop * 3) / 100.0 + ')');
this.navNode?.style?.setProperty('opacity', 1 - (scrollTop * 3 > 100 ? 100 : scrollTop * 3) / 100.0);
this.searchNode?.style?.setProperty('width', 700 - (scrollTop > 40 ? 40 : scrollTop) + 'rpx');
this.searchNode?.style?.setProperty('top', 0 - (scrollTop > 40 ? 40 : scrollTop) + 'px');
this.scrollTop = scrollTop;
}, },
back() { back() {
// uni.navigateBack() // 这么写用不了 uni.navigateBack();
// 这么写可以用
uni.navigateBack({
success(result) {
console.log('navigateBack success', result.errMsg)
},
fail(error) {
console.log('navigateBack fail', error.errMsg)
},
complete(result) {
console.log('navigateBack complete', result.errMsg)
},
})
// uni.switchTab({
// url:'/pages/tabBar/template'
// })
}, },
toSearchPage() { search() {
uni.showToast({ uni.showToast({
title: '暂不支持', title: '暂不支持',
icon: 'none' icon: 'none'
}); });
} }
}, }
}
} </script>
</script>
<style> <style>
.page { .page {
flex: 1; flex: 1;
background-color: #fbdf0d; background-color: #f5f5f5;
} }
.navigatorbar {
.scroll-view { position: fixed;
flex: 1; /* #ifdef APP */
} padding-top: 35px;
height: 124px;
.height-seat { /* #endif */
height: 110px; /* #ifdef WEB */
/* background-color: #fbdf0d; */ height: 88px;
} /* #endif */
border-bottom: 1px solid #efefef;
.content { width: 100%;
padding: 5px 15px; background-color: #f5f5f5;
background-color: #f5f5f5; }
} .titlebar {
flex-direction: row;
.content-item { align-items: center;
padding: 15px; height: 44px;
margin: 5px 0; }
background-color: #fff; .backview {
border-radius: 5px; width: 44px;
} height: 44px;
justify-content: center;
.text { align-items: center;
font-size: 14px; }
color: #666; .back {
line-height: 20px; width: 20px;
} }
.title {
.top-box { margin: 0px 2px;
position: fixed; }
top: 0; .searchbar {
width: 100%; position: absolute;
align-items: flex-end; bottom: 2px;
border-bottom: 1px solid #efefef; left: 0px;
/* #ifdef APP */ right: 0px;
height: 125px; background-color: #FFFFFF;
padding-top: 35px; border: 1px solid #fbdf0d;
/* #else */ height: 32px;
height: 90px; border-radius: 100px;
/* #endif */ margin: 6px 12px;
background-color: rgba(255, 255, 255, 0); padding: 8px;
background-color: aliceblue; flex-direction: row;
} align-items: center;
justify-content: center;
.scroll-fold-nav { }
height: 44px; .searchimg {
width: 100%; width: 15px;
justify-content: center; }
} .searchinput {
flex-grow: 1;
.nav-title { font-size: 12px;
margin-left: 30px; color: #666;
} }
.searchbutton {
.nav-back { font-size: 12px;
position: absolute; background-color: #ff6900;
/* #ifdef APP */ color: #FFF;
top: 46px; padding: 5px 8px;
/* #else */ border-radius: 100px;
top: 11px; }
/* #endif */ .seatbar {
left: 8px; /* #ifdef APP */
} height: 124px;
/* #endif */
.nav-back .back-img { /* #ifdef WEB */
width: 18px; height: 88px;
margin-top: 2px; /* #endif */
} }
.content {
.search { padding: 5px 15px;
background-color: #FFFFFF; }
border: 1px solid #fbdf0d; .content-item {
height: 35px; padding: 15px;
border-radius: 100px; margin: 5px 0;
margin: 0 12px; background-color: #fff;
padding: 8px; border-radius: 5px;
flex-direction: row; }
align-items: center; .text {
justify-content: space-between; font-size: 14px;
width: 96%; color: #666;
top: 0px; line-height: 20px;
} }
.search-inner { </style>
margin-top: 2px;
flex-direction: row;
}
.search-inner .search-img {
width: 15px;
}
.search-tip-text {
font-size: 12px;
color: #666;
}
.search-btn {
font-size: 12px;
background-color: #ff6900;
color: #FFF;
padding: 5px 8px;
border-radius: 100px;
}
</style>
<template> <template>
<view class="page"> <view class="page">
<view @click="back" class="nav-back"> <view ref="back" @click="back" class="nav-back">
<image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image> <image class="back-img" src="/static/template/scroll-fold-nav/back.png" mode="widthFix"></image>
</view> </view>
<swiper class="swiper" :current="current" :circular="index != 0" :vertical="true" @change="onSwiperChange" <swiper class="swiper" :current="current" :circular="index != 0" :vertical="true" @change="onSwiperChange"
...@@ -86,7 +86,12 @@ ...@@ -86,7 +86,12 @@
}, },
onReady() { onReady() {
// 一启动完成,就播放第一个 // 一启动完成,就播放第一个
this.doPlay(0) this.doPlay(0);
// #ifdef APP
//App端适配不同状态栏高度
let backElement = this.$refs['back'] as UniElement;
backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px');
// #endif
}, },
onShow() { onShow() {
currentPageIsShow = true currentPageIsShow = true
...@@ -257,12 +262,14 @@ ...@@ -257,12 +262,14 @@
.nav-back { .nav-back {
position: absolute; position: absolute;
top: 20px; /* #ifdef APP */
left: 8px; top: 35px;
/* #endif */
background-color: rgba(220, 220, 220, 0.8); background-color: rgba(220, 220, 220, 0.8);
border-radius: 100px; border-radius: 100px;
width: 28px; margin: 6px;
height: 28px; width: 32px;
height: 32px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 10; z-index: 10;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册