xiaohaizhao 1 рік тому
батько
коміт
f0d5f0136e
1 змінених файлів з 16 додано та 5 видалено
  1. 16 5
      components/My_search.vue

+ 16 - 5
components/My_search.vue

@@ -1,8 +1,10 @@
 <template>
     <view class="My_search" :style="{ background: bgColor }">
         <slot name="left" />
-        <u-search v-model="value" :focus="focus" :showAction="false" @search="onSearch" @custom="onSearch" @clear="onSearch"
-            :placeholder="placeholder" />
+        <u-search v-if="ispad" v-model="value" :focus="focus" :showAction="false" height="60" @search="onSearch"
+            @custom="onSearch" @clear="onSearch" :placeholder="placeholder" />
+        <u-search v-else v-model="value" :focus="focus" :showAction="false" @search="onSearch" @custom="onSearch"
+            @clear="onSearch" :placeholder="placeholder" />
         <view v-if="isFilter" @click="startFilter" class="filtrate" hover-class="navigator-hover">
             <text class="iconfont icon-shaixuan" />筛选
         </view>
@@ -47,9 +49,18 @@ export default {
     },
     data() {
         return {
-            value: ""
+            value: "",
+            ispad: false
         };
     },
+    created() {
+        // #ifdef MP-WEIXIN
+        let that = this;
+        uni.getSystemInfo({
+            success: ({ deviceType }) => that.ispad = deviceType == "pad"
+        })
+        // #endif      
+    },
     methods: {
         onSearch(value) {
             this.$emit("startSearch", value)
@@ -92,8 +103,8 @@ export default {
         }
     }
 
-    /deep/ .u-search .u-search__content {
-        height: 29px !important;
+    /deep/ .u-search__content {
+        height: 30px !important;
     }
 
     /deep/ .u-icon__icon {