1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pagesub-category-brands"],{"075e":function(t,e,i){"use strict";i.r(e);var n=i("9eda"),a=i("39b5");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("0add");var r=i("828b"),o=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"1cbc4450",null,!1,n["a"],void 0);e["default"]=o.exports},"0add":function(t,e,i){"use strict";var n=i("a3df"),a=i.n(n);a.a},2754:function(t,e,i){"use strict";i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=n(i("2634")),s=n(i("2fdc")),r=n(i("9b1b"));i("aa9c"),i("dd2b"),i("c223"),i("bf0f"),i("5c47");var o=n(i("075e")),c=i("8f59"),d={components:{brandProduct:o.default},data:function(){return{scrollLeft:0,isClickChange:!1,tabIndex:0,newsitems:[],tabBars:[{name:"关注",id:"guanzhu"},{name:"推荐",id:"tuijian"},{name:"体育",id:"tiyu"},{name:"热点",id:"redian"},{name:"财经",id:"caijing"},{name:"娱乐",id:"yule"},{name:"军事",id:"junshi"},{name:"历史",id:"lishi"},{name:"本地",id:"bendi"}]}},computed:(0,c.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin"]),onLoad:function(){uni.setNavigationBarTitle({title:this.__("推荐品牌")});var t=this;t.$.request({url:t.Config.URL.product.list_brands,loading:!1,success:function(e){t.setData({tabBars:e});for(var i=[],n=0,a=t.tabBars.length;n<a;n++)i.push({items:[]});t.newsitems=i,t.loadBrandsAndProduncts(0)}})},methods:(0,r.default)((0,r.default)({},(0,c.mapMutations)(["login","logout","getPlantformInfo","forceUserInfo","getUserInfo","showCartNum"])),{},{goDetail:function(t){uni.navigateTo({url:"/pages/template/tabbar/detail/detail?title="+t.title})},close:function(t,e){var i=this;uni.showModal({content:"是否删除本条信息?",success:function(n){n.confirm&&i.newsitems[t].items.splice(e,1)}})},loadMore:function(t){var e=this;setTimeout((function(){e.addData(t)}),1200)},addData:function(t){if(this.newsitems[t].total<=this.newsitems[t].page)this.newsitems[t].loadingText="没有更多了";else{var e=this.tabBars[this.tabIndex].brand_id;this.loadBrandsAndProduncts(e,this.newsitems[t].page+1)}},loadBrandsAndProduncts:function(t,e){var i=this,n={};n.brand_id=t,n.page=e,i.$.request({url:i.Config.URL.product.list_brands_products,loading:!1,data:n,success:function(t){if(t.page>1){var e=i.newsitems[i.tabIndex];e.items=e.items.concat(t.items),e.page=t.page,t.page>=t.total?e.loadingText=i.__("没有更多了"):e.loadingText=i.__("加载中...."),i.$set(i.newsitems,i.tabIndex,e)}else t.page>=t.total?t.loadingText=i.__("没有更多了"):t.loadingText=i.__("加载中...."),i.$set(i.newsitems,i.tabIndex,t)}})},changeTab:function(t){var e=this;return(0,s.default)((0,a.default)().mark((function i(){var n,s,r,o,c,d,l,u,f,p;return(0,a.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.target.current,0===e.newsitems[n].items.length&&(s=e.tabBars[n].brand_id,e.loadBrandsAndProduncts(s,1)),!e.isClickChange){i.next=6;break}return e.tabIndex=n,e.isClickChange=!1,i.abrupt("return");case 6:return i.next=8,e.getElSize("tab-bar");case 8:r=i.sent,o=r.scrollLeft,c=0,d=0;case 12:if(!(d<n)){i.next=20;break}return i.next=15,e.getElSize(e.tabBars[d].id);case 15:l=i.sent,c+=l.width;case 17:d++,i.next=12;break;case 20:return u=uni.getSystemInfoSync().windowWidth,i.next=23,e.getElSize(e.tabBars[n].id);case 23:f=i.sent,p=f.width,c+p-o>u&&(e.scrollLeft=c+p-u),c<o&&(e.scrollLeft=c),e.isClickChange=!1,e.tabIndex=n;case 29:case"end":return i.stop()}}),i)})))()},getElSize:function(t){return new Promise((function(e,i){uni.createSelectorQuery().select("#tab_"+t).fields({size:!0,scrollOffset:!0},(function(t){e(t)})).exec()}))},tapTab:function(t){var e=this;return(0,s.default)((0,a.default)().mark((function i(){var n,s,r;return(0,a.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.target.dataset.current,e.newsitems[n].items.length,e.tabIndex!==n){i.next=6;break}return i.abrupt("return",!1);case 6:return i.next=8,e.getElSize("tab-bar");case 8:s=i.sent,r=s.scrollLeft,e.scrollLeft=r,e.isClickChange=!0,e.tabIndex=n;case 13:case"end":return i.stop()}}),i)})))()}})};e.default=d},"36b4":function(t,e,i){"use strict";i.r(e);var n=i("2754"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=a.a},"39b5":function(t,e,i){"use strict";i.r(e);var n=i("a7c9"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=a.a},"3d41":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"uni-tab-bar"},[i("v-uni-scroll-view",{staticClass:"uni-swiper-tab",attrs:{id:"tab_tab-bar","scroll-x":!0,"scroll-left":t.scrollLeft}},t._l(t.tabBars,(function(e,n){return i("v-uni-view",{key:e.id,staticClass:"swiper-tab-list",class:t.tabIndex==n?"active":"",attrs:{id:"tab_"+e.id,"data-current":n},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.tapTab.apply(void 0,arguments)}}},[t._v(t._s(e.brand_name))])})),1),i("v-uni-swiper",{staticClass:"swiper-box",attrs:{current:t.tabIndex,duration:300},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.changeTab.apply(void 0,arguments)}}},t._l(t.newsitems,(function(e,n){return i("v-uni-swiper-item",{key:n},[i("v-uni-scroll-view",{staticClass:"list",attrs:{"scroll-y":!0},on:{scrolltolower:function(e){arguments[0]=e=t.$handleEvent(e),t.loadMore(n)}}},[t._l(e.items,(function(e,a){return[i("brand-product",{key:a+"_0",attrs:{options:e},on:{close:function(e){arguments[0]=e=t.$handleEvent(e),t.close(n,a)},click:function(i){arguments[0]=i=t.$handleEvent(i),t.goDetail(e)}}})]})),i("v-uni-view",{staticClass:"uni-tab-bar-loading"},[t._v(t._s(e.loadingText||t.__("加载中....")))])],2)],1)})),1)],1)},a=[]},"3e40":function(t,e,i){"use strict";var n=i("e636"),a=i.n(n);a.a},4336:function(t,e,i){"use strict";i.r(e);var n=i("3d41"),a=i("36b4");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("3e40");var r=i("828b"),o=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"4a4b643a",null,!1,n["a"],void 0);e["default"]=o.exports},9470:function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */[data-v-1cbc4450]:export{theme_bg:#f30213}uni-view[data-v-1cbc4450]{display:flex;flex-direction:column;box-sizing:border-box}.m-product-list[data-v-1cbc4450]{display:inline-block;position:relative;overflow:visible}.m-listv .m-product-item[data-v-1cbc4450]{width:%?220?%;margin:0;margin-top:%?120?%;padding-left:6px;margin-left:%?1?%;height:%?356?%;margin-bottom:%?1?%}.m-listv[data-v-1cbc4450]{margin:%?20?%!important;margin-top:%?120?%!important;border-width:%?1?%;border-style:solid;border-color:#c8c7cc;padding:0!important;background-color:#fff;min-height:%?300?%}.m-listv .m-product-img[data-v-1cbc4450]{width:%?200?%;height:%?200?%;padding:0}.m-product-img[data-v-1cbc4450]{float:left;text-align:center;width:%?200?%;height:%?200?%}.m-product-img uni-image[data-v-1cbc4450]{box-sizing:border-box;padding:%?0?%!important;width:%?200?%;height:%?200?%}.m-product-price1[data-v-1cbc4450]{font-size:%?32?%;color:#f30213;line-height:%?40?%}.m-product-price1 uni-label[data-v-1cbc4450]{font-size:%?24?%}.m-product-name2[data-v-1cbc4450]{font-size:%?28?%;box-sizing:border-box;padding-right:%?20?%;position:relative;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.m-listv .m-product-name2[data-v-1cbc4450]{width:%?240?%;box-sizing:border-box;padding:0 %?20?%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.m-listv .m-product-info1[data-v-1cbc4450]{height:%?200?%;width:100%}\n/*全部商品 end*/.m-product-price1[data-v-1cbc4450]{width:100%;display:flex;justify-content:space-between}.num[data-v-1cbc4450]{font-size:%?24?%;color:#717171;padding-right:%?20?%\n /*margin-left:260rpx; */}.money[data-v-1cbc4450]{display:inline-block}.media-image-left[data-v-1cbc4450]{flex-direction:row-reverse;position:absolute;z-index:9999999;top:-50px}.media-title[data-v-1cbc4450]{font-size:%?32?%;color:#555;margin-top:%?140?%;margin-left:%?20?%;line-height:%?40?%;height:%?40?%;width:%?440?%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis!important}.image-section[data-v-1cbc4450]{flex-direction:row;justify-content:space-between;padding-left:%?12?%}.image-section-right[data-v-1cbc4450]{margin-top:%?0?%;margin-left:%?10?%;width:%?200?%;height:%?200?%}.image-section-left[data-v-1cbc4450]{margin-top:%?0?%;margin-right:%?10?%;width:%?200?%;height:%?200?%}.image-list[data-v-1cbc4450]{width:%?200?%;height:%?200?%}',""]),t.exports=e},"9eda":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticStyle:{"background-color":"#e8e8e8"}},[i("v-uni-view",{class:{"m-product-list":1,"m-listv":1}},[i("v-uni-navigator",{attrs:{url:"/pages/product/list?brand_id="+t.options.brand_id+"&cname="+t.options.brand_name,"hover-class":"uni-list-cell-hover"}},[i("v-uni-view",{staticClass:"media-image-left "},[i("v-uni-view",{staticClass:"media-title "},[t._v(t._s(t.options.brand_name))]),i("v-uni-view",{staticClass:"image-section image-section-left"},[i("v-uni-image",{staticClass:"image-list",attrs:{src:t.options.brand_image}})],1)],1)],1),t._l(t.options.items,(function(e,n){return[i("v-uni-navigator",{key:n+"_0",staticClass:"m-product-item",attrs:{url:"/pages/product/detail?pid="+e.item_id,"hover-class":"uni-list-cell-hover"}},[i("v-uni-view",{staticClass:"m-product-img product-list"},[e.product_image?i("v-uni-image",{attrs:{"lazy-load":!0,src:e.product_image}}):t._e()],1),i("v-uni-view",{staticClass:"m-product-info1",staticStyle:{display:"flex","flex-flow":"column","justify-content":"space-between"}},[i("v-uni-view",{staticClass:"m-product-name2"},[i("v-uni-label",[t._v(t._s(e.product_name))])],1),i("v-uni-view",{staticClass:"m-product-price1"},[i("v-uni-view",{staticClass:"money"},[e.product_unit_price?[i("v-uni-label",[t._v(t._s(t.__("¥")))]),i("v-uni-label",[t._v(t._s(e.product_unit_price))])]:t._e(),e.product_unit_points?[i("v-uni-label",{staticStyle:{margin:"0rpx 10rpx"}},[t._v("+")]),i("v-uni-label",[t._v(t._s(t.number_format(e.product_unit_points)))]),i("v-uni-label",[t._v(t._s(t.__("积分")))])]:t._e(),e.product_unit_sp?[i("v-uni-label",{staticStyle:{margin:"0rpx 10rpx"}},[t._v("+")]),i("v-uni-label",[t._v(t._s(e.product_unit_sp))]),i("v-uni-label",[t._v(t._s(t.__("众宝")))])]:t._e()],2),e.SaleNum>0?i("v-uni-view",{staticClass:"num"},[i("v-uni-text",[t._v(t._s(t.__("已售")))]),i("v-uni-label",{staticStyle:{color:"#db384c"}},[t._v(t._s(e.SaleNum))])],1):t._e()],1)],1)],1)]}))],2)],1)},a=[]},a3df:function(t,e,i){var n=i("9470");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("967d").default;a("c41784d4",n,!0,{sourceMap:!1,shadowMode:!1})},a7c9:function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={props:{options:{type:Object,default:function(t){return{}}}},methods:{close:function(t){this.$emit("close")},bindClick:function(){this.$emit("click")}}};e.default=n},ad87:function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,"uni-page-body[data-v-4a4b643a]{width:100%;height:100%;background-size:100% auto ;padding:0}body.?%PAGE?%[data-v-4a4b643a]{background-size:100% auto\n}.uni-tab-bar[data-v-4a4b643a]{width:100%; \nheight:calc(100vh - %?88?% - %?100?%); \n\n\nheight:100vh}.uni-tab-bar-loading[data-v-4a4b643a]{text-align:center;font-size:%?28?%;color:#999}",""]),t.exports=e},e636:function(t,e,i){var n=i("ad87");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("967d").default;a("cf574550",n,!0,{sourceMap:!1,shadowMode:!1})}}]); |