fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!--
 * @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>