infrunami | perthchimon: ฟิค Boy Love (แชท) (2024)

infrunami | perthchimon: ฟิค Boy Love (แชท) (1)

ใช้แล้ว 1 PASS

ปิด

อ่านเลย

"); loadContent(); } }).fail(function(){ window.location.href = WEB_URL_HTTPS + "c/"; }); } } } }); } function popupFlexiblePricing(product_guid, product_type) { var description = 'คุณสามารถให้กำลังใจนักเขียนได้เป็นกรณีพิเศษ
โดยให้ Tip เพิ่มจากราคาปกติ'; var html = ''; buy_chapter_guid = product_guid; $.ajax({ method: 'POST', url: "?action=ajax&ajax=1&ajax_case=CallWrapper", data: { api_call: 'Article', method_call: 'userGetChapterInfo', chapter_guid: product_guid, get_price_data: 1, }, dataType: "json", beforeSend: function () { } }).done(function (data) { // flexible price if (data.status.success && data.data.flexible_pricing_enable == 1) { var order_price = data.data.baht_price; if(data.data.flexible_pricing_description != '' && data.data.flexible_pricing_description != null) { description = data.data.flexible_pricing_description; } html = `

เรื่อง ${data.data.article_name}
${data.data.chapter_title} ${data.data.chapter_subtitle}

${description}

ผลงานตอนนี้มีราคาเริ่มต้นที่ ${parseInt(order_price)} คอยน์

${parseInt(order_price)} คอยน์

${parseInt(order_price)*3} คอยน์

${parseInt(order_price)*5} คอยน์

กำหนดเอง

infrunami | perthchimon: ฟิค Boy Love (แชท) (2) ชำระเลย ${parseInt(order_price)} คอยน์

`; let swal_prop = { width: 300 }; let swal_title = 'ซื้อตอน'; // articleH.jPopup('', html); articleH.jPopup(swal_title, html, null, swal_prop); listRestrictChapter($('#restr-flexible')); $('.descriptionFlexiblePriceChapter').parents('.swal2-modal').addClass('fixWidth300'); $('input[name=flexible_price]').change(function(){ var select_price = $('input[name=flexible_price]:checked').val(); var flexible_price = $('#flexible_price').val(); if(select_price == 'custom') { if(!$('.input_flexible_price').is(':visible')){ $('.input_flexible_price').show(); $('.boxTxtCustomPrice').hide() } $('#flexible_price').focus(); $('#flexible_price_active').text(flexible_price); } else { if(flexible_price == ''){ $('.input_flexible_price').hide(); $('.boxTxtCustomPrice').show(); } $('#flexible_price_active').text(select_price); } }); $('#btn_flexible_price').click(function(){ var select_price = $('input[name=flexible_price]:checked').val(); var flexible_price = $('#flexible_price').val(); swal.close(); if(select_price == 'custom') { if(parseFloat(flexible_price) < order_price || parseFloat(flexible_price) <= 0) { articleH.jAlert('', 'ไม่สามารถกรอกจำนวนเงินน้อยกว่าราคา '+parseInt(order_price)+' คอยน์
กรุณาเปลี่ยนราคา', function(){ popupFlexiblePricing(product_guid, product_type); }, 'warning'); return false; } setParamModal(product_guid, product_type, parseFloat(flexible_price)); } else { setParamModal(product_guid, product_type, parseFloat(select_price)); } displayModalPayViaMebcoin(); }); } else { setParamModal(product_guid, product_type); displayModalPayViaMebcoin(); } }).fail(function (xhr, textStatus, errorThrown) { console.error(xhr.responseText, textStatus, errorThrown); articleH.jAlert('', 'ขออภัยจ้า เกิดข้อผิดพลาดไม่สามารถซื้อตอนได้', '', 'error'); return false; }); } function isNumberKey(field){ var charCode = event.keyCode if((charCode > 31 && (charCode != 46 &&(charCode < 48 || charCode > 57))) || ((field.value).match(/\./) && charCode == 46)) { return false; } else { // isNumberInput(field); if((field.value).match(/\.[0-9]{2}/)) { return false; } else if((field.value).match(/[0-9]{4}/)) { if((field.value).match(/[0-9]{4}\.[0-9]{0,1}/)) { return true; } else if(charCode >= 48 && charCode <= 57) { return false; } } else { return true; } } } function startPayViaMebcoin(product_guid, product_type, flexible_pricing_enable, is_passable_chapter) { var user_token = CookiesJS.getCookie('user_token'); if (user_token) { var is_activate_coin_user = CookiesJS.getCookie('is_activate_coin_user'); // if(is_activate_coin_user != 1) // { // var html = ''; // html += '

ยังไม่ได้ลงทะเบียนเมพคอยน์เลย ไปลงทะเบียนก่อนนะจ๊ะ

'; // // html += '

'; // html += ''; // html += '' // html += ''; // html += '' // html += '

'; // // articleH.jPopupWidth('', html); // // $('#regis_mebcoin').click(function(){ // Header.submitFormByElementId('form-submit-to-coin'); // articleH.jUnblockUI(); // }); // // return false; // } // flexible price if(flexible_pricing_enable == 1) { popupFlexiblePricing(product_guid, product_type); } // normal price else { // buy chapter getRestrictChapter(function(data){ if(!data.status.success) { setParamModal(product_guid, product_type); displayModalPayViaMebcoin(); } else { /* const html = `

