2020-06-11 15:06:19 +08:00

149 lines
5.8 KiB
Plaintext

<!-- 导航栏 -->
<cu-custom bgColor='bg-gradual-red'><view slot="content">Cherry Store</view></cu-custom>
<!-- 搜索栏 -->
<view class="cu-bar search bg-white" bindtap="jumpToFuzzy">
<view class="search-form round">
<text class="icon-search"></text>
<input type="text" placeholder="搜索商品名" disabled="{{true}}" confirm-type="search"></input>
</view>
<view class="action">
<button class="cu-btn bg-red shadow-blur round">搜索</button>
</view>
</view>
<!-- swiper -->
<swiper class="card-swiper square-dot" indicator-dots="true" circular="true" autoplay="true" interval="5000" duration="500" bindchange="cardSwiper" indicator-color="#aaa" indicator-active-color="#fff">
<swiper-item wx:for="{{swiperList}}" wx:key="index" class="{{cardCur==index?'cur':''}}">
<view class="swiper-item">
<image src="{{item.url}}" mode="aspectFill"></image>
</view>
</swiper-item>
</swiper>
<!-- 标签列表 -->
<view class="tag-box">
<view class="item-box" bindtap="requestSubscribeMessage" data-tagtype="图书">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/book.png" />
<view class="text">图书</view>
</view>
<view class="item-box" bindtap="goToTagSearch" data-tagtype="电子">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/game.png" />
<view class="text">电子</view>
</view>
<view class="item-box" bindtap="goToTagSearch" data-tagtype="体育">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/ball.png" />
<view class="text">体育</view>
</view>
<view class="item-box" bindtap="goToTagSearch" data-tagtype="乐器">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/guitar.png" />
<view class="text">乐器</view>
</view>
<view class="item-box" bindtap="goToTagSearch" data-tagtype="生活">
<image src="cloud://cloud-83621f.636c-cloud-83621f/cherryStore/life.png" />
<view class="text">生活</view>
</view>
</view>
<!-- 分类(免费,有偿) -->
<view class="classify-box">
<view class="paid {{classify?'classify-choice':''}}" data-classify='paid' bindtap="changeClassify">
<text class="paid-text">发现好货</text>
<view class="line" ></view>
</view>
<view class="free {{classify?'':'classify-choice'}}" data-classify='free' bindtap="changeClassify">
<text class="free-text">免费专区</text>
<view class="line"></view>
</view>
</view>
<!-- 排序框 (时间,价格,浏览量)-->
<view class="sort-box">
<view class="time-sort" data-sortType='time' bindtap='changeSort'>
<text class="{{timeSort==0?'sort-labal':'sort-labal-choose'}}">时间</text>
<text style="font-size:40rpx;" class=" {{timeSort?'':'sort-icon-hidden'}} icon-{{timeSort==1?'triangleupfill':'triangledownfill'}} lg text-{{timeSort==0?'gray':'red'}}"></text>
<!-- triangledownfill -->
</view>
<view class="price-sort" data-sortType='price' bindtap='changeSort'>
<text class="{{priceSort==0?'sort-labal':'sort-labal-choose'}}">价格</text>
<text style="font-size:40rpx;" class=" {{priceSort?'':'sort-icon-hidden'}} icon-{{priceSort==1?'triangleupfill':'triangledownfill'}} lg text-{{priceSort==0?'gray':'red'}}"></text>
</view>
<view class="view-sort" data-sortType='view' bindtap='changeSort'>
<text class="{{viewSort==0?'sort-labal':'sort-labal-choose'}}">浏览量</text>
<text style="font-size:40rpx;" class=" {{viewSort?'':'sort-icon-hidden'}} icon-{{viewSort==1?'triangleupfill':'triangledownfill'}} lg text-{{viewSort==0?'gray':'red'}}"></text>
</view>
</view>
<!-- 商品列表 -->
<view class="product-list" >
<view class="product-item" wx:for="{{list}}" wx:key="index" wx:if="{{!item.isSall}}" data-productId="{{item._id}}" bindtap="jumpToDetail">
<view class="user-box">
<image src="{{item.userAvatarUrl}}" />
<view class="user-info">
<view class="user-name">{{item.userName}}</view>
<view class="user-time">{{item.time}}</view>
</view>
<view class="pro-price">
¥{{item.price}}
</view>
</view>
<view class="pro-title">#{{item.title}}#</view>
<view class="pro-detail">{{item.details}}</view>
<image mode='aspectFill' class="pro-img" src="{{item.photos[0]}}" />
<view class='pro-footer'>
<view class="pro-tag">
<view class="padding-xs">
<view class="cu-tag {{tagColor.style(item.tag)}} light">{{item.tag}}</view>
<view class="cu-tag {{tagColor.style(item.adds)}} light">{{item.adds}}</view>
</view>
</view>
<view class="text-gray text-sm">
<text class="icon-attentionfill margin-lr-xs"></text> {{item.viewNum}}
<text class="icon-appreciatefill margin-lr-xs"></text> {{item.wantUser.length?item.wantUser.length:0}}
<text class="icon-messagefill margin-lr-xs"></text> {{item.comment.length?item.comment.length:0}}
</view>
</view>
<view style="width: 120%; height: 25rpx; background-color: #eee; margin-top:30rpx;" wx:if="{{!item.isSall}}"></view>
</view>
</view>
<view class="nomore-box" wx:if="{{showNoMore}}">
<view>阁下别再往下拉啦~这就是我的全部啦~</view>
</view>
<view style="width:100%; height:20rpx; background-color: #eee;" wx:if="{{showNoMore}}"></view>
<!-- 回顶按钮 -->
<view class="to-top" wx:if="{{goTopStatus}}"bindtap='goToTop'>
<text class="icon-top text-gray"></text>
</view>
<wxs module="tagColor">
var colorClass = function(item){
switch(item){
case "图书":
return 'bg-cyan';
break;
case "电子":
return 'bg-orange';
break;
case "体育":
return 'bg-yellow';
break;
case "乐器":
return 'bg-green';
break;
case "生活":
return 'bg-red';
break;
case "长理南区":
return 'bg-blue';
break;
case "长理东区":
return 'bg-brown';
break;
case "长理西区":
return 'bg-pink';
break;
}
};
module.exports.style = colorClass;
</wxs>