Commit c2c6f062798e067e7618f34c68d3009595ab1e27
1 parent
afc260dc
助力活动页轮播图修改
Showing
4 changed files
with
29 additions
and
5 deletions
app.wxss
@@ -36,6 +36,13 @@ button { | @@ -36,6 +36,13 @@ button { | ||
36 | white-space: nowrap; | 36 | white-space: nowrap; |
37 | text-overflow: ellipsis; | 37 | text-overflow: ellipsis; |
38 | } | 38 | } |
39 | +.ellipsis-1x { | ||
40 | + overflow: hidden; | ||
41 | + text-overflow: ellipsis; | ||
42 | + display: -webkit-box; | ||
43 | + -webkit-box-orient: vertical; | ||
44 | + -webkit-line-clamp: 1; | ||
45 | +} | ||
39 | .ellipsis-2 { | 46 | .ellipsis-2 { |
40 | overflow: hidden; | 47 | overflow: hidden; |
41 | text-overflow: ellipsis; | 48 | text-overflow: ellipsis; |
pages/user/assistance/task_assistance.js
@@ -63,6 +63,8 @@ Page({ | @@ -63,6 +63,8 @@ Page({ | ||
63 | zltime: "", //助力时间 | 63 | zltime: "", //助力时间 |
64 | djs: "", //定时器的显示 | 64 | djs: "", //定时器的显示 |
65 | //*********************************************end | 65 | //*********************************************end |
66 | + | ||
67 | + Hei: 0, | ||
66 | }, | 68 | }, |
67 | 69 | ||
68 | /** | 70 | /** |
@@ -1071,6 +1073,19 @@ Page({ | @@ -1071,6 +1073,19 @@ Page({ | ||
1071 | var aitem = this.data.aitem; | 1073 | var aitem = this.data.aitem; |
1072 | var task_id = aitem[ind].id; | 1074 | var task_id = aitem[ind].id; |
1073 | getApp().goto("/pages/test/zhuli_test?taskId="+task_id); | 1075 | getApp().goto("/pages/test/zhuli_test?taskId="+task_id); |
1074 | - } | 1076 | + }, |
1077 | + | ||
1078 | + | ||
1079 | + imgH:function(e){ | ||
1080 | + | ||
1081 | + var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度 | ||
1082 | + var imgh = e.detail.height; //图片高度 | ||
1083 | + var imgw = e.detail.width; | ||
1084 | + var swiperH = winWid*0.827*imgh/imgw + "px" //等比设置swiper的高度。 即 屏幕宽度 / swiper高度 = 图片宽度 / 图片高度 ==》swiper高度 = 屏幕宽度 * 图片高度 / 图片宽度 | ||
1085 | + console.log('imgload',winWid, imgh, imgw, swiperH); | ||
1086 | + this.setData({ | ||
1087 | + Hei:swiperH //设置高度 | ||
1088 | + }) | ||
1089 | + }, | ||
1075 | 1090 | ||
1076 | }) | 1091 | }) |
pages/user/assistance/task_assistance.wxml
@@ -16,17 +16,19 @@ | @@ -16,17 +16,19 @@ | ||
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | <!-- 图片的轮播图 --> | 18 | <!-- 图片的轮播图 --> |
19 | - <view class="xc-specific-more-frame flex-center"> | 19 | + <view class="xc-specific-more-frame flex-center" style="height:{{Hei}};"> |
20 | <view bindtap="click_pre"> | 20 | <view bindtap="click_pre"> |
21 | <view class="bg_left xc-left bcolor"></view> | 21 | <view class="bg_left xc-left bcolor"></view> |
22 | </view> | 22 | </view> |
23 | - <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> | 23 | + <!-- <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='width:82.7%; height:100%' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}"> --> |
24 | + <swiper bindanimationfinish="changeGoodsSwip" current="{{sw_index}}" style='' bindchange='onSli' indicator-dots="{{false}}" autoplay="{{false}}" style='width:82.7%;height: 100%;'> | ||
24 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> | 25 | <swiper-item class="rel" wx:for="{{aitem}}" wx:for-item="aitem" wx:for-index="pidx"> |
25 | 26 | ||
26 | - <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}"></image> | 27 | + <image class="xc-center-img" bindtap="libao_details" data-taskid="{{aitem.id}}" src="{{aitem.giftBagUrl!=null&&aitem.giftBagUrl!=''?iurl+aitem.giftBagUrl:swpie_img}}" mode="widthFix" bindload='imgH' style="width: 100%;display: block;"></image> |
27 | <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> | 28 | <view bindtap="libao_details" data-taskid="{{aitem.id}}" class="abs select_details fs26 white">礼包详情</view> |
28 | 29 | ||
29 | </swiper-item> | 30 | </swiper-item> |
31 | + | ||
30 | </swiper> | 32 | </swiper> |
31 | 33 | ||
32 | <view bindtap="click_next"> | 34 | <view bindtap="click_next"> |
pages/user/assistance/task_assistance.wxss