FETTVERBRENNUNG-ANREGEN.EU ≡ G-Series Lure Components New! Cushions Guitar Pedals & Accessories
  • Effect Pedals

  • BLUE NOTE TOUR SERIES - J.ROCKETT

BLUE NOTE TOUR SERIES - J.ROCKETT

$39.64 $59.86
\n\n\n\n","desc_show_pics":1,"new_time":"2020-12-09 03:01:50","is_fake":0,"qr_url":"https:\/\/lnwgo.com\/qr\/p\/667597\/2769?s=e5600668","display_sell":"availability","price_list":null,"condition_flag":1,"created_time":"2020-12-09 03:01:50","modified_time":"2020-12-09 03:01:50","brand":"j.ROCKETT","model":"BLUE NOTE TOUR SERIES","size":null,"preorder_flag":0,"prepare_duration":"1 วันทำการ","attrs":[{"name":"ยี่ห้อ","value":"j.ROCKETT"},{"name":"รุ่น","value":"BLUE NOTE TOUR SERIES"}],"category":{"id":165,"name":"J. ROCKETT","thumbnail":"https:\/\/gd.lnwfile.com\/_\/gd\/_resize\/64\/64\/9v\/ba\/bi.jpg","category_num":"0","full_url":"https:\/\/www.yessguitar.com\/category\/165\/effect-pedals\/j-rockett","is_fake":0,"product_num":"8","itemprop_content":"EFFECT PEDALS > J. ROCKETT"},"thumbnails":["https:\/\/gd.lnwfile.com\/_\/gd\/_resize\/200\/200\/jh\/rl\/0k.jpg"],"rating":null,"total_review":"0","like_url":"http:\/\/www.yessguitar.com\/p\/2769","reviews":[],"discusses":[],"tags":{"j-rockett":"J.ROCKETT","archer-ikon":"ARCHER IKON","the-dude":"The Dude"},"status":{"instock":1,"soldout":0,"preorder":0,"condition":1,"condition_1_option":null,"condition_2_option":null,"recommend":0,"hot":0,"new":0,"sale":0,"sell":"availability"},"seo":{"title_tag":"BLUE NOTE TOUR SERIES - J.ROCKETT","meta_keywords":"J.ROCKETT,ARCHER IKON,The Dude","meta_desc":"สินค้าเข้าไทย มกราคม 2021 The Blue Note Tour Series is identical in sound to the original Blue Note, but does not offer the “Hot Switch” o..."},"cart_num":0}}; var choosed_option_choice = {}; if(payload.pdata.has_sub) { if(payload.sub_options) { payload.sub_options.forEach(function(sub_option) { choosed_option_choice[sub_option.key] = null; }); } } var choosed_option_rank = []; var img_showed = {}; img_showed[payload.pdata.image] = true; return { payload: payload, now_slide_idx: 0, choosed_option_rank: choosed_option_rank, choosed_option_choice: choosed_option_choice, is_product_version_new_widget: false, cart_ajaxing: false, cart_quantity: 1, lang_text_time: 0, is_suboption_dropdown: false, sub_pdata_image: null, last_focus_pdata_id: null, last_click_addCart: null, img_showed: img_showed, is_zooming : false, slide_item_maxsize: null, vdo_youtube_player: null, vdo_youtube_player_is_pause: true, vdo_facebook_player_is_pause: true, vdo_tiktok_player_is_pause: true, is_img_dragging: false, img_startX: null, img_moveX: null, promotion_now_ts: (new Date()).getTime(), promotion_timer_id: null , GAEEPD: []} }, computed: { productImageBoxStyle: function() { var style = {}; return style; }, product_image: function() { if(this.focus_pdata) { return this.focus_pdata.image; } return this.payload.pdata.image; }, slide_1_items: function() { var that = this; var items = []; var added_imgs = {}; this.payload.pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = items.length; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 1, is_sub: 0, alt: that.payload.pdata.title }); } }); if(this.payload.pdata.video.enable) { var video = this.payload.pdata.video; var item = { type: video.type, url: video.url, thumbnail: __lnw__.img_src(this.payload.pdata.image,'product',100,100), is_main: 1, is_sub: 0, }; if(video.width) { if(this.slide_item_maxsize != null) { if(video.width > video.height) { item.width = this.slide_item_maxsize; item.height = video.height*item.width/video.width; }else if(video.width < video.height) { item.height = this.slide_item_maxsize; item.width = video.width*item.height/video.height; } else{ item.width = this.slide_item_maxsize; item.height = this.slide_item_maxsize; } } } if(this.payload.pdata.video.position == 'first') { items.unshift(item); }else if(this.payload.pdata.video.position == 'last') { items.push(item); } } return items; }, choosed_option_text: function() { var that = this; if(that.choosed_option_rank.length > 0) { var texts = []; this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var text = that.choosed_option_choice[sub_option.key].text; texts.push(text); } }) return texts.join(' , '); } return null; }, slide_2_items: function() { var that = this; var items = []; var added_imgs = {}; if(that.choosed_option_rank.length > 0) { if(this.focus_pdata && (this.focus_pdata.id != this.payload.pdata.id)) { this.focus_pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.focus_pdata.title }); } }); } this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var img = that.choosed_option_choice[sub_option.key].image; if(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.payload.pdata.name ' : ' sub_option.name }); } } } }) } return items; }, slide_items: function() { var items = []; this.slide_1_items.forEach(function(item) { items.push(item); }); this.slide_2_items.forEach(function(item) { items.push(item); }); this.$nextTick(function(){ if(this.slide_2_items.length > 0) { this.slide_select_idx(this.slide_1_items.length); }else if(this.slide_1_items.length > 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base <= 0) { return null; } return price_format(base); }, flash_sale_discount_percent: function() { if(!this.use_promotion_price_data) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } base = parseFloat(base); if(isNaN(base) || base <= 0 || isNaN(promo_price) || promo_price <= 0) { return null; } var percent = Math.round((1 - (promo_price / base)) * 100); if(percent <= 0) { return null; } return percent; }, flash_sale_vat_multiplier: function() { if(!this.show_pdata.price || !this.show_pdata.before_vat_price) { return null; } var price = parseFloat(this.show_pdata.price); var before_vat = parseFloat(this.show_pdata.before_vat_price); if(isNaN(price) || isNaN(before_vat) || before_vat <= 0) { return null; } return price / before_vat; }, flash_sale_before_vat_price_text: function() { if(!this.use_promotion_price_data) { return null; } var multiplier = this.flash_sale_vat_multiplier; if(!multiplier) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); if(isNaN(promo_price) || promo_price J. ROCKETT"},"thumbnails":["https:\/\/gd.lnwfile.com\/_\/gd\/_resize\/200\/200\/jh\/rl\/0k.jpg"],"rating":null,"total_review":"0","like_url":"http:\/\/www.yessguitar.com\/p\/2769","reviews":[],"discusses":[],"tags":{"j-rockett":"J.ROCKETT","archer-ikon":"ARCHER IKON","the-dude":"The Dude"},"status":{"instock":1,"soldout":0,"preorder":0,"condition":1,"condition_1_option":null,"condition_2_option":null,"recommend":0,"hot":0,"new":0,"sale":0,"sell":"availability"},"seo":{"title_tag":"BLUE NOTE TOUR SERIES - J.ROCKETT","meta_keywords":"J.ROCKETT,ARCHER IKON,The Dude","meta_desc":"สินค้าเข้าไทย มกราคม 2021 The Blue Note Tour Series is identical in sound to the original Blue Note, but does not offer the “Hot Switch” o..."},"cart_num":0}}; var choosed_option_choice = {}; if(payload.pdata.has_sub) { if(payload.sub_options) { payload.sub_options.forEach(function(sub_option) { choosed_option_choice[sub_option.key] = null; }); } } var choosed_option_rank = []; var img_showed = {}; img_showed[payload.pdata.image] = true; return { payload: payload, now_slide_idx: 0, choosed_option_rank: choosed_option_rank, choosed_option_choice: choosed_option_choice, is_product_version_new_widget: false, cart_ajaxing: false, cart_quantity: 1, lang_text_time: 0, is_suboption_dropdown: false, sub_pdata_image: null, last_focus_pdata_id: null, last_click_addCart: null, img_showed: img_showed, is_zooming : false, slide_item_maxsize: null, vdo_youtube_player: null, vdo_youtube_player_is_pause: true, vdo_facebook_player_is_pause: true, vdo_tiktok_player_is_pause: true, is_img_dragging: false, img_startX: null, img_moveX: null, promotion_now_ts: (new Date()).getTime(), promotion_timer_id: null , GAEEPD: []} }, computed: { productImageBoxStyle: function() { var style = {}; return style; }, product_image: function() { if(this.focus_pdata) { return this.focus_pdata.image; } return this.payload.pdata.image; }, slide_1_items: function() { var that = this; var items = []; var added_imgs = {}; this.payload.pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = items.length; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 1, is_sub: 0, alt: that.payload.pdata.title }); } }); if(this.payload.pdata.video.enable) { var video = this.payload.pdata.video; var item = { type: video.type, url: video.url, thumbnail: __lnw__.img_src(this.payload.pdata.image,'product',100,100), is_main: 1, is_sub: 0, }; if(video.width) { if(this.slide_item_maxsize != null) { if(video.width > video.height) { item.width = this.slide_item_maxsize; item.height = video.height*item.width/video.width; }else if(video.width < video.height) { item.height = this.slide_item_maxsize; item.width = video.width*item.height/video.height; } else{ item.width = this.slide_item_maxsize; item.height = this.slide_item_maxsize; } } } if(this.payload.pdata.video.position == 'first') { items.unshift(item); }else if(this.payload.pdata.video.position == 'last') { items.push(item); } } return items; }, choosed_option_text: function() { var that = this; if(that.choosed_option_rank.length > 0) { var texts = []; this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var text = that.choosed_option_choice[sub_option.key].text; texts.push(text); } }) return texts.join(' , '); } return null; }, slide_2_items: function() { var that = this; var items = []; var added_imgs = {}; if(that.choosed_option_rank.length > 0) { if(this.focus_pdata && (this.focus_pdata.id != this.payload.pdata.id)) { this.focus_pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.focus_pdata.title }); } }); } this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var img = that.choosed_option_choice[sub_option.key].image; if(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.payload.pdata.name ' : ' sub_option.name }); } } } }) } return items; }, slide_items: function() { var items = []; this.slide_1_items.forEach(function(item) { items.push(item); }); this.slide_2_items.forEach(function(item) { items.push(item); }); this.$nextTick(function(){ if(this.slide_2_items.length > 0) { this.slide_select_idx(this.slide_1_items.length); }else if(this.slide_1_items.length > 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base <= 0) { return null; } return price_format(base); }, flash_sale_discount_percent: function() { if(!this.use_promotion_price_data) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } base = parseFloat(base); if(isNaN(base) || base <= 0 || isNaN(promo_price) || promo_price <= 0) { return null; } var percent = Math.round((1 - (promo_price / base)) * 100); if(percent <= 0) { return null; } return percent; }, flash_sale_vat_multiplier: function() { if(!this.show_pdata.price || !this.show_pdata.before_vat_price) { return null; } var price = parseFloat(this.show_pdata.price); var before_vat = parseFloat(this.show_pdata.before_vat_price); if(isNaN(price) || isNaN(before_vat) || before_vat video.height) { item.width = this.slide_item_maxsize; item.height = video.height*item.width/video.width; }else if(video.width 0) { var texts = []; this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var text = that.choosed_option_choice[sub_option.key].text; texts.push(text); } }) return texts.join(' , '); } return null; }, slide_2_items: function() { var that = this; var items = []; var added_imgs = {}; if(that.choosed_option_rank.length > 0) { if(this.focus_pdata && (this.focus_pdata.id != this.payload.pdata.id)) { this.focus_pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.focus_pdata.title }); } }); } this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var img = that.choosed_option_choice[sub_option.key].image; if(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.payload.pdata.name ' : ' sub_option.name }); } } } }) } return items; }, slide_items: function() { var items = []; this.slide_1_items.forEach(function(item) { items.push(item); }); this.slide_2_items.forEach(function(item) { items.push(item); }); this.$nextTick(function(){ if(this.slide_2_items.length > 0) { this.slide_select_idx(this.slide_1_items.length); }else if(this.slide_1_items.length > 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base <= 0) { return null; } return price_format(base); }, flash_sale_discount_percent: function() { if(!this.use_promotion_price_data) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } base = parseFloat(base); if(isNaN(base) || base <= 0 || isNaN(promo_price) || promo_price <= 0) { return null; } var percent = Math.round((1 - (promo_price / base)) * 100); if(percent 0) { if(this.focus_pdata && (this.focus_pdata.id != this.payload.pdata.id)) { this.focus_pdata.images.forEach(function(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.focus_pdata.title }); } }); } this.payload.sub_options.forEach(function(sub_option){ if(that.choosed_option_choice[sub_option.key]) { var img = that.choosed_option_choice[sub_option.key].image; if(img) { if(typeof added_imgs[img] == 'undefined') { added_imgs[img] = true; items.push({ type: 'image', url: img, thumbnail: __lnw__.img_src(img,'product',100,100), is_main: 0, is_sub: 1, alt: that.payload.pdata.name ' : ' sub_option.name }); } } } }) } return items; }, slide_items: function() { var items = []; this.slide_1_items.forEach(function(item) { items.push(item); }); this.slide_2_items.forEach(function(item) { items.push(item); }); this.$nextTick(function(){ if(this.slide_2_items.length > 0) { this.slide_select_idx(this.slide_1_items.length); }else if(this.slide_1_items.length > 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base <= 0) { return null; } return price_format(base); }, flash_sale_discount_percent: function() { if(!this.use_promotion_price_data) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } base = parseFloat(base); if(isNaN(base) || base <= 0 || isNaN(promo_price) || promo_price 0) { this.slide_select_idx(this.slide_1_items.length); }else if(this.slide_1_items.length > 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base <= 0) { return null; } return price_format(base); }, flash_sale_discount_percent: function() { if(!this.use_promotion_price_data) { return null; } var promo_price = parseFloat(this.use_promotion_price_data.price); var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } base = parseFloat(base); if(isNaN(base) || base 0){ this.slide_select_idx(0); } }); return items; }, is_choosed_all: function() { var that = this; if(!this.payload.pdata.has_sub) { return true; } return that.payload.sub_options.every(function(sub_option) { return (that.choosed_option_choice[sub_option.key] != null); }); }, focus_pdata: function(){ var that = this; if(!this.payload.pdata.has_sub) { return this.payload.pdata; } if(!this.is_choosed_all) { return null; } var pid = Object.keys(that.payload.spdatas).find(function(pid) { var spdata = that.payload.spdatas[pid]; return that.choosed_option_rank.every(function(option_key) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == that.choosed_option_choice[option_key].key); }); }); if(pid) { return that.payload.spdatas[pid]; } return false; }, show_pdata_cart_num: function() { var that = this; if(lnw_store && lnw_store.state.cart.data) { var item = lnw_store.state.cart.data.items.find(function(item) { return ((item.spec.type == 'product') && (that.show_pdata.id == item.spec.product_id)); }); if(item) { return item.quantity; } else { return 0; } } return that.show_pdata.cart_num; }, show_pdata_weight_text: function() { var val = this.show_pdata.weight; if(val > 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '<span><span>' price_format(that.show_pdata.price) '</span> บาท</span>'; } if(this.show_pdata.before_vat_price_text) { html = '<span style="font-size: 0.5em; font-weight:normal; color: #666;"> (รวม Vat แล้ว)</span>' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, flash_sale_price_text: function() { if(!this.use_promotion_price_data) { return null; } return price_format(this.use_promotion_price_data.price); }, flash_sale_reference_price_text: function() { var base = null; if(this.show_pdata.price_old !== null && typeof this.show_pdata.price_old != 'undefined') { base = this.show_pdata.price_old; } else if(this.show_pdata.price) { base = this.show_pdata.price; } if(base === null) { return null; } if(typeof base == 'object') { base = base[0]; } if(isNaN(base) || base 0) { return number_format(val) ' กรัม'; } return null; }, show_pdata: function(){ var that = this; var focus_pdata = this.focus_pdata; if(focus_pdata === null) { return that.payload.pdata; } if(focus_pdata === false) { var pdata = {}; var pkeys = ['id','price','price_old','title']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); pdata.show_remain = 0; pdata.cart_num = 0; var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','status','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ pdata[key] = that.payload.pdata[key]; }); return pdata; } if((focus_pdata.id == this.payload.pdata.id)){ return focus_pdata; } //return focus_pdata; var pdata = {}; var pkeys = ['id','price','price_old','show_remain','cart_num','title']; pkeys.forEach(function(key){ pdata[key] = focus_pdata[key]; }); var pkeys = ['name','weight','code','barcode','condition_flag','buy_button','promotion','attrs','color','size','brand','model','width','height','length','isbn','dropship_price','promotion_price_data','upcoming_promotion_data','before_vat_price','before_vat_price_text','created_time','modified_time','preorder_flag','prepare_duration']; pkeys.forEach(function(key){ if(focus_pdata[key]){ pdata[key] = focus_pdata[key]; }else{ pdata[key] = that.payload.pdata[key]; } }); var status = {}; Object.keys(focus_pdata.status).forEach(function(skey) { status[skey] = focus_pdata.status[skey]; }); Object.keys(that.payload.pdata.status).forEach(function(skey) { if((typeof status[skey] == 'undefined') || (status[skey] === null)) { status[skey] = that.payload.pdata.status[skey]; } }); pdata.status = status; that.payload.pdata.attrs.forEach(function(attr) { var haved = false; pdata.attrs.forEach(function(pattr) { if(pattr.name == attr.name) { if(pattr.value !== null) { haved = true; } } }); if(haved === false) { pdata.attrs.push(attr); } }); return pdata; }, show_pdata_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ }else{ html = '' price_format(that.show_pdata.price) ' บาท'; } if(this.show_pdata.before_vat_price_text) { html = ' (รวม Vat แล้ว)' } return html; }, show_pdata_dropship_price_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id) { } else if(that.show_pdata.dropship_price) { html = price_format(that.show_pdata.dropship_price); } return html; }, use_promotion_price_data: function() { var that = this; if(that.show_pdata.promotion_price_data && that.show_pdata.promotion_price_data.price) { var limit = that.sale_promotion_quantity_limit; // ถ้าโปรไม่กำหนดจำนวนสูงสุด ไม่ต้องปิดการใช้ราคาโปร if(limit !== null && limit !== undefined && that.want_cart_quantity > limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff <= 0) { return null; } return this.format_countdown(diff); }, upcoming_flash_sale_countdown: function() { if(!this.upcoming_flash_sale) { return null; } var start_ts = this.parse_promotion_start_ts(); if(!start_ts) { return null; } var diff = start_ts - this.promotion_now_ts; if(diff limit) { return false; } return that.show_pdata.promotion_price_data; } return null; }, sale_promotion_quantity_limit: function() { var that = this; if(that.show_pdata.promotion_price_data) { if(that.show_pdata.promotion_price_data.order_limit) { return that.show_pdata.promotion_price_data.order_limit; } else if(that.show_pdata.promotion_price_data.max_quantity) { return that.show_pdata.promotion_price_data.max_quantity; } } return null; }, upcoming_flash_sale: function() { if(this.use_promotion_price_data) { return null; } var promo = this.show_pdata ? this.show_pdata.upcoming_promotion_data : null; if(!promo) { promo = this.payload && this.payload.pdata ? this.payload.pdata.upcoming_promotion_data : null; } if(!promo || !promo.begin_datetime) { return null; } return promo; }, show_pdata_promotion_price_html: function(){ var that = this; var html = ''; if(this.use_promotion_price_data) { html = price_format(that.use_promotion_price_data.price); } return html; }, show_pdata_promotion_end_text: function() { var that = this; var html = ''; if(this.use_promotion_price_data && that.use_promotion_price_data.end_datetime) { html = __lnw__.clock.show_datetime(that.use_promotion_price_data.end_datetime, false, true) } return html; }, flash_sale_has_end: function() { return (this.use_promotion_price_data && this.use_promotion_price_data.end_datetime); }, flash_sale_countdown: function() { if(!this.flash_sale_has_end) { return null; } var end_ts = this.parse_promotion_end_ts(); if(!end_ts) { return null; } var diff = end_ts - this.promotion_now_ts; if(diff 0) { percent = 5; } if(percent > 100) { percent = 100; } return percent; }, flash_sale_progress_text: function() { var limit = this.sale_promotion_quantity_limit; var promo = this.use_promotion_price_data; if(!promo || limit === null || typeof limit == 'undefined') { return null; } if(promo.remain === false || promo.remain === null || typeof promo.remain == 'undefined') { return null; } return 'เหลือ ' promo.remain ' ' (this.show_pdata.unit || ''); }, show_pdata_remain: function() { var that = this; if(typeof this.show_pdata.show_remain == 'undefined') { return false; } if(this.use_promotion_price_data) { return this.use_promotion_price_data.remain; } return this.show_pdata.show_remain; }, show_pdata_price_old_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ if(that.show_pdata.price_old == null){ }else if(typeof that.show_pdata.price_old == 'object'){ html = price_format(that.show_pdata.price_old[0]) '-' price_format(that.show_pdata.price_old[1]); }else{ html = price_format(that.show_pdata.price_old); } }else{ html = price_format(that.show_pdata.price_old); } return html; }, show_product_warning: function() { var that = this; if(that.sale_promotion_quantity_limit) { if(that.use_promotion_price_data) { if(that.want_cart_quantity == that.sale_promotion_quantity_limit) { return __lnw__.show_lang('FLASHSALE-LIMIT-REACH', that.sale_promotion_quantity_limit, that.show_pdata.unit); } } else { return __lnw__.show_lang('FLASHSALE-LIMIT-OVER', that.sale_promotion_quantity_limit, that.show_pdata.unit); } } return null; }, link_choice_to_spdata_ids: function(){ var that = this; var ccc = {}; var is_option_one = (that.payload.suboption_rank.length ==1) that.payload.suboption_rank.forEach(function(option_key){ var _link_choice_to_spdata_ids = {}; that.payload.spdata_ids.forEach(function(spdata_id){ var spdata = that.payload.spdatas[spdata_id]; var key = spdata.option_choice_keys[option_key]; if(is_option_one){ key = spdata_id } _link_choice_to_spdata_ids[key] = spdata_id; }); ccc[option_key] = _link_choice_to_spdata_ids; }); return ccc; }, enabled_choice_keyss: function() { var that = this; if(!this.payload.pdata.has_sub) { return {}; } var echoices = {}; var spdatas = Object.keys(that.payload.spdatas).map(function(pid) { return that.payload.spdatas[pid]; }) spdatas = spdatas.filter(function(spdata) { return (spdata.status.sell=='availability'); }); that.choosed_option_rank.forEach(function(option_key) { var option_val = that.choosed_option_choice[option_key].key; var sub_option = that.payload.sub_options.find(function(sub_option) { return (sub_option.key == option_key); }); echoices[option_key] = that.get_choices(spdatas,option_key); spdatas = spdatas.filter(function(spdata) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == option_val) }); }); that.payload.sub_options.forEach(function(sub_option) { if(typeof echoices[sub_option.key] == 'undefined') { echoices[sub_option.key] = that.get_choices(spdatas,sub_option.key); } }); return echoices; }, size_chart_name: function() { let name = null; let that = this; this.show_pdata.attrs.forEach(function (attr){ if(attr.value == that.show_pdata.size_chart){ name = attr.name; return; } }) return name; }, want_cart_quantity: function() { return (this.cart_quantity?this.cart_quantity:0) this.show_pdata_cart_num; } }, watch: { slide_items: function(newValue) { this.setupImageZoom(this.now_slide_idx); }, now_slide_idx: function(newValue,) { if(this.slide_items[newValue]) { var item = this.slide_items[newValue]; if(item.type == 'image') { if(typeof this.img_showed[item.url] == 'undefined') { this.img_show(item.url); } } this.setupImageZoom(newValue); } }, use_promotion_price_data: function() { this.restart_promotion_timer(); }, show_pdata: function() { this.restart_promotion_timer(); }, cart_quantity: function() { if(this.show_product_warning) { this.alert_product_warning(); } } }, methods: { alert_product_warning: function() { var msg = this.show_product_warning; if(msg) { __lnw__.simpleAlert(msg); } }, restart_promotion_timer: function() { this.clear_promotion_timer(); var needTimer = this.flash_sale_has_end || this.upcoming_flash_sale; if(!needTimer) { return; } this.promotion_now_ts = (new Date()).getTime(); var that = this; this.promotion_timer_id = setInterval(function(){ that.promotion_now_ts = (new Date()).getTime(); var shouldClear = false; var end_ts = that.parse_promotion_end_ts(); if(end_ts && (end_ts - that.promotion_now_ts) <= 0) { shouldClear = true; } if(!that.use_promotion_price_data) { var start_ts = that.parse_promotion_start_ts(); if(start_ts && (start_ts - that.promotion_now_ts) 100) { percent = 100; } return percent; }, flash_sale_progress_text: function() { var limit = this.sale_promotion_quantity_limit; var promo = this.use_promotion_price_data; if(!promo || limit === null || typeof limit == 'undefined') { return null; } if(promo.remain === false || promo.remain === null || typeof promo.remain == 'undefined') { return null; } return 'เหลือ ' promo.remain ' ' (this.show_pdata.unit || ''); }, show_pdata_remain: function() { var that = this; if(typeof this.show_pdata.show_remain == 'undefined') { return false; } if(this.use_promotion_price_data) { return this.use_promotion_price_data.remain; } return this.show_pdata.show_remain; }, show_pdata_price_old_html: function(){ var that = this; var html = ''; if(that.payload.pdata.id == that.show_pdata.id){ if(that.show_pdata.price_old == null){ }else if(typeof that.show_pdata.price_old == 'object'){ html = price_format(that.show_pdata.price_old[0]) '-' price_format(that.show_pdata.price_old[1]); }else{ html = price_format(that.show_pdata.price_old); } }else{ html = price_format(that.show_pdata.price_old); } return html; }, show_product_warning: function() { var that = this; if(that.sale_promotion_quantity_limit) { if(that.use_promotion_price_data) { if(that.want_cart_quantity == that.sale_promotion_quantity_limit) { return __lnw__.show_lang('FLASHSALE-LIMIT-REACH', that.sale_promotion_quantity_limit, that.show_pdata.unit); } } else { return __lnw__.show_lang('FLASHSALE-LIMIT-OVER', that.sale_promotion_quantity_limit, that.show_pdata.unit); } } return null; }, link_choice_to_spdata_ids: function(){ var that = this; var ccc = {}; var is_option_one = (that.payload.suboption_rank.length ==1) that.payload.suboption_rank.forEach(function(option_key){ var _link_choice_to_spdata_ids = {}; that.payload.spdata_ids.forEach(function(spdata_id){ var spdata = that.payload.spdatas[spdata_id]; var key = spdata.option_choice_keys[option_key]; if(is_option_one){ key = spdata_id } _link_choice_to_spdata_ids[key] = spdata_id; }); ccc[option_key] = _link_choice_to_spdata_ids; }); return ccc; }, enabled_choice_keyss: function() { var that = this; if(!this.payload.pdata.has_sub) { return {}; } var echoices = {}; var spdatas = Object.keys(that.payload.spdatas).map(function(pid) { return that.payload.spdatas[pid]; }) spdatas = spdatas.filter(function(spdata) { return (spdata.status.sell=='availability'); }); that.choosed_option_rank.forEach(function(option_key) { var option_val = that.choosed_option_choice[option_key].key; var sub_option = that.payload.sub_options.find(function(sub_option) { return (sub_option.key == option_key); }); echoices[option_key] = that.get_choices(spdatas,option_key); spdatas = spdatas.filter(function(spdata) { var val; if(option_key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[option_key]; } return (val == option_val) }); }); that.payload.sub_options.forEach(function(sub_option) { if(typeof echoices[sub_option.key] == 'undefined') { echoices[sub_option.key] = that.get_choices(spdatas,sub_option.key); } }); return echoices; }, size_chart_name: function() { let name = null; let that = this; this.show_pdata.attrs.forEach(function (attr){ if(attr.value == that.show_pdata.size_chart){ name = attr.name; return; } }) return name; }, want_cart_quantity: function() { return (this.cart_quantity?this.cart_quantity:0) this.show_pdata_cart_num; } }, watch: { slide_items: function(newValue) { this.setupImageZoom(this.now_slide_idx); }, now_slide_idx: function(newValue,) { if(this.slide_items[newValue]) { var item = this.slide_items[newValue]; if(item.type == 'image') { if(typeof this.img_showed[item.url] == 'undefined') { this.img_show(item.url); } } this.setupImageZoom(newValue); } }, use_promotion_price_data: function() { this.restart_promotion_timer(); }, show_pdata: function() { this.restart_promotion_timer(); }, cart_quantity: function() { if(this.show_product_warning) { this.alert_product_warning(); } } }, methods: { alert_product_warning: function() { var msg = this.show_product_warning; if(msg) { __lnw__.simpleAlert(msg); } }, restart_promotion_timer: function() { this.clear_promotion_timer(); var needTimer = this.flash_sale_has_end || this.upcoming_flash_sale; if(!needTimer) { return; } this.promotion_now_ts = (new Date()).getTime(); var that = this; this.promotion_timer_id = setInterval(function(){ that.promotion_now_ts = (new Date()).getTime(); var shouldClear = false; var end_ts = that.parse_promotion_end_ts(); if(end_ts && (end_ts - that.promotion_now_ts) = 0 ? prev : maxIdx; } else if (action === 'next') { // ไปข้างหน้า 1 step const next = this.now_slide_idx 1; const maxIdx = this.slide_items.length - 1; this.now_slide_idx = next { el.src = url; }); }; if (item.type === 'facebook') { const el = document.getElementById('vdo-facebook-player-' idx); reloadWithoutAutoplay(el); this.vdo_facebook_player_is_pause = true; return; } if (item.type === 'tiktok') { const el = document.getElementById('vdo-tiktok-player-' idx); reloadWithoutAutoplay(el); this.vdo_tiktok_player_is_pause = true; return; } }, image_touchstart: function(e) { this.is_img_dragging = true; this.img_startX = e.touches[0].pageX; this.img_moveX = 0; }, image_touchmove: function(e) { if(!this.is_img_dragging) { return; } var currentX = e.touches[0].pageX; this.img_moveX = currentX - this.img_startX; if(this.img_moveX > 10) { if(this.slide_items[this.now_slide_idx-1]) { var slide_item = this.slide_items[this.now_slide_idx-1]; if(!this.img_showed[slide_item.url]) { this.img_show(slide_item.url); } } } else if(this.img_moveX < -10) { if(this.slide_items[this.now_slide_idx 1]) { var slide_item = this.slide_items[this.now_slide_idx 1]; if(!this.img_showed[slide_item.url]) { this.img_show(slide_item.url); } } } }, image_touchend: function(e) { this.is_img_dragging = false; if(this.img_moveX > 70) { if(this.now_slide_idx > 0) { this.now_slide_idx--; } } else if(this.img_moveX < -70) { if(this.now_slide_idx < (this.slide_items.length-1)) { this.now_slide_idx ; } } }, changeZoom( mouseleave ) { if(mouseleave && this.slide_items[this.now_slide_idx].type == 'image'){ this.is_zooming = true; }else{ this.is_zooming = false; } }, buy_button_key_texts: function(buy_button_key) { if(buy_button_key == 'custom1') { var pattern = /^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.) [a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(:(\d ))?(\/[-a-z\d%_.~ ]*)*(\?[;&a-z\d%_.~ =-]*)?(#[-a-z\d_]*)?$/i; var url = this.show_pdata.buy_button[buy_button_key]; var match = url.match(pattern); if (match) { var buyButtonText = match[2]; if (buyButtonText.startsWith('www.')) { buyButtonText = buyButtonText.substr(4); } return buyButtonText; } return __lnw__.show_lang('PRODUCT-BUY_ON_WEBSITE') } else if(buy_button_key == 'jd_central') { return 'JD Central'; } else if(buy_button_key == 'line_shopping') { return 'Line Shopping'; } else if(buy_button_key == 'map1') { return __lnw__.show_lang('PRODUCT-BUY_AT_STORE') } else { return buy_button_key; } }, img_show: function(url) { this.$set(this.img_showed,url,true); return true; }, setupImageZoom: function(id) { var that = this; setTimeout( function() { that.imageZoom('slide_item_' id, 'zoomContainer'); }, 200 ); return true; }, imageZoom: function(imgID, resultID) { var img, lens, result, cx, cy; img = document.getElementById(imgID); result = document.getElementById(resultID); var lens = document.querySelector('.img-zoom-lens'); if(!img) { result.style.backgroundImage = ""; result.style.backgroundSize = ""; return false; } if(!img.offsetWidth) { var that = this; setTimeout( function() { that.imageZoom(imgID, resultID); }, 500); return; } /* Calculate the ratio between result DIV and lens: */ cx = result.offsetWidth / lens.offsetWidth; cy = result.offsetHeight / lens.offsetHeight; /* Set background properties for the result DIV */ result.style.backgroundImage = "url('" img.src "')"; result.style.backgroundSize = (img.offsetWidth * cx) "px " (img.offsetHeight * cy) "px"; /* Execute a function when someone moves the cursor over the image, or the lens: */ lens.addEventListener("mousemove", moveLens); img.addEventListener("mousemove", moveLens); /* And also for touch screens: */ lens.addEventListener("touchmove", moveLens); img.addEventListener("touchmove", moveLens); function moveLens(e) { var pos, x, y; /* Prevent any other actions that may occur when moving over the image */ e.preventDefault(); /* Get the cursor's x and y positions: */ pos = getCursorPos(e); /* Calculate the position of the lens: */ x = pos.x - (lens.offsetWidth / 2); y = pos.y - (lens.offsetHeight / 2); oX = img.offsetLeft; oY = img.offsetTop; /* Prevent the lens from being positioned outside the image: */ if (x > (img.width) - lens.offsetWidth) {x = (img.width) - lens.offsetWidth;} if (x < 0) {x = 0;} if (y > img.height - lens.offsetHeight) {y = img.height - lens.offsetHeight;} if (y < 0) {y = 0;} /* Set the position of the lens: */ lens.style.left = (x oX) "px"; lens.style.top = (y oY) "px"; /* Display what the lens "sees": */ result.style.backgroundPosition = "-" (x * cx) "px -" (y * cy) "px"; } function getCursorPos(e) { var a, x = 0, y = 0; e = e || window.event; /* Get the x and y positions of the image: */ a = img.getBoundingClientRect(); /* Calculate the cursor's x and y coordinates, relative to the image: */ x = e.pageX - a.left; y = e.pageY - a.top; /* Consider any page scrolling: */ x = x - window.pageXOffset; y = y - window.pageYOffset; return {x : x, y : y}; } }, size_chart_zoom: function() { __lnw__.box.show({ addClass: '', appendChild: '.sizeChart', change_close_to_hide: false, }); }, photo_zoom: function(){ if(this.slide_items[this.now_slide_idx].type != 'image'){ return false; } var that = this; var imgs = new Array(); this.slide_items.forEach(function(slide_item) { if(slide_item.type == 'image') { imgs.push(slide_item.url); } }); lnwImageShow.set_imgs(imgs); lnwImageShow.set_callback(function(src,here){ that.slide_select_idx(here); }); lnwImageShow.show(that.now_slide_idx); }, get_choices: function(spdatas,key) { var choices = {}; spdatas.forEach(function(spdata) { var val; if(key == 'id') { val = spdata.id; }else{ val = spdata.option_choice_keys[key]; } choices[val] = true; }); return choices; }, update_lang: function(){ this.lang_text_time = new Date().getTime(); }, show_lang: function(){ var xxx = this.lang_text_time; return __lnw__.show_lang.apply(this,arguments); var aaaaa = $.extend([],arguments); var full_key = aaaaa.shift(); if(this._lang_text == null || typeof this._lang_text[full_key] == 'undefined'){ return full_key; } if(aaaaa.length > 0){ var _text = this._lang_text[full_key]; var aaa = aaaaa; aaa.unshift(_text); return sprintf.apply(this,aaa); }else{ return this._lang_text[full_key]; } }, chooseSub: function(option_key,choice){ var that = this; var old_rank = that.choosed_option_rank; var idx = old_rank.indexOf(option_key); var new_rank = []; if(idx == -1) { that.choosed_option_choice[option_key] = choice; that.choosed_option_rank.push(option_key); }else{ that.choosed_option_rank.splice(idx,1); if(that.choosed_option_choice[option_key] == choice) { that.choosed_option_choice[option_key] = null; }else{ that.choosed_option_choice[option_key] = choice; that.choosed_option_rank.push(option_key); } } return; }, choose_sub_by_id: function(id) { if(typeof this.payload.spdatas[id] == 'undefined') { return false; } var that = this; var spdata = this.payload.spdatas[id]; var choosed_option_choice = {}; var choosed_option_rank = []; var is_error = false; that.payload.sub_options.forEach(function(sub_option) { if(is_error) { return false; } var choice_key; if(sub_option.key == 'id') { choice_key = spdata.id; }else{ choice_key = spdata.option_choice_keys[sub_option.key]; } var choice = sub_option.choices.find(function(ch){ return (ch.key == choice_key); }); if(choice) { choosed_option_choice[sub_option.key] = choice; choosed_option_rank.push(sub_option.key); }else{ is_error = true; } }); if(is_error) { return false; } that.choosed_option_choice = choosed_option_choice; that.choosed_option_rank = choosed_option_rank; return true; }, slide_select_idx: function(idx){ //scrollPage('.productPhoto .productImageBox'); this.now_slide_idx = idx; }, slide_select: function(url){ var idx = this.get_slide_idx(url); this.slide_select_idx(idx); }, get_slide_idx: function(url){ var idx = -1; this.slide_items.forEach(function(item,index) { if(item.url == url) { idx = index; } }); return idx; }, cart_quantity_dec: function(){ var q = parseFloat(this.cart_quantity); if(isNaN(q) || q<=1){ this.cart_quantity = 1; }else{ this.cart_quantity = q-1; } }, cart_quantity_inc: function(){ var q = parseFloat(this.cart_quantity); if(isNaN(q) || q 10) { if(this.slide_items[this.now_slide_idx-1]) { var slide_item = this.slide_items[this.now_slide_idx-1]; if(!this.img_showed[slide_item.url]) { this.img_show(slide_item.url); } } } else if(this.img_moveX 70) { if(this.now_slide_idx > 0) { this.now_slide_idx--; } } else if(this.img_moveX < -70) { if(this.now_slide_idx 0) { this.now_slide_idx--; } } else if(this.img_moveX (img.width) - lens.offsetWidth) {x = (img.width) - lens.offsetWidth;} if (x img.height - lens.offsetHeight) {y = img.height - lens.offsetHeight;} if (y 0){ var _text = this._lang_text[full_key]; var aaa = aaaaa; aaa.unshift(_text); return sprintf.apply(this,aaa); }else{ return this._lang_text[full_key]; } }, chooseSub: function(option_key,choice){ var that = this; var old_rank = that.choosed_option_rank; var idx = old_rank.indexOf(option_key); var new_rank = []; if(idx == -1) { that.choosed_option_choice[option_key] = choice; that.choosed_option_rank.push(option_key); }else{ that.choosed_option_rank.splice(idx,1); if(that.choosed_option_choice[option_key] == choice) { that.choosed_option_choice[option_key] = null; }else{ that.choosed_option_choice[option_key] = choice; that.choosed_option_rank.push(option_key); } } return; }, choose_sub_by_id: function(id) { if(typeof this.payload.spdatas[id] == 'undefined') { return false; } var that = this; var spdata = this.payload.spdatas[id]; var choosed_option_choice = {}; var choosed_option_rank = []; var is_error = false; that.payload.sub_options.forEach(function(sub_option) { if(is_error) { return false; } var choice_key; if(sub_option.key == 'id') { choice_key = spdata.id; }else{ choice_key = spdata.option_choice_keys[sub_option.key]; } var choice = sub_option.choices.find(function(ch){ return (ch.key == choice_key); }); if(choice) { choosed_option_choice[sub_option.key] = choice; choosed_option_rank.push(sub_option.key); }else{ is_error = true; } }); if(is_error) { return false; } that.choosed_option_choice = choosed_option_choice; that.choosed_option_rank = choosed_option_rank; return true; }, slide_select_idx: function(idx){ //scrollPage('.productPhoto .productImageBox'); this.now_slide_idx = idx; }, slide_select: function(url){ var idx = this.get_slide_idx(url); this.slide_select_idx(idx); }, get_slide_idx: function(url){ var idx = -1; this.slide_items.forEach(function(item,index) { if(item.url == url) { idx = index; } }); return idx; }, cart_quantity_dec: function(){ var q = parseFloat(this.cart_quantity); if(isNaN(q) || q0){ $cart = $('.lnw-mobile-cart'); } var src = elem; var dft = $cart.get(0); animate_img_transfer(img,src,dft,function(){ var new_cart_num = 0; if(that.payload.pdata.id==product_id){ that.payload.pdata.cart_num = quantity; }else if(typeof that.payload.spdatas[product_id] != 'undefined'){ that.payload.spdatas[product_id].cart_num = quantity; } /* var html = ''; html = 'ใส่สินค้าลงตะกร้าเรียบร้อยแล้ว'; html = 'เริ่มการสั่งซื้อเลือกซื้อสินค้าเพิ่ม0){ $('.actionBar2015 .new-u-cart').removeClass('cart-empty'); }else{ $('.actionBar2015 .new-u-cart').addClass('cart-empty'); } } }); }, complete: function(){ that.cart_ajaxing = false; } }); } } }, play_vdo: function(e) { if(this.vdo_youtube_player != null) { this.vdo_youtube_player.playVideo(); } }, onYoutubeStateChange: function(e) { var state = e.data; this.vdo_youtube_player_is_pause = (state != 1); } }, mounted: function() { var that = this; if(this.payload.pdata.has_sub && that.payload.sub_options) { that.payload.sub_options.forEach(function(sub_option) { var choices = sub_option.choices.filter(function() { return that.enabled_choice_keyss[sub_option.key] }); if(choices.length == 1) { that.chooseSub(sub_option.key,choices[0]); } }) } that.slide_item_maxsize = $('.productPhoto .productImageBox').width(); if(that.payload.pdata.video.enable && that.payload.pdata.video.type == 'youtube') { var tag = document.createElement('script'); tag.id = 'youtube-iframe-api'; tag.src = 'https://www.youtube.com/iframe_api'; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); } this.setupImageZoom('0'); this.restart_promotion_timer(); }, beforeDestroy: function() { this.clear_promotion_timer(); }, updated: function(){ if(typeof __lnw__ == 'object' && __lnw__.gointer.is_enabled()){ __lnw__.gointer.reload_convert_currency(); } } }); __lnw__.bind_lang_save(function(){ vm.update_lang(); }) var $product_tab = $('.product_tab'); if($('#related').length 0){ $product_tab.find('> .tab a[href="' window.location.hash '"]').click(); } $('.reviewForm .score_star .mini-star').click(function(){ var score = $(this).attr('value'); $('.reviewForm .score_star .mini-star').removeClass('full').filter(function(){ return parseInt($(this).attr('value')) <= score; }).addClass('full'); $('.reviewForm input[name=score]').val(score); }); $('.reviewForm .score_star .mini-star').hover(function(){ var score = $(this).attr('value'); $('.reviewForm .score_star .mini-star').filter(function(){ return parseInt($(this).attr('value')) .tab a[href="' window.location.hash '"]').click(); } $('.reviewForm .score_star .mini-star').click(function(){ var score = $(this).attr('value'); $('.reviewForm .score_star .mini-star').removeClass('full').filter(function(){ return parseInt($(this).attr('value')) 250){ $(this).append(''); $(this).after(' ดูเพิ่ม0){ var offsetCoords = $self.offset(), topOffset = offsetCoords.top; var direction = 1; $window.scroll( function() { if( direction == 1 && topOffset = ($window.scrollTop() - 40)) { $self.removeClass("fixOnTop"); $('.product_tab').css('padding-top','inherit'); direction = 1; } } ); } */ $('.feedbackAverage').click(function(){ $(this).find('.arrow').toggleClass('rotate90'); var $this = $(this).parent().parent().find('.feedbackPremium'); $this.slideToggle(500); }); }); function onYouTubeIframeAPIReady() { vm.vdo_youtube_player = new YT.Player('vdo-youtube-player', { events: { onStateChange: vm.onYoutubeStateChange } }); } function photo_init(){ lnwImageShow.set_imgs_by_ele('.productPhoto .productImageBox .productImage',function(ele){ return $(ele).attr('src'); }); lnwImageShow.set_callback(function(src,here){ vm.slide_select_idx(here); }); } function productreviewClick(ele){ if (!$(ele).hasClass('clickable')){ return false; } var $box = $(ele).closest('.feedbackContent'); var rowProductFull = $box.find('.listProductFull'); var rowProductExample = $box.find('.listProductExample'); if (rowProductFull.is(':hidden')){ rowProductExample.find('.style_product').fadeOut('slow'); rowProductFull.slideToggle('slow'); rowProductExample.css('display','none'); } } function scrolltoA(ahref){ $('html, body').animate({scrollTop: $("#" ahref).offset().top}, 500); }
Effect Pedals

Effect Pedals

  • ARCHER OD - J.ROCKETT
    $54.11 $83.87
  • ARCHER IKON - J.ROCKETT
    $68.33 $90.88
  • BLUE NOTE TOUR SERIES - J.ROCKETT
    $39.64 $59.86
  • ABASI PATHOS PEDAL
    $41.34 $69.04

© 2026 - FETTVERBRENNUNG-ANREGEN.EU