|
@@ -12,60 +12,56 @@
|
|
<view class="header-right"></view>
|
|
<view class="header-right"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="search-result">
|
|
|
|
- <view class="right-box">
|
|
|
|
- <!-- body -->
|
|
|
|
- <scroll-view
|
|
|
|
- class="scrollPage-body"
|
|
|
|
- :style="{height: (screenHeight - statusBarHeight - safeAreaBottom - 40) + 'px'}"
|
|
|
|
- scroll-y="true"
|
|
|
|
- type="custom"
|
|
|
|
- :bounces="false"
|
|
|
|
- @scrolltolower="reachBottom">
|
|
|
|
- <!-- 搜索,吸顶 -->
|
|
|
|
- <sticky-header>
|
|
|
|
- <view class="search-head">
|
|
|
|
- <uni-search-bar v-model="queryWord" :focus="focus" radius="100" placeholder="请输入商品名称/产品编码/原厂编码" textColor="#666" clearButton="auto" cancelButton="none" @input="searchChange" @confirm="searchList" @clear="clearList" />
|
|
|
|
- </view>
|
|
|
|
- </sticky-header>
|
|
|
|
- <!-- 产品列表 -->
|
|
|
|
- <chooseProductItem
|
|
|
|
- v-for="(item, index) in list"
|
|
|
|
- :key="item.id"
|
|
|
|
- :index="index"
|
|
|
|
- :list="item"
|
|
|
|
- :isView="true"
|
|
|
|
- :isLogin="hasLogin"
|
|
|
|
- @toDetail="viewDetail"
|
|
|
|
- >
|
|
|
|
- </chooseProductItem>
|
|
|
|
- <!-- loading -->
|
|
|
|
- <view class="loading-bar" v-if="total>0 && (loading||loadEnd)">{{loadText}}</view>
|
|
|
|
- <!-- <view class="empty-bar" v-if="total==0&&!loading">
|
|
|
|
- <image mode="aspectFit" :src="empty.imgUrl"></image>
|
|
|
|
- <view>{{empty.tip}}</view>
|
|
|
|
- </view> -->
|
|
|
|
- <!-- 搜索记录 -->
|
|
|
|
- <view class="search-history" v-if="historyList.length&&list.length==0&&queryWord==''&&clzId==''">
|
|
|
|
- <view class="search-history-title">
|
|
|
|
- <text>搜索记录</text>
|
|
|
|
- <view class="search-history-right">
|
|
|
|
- <view class="search-history-expend" v-if="searchHistoryList.length>10" @click="expend=!expend">
|
|
|
|
- {{expend?'收起':'展开'}}
|
|
|
|
- <uni-icons :type="expend?'arrowup':'arrowdown'" size="14"></uni-icons>
|
|
|
|
- </view>
|
|
|
|
- <uni-icons type="trash" size="18" @click="clearHistory" color="#eb0000"></uni-icons>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- <view class="search-history-body">
|
|
|
|
- <view class="item" v-for="item in historyList" :key="item.id" @click="toSearch(item)">
|
|
|
|
- <text class="ellipsis-one" max-lines="1" overflow="ellipsis">{{item.text}}</text>
|
|
|
|
- </view>
|
|
|
|
|
|
+ <!-- body -->
|
|
|
|
+ <scroll-view
|
|
|
|
+ class="scrollPage-body"
|
|
|
|
+ :style="{height: (screenHeight - statusBarHeight - safeAreaBottom - 40) + 'px'}"
|
|
|
|
+ scroll-y="true"
|
|
|
|
+ type="custom"
|
|
|
|
+ :bounces="false"
|
|
|
|
+ @scrolltolower="reachBottom">
|
|
|
|
+ <!-- 搜索,吸顶 -->
|
|
|
|
+ <sticky-header>
|
|
|
|
+ <view class="search-head">
|
|
|
|
+ <uni-search-bar v-model="queryWord" :focus="focus" radius="100" placeholder="请输入商品名称/产品编码/原厂编码" textColor="#666" clearButton="auto" cancelButton="none" @input="searchChange" @confirm="searchList" @clear="clearList" />
|
|
|
|
+ </view>
|
|
|
|
+ </sticky-header>
|
|
|
|
+ <!-- 产品列表 -->
|
|
|
|
+ <chooseProductItem
|
|
|
|
+ v-for="(item, index) in list"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :index="index"
|
|
|
|
+ :list="item"
|
|
|
|
+ :isView="true"
|
|
|
|
+ :isLogin="hasLogin"
|
|
|
|
+ @toDetail="viewDetail"
|
|
|
|
+ >
|
|
|
|
+ </chooseProductItem>
|
|
|
|
+ <!-- loading -->
|
|
|
|
+ <view class="loading-bar" v-if="total>0 && (loading||loadEnd)">{{loadText}}</view>
|
|
|
|
+ <!-- <view class="empty-bar" v-if="total==0&&!loading">
|
|
|
|
+ <image mode="aspectFit" :src="empty.imgUrl"></image>
|
|
|
|
+ <view>{{empty.tip}}</view>
|
|
|
|
+ </view> -->
|
|
|
|
+ <!-- 搜索记录 -->
|
|
|
|
+ <view class="search-history" v-if="historyList.length&&list.length==0&&queryWord==''&&clzId==''">
|
|
|
|
+ <view class="search-history-title">
|
|
|
|
+ <text>搜索记录</text>
|
|
|
|
+ <view class="search-history-right">
|
|
|
|
+ <view class="search-history-expend" v-if="searchHistoryList.length>10" @click="expend=!expend">
|
|
|
|
+ {{expend?'收起':'展开'}}
|
|
|
|
+ <uni-icons :type="expend?'arrowup':'arrowdown'" size="14"></uni-icons>
|
|
</view>
|
|
</view>
|
|
|
|
+ <uni-icons type="trash" size="18" @click="clearHistory" color="#eb0000"></uni-icons>
|
|
</view>
|
|
</view>
|
|
- </scroll-view>
|
|
|
|
|
|
+ </view>
|
|
|
|
+ <view class="search-history-body">
|
|
|
|
+ <view class="item" v-for="item in historyList" :key="item.id" @click="toSearch(item)">
|
|
|
|
+ <text class="ellipsis-one" max-lines="1" overflow="ellipsis">{{item.text}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </scroll-view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -310,95 +306,70 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .search-result{
|
|
|
|
- flex-grow: 1;
|
|
|
|
- display: flex;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- .right-box{
|
|
|
|
- width: 100%;
|
|
|
|
- .scrollPage-body{
|
|
|
|
- width:100%;
|
|
|
|
- .uni-searchbar{
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
- }
|
|
|
|
- /deep/ .choose-product-item{
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
- margin: 6px 10px;
|
|
|
|
- border-radius: 10px;
|
|
|
|
- }
|
|
|
|
- .loading-bar{
|
|
|
|
- text-align: center;
|
|
|
|
- padding: 10px 0;
|
|
|
|
- color: #999999;
|
|
|
|
- }
|
|
|
|
- .empty-bar{
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: column;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: center;
|
|
|
|
- padding: 20px 0;
|
|
|
|
- image{
|
|
|
|
- width: 100px;
|
|
|
|
- height: 100px;
|
|
|
|
- }
|
|
|
|
- view{
|
|
|
|
- font-size: 12px;
|
|
|
|
- color: #999999;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .search-history{
|
|
|
|
- padding: 0 1.5rem;
|
|
|
|
- .search-history-title{
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- padding: 6px 0;
|
|
|
|
- font-size: 14px;
|
|
|
|
- color: #333333;
|
|
|
|
- border-bottom: 1px solid #E6E6E6;
|
|
|
|
- }
|
|
|
|
- .search-history-right{
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- }
|
|
|
|
- .search-history-expend{
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- font-size: 12px;
|
|
|
|
- margin-right: 15px;
|
|
|
|
- }
|
|
|
|
- .search-history-body{
|
|
|
|
- display: flex;
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
- align-items: center;
|
|
|
|
- justify-content: space-between;
|
|
|
|
- padding: 10px 10px;
|
|
|
|
- .item{
|
|
|
|
- padding: 6px 0;
|
|
|
|
- background-color: #f8f8f8;
|
|
|
|
- border-radius: 20px;
|
|
|
|
- font-size: 12px;
|
|
|
|
- color: #333333;
|
|
|
|
- width: 46%;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ .scrollPage-body{
|
|
|
|
+ width:100%;
|
|
|
|
+ .uni-searchbar{
|
|
|
|
+ background-color: #FFFFFF;
|
|
|
|
+ }
|
|
|
|
+ /deep/ .choose-product-item{
|
|
|
|
+ background-color: #FFFFFF;
|
|
|
|
+ margin: 6px 10px;
|
|
|
|
+ border-radius: 10px;
|
|
|
|
+ }
|
|
|
|
+ .loading-bar{
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 10px 0;
|
|
|
|
+ color: #999999;
|
|
|
|
+ }
|
|
|
|
+ .empty-bar{
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ padding: 20px 0;
|
|
|
|
+ image{
|
|
|
|
+ width: 100px;
|
|
|
|
+ height: 100px;
|
|
}
|
|
}
|
|
- .right-item{
|
|
|
|
- /deep/ .choose-product-item{
|
|
|
|
- margin: 5px 8px;
|
|
|
|
- .choose-product-item-img{
|
|
|
|
- height: 130rpx;
|
|
|
|
- }
|
|
|
|
- .choose-product-item-info .choose-product-item-left-info-name{
|
|
|
|
- font-weight: normal;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- .search-head{
|
|
|
|
- background-color: #FFFFFF;
|
|
|
|
- /deep/ .uni-searchbar{
|
|
|
|
- padding: 5px 6px;
|
|
|
|
- }
|
|
|
|
|
|
+ view{
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #999999;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .search-history{
|
|
|
|
+ padding: 0 1.5rem;
|
|
|
|
+ .search-history-title{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 6px 0;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #333333;
|
|
|
|
+ border-bottom: 1px solid #E6E6E6;
|
|
|
|
+ }
|
|
|
|
+ .search-history-right{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+ .search-history-expend{
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ }
|
|
|
|
+ .search-history-body{
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 10px 10px;
|
|
|
|
+ .item{
|
|
|
|
+ padding: 6px 0;
|
|
|
|
+ background-color: #f8f8f8;
|
|
|
|
+ border-radius: 20px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ color: #333333;
|
|
|
|
+ width: 46%;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|