123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <view class="zaiui-bar-search-title-box">
- <view class="cu-bar" :class="[fixed?'fixed':'', shadow?'':'no-shadow', bgColor]">
- <view class="action" @tap="BackPage" v-if="isBack">
- <text class="cuIcon-back"/>
- </view>
- <view class="content search" @tap="contentTap">
- <view class="search-form round">
- <text class="cuIcon-search"/>
- <text class="margin-left-xs">{{content}}</text>
- </view>
- </view>
- <view class="action" @tap="rightTap">
- <!--小程序端不显示-->
- <!-- #ifndef MP -->
- <slot name="right"/>
- <!-- #endif -->
- </view>
- </view>
- <!--占位的-->
- <view class="zaiui-seat-height" v-if="fixed"/>
- </view>
- </template>
- <script>
- export default {
- name: 'bar-search-title',
- props: {
- bgColor: {
- type: String,
- default: ''
- },
- content: {
- type: String,
- default: '输入关键字'
- },
- isBack: {
- type: Boolean,
- default: true
- },
- fixed: {
- type: Boolean,
- default: true
- },
- shadow: {
- type: Boolean,
- default: false
- }
- },
- methods: {
- BackPage() {
- uni.navigateBack();
- },
- contentTap() {
- this.$emit('contentTap');
- },
- rightTap() {
- this.$emit('rightTap');
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .zaiui-bar-search-title-box {
- .cu-bar {
- padding-top: var(--status-bar-height);
- min-height: calc(var(--status-bar-height) + 101upx);
- .content {
- top: var(--status-bar-height);
- /* #ifndef MP */
- width: calc(100% - 181.81upx);
- /* #endif */
-
- /* #ifdef MP */
- left: -140upx;
- width: calc(100% - 300upx);
- /* #endif */
-
- .search-form {
- display: inherit;
- flex: inherit;
- margin: 0;
- color: #717171;
- [class*="cuIcon-"] {
- margin: 0;
- }
- }
- }
- }
- .cu-bar.fixed.no-shadow {
- box-shadow: inherit;
- }
- .cu-bar.bg-white {
- color: #333333;
- }
- .zaiui-seat-height {
- width: 100%;
- height: calc(var(--status-bar-height) + 101upx);
- }
- }
- </style>
|