Authored by 郭成尧

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

@@ -56,7 +56,38 @@ @@ -56,7 +56,38 @@
56 keys: {} 56 keys: {}
57 }; 57 };
58 }, 58 },
  59 + created() {
  60 + yoho.addNativeMethod('editModel', () => {
  61 + this.hideDelBth();
  62 + this.editmodel = !this.editmodel;
  63 + this.updateNavBar();
  64 + });
  65 +
  66 + yoho.store.remove('brandReload');
  67 + document.addEventListener('visibilitychange', () => {
  68 + if (!document.hidden && yoho.store.get('brandReload')) {
  69 + this.reload();
  70 + }
  71 + });
  72 +
  73 + if (yoho.isApp) {
  74 + bus.$on('app.favourite.tabChange', this.updateNavBar);
  75 + }
  76 + },
59 methods: { 77 methods: {
  78 + reload() {
  79 + this.nullbox = 'hide';
  80 + this.busy = false;
  81 + this.editmodel = false;
  82 + this.page = 0;
  83 + this.pageX = 0;
  84 + this.currentX = 0;
  85 + this.pandata = {};
  86 + this.brandData = [];
  87 + this.keys = {};
  88 +
  89 + yoho.store.remove('brandReload');
  90 + },
60 loadMore() { 91 loadMore() {
61 this.busy = true; 92 this.busy = true;
62 $.ajax({ 93 $.ajax({
@@ -225,23 +256,6 @@ @@ -225,23 +256,6 @@
225 header: header 256 header: header
226 }); 257 });
227 } 258 }
228 - },  
229 - created() {  
230 - yoho.addNativeMethod('editModel', () => {  
231 - this.hideDelBth();  
232 - this.editmodel = !this.editmodel;  
233 - this.updateNavBar();  
234 - });  
235 -  
236 - document.addEventListener('visibilitychange', function() {  
237 - if (yoho.isApp && !document.hidden) {  
238 - location.reload();  
239 - }  
240 - });  
241 -  
242 - if (yoho.isApp) {  
243 - bus.$on('app.favourite.tabChange', this.updateNavBar);  
244 - }  
245 } 259 }
246 }; 260 };
247 </script> 261 </script>
@@ -60,7 +60,38 @@ @@ -60,7 +60,38 @@
60 keys: {} 60 keys: {}
61 }; 61 };
62 }, 62 },
  63 + created() {
  64 + yoho.addNativeMethod('editModel', () => {
  65 + this.hideDelBth();
  66 + this.editmodel = !this.editmodel;
  67 + this.updateNavBar();
  68 + });
  69 +
  70 + yoho.store.remove('productReload');
  71 + document.addEventListener('visibilitychange', () => {
  72 + if (!document.hidden && yoho.store.get('productReload')) {
  73 + this.reload();
  74 + }
  75 + });
  76 +
  77 + if (yoho.isApp) {
  78 + bus.$on('app.favourite.tabChange', this.updateNavBar);
  79 + }
  80 + },