`; articleH.jPopup('', html); const container_element = $('#restr-static') renderRestrictChapter(data.data.restrict_chapter_list, container_element, function(){ container_element.show(); }) //*/ if(typeof(current_view) != "undefined") { $('#modal-buy-all').modal('hide'); setParamModal(product_guid, product_type); displayModalPayViaMebcoin(); } else { buyAllChapter(article_name, [chapter_pay_arr[product_guid]], product_type, is_passable_chapter); } } }) } } else { //Login.ShowLogin(); Login.showFormLoginAndRegister('login'); } } function buyIgnoreResctrictChapter(product_guid, product_type){ swal.close(); setParamModal(product_guid, product_type); displayModalPayViaMebcoin(); } function startDonateViaMebcoin(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message, article_name, chapter_name) { var user_token = CookiesJS.getCookie('user_token'); if (user_token) { var is_activate_coin_user = CookiesJS.getCookie('is_activate_coin_user'); // if(is_activate_coin_user != 1) // { // Header.submitFormByElementId('form-submit-to-coin'); // return false; // } if(user_id_publisher == '' && article_guid == '' && chapter_guid == '') { articleH.jAlert('', 'ขออภัยจ้า ไม่พบรายการผู้รับ Donate ที่ท่านต้องการ Donate ในระบบ', '', 'error'); return false; } // showPopupConfirmDonateNewFlow(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message, article_name, chapter_name); setParamDonateModal(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message); displayModalPayViaMebcoin(); } else { //Login.ShowLogin(); Login.showFormLoginAndRegister('login'); } } function showPopupConfirmDonateNewFlow(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message, article_name, chapter_name){ const modal_name = `modal_confirm_donate`; const html_title = 'โดเนท'; let txt_description_donate = ''; if(typeof article_name != 'undefined' && !jMeb.empty(article_name)){ txt_description_donate += 'เรื่อง ' + article_name + ' '; } if(typeof chapter_name != 'undefined' && !jMeb.empty(chapter_name)){ txt_description_donate += 'ตอน ' + chapter_name; } let html_body = `

${txt_description_donate}

infrunami | perthchimon: ฟิค Boy Love (แชท) (3) ชำระเลย ${parseInt(order_amount)} คอยน์

