Authored by 沈志敏

添加左划效果

@@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
17 margin-top: 20px; 17 margin-top: 20px;
18 } 18 }
19 19
20 - .fav-del { 20 + .fav-del-left {
21 display: none; 21 display: none;
22 float: left; 22 float: left;
23 width: 50px; 23 width: 50px;
@@ -38,6 +38,30 @@ @@ -38,6 +38,30 @@
38 display: block; 38 display: block;
39 } 39 }
40 40
  41 + .fav-del-right {
  42 + position: absolute;
  43 + top: 0;
  44 + right: -126px;
  45 + background: #ff3b30;
  46 + width: 126px;
  47 + height: 200px;
  48 + text-align: center;
  49 +
  50 + .fav-del-btn {
  51 + display: inline-block;
  52 + width: 35px;
  53 + height: 43px;
  54 + margin-top: 50px;
  55 + background: resolve("home/fav/fav-del-btn.png");
  56 + background-size: 100%;
  57 + }
  58 +
  59 + .fav-del-txt {
  60 + font-size: 24px;
  61 + color: #fff;
  62 + }
  63 + }
  64 +
41 .fav-img-box { 65 .fav-img-box {
42 width: 152px; 66 width: 152px;
43 height: 203px; 67 height: 203px;
@@ -156,7 +180,7 @@ @@ -156,7 +180,7 @@
156 border-bottom: 1px solid #e0e0e0; 180 border-bottom: 1px solid #e0e0e0;
157 } 181 }
158 182
159 - .fav-del { 183 + .fav-del-left {
160 display: none; 184 display: none;
161 float: left; 185 float: left;
162 width: 50px; 186 width: 50px;
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10"> 2 <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
3 <ul class="fav-brand-list"> 3 <ul class="fav-brand-list">
4 <li v-for="item in brandData" track-by="fav_id"> 4 <li v-for="item in brandData" track-by="fav_id">
5 - <div class="fav-del {{editmodel ? 'delshow': ''}}" @click="delItem($index, item.fav_id)"> 5 + <div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="delItem($index, item.fav_id)">
6 <span class="fav-del-span"></span> 6 <span class="fav-del-span"></span>
7 </div> 7 </div>
8 <a :href="item.link"> 8 <a :href="item.link">
@@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
14 <span class="down" v-if="item.down">品牌已下架</span> 14 <span class="down" v-if="item.down">品牌已下架</span>
15 </div> 15 </div>
16 </a> 16 </a>
  17 + <div class="fav-del-right">
  18 + <span class="fav-del-btn"></span>
  19 + </div>
17 </li> 20 </li>
18 </ul> 21 </ul>
19 <div class="fav-null-box {{ nullbox }}"> 22 <div class="fav-null-box {{ nullbox }}">
1 <template> 1 <template>
2 <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10"> 2 <div class="fav-type" v-infinite-scroll="loadMore()" infinite-scroll-disabled="busy" infinite-scroll-distance="10">
3 <ul class="fav-product-list"> 3 <ul class="fav-product-list">
4 - <li v-for="item in productData" track-by="fav_id">  
5 - <div class="fav-del {{editmodel ? 'delshow': ''}}" @click="delItem($index, item.fav_id)"> 4 + <li v-for="item in productData" track-by="fav_id" id="li-{{$index}}">
  5 + <div class="fav-del-left {{editmodel ? 'delshow': ''}}" @click="showDelBtn($index)">
6 <span class="fav-del-span"></span> 6 <span class="fav-del-span"></span>
7 </div> 7 </div>
8 <a :href="item.link"> 8 <a :href="item.link">
@@ -22,6 +22,11 @@ @@ -22,6 +22,11 @@
22 </div> 22 </div>
23 </div> 23 </div>
24 </a> 24 </a>
  25 + <div class="fav-del-right" id="del-{{$index}}" @click="delItem($index, item.fav_id)">
  26 + <span class="fav-del-btn"></span>
  27 + <br/>
  28 + <span class="fav-del-txt">删除</span>
  29 + </div>
25 </li> 30 </li>
26 </ul> 31 </ul>
27 <div class="fav-null-box {{ nullbox }}"> 32 <div class="fav-null-box {{ nullbox }}">
@@ -77,6 +82,11 @@ @@ -77,6 +82,11 @@
77 editModel(action) { 82 editModel(action) {
78 this.editmodel = action; 83 this.editmodel = action;
79 }, 84 },
  85 + showDelBtn(index) {
  86 + var delBtn = $("#del-" + index);
  87 + var width = delBtn.width();
  88 + $("#li-" + index).css("transform","translateX(-" + width + "px)");
  89 + },
80 delItem(index, id) { 90 delItem(index, id) {
81 let _this = this; 91 let _this = this;
82 $.ajax({ 92 $.ajax({