Commit 0dd9c4051eb8fa2cfb97619414be866ebbdd583d
1 parent
8ed9007d
搜索列表和等级卡样式调整
Showing
4 changed files
with
53 additions
and
21 deletions
pages/goods/search/g_filter.wxs
| ... | ... | @@ -77,7 +77,7 @@ var g_filters = { |
| 77 | 77 | //min_price=min.price; |
| 78 | 78 | //min_name=min.name; |
| 79 | 79 | if(type==0) return min_price.toFixed(2); |
| 80 | - if(min_name.length>4 ) min_name=min_name.substring(0, 4); | |
| 80 | + if(min_name.length>7 ) min_name=min_name.substring(0, 8); | |
| 81 | 81 | return min_name; |
| 82 | 82 | }, |
| 83 | 83 | } | ... | ... |
pages/goods/search/search.js
| ... | ... | @@ -78,7 +78,7 @@ Page({ |
| 78 | 78 | //--- 判断是等级会员,且在有效期范围内 --- |
| 79 | 79 | if(user.card_field && now<end){ |
| 80 | 80 | var card_name=ob.name_map.get(user.card_field); |
| 81 | - if(card_name.length>4) card_name=card_name.substring(0,4); | |
| 81 | + if(card_name.length>7) card_name=card_name.substring(0,8); | |
| 82 | 82 | th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list}); |
| 83 | 83 | } |
| 84 | 84 | } | ... | ... |
pages/goods/search/search.wxml
| ... | ... | @@ -28,12 +28,12 @@ |
| 28 | 28 | </navigator> |
| 29 | 29 | </view> |
| 30 | 30 | <view class="choice_list"> |
| 31 | - <navigator class="choice_item" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" wx:key="{{index}}"> | |
| 31 | + <navigator class="choice_item flex ai-center" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" wx:key="{{index}}"> | |
| 32 | 32 | <view class="img-wrap"> |
| 33 | 33 | <image src="{{item.original_img}}" lazy-load="true" binderror="bind_bnerr" data-errorimg="requestData[{{index}}].original_img"></image> |
| 34 | 34 | </view> |
| 35 | 35 | <view class="item-cont"> |
| 36 | - <view class="title">{{item.goods_name}}</view> | |
| 36 | + <view class="title ellipsis-2">{{item.goods_name}}</view> | |
| 37 | 37 | <!-- 判断是否有活动价 --> |
| 38 | 38 | <block wx:if="{{item.prom_price>0}}"> |
| 39 | 39 | <!-- 活动价 --> |
| ... | ... | @@ -50,11 +50,12 @@ |
| 50 | 50 | <block wx:if="{{card_field}}"> |
| 51 | 51 | <!-- 等级价>0 --> |
| 52 | 52 | <block wx:if="{{item[card_field]>0}}"> |
| 53 | - <view class="flex ai_and"> | |
| 53 | + <view class="flex ai_center"> | |
| 54 | 54 | <view class="price">¥{{item[card_field]}}</view> |
| 55 | - <view class="card_bg"> | |
| 56 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 57 | - <view class="card_name">{{card_name}}</view> | |
| 55 | + <view class="card_bg flex ai-center"> | |
| 56 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 57 | + <!-- <view class="card_name ellipsis-1">{{card_name}}</view> --> | |
| 58 | + <text class="ellipsis-1">{{card_name}}</text> | |
| 58 | 59 | </view> |
| 59 | 60 | </view> |
| 60 | 61 | <view class="comment flex jc_sb"> |
| ... | ... | @@ -77,11 +78,13 @@ |
| 77 | 78 | <view class="word-line xc-ash mk_price">¥{{item.market_price}}</view> |
| 78 | 79 | </view> |
| 79 | 80 | <view class="comment flex jc_sb"> |
| 80 | - <view class="flex ai_and"> | |
| 81 | + <view class="flex ai_center"> | |
| 81 | 82 | <view class="">¥{{g_filter.get_card_price(item,card_list,0)}}</view> |
| 82 | - <view class="card_bg"> | |
| 83 | - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image> | |
| 84 | - {{g_filter.get_card_price(item,card_list,1)}} | |
| 83 | + <view class="card_bg flex"> | |
| 84 | + <view class="flex ai-center"> | |
| 85 | + <image src="{{url}}/miniapp/images/plus/dj_icon.png" class=""></image> | |
| 86 | + <text class="ellipsis-1">{{g_filter.get_card_price(item,card_list,1)}}</text> | |
| 87 | + </view> | |
| 85 | 88 | </view> |
| 86 | 89 | </view> |
| 87 | 90 | <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view> | ... | ... |
pages/goods/search/search.wxss
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | align-items: center; |
| 12 | 12 | justify-content: center; |
| 13 | 13 | font-size: 32rpx; |
| 14 | - border-bottom: 1px solid #dfefef; | |
| 14 | + border-bottom: 2rpx solid #E6E6E6; | |
| 15 | 15 | background-color: #fff; |
| 16 | 16 | } |
| 17 | 17 | |
| ... | ... | @@ -64,15 +64,17 @@ |
| 64 | 64 | width: 100%; |
| 65 | 65 | min-height: 200rpx; |
| 66 | 66 | padding: 10rpx 0; |
| 67 | - border-bottom: 1px solid #dfefef; | |
| 67 | + border-bottom: 2rpx solid #E6E6E6; | |
| 68 | 68 | font-size: 30rpx; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | .img-wrap { |
| 72 | - float: left; | |
| 72 | + /* float: left; */ | |
| 73 | 73 | width: 180rpx; |
| 74 | 74 | height: 180rpx; |
| 75 | - padding: 0 10rpx 10rpx; | |
| 75 | + padding: 0 10rpx 0 30rpx; | |
| 76 | + flex-shrink: 0; | |
| 77 | + /* padding: 10rpx; */ | |
| 76 | 78 | } |
| 77 | 79 | |
| 78 | 80 | .img-wrap image { |
| ... | ... | @@ -83,16 +85,17 @@ |
| 83 | 85 | .item-cont .title { |
| 84 | 86 | height: 72rpx; |
| 85 | 87 | margin: 16rpx 0; |
| 86 | - padding-right: 10rpx; | |
| 88 | + padding-right: 30rpx; | |
| 87 | 89 | line-height: 36rpx; |
| 88 | 90 | color: #333; |
| 89 | 91 | overflow: hidden; |
| 92 | + text-align: justify; | |
| 90 | 93 | } |
| 91 | 94 | |
| 92 | 95 | .price { |
| 93 | 96 | display: inline-block; |
| 94 | 97 | color: #f23030; |
| 95 | - line-height: 24rpx; | |
| 98 | + /* line-height: 24rpx; */ | |
| 96 | 99 | /* padding-bottom: 20rpx; */ |
| 97 | 100 | } |
| 98 | 101 | |
| ... | ... | @@ -226,7 +229,7 @@ |
| 226 | 229 | margin-left: 15rpx; |
| 227 | 230 | } |
| 228 | 231 | |
| 229 | -.card_bg { | |
| 232 | +/* .card_bg { | |
| 230 | 233 | display: flex; |
| 231 | 234 | max-width: 110rpx; |
| 232 | 235 | height: 25rpx; |
| ... | ... | @@ -241,11 +244,36 @@ |
| 241 | 244 | margin-top: 7rpx; |
| 242 | 245 | line-height: 25rpx; |
| 243 | 246 | width: auto; |
| 247 | +} */ | |
| 248 | + | |
| 249 | +.card_bg { | |
| 250 | + box-sizing: border-box; | |
| 251 | + padding: 2rpx 10rpx; | |
| 252 | + /* height: 28rpx; */ | |
| 253 | + border-radius: 26rpx; | |
| 254 | + font-size: 18rpx; | |
| 255 | + /* line-height: 28rpx; */ | |
| 256 | + max-width: 210rpx; | |
| 257 | + background: #333; | |
| 258 | + color: #fff; | |
| 259 | + margin-left: 8rpx; | |
| 244 | 260 | } |
| 245 | 261 | |
| 246 | 262 | .card_bg image { |
| 247 | 263 | width: 19rpx; |
| 248 | 264 | height: 19rpx; |
| 265 | + margin-right: 8rpx; | |
| 266 | + flex-shrink: 0; | |
| 267 | +} | |
| 268 | + | |
| 269 | +.card_name { | |
| 270 | + position: relative; | |
| 271 | + top: -4rpx; | |
| 272 | +} | |
| 273 | + | |
| 274 | +/* .card_bg image { | |
| 275 | + width: 19rpx; | |
| 276 | + height: 19rpx; | |
| 249 | 277 | margin-right: 1rpx; |
| 250 | 278 | vertical-align: middle; |
| 251 | 279 | } |
| ... | ... | @@ -255,7 +283,7 @@ |
| 255 | 283 | width: auto; |
| 256 | 284 | overflow: hidden; |
| 257 | 285 | white-space: nowrap; |
| 258 | -} | |
| 286 | +} */ | |
| 259 | 287 | |
| 260 | 288 | .mk_price { |
| 261 | 289 | margin-left: 10rpx; |
| ... | ... | @@ -263,5 +291,6 @@ |
| 263 | 291 | } |
| 264 | 292 | |
| 265 | 293 | .item-cont { |
| 266 | - line-height: 38rpx; | |
| 294 | + /* line-height: 38rpx; */ | |
| 295 | + flex-grow: 1; | |
| 267 | 296 | } | ... | ... |