//-------------------topBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='topBanner-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' [id|=topBanner] .swiper-pagination { position: absolute; bottom: 1rem; display: block; width: 100%; margin: 0; list-style: none; text-align: center; } .swiper-pagination-bullet-active { opacity: 1; background: #00ACFF; [id|=topBanner] .swiper-pagination { position: absolute; bottom: 1rem; display: block; width: 100%; margin: 0; list-style: none; text-align: center; } .swiper-pagination-bullet-active { opacity: 1; background: #00ACFF; } }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component('topBanner-Template', { props: ['item', 'index'], template: '#topBanner-Template', data: function () { return { //bannerStyle: { // height: (window.innerWidth * 8 / 15) + 'px' // }, imgHeight: { height: (window.innerWidth * 200 / 15) + 'px' } } }, mounted: function () { this.item.listData.itemContentList.forEach(item => { item.clickUrl = this.handleUrl(item.clickUrl) }) this.$nextTick(function () { var autoIf, loopIf; var img1 = new Image; img1.src = this.item.listData.itemContentList[0].imageUrl; img1.onload = function () { if (window.innerWidth > 1024) { $(".bannerStyle ").css({ height: 500 * img1.height / img1.width + "px" }); } else { $(".bannerStyle ").css({ height: window.innerWidth * img1.height / img1.width + "px" }); } } if (this.item.listData.itemContentList.length > 1) { var topBannerSwiper = new Swiper("#topBanner-" + this.item.listData.name, { autoplay: { delay: 5000, disableOnInteraction: false }, direction: "horizontal", speed: 500, grabCursor: true, loop: true, freeMode: false, touchMoveStopPropagation: false, //autoHeight: true, //高度随内容变化 pagination: { el: '.swiper-pagination', type: 'bullets', bulletElement: 'li' } }) } }); }, methods: { handleUrl(item) { if(!item){ return '' } let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------topBanner Ends------------------- //-------------------iconList Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='iconList-Template'; var templateText = document.createTextNode('

{{listItem.title}}

'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component('iconList-Template', { props: ['item'], template: '#iconList-Template', mounted: function () { this.item.listData.itemContentList.forEach(item => { item.clickUrl = this.handleUrl(item.clickUrl) }) if (window.innerWidth > 1024) { var iconWidth = 500; } else { var iconWidth = window.innerWidth } $(".iconListWrapper").css({ "padding-top": 16 / 375 * iconWidth + "px", "padding-bottom": 15 / 375 * iconWidth + "px", }); $(".iconListWrapper p").css({ "margin": "0px", "margin-top": 4 / 375 * iconWidth + "px", }) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------iconList Ends------------------- //-------------------assure Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='assure-Template'; var templateText = document.createTextNode('

正品保证

专业精选

15天无忧退换

