Commit 39b794f6 by 李伟康

提交代码

1 parent f148a2ed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="layout"> <div class="layout">
<div class="title">左右滑动查看核销凭证</div> <div class="title">左右滑动查看核销凭证</div>
<div class="content"> <div class="content">
<div <!-- <div
class="img-box flex" class="img-box flex"
:key="updata" :key="updata"
ref="imgBox" ref="imgBox"
...@@ -32,8 +32,39 @@ ...@@ -32,8 +32,39 @@
</van-image> </van-image>
</div> </div>
</template> </template>
</div> </div> -->
<div class="dots x-center text-center"> <van-swipe
class="img-box test"
:key="updata"
indicator-color="#FFFFFF"
:width="347"
>
<template v-for="(i,index) in orderList">
<van-swipe-item
:key="index"
>
<create-order-img
:orderInfo="i"
:canvasId="`order-${index}`"
:ref="`order-${index}`"
/>
<van-image
:src="imgList[index]"
class="img"
>
<template v-slot:loading>
<van-loading
type="spinner"
size="20"
/>
</template>
</van-image>
</van-swipe-item>
</template>
</van-swipe>
<!-- <div class="dots x-center text-center">
<template v-for="(i,index) in orderList"> <template v-for="(i,index) in orderList">
<div <div
:key="index" :key="index"
...@@ -42,7 +73,7 @@ ...@@ -42,7 +73,7 @@
</div> </div>
</template> </template>
</div> </div> -->
</div> </div>
<div class="tips text-center">长按保存图片</div> <div class="tips text-center">长按保存图片</div>
</div> </div>
...@@ -104,8 +135,6 @@ export default { ...@@ -104,8 +135,6 @@ export default {
}, },
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
...@@ -115,7 +144,15 @@ export default { ...@@ -115,7 +144,15 @@ export default {
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) console.log(e)
_this.moveSlow(box.scrollLeft, total) if (e.type == 'touchend') {
console.log('触摸离开')
_this.moveSlow(box.scrollLeft, total)
}
if (e.type != 'touchend' && !_this.touchFlag) {
console.log('滑动完')
_this.moveSlow(box.scrollLeft, total)
_this.touchFlag = true
}
}, 200), }, 200),
getOrderList () { getOrderList () {
let { id } = this.getLocalStorage('wx_scrm_link_params') let { id } = this.getLocalStorage('wx_scrm_link_params')
...@@ -163,6 +200,9 @@ export default { ...@@ -163,6 +200,9 @@ export default {
} }
} }
} }
.test{
padding-left: 19px;
}
.img-box { .img-box {
overflow-x: scroll; overflow-x: scroll;
width: 100%; width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!