`; const html_footer = ``; let modal_prop = { "modal":{ "addClass":"", "style":"" }, "modal_dialog":{ "addClass":"container", "style":"max-width:300px;margin: 20vh auto;" }, "modal_content":{ "addClass":"relativePos", "style":"" }, "modal_header":{ "addClass":"text-center", "style":"" }, "modal_body":{ "addClass":"paddingTop20 paddingBottom10 paddingLeftRight10", "style":"" }, "modal_footer":{ "addClass":"hide", "style":"" }, "closeButton":{ "show":true, "onClickProp":`` }, "fadeBottom":{ "addClass":"notShowOnDesktop", "style":"" }, } if($(`#${modal_name}`).get(0)){ $(`#${modal_name}`).remove(); } articleH.createModal(modal_name, modal_prop); articleH.settingModal(modal_name, html_title, html_body, html_footer); articleH.renderModal(modal_name,{backdrop: 'static', show: true}); $('#btnComfirmDonate').click(function(){ $('#' + modal_name).modal('hide'); setParamDonateModal(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message); displayModalPayViaMebcoin(); }); } // function submitFormByElementId(element_id) // { // console.log('submit') // $('#' + element_id).submit(); // } function setParamModal(product_guid, product_type, flexible_baht_price) { product_guid = (Array.isArray(product_guid) && product_guid.length === 1) ? product_guid[0]['chapter_guid'] : product_guid; //console.log(product_guid, product_type, flexible_baht_price); var html = ''; html += '

'; //html += '

ดูวิธีซื้อตอนที่ติดเหรียญที่นี่เลยจ้า

'; $('#modal_body_pay_via_mebcoin').html('

infrunami | perthchimon: ฟิค Boy Love (แชท) (4)

'); $('#modal_body_pay_via_mebcoin').append(html); if(Array.isArray(product_guid)) { $('#form_buy_all').submit(); } } function setParamDonateModal(user_id_publisher, article_guid, chapter_guid, product_type, order_amount, is_show_donator, donate_item_id, donor_message) { var html = ''; html += '

'; html += '

ดูวิธีซื้อตอนที่ติดเหรียญที่นี่เลยจ้า

'; $('#modal_body_pay_via_mebcoin').html('

infrunami | perthchimon: ฟิค Boy Love (แชท) (5)

'); $('#modal_body_pay_via_mebcoin').append(html); } function displayModalPayViaMebcoin() { if(!check_loaded_modal) { setCloseModalPayViaMebcoin(); check_loaded_modal = true; } if(navigator.userAgent.match(/iPhone|iPad|iPod/i) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) { $('#popup_pay_via_mebcoin').on('show.bs.modal', function() { $(this) .css({ position: 'absolute', marginTop: ($(window).scrollTop()-$('#headerMenuMobile').height()) + 'px', bottom: 'auto' }); setTimeout( function() { $('.modal-backdrop').css({ position: 'absolute', top: 0, left: 0, width: '100%', height: Math.max( document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight ) + 'px' }); }, 0); }).modal('show'); } else { $('#popup_pay_via_mebcoin').modal({backdrop: 'static',show: true}); if(!$('#popup_pay_via_mebcoin').find('.modal-dialog').hasClass('boxTrans')){ $('#popup_pay_via_mebcoin').find('.modal-dialog').addClass('boxTrans'); $('#popup_pay_via_mebcoin').find('.modal-body').addClass('boxTrans'); } } } function clickChapterTr(guid){ const is_check = $('#check_chapter_' + guid ).is(':checked'); $('#check_chapter_' + guid ).prop('checked', !is_check) toggleSelectChapter(guid) } let select_chapter = {} function toggleSelectChapter(chap_guid){ //console.log('toggleSelectChapter ' + chap_guid) //console.log(select_chapter) if(chap_guid){ if($('#check_chapter_' + chap_guid ).is(':checked')) { select_chapter[chap_guid].selected = true; } else { select_chapter[chap_guid].selected = false; } } else{ $('.check_chapter').each(function(){ const __guid = $(this).attr('id').replace('check_chapter_', '') if(select_chapter[__guid] != undefined){ if($(this).is(':checked')) { select_chapter[__guid].selected = true; } else { select_chapter[__guid].selected = false; } } }) } let selected_all = true; let ttl_chap = 0; let sum = 0; let prod_guid_val = ''; for(var guid in select_chapter) { ttl_chap += select_chapter[guid].selected? 1 : 0; sum += select_chapter[guid].selected? parseFloat(select_chapter[guid].price) : 0; prod_guid_val += prod_guid_val&&select_chapter[guid].selected? ',' : ''; prod_guid_val += select_chapter[guid].selected? guid : ''; selected_all = select_chapter[guid].selected && selected_all } $('#product_guid').val(prod_guid_val); $('#total_price').html(sum); $('#ttl_chap').html(ttl_chap); if(sum <= 0) { $('#btnComfirmBuyAll').attr('disabled', true) } else{ $('#btnComfirmBuyAll').attr('disabled', false) } if(selected_all){ $('#check_all').prop('checked', true) } else{ $('#check_all').prop('checked', false) } } function toggleSelectAllChapter(){ if($('#check_all').is(':checked')){ $('.check_chapter').prop('checked', true) } else{ $('.check_chapter').prop('checked', false) } toggleSelectChapter('') } function buyAllChapter(article_name, product_guid_list, product_type, is_passable_chapter) { var user_token = CookiesJS.getCookie('user_token'); let more_than_1_chap = 0; for(var i in product_guid_list) { more_than_1_chap++; if(more_than_1_chap > 1) break; } if (user_token) { var is_activate_coin_user = CookiesJS.getCookie('is_activate_coin_user'); // if(is_activate_coin_user != 1) // { // var html = ''; // html += '

