Commit e8531d1cb44fbd54432a8f9b256249dc4ad8de76

Authored by 王强
1 parent dbcb2e8e

1、替换title背景图片

2、折扣专区首页和列表页优化
src/pages/discountList/discountList.vue
... ... @@ -55,7 +55,7 @@
55 55 sty="1">
56 56  
57 57 <!-- 折扣角标 -->
58   - <div class="discount-flag" slot="flag">
  58 + <div class="discount-flag" slot="flag" v-if="item.price < item.prices">
59 59 {{getDiscount(item.price, item.prices)}}折
60 60 </div>
61 61 </goods-item-8>
... ... @@ -110,7 +110,7 @@
110 110 // 售价/原价
111 111 let x = (price * 100) / (prices * 100);
112 112  
113   - return (Math.floor(x * 100) / 100) * 10;
  113 + return (Math.floor(x * 1000) / 1000) * 10;
114 114 }
115 115 }
116 116 },
... ...
src/pages/optimization2/optimization2.vue
... ... @@ -23,7 +23,7 @@
23 23 <!-- 标题 -->
24 24 <text-bg-title-com @more="toDiscountList"
25 25 :titles="{
26   - bg: 'static/img/text_bg_title_bg.jpg',
  26 + bg: 'static/img/text_bg_title_bg.png',
27 27 more: true
28 28 }">
29 29  
... ... @@ -43,7 +43,7 @@
43 43 pid="4">
44 44  
45 45 <!-- 折扣角标 -->
46   - <div class="discount-flag" slot="flag">
  46 + <div class="discount-flag" slot="flag" v-if="item.price < item.prices">
47 47 {{getDiscount(item.price, item.prices)}}折
48 48 </div>
49 49 </goods-item-2>
... ... @@ -168,6 +168,7 @@
168 168 title: "", // 标题
169 169 backs: null, // 后退按钮组
170 170 navs: null, // 导航
  171 + discountTimeout: 0, // 倒计时超时时间计数
171 172 discountTime: null, // 倒计时时间
172 173 discountLists: null, // 折扣专区数据
173 174 quality: null, // 品质优选
... ... @@ -190,7 +191,7 @@
190 191 // 售价/原价
191 192 let x = (price * 100) / (prices * 100);
192 193  
193   - return (Math.floor(x * 100) / 100) * 10;
  194 + return (Math.floor(x * 1000) / 1000) * 10;
194 195 }
195 196 }
196 197 },
... ... @@ -318,6 +319,22 @@
318 319 // 设置倒计时时间
319 320 this.$set(this, 'discountTime', datas.discount_time);
320 321  
  322 + // 设置倒计时超时轮训
  323 + let timeoutInterval = setInterval(() => {
  324 +
  325 + // 判断是否超时
  326 + if (this.discountTimeout > this.discountTime) {
  327 +
  328 + // 停止倒计时
  329 + clearInterval(timeoutInterval);
  330 +
  331 + // 设置倒计时时间为负数,隐藏“折扣专区”区块
  332 + this.$set(this, 'discountTime', '-1');
  333 + } else {
  334 + this.discountTimeout++;
  335 + }
  336 + }, 1000);
  337 +
321 338 // 设置折扣专区数据
322 339 this.$set(this, 'discountLists', datas.discount);
323 340 }
... ...
static/img/text_bg_title_bg.jpg deleted 100644 → 0

7.79 KB

static/img/text_bg_title_bg.png 0 → 100644

13.3 KB