Authored by 毕凯

Merge branch 'hotfix/free-mail' into 'master'

Hotfix/free mail



See merge request !837
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "6.0.4", 3 + "version": "6.0.5",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
1 'use strict'; 1 'use strict';
2 const yoho = require('yoho-app'); 2 const yoho = require('yoho-app');
3 3
  4 +let tip = require('plugin/tip');
  5 +
4 import { 6 import {
5 Controller 7 Controller
6 } from 'yoho-mvc'; 8 } from 'yoho-mvc';
@@ -25,13 +27,7 @@ class FreeMailIndexController extends Controller { @@ -25,13 +27,7 @@ class FreeMailIndexController extends Controller {
25 this.freeMailModel.receiveVerify().then(result => { 27 this.freeMailModel.receiveVerify().then(result => {
26 if (result.code === 200) { 28 if (result.code === 200) {
27 if (yoho.isApp) { 29 if (yoho.isApp) {
28 - yoho.goH5('http://m.yohobuy.com/activity/free-mail/list', JSON.stringify({  
29 - action: 'go.h5',  
30 - params: {  
31 - islogin: 'N',  
32 - url: 'http://m.yohobuy.com/activity/free-mail/list'  
33 - }  
34 - })); 30 + yoho.goH5(location.protocol + '//m.yohobuy.com/activity/free-mail/list');
35 } else { 31 } else {
36 location.href = '//m.yohobuy.com/activity/free-mail/list'; 32 location.href = '//m.yohobuy.com/activity/free-mail/list';
37 } 33 }
@@ -47,6 +43,8 @@ class FreeMailIndexController extends Controller { @@ -47,6 +43,8 @@ class FreeMailIndexController extends Controller {
47 } 43 }
48 44
49 this.receiveView.popHide(); 45 this.receiveView.popHide();
  46 + }).catch(() => {
  47 + tip.show('服务异常,请稍后重试');
50 }); 48 });
51 } 49 }
52 } 50 }
@@ -11,7 +11,7 @@ class FreeMail { @@ -11,7 +11,7 @@ class FreeMail {
11 receiveVerify() { 11 receiveVerify() {
12 return http({ 12 return http({
13 type: 'GET', 13 type: 'GET',
14 - url: '/activity/free-mail/verify' 14 + url: location.protocol + '//m.yohobuy.com/activity/free-mail/verify'
15 }); 15 });
16 } 16 }
17 } 17 }
@@ -30,13 +30,7 @@ class FreeMailIndexController extends Controller { @@ -30,13 +30,7 @@ class FreeMailIndexController extends Controller {
30 30
31 setTimeout(function() { 31 setTimeout(function() {
32 if (yoho.isApp) { 32 if (yoho.isApp) {
33 - yoho.goH5('http://m.yohobuy.com/home/coupons', JSON.stringify({  
34 - action: 'go.coupon',  
35 - params: {  
36 - islogin: 'N',  
37 - url: 'http://m.yohobuy.com/home/coupons'  
38 - }  
39 - })); 33 + yoho.goH5(location.protocol + '//m.yohobuy.com/home/coupons');
40 } else { 34 } else {
41 location.href = '//m.yohobuy.com/home/coupons'; 35 location.href = '//m.yohobuy.com/home/coupons';
42 } 36 }
@@ -44,6 +38,8 @@ class FreeMailIndexController extends Controller { @@ -44,6 +38,8 @@ class FreeMailIndexController extends Controller {
44 } else { 38 } else {
45 tip.show(result.message); 39 tip.show(result.message);
46 } 40 }
  41 + }).catch(() => {
  42 + tip.show('服务异常,请稍后重试');
47 }); 43 });
48 } 44 }
49 } 45 }
@@ -11,7 +11,7 @@ class FreeMailList { @@ -11,7 +11,7 @@ class FreeMailList {
11 receiveCoupon() { 11 receiveCoupon() {
12 return http({ 12 return http({
13 type: 'GET', 13 type: 'GET',
14 - url: '/activity/free-mail/verifyCoupon' 14 + url: location.protocol + '//m.yohobuy.com/activity/free-mail/verifyCoupon'
15 }); 15 });
16 } 16 }
17 } 17 }