Commit f148a2ed by 李伟康

commit

1 parent 81cb7b04
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
客服 客服
</div> </div>
</template> </template>
<template v-if="showOrderBtn"> <!-- <template v-if="showOrderBtn">
<div <div
class="page-item flex order-move" class="page-item flex order-move"
@click="to('crowdfunding.orderList')" @click="to('crowdfunding.orderList')"
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="sprite-icon icon-order"></div> <div class="sprite-icon icon-order"></div>
订单 订单
</div> </div>
</template> </template> -->
</div> </div>
<div class="big-img"> <div class="big-img">
<img :src="detail.activityBigImg" /> <img :src="detail.activityBigImg" />
......
...@@ -62,7 +62,8 @@ export default { ...@@ -62,7 +62,8 @@ export default {
imgList: [], imgList: [],
updata: Date.now(), updata: Date.now(),
lastItemIndex: 0, lastItemIndex: 0,
itemIndex: 0 itemIndex: 0,
touchFlag: true
} }
}, },
activated () { activated () {
...@@ -81,6 +82,7 @@ export default { ...@@ -81,6 +82,7 @@ export default {
}, 1) }, 1)
} else { } else {
box.scrollLeft = total box.scrollLeft = total
this.touchFlag = false
} }
} }
if (this.lastItemIndex > this.itemIndex) { if (this.lastItemIndex > this.itemIndex) {
...@@ -92,11 +94,18 @@ export default { ...@@ -92,11 +94,18 @@ export default {
}, 1) }, 1)
} else { } else {
box.scrollLeft = total box.scrollLeft = total
this.touchFlag = false
} }
} }
if (this.lastItemIndex == this.itemIndex) box.scrollLeft = total if (this.lastItemIndex == this.itemIndex) {
box.scrollLeft = total
this.touchFlag = false
}
}, },
touchEnd: util.debounce(e => { touchEnd: util.debounce(e => {
if (_this.touchFlag && e.type == 'scroll') return
else _this.touchFlag = true
_this.lastItemIndex = _this.itemIndex _this.lastItemIndex = _this.itemIndex
let box = document.getElementsByClassName('img-box')[0] let box = document.getElementsByClassName('img-box')[0]
let { imgList } = _this let { imgList } = _this
...@@ -105,6 +114,7 @@ export default { ...@@ -105,6 +114,7 @@ export default {
let index = (box.scrollLeft / width).toFixed() let index = (box.scrollLeft / width).toFixed()
let total = index == 0 ? 0 : width * index + (spacing * index) let total = index == 0 ? 0 : width * index + (spacing * index)
_this.itemIndex = index _this.itemIndex = index
console.log(e)
_this.moveSlow(box.scrollLeft, total) _this.moveSlow(box.scrollLeft, total)
}, 200), }, 200),
getOrderList () { getOrderList () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!