|
|
<template>
|
|
|
<div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
|
|
|
<div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10" >
|
|
|
<ul class="fav-product-list">
|
|
|
<li v-for="item in productData" track-by="fav_id" id="li-{{item.fav_id}}"
|
|
|
v-touch-options:pan="{ direction: 'horizontal', threshold: 100}"
|
|
|
v-touch:panstart="panstart(item.fav_id)"
|
|
|
v-touch:panmove="panmove(item.fav_id)"
|
|
|
v-touch:panend="panend(item.fav_id)"
|
|
|
v-touch-options:pan="{ direction: 'horizontal' }">
|
|
|
v-touch:panend="panend(item.fav_id)">
|
|
|
<div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn(item.fav_id)">
|
|
|
<span class="fav-del-span"><span class="icon icon-edit-del"></span></span>
|
|
|
</div>
|
...
|
...
|
@@ -55,8 +55,8 @@ |
|
|
page: 0,
|
|
|
pageX: 0,
|
|
|
currentX: 0,
|
|
|
pandata: {},
|
|
|
productData: [],
|
|
|
pandata: {},
|
|
|
keys: {}
|
|
|
};
|
|
|
},
|
...
|
...
|
@@ -154,25 +154,24 @@ |
|
|
},
|
|
|
panstart(id) {
|
|
|
event.preventDefault();
|
|
|
if (this.editmodel && this.pandata.id !== id) {
|
|
|
if (this.pandata.id && this.pandata.id !== id) {
|
|
|
$('#li-' + this.pandata.id).css('transform', 'translateX(0px)');
|
|
|
$('#del-' + this.pandata.id).addClass('hide');
|
|
|
return false;
|
|
|
}
|
|
|
} else {
|
|
|
this.pageX = event.targetTouches[0].pageX;
|
|
|
var delBtn = $('#del-' + id);
|
|
|
|
|
|
$('#del-' + id).removeClass('hide');
|
|
|
this.pageX = event.targetTouches[0].pageX;
|
|
|
if (this.pandata.id !== id) {
|
|
|
if (this.pandata.id !== undefined) {
|
|
|
$('#li-' + this.pandata.id).css('transform', 'translateX(0px)');
|
|
|
$('#del-' + this.pandata.id).addClass('hide');
|
|
|
if (delBtn.hasClass('hide')) {
|
|
|
delBtn.removeClass('hide');
|
|
|
this.pandata.objX = 0;
|
|
|
this.pandata.id = id;
|
|
|
}
|
|
|
|
|
|
this.pandata.objX = 0;
|
|
|
this.pandata.id = id;
|
|
|
}
|
|
|
},
|
|
|
panmove(id) {
|
|
|
event.preventDefault();
|
|
|
if (this.editmodel && this.pandata.id !== id) {
|
|
|
if (this.pandata.id && this.pandata.id !== id) {
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -199,7 +198,8 @@ |
|
|
},
|
|
|
panend(id) {
|
|
|
event.preventDefault();
|
|
|
if (this.editmodel && this.pandata.id !== id) {
|
|
|
if (this.pandata.id && this.pandata.id !== id) {
|
|
|
this.pandata = {};
|
|
|
return false;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -215,7 +215,7 @@ |
|
|
}
|
|
|
li.css('transform', 'translateX(' + this.pandata.objX + 'px)');
|
|
|
|
|
|
if (this.editmodel && this.pandata.id === id && this.pandata.objX === 0) {
|
|
|
if (this.pandata.objX === 0) {
|
|
|
this.pandata = {};
|
|
|
}
|
|
|
}
|
...
|
...
|
|