Commit 76ba291d authored by jyx's avatar jyx

优化样式

parent 9cde95fb
<template> <template>
<uni-popup ref='pop' type="left" maskClick="ture"> <uni-popup ref='pop' type="left" :is-mask-click='false' :safe-area='false'>
<scroll-view scroll-y style="background-color: white;width: 400rpx;max-width: 400rpx;"> <scroll-view scroll-y style="background-color: white;width: 400rpx;max-width: 400rpx;height: 100%;">
<view class="setting-box"> <view class="setting-box">
<block v-for='(item, index) in catalogueList' :key='index' :item='item'> <block v-for='(item, index) in catalogueList' :key='index' :item='item'>
<view @click="changeCatalogue(item.chapterNum)"> <view @click="changeCatalogue(item.chapterNum)">
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
}, },
computed: {}, computed: {},
watch: { watch: {
show: function(n) { show: function(n) {
this.initList() this.initList()
this.showPop = n; this.showPop = n;
}, },
showPop: function(n, o) { showPop: function(n, o) {
if (n == o) return; if (n == o) return;
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
{{limitButtonTitle}} {{limitButtonTitle}}
</view> </view>
<view style="height: 120rpx;"> </view> <view style="height: 150rpx;"> </view>
<view class="safe-placeholder" :style="[safePlacehoderStyle]"> </view>
</template> </template>
</view> </view>
</template> </template>
...@@ -131,7 +131,16 @@ ...@@ -131,7 +131,16 @@
}, },
isHasContent: function() { isHasContent: function() {
return this.contentSources.length > 0 return this.contentSources.length > 0
} },
safePlacehoderStyle: function() {
let height = 0;
if (this.bottomSafeHeight) {
height = height + px2rpx(this.bottomSafeHeight)
}
return {
height: `${height}rpx`
}
},
}, },
methods: { methods: {
// 文章数据刷新 // 文章数据刷新
...@@ -251,7 +260,7 @@ ...@@ -251,7 +260,7 @@
padding: 0 100rpx; padding: 0 100rpx;
text { text {
background-color: #fff; background-color: cornsilk;
color: black; color: black;
border-radius: 10rpx; border-radius: 10rpx;
padding: 16rpx 20rpx; padding: 16rpx 20rpx;
...@@ -261,9 +270,9 @@ ...@@ -261,9 +270,9 @@
.limit-button-box { .limit-button-box {
text-indent: 0; text-indent: 0;
height: 80rpx; height: 50rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
line-height: 80rpx; line-height: 50rpx;
text-align: center; text-align: center;
color: goldenrod; color: goldenrod;
font-size: 28rpx; font-size: 28rpx;
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
this.$emit('close') this.$emit('close')
this.$refs.pop.close(); this.$refs.pop.close();
}, },
change(e) { change(e) {
if (this.showPop == e.show) return; if (this.showPop == e.show) return;
this.showPop = e.show this.showPop = e.show
}, },
......
<template> <template>
<view class="search-section"> <view class="search-section">
<view class="row header"> <view class="row header">
<view class="title"> <view class="title">
{{title}} {{title}}
</view> </view>
<view class="header-button"> <view class="header-button">
<slot name='headerButton'></slot> <slot name='headerButton'></slot>
</view> </view>
</view> </view>
<view class="row body"> <view class="row body">
<slot> <slot>
<view class="ele-empty" v-if='showEmpty'> <view class="ele-empty" v-if='showEmpty'>
{{emptyTitle}} {{emptyTitle}}
</view> </view>
<view class="ele-box" v-else> <!-- <scroll-view scroll-x v-else> -->
<view class="ele" v-for='(item, index) in itemSource' :key="index" @click="tapEle(item, index)"> <view class="ele-box" v-else>
{{itemKey?item[itemKey]:item}} <view class="ele" v-for='(item, index) in itemSource' :key="index" @click="tapEle(item, index)">
</view> {{itemKey?item[itemKey]:item}}
</view> </view>
</slot> </view>
</view> <!-- </scroll-view> -->
</view> </slot>
</template> </view>
</view>
<script> </template>
import {
isEmpty <script>
} from '../../../../common/utils/util' import {
export default { isEmpty
props: { } from '../../../../common/utils/util'
title: { export default {
type: String, props: {
default: "" title: {
}, type: String,
itemSource: { default: ""
type: Array, },
default: function() { itemSource: {
return [] type: Array,
} default: function() {
}, return []
itemKey: { }
type: String, },
default: "" itemKey: {
}, type: String,
emptyTitle: { default: ""
type: String, },
default: '暂无数据~' emptyTitle: {
} type: String,
}, default: '暂无数据~'
computed: { }
showEmpty: function() { },
return isEmpty(this.itemSource); computed: {
} showEmpty: function() {
}, return isEmpty(this.itemSource);
methods: { }
tapEle(item, index) { },
this.$emit('tapItem', { methods: {
detail: { tapEle(item, index) {
item, this.$emit('tapItem', {
index detail: {
} item,
}) index
} }
} })
} }
</script> }
}
<style lang="scss" scoped> </script>
.search-section {
padding: 20rpx 40rpx; <style lang="scss" scoped>
display: flex; .search-section {
flex-direction: column; padding: 20rpx 40rpx;
display: flex;
.row { flex-direction: column;
margin-bottom: 20rpx;
} .row {
margin-bottom: 20rpx;
.row:last-child { }
margin-bottom: 0;
} .row:last-child {
margin-bottom: 0;
.header { }
display: flex;
flex-direction: row; .header {
align-items: center; display: flex;
justify-content: space-between; flex-direction: row;
align-items: center;
.title { justify-content: space-between;
height: 40rpx;
line-height: 40rpx; .title {
font-size: 28rpx; height: 40rpx;
color: #333; line-height: 40rpx;
} font-size: 28rpx;
color: #333;
.header-button { }
display: flex;
flex-direction: column; .header-button {
align-items: center; display: flex;
justify-content: center; flex-direction: column;
} align-items: center;
} justify-content: center;
}
.body { }
display: flex;
flex-direction: column; .body {
display: flex;
.ele-empty { flex-direction: column;
height: 80rpx;
line-height: 80rpx; .ele-empty {
text-align: center; height: 80rpx;
font-size: 28rpx; line-height: 80rpx;
color: #999; text-align: center;
} font-size: 28rpx;
color: #999;
.ele-box { }
display: flex;
flex-direction: row; .ele-box {
padding-left: 15rpx; display: flex;
flex-direction: row;
.ele { padding-left: 15rpx;
margin: 15rpx 0; flex-wrap: wrap;
margin-right: 15rpx; overflow: auto;
padding: 0 20rpx;
height: 50rpx; .ele {
line-height: 50rpx; margin: 15rpx 0;
border-radius: 25rpx; margin-right: 15rpx;
background: #ededed; padding: 0 20rpx;
color: #999; height: 50rpx;
font-size: 28rpx; line-height: 50rpx;
} border-radius: 25rpx;
} background: #ededed;
} color: #999;
} font-size: 28rpx;
}
}
}
}
</style> </style>
\ No newline at end of file
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
}) })
}, },
tapItem(e, index) { tapItem(e, index) {
gotoBookContentPage(e.detail.data.id, e.detail.data.id) gotoBookContentPage(e.detail.data.id, e.detail.data.shortis)
}, },
} }
} }
......
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