Authored by 郭成尧

baseUrl

... ... @@ -8,12 +8,18 @@ import user from './user';
import cookies from './cookies';
import jsonp from './jsonp';
let baseUrl = '//activity.yoho.cn';
if (location.hostname === 'm.yohobuy.com') {
baseUrl = '//m.yohobuy.com/activity';
}
let _getCoin = function(data) {
data.app = utils.queryString();
data.app.uid = data.uid;
jsonp({
url: '//m.yohobuy.com/activity/coin/sendCoin?callback=?',
url: `${baseUrl}/coin/sendCoin?callback=?`,
data: data
}).then(function(res) {
if (res.code === 200 && res.data) {
... ... @@ -88,7 +94,7 @@ let _getCoupon = function(data){
jsonp({
url: '//m.yohobuy.com/activity/feature/couponSend?callback=?',
url: `${baseUrl}/feature/couponSend?callback=?`,
data: data
}).then(function(res) {
if (res.code === 200) {
... ... @@ -144,7 +150,7 @@ let _initCoin = function(uid){
if (window.__wxjs_environment === 'miniprogram' && wx && wx.miniProgram) {
wx.miniProgram.navigateTo({
url: `/pages/userCenter/userCenter?h5back=${location.href}`
url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}`
});
return;
}
... ... @@ -182,8 +188,8 @@ let _initCoupon = function(uid) {
cookies.setCookie('yoho-conpon-token', token);
if (window.__wxjs_environment === 'miniprogram' && wx && wx.miniProgram) {
wx.miniProgram.switchTab({
url: `/pages/userCenter/userCenter?h5back=${location.href}`
wx.miniProgram.navigateTo({
url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}`
});
return;
}
... ...