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.
huitong/pages/index/component/headerSerch.vue

258 lines
6.7 KiB

9 months ago
<template>
<!-- #ifdef H5 -->
9 months ago
<view class="header" :style="'margin-top:'+ mbConfig +'rpx;'">
9 months ago
<view class="serch-wrapper acea-row row-between-wrapper" :style="'padding-left:'+prConfig+'rpx;'">
<view v-if="logoConfig" class="logo skeleton-rect">
<image :src="logoConfig" mode=""></image>
</view>
<navigator :url="merId ? '/pages/store/list/index?mer_id='+merId : '/pages/columnGoods/goods_search/index'" :class="logoConfig ? 'input' : 'uninput'" class="skeleton-rect box" hover-class="none"
:style="'border-radius:'+boxStyle+'rpx;text-align:'+txtStyle">
<text class="iconfont icon-xiazai5"></text>
搜索商品
</navigator>
<navigator class="btn skeleton-rect" url="/pages/chat/customer_list/index?type=0" hover-class="none">
<view class="iconfont icon-xiaoxi" :style="'color:'+iconColor"></view>
<text class="iconnum" v-if="userInfo.total_unread">{{ userInfo.total_unread }}</text>
</navigator>
</view>
</view>
<!-- #endif -->
<!-- #ifdef MP || APP-PLUS -->
<view>
9 months ago
<!-- :style="'margin-top:'+ mbConfig +'rpx;'" -->
<view class="mp-header" >
9 months ago
<view class="sys-head skeleton-rect" :style="{ height: statusBarHeight }"></view>
9 months ago
<view class="serch-box skeleton-rect" style="height: 43px;display: flex;justify-content: space-between;align-items: center;min-width: 550rpx;max-width: 550rpx;">
<!-- <view class="serch-wrapper flex" :style="'padding-left:'+prConfig+'rpx;'">
9 months ago
<view v-if="logoConfig" class="logo skeleton-rect"><image :src="logoConfig" mode=""></image></view>
<navigator :url="merId ? '/pages/store/list/index?mer_id='+merId : '/pages/columnGoods/goods_search/index'" :class="logoConfig ? 'input' : 'uninput'"
hover-class="none" class="skeleton-rect box" :style="'border-radius:'+boxStyle+'rpx;text-align:'+txtStyle">
<text class="iconfont icon-xiazai5"></text>
搜索商品
</navigator>
9 months ago
</view> -->
<view class="indexTitle">
惠通商城
9 months ago
</view>
8 months ago
<image src="/static/images/xiaoxi.png" mode="" @click="goChat" class="xiaoxi"></image>
9 months ago
</view>
<view class="serch-box skeleton-rect" style="height: 110rpx;">
<view class="serch-wrapper flex">
<view v-if="logoConfig" class="logo skeleton-rect"><image :src="logoConfig" mode=""></image></view>
<navigator :url="merId ? '/pages/store/list/index?mer_id='+merId : '/pages/columnGoods/goods_search/index'" :class="logoConfig ? 'input' : 'uninput'"
hover-class="none" class="skeleton-rect box" :style="'border-radius:'+'80'+'rpx;text-align:'+txtStyle">
<text class="iconfont icon-xiazai5"></text>
搜索商品
9 months ago
<view class="searchBtn">搜索</view>
9 months ago
</navigator>
9 months ago
9 months ago
</view>
9 months ago
</view>
</view>
<view :style="'height:'+marTop+'px;'"></view>
</view>
<!-- #endif -->
</template>
<script>
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight*2 + 'rpx';
export default {
name: 'headerSerch',
props: {
dataConfig: {
type: Object,
default: () => {}
},
userInfo: {
type: Object,
default: () => {}
},
merId: {
type: String || Number,
default: ''
}
},
data() {
return {
statusBarHeight: statusBarHeight,
marTop:0,
searchH: 0,
bgColor: this.dataConfig.bgColor && this.dataConfig.bgColor.color[0].item,
iconColor: this.dataConfig.iconColor && this.dataConfig.iconColor.color[0].item,
boxStyle: this.dataConfig.boxStyle.type ? '0' : '32',
logoConfig: this.dataConfig.logoConfig.url,
mbConfig: this.dataConfig.mbConfig.val*2,
prConfig: this.dataConfig.prConfig.val*2,
txtStyle: this.dataConfig.txtStyle.type ? 'center' : 'xleft',
};
},
mounted(){
let that = this;
// #ifdef H5
// 获取H5 搜索框高度
setTimeout(() => {
let appSearchH = uni.createSelectorQuery().select('.serch-wrapper');
appSearchH
.boundingClientRect(function(data) {
that.searchH = data.height;
})
.exec();
}, 800);
// #endif
// #ifdef MP || APP-PLUS
setTimeout(() => {
// 获取小程序头部高度
let info = uni.createSelectorQuery().in(this).select(".mp-header");
info.boundingClientRect(function(data) {
that.marTop = data.height
}).exec()
}, 300)
// #endif
},
8 months ago
methods: {
goChat(){
uni.navigateTo({
url:"/pages/goods_details/notice"
})
}
}
9 months ago
}
</script>
<style lang="scss" scoped>
.header {
width: 100%;
background: #ffffff;
.btn {
position: relative;
margin-left: 30rpx;
.iconfont {
font-size: 45rpx;
}
}
.iconnum {
min-width: 6px;
color: #fff;
background: #e93323;
border-radius: 15rpx;
position: absolute;
right: -10rpx;
top: -10rpx;
font-size: 10px;
padding: 0 4px;
}
.serch-wrapper {
display: flex;
align-items: center;
padding: 20rpx 30rpx 20rpx 30rpx;
.box{
flex: 1;
}
.logo {
width: 127rpx;
height: 46rpx;
margin-right: 20rpx;
}
image {
width: 118rpx;
height: 42rpx;
}
.input,.uninput {
9 months ago
line-height: 80rpx;
9 months ago
padding: 0 0 0 30rpx;
background: rgba(237, 237, 237, 1);
border: 1px solid rgba(241, 241, 241, 1);
color: #bbbbbb;
font-size: 28rpx;
.iconfont {
margin-right: 20rpx;
}
}
}
}
/* #ifdef MP || APP-PLUS */
.mp-header {
z-index: 999;
position: fixed;
left: 0;
top: 0;
width: 100%;
/* #ifdef H5 */
padding-bottom: 20rpx;
/* #endif */
9 months ago
// background-color: #fff;
background-size: cover;
background-image: url(http://b2.njrenzhou.com/uploads/def/20240314/ebc9ea0e40ac396e6c768d56fd3a1a36.png);
// margin-bottom: 24rpx;
.indexTitle{
margin:0 24rpx;
font-family: Alibaba PuHuiTi;
font-weight: bold;
font-size: 36rpx;
color: #222222;
}
.xiaoxi{
width:44rpx;
height:44rpx;
}
9 months ago
.serch-wrapper {
height: 100%;
align-items: center;
9 months ago
// padding: 0 50rpx 0 53rpx;
padding: 0 24rpx;
position: relative;
9 months ago
image {
width: 118rpx;
height: 42rpx;
margin-right: 30rpx;
}
.input,.uninput {
display: flex;
align-items: center;
/* #ifndef APP-PLUS */
width: 305rpx;
/* #endif */
/* #ifdef APP-PLUS */
flex: 1;
width: 500rpx;
/* #endif */
9 months ago
height: 80rpx;
9 months ago
padding: 0 0 0 30rpx;
background: rgba(247, 247, 247, 1);
border: 1px solid rgba(241, 241, 241, 1);
border-radius: 29rpx;
color: #bbbbbb;
font-size: 28rpx;
.iconfont {
margin-right: 20rpx;
}
}
.uninput {
/* #ifdef MP */
9 months ago
// min-width: 450rpx;
// max-width: 480rpx;
width: 100%;
9 months ago
/* #endif*/
}
}
9 months ago
.searchBtn{
position: absolute;
z-index:2;
width: 120rpx;
height: 66rpx;
background: linear-gradient(0deg, #89B929, #116636);
border-radius: 33px;
font-family: Alibaba PuHuiTi;
font-weight: 400;
font-size: 28rpx;
line-height: 66rpx;
text-align: center;
color: #FFFFFF;
right: 31rpx;
}
9 months ago
}
/* #endif */
</style>