ยังไม่ได้ลงทะเบียนเมพคอยน์เลย ไปลงทะเบียนก่อนนะจ๊ะ

'; // // html += '

'; // html += ''; // html += '' // html += ''; // html += '' // html += '

'; // // articleH.jPopupWidth('', html); // // $('#regis_mebcoin').click(function(){ // Header.submitFormByElementId('form-submit-to-coin'); // articleH.jUnblockUI(); // }); // // return false; // } var header = ''; var item_buy = ''; var button_buy = ''; var total_baht_price = 0; const h_text = more_than_1_chap > 1? 'คุณต้องการซื้อทุกตอนของเรื่อง '+article_name+' โดยจะได้รับตอนต่อไปนี้': 'ซื้อตอน'; if(more_than_1_chap > 1) { header += ''; header += '

'; header += ''+h_text+''; header += '

'; header += '

(รายการเหล่านี้ไม่รวมถึงตอนที่คุณเคยซื้อไปแล้ว)

'; item_buy += '

'; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; let total_chap = 0; select_chapter = {} for(var i in product_guid_list) { var chapter_title_name = product_guid_list[i]['chapter_title'] + ' ' + product_guid_list[i]['chapter_subtitle']; var baht_price = parseFloat(product_guid_list[i]['baht_price']); var chapter_order = product_guid_list[i]['chapter_order']; var chapter_guid = product_guid_list[i]['chapter_guid']; select_chapter[chapter_guid] = {price:baht_price, selected: true}; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; item_buy += ''; total_baht_price += baht_price; total_chap++; } item_buy += ''; item_buy += '
ลำดับชื่อตอนราคา
'+chapter_order+''+chapter_title_name+'

infrunami | perthchimon: ฟิค Boy Love (แชท) (6) '+baht_price+ '

'; button_buy += '

'; button_buy += ''; button_buy += ' ซื้อทุกตอน'; button_buy += '

'; button_buy += ''; $('#modal-buy-all').find('.modal-footer').show(); $('#modal-buy-all').find('div[class=modal-dialog]').css('max-width', '800px'); $('#modal-buy-all').find('div[class=modal-dialog]').css('margin', ''); } else { const { baht_price, chapter_guid, chapter_order, chapter_title, chapter_subtitle } = product_guid_list[0]; header = `

