Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

@@ -28,7 +28,8 @@ const handleBrandList = origin => { @@ -28,7 +28,8 @@ const handleBrandList = origin => {
28 brands.push({ 28 brands.push({
29 name: subValue.brand_name, 29 name: subValue.brand_name,
30 link: '/brand/' + subValue.brand_domain, 30 link: '/brand/' + subValue.brand_domain,
31 - logo: subValue.brand_ico 31 + logo: subValue.brand_ico,
  32 + domain: subValue.brand_domain
32 }); 33 });
33 }); 34 });
34 35
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <div class="index"><a href="#{{item.index}}" name="{{item.index}}">{{item.index}}</a></div> 4 <div class="index"><a href="#{{item.index}}" name="{{item.index}}">{{item.index}}</a></div>
5 <div class="brand-big-box clearfix"> 5 <div class="brand-big-box clearfix">
6 <div class="brand-box" v-for="brand in item.brands"> 6 <div class="brand-box" v-for="brand in item.brands">
7 - <a href="{{brand.link}}"> 7 + <a href="{{brand.domain | brandUrl}}">
8 <div class="brand-logo"> 8 <div class="brand-logo">
9 <img v-lazy="brand.logo | resize 150 150" alt="{{brand.name}}"> 9 <img v-lazy="brand.logo | resize 150 150" alt="{{brand.name}}">
10 </div> 10 </div>
@@ -40,6 +40,7 @@ @@ -40,6 +40,7 @@
40 const tip = require('common/tip'); 40 const tip = require('common/tip');
41 const interceptClick = require('common/intercept-click'); 41 const interceptClick = require('common/intercept-click');
42 const yoho = require('yoho'); 42 const yoho = require('yoho');
  43 + const bus = require('common/vue-bus');
43 44
44 module.exports = { 45 module.exports = {
45 data() { 46 data() {
@@ -91,6 +92,11 @@ @@ -91,6 +92,11 @@
91 } 92 }
92 93
93 this.nullbox = this.brandData.length ? 'hide' : ''; 94 this.nullbox = this.brandData.length ? 'hide' : '';
  95 +
  96 + if (this.page === 1) {
  97 + yoho.showLoading(false);
  98 + this.updateNavBar();
  99 + }
94 }).fail(() => { 100 }).fail(() => {
95 tip('网络错误'); 101 tip('网络错误');
96 }); 102 });
@@ -143,7 +149,7 @@ @@ -143,7 +149,7 @@
143 return false; 149 return false;
144 } else { 150 } else {
145 this.pageX = event.targetTouches[0].pageX; 151 this.pageX = event.targetTouches[0].pageX;
146 - var delBtn = $('#del-' + id); 152 + let delBtn = $('#del-' + id);
147 153
148 if (delBtn.hasClass('hide')) { 154 if (delBtn.hasClass('hide')) {
149 delBtn.removeClass('hide'); 155 delBtn.removeClass('hide');
@@ -222,15 +228,9 @@ @@ -222,15 +228,9 @@
222 this.updateNavBar(); 228 this.updateNavBar();
223 }); 229 });
224 230
225 - document.addEventListener('visibilitychange', () => {  
226 - if (!document.hidden) {  
227 - this.updateNavBar(); 231 + if (yoho.isApp) {
  232 + bus.$on('app.favourite.tabChange', this.updateNavBar);
228 } 233 }
229 - });  
230 - },  
231 - ready() {  
232 - yoho.showLoading(false);  
233 - this.updateNavBar();  
234 } 234 }
235 }; 235 };
236 </script> 236 </script>
@@ -45,6 +45,7 @@ @@ -45,6 +45,7 @@
45 const tip = require('common/tip'); 45 const tip = require('common/tip');
46 const interceptClick = require('common/intercept-click'); 46 const interceptClick = require('common/intercept-click');
47 const yoho = require('yoho'); 47 const yoho = require('yoho');
  48 + const bus = require('common/vue-bus');
48 49
49 module.exports = { 50 module.exports = {
50 data() { 51 data() {
@@ -72,12 +73,7 @@ @@ -72,12 +73,7 @@
72 if ($.isEmptyObject(data) || data.pageTotal === 0) { 73 if ($.isEmptyObject(data) || data.pageTotal === 0) {
73 this.busy = true; 74 this.busy = true;
74 } else { 75 } else {
75 - if (this.page === data.pageTotal) {  
76 - this.busy = true;  
77 - } else {  
78 - this.busy = false;  
79 - }  
80 - 76 + this.busy = this.page === data.pageTotal;
81 const list = data.productList || []; 77 const list = data.productList || [];
82 78
83 list.forEach(o => { 79 list.forEach(o => {
@@ -111,6 +107,11 @@ @@ -111,6 +107,11 @@
111 } 107 }
112 108
113 this.nullbox = this.productData.length ? 'hide' : ''; 109 this.nullbox = this.productData.length ? 'hide' : '';
  110 +
  111 + if (this.page === 1) {
  112 + yoho.showLoading(false);
  113 + this.updateNavBar();
  114 + }
114 }).fail(() => { 115 }).fail(() => {
115 tip('网络错误'); 116 tip('网络错误');
116 }); 117 });
@@ -162,7 +163,7 @@ @@ -162,7 +163,7 @@
162 return false; 163 return false;
163 } else { 164 } else {
164 this.pageX = event.targetTouches[0].pageX; 165 this.pageX = event.targetTouches[0].pageX;
165 - var delBtn = $('#del-' + id); 166 + let delBtn = $('#del-' + id);
166 167
167 if (delBtn.hasClass('hide')) { 168 if (delBtn.hasClass('hide')) {
168 delBtn.removeClass('hide'); 169 delBtn.removeClass('hide');
@@ -229,6 +230,7 @@ @@ -229,6 +230,7 @@
229 if (!this.productData.length) { 230 if (!this.productData.length) {
230 header.right.des = ''; 231 header.right.des = '';
231 } 232 }
  233 +
232 yoho.updateNavigationBar({ 234 yoho.updateNavigationBar({
233 header: header 235 header: header
234 }); 236 });
@@ -241,15 +243,9 @@ @@ -241,15 +243,9 @@
241 this.updateNavBar(); 243 this.updateNavBar();
242 }); 244 });
243 245
244 - document.addEventListener('visibilitychange', () => {  
245 - if (!document.hidden) {  
246 - this.updateNavBar(); 246 + if (yoho.isApp) {
  247 + bus.$on('app.favourite.tabChange', this.updateNavBar);
247 } 248 }
248 - });  
249 - },  
250 - ready() {  
251 - yoho.showLoading(false);  
252 - this.updateNavBar();  
253 } 249 }
254 }; 250 };
255 </script> 251 </script>