Commit a04dbad7fd08edd94a7627b31640076ecf1a07ac

Authored by taiyuan
1 parent 782c1484

小程序自定义模板中 商品分组和秒杀模块 商品名称以两行显示,溢出省略

components/diy_goodsGroup/diy_goodsGroup.wxml
@@ -208,7 +208,7 @@ @@ -208,7 +208,7 @@
208 </view> 208 </view>
209 209
210 <view class='zs_center_2l'> 210 <view class='zs_center_2l'>
211 - <view class='zs_wz1_2l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> 211 + <view class='zs_wz1_2l ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
212 <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}"> 212 <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}">
213 213
214 <block wx:if="{{item.prom_price || item.prom_integral}}"> 214 <block wx:if="{{item.prom_price || item.prom_integral}}">
@@ -498,9 +498,15 @@ @@ -498,9 +498,15 @@
498 </block> 498 </block>
499 499
500 <block wx:else> 500 <block wx:else>
501 - <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}" 501 + <!-- 原来的 -->
  502 + <!-- <image class="zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}"
  503 + src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
  504 + binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> -->
  505 +
  506 + <!-- 2021.11.27修改 -->
  507 + <image class="block zs_t_img_x {{object.big_order_type==0?'zj':''}}{{object.big_order_type==1?'yj':''}}"
