点击收藏未登录弹出登录框

This commit is contained in:
pushuo 2022-08-30 17:21:02 +08:00
parent 7559b57bc8
commit 62cde1dbf2
2 changed files with 32 additions and 18 deletions

View File

@ -2132,15 +2132,7 @@ __webpack_require__.r(__webpack_exports__);
isBuyNow = _ref$isBuyNow === void 0 ? false : _ref$isBuyNow;
if (!isLogin) {
layer.open({
type: 2,
title: '',
shadeClose: true,
shade: 0.8,
area: ['900px', '600px'],
content: 'login?iframe=true' //iframe的url
});
this.openLogin();
return;
}
@ -2167,6 +2159,11 @@ __webpack_require__.r(__webpack_exports__);
});
},
addWishlist: function addWishlist(id, event) {
if (!isLogin) {
this.openLogin();
return;
}
var $btn = $(event);
var btnHtml = $btn.html();
var isWishlist = $btn.attr('data-in-wishlist') * 1;
@ -2239,6 +2236,16 @@ __webpack_require__.r(__webpack_exports__);
}
});
});
},
openLogin: function openLogin() {
layer.open({
type: 2,
title: '',
shadeClose: true,
area: ['900px', '600px'],
content: 'login?iframe=true' //iframe的url
});
}
});

View File

@ -30,15 +30,7 @@ export default {
*/
addCart({sku_id, quantity = 1, isBuyNow = false}, event) {
if (!isLogin) {
layer.open({
type: 2,
title: '',
shadeClose: true,
shade: 0.8,
area: ['900px', '600px'],
content: 'login?iframe=true' //iframe的url
});
this.openLogin()
return;
}
@ -57,6 +49,11 @@ export default {
},
addWishlist(id, event) {
if (!isLogin) {
this.openLogin()
return;
}
const $btn = $(event);
const btnHtml = $btn.html();
const isWishlist = $btn.attr('data-in-wishlist') * 1;
@ -113,5 +110,15 @@ export default {
}
})
})
},
openLogin() {
layer.open({
type: 2,
title: '',
shadeClose: true,
area: ['900px', '600px'],
content: 'login?iframe=true' //iframe的url
});
}
}