search.wxml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!--pages/search/search.wxml-->
  2. <view class="search">
  3. <input placeholder="请输入产品名称" value="{{picTitle}}" data-name="picTitle" bindconfirm="searchGoods" bindinput="asyncValue" />
  4. <icon class="icon-small" type="search" size="40rpx"></icon>
  5. <view wx:if="{{goodsList.length == 0}}" class="text" bind:tap="searchGoods">搜索</view>
  6. <view wx:else="" class="text" bind:tap="cancelSearch">取消</view>
  7. </view>
  8. <block wx:if="{{goodsList.length == 0}}">
  9. <view class="history">
  10. <view>搜索记录</view>
  11. <view bind:tap="delHistory">
  12. <view class="iconfont icon-shanchu" style="display: inline-block;"></view>清空记录
  13. </view>
  14. </view>
  15. <view class="searchBtn">
  16. <view class="searchBtnItem" wx:for="{{searchKeys}}" wx:for-index="index" wx:key="index" data-index="{{index}}" data-name1="{{item}}" bind:tap="searchGoods">{{item}}</view>
  17. </view>
  18. </block>
  19. <view class="goodsList">
  20. <navigator url="/pages/goods/goods?prodId={{item.prodId}}" class="goods" wx:for="{{goodsList}}" wx:key="goodsId">
  21. <image src="{{item.picText || '/images/empty.png'}}"></image>
  22. <view class="goodsInfo">
  23. <view class="name text2">{{item.prodName}}</view>
  24. <view class="brief text3">{{item.simpleTitle}}</view>
  25. <view class="bar">
  26. <view class="price">¥{{item.price}}</view>
  27. <!-- <view class="iconfont icon-lujing icon"></view> -->
  28. <view style="font-weight: 400;font-size: 18rpx;color: #A2A2A2;line-height: 40rpx;">
  29. <text>可供{{item.totalStocks}}{{item.stockUnit || '件 '}}</text>
  30. <text wx:if="{{item.limitQty}}"> 限购数量{{item.limitQty}}{{item.stockUnit || '件'}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. </navigator>
  35. <view class="goods" wx:if="{{loading}}">
  36. <view wx:if="{{loadding}}" class="iconfont icon-loadding"></view>
  37. <view wx:if="{{searchKeys.length == 0}}">
  38. <image class="listEmpty" src="/images/list-empty.png"></image>
  39. <view class="loadMore" style="margin-top: 20rpx;">啥记录也没有!</view>
  40. </view>
  41. <view wx:elif="{{pages == null && goodsList.length == 0}}">
  42. <image class="listEmpty" src="/images/list-empty.png"></image>
  43. <view class="loadMore" style="margin-top: 20rpx;">搜不到诶,换个词试试呗?</view>
  44. </view>
  45. <view wx:elif="{{current < pages}}" class="loadMore" catch:tap="getGoodsList">点击加载更多</view>
  46. <view wx:else="" class="noMore">--我也是有底线的--</view>
  47. </view>
  48. <view class="goods" wx:else>
  49. <view wx:if="{{searchKeys.length == 0}}">
  50. <image class="listEmpty" src="/images/list-empty.png"></image>
  51. <view class="loadMore" style="margin-top: 20rpx;">啥记录也没有!</view>
  52. </view>
  53. </view>
  54. </view>