502 src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true" 508 src="{{item.goods_img}}" data-errorimg="goods_array[{{index}}].goods_img" lazy-load="true"
503 - binderror="bind_bnerr3" mode="widthFix" style='max-height:290rpx'></image> 509 + binderror="bind_bnerr3" mode="widthFix"></image>
504 </block> 510 </block>
505 511
506 <block wx:if="{{object.goodicon==3}}"> 512 <block wx:if="{{object.goodicon==3}}">
@@ -523,7 +529,7 @@ @@ -523,7 +529,7 @@
523 </view> 529 </view>
524 530
525 <view class='zs_center_x'> 531 <view class='zs_center_x'>
526 - <view class='zs_wz1_x' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> 532 + <view class='zs_wz1_x ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
527 <view class='zs_wz2_x' wx:if="{{object.goodsprice}}"> 533 <view class='zs_wz2_x' wx:if="{{object.goodsprice}}">
528 534
529 <block wx:if="{{item.prom_price || item.prom_integral}}"> 535 <block wx:if="{{item.prom_price || item.prom_integral}}">
components/diy_goodsGroup/diy_goodsGroup.wxss
@@ -123,12 +123,15 @@ @@ -123,12 +123,15 @@
123 } 123 }
124 124
125 .zs_goods_xiao_bottom { 125 .zs_goods_xiao_bottom {
126 - width: 100%;  
127 - min-height: 300rpx; 126 + /* width: 100%; */
  127 + /* min-height: 300rpx; */
128 display: flex; 128 display: flex;
129 border-bottom: 2rpx #eee solid; 129 border-bottom: 2rpx #eee solid;
130 - padding: 10rpx; 130 + /* padding: 10rpx; */
131 background-color: white; 131 background-color: white;
  132 + padding: 20rpx;
  133 + /* background-color: pink; */
  134 + box-sizing: border-box;
132 } 135 }
133 136
134 .zs_goods_xiao { 137 .zs_goods_xiao {
@@ -141,17 +144,17 @@ @@ -141,17 +144,17 @@
141 } 144 }
142 145
143 .zs_top_x { 146 .zs_top_x {
144 - width: 400rpx;  
145 - height: 318rpx;  
146 - margin-top: 20rpx;  
147 - display: flex; 147 + /* width: 400rpx;
  148 + height: 318rpx; */
  149 + /* margin-top: 20rpx; */
  150 + /* display: flex; */
148 position: relative; 151 position: relative;
149 } 152 }
150 153
151 .zs_t_img_x { 154 .zs_t_img_x {
152 width: 290rpx; 155 width: 290rpx;
153 height: 290rpx; 156 height: 290rpx;
154 - margin-left: 20rpx; 157 + /* margin-left: 20rpx; */
155 } 158 }
156 159
157 .zs_t_img_x.zj{ border: 1rpx solid #eee;} 160 .zs_t_img_x.zj{ border: 1rpx solid #eee;}
@@ -159,22 +162,24 @@ @@ -159,22 +162,24 @@
159 162
160 163
161 .zs_center_x { 164 .zs_center_x {
162 - width: 100%;  
163 - min-height: 200rpx; 165 + /* width: 100%;
  166 + min-height: 200rpx; */
164 font-size: 28rpx; 167 font-size: 28rpx;
165 color: #333; 168 color: #333;
166 - text-align: left;  
167 - margin-top: 30rpx;  
168 - padding: 0 10rpx; 169 + padding-left: 20rpx;
  170 + /* text-align: left; */
  171 + /* margin-top: 30rpx;
  172 + padding: 0 10rpx; */
169 } 173 }
170 174
171 .zs_wz1_x { 175 .zs_wz1_x {
172 - overflow: hidden;  
173 - text-overflow: ellipsis; 176 + /* overflow: hidden;
  177 + text-overflow: ellipsis; */
  178 + height: 90rpx;
174 margin-bottom: 10rpx; 179 margin-bottom: 10rpx;
175 font-size: 28rpx; 180 font-size: 28rpx;
176 - white-space: nowrap;  
177 - width: 80%; 181 + /* white-space: nowrap;
  182 + width: 80%; */
178 } 183 }
179 184
180 .zs_wz2_x { 185 .zs_wz2_x {
@@ -229,10 +234,11 @@ @@ -229,10 +234,11 @@
229 } 234 }
230 235
231 .zs_t1_x1 { 236 .zs_t1_x1 {
  237 + position: absolute;
232 width: 56rpx; 238 width: 56rpx;
233 height: 56rpx; 239 height: 56rpx;
234 - position: relative;  
235 - right: 285rpx; 240 + /* position: relative; */
  241 + left: 6rpx;
236 top: 6rpx; 242 top: 6rpx;
237 } 243 }
238 244
@@ -302,16 +308,16 @@ @@ -302,16 +308,16 @@
302 font-size: 28rpx; 308 font-size: 28rpx;
303 color: #333; 309 color: #333;
304 text-align: left; 310 text-align: left;
305 - padding: 0 10rpx; 311 + /* padding: 0 10rpx; */
306 } 312 }
307 313
308 .zs_wz1_2l { 314 .zs_wz1_2l {
309 - overflow: hidden;  
310 - text-overflow: ellipsis; 315 + /* overflow: hidden;
  316 + text-overflow: ellipsis; */
311 font-size: 28rpx; 317 font-size: 28rpx;
312 - white-space: nowrap;  
313 - height: 40rpx;  
314 - line-height: 40rpx; 318 + /* white-space: nowrap; */
  319 + height: 90rpx;
  320 + /* line-height: 40rpx; */
315 margin-top: 10rpx; 321 margin-top: 10rpx;
316 } 322 }
317 323
@@ -825,4 +831,16 @@ top: 10rpx; @@ -825,4 +831,16 @@ top: 10rpx;
825 bottom: 10rpx; 831 bottom: 10rpx;
826 } 832 }
827 833
828 -.n_box{ position: absolute !important;z-index: 10}  
829 \ No newline at end of file 834 \ No newline at end of file
  835 +.n_box{ position: absolute !important;z-index: 10}
  836 +
  837 +.block {
  838 + display: block;
  839 +}
  840 +
  841 +.ellipsis-2 {
  842 + overflow: hidden;
  843 + text-overflow: ellipsis;
  844 + display: -webkit-box;
  845 + -webkit-box-orient: vertical;
  846 + -webkit-line-clamp: 2;
  847 +}
