|
@@ -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();
|
|
|
247
|
- }
|
|
|
248
|
- });
|
|
|
249
|
- },
|
|
|
250
|
- ready() {
|
|
|
251
|
- yoho.showLoading(false);
|
|
|
252
|
- this.updateNavBar();
|
246
|
+ if (yoho.isApp) {
|
|
|
247
|
+ bus.$on('app.favourite.tabChange', this.updateNavBar);
|
|
|
248
|
+ }
|
253
|
}
|
249
|
}
|
254
|
};
|
250
|
};
|
255
|
</script>
|
251
|
</script>
|