Authored by 郭成尧

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -56,7 +56,38 @@
keys: {}
};
},
created() {
yoho.addNativeMethod('editModel', () => {
this.hideDelBth();
this.editmodel = !this.editmodel;
this.updateNavBar();
});
yoho.store.remove('brandReload');
document.addEventListener('visibilitychange', () => {
if (!document.hidden && yoho.store.get('brandReload')) {
this.reload();
}
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
},
methods: {
reload() {
this.nullbox = 'hide';
this.busy = false;
this.editmodel = false;
this.page = 0;
this.pageX = 0;
this.currentX = 0;
this.pandata = {};
this.brandData = [];
this.keys = {};
yoho.store.remove('brandReload');
},
loadMore() {
this.busy = true;
$.ajax({
... ... @@ -225,23 +256,6 @@
header: header
});
}
},
created() {
yoho.addNativeMethod('editModel', () => {
this.hideDelBth();
this.editmodel = !this.editmodel;
this.updateNavBar();
});
document.addEventListener('visibilitychange', function() {
if (yoho.isApp && !document.hidden) {
location.reload();
}
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
}
};
</script>
... ...
... ... @@ -60,7 +60,38 @@
keys: {}
};
},
created() {
yoho.addNativeMethod('editModel', () => {
this.hideDelBth();
this.editmodel = !this.editmodel;
this.updateNavBar();
});
yoho.store.remove('productReload');
document.addEventListener('visibilitychange', () => {
if (!document.hidden && yoho.store.get('productReload')) {
this.reload();
}
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
},
methods: {
reload() {
this.nullbox = 'hide';
this.busy = false;
this.editmodel = false;
this.page = 0;
this.pageX = 0;
this.currentX = 0;
this.productData = [];
this.pandata = {};
this.keys = {};
yoho.store.remove('productReload');
},
loadMore() {
this.busy = true;
$.ajax({
... ... @@ -239,23 +270,6 @@
header: header
});
}
},
created() {
yoho.addNativeMethod('editModel', () => {
this.hideDelBth();
this.editmodel = !this.editmodel;
this.updateNavBar();
});
document.addEventListener('visibilitychange', function() {
if (yoho.isApp && !document.hidden) {
location.reload();
}
});
if (yoho.isApp) {
bus.$on('app.favourite.tabChange', this.updateNavBar);
}
}
};
</script>
... ...
... ... @@ -90,12 +90,6 @@
interceptClick.intercept('/me/service');
return false;
});
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
});
},
methods: {
updateNavBar() {
... ... @@ -271,10 +265,20 @@
});
},
goBuy(order) {
let orderDesc = [];
let goods = order.orderGoods || [];
goods.forEach((g) => {
orderDesc.push(g.productName);
});
yoho.goPay({
orderid: order.orderCode,
amount: order.amount
amount: order.amount,
orderDesc: orderDesc.join(','),
type: "orderDetail"
}, () => {
this.reload();
yoho.store.set('orderReload', true);
});
},
... ...
... ... @@ -88,10 +88,8 @@
this.getCancelReason();
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
if (yoho.store.get('orderReload')) {
this.reload();
}
if (!document.hidden && yoho.store.get('orderReload')) {
this.reload();
}
});
},
... ... @@ -252,11 +250,20 @@
});
},
goBuy(order) {
let orderDesc = [];
let goods = order.orderGoods || [];
goods.forEach((g) => {
orderDesc.push(g.productName);
});
yoho.goPay({
orderid: order.orderCode,
amount: order.amount
amount: order.amount,
orderDesc: orderDesc.join(','),
type: "orderList"
}, () => {
yoho.store.set('orderReload', true);
this.reload();
});
},
dropDown(elementId) {
... ...
... ... @@ -467,6 +467,7 @@
if (result.code === 200) {
tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功');
this.entity.isCollect = this.entity.isCollect === 'Y' ? 'N' : 'Y';
yoho.store.set('productReload', true);
} else if (result.code === 403) {
// 未登录
yoho.goLogin('', () => {
... ...
... ... @@ -74,6 +74,7 @@
}).done(result => {
if (result.code === 200) {
this.shareData.isFav = !this.shareData.isFav;
yoho.store.set('brandReload', true);
} else if (result.code === 403) {
yoho.goLogin('', this.collectShop);
}
... ...