Authored by 肖亚东

进详情页需要先登录(主要是分享时打开)

... ... @@ -162,6 +162,12 @@ Page(Object.assign({
appParameter
});
let userInfo = app.getUserInfo();
if (!userInfo.wechat || !this.getUserWechatId()) {
this.goLogin({'login': '0', 'type': 'redirectTo'});
return;
}
yas = new Yas(app); // 实例化埋点
this.initActionSheet();
... ... @@ -546,7 +552,7 @@ Page(Object.assign({
let userInfo = app.getUserInfo();
if (!userInfo.wechat || !this.getUserWechatId()) {
this.goLogin(0);
this.goLogin({'login': '0'});
return;
}
... ... @@ -609,7 +615,7 @@ Page(Object.assign({
let userInfo = app.getUserInfo();
if (!userInfo.wechat || !this.getUserWechatId()) {
this.goLogin(0);
this.goLogin({'login': '0'});
return;
}
... ... @@ -771,7 +777,9 @@ Page(Object.assign({
})
},
goLogin(login = 1) {
goLogin(params) {
let login = parseInt(params['login']) || 1;
let type = params['type'] || 'navigateTo';
let data = {};
if (this.data.originUid) {
... ... @@ -788,7 +796,8 @@ Page(Object.assign({
router.go('userCenter', {
referer: `/pages/product/detail/detail?${decodeURIComponent(stringify(data))}`,
login
});
},
type);
},
onPullDownRefresh: function() {
this.setData({
... ...