${h_text}

`; let html_pass_button = ''; if(is_passable_chapter) { const readable_end_hours_json = storage.getStorage('readable_end_hours'); buy_chapter_guid = product_guid_list[0]['chapter_guid']; let readable_end_hours_list = {}; if(readable_end_hours_json) { readable_end_hours_list = jQuery.parseJSON(readable_end_hours_json); } let readable_end_text = ''; if(readable_end_hours_list[article_guid] && !isNaN(readable_end_hours_list[article_guid])) { let readable_end_hours = parseInt(readable_end_hours_list[article_guid]); if(readable_end_hours >= 24) { let readable_end_day = Math.ceil(readable_end_hours/24); readable_end_text = `ใช้ 1 PASS อ่านฟรีได้ ${readable_end_day} วัน`; } else { readable_end_text = `ใช้ 1 PASS อ่านฟรีได้ ${readable_end_hours} ชั่วโมง`; } } else { readable_end_text = 'ใช้ 1 PASS เพื่ออ่าน'; } html_pass_button = `

${readable_end_text}

` } else { buy_chapter_guid = product_guid_list[0]['chapter_guid']; } item_buy = `

เรื่อง ${article_name}
${chapter_title} ${chapter_subtitle}

${html_pass_button}

infrunami | perthchimon: ฟิค Boy Love (แชท) (7) ชำระเลย ${parseInt(baht_price)} คอยน์