63 methods: { 81 methods: {
  82 + reload() {
  83 + this.nullbox = 'hide';
  84 + this.busy = false;
  85 + this.editmodel = false;
  86 + this.page = 0;
  87 + this.pageX = 0;
  88 + this.currentX = 0;
  89 + this.productData = [];
  90 + this.pandata = {};
  91 + this.keys = {};
  92 +
  93 + yoho.store.remove('productReload');
  94 + },
64 loadMore() { 95 loadMore() {
65 this.busy = true; 96 this.busy = true;
66 $.ajax({ 97 $.ajax({
@@ -239,23 +270,6 @@ @@ -239,23 +270,6 @@
239 header: header 270 header: header
240 }); 271 });
241 } 272 }
242 - },  
243 - created() {  
244 - yoho.addNativeMethod('editModel', () => {  
245 - this.hideDelBth();  
246 - this.editmodel = !this.editmodel;  
247 - this.updateNavBar();  
248 - });  
249 -  
250 - document.addEventListener('visibilitychange', function() {  
251 - if (yoho.isApp && !document.hidden) {  
252 - location.reload();  
253 - }  
254 - });  
255 -  
256 - if (yoho.isApp) {  
257 - bus.$on('app.favourite.tabChange', this.updateNavBar);  
258 - }  
259 } 273 }
260 }; 274 };
261 </script> 275 </script>
@@ -90,12 +90,6 @@ @@ -90,12 +90,6 @@
90 interceptClick.intercept('/me/service'); 90 interceptClick.intercept('/me/service');
91 return false; 91 return false;
92 }); 92 });
93 -  
94 - document.addEventListener('visibilitychange', () => {  
95 - if (!document.hidden) {  
96 - this.reload();  
97 - }  
98 - });  
99 }, 93 },
100 methods: { 94 methods: {
101 updateNavBar() { 95 updateNavBar() {
@@ -271,10 +265,20 @@ @@ -271,10 +265,20 @@
271 }); 265 });
272 }, 266 },
273 goBuy(order) { 267 goBuy(order) {
  268 + let orderDesc = [];
  269 + let goods = order.orderGoods || [];
  270 +
  271 + goods.forEach((g) => {
  272 + orderDesc.push(g.productName);
  273 + });
  274 +
274 yoho.goPay({ 275 yoho.goPay({
275 orderid: order.orderCode, 276 orderid: order.orderCode,
276 - amount: order.amount 277 + amount: order.amount,
  278 + orderDesc: orderDesc.join(','),
  279 + type: "orderDetail"
277 }, () => { 280 }, () => {
  281 + this.reload();
278 yoho.store.set('orderReload', true); 282 yoho.store.set('orderReload', true);
279 }); 283 });
280 }, 284 },
@@ -88,10 +88,8 @@ @@ -88,10 +88,8 @@
88 this.getCancelReason(); 88 this.getCancelReason();
89 89
90 document.addEventListener('visibilitychange', () => { 90 document.addEventListener('visibilitychange', () => {
91 - if (!document.hidden) {  
92 - if (yoho.store.get('orderReload')) {  
93 - this.reload();  
94 - } 91 + if (!document.hidden && yoho.store.get('orderReload')) {
  92 + this.reload();
95 } 93 }
96 }); 94 });
97 }, 95 },
@@ -252,11 +250,20 @@ @@ -252,11 +250,20 @@
252 }); 250 });
253 }, 251 },
254 goBuy(order) { 252 goBuy(order) {
  253 + let orderDesc = [];
  254 + let goods = order.orderGoods || [];
  255 +
  256 + goods.forEach((g) => {
  257 + orderDesc.push(g.productName);
  258 + });
  259 +
255 yoho.goPay({ 260 yoho.goPay({
256 orderid: order.orderCode, 261 orderid: order.orderCode,
257 - amount: order.amount 262 + amount: order.amount,
  263 + orderDesc: orderDesc.join(','),
  264 + type: "orderList"
258 }, () => { 265 }, () => {
259 - yoho.store.set('orderReload', true); 266 + this.reload();
260 }); 267 });
261 }, 268 },
262 dropDown(elementId) { 269 dropDown(elementId) {
@@ -467,6 +467,7 @@ @@ -467,6 +467,7 @@
467 if (result.code === 200) { 467 if (result.code === 200) {
468 tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功'); 468 tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功');
469 this.entity.isCollect = this.entity.isCollect === 'Y' ? 'N' : 'Y'; 469 this.entity.isCollect = this.entity.isCollect === 'Y' ? 'N' : 'Y';
  470 + yoho.store.set('productReload', true);
470 } else if (result.code === 403) { 471 } else if (result.code === 403) {
471 // 未登录 472 // 未登录
472 yoho.goLogin('', () => { 473 yoho.goLogin('', () => {
@@ -74,6 +74,7 @@ @@ -74,6 +74,7 @@
74 }).done(result => { 74 }).done(result => {
75 if (result.code === 200) { 75 if (result.code === 200) {
76 this.shareData.isFav = !this.shareData.isFav; 76 this.shareData.isFav = !this.shareData.isFav;
  77 + yoho.store.set('brandReload', true);
77 } else if (result.code === 403) { 78 } else if (result.code === 403) {
78 yoho.goLogin('', this.collectShop); 79 yoho.goLogin('', this.collectShop);
79 } 80 }