'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' '); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("assure-Template", { template: "#assure-Template", data: function () { return { fontStyle: { fontSize: window.innerWidth * 13 / 375 + 'px', paddingTop:window.innerWidth*10/375+"px", paddingBottom:window.innerWidth*10/375+"px", paddingLeft:window.innerWidth*30/375+"px", paddingRight:window.innerWidth*30/375+"px", }, assureWidth:"" } }, mounted:function () { if(window.innerWidth>1024){ this.assureWidth = 500; this.fontStyle={ fontSize: this.assureWidth * 13 / 375 + 'px', paddingTop:this.assureWidth*10/375+"px", paddingBottom:this.assureWidth*10/375+"px", paddingLeft:this.assureWidth*30/375+"px", paddingRight:this.assureWidth*30/375+"px", } }else{ this.assureWidth = window.innerWidth; } $(".assureIcon").css({ "width":this.assureWidth*15/375+"px", "margin-right":this.assureWidth*5/375+"px" }); $(".assureIcon:nth-child(2)").css({ "margin-left":this.assureWidth*40/375+"px", "margin-right":this.assureWidth*40/375+"px" }) } }); //-------------------assure Ends------------------- //-------------------topNews Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='topNews-Template'; var templateText = document.createTextNode('
{{itemd1.prefix}} {{itemd1.title}}
{{itemd2.prefix}} {{itemd2.title}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' @media screen and (max-width: 370px) { .newsIcon { margin-top: 3px; } } .spanTitle{ display:flex; white-space: nowrap; overflow: hidden; text-overflow: ellipsis } '); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component('topNews-Template', { props: ['item', 'index'], template: '#topNews-Template', data: function () { return { topNewsWidth: "" } }, created() { this.item.listData.articleList.forEach(item => { item.articleDetail.forEach(items => { items.clickUrl = this.handleUrl(items.clickUrl) }) item.articleDetail1.forEach(itemt => { itemt.clickUrl = this.handleUrl(itemt.clickUrl) }) }) }, mounted: function () { if (window.innerWidth > 1024) { this.topNewsWidth = 500; } else { this.topNewsWidth = window.innerWidth; } $("#topNewsWrapper").slick(); $(".topNew").css({ "padding-top": 10 / 375 * this.topNewsWidth + "px", "padding-bottom": 10 / 375 * this.topNewsWidth + "px", }); if (this.topNewsWidth <= 320) { $(".newsIcon").css({ "margin-top": this.topNewsWidth * 3.5 / 375 + "px" }); } else { $(".newsIcon").css({ "margin-top": this.topNewsWidth * 1.5 / 375 + "px" }); } $(".newsIcon").css({ "width": this.topNewsWidth * 42 / 375 + "px" }); $(".spTitle").css({ "width": this.topNewsWidth * 230 / 375 + "px" }) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------topNews Ends------------------- //-------------------brandRecommendation Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='brandRecommendation-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}品牌馆
已售罄
已下架
{{item.goodsName}}
¥{{item.goodsVipPrice.toFixed(2)}} ¥{{item.goodsTagPrice}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' .brandList {display: flex;flex-wrap: nowrap;overflow-x:scroll; -webkit-overflow-scrolling : touch;} .brandList > div {flex: 0 0 auto;width: 30%;} .brandList img {width: 100%;} .twoLinebrand{width: 100%; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;font-family: PingFangSC-Regular;font-size: 14px;color: #555555;line-height:1.5rem;} .brandRecExtra {padding: 0px 4px; padding-top:1px; height: 16px; line-height: 14px; font-size: 9px; color: #fff; display: flex; align-items: center; background: linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%)} @media screen and (max-width: 330px) {.brandRec-extra {font-size: 1rem;}} .goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 } .goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== var timer; Vue.component('brandRecommendation-Template', { props: ['item', 'index'], template: '#brandRecommendation-Template', data: function() { return { goodsList: [], wrapperCounts: 0, moreImg: { width: 5 / 375 * window.innerWidth + "px", marginLeft: 5 / 375 * window.innerWidth + "px", top: (-1) * 1 / 375 * window.innerWidth + "px" }, clickCount: 0, labelExtra: { width: 32 / 375 * window.innerWidth + "px" }, brandWidth: "" } }, mounted: function() { var _this = this; if (window.innerWidth > 1024) { _this.brandWidth = 500; _this.moreImg = { width: 5 / 375 * _this.brandWidth + "px", marginLeft: 5 / 375 * _this.brandWidth + "px", top: (-1) * 1 / 375 * _this.brandWidth + "px" }; _this.labelExtra = { width: 32 / 375 * _this.brandWidth + "px" } } else { _this.brandWidth = window.innerWidth; } $(".imgCount").css({ 'backgroundColor': "#F5F5F5" }); $(".imgCount")[0].style.backgroundColor = "#Fdd000"; $(".brandReW").css({ "padding-top": _this.brandWidth * 0.05 + "px", "padding-bottom": _this.brandWidth * 10 / 375 + "px", }); _this.goodsList = _this.item.listData.brands[0].goodsList; _this.scrollBrand(); }, methods: { changeBrand: function(goods, index, brandId,plateId) { console.log('changeBrand',goods, index, brandId,plateId); var _this = this; if (index == _this.clickCount) { if (_this.isAndorIosB() == "null") { var url = '/html/brand/brandStory?brandId=' + brandId; if (brandId != undefined) { if (plateId != undefined && plateId != "") { url += "&plateId=" + plateId; }; window.location.href = url; } } else { var actB = "", parB = ""; actB = "brandStory"; if (brandId != null) { parB = brandId; } if (_this.isAndorIosB() == "android") { window.android.__helloApp(actB, parB); } else if (_this.isAndorIosB() == "ios") { window.webkit.messageHandlers.__helloApp.postMessage([actB, parB]) } } } else if (index != _this.clickCount) { $(".imgCount").css({ 'backgroundColor': "#F5F5F5" }) $(".imgCount")[index].style.backgroundColor = "#Fdd000"; _this.goodsList = goods; _this.scrollBrand(); _this.clickCount = index; } }, scrollBrand: function() { var _this = this; setTimeout(function() { _this.wrapperCounts = _this.goodsList.length; var bLabelH = 0; console.log(_this.wrapperCounts) for (var i = 0; i < _this.goodsList.length; i++) { if ($(".brandWrapper" + _this.goodsList[i].id).height() != 0) { bLabelH = $(".brandWrapper" + _this.goodsList[i].id).height(); break; } } $(".parentBrand").css("marginTop", _this.brandWidth * 5 / 375 + "px"); $(".parentBrand").css("height", _this.brandWidth * 100 / 375 + _this.brandWidth * (5 + 5) / 375 + $('.twoLinebrand').height() + $('.brandList>div span').height() + bLabelH + 2 + 'px'); // $('.brandList').css({ // 'width':_this.wrapperCounts*(window.innerWidth*100/375+window.innerWidth*10/375)+window.innerWidth*0.05+ 'px', // 'height':window.innerWidth*100/375+window.innerWidth*(5+5)/375+$('.twoLinebrand').height()+$('.brandList>div span').height()+bLabelH +'px', // // }); $('.brandList>div').css({ 'width': _this.brandWidth * 100 / 375 + 'px', 'height': _this.brandWidth * 100 / 375 + _this.brandWidth * (5 + 5) / 375 + $('.twoLinebrand').height() + $('.brandList>div span').height() + bLabelH + 10 + 'px', "marginRight": _this.brandWidth * 10 / 375 + "px" }); $('.brandList>div:nth-child(1)').css("margin-left", _this.brandWidth * 0.05 + "px"); $('.twoLinebrand').css({ marginTop: _this.brandWidth * 5 / 375 + "px", fontSize: 13 / 375 * _this.brandWidth + "px", lineHeight: 17 / 375 * _this.brandWidth + "px" }); $(".twoPb").css({ fontSize: 14 / 375 * _this.brandWidth + "px" }) $(".twoPb1").css({ fontSize: 11 / 375 * _this.brandWidth + "px", marginLeft: 5 / 375 * _this.brandWidth + "px" }) }, 100) }, aGoods: function(allItem) { var _this = this; if (_this.isAndorIosB() == "null") { if (window.location.href.indexOf("activity") > -1) { _czc.push(['_trackEvent', "活动", "查看", "商品:" + allItem.id]); } else { _czc.push(['_trackEvent', "首页", "查看", "商品:" + allItem.id]); } setTimeout(function() { var u = navigator.userAgent; if (u.indexOf('MicroMessenger') == -1) { //说明不在微信中 // 走不在小程序的逻辑 if (allItem.plateId != "" && allItem.plateId != undefined) { window.location.href = '/html/commodity/goodsMessage?goodsId=' + allItem.id + "&plateId=" + allItem.plateId; } else { window.location.href = '/html/commodity/goodsMessage?goodsId=' + allItem.id; } } else { wx.miniProgram.getEnv(function(res) { if (res.miniprogram) { // 走在小程序的逻辑 if (allItem.plateId != "" && allItem.plateId != undefined) { wx.miniProgram.navigateTo({ url: '/pages/activity-detail/activity-detail?goodsId=' + allItem.id + "&plateId=" + allItem.plateId }); } else { wx.miniProgram.navigateTo({ url: '/pages/activity-detail/activity-detail?goodsId=' + allItem.id }); } } else { // // 走不在小程序的逻辑 if (allItem.plateId != "" && allItem.plateId != undefined) { window.location.href = '/html/commodity/goodsMessage?goodsId=' + allItem.id + "&plateId=" + allItem.plateId; } else { window.location.href = '/html/commodity/goodsMessage?goodsId=' + allItem.id; } } }) } // window.location.href = '../html/commodity/goodsMessage?goodsId=' + allItem.id; }, 300); } else { var actB = "", parB = ""; actB = "goodsDetail", parB = allItem.id; if (allItem.id != null) { parB = allItem.id; } if (_this.isAndorIosB() == "android") { window.android.__helloApp(actB, parB); } else if (_this.isAndorIosB() == "ios") { window.webkit.messageHandlers.__helloApp.postMessage([actB, parB]) } } }, isAndorIosB: function() { var ua = window.navigator.userAgent.toLowerCase(); var u = navigator.userAgent, app = navigator.appVersion; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端; if (isAndroid && ua.match(/MicroMessenger/i) != 'micromessenger') { return "android"; } else if (isiOS && ua.match(/MicroMessenger/i) != 'micromessenger') { return "ios"; } else { return "null" } } } }); //-------------------brandRecommendation Ends------------------- //-------------------hotSale Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='hotSale-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' .recommendSlide { display: flex; flex-wrap: nowrap; width: 100%; } .recommendSlide > div{ flex: 0 0 auto; width:28%; } .recommendSlide img { width: 100%; } .recommendSlideWrapper { width: 100%; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("hotSale-Template", { props: ['item', 'index'], template: "#hotSale-Template", data: function () { return { } }, created() { this.item.listData.items.forEach(item => { item.appParam = this.handleUrl(item.appParam) item.clickUrl = this.handleUrl(item.clickUrl) }) }, mounted: function () { $(".hotWrapper").css("padding-top", window.innerWidth * 0.05 + "px") var _this = this; if (this.item.listData.items[0].title == "") { $(".hotSaleScrollSec").css({ "height": (window.innerWidth * 172 / 372) + 10 + "px" }); $(".iconHeight").css({ "height": (window.innerWidth * 172 / 372) / 2 + "px" }) $(".hotSaleScrollSec>a").css({ "width": window.innerWidth * 86 / 375 + "px", "padding-right": window.innerWidth * 10 / 375 + "px", "box-sizing": "border-box", "padding-top": window.innerWidth * 10 / 375 + "px" }); $(".hotSaleScroll").css({ "height": (window.innerWidth * 172 / 372) + 2 + "px" }) } else { $(".hotSaleScrollSec").css({ "height": (window.innerWidth * 192 / 372) + 10 + "px" }); $(".iconHeight").css({ "height": (window.innerWidth * 192 / 372) / 2 + "px" }) $(".hotSaleScrollSec>a").css({ "width": window.innerWidth * 0.9 * 0.22 + "px", "margin-right": window.innerWidth * 0.05 * 13 / 20 + "px" }); $(".hotSaleScroll").css({ "height": (window.innerWidth * 192 / 372) + 2 + "px" }) } if ($(".hotSaleScrollSec>a").length == 8) { $(".hotSaleScrollSec").css("overflow-x", "hidden"); } $(".hotSaleScrollSec").css({ "width": (Math.ceil($(".hotSaleScrollSec>a").length / 2) * window.innerWidth * 0.9 * 0.22 + window.innerWidth * 0.9 * 0.12 / 8 * 2 * (Math.ceil($(".hotSaleScrollSec>a").length / 2))) + "px", // "margin-top":window.innerWidth*10/375+"px" }) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }) //-------------------hotSale Ends------------------- //-------------------recommend Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='recommend-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component("recommend-Template", { props: ['item'], template: "#recommend-Template", mounted: function () { this.item.listData.recs.forEach(item => { item.clickUrl = this.handleUrl(item.clickUrl) }) $(".reWrapper").css("padding-top", window.innerWidth * 0.05 + "px"); $(".recWrapper").css("margin-top", window.innerWidth * 10 / 375 + "px") }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------recommend Ends------------------- //-------------------singleRec Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='singleRec-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' .singleRecWrapper { box-shadow: 0 0px 6px 2px rgba(0, 0, 0, 0.10); width: 90%; margin: 0 auto; }.swiper-container-horizontal > .swiper-pagination-bullets{ bottom:0px;}.swiper-container { z-index: 0 !important;}.goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 } .goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("singleRecTemplate", { props: ['item'], template: "#singleRec-Template", data: function () { return { wrapperStyle: { width: (window.innerWidth>1024)? 500* 1 + 'px':window.innerWidth* 1 + 'px', paddingTop:(window.innerWidth>1024)?500*10/375+"px":window.innerWidth*10/375+"px" }, swiperSpan:{ fontSize:(window.innerWidth>1024)?500*17/375+"px":window.innerWidth*17/375+"px" }, labelExtra:{ width:(window.innerWidth>1024)?500*32/375+"px":32/375*window.innerWidth+"px", height:(window.innerWidth>1024)?500*15/375+"px":15/375*window.innerWidth+"px" }, sinRecWidth:"" } }, mounted: function () { var _this = this; if(window.innerWidth>1024){ _this.sinRecWidth = 500; }else{ _this.sinRecWidth = window.innerWidth; } $(".sRWrapper").css("padding-top",_this.sinRecWidth *0.05+"px"); $(".singleRecWrapper").css("margin-bottom",_this.sinRecWidth *0.05*0.75+"px"); //$("#singleRecWrapper").css("height",window.innerWidth*(200+23)/375+"px"); if(window.innerWidth>1024){ $("#singleRecWrapper").css("height",($(".singleRecWrapper").height()+23/375*_this.sinRecWidth+_this.sinRecWidth *0.05*0.75)+"px") }else{ $("#singleRecWrapper").css("height",($("#singleRecWrapper").height()+23/375*_this.sinRecWidth )+"px") } var singleRecswiper =new Swiper("#singleRecWrapper", { autoplay: { delay: 5000, disableOnInteraction: false }, direction:"horizontal", speed:500, grabCursor : true, loop:true, freeMode : false, touchMoveStopPropagation : false, pagination: { el: '.swiper-pagination', type: 'bullets', bulletElement : 'li' } }) } }); //-------------------singleRec Ends------------------- //-------------------separator Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='separator-Template'; var templateText = document.createTextNode('
为您推荐
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component("separatorTemplate", { template: '#separator-Template', mounted:function(){ $(".sepWrapper").css({ paddingTop:window.innerWidth*0.05+"px", paddingBottom:window.innerWidth*10/375+"px" }) } }); //-------------------separator Ends------------------- //-------------------imageBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='imageBanner-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component("imageBanner-Template", { props:['item'], data: function () { return { width: { width: '50%' } } }, template: '#imageBanner-Template', mounted:function () { this.item.listData.clickUrl = this.handleUrl(this.item.listData.clickUrl) $(".imgBanner").css("padding",window.innerWidth*10/375+"px"); $(".imgBanner>a").css("padding",window.innerWidth*10/375+"px") }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------imageBanner Ends------------------- //-------------------singleGoods Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='singleGoods-Template'; var templateText = document.createTextNode('
已售罄
已下架

{{ item.listData.goods[0].goodsName }}

¥{{ item.listData.goods[0].goodsVipPrice }}

¥{{ item.listData.goods[0].goodsTagPrice }}
\"\"
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' .extra {padding: 0px 4px; padding-top:1px; height: 16px; line-height: 14px; font-size: 9px; color: #fff; display: flex; align-items: center;background:linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%)} @media screen and (max-width: 330px) { .extra { font-size: 1rem; } }a,a:link,a:visited,a:hover,a:active{ text-decoration: none; color:inherit; }.goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 }.goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("singleGoodsTemplate", { props: ['item'], template: '#singleGoods-Template', data: function () { return { dataHref: '/html/commodity/goodsMessage?goodsId=', width: { width: '50%' }, labels: { width: '', position: 'absolute', top: '', left: 0, }, cData: "", appAct: "goodsDetail", labelExtra: { // width: "" height: '', }, singleWidth: "", } }, mounted: function () { let dataHref = this.dataHref + this.item.listData.goods[0].id let href = window.location.href let obj = {} let query = href.split('?')[1] if(query) { query = query.split('&') query.forEach((item, index) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) } if (Object.keys(obj).includes('sharerToken')) { this.dataHref = dataHref + '&sharerToken=' + obj.sharerToken } else { this.dataHref = dataHref } this._init(); }, methods: { _init: function () { this.labels.width = (window.innerWidth > 1024) ? 44 / 375 * 500 + "px" : 44 / 375 * window.innerWidth + "px"; this.labels.top = (window.innerWidth > 1024) ? 10 / 375 * 500 + "px" : 10 / 375 * window.innerWidth + "px"; // this.labelExtra.width = (window.innerWidth > 1024) ? 32 / 375 * 500 + "px" : 32 / 375 * window.innerWidth + "px"; this.labelExtra.height = "13px"; this.labelExtra.overflow = "hidden"; if (window.innerWidth > 1024) { this.singleWidth = 500; } else { this.singleWidth = window.innerWidth } var padding_num = this.singleWidth * 10 / 375; //$(".sinGoods").css({padding: padding_num + "px"}); $(".sinGoods").css({ "margin": padding_num + "px", "margin-top": "0", }).parent().css({ display: 'block' }); $(".sinGoods:odd").css({ 'margin-left': padding_num / 2 + "px", }); $(".sinGoods:even").css({ 'margin-right': padding_num / 2 + "px", }); $(".pStyle1").css({ marginTop: this.singleWidth * 5 / 375 + "px", fontSize: this.singleWidth * 14 / 375 + "px" }); var pStyle2_Fz = this.singleWidth * 13 / 375; $(".pStyle2").css({ 'fontSize': pStyle2_Fz + "px", 'overflow': 'hidden', 'height': '36px', 'line-height': '18px', // 'height': (pStyle2_Fz+4)*2+'px', // 'line-height': pStyle2_Fz+4+'px', }); $(".pStyle3").css({ marginBottom: this.singleWidth * 0 / 375 + "px", }); $(".pStyle4").css({ fontSize: this.singleWidth * 12 / 375 + "px", //marginLeft: 5 / 375 * this.singleWidth + "px" }); for (var i = 0; i < this.item.listData.goods[0].activityLabels.length; i++) { if (this.item.listData.goods[0].activityLabels[i].alType == 3) { this.cData = this.item.listData.goods[0].activityLabels[i].alPicture; break; } } } }, watch: { item(value) { this.item = value; this._init() } } }); //-------------------singleGoods Ends------------------- //-------------------singleImgBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='singleImgBanner-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component('singleImgBanner-Template', { template: '#singleImgBanner-Template', props: ['item', 'index'], data: function () { return { heightHtml: { height: (window.innerWidth > 1024) ? (500 * 125 / 375) + "px" : (window.innerWidth * 125 / 375) + "px" } } }, mounted() { this.item.listData.clickUrl = this.handleUrl(this.item.listData.clickUrl) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------singleImgBanner Ends------------------- //-------------------threeImgBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='threeImgBanner-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}查看更多
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component('threeImgBanner-Template', { template: '#threeImgBanner-Template', props: ['item', 'index'], data: function () { return { heightHtml: { height: (window.innerWidth * 227 / 375) + "px" }, heightSmallHtml: { height: (window.innerWidth * 109 / 375) + "px" }, moreImg: { width: 5 / 375 * window.innerWidth + "px", marginLeft: 5 / 375 * window.innerWidth + "px", top: (-1) * 1 / 375 * window.innerWidth + "px" } } }, mounted: function () { this.item.listData.moreUrl = this.handleUrl(this.item.listData.moreUrl) this.item.listData.imgUrlList.forEach(item => { item.clickUrl = this.handleUrl(item.clickUrl) }) $(".threeWrapper").css("paddingTop", window.innerWidth * 0.05 + "px") $(".threeImg").css({ paddingTop: window.innerWidth * 10 / 375 + "px", }); $(".smallThree").css({ marginBottom: window.innerWidth * 9 / 375 + "px", }); $(".smallThreeParent").css({ paddingLeft: window.innerWidth * 10 / 375 + "px" }) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------threeImgBanner Ends------------------- //-------------------scrollableIconList Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='scrollableIconList-Template'; var templateText = document.createTextNode('

{{listItem.title}}

'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.scrollableA p { width: 100%; display: flex; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-flow: column nowrap; align-items: center;}'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("scrollableIconList-Template", { template: "#scrollableIconList-Template", props: ["item", "index"], data: function () { var lj_sale = 60; return { lj_sale: lj_sale, ljstyle1: { position: 'absolute', bottom: '6px', width: lj_sale + 'px', height: '4px', left: '50%', marginLeft: '-30px', borderRadius: '10px', overflow: 'hidden', backgroundColor: '#ddd', }, ljstyle2: { position: 'absolute', backgroundColor: '#00ACFF', left: '0', top: '0', borderRadius: '10px', bottom: '0', width: '0' }, isLjBottoom: false, listHeight: { height: (window.innerWidth > 1024) ? (500 * 164 / 375) + "px" : (window.innerWidth * 164 / 375) + "px" }, iconHeight: { height: (window.innerWidth > 1024) ? (500 * 164 / 375) / 2.1 + "px" : (window.innerWidth * 164 / 375) / 2.1 + "px" }, iconScroll: {}, scrollableWidth: "", } }, methods: { lj_bottomFN: function () { var _this = this; var lj_iconListScrollSec = $(".iconListScrollSec"); var lj_offsetWidth = lj_iconListScrollSec[0].offsetWidth; var lj_scrollWidth = lj_iconListScrollSec[0].scrollWidth; var lj_scrollLeft = lj_iconListScrollSec[0].scrollLeft; var lj_count = Math.ceil(lj_scrollWidth / lj_offsetWidth); // var lj_cur = 0; var sale = this.lj_sale / lj_iconListScrollSec[0].scrollWidth; this.ljstyle2.width = lj_offsetWidth * sale + 'px'; _this.isLjBottoom = (lj_count > 1) ? true : false; console.log(lj_count); // console.log(lj_offsetWidth,lj_scrollWidth,lj_scrollLeft); lj_iconListScrollSec.scroll(function (event) { var scrollLeft = event.currentTarget.scrollLeft * sale; _this.ljstyle2.left = scrollLeft + 'px'; // console.log('scrollLeft',scrollLeft); }) }, handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } }, mounted: function () { var _this = this; if (window.innerWidth > 1024) { _this.scrollableWidth = 500; } else { _this.scrollableWidth = window.innerWidth; } $.each(_this.item.listData.itemContentList, function (index, item) { switch (item.appAction) { case "url": item.clickUrl = _this.handleUrl(item.appParam); break; case "sceneRecom": item.clickUrl = _this.handleUrl("/html/sceneRecommend/sceneRecommend"); break; case "salesCenter": item.clickUrl = _this.handleUrl("/html/personalCenter/couponCenter"); break; case "goodsDetail": item.clickUrl = _this.handleUrl("/html/commodity/goodsMessage?goodsId=" + item.appParam); break; case "brandCenter": item.clickUrl = _this.handleUrl("/html/brand/brandPlace"); break; case "goodsList": item.clickUrl = _this.handleUrl("/html/search/searchCotent?categoryId=" + item.appParam); default: break; } }) var count = _this.item.listData.itemContentList.length; var iconListScrollSecWidth = 0; var sale_i = 1; var sale_ih1 = 25; var sale_ih2 = 35; if (_this.scrollableWidth * sale_i * 0.2 * Math.ceil($(".iconListScroll >div >div").length / 2) > _this.scrollableWidth * sale_i) { iconListScrollSecWidth = _this.scrollableWidth * sale_i + "px" } else { iconListScrollSecWidth = _this.scrollableWidth * sale_i * 0.2 * Math.ceil($(".iconListScroll >div >div").length / 2) + "px" } if (count < 2) { $(".iconListScrollSec").css({ "width": iconListScrollSecWidth, 'height': (_this.scrollableWidth * 164 / 375) / 2.1 + sale_ih1 + "px", "padding-bottom": _this.scrollableWidth * 16 / 375 + "px" }) $(".iconListScroll").css({ "height": (_this.scrollableWidth * 164 / 375) / 2.1 + sale_ih1 + "px", "marginTop": 10 / 375 * _this.scrollableWidth + "px" }); } else { if (window.innerWidth > 1024) { $(".iconListScrollSec").css({ "width": iconListScrollSecWidth, 'height': (_this.scrollableWidth * 164 / 375) / 2.1 * 2 + sale_ih2 + "px", "padding-bottom": "4px" }) } else { $(".iconListScrollSec").css({ "width": iconListScrollSecWidth, 'height': (_this.scrollableWidth * 164 / 375) / 2.1 * 2 + sale_ih2 + "px", "padding-bottom": _this.scrollableWidth * 16 / 375 + 4 + "px" }) } $(".iconListScroll").css({ "height": (_this.scrollableWidth * 164 / 375) / 2.1 * 2 + sale_ih1 + "px", "marginTop": 10 / 375 * _this.scrollableWidth + "px" }); } $(".iconListScrollSec>div").css({ "width": _this.scrollableWidth * sale_i * 0.2 + "px", 'margin-bottom': '1px' }); $(".scrollableA").css({}); $(".scrollableA>p").css({ margin: 0, marginTop: _this.scrollableWidth * 8 / 375 + "px", fontSize: "12px", // fontSize: _this.scrollableWidth * 13 / 375 + "px", fontFamily: "PingFangSC-Regular" }) this.lj_bottomFN(); } }); //-------------------scrollableIconList Ends------------------- //-------------------smallSingleGoods Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='smallSingleGoods-Template'; var templateText = document.createTextNode('
已售罄
已下架

{{ item.listData.goods[0].goodsName }}

¥ {{ item.listData.goods[0].goodsVipPrice }} ¥ {{ item.listData.goods[0].goodsTagPrice }}

'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 } .goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("smallSingleGoodsTemplate", { props: ['item'], template: "#smallSingleGoods-Template", data: function () { return { width: { width: '50%', smallSingWidth: "", sharerToken: '' } } }, mounted: function () { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(query){ query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) } if (Object.keys(obj).includes('sharerToken')) sharerToken = '&sharerToken=' + obj.sharerToken this.sharerToken = sharerToken if (window.innerWidth > 1024) { this.smallSingWidth = 500 } else { this.smallSingWidth = window.innerWidth } var padding_num = this.smallSingWidth * 10 / 375; $(".sinGood").css({ padding: padding_num + "px", 'padding-top': '0' }); $(".sinGood:odd").css({ 'padding-left': padding_num / 2 + "px" }); $(".sinGood:even").css({ 'padding-right': padding_num / 2 + "px" }); $(".sinGood>a").css({ padding: this.smallSingWidth * 10 / 375 + "px" }); $(".sinGoodPStyle").css({ marginTop: this.smallSingWidth * 5 / 375 + "px", marginBottom: this.smallSingWidth * 5 / 375 + "px", fontSize: this.smallSingWidth * 12 / 375 + "px", color: "#666666" }); $(".sinGoodPStyle1").css({ margin: 0, marginBottom: this.smallSingWidth * 9 / 375 + "px", }) } }); //-------------------smallSingleGoods Ends------------------- //-------------------sevenImgBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='sevenImgBanner-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component('sevenImgBanner-Template', { template: '#sevenImgBanner-Template', props: ['item', 'index'], data: function () { return { heightHtml: { height: (window.innerWidth > 1024) ? (500 * 125 / 375) + "px" : (window.innerWidth * 125 / 375) + "px" }, sevenWidth: "" } }, mounted: function () { this.item.listData.imgUrlList.forEach(item => { if (item.clickUrl) item.clickUrl = this.handleUrl(item.clickUrl) }) if (window.innerWidth > 1024) { this.sevenWidth = 500; } else { this.sevenWidth = window.innerWidth; } $(".sevenWrapper").css("padding", this.sevenWidth * 10 / 375 + "px"); $(".sevenTop").css("marginBottom", this.sevenWidth * 5 / 375 + "px"); $(".sevenTop div").css({ "width": this.sevenWidth * 84.5 / 375 + "px", "height": this.sevenWidth * 125 / 375 + "px" }); $(".sevenTop div:nth-child(1)").css({ "width": this.sevenWidth * 175 / 375 + "px", }); $(".sevenTop div:nth-child(2)").css({ "marginLeft": this.sevenWidth * 5 / 375 + "px", "marginRight": this.sevenWidth * 5.1 / 375 + "px" }); $(".sevenBottom div").css({ "width": this.sevenWidth * 84.5 / 375 + "px", "height": this.sevenWidth * 125 / 375 + "px" }); $(".sevenBottom div:nth-child(2)").css({ "marginLeft": this.sevenWidth * 5.1 / 375 + "px", "marginRight": this.sevenWidth * 5.1 / 375 + "px" }); $(".sevenBottom div:nth-child(3)").css({ "marginRight": this.sevenWidth * 5.1 / 375 + "px" }) }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------sevenImgBanner Ends------------------- //-------------------scrollImgList Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='scrollImgList-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}} 查看更多
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component("scrollImgList-Template", { template: "#scrollImgList-Template", props: ["item", "index"], data: function () { return { listheight: { height: (window.innerWidth * 161 / 375) + "px", marginRight: (10 / 375 * window.innerWidth) + "px", width: window.innerWidth * 100 / 375 + "px" }, scrollImgList: {}, moreImg: { width: 5 / 375 * window.innerWidth + "px", marginLeft: 5 / 375 * window.innerWidth + "px", top: (-1) * 1 / 375 * window.innerWidth + "px" }, checkMore: {}, imgList: [], imgListObj: {}, scrollImgWidth: "" } }, mounted: function () { var _this = this; if (window.innerWidth > 1024) { _this.scrollImgWidth = 500; _this.listheight = { height: (_this.scrollImgWidth * 161 / 375) + "px", marginRight: (10 / 375 * _this.scrollImgWidth) + "px", width: _this.scrollImgWidth * 100 / 375 + "px" }; _this.moreImg = { width: 5 / 375 * _this.scrollImgWidth + "px", marginLeft: 5 / 375 * _this.scrollImgWidth + "px", top: (-1) * 1 / 375 * _this.scrollImgWidth + "px" } } else { _this.scrollImgWidth = window.innerWidth; } // 页面可多次搭配同一组件,样式必须限定在当前实例,禁止全局 $('.scrollImgList') var $root = $(_this.$el); $root.find(".groupWrpper").css("padding-top", _this.scrollImgWidth * 0.05 + "px"); console.log(_this.item.listData.appAction); _this.groupObj = _this.item.listData var widthLength = (_this.groupObj.itemContentList && _this.groupObj.itemContentList.length) || 0; var $scrollImgList = $root.find('.scrollImgList'); if ((_this.scrollImgWidth * 100 / 375 + _this.scrollImgWidth * 10 / 375) * widthLength + (_this.scrollImgWidth * 20 / 375) > _this.scrollImgWidth) { $scrollImgList.css({ 'width': _this.scrollImgWidth + 'px', 'height': (_this.scrollImgWidth * 161 / 375) + 10 + "px", 'padding-left': (_this.scrollImgWidth * 20 / 375) + "px" }); } else { $scrollImgList.css({ 'width': (_this.scrollImgWidth * 100 / 375 + _this.scrollImgWidth * 10 / 375) * widthLength + (_this.scrollImgWidth * 20 / 375) + 'px', 'height': (_this.scrollImgWidth * 161 / 375 + 10) + "px", 'padding-left': (_this.scrollImgWidth * 20 / 375) + "px" }); } $scrollImgList.children('div').css({ 'width': _this.scrollImgWidth * 100 / 375 + "px", 'height': _this.scrollImgWidth * 161 / 375 + "px", 'margin-right': _this.scrollImgWidth * 10 / 375 + "px" }); $scrollImgList.children('div:last-child').css({ 'margin-right': "0px" }); $root.find('.scrollImgListWrapper').css({ 'height': (_this.scrollImgWidth * 161 / 375) + 2 + "px", 'margin-top': _this.scrollImgWidth * 10 / 375 + "px", // "padding-left":_this.scrollImgWidth*20/375+"px" }); $root.find('.sLWrapper').css({ 'padding-top': _this.scrollImgWidth * 10 / 375 + "px", }); var actGoodsDetail_dataurl = "/html/commodity/goodsMessage"; switch (_this.groupObj.appAction) { case "url": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl(_this.groupObj.appParam), plateId: _this.groupObj.plateId }; break; case "sceneRecom": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/sceneRecommend/sceneRecommend"), plateId: _this.groupObj.plateId }; break; case "salesCenter": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/personalCenter/couponCenter?scene=1002&signin=b3V0Zml0"), plateId: _this.groupObj.plateId }; break; case "goodsDetail": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/commodity/goodsMessage?goodsId=" + item.appParam), plateId: _this.groupObj.plateId // goodsStatus:_this.groupObj.goods[0].indexGoodsType }; break; case "brandCenter": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/brand/brandPlace"), plateId: _this.groupObj.plateId }; break; case "groupActivity": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/groupActivity/groupGoodsList"), plateId: _this.groupObj.plateId }; break; case "brandDetail": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl("/html/brand/brandStory?brandId=" + item.appParam), plateId: _this.groupObj.plateId }; break; case "groupDetail": _this.checkMore = { appAction: _this.groupObj.appAction, appParam: _this.groupObj.appParam, dataUrl: _this.handleUrl(actGoodsDetail_dataurl + "?goodsId=" + item.appParam), plateId: _this.groupObj.plateId }; break; default: break; } $.each(_this.groupObj.itemContentList, function (index, item) { switch (item.appAction) { case "url": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl(_this.groupObj.appParam), dataImg: item.imageUrl, plateId: item.plateId }; break; case "sceneRecom": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/sceneRecommend/sceneRecommend"), dataImg: item.imageUrl, plateId: item.plateId }; break; case "salesCenter": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/personalCenter/couponCenter?scene=1002&signin=b3V0Zml0"), dataImg: item.imageUrl, plateId: item.plateId }; break; case "goodsDetail": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/commodity/goodsMessage?goodsId=" + item.appParam), // goodsStatus:item.goods[0].indexGoodsType, dataImg: item.imageUrl, plateId: item.plateId }; break; case "brandCenter": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/brand/brandPlace"), dataImg: item.imageUrl, plateId: item.plateId }; break; case "groupActivity": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/groupActivity/groupGoodsList"), dataImg: item.imageUrl, plateId: item.plateId }; break; case "brandDetail": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/brand/brandStory?brandId=" + item.appParam), dataImg: item.imageUrl, plateId: item.plateId }; break; case "groupDetail": _this.imgListObj = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl(actGoodsDetail_dataurl + "?goodsId=" + item.appParam), dataImg: item.imageUrl, plateId: item.plateId }; break; default: break; } _this.imgList.push(_this.imgListObj) }) // var widthLength = $(".scrollImgList>div").length; }, methods: { handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if (!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } } }); //-------------------scrollImgList Ends------------------- //-------------------fullscreenImgBanner Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='fullscreenImgBanner-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== Vue.component('fullscreenImgBanner-Template', { template: '#fullscreenImgBanner-Template', props: ['item', 'index'], data: function () { return { heightHtml: { height: (window.innerWidth * 492 / 375) + "px" } } }, created() { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(query){ query = query.split('&') query.forEach((item, index) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (this.item.listData.clickUrl.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } this.item.listData.clickUrl += sharerToken } }, mounted: function () { $(".fullImg").css("margin-top", window.innerWidth * 10 / 375 + "px"); $(".fullWrapper").css("padding-top", window.innerWidth * 0.05 + "px") } }); //-------------------fullscreenImgBanner Ends------------------- //-------------------goodsListWithImage Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='goodsListWithImage-Template'; var templateText = document.createTextNode('
{{item.listData.mainTitle}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.brandRec-goodsList { display: flex; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; width: 100%; }.goodsListWithImgStyle::-webkit-scrollbar { width: 0px } .brandRec-goodsList > div { flex: 0 0 auto; width: 30%; } .brandRec-goodsList img { width: 100%; } .twoLine{ width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; color: #555555; line-height:1.5rem; } .brandRec-extra { padding: 0px 4px; padding-top:1px; height: 16px; line-height: 14px; font-size: 9px; color: #fff; display: flex; align-items: center;background:linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%) } @media screen and (max-width: 330px) { .brandRec-extra { font-size: 1rem; } }.goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 } .goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component('goodsListWithImage-Template', { props: ['item', 'index'], template: '#goodsListWithImage-Template', data: function () { return { imgHeight: { // height:(window.innerWidth*113/375) + "px" }, imageWrapper: { paddingLeft: '', marginTop: '' }, lineStyle: { fontSize: '', marginTop: '', lineHeight: '' }, goodsList: [], scrollbrandGoods: {}, labelExtra: { width: '' }, goodslistWidth: "" } }, created() { this.item.listData.goodsList.forEach((item) => { item.id = this.handleUrl(item.id) }) this.item.listData.imgHref = this.handleUrl(this.item.listData.imgHref) }, mounted: function () { this._init(); }, methods: { _init: function () { var _this = this; _this.imageWrapper = { paddingLeft: (window.innerWidth > 1024) ? 500 * 0.05 * 0.75 + "px" : window.innerWidth * 0.05 * 0.75 + "px", marginTop: (window.innerWidth > 1024) ? 500 * 5 / 375 + "px" : window.innerWidth * 5 / 375 + "px" }; _this.lineStyle = { fontSize: (window.innerWidth > 1024) ? 13 / 375 * 500 + "px" : 13 / 375 * window.innerWidth + "px", marginTop: (window.innerWidth > 1024) ? 5 / 375 * 500 + "px" : 5 / 375 * window.innerWidth + "px", lineHeight: (window.innerWidth > 1024) ? 17 / 375 * 500 + "px" : 17 / 375 * window.innerWidth + "px" }; _this.labelExtra.width = (window.innerWidth > 1024) ? 32 / 375 * 500 + "px" : 32 / 375 * window.innerWidth + "px"; if (window.innerWidth > 1024) { _this.goodslistWidth = 500; } else { _this.goodslistWidth = window.innerWidth; } _this.wrapperCounts = this.item.listData.goodsList.length; if (_this.item.listData.mainTitle != "") { $(".titleG" + _this.item.listData.goodsList[0].id).css("margin-bottom", _this.goodslistWidth * 10 / 375 + "px"); } $('.withImg').css({ paddingTop: _this.goodslistWidth * 0.05 + "px" }); var labelH = 0; for (var i = 0; i < _this.item.listData.goodsList.length; i++) { if ($(".brandRecWrapper" + _this.item.listData.goodsList[i].id).height() != 0) { labelH = $(".brandRecWrapper" + _this.item.listData.goodsList[i].id).height(); break; } } $(".twoP").css({ fontSize: 14 / 375 * _this.goodslistWidth + "px" }) $(".twoP1").css({ fontSize: 11 / 375 * _this.goodslistWidth + "px", marginLeft: 5 / 375 * _this.goodslistWidth + "px", }) $(".brandRec-goodsList" + _this.item.listData.goodsList[0].id + ">div").css({ 'width': _this.goodslistWidth * 100 / 375 + 'px', 'height': _this.goodslistWidth * 100 / 375 + _this.goodslistWidth * 5 / 375 + $('.twoLine').height() + $(".brandRec-goodsList" + _this.item.listData.goodsList[0].id + ">div span").height() + labelH + 'px', 'marginRight': _this.goodslistWidth * 10 / 375 + "px" }); $(".brandRec-goodsList" + _this.item.listData.goodsList[0].id).css({ 'height': _this.goodslistWidth * 100 / 375 + _this.goodslistWidth * 5 / 375 + $('.twoLine').height() + $(".brandRec-goodsList" + _this.item.listData.goodsList[0].id + ">div span").height() + labelH + 14 + 'px' }); $(".brandRecGoodsListWrapper" + _this.item.listData.goodsList[0].id).css({ 'height': _this.goodslistWidth * 100 / 375 + _this.goodslistWidth * 5 / 375 + $('.twoLine').height() + $(".brandRec-goodsList" + _this.item.listData.goodsList[0].id + ">div span").height() + labelH + 'px' }) // $(".goodsListWithImgStyle").css("height",$(".goodsListWithImgStyle").height()+10+"px"); // $(".goodsListWithImgStyleParent").css("height",$(".goodsListWithImgStyle").height()-8+"px"); // $(".twoLine").css("marginTop",window.innerWidth*5/375+"px") }, handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = '&sharerToken=' + obj.sharerToken return item += sharerToken } }, watch: { item(value) { this.item = value; console.log('goodsListWithImage', value) this._init() } } }); //-------------------goodsListWithImage Ends------------------- //-------------------line Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='line-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode(' lineParent{ } .ce{ display: block; border-bottom:1px solid #cccccc; -webkit-transform: scale(0.5, 0.5); transform: scale(0.5, 0.5); }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("line-Template", { template: "#line-Template", props:['item'], data: function () { return { fontStyle: { fontSize: window.innerWidth * 14 / 375 + 'px' } } }, mounted:function () { } }); //-------------------line Ends------------------- //-------------------line2 Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='line2-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.ce{ display: block; border-bottom:1px solid #cccccc; -webkit-transform: scale(0.5, 0.5); transform: scale(0.5, 0.5); }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("line2-Template", { template: "#line2-Template", props:['item'], data: function () { return { fontStyle: { fontSize: window.innerWidth * 14 / 375 + 'px', marginTop:window.innerWidth*20/375+"px" } } }, mounted:function () { } }); //-------------------line2 Ends------------------- //-------------------sharePage Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='sharePage-Template'; var templateText = document.createTextNode('
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Script=============== $(function () { var ifShare,firstTitle,secondTitle,imgShare,urlShare; Vue.component('sharePage-Template', { props: ['item'], template: '#sharePage-Template', data:function () { return { // ifShare:"", } }, mounted: function () { this.$nextTick(function () { var _this = this; console.log(this.item.listData.ifShare+this.item.listData.firstTitle+this.item.listData.secondTitle+this.item.listData.imgUrl) // _this.ifShare = this.item.listData.ifShare; ifShare = this.item.listData.ifShare; firstTitle = this.item.listData.firstTitle; secondTitle = this.item.listData.secondTitle; imgShare = this.item.listData.imgUrl; if(ifShare==1){ document.title = firstTitle; window.setDocumentTitle = function(title) { var i = document.createElement('iframe'); i.src = '../favicon.ico'; i.style.display = 'none'; i.onload = function() { setTimeout(function(){ i.remove(); }, 9) } document.body.appendChild(i); } } //urlShare = window.location.origin+"/html/share?page="+window.location.pathname+window.location.search+"?fromid="+$.cookie("auth_unionId") if(isAndorIosC() == "null"){ }else{ if (isAndorIosC() == "android"){ window.android.enableShare(this.item.listData.ifShare) }else if (isAndorIosC()=="ios"){ window.webkit.messageHandlers.enableShare.postMessage(this.item.listData.ifShare) } } }); } }); function isAndorIosC(){ var ua = window.navigator.userAgent.toLowerCase(); var u = navigator.userAgent, app = navigator.appVersion; var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端; if (isAndroid&&ua.match(/MicroMessenger/i) != 'micromessenger'){ return "android"; }else if (isiOS&&ua.match(/MicroMessenger/i) != 'micromessenger'){ return "ios"; }else { return "null" } }; function enableShare(state) { console.log(state) }; window["__getShareStr"] = function (msg) { var w=navigator.userAgent.indexOf('sign'); var aa = navigator.userAgent.substring(w) var arrA=[]; arrA=aa.split(";"); var arrB = []; arrB = arrA[0].split(":"); var objShare={}; for(var i=0;i
\"\"
已售罄
已下架
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.lineFont{ display:-webkit-box; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }.goodsCanBuy{ width: 100%; height: 100%; position: absolute; top: 0; left: 0; background-color: rgba(0,0,0,0.4); display: inline-flex; justify-content: center; align-items: center; z-index:10 } .goodsCanBuy>div{ font-size: 20px; color: #FFFFFF; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component("changeWidthGoodsTemplate", { props: ['item'], template: '#changeWidthGoods-Template', data: function () { return { wGoodsWidth: { width: '', }, changeList: [ ], changeItem: { appAction: "", appParam: "", dataUrl: "", } } }, mounted: function () { this._init() }, methods: { _init: function () { var _this = this; var changeList = []; _this.wGoodsWidth.width = (window.innerWidth > 1024) ? 500 / this.item.listData.changeWidthList.length + "px" : window.innerWidth / this.item.listData.changeWidthList.length + "px"; $.each(this.item.listData.changeWidthList, function (index, item) { switch (item.appAction) { case "url": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl(item.appParam), dataImg: item.pic, plateId: item.plateId }; break; case "sceneRecom": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/sceneRecommend/sceneRecommend"), dataImg: item.pic, plateId: item.plateId, }; break; case "salesCenter": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/personalCenter/couponCenter?scene=1002&signin=b3V0Zml0"), dataImg: item.pic, plateId: item.plateId }; break; case "goodsDetail": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/commodity/goodsMessage?goodsId=" + item.appParam), dataImg: item.pic, goodsStatus: item.goods[0].indexGoodsType, plateId: item.plateId }; break; case "brandCenter": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/brand/brandPlace"), dataImg: item.pic, plateId: item.plateId }; break; case "groupActivity": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("/html/groupActivity/groupGoodsList"), dataImg: item.pic, plateId: item.plateId }; break;; case "brandDetail": _this.changeItem = { appAction: item.appAction, appParam: item.appParam, dataUrl: _this.handleUrl("../html/brand/brandStory?brandId=" + item.appParam), dataImg: item.pic, plateId: item.plateId }; break; default: break; } changeList.push(_this.changeItem); }) _this.changeList = changeList; }, handleUrl(item) { let href = window.location.href let obj = {} let sharerToken = '' let query = href.split('?')[1] if(!query) return item query = query.split('&') query.forEach((item) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) if (Object.keys(obj).includes('sharerToken')) sharerToken = 'sharerToken=' + obj.sharerToken if (item.indexOf("?") === -1) { sharerToken = "?" + sharerToken } else { sharerToken = "&" + sharerToken } return item += sharerToken } }, watch: { item(value) { this.item = value; console.log('changeWidthGoodsTemplate3', value) this._init() } } }); //-------------------changeWidthGoods Ends------------------- //-------------------schedule Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='schedule-Template'; var templateText = document.createTextNode('
5?\'navBar-scrollbox\':\'navBar-flexbox\']\">
{{el1.mainTitle}}
{{el1.subTitle}}
\"\"
{{el.goodsMainTitle || el.mainTitle}}
{{el.goodsSubTitle || el.subTitle}}
¥{{el.goodsVipPrice}}
¥{{el.goodsTagPrice}}
已售:{{el.sellingCount}}件
{{el.percentDesc}}
即将开始
{{el.buttonText}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.marketAxis { background-color: #F8F8F8;}.marketAxis .navBarBox { height: auto;}.marketAxis .navBarBox.navBar-flexbox { width: 100%; display: -webkit-box; -webkit-box-pack: center;}.marketAxis .navBarBox.navBar-flexbox .navBar-li { -webkit-box-flex: 1;}.marketAxis .navBar-li { text-align: center; padding: 10px 0 0;}.marketAxis .navBar-tit { color: #555; font-size: 14px;}.marketAxis .navBar-sub { color: #999; font-size: 10px;}.marketAxis .navBar-line { width: 48%; height: 3px; background-color: #00ACFF; border-radius: 2px; margin: 5px auto 0; opacity: 0;}.marketAxis .navBarActive { position: relative; top: -2px;}.marketAxis .navBarActive .navBar-tit { font-weight: bold; font-size: 16px;}.marketAxis .navBarActive .navBar-tit,.marketAxis .navBarActive .navBar-sub { color: #00ACFF;}.marketAxis .navBarActive .navBar-line { opacity: 1;}.marketAxis .navBarBox.navBar-scrollbox { overflow: auto; overflow-y: hidden; display: flex; white-space: nowrap; margin: 0 5px; width: 100%;}.marketAxis .navBarBox.navBar-scrollbox::-webkit-scrollbar { display: none;}.marketAxis .navBarBox.navBar-scrollbox .navBar-li { min-width: 18%; /* padding-left: 10px; padding-right: 10px; */ margin: 0 10px; flex-grow: 0; flex-shrink: 0;}.marketAxis .navBarBox.navBar-scrollbox .navBar-li .navBar-line { /*width: 100%;*/ width: 82%;}.marketAxis .navBarBox.navBar-scrollbox::-webkit-scrollbar { display: none;}.imgbox { display: block; position: relative; overflow: hidden; line-height: 1; height: 0; width: 100%; padding-bottom: 100%;}.imgbox .imgbox-img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; object-fit: cover;}.goodsHorizontalList { width: 100%; padding: 0;}.goodsHorizontalList .proList { padding: 10px 10px 0;}.goodsHorizontalList .pro-li { background-color: #fff; border-radius: 4px; padding: 8px; display: -webkit-box;}.goodsHorizontalList .pro-imgbox { width: 36%; border-radius: 4px; overflow: hidden; display: -webkit-box; -webkit-box-align: center;}.goodsHorizontalList .pro-imgbox .imgbox { background-color: #eee; border-radius: 4px; overflow: hidden;}.goodsHorizontalList .pro-flex { -webkit-box-flex: 1; margin-left: 8px; display: -webkit-box; display: -webkit-flex; display: flex; justify-content: space-between; -webkit-flex-direction: column; flex-direction: column;}.goodsHorizontalList .pro-title { font-size: 14px; font-weight: bold; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}.goodsHorizontalList .pro-sub { color: #999; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; margin-top: 3px;}.goodsHorizontalList .tag-box { margin-top: 5px;}.goodsHorizontalList .goods-tag { background: #FFE8E9; color: #FF4449;}.goodsHorizontalList .pro-bot { margin-top: 8px; display: -webkit-box; -webkit-box-align: end;}.goodsHorizontalList .pro-bot-left { -webkit-box-flex: 1; overflow: hidden;}.goodsHorizontalList .vip-price { color: #FF4449; font-weight: bold; font-size: 10px;}.goodsHorizontalList .vip-price .pro-prc-span { font-size: 17px;}.goodsHorizontalList .old-price { color: #999; font-size: 11px; text-decoration: line-through;}.goodsHorizontalList .pro-button { background:linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%); font-size: 12px; line-height: 1.5; border-radius: 4px; padding: 3px 18px 3px 7px; margin-bottom: 3px; position: relative; color:#fff;}.goodsHorizontalList .pro-button:after { position: absolute; content: ""; width: 6px; height: 6px; border-top: 1px solid #333; border-left: 1px solid #333; transform: rotate(135deg); -webkit-transform: rotate(135deg); top: 50%; margin-top: -3px; right: 10px;}.goodsHorizontalList .pro-button.old-button { background: #333333; color: #fff;}.goodsHorizontalList .pro-button.old-button:after { border-color: #fff;}.goodsHorizontalList .percent-tips { font-size: 8px; color: #666666; text-align: right;}.goodsHorizontalList .percentBox { margin-bottom: 5px;}.goodsHorizontalList .percent-bar { background-color: #eee; width: 100%; position: relative; height: 5px; line-height: 1; margin-top: 3px; border-radius: 50px; overflow: hidden;}.goodsHorizontalList .percent-value { background-color: #FDD000; position: absolute; left: 0; top: 0; bottom: 0;}.goodsHorizontalList .old-row { display: -webkit-box; -webkit-box-align: center;}.goodsHorizontalList .old-count { font-size: 10px; color: #999; margin-left: 7px;}/* 垃圾 */.goodsHorizontalList .lj-button{ background:linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%); font-size: 12px; line-height: 1.5; border-radius: 4px; margin-bottom: 3px; position: relative; min-width: 73px; height: 24px; line-height: 24px; overflow: hidden; display: inline-block; text-align: center; -webkit-box-sizing: border-box; box-sizing: border-box; padding: 0 3px; color:#fff;}.goodsHorizontalList .lj-button-jt{ display: inline-block; position: relative; width: 6px; height: 6px; border-top: 1px solid #fff; border-left: 1px solid #fff; transform: rotate(135deg); -webkit-transform: rotate(135deg); vertical-align: 1px;}.goodsHorizontalList .lj-button.old-button { background: #333333; color: #fff;}.goodsHorizontalList .lj-button.old-button .lj-button-jt{ border-color: #fff;}'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component('schedule-Template', { //行装 props: ['item'], template: '#schedule-Template', watch: { item(value) { this.item = value; console.log('item', value) this._getInit() } }, data: function () { return { //正 nodeSet: [], currentMacketNode: 0, isTime: 0, subTitle_cur: '', //当前副标 subTitle_next: '', //下一副标 bgColor: 'F8F8F8', //行装 // item: null, } }, created: function () { console.log('created') //行装 this._getInit() // this.lj_item(); }, mounted: function () { console.log('schedule-Template') }, methods: { _getInit: function () { var _this = this; if (_this.item && _this.item.listData) { var listData = _this.item.listData; if (listData.nodeSet) _this.nodeSet = listData.nodeSet; _this.currentMacketNode = listData.currentMacketNode || 0; _this.isTime = listData.isTime || 0; _this.subTitle_cur = listData.subTitle_cur || ''; _this.subTitle_next = listData.subTitle_next || ''; if (listData.bgColor) _this.bgColor = listData.bgColor; if (_this.nodeSet.length > 5) { _this.$nextTick(function () { var aleft = $('.navBarActive').offset().left - 152; console.log(aleft); $(".navBarBox").scrollLeft(aleft); }); } } }, go_goodsMessage: function (el) { var host = window.location.host; if (host === "a.outdoorclub.com.cn" || host === "testa.outdoorclub.com.cn" || host === "10.0.0.35") return false; console.log('点击', el); let href = window.location.href let obj = {} let query = href.split('?')[1] if(query){ query = query.split('&') query.forEach((item, index) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) } var html = '/html/commodity/goodsMessage?goodsId=' + el.id if (el.plateId) html += '&plateId=' + el.plateId; if (Object.keys(obj).includes('sharerToken')) html += '&sharerToken=' + obj.sharerToken console.log('跳转', html); window.location.href = html; }, }, }); //-------------------schedule Ends------------------- //-------------------horizontalSingleGoods Component------------------- //=============Insert template=============== var template = document.createElement('script'); template.type='x-template'; template.id='horizontalSingleGoods-Template'; var templateText = document.createTextNode('
\"\"
{{el.goodsMainTitle || el.mainTitle}}
{{el.goodsSubTitle || el.subTitle}}
¥{{el.goodsVipPrice}}
¥{{el.goodsTagPrice}}
已售:{{el.sellingCount}}件
{{el.buttonText}}
{{el.buttonText}}
'); template.appendChild(templateText); document.head.insertBefore(template,null); //=============Insert CSS=============== var css = document.createElement('style'); var cssText = document.createTextNode('.imgbox{ display: block; position: relative; overflow: hidden; line-height: 1; height: 0; width: 100%; padding-bottom: 100%; } .imgbox .imgbox-img{ position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; object-fit:cover; } .goodsHorizontalList{ width: 100%; padding: 0; } .goodsHorizontalList .proList{ padding: 10px 10px 0; } .goodsHorizontalList .pro-li{ background-color: #fff; border-radius: 4px; padding: 8px; display:-webkit-box; } .goodsHorizontalList .pro-imgbox{ width: 36%; border-radius: 4px; overflow: hidden;display:-webkit-box;-webkit-box-align:center; }.goodsHorizontalList .pro-imgbox .imgbox{background-color:#eee;border-radius: 4px;overflow: hidden;} .goodsHorizontalList .pro-flex{ -webkit-box-flex:1; margin-left: 8px; display:-webkit-box; display: -webkit-flex; display: flex; justify-content: space-between; -webkit-flex-direction:column; flex-direction: column; } .goodsHorizontalList .pro-title{ font-size: 14px; font-weight: bold; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; } .goodsHorizontalList .pro-sub{ color: #999; font-size: 11px; text-overflow:ellipsis; white-space:nowrap; overflow:hidden; margin-top: 3px; } .goodsHorizontalList .tag-box{ margin-top: 5px; } .goodsHorizontalList .goods-tag{ background:#FFE8E9; color: #FF4449; } .goodsHorizontalList .pro-bot{ margin-top: 8px; display:-webkit-box; -webkit-box-align:end; } .goodsHorizontalList .pro-bot-left{ -webkit-box-flex:1; overflow: hidden; } .goodsHorizontalList .vip-price{ color: #FF4449; font-weight: bold; font-size: 10px; } .goodsHorizontalList .vip-price .pro-prc-span{ font-size: 17px; } .goodsHorizontalList .old-price{ color: #999; font-size: 11px; text-decoration: line-through; } .goodsHorizontalList .pro-button{display:inline-block;text-align:center;min-width:73px;box-sizing: border-box; color:#fff; background: linear-gradient(135deg, #00D0E2 0%, #00ACFF 100%); font-size: 12px; line-height: 1.5; border-radius: 4px; padding: 3px 18px 3px 7px; margin-bottom: 3px; position: relative; } .goodsHorizontalList .pro-button:after{ position: absolute; content: ""; width: 6px; height: 6px; border-top: 1px solid #fff;border-left: 1px solid #fff; transform:rotate(135deg);-webkit-transform:rotate(135deg); top: 50%; margin-top: -3px; right: 10px; } .goodsHorizontalList .pro-button.old-button{ background:#333333; color: #fff; } .goodsHorizontalList .pro-button.old-button:after{ border-color: #fff; } .goodsHorizontalList .percent-tips{ font-size: 8px; color: #666666; text-align: right; } .goodsHorizontalList .percentBox{ margin-bottom: 5px; } .goodsHorizontalList .percent-bar{ background-color: #eee; width: 100%; position: relative; height: 5px; line-height: 1; margin-top: 3px; border-radius: 50px; overflow: hidden; } .goodsHorizontalList .percent-value{ background-color: #00ACFF; position: absolute; left: 0; top: 0; bottom: 0; } .goodsHorizontalList .old-row{ display:-webkit-box; -webkit-box-align:center; } .goodsHorizontalList .old-count{ font-size: 10px; color: #999; margin-left: 7px; }'); css.appendChild(cssText); document.head.insertBefore(css,null); //=============Script=============== Vue.component('horizontalSingleGoods-Template', { //行装 props: ['item'], template: '#horizontalSingleGoods-Template', watch: { item(value) { this.item = value; this._getInit() } }, data: function () { return { //正 goodsHorizontalList: [], bgColor: 'F8F8F8', //行装 // item: null, } }, created: function () { console.log('created') //行装 this._getInit() // this.lj_item(); }, mounted: function () { console.log('horizontalSingleGoods-Template') }, methods: { _getInit: function () { var _this = this; if (_this.item && _this.item.listData) { var listData = _this.item.listData; if (listData.bgColor) _this.bgColor = listData.bgColor; _this.goodsHorizontalList = listData.goodsHorizontalList || listData.goods_horizontal || []; } }, go_goodsMessage: function (el) { let href = window.location.href let obj = {} let query = href.split('?')[1] if(query) { query = query.split('&') query.forEach((item, index) => { let newarray = item.split('=') obj[newarray[0]] = newarray[1] }) } var host = window.location.host; if (host === "a.hpsmall.com" || host === "testa.outdoorclub.com.cn" || host === "10.0.0.35") return false; console.log('点击', el); var html = '/html/commodity/goodsMessage?goodsId=' + el.id var plateId_lml = el.plateId || this.getQueryString('plateId'); if (plateId_lml) html += '&plateId=' + plateId_lml; if (Object.keys(obj).includes('sharerToken')) html += '&sharerToken=' + obj.sharerToken window.location.href = html; }, getQueryString: function (name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; }, //行装 /*lj_item: function(){ var _this = this; return $._post(`/apishare/lockfansurl/axisMarketing`,{}).then(function(data){ _this.item = data; _this._getInit() }, function(err){ }); },*/ }, }); //-------------------horizontalSingleGoods Ends-------------------