`; button_buy = ``; $('#modal-buy-all').find('.modal-footer').hide(); $('#modal-buy-all').find('div[class=modal-dialog]').css('max-width', '300px'); $('#modal-buy-all').find('div[class=modal-dialog]').css('margin', '20vh auto'); } listRestrictChapter($('#modal-restrict-chapter-all')); // buy all if(Array.isArray(product_guid_list)) { toggleSelectChapter(); $('#modal-header-buy-all').html(header); $('#modal-body-buy-all').html(item_buy); $('#modal-buy-all').find('.modal-footer').html(button_buy); $('#btnComfirmBuyAll').click(function(){ $('#modal-buy-all').modal('hide'); setParamModal(product_guid_list, product_type); displayModalPayViaMebcoin(); }); if(navigator.userAgent.match(/iPhone|iPad|iPod/i) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) { $('#modal-buy-all').on('show.bs.modal', function() { $(this) .css({ position: 'absolute', marginTop: ($(window).scrollTop()-$('#headerMenuMobile').height()) + 'px', bottom: 'auto' }); setTimeout( function() { $('.modal-backdrop').css({ position: 'absolute', top: 0, left: 0, width: '100%', height: Math.max( document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight ) + 'px' }); }, 0); }).modal('show'); } else { $('#modal-buy-all').modal({backdrop: "static",show: true}); } if((navigator.userAgent.match(/iPhone|iPod|Android|webOS|BlackBerry|IEMobile|Opera Mini/i) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)) && $(window).height() < 768) { $('#modal-buy-all').find('.modal-body').css({ maxHeight: '50vh' }); } } // buy chapter else { setParamModal(product_guid_list, product_type); displayModalPayViaMebcoin(); } } else { //Login.ShowLogin(); Login.showFormLoginAndRegister('login'); } } function listRestrictChapter(container_element){ getRestrictChapter(function(data){ if (!data.status.success) { console.error(data.status) container_element.hide(); } else{ if(data.data.restrict_chapter_list.length > 0){ renderRestrictChapter(data.data.restrict_chapter_list, container_element, function(){ container_element.show(); }) } } }) } function renderRestrictChapter(restrict_chapter_arr, container_element, cb){ cb = cb || function(){} var chap_html = ''; chap_html += '

'; chap_html += ''; chap_html += ''; chap_html += ''; chap_html += ``; chap_html += ''; chap_html += ''; chap_html += ''; chap_html += '
เรื่องนี้มีบางตอนที่ปิดเนื้อหาและเข้าอ่านไม่ได้จ้าดูตอนที่ปิด

'; container_element.html(chap_html) cb(); } let global_restrict_chapter_list = {}; function getRestrictChapter(cb){ if(global_restrict_chapter_list[article_guid]) { cb(global_restrict_chapter_list[article_guid]) return; } $.ajax({ method: 'POST', url: "?action=ajax&ajax=1&ajax_case=CallWrapper", data: { api_call: 'Article', method_call : 'userGetRestrictChapter', token: CookiesJS.getCookie('user_token'), article_guid: article_guid, app_id: DEFAULT_APP_ID, app_platform: APP_PLATFORM, device_id: CookiesJS.getCookie('device_id') }, dataType: "json" }).done(function(data){ global_restrict_chapter_list[article_guid] = data if(data.status.code === 3 && data.status.message === "Article_userGetRestrictChapter_NotFoundRestrictChapter"){ global_restrict_chapter_list[article_guid].data = {restrict_chapter_list:[]} data.status.success = true; } cb(data); }).fail(function(){ cb({ status: { success: false, message: 'Unable to connect to server!' } }); }); } function toggleRestrictChapterList(element) { if($(element).attr('show') == 1) { $('.item-restr').hide(); $('.toggle_restr_btn').html('ดูตอนที่ปิด') $(element).attr('show', '0') } else{ $('.item-restr').show(); $('.toggle_restr_btn').html('ปิด') $(element).attr('show', '1') } } function unlockChapterByPass(chapter_guid) { PassH.unlockChapterByPass(chapter_guid, unlockChapterByPassSuccess); } function unlockChapterByPassSuccess(code) { $('#modal-buy-all').modal('hide'); $('#modal-pass-unlock').modal('toggle'); $('#modal-pass-unlock-body').hide(); $('#modal-pass-unlock-success').hide(); if(code == 0) { MyPurchaseChapterObj.processMyPurchaseChapter(); $('#modal-pass-unlock-success').show(); $('#modal-pass-unlock-body').html(''); } else if(code == 10) { MyPurchaseChapterObj.processMyPurchaseChapter(); $('#modal-pass-unlock-body').show(); $('#modal-pass-unlock-body').html('ตอนถูกปลดล็อคแล้ว'); } else if(code == 11) { MyPurchaseChapterObj.processMyPurchaseChapter(); $('#modal-pass-unlock-body').show(); $('#modal-pass-unlock-body').html('ไม่อนุญาตให้ใช้ PASS กับตอนนี้'); } else { $('#modal-pass-unlock-body').show(); $('#modal-pass-unlock-body').html('ไม่มี PASS ที่สามารถใช้ได้'); } } function closePayModal(modal_name) { $('#'+modal_name).modal('hide'); } function readPurchaseChapter() { window.location.href = SITE_URL_HTTPS + 'c/' + buy_chapter_guid; } function setHeightModal(height = '275') { $('#iframe_sell').css('max-height', `${height}px`); }

ธีมสี

ชื่อในเนื้อหา : y/n

สถานะ : ตัวละครหลักของเรื่อง


ตั้งชื่อใหม่ให้ตัวละคร

infrunami | perthchimon: ฟิค Boy Love (แชท) (2024)
Top Articles
Latest Posts
Article information

Author: Eusebia Nader

Last Updated:

Views: 6110

Rating: 5 / 5 (80 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Eusebia Nader

Birthday: 1994-11-11

Address: Apt. 721 977 Ebert Meadows, Jereville, GA 73618-6603

Phone: +2316203969400

Job: International Farming Consultant

Hobby: Reading, Photography, Shooting, Singing, Magic, Kayaking, Mushroom hunting

Introduction: My name is Eusebia Nader, I am a encouraging, brainy, lively, nice, famous, healthy, clever person who loves writing and wants to share my knowledge and understanding with you.