productInfo.js 9.8 KB

12345678910
  1. require('./common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["subpackage/diyComponents/productInfo"],{"096c":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var o=function(){var t=this,e=t.$createElement,i=(t._self._c,t.productData&&void 0!==t.indicatorConfig.tabVal&&2===t.indicatorConfig.tabVal?t.sliderImage.length:null),o=t.productData?3===t.specStyle&&t.skuList.length>0:null,n=t.productData&&o?t.skuList.length:null,r=t.productData?(0===t.specStyle||1===t.specStyle)&&t.skuList.length>0:null,s=t.productData&&r&&0===t.specStyle?t.skuList.length:null,c=t.productData&&r&&1===t.specStyle?t.skuList.length:null,l=t.productData?t.__map(t.sortList,(function(e,i){var o=t.__get_orig(e),n="price"===e.name&&e.show?e.checkList.includes(0):null,r="price"===e.name&&e.show?e.checkList.includes(1):null,s="price"===e.name&&e.show?e.checkList.includes(2)&&t.displayInfo.vip_price:null,c="data"===e.name&&e.show?e.checkList.includes(0):null,l="data"===e.name&&e.show?e.checkList.includes(1):null,a="data"===e.name&&e.show?e.checkList.includes(2):null,u="tags"===e.name&&e.show&&t.productData.label_list&&t.productData.label_list.length;return{$orig:o,g6:n,g7:r,g8:s,g9:c,g10:l,g11:a,g12:u}})):null,a=t.productData?2===t.specStyle&&t.skuList.length>0:null,u=t.productData&&a?t.skuList.length:null;t.$mp.data=Object.assign({},{$root:{g0:i,g1:o,g2:n,g3:r,g4:s,g5:c,l0:l,g13:a,g14:u}})},n=[]},"4fbc":function(t,e,i){"use strict";i.r(e);var o=i("fc1f"),n=i.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(r);e["default"]=n.a},c410:function(t,e,i){"use strict";i.r(e);var o=i("096c"),n=i("4fbc");for(var r in n)["default"].indexOf(r)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(r);i("cc05");var s=i("828b"),c=Object(s["a"])(n["default"],o["b"],o["c"],!1,null,"70dd3f0b",null,!1,o["a"],void 0);e["default"]=c.exports},cc05:function(t,e,i){"use strict";var o=i("de8a"),n=i.n(o);n.a},de8a:function(t,e,i){},fc1f:function(t,e,i){"use strict";(function(t){var o=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=o(i("7ca3")),r=o(i("af34"));function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function c(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){(0,n.default)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var l={name:"productInfo",components:{BaseTag:function(){i.e("components/BaseTag").then(function(){return resolve(i("5e27"))}.bind(null,i)).catch(i.oe)},commonWrapper:function(){i.e("subpackage/diyComponents/commonWrapper").then(function(){return resolve(i("11450"))}.bind(null,i)).catch(i.oe)}},props:{dataConfig:{type:Object,default:function(){return{}}},productData:{type:Object,default:function(){return{}}},priceData:{type:Object,default:function(){return{}}},skuList:{type:Array,default:function(){return[]}},colorStyle:{type:Object,default:function(){return{theme:"#E93323"}}}},data:function(){return{currentSwiper:0,selectedIndex:0,videoControls:!0,videoPlaying:!1}},computed:{displayInfo:function(){var t=this.priceData.price||"0.00",e=this.priceData.real_price||"0.00",i=this.priceData.ot_price||"0.00",o=this.priceData.vip_price,n=this.productData.stock||0,r=this.productData.fsales||0,s=this.productData.unit_name||"";if(this.skuList.length>0&&this.selectedIndex<this.skuList.length){var c=this.skuList[this.selectedIndex];c&&(c.price&&(t=c.price),c.real_price&&(t=c.real_price),c.ot_price&&(i=c.ot_price),c.vip_price&&(o=c.vip_price),(c.stock||0===c.stock)&&(n=c.stock))}return{price:t,ot_price:i,vip_price:o,stock:n,fsales:r,unit_name:s,real_price:e}},sliderImage:function(){var t=this.productData.slider_image||[],e=this.productData.video_link;return e?[{isVideo:!0,src:e,poster:t[0]||""}].concat((0,r.default)(t.slice(1))):t},currentSlideImage:function(){var t=this.sliderImage[this.currentSwiper];return t?t.isVideo?t.poster:t:""},configData:function(){return c(c({},this.dataConfig),{},{paddingConfig:this.dataConfig.paddingConfig||{isAll:!1,valList:[{val:0},{val:0},{val:0},{val:0}]},marginConfig:this.dataConfig.marginConfig||{isAll:!1,valList:[{val:0},{val:0},{val:0},{val:0}]}})},specStyle:function(){return this.dataConfig.specStyle?this.dataConfig.specStyle.tabVal:0},specSettings:function(){return this.dataConfig.specSettings||{}},isCustomSpecTone:function(){return this.specSettings.colorTone&&1===this.specSettings.colorTone.tabVal},specSelectedColor:function(){return this.isCustomSpecTone?this.specSettings.selectedBorderColor&&this.specSettings.selectedBorderColor.color[0].item?this.specSettings.selectedBorderColor.color[0].item:"#E93323":"var(--view-theme)"},specTextColor:function(){return this.isCustomSpecTone?this.specSettings.textColor&&this.specSettings.textColor.color[0].item?this.specSettings.textColor.color[0].item:"#666":"var(--view-theme)"},specSelectedBorderColor:function(){return this.isCustomSpecTone&&this.specSettings.selectedBorderColor&&this.specSettings.selectedBorderColor.color[0].item?this.specSettings.selectedBorderColor.color[0].item:this.specSelectedColor},specSelectedTextColor:function(){return this.isCustomSpecTone&&this.specSettings.selectedTextColor&&this.specSettings.selectedTextColor.color[0].item?this.specSettings.selectedTextColor.color[0].item:this.specTextColor},specSelectedBgColor:function(){return this.isCustomSpecTone?this.specSettings.selectedBgColor&&this.specSettings.selectedBgColor.color[0].item?this.specSettings.selectedBgColor.color[0].item:this.hexToRgba(this.colorStyle.theme||"#E93323",.1):3===this.specStyle?"#777777":this.hexToRgba(this.colorStyle.theme||"#E93323",.1)},specUnselectedTextColor:function(){return this.isCustomSpecTone&&this.specSettings.unselectedTextColor&&this.specSettings.unselectedTextColor.color[0].item?this.specSettings.unselectedTextColor.color[0].item:3===this.specStyle?"#ffffff":"#333333"},titleColor:function(){var t=this.dataConfig.titleConfig;return t?0===t.tabVal?"var(--view-theme)":t.color&&t.color.color[0].item?t.color.color[0].item:"#333333":"#333333"},titleFontSize:function(){return this.dataConfig.titleConfig&&this.dataConfig.titleConfig.fontSize?this.dataConfig.titleConfig.fontSize.val:16},sortList:function(){return this.dataConfig.sortList?this.dataConfig.sortList.list:[{name:"price",show:!0,checkList:[0,1,2]},{name:"name",show:!0},{name:"data",show:!0,checkList:[0,1,2]},{name:"tags",show:!0}]},indicatorConfig:function(){return this.dataConfig.indicatorConfig||{}},selectColor:function(){return this.indicatorConfig.selectColor?this.indicatorConfig.selectColor.color[0].item:"#E93323"},defaultColor:function(){return this.indicatorConfig.defaultColor?this.indicatorConfig.defaultColor.color[0].item:"#CCCCCC"},indicatorPosition:function(){if(0===this.indicatorConfig.tabVal)return"center";var t=this.indicatorConfig.positionVal;return 0===t?"left":2===t?"right":"center"},priceSettings:function(){return this.dataConfig.priceSettings||{}},dataSettings:function(){return this.dataConfig.dataSettings||{}},isCustomPriceTone:function(){return this.priceSettings.colorTone&&1===this.priceSettings.colorTone.tabVal},finalPriceColor:function(){return this.isCustomPriceTone?this.priceSettings.finalPriceColor&&this.priceSettings.finalPriceColor.color[0].item?this.priceSettings.finalPriceColor.color[0].item:"#E93323":"var(--view-theme)"},sellingPriceColor:function(){return this.isCustomPriceTone&&this.priceSettings.sellingPriceColor&&this.priceSettings.sellingPriceColor.color[0].item?this.priceSettings.sellingPriceColor.color[0].item:"#333333"},priceFontSize:function(){return this.priceSettings.priceFontSize?this.priceSettings.priceFontSize.val:24},originalPriceColor:function(){return this.dataSettings.originalPriceColor&&this.dataSettings.originalPriceColor.color[0].item?this.dataSettings.originalPriceColor.color[0].item:"#999999"},stockColor:function(){return this.dataSettings.stockColor&&this.dataSettings.stockColor.color[0].item?this.dataSettings.stockColor.color[0].item:"#999999"},salesColor:function(){return this.dataSettings.salesColor&&this.dataSettings.salesColor.color[0].item?this.dataSettings.salesColor.color[0].item:"#999999"}},methods:{swiperChange:function(e){if(this.currentSwiper=e.detail.current,0!==this.currentSwiper||!this.productData.video_link){this.videoControls=!0,this.videoPlaying=!1;var i=t.createVideoContext("productVideo",this);i&&i.pause()}},playVideo:function(){var e=this;this.videoControls=!1,this.videoPlaying=!0,this.$nextTick((function(){var i=t.createVideoContext("productVideo",e);i.play()}))},onVideoPlay:function(){this.videoPlaying=!0},onVideoPause:function(){this.videoPlaying=!1},changeSpec:function(t,e){void 0!==e&&(this.selectedIndex=e),this.$emit("changeSpec",t)},showSpecModal:function(){this.$emit("showSpecModal")},emitShare:function(){this.$emit("share")},hexToRgba:function(t,e){return t?/^#([A-Fa-f0-9]{3}){1,2}$/.test(t)?(i=t.substring(1).split(""),3==i.length&&(i=[i[0],i[0],i[1],i[1],i[2],i[2]]),i="0x"+i.join(""),"rgba("+[i>>16&255,i>>8&255,255&i].join(",")+","+e+")"):t:"";var i}},watch:{skuList:{handler:function(t){t&&t.length>0&&(this.selectedIndex=0)},deep:!0,immediate:!0}}};e.default=l}).call(this,i("df3c")["default"])}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'subpackage/diyComponents/productInfo-create-component',
  4. {
  5. 'subpackage/diyComponents/productInfo-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('df3c')['createComponent'](__webpack_require__("c410"))
  7. })
  8. },
  9. [['subpackage/diyComponents/productInfo-create-component']]
  10. ]);