Commit 83c0f601 by 李伟康

提交代码

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