Commit 83c0f601 by 李伟康

提交代码

1 parent 0dcfd574
<template>
<div class="layout">
<div class="title">左右滑动查看核销凭证</div>
<div
class="img-box flex"
:key="updata"
ref="imgBox"
@touchend="scroll"
@touchstart="scrollstart"
>
<template v-for="(i,index) in orderList">
<div
:key="index"
class="img-item"
>
<create-order-img
:orderInfo="i"
:canvasId="`order-${index}`"
:ref="`order-${index}`"
/>
<van-image
:src="imgList[index]"
class="img"
<div class="content">
<div
class="img-box flex"
:key="updata"
ref="imgBox"
@touchend="scroll"
@touchstart="scrollstart"
>
<template v-for="(i,index) in orderList">
<div
:key="index"
class="img-item"
>
<template v-slot:loading>
<van-loading
type="spinner"
size="20"
/>
</template>
</van-image>
</div>
</template>
<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>
</div>
</template>
</div>
<div class="dots x-center text-center">
<template v-for="(i,index) in orderList">
<div
:key="index"
:class="['dots-item',{'active':itemIndex == index}]"
>
</div>
</template>
</div>
</div>
<div class="tips text-center">长按保存图片</div>
</div>
......@@ -85,7 +97,7 @@ export default {
box.scrollLeft = total
}
}
if(this.lastItemIndex == this.itemIndex) box.scrollLeft = total
if (this.lastItemIndex == this.itemIndex) box.scrollLeft = total
},
scroll: util.debounce(e => {
_this.lastItemIndex = _this.itemIndex
......@@ -97,7 +109,7 @@ export default {
let total = index == 0 ? 0 : width * index + (spacing * index)
_this.itemIndex = index
_this.moveSlow(box.scrollLeft, total)
},200),
}, 200),
getOrderList () {
let { id } = this.getLocalStorage('wx_scrm_link_params')
shopmallApi.getOrderList(id).then(data => {
......@@ -128,6 +140,22 @@ export default {
color: #999999;
padding: 16px 0 8px 20px;
}
.content {
position: relative;
.dots {
bottom: 15px;
&-item {
width: 5px;
height: 5px;
background: rgba(255, 255, 255, 0.5);
border-radius: 100%;
margin: 0 4px;
}
.active {
background: #ffffff;
}
}
}
.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!