Authored by 郭成尧

uid-get

@@ -81,11 +81,10 @@ let _getCoin = function(data) { @@ -81,11 +81,10 @@ let _getCoin = function(data) {
81 let _getCoupon = function(data){ 81 let _getCoupon = function(data){
82 data.app = utils.queryString(); 82 data.app = utils.queryString();
83 83
84 - data.app.uid = cookies.cookie('app_uid') || data.app.uid;  
85 - data.app.app_version = cookies.cookie('app_version') || data.app.app_version;  
86 - data.app.client_type = cookies.cookie('app_client_type') || data.app.client_type;  
87 - data.app.session_key = cookies.cookie('app_session_key') || data.app.session_key;  
88 - 84 + data.app.uid = data.app.uid || cookies.cookie('app_uid');
  85 + data.app.app_version = data.app.app_version || cookies.cookie('app_version');
  86 + data.app.client_type = data.app.client_type ||cookies.cookie('app_client_type');
  87 + data.app.session_key = data.app.session_key || cookies.cookie('app_session_key');
89 88
90 jsonp({ 89 jsonp({
91 url: '//m.yohobuy.com/activity/feature/couponSend?callback=?', 90 url: '//m.yohobuy.com/activity/feature/couponSend?callback=?',
@@ -142,7 +141,7 @@ let _initCoin = function(uid){ @@ -142,7 +141,7 @@ let _initCoin = function(uid){
142 } else { 141 } else {
143 cookies.setCookie('yoho-coin-token', token); 142 cookies.setCookie('yoho-coin-token', token);
144 143
145 - if (window.__wxjs_environment === 'miniprogram' && wx && wx.miniProgram) { 144 + if (window.__wxjs_environment === 'miniprogram' && typeof wx !== 'undefined' && wx.miniProgram) {
146 wx.miniProgram.navigateTo({ 145 wx.miniProgram.navigateTo({
147 url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}` 146 url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}`
148 }); 147 });
@@ -181,7 +180,7 @@ let _initCoupon = function(uid) { @@ -181,7 +180,7 @@ let _initCoupon = function(uid) {
181 } else { 180 } else {
182 cookies.setCookie('yoho-conpon-token', token); 181 cookies.setCookie('yoho-conpon-token', token);
183 182
184 - if (window.__wxjs_environment === 'miniprogram' && wx && wx.miniProgram) { 183 + if (window.__wxjs_environment === 'miniprogram' && typeof wx !== 'undefined' && wx.miniProgram) {
185 wx.miniProgram.navigateTo({ 184 wx.miniProgram.navigateTo({
186 url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}` 185 url: `../bindPhoneNumber/bindPhoneNumber?h5back=${location.href}`
187 }); 186 });