;(function ($) { $("#Main_Form").fromsAuth({ type:'NONE', callprev:function(e){ $('#Gift').val($('.gift-style').find('.in-active').attr('sid')); } }); $('.gift-style').on('click', '.gift-style-item', function (e) { const itemValue = $(this).children('.gift-style-link').data('value'); $(this). addClass('in-active'). siblings('.gift-style-item'). removeClass('in-active'). parents('.modal-item'). find('.modal-item-content'). text(itemValue); }); $('.stored-list').on('click', '.stored-list-item', function (e) { var _this = $(this), storeid = _this.attr('storeid'); $('#Stored_Money_Value').html(_this.find('.Deposit_Value').html()); $('#Stored_ID').val(storeid); $.ajax({ type: "POST", url: "/ajax/ajax_get_deposit_gift.php", data: {storeid:storeid}, async: false, dataType: 'json', success: function(d) { if(d.status == 'ok') { $(".Gift_Group").show(); $(".gift-style").html(d.prod); $(".spec1_name").html(d.spec_title); $('body').addClass('theme-block'); } else if(d.status == 'no_gift') { $(".Gift_Group").hide(); $('body').addClass('theme-block'); }else if(d.status == 'no_Pos_Member'){ alert(_jsLang.學姊不可購買該專案); return false; } else { alert(_jsLang.請先登入會員); window.location.href = '/member-login'; return false; } } }); }); $("#Main_Form").on('change',".City",function(){ $(this).next(".Area").load('/ajax/ajax_country.php',{type:'area',id:$(this).val()}); }); //關閉跳窗 $('.modal-layer').on('click', function (e) { if (e.currentTarget === e.target || e.target === $('.modal-closer')[0]) { $('body').removeClass('theme-block'); } }); })($);