You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
2.1 KiB
104 lines
2.1 KiB
<template>
|
|
<view class="showMore">
|
|
<view class="showMoreContent" :class="collapseFlag ? 'up' : 'down'">
|
|
<slot></slot>
|
|
</view>
|
|
<view class="showMoreTool">
|
|
<view class="showMoreTitle">{{ title }}</view>
|
|
<view class="showMoreIcon" :class="collapseFlag ? 'up' : 'down'" @click="collapse"></view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
const COMPONENT_NAME = 'showMore'
|
|
export default {
|
|
name: COMPONENT_NAME,
|
|
props: {
|
|
showBack: { // 是否显示返回按钮
|
|
type: Boolean,
|
|
default() {
|
|
return true
|
|
}
|
|
},
|
|
bgTransparent: { // 背景是否透明
|
|
type: Boolean,
|
|
default() {
|
|
return false
|
|
}
|
|
},
|
|
bgnum: {
|
|
type: Boolean,
|
|
default() {
|
|
return false
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
title: this.$t("recharge").ShowMore,
|
|
collapseFlag: false, // 折叠状态
|
|
}
|
|
},
|
|
computed: {
|
|
|
|
},
|
|
mounted() {
|
|
|
|
},
|
|
methods: {
|
|
collapse() {
|
|
this.collapseFlag = !this.collapseFlag;
|
|
this.title = this.collapseFlag ? this.$t("recharge").Pickup : this.$t("recharge").ShowMore
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.showMoreContent {
|
|
padding-top: 16rpx;
|
|
margin-bottom: 16rpx;
|
|
// border-top: 2rpx solid #323045;
|
|
overflow: hidden;
|
|
transition: max-height 0.5s ease-in-out;
|
|
|
|
&.up {
|
|
max-height: 500rpx;
|
|
}
|
|
|
|
&.down {
|
|
max-height: 0;
|
|
|
|
}
|
|
}
|
|
|
|
.showMoreTool {
|
|
position: relative;
|
|
color: #00E8A2;
|
|
font-size: 28rpx;
|
|
|
|
.showMoreIcon {
|
|
width: 32rpx;
|
|
height: 32rpx;
|
|
|
|
position: absolute;
|
|
top: 4rpx;
|
|
right: 8rpx;
|
|
background-image: url(../../static/me/ic_input_arrow_down.png);
|
|
background-repeat: no-repeat;
|
|
background-size: 32rpx;
|
|
transition: transform 0.3s;
|
|
|
|
&.up {
|
|
transform: rotate(-180deg);
|
|
}
|
|
|
|
&.down {
|
|
transform: rotate(0deg);
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|