|
@@ -1,14 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<view class="search-container">
|
|
<view class="search-container">
|
|
<view class="search-main">
|
|
<view class="search-main">
|
|
- <view class="search">
|
|
|
|
- <view class="search-input">
|
|
|
|
- <text class="iconfont icon-iconfonticonfontsousuo1"></text>
|
|
|
|
- <input maxlength="20" focus type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入商品关键词" v-model.trim="searchInputVal"/>
|
|
|
|
- <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
|
|
|
|
- </view>
|
|
|
|
- <view class="search-btn" @click="subMitSearch()">搜索</view>
|
|
|
|
|
|
+ <view class="search-input">
|
|
|
|
+ <text class="iconfont icon-iconfonticonfontsousuo1"></text>
|
|
|
|
+ <input maxlength="20" focus type="text" value="" confirm-type="search" @focus="onFocus" @input="onShowClose" @confirm="subMitSearch()" placeholder="请输入商品关键词" v-model.trim="searchInputVal"/>
|
|
|
|
+ <text class="iconfont icon-shanchu1" v-if="isShowClose" @click="delInputText()"></text>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="search-btn" @click="subMitSearch()">搜索</view>
|
|
</view>
|
|
</view>
|
|
<view class="search-container-history" v-if="!isShowWrapper">
|
|
<view class="search-container-history" v-if="!isShowWrapper">
|
|
<view :class="'s-' + themeClass" v-if="serachRecordList.length>0">
|
|
<view :class="'s-' + themeClass" v-if="serachRecordList.length>0">
|
|
@@ -22,8 +20,8 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- <go-search :theme="themeClass" @subMitSearch="subMitSearch"></go-search> -->
|
|
<!-- <go-search :theme="themeClass" @subMitSearch="subMitSearch"></go-search> -->
|
|
- <view v-else class="container commodity-list-wrapper" :style="{'overflow':(showSkeleton ? 'hidden' : 'auto'),'height':(showSkeleton? (scrollHeight-57) + 'px' : 'auto')}">
|
|
|
|
- <scroll-view :style="{'height':scrollHeight+'px'}" @scrolltolower="scrolltolower" scroll-y v-if="!showEmpty">
|
|
|
|
|
|
+ <view v-else class="commodity-list-wrapper" :style="{'overflow':'auto','height':(commodityList.length>4? windowHeight + 'px' : 'auto')}">
|
|
|
|
+ <scroll-view :style="{'height':(commodityList.length>4? scrollHeight+'px' : 'auto')}" @scrolltolower="scrolltolower" scroll-y v-if="!showEmpty">
|
|
<view v-for="(item,index) in commodityList" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.id)">
|
|
<view v-for="(item,index) in commodityList" :key="index" :id="item.id" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.id)">
|
|
<image mode='widthFix' :src="item.mainImage" class="list-img" alt="list-img"></image>
|
|
<image mode='widthFix' :src="item.mainImage" class="list-img" alt="list-img"></image>
|
|
<view class="list-details-info">
|
|
<view class="list-details-info">
|
|
@@ -83,7 +81,6 @@
|
|
isShowWrapper:false,
|
|
isShowWrapper:false,
|
|
isModallayer:false,
|
|
isModallayer:false,
|
|
windowHeight: '',
|
|
windowHeight: '',
|
|
- showSkeleton: true,
|
|
|
|
showEmpty: false,
|
|
showEmpty: false,
|
|
userID: '',
|
|
userID: '',
|
|
loginStatus: true,
|
|
loginStatus: true,
|
|
@@ -157,11 +154,8 @@
|
|
this.showEmpty = false;
|
|
this.showEmpty = false;
|
|
if(loadMore) {
|
|
if(loadMore) {
|
|
this.commodityList = [...this.commodityList,...resList];
|
|
this.commodityList = [...this.commodityList,...resList];
|
|
- this.showSkeleton = false;
|
|
|
|
} else {
|
|
} else {
|
|
this.commodityList = [...resList];
|
|
this.commodityList = [...resList];
|
|
- this.showSkeleton = true;
|
|
|
|
- console.log(this.showSkeleton)
|
|
|
|
}
|
|
}
|
|
// 防上拉暴滑
|
|
// 防上拉暴滑
|
|
this.pullFlag = false;
|
|
this.pullFlag = false;
|
|
@@ -267,7 +261,7 @@
|
|
page{
|
|
page{
|
|
background-color: #F7F7F7 !important;
|
|
background-color: #F7F7F7 !important;
|
|
}
|
|
}
|
|
- .search{
|
|
|
|
|
|
+ .search-main{
|
|
width: 702rpx;
|
|
width: 702rpx;
|
|
height: 80rpx;
|
|
height: 80rpx;
|
|
padding: 12rpx 24rpx;
|
|
padding: 12rpx 24rpx;
|
|
@@ -453,7 +447,8 @@
|
|
.commodity-list-wrapper {
|
|
.commodity-list-wrapper {
|
|
scroll-view {
|
|
scroll-view {
|
|
height: 100%;
|
|
height: 100%;
|
|
- }
|
|
|
|
|
|
+ overflow: scroll;
|
|
|
|
+ }
|
|
.empty-container-image {
|
|
.empty-container-image {
|
|
margin-top: -300rpx;
|
|
margin-top: -300rpx;
|
|
}
|
|
}
|