|
@@ -15,8 +15,8 @@
|
|
|
</view>
|
|
|
<!--多张图片-->
|
|
|
<view v-else-if="item.type == 11">
|
|
|
- <swiper class="swiper" autoplay="false" vertical="true" interval="990000" :previous-margin="previous_margin" :next-margin="next_margin" @change="changes" circular="true">
|
|
|
- <swiper-item v-for="(v, k) in item.data" :key="k">
|
|
|
+ <swiper class="swiper" autoplay="false" vertical="true" interval="990000" :previous-margin="previous_margin" :next-margin="next_margin" @change="setMargin" circular="true">
|
|
|
+ <swiper-item v-for="(v, k) in item.data" :key="k" style="overflow: unset;">
|
|
|
<pic @setHeight="setHeight" :index="index" :pic_index="k" :item="v" :control="control" :bottom="bottom"></pic>
|
|
|
</swiper-item>
|
|
|
</swiper>
|
|
@@ -29,7 +29,7 @@
|
|
|
|
|
|
<!--多张四宫格图片-->
|
|
|
<view v-else-if="item.type == 13">
|
|
|
- <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
|
|
|
+ <swiper class="swiper" autoplay="false" vertical="true" interval="990000" circular="true">
|
|
|
<swiper-item v-for="(v, k) in item.data" :key="k">
|
|
|
<picGrid :index="index" :item="v" :control="control" :bottom="bottom"></picGrid>
|
|
|
</swiper-item>
|
|
@@ -40,7 +40,7 @@
|
|
|
|
|
|
<!--视频-->
|
|
|
<view v-else-if="item.type == 20">
|
|
|
- <swiper class="swiper" autoplay="false" vertical="true" interval="990000">
|
|
|
+ <swiper class="swiper" autoplay="false" vertical="true" interval="990000" circular="true">
|
|
|
<swiper-item v-for="(v, k) in item.data" :key="k">
|
|
|
<vod :index="index" :item="v" :control="control" :bottom="bottom"></vod>
|
|
|
</swiper-item>
|
|
@@ -139,18 +139,20 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ item_height : {},
|
|
|
next_margin : '0px',
|
|
|
previous_margin : '0px',
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.item_height[this.index] = [];
|
|
|
+ },
|
|
|
methods:{
|
|
|
- setHeight : function(index, height) {
|
|
|
-
|
|
|
- if (index == 0) {
|
|
|
- height = height + 20;
|
|
|
- //this.next_margin = height + 'px';
|
|
|
+ setHeight : function(index, height) {
|
|
|
+ this.item_height[this.index][index] = height;
|
|
|
+ if (index == 0) {
|
|
|
+ this.setMargin(false, index);
|
|
|
}
|
|
|
- console.info(index, height, this.next_margin);
|
|
|
},
|
|
|
getData : function(page) {
|
|
|
|
|
@@ -165,11 +167,17 @@ export default {
|
|
|
handle : function(e) {
|
|
|
this.showDrawer(this.button[e.index].key);
|
|
|
},
|
|
|
- changes : function(e) {
|
|
|
- return;
|
|
|
- var i = parseInt(e.detail.current);
|
|
|
- this.next_margin = i*50;
|
|
|
- this.next_margin = this.next_margin + 'px';
|
|
|
+ setMargin : function(e, i) {
|
|
|
+ var index = i >= 0 ? i : e.detail.current;
|
|
|
+ if (this.item_height[this.index].length > 0 && this.item_height[this.index][index]) {
|
|
|
+ var height = this.item_height[this.index][index];
|
|
|
+ var windowHeight = this.Dever.config.system.windowHeight;
|
|
|
+ if (windowHeight > height) {
|
|
|
+ height = windowHeight-height-3;
|
|
|
+ this.next_margin = height + 'px';
|
|
|
+ console.info(this.next_margin)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
components:{
|