830 \ No newline at end of file 848 \ No newline at end of file
components/diy_seckill/diy_seckill.wxml
@@ -62,7 +62,7 @@ @@ -62,7 +62,7 @@
62 </view> 62 </view>
63 63
64 <view class='sp_wz'> 64 <view class='sp_wz'>
65 - <view class='sp_wzi'>{{aitem.goods_name}}</view> 65 + <view class='sp_wzi ellipsis-2'>{{aitem.goods_name}}</view>
66 <view class='sp_jg'>¥{{aitem.price}}</view> 66 <view class='sp_jg'>¥{{aitem.price}}</view>
67 <view class='sp_jgx'>¥{{aitem.market_price}}</view> 67 <view class='sp_jgx'>¥{{aitem.market_price}}</view>
68 </view> 68 </view>
@@ -85,7 +85,7 @@ @@ -85,7 +85,7 @@
85 </view> 85 </view>
86 86
87 <view class="o1_right"> 87 <view class="o1_right">
88 - <view class="sp_wzi">{{aitem.title}}</view> 88 + <view class="sp_wzi ellipsis-2">{{aitem.title}}</view>
89 <view class="o1_sj_kill"> 89 <view class="o1_sj_kill">
90 <text>{{aitem.djs.day}}</text> 天 90 <text>{{aitem.djs.day}}</text> 天
91 <text>{{aitem.djs.hou}}</text> : 91 <text>{{aitem.djs.hou}}</text> :
components/diy_seckill/diy_seckill.wxss
@@ -112,13 +112,13 @@ swiper { @@ -112,13 +112,13 @@ swiper {
112 font-size: 30rpx; 112 font-size: 30rpx;
113 border-bottom: 2rpx solid #dcdcdc; 113 border-bottom: 2rpx solid #dcdcdc;
114 width: 100%; 114 width: 100%;
115 - text-align: left; 115 + /* text-align: left; */
116 padding: 4rpx 0; 116 padding: 4rpx 0;
117 - overflow: hidden;  
118 - height: 48rpx;  
119 - text-overflow: ellipsis; 117 + /* overflow: hidden; */
  118 + height: 90rpx;
  119 + /* text-overflow: ellipsis;
120 white-space: nowrap; 120 white-space: nowrap;
121 - line-height: 48rpx; 121 + line-height: 48rpx; */
122 } 122 }
123 123
124 .sp_wz .sp_jg { 124 .sp_wz .sp_jg {
@@ -222,12 +222,12 @@ swiper { @@ -222,12 +222,12 @@ swiper {
222 .o1_right .sp_wzi { 222 .o1_right .sp_wzi {
223 font-size: 30rpx; 223 font-size: 30rpx;
224 margin-bottom: 6rpx; 224 margin-bottom: 6rpx;
225 - text-align: left; 225 + /* text-align: left; */
226 padding: 4rpx 0; 226 padding: 4rpx 0;
227 - height: 48rpx;  
228 - overflow: hidden; 227 + height: 90rpx;
  228 + /* overflow: hidden;
229 white-space: nowrap; 229 white-space: nowrap;
230 - text-overflow: ellipsis; 230 + text-overflow: ellipsis; */
231 } 231 }
232 232
233 .o1_right .o1_sj_kill { 233 .o1_right .o1_sj_kill {
@@ -287,4 +287,13 @@ swiper { @@ -287,4 +287,13 @@ swiper {
287 align-items: center; 287 align-items: center;
288 } 288 }
289 289
290 -.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal}  
291 \ No newline at end of file 290 \ No newline at end of file
  291 +.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal}
  292 +
  293 +
  294 +.ellipsis-2 {
  295 + overflow: hidden;
  296 + text-overflow: ellipsis;
  297 + display: -webkit-box;
  298 + -webkit-box-orient: vertical;
  299 + -webkit-line-clamp: 2;
  300 +}
292 \ No newline at end of file 301 \ No newline at end of file