| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <!-- 自定义导航栏 -->
- <view class="navBarBox">
- <!-- 状态栏占位 -->
- <view class="statusBar" :style="{paddingTop:statusBarHeight + 'rpx'}">
- </view>
- <!-- 直正的导航栏内容 -->
- <view class="navBar">
- <image class="logo" src="/static/images/dingwei@3x.png" mode="aspectFit" @click="leftbuttonsel(1)"></image>
- <view class="textlable" @click="leftbuttonsel(1)">
- <view class="lableT textfontB4">
- <text class="titleT">{{title}}</text>
- </view>
- <view class="lableB textfontS2">
- <text class="changduxz">{{titledetl}}</text>
- </view>
- </view>
-
- <view class="rightconten">
- <!--<image v-if="LinterestBT===1" class="interest" src="/static/images/购物车.png" mode="aspectFit" @click="leftbuttonsel(2)"></image>
- <image v-if="LmycartBT===1" class="mycart" src="/static/images//购物车.png" mode="aspectFit" @click="leftbuttonsel(3)"></image>-->
- </view>
- </view>
- <view class="contentColumnC">
- <uni-search-bar class="searchbar" :placeholder="$t('index.searchgoods')" cancelButton="none" locateButton="always" :readonly="readonly" v-on:searchClick="searchClick"></uni-search-bar>
- </view>
-
- </view>
- </template>
- <script>
- export default
- {
- props:{
- title:"",
- titledetl:"",
- interestBT:0,
- mycartBT:0,
- },
- data() {
- return{
- // 状态栏高度
- statusBarHeight:0,
- // 导航栏高度
- navBarHeight: 100,
- LinterestBT:this.interestBT,
- LmycartBT:this.mycartBT,
- readonly:true,
- };
- },
- //第一次加载时调用
- created() {
- //获取手机状态栏高度
- var systemInfo = uni.getSystemInfoSync();
- this.statusBarHeight=systemInfo.statusBarHeight*2;
- },
- methods:{
- leftbuttonsel(item){
- //触发一个更新事件
- this.$emit('Enavbarsel',1);
- },
- searchClick(){
- this.$emit('Enavbarsel',2);
- }
-
- },
- }
- </script>
- <style>
- .navBarBox{
- display: flex;
- flex-direction: column;
- justify-content: center;
- width: 100%;
- background-color: #00A6FF;
- }
- .navBar {
- display: flex;
- flex-direction: row;
- align-items: center;
- width: 90%;
- margin-left: 5%;
- margin-top: 40rpx;
- height: 100rpx;
- }
- .searchbar{
- width: 90%;
- }
- .logo {
- width: 70rpx;
- height: 70rpx;
- margin-left: 6rpx;
- }
- .textlable{
- flex-direction:column;
- margin-left: 8rpx;
- width: 80%;
- }
- .lableT{
- color: white;
- }
- .lableB{
- color: white;
- }
- .titleT{
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .changduxz{
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .rightconten{
- margin-left: auto;
- display: flex;
- flex-direction: row;
- justify-content:right;
- }
- .interest {
- margin-right: 10rpx;
- width: 82rpx;
- height: 82rpx;
- }
- .mycart {
- margin-right: 10rpx;
- width: 82rpx;
- height: 82rpx;
-
- }
- </style>
|