<!--
|
* @Author: 张嘉彬
|
* @Date: 2021-09-28 14:42:15
|
* @Description:
|
-->
|
<template>
|
<div class="search-row" :style="{
|
position: infoData.fixedPosition ? 'fixed' : 'absolute',
|
top: infoData.codeY,
|
left: infoData.codeX,
|
width: infoData.width,
|
height: infoData.height,
|
fontSzie: infoData.fontSzie,
|
zIndex: infoData.z,
|
color: infoData.fontColor,
|
}" @click="goSearch">
|
<div class="search-left" :style="{
|
background: infoData.bgColor,
|
borderColor: infoData.strokeColor,
|
borderWidth: infoData.borderSize,
|
borderStyle: 'solid',
|
color: infoData.fontColor,
|
borderRadius: infoData.borderRadiu,
|
fontSize: $setVw(infoData.fontSize),
|
lineHeight: infoData.height,
|
paddingLeft: $setVw(10),
|
}">
|
<i class="iconfont icon-search" :style="{ fontSize: $setVw(20) }"></i>
|
<p :style="{ height: infoData.height, marginLeft: $setVw(10) }">搜索感兴趣的商品</p>
|
</div>
|
<!-- <p class="search-right" :style="{ color: infoData.tipColor }">搜索</p> -->
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: 'Search',
|
props: {
|
infoData: {
|
type: Object,
|
default: () => {
|
return {}
|
}
|
}
|
},
|
methods: {
|
// 跳转至搜索页面
|
goSearch () {
|
if (this.$route.query.isPreview) return
|
if (this.$root.isIos) {
|
window.webkit.messageHandlers.iosRouter.postMessage('wlyxls://category_search')
|
} else {
|
if (window.wlyxls) {
|
window.wlyxls.toSearchPage('')
|
}
|
}
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
.search-row {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
}
|
.search-left {
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
flex: 1;
|
margin-right: 10px;
|
}
|
</style>
|