に存在しないポップアップ:私は以下のコードを使用していますカートに製品を追加すると、製品がカート
addproduct(itemId) {
this.showLoading = true
this.$http.post('/shampoo', {'item': itemId}).then((response) => {
swal({
title: "Success!",
text: "Product added to your basket!",
type: "success",
timer: 1500,
showConfirmButton: false
})
this.showLoading = false
}, (response) => {
this.showLoading = false
})
ノー製品のために、彼ら後、カートにあったポップアップフォームを作成しました買い物カゴに追加ボタンをクリックすると、商品がカートに置かれた後、別の商品を追加してポップアップを表示する必要がある場合はポップアップ表示されます。商品がカートに入っていればポップアップが欲しくない。
ここにポップアップフォームのコードがあります。 show(){ this.showLoading = true;あなたがカートに追加]をクリックすると
$(".loading").css('display', 'block');
$('#products').modal("hide");
//
let code = $('input[name=code]').val();
if(code) {
this.$http.post('/codee', { code: code}).then((response) => {
// $('#basic-form').submit();
}, (response) => {
swal({
title: "Error!",
text: "Sorry this Code is invalid!",
type: "error",
timer: 2500,
showConfirmButton: false
})
$(".loading").css('display', 'none');
this.showLoading = false
$('input[name=code]').val('')
})