Authored by 李犇

个人中心点击跳转增加登陆判断,并在登陆成功后,直接跳转到目标页面——review by 陈林

@@ -154,9 +154,9 @@ class MineContainer extends Component { @@ -154,9 +154,9 @@ class MineContainer extends Component {
154 NativeModules.YH_CommonHelper.logEvent('YB_MY_STU_IDENTIFY', params); 154 NativeModules.YH_CommonHelper.logEvent('YB_MY_STU_IDENTIFY', params);
155 break; 155 break;
156 case 'mineLogin': 156 case 'mineLogin':
  157 + //登陆,直接return了,不需要再去调用跳转规则
157 ReactNative.NativeModules.YH_CommonHelper.login(); 158 ReactNative.NativeModules.YH_CommonHelper.login();
158 - //登陆  
159 - break; 159 + return;
160 case 'mineFavProduct': 160 case 'mineFavProduct':
161 url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.fav","params":{}}`; 161 url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.fav","params":{}}`;
162 NativeModules.YH_CommonHelper.logEvent('YB_MY_FAVPRD', {}); 162 NativeModules.YH_CommonHelper.logEvent('YB_MY_FAVPRD', {});
@@ -261,7 +261,25 @@ class MineContainer extends Component { @@ -261,7 +261,25 @@ class MineContainer extends Component {
261 default: 261 default:
262 break; 262 break;
263 } 263 }
264 - ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url); 264 + // 去设置界面不需要判断登陆
  265 + if (viewId === 'mineSetting') {
  266 + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  267 + }
  268 + else {
  269 + ReactNative.NativeModules.YH_CommonHelper.uid()
  270 + .then(data => {
  271 + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  272 + })
  273 + .catch(error => {
  274 + ReactNative.NativeModules.YH_CommonHelper.login()
  275 + .then(uid => {
  276 + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  277 + })
  278 + .catch(error => {
  279 +
  280 + });
  281 + });
  282 + }
265 } 283 }
266 284
267 _onPressProductListProduct(product, rowId = 0) { 285 _onPressProductListProduct(product, rowId = 0) {