Commit 0471b28a authored by chuan.liu's avatar chuan.liu

ios模拟器兼容性处理

parent 46ce3f1c
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
this.navHeight = `height:${this.sysinfo.safeArea.top + 44}px`; this.navHeight = `height:${this.sysinfo.safeArea.top + 44}px`;
}, },
onBackPress() { onBackPress() {
uni.navigateBack()
} }
} }
</script> </script>
......
<template> <template>
<view class="ticket-order-page"> <view class="ticket-order-page">
<view class="status_bar" :style="navHeight"></view> <view class="status_bar" :style="navHeight"></view>
<view class="tabs"> <view class="tabs">
<scroll-view ref="tabbar1" id="tab-bar" class="tab-bar" :scroll="false" :scroll-x="true" <scroll-view ref="tabbar1" id="tab-bar" class="tab-bar" :scroll="false" :scroll-x="true"
:scroll-into-view="scrollInto"> :scroll-into-view="scrollInto">
<view class="tab-bar-list"> <view class="tab-bar-list">
<view class="tab-bar-list-wrapper"> <view class="tab-bar-list-wrapper">
<view class="uni-tab-item" v-for="(tab,index) in tabList" :key="tab.id" :ref="'tabitem'+index"> <view class="uni-tab-item" v-for="(tab,index) in tabList" :key="tab.id" :ref="'tabitem'+index">
<text :id="tab.id" :data-id="index" :data-current="index" class="uni-tab-item-title" <text :id="tab.id" :data-id="index" :data-current="index" class="uni-tab-item-title"
:class="{'uni-tab-item-title-active':tabIndex==index}" @click="ontabtap">{{tab.name}}</text> :class="{'uni-tab-item-title-active':tabIndex==index}"
</view> @click="ontabtap">{{tab.name}}</text>
</view> </view>
<view class="scroll-view-indicator"> </view>
<view ref="underline" class="scroll-view-underline" :class="{'scroll-view-animation':isTap}" <view class="scroll-view-indicator">
:style="underlineStyle"></view> <view ref="underline" class="scroll-view-underline" :class="{'scroll-view-animation':isTap}"
</view> :style="underlineStyle"></view>
</view> </view>
</scroll-view> </view>
</scroll-view>
<view class="conditon-block" :class="{'conditon-block-auto':ishowDetail}">
<view class="filter-title"> <view class="conditon-block" :style="conditionTop" :class="{'conditon-block-auto':ishowDetail}">
<button type="default" class="filter-btn filter-btn-active">一周内</button> <view class="filter-title">
<button type="default" @click="handleFilter(item)" :class="{'filter-btn-active':item === filterActiveIndex}" class="filter-btn" v-for="item in 3" :key='item'>{{item}}月内</button> <button type="default" class="filter-btn filter-btn-active"><text
<image @click="handleShowDetail" class="icon-arrow" :class="{'icon-arrow-rotate':ishowDetail}" class="filter-btn__text filter-btn-active__text">一周内</text></button>
src="@/static/image/arrow_up@3x.png" mode="aspectFit"></image> <button type="default" @click="handleFilter(item)"
</view> :class="{'filter-btn-active':item === filterActiveIndex}" class="filter-btn" v-for="item in 3"
<view class="filter-content"> :key='item'>
<button type="default" @click="handleFilter(item+3)" class="filter-btn" :class="{'filter-btn-active':item+3 === filterActiveIndex}" v-for="item in 9" :key='item'>{{item+3}}月内</button> <text class="filter-btn__text"
</view> :class="{'filter-btn-active__text':item === filterActiveIndex}">{{item}}月内</text></button>
</view> <image @click="handleShowDetail" class="icon-arrow" :class="{'icon-arrow-rotate':ishowDetail}"
src="@/static/image/arrow_up@3x.png" mode="aspectFit"></image>
<swiper ref="swiper1" class="tab-box" :current="tabIndex" :duration="300" @change="onswiperchange" </view>
@transition="onswiperscroll" @animationfinish="animationfinish" @onAnimationEnd="animationfinish"> <view class="filter-content">
<swiper-item class="swiper-item" v-for="(page, index) in tabList" :key="index"> <button type="default" @click="handleFilter(item+3)" class="filter-btn"
<orderPage :ref="'page' + index" class="page-item" :nid="page.newsid"></orderPage> :class="{'filter-btn-active':item+3 === filterActiveIndex}" v-for="item in 9" :key='item'><text
</swiper-item> class="filter-btn__text"
</swiper> :class="{'filter-btn-active__text':item+3 === filterActiveIndex}">{{item+3}}月内</text></button>
</view> </view>
</view>
<view class="empty"></view>
<swiper ref="swiper1" class="tab-box" :current="tabIndex" :duration="300" @change="onswiperchange"
@transition="onswiperscroll" @animationfinish="animationfinish" @onAnimationEnd="animationfinish">
<swiper-item class="swiper-item" v-for="(page, index) in tabList" :key="index">
<orderPage :ref="'page' + index" class="page-item" :nid="page.newsid"></orderPage>
</swiper-item>
</swiper>
</view>
</view> </view>
</template> </template>
...@@ -64,23 +75,24 @@ ...@@ -64,23 +75,24 @@
data() { data() {
return { return {
tabList: [{ tabList: [{
id: "tab01", id: "tab01",
name: '全部', name: '全部',
newsid: 0 newsid: 0
}, { }, {
id: "tab02", id: "tab02",
name: '配额', name: '配额',
newsid: 23 newsid: 23
}, { }, {
id: "tab03", id: "tab03",
name: '非配额', name: '非配额',
newsid: 223 newsid: 223
}, },
{ {
id: "tab04", id: "tab04",
name: '公关团购', name: '公关团购',
newsid: 224 newsid: 224
}], }
],
tabIndex: 0, tabIndex: 0,
cacheTab: [], cacheTab: [],
scrollInto: "", scrollInto: "",
...@@ -93,9 +105,9 @@ ...@@ -93,9 +105,9 @@
swiperWidth: 0, swiperWidth: 0,
tabbarWidth: 0, tabbarWidth: 0,
tabListSize: {}, tabListSize: {},
_touchTabIndex: 0, _touchTabIndex: 0,
ishowDetail:false, ishowDetail: false,
filterActiveIndex:0, filterActiveIndex: 0,
} }
}, },
computed: { computed: {
...@@ -104,11 +116,16 @@ ...@@ -104,11 +116,16 @@
left: this.indicatorLineLeft + 'px', left: this.indicatorLineLeft + 'px',
width: this.indicatorLineWidth + 'px' width: this.indicatorLineWidth + 'px'
} }
}, },
navHeight() { navHeight() {
return { return {
'height': `${this.sysinfo.safeArea.top + 44}px` 'height': `${this.sysinfo.safeArea.top + 44}px`
} }
},
conditionTop() {
return {
'top': `${this.sysinfo.safeArea.top + 44 + 42}px`
}
}, },
...mapState(['sysinfo']) ...mapState(['sysinfo'])
}, },
...@@ -290,22 +307,23 @@ ...@@ -290,22 +307,23 @@
}, },
clearTabData(index) { clearTabData(index) {
this.pageList[index].clear(); this.pageList[index].clear();
}, },
handleShowDetail() { handleShowDetail() {
this.ishowDetail = !this.ishowDetail this.ishowDetail = !this.ishowDetail
}, },
handleFilter(item){ handleFilter(item) {
this.filterActiveIndex = item this.filterActiveIndex = item
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.ticket-order-page{ .ticket-order-page {
flex-direction: column; flex-direction: column;
} flex: 1;
}
/* #ifndef APP-PLUS */ /* #ifndef APP-PLUS */
page { page {
width: 100%; width: 100%;
...@@ -324,7 +342,7 @@ ...@@ -324,7 +342,7 @@
flex: 1; flex: 1;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
background-color: #ffffff; background-color: #ffffff;
} }
.tab-bar { .tab-bar {
...@@ -333,7 +351,7 @@ ...@@ -333,7 +351,7 @@
flex-direction: row; flex-direction: row;
/* #ifndef APP-PLUS */ /* #ifndef APP-PLUS */
white-space: nowrap; white-space: nowrap;
/* #endif */ /* #endif */
border-bottom: 0.5px solid #eeeeee; border-bottom: 0.5px solid #eeeeee;
} }
...@@ -375,62 +393,86 @@ ...@@ -375,62 +393,86 @@
.scroll-view-animation { .scroll-view-animation {
transition-duration: 0.2s; transition-duration: 0.2s;
transition-property: left; transition-property: left;
} }
.conditon-block{ .conditon-block {
width: 750rpx; position: fixed;
height: 124rpx; left: 0;
overflow:hidden; top: 172rpx;
background-color: #fff; right: 0;
display: flex; bottom: 0;
flex-direction: column; z-index: 10;
padding: 40rpx 32rpx 0 16rpx; width: 750rpx;
} height: 124rpx;
overflow: hidden;
.conditon-block-auto{ background-color: #fff;
height: auto; display: flex;
overflow:auto; flex-direction: column;
max-height:230px; padding: 40rpx 32rpx 0 16rpx;
} }
.icon-arrow { .conditon-block-auto {
width: 28rpx; height: 460rpx;
height: 16rpx; overflow: auto;
margin-left: 16rpx; max-height: 230px;
margin-top: 24rpx; }
transition-property: transform;
transition-duration: 0.15s; .icon-arrow {
transform: rotate(0deg); width: 28rpx;
} height: 16rpx;
margin-left: 16rpx;
.icon-arrow-rotate { margin-top: 24rpx;
transform: rotate(180deg); transition-property: transform;
} transition-duration: 0.15s;
transform: rotate(0deg);
}
.filter-btn{
flex: 0 0 148rpx; .icon-arrow-rotate {
height: 68rpx; transform: rotate(180deg);
line-height: 68rpx; }
background: #f8f8f8;
border-radius: 16rpx;
color: #8e8e8e; .filter-btn {
font-size: 24rpx; flex: 1;
margin-right: 20rpx; min-width: 148rpx;
margin-bottom: 20rpx; max-width: 148rpx;
border: 2rpx solid #f8f8f8; height: 68rpx;
} line-height: unset;
background: #f8f8f8;
.filter-btn-active{ border-radius: 16rpx;
background: #f61d30; color: #8e8e8e;
color: #fff; font-size: 24rpx;
border: 2rpx solid #f61d30; margin-right: 20rpx;
box-shadow: 0px 4rpx 12rpx 0px rgba(255,29,50,0.56); margin-bottom: 20rpx;
} margin-left: 0;
border: 2rpx solid #f8f8f8;
.filter-content{ }
display: flex;
flex-wrap: wrap; .filter-btn__text {
height: 68rpx;
line-height: 68rpx;
color: #8e8e8e;
font-size: 24rpx;
}
.filter-btn-active {
background: #f61d30;
color: #fff;
border: 2rpx solid #f61d30;
box-shadow: 0px 4rpx 12rpx 0px rgba(255, 29, 50, 0.56);
}
.filter-btn-active__text {
color: #fff;
}
.filter-content {
display: flex;
flex-wrap: wrap;
}
.empty {
height: 124rpx;
} }
.tab-box { .tab-box {
...@@ -477,9 +519,9 @@ ...@@ -477,9 +519,9 @@
flex: 1; flex: 1;
flex-direction: row; flex-direction: row;
position: absolute; position: absolute;
left: 0; left: 16rpx;
top: 0; top: 0;
right: 0; right: 16rpx;
bottom: 0; bottom: 0;
} }
</style> </style>
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
<view class="top"> <view class="top">
<text class="title-no">订单编号:TP10000021</text> <text class="title-no">订单编号:TP10000021</text>
<view class="title-info"> <view class="title-info">
<button class="title-info__status title-info__status-done" type="default">待审批</button> <button class="title-info__status title-info__status-done" type="default"><text
class="item-block-btn__text">待审批</text></button>
</view> </view>
</view> </view>
<view class="middle view"> <view class="middle view">
...@@ -37,8 +38,7 @@ ...@@ -37,8 +38,7 @@
} }
}, },
data() { data() {
return { return {}
}
}, },
methods: { methods: {
click() { click() {
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
height: 72rpx; height: 72rpx;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 32rpx; padding: 0 48rpx;
} }
.title-no { .title-no {
...@@ -87,21 +87,28 @@ ...@@ -87,21 +87,28 @@
height: 48rpx; height: 48rpx;
line-height: 48rpx; line-height: 48rpx;
background: #f61d30; background: #f61d30;
border-radius: 8rpx 200rpx 200rpx 8rpx; border-radius: 80rpx 200rpx 200rpx 80rpx;
border:1px solid #f61d30; border: 1px solid #f61d30;
font-size: 12px; font-size: 12px;
color: #fff; color: #fff;
text-align: center; text-align: center;
}
.title-info__status:after {
border: 0;
}
.title-info__status-done {
background: #f8f8f8;
color: #888888;
border: 1px solid #f8f8f8;
} }
.title-info__status:after { .item-block-btn__text {
border:0; height: 48rpx;
} line-height: 48rpx;
font-size: 12px;
.title-info__status-done{
background: #f8f8f8;
color: #888888; color: #888888;
border:1px solid #f8f8f8;
} }
.middle { .middle {
...@@ -146,7 +153,7 @@ ...@@ -146,7 +153,7 @@
.middle-date-des { .middle-date-des {
font-size: 24rpx; font-size: 24rpx;
color: #999; color: #999;
} }
.text-block-box { .text-block-box {
...@@ -157,7 +164,7 @@ ...@@ -157,7 +164,7 @@
.middle-date-right { .middle-date-right {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
text-align: right;
} }
</style> </style>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</view> </view>
</view> </view>
<view class="receive-info" ref='receiveInfo' <view class="receive-info" ref='receiveInfo' :style="receiveInfoHeightComputed"
:class="{'receive-info-auto':ishowReceiveDetail}"> :class="{'receive-info-auto':ishowReceiveDetail}">
<view class="block-detal-item"> <view class="block-detal-item">
<text class="detal-item-label detal-item-title">收货信息</text> <text class="detal-item-label detal-item-title">收货信息</text>
...@@ -122,6 +122,10 @@ ...@@ -122,6 +122,10 @@
</template> </template>
<script> <script>
// #ifdef APP-NVUE
const dom = weex.requireModule('dom')
// #endif
export default { export default {
props: { props: {
newsItem: { newsItem: {
...@@ -134,28 +138,37 @@ ...@@ -134,28 +138,37 @@
data() { data() {
return { return {
ishowDetail: true, ishowDetail: true,
ishowReceiveDetail: true, ishowReceiveDetail: false,
receiveInfoHeight:'24px' receiveInfoHeight: '132',
receiveInfoDetailSize: {},
} }
}, },
// watch:{ // watch:{
// ishowReceiveDetail(val){ // ishowReceiveDetail(val){
// if(val === true){ // if(val === true){
// this.receiveInfoHeight = `${this.$refs.receiveInfo.$el.clientHeight}px` // this.receiveInfoHeight = `${this.$refs.receiveInfo.$el.clientHeight}px`
// }else{ // }else{
// this.receiveInfoHeight = '24px' // this.receiveInfoHeight = '24px'
// }
// }
// },
// computed: {
// receiveInfoHeight() {
// let height = 0
// height = this.ishowReceiveDetail ? this.$refs.receiveInfo.$el.clientHeight : '0'
// return {
// "height": `${height}px`
// } // }
// } // }
// }, // },
computed: {
receiveInfoHeightComputed() {
return {
"height": `${this.receiveInfoHeight}px`
}
}
},
mounted() {
// setTimeout(() => {
// const result = dom.getComponentRect(this.$refs.receiveInfo, option => {
// console.log('getComponentRect:', option)
// this.receiveInfoDetailSize = option.size
// })
// console.log('return value2:', result)
// console.log('viewport:', dom.getComponentRect('viewport'))
// }, 100);
},
methods: { methods: {
click() { click() {
this.$emit('click'); this.$emit('click');
...@@ -169,6 +182,11 @@ ...@@ -169,6 +182,11 @@
}, },
handleShowReceiveDetail() { handleShowReceiveDetail() {
this.ishowReceiveDetail = !this.ishowReceiveDetail this.ishowReceiveDetail = !this.ishowReceiveDetail
if (this.ishowReceiveDetail === true) {
this.receiveInfoHeight = '480'
} else {
this.receiveInfoHeight = '132'
}
}, },
checkLogistics() { checkLogistics() {
uni.navigateTo({ uni.navigateTo({
...@@ -377,7 +395,7 @@ ...@@ -377,7 +395,7 @@
padding-bottom: 60rpx; padding-bottom: 60rpx;
} }
.receive-info-auto { .receive-info-auto {
height: auto; height: auto;
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment