Commit 39b794f6 by 李伟康

提交代码

1 parent f148a2ed
......@@ -2,7 +2,7 @@
<div class="layout">
<div class="title">左右滑动查看核销凭证</div>
<div class="content">
<div
<!-- <div
class="img-box flex"
:key="updata"
ref="imgBox"
......@@ -32,8 +32,39 @@
</van-image>
</div>
</template>
</div>
<div class="dots x-center text-center">
</div> -->
<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">
<div
:key="index"
......@@ -42,7 +73,7 @@
</div>
</template>
</div>
</div> -->
</div>
<div class="tips text-center">长按保存图片</div>
</div>
......@@ -104,8 +135,6 @@ export default {
},
touchEnd: util.debounce(e => {
if (_this.touchFlag && e.type == 'scroll') return
else _this.touchFlag = true
_this.lastItemIndex = _this.itemIndex
let box = document.getElementsByClassName('img-box')[0]
let { imgList } = _this
......@@ -115,7 +144,15 @@ export default {
let total = index == 0 ? 0 : width * index + (spacing * index)
_this.itemIndex = index
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),
getOrderList () {
let { id } = this.getLocalStorage('wx_scrm_link_params')
......@@ -163,6 +200,9 @@ export default {
}
}
}
.test{
padding-left: 19px;
}
.img-box {
overflow-x: scroll;
width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!