Model14.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="model-14">
  3. <view class="top-search-form" :style="{backgroundColor:editablePageConfig.editable_page_config_content.back_color}">
  4. <image mode="aspectFit" v-if="editablePageConfig.editable_page_config_content['if_show_logo']==1" class="logo" :src="config.site_mobile_logo" />
  5. <view class="top-search-box border-circle" style="background: rgb(232, 232, 232);">
  6. <input v-model="keyword" class="top-search-input" style="color: rgb(153, 153, 153);" placeholder="搜索">
  7. <text class="top-search-icon" @click="goSearch()">
  8. <text class="iconfont" style="color: rgb(153, 153, 153);">&#xe67e;
  9. </text>
  10. </text>
  11. </view>
  12. <view class="more" v-if="editablePageConfig.editable_page_config_content['if_show_more']==1">
  13. <view class="iconfont" @click="popupMore">&#xe680;</view>
  14. <header-more v-if="popupVisible"></header-more>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import { mapState } from 'vuex'
  21. import HeaderMore from '../../../HeaderMore'
  22. export default {
  23. name: 'Model14',
  24. data () {
  25. return {
  26. keyword:'',
  27. showIndex:1,
  28. popupVisible: false,
  29. }
  30. },
  31. components: {
  32. HeaderMore
  33. },
  34. props: ['editablePageConfig','editablePage'],
  35. computed: {
  36. ...mapState({
  37. config: state => state.config.config,
  38. })
  39. },
  40. methods: {
  41. goSearch(){
  42. var url=this.editablePageConfig.editable_page_config_content.link
  43. if(url.strpos('?')){
  44. url+='&'
  45. }else{
  46. url+='?'
  47. }
  48. url+=this.keyword
  49. uni.navigateTo({url:url})
  50. },
  51. goAdUrl (url) {
  52. window.location.href = url
  53. },
  54. popupMore () {
  55. if (!this.popupVisible) {
  56. this.popupVisible = true
  57. } else {
  58. this.popupVisible = false
  59. }
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .model-14 .top-search-form{
  66. display: flex;
  67. align-items: center;
  68. height: 38px;
  69. padding: 10px 5px;
  70. border-radius: 5px;
  71. }
  72. .model-14 .top-search-form .logo{
  73. margin-top:-3px;
  74. width: 71px;
  75. height:38px;
  76. background-size: contain;
  77. background-repeat: no-repeat;
  78. background-position: center;
  79. margin-right: 10px;
  80. }
  81. .model-14 .top-search-form .more{
  82. margin-left:10px;
  83. margin-right:5px;
  84. font-size: 20px;
  85. }
  86. .model-14 .top-search-form .top-search-box{
  87. flex:1;
  88. border-radius:3px;
  89. position:relative;
  90. height:38px;
  91. line-height:38px;
  92. overflow:hidden;
  93. margin-top: -3px;
  94. font-size: 0;
  95. }
  96. .model-14 .top-search-form .top-search-box .top-search-input{
  97. background: unset;
  98. width:100%;
  99. height: 100%;
  100. padding: 0 15px;
  101. box-sizing: border-box;
  102. }
  103. .model-14 .top-search-form .top-search-box .top-search-icon{
  104. display:block;
  105. position:absolute;
  106. width:30px;
  107. height:30px;
  108. right:6px;
  109. top:50%;
  110. margin-top:-15px;
  111. text-align: center;
  112. line-height: 30px;
  113. }
  114. .model-14 .top-search-form .top-search-box .top-search-icon i{
  115. font-size: 18px;
  116. }
  117. </style>