webpackJsonp([51],{"4FXV":function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={data:function(){return{au_nums:"",noneDone:!1,hasAuno:!1,stime:this.getDay(-1,!1),etime:this.getDay(-1,!1),typeList:[],infoList:[],total:0,page:1,dataType:"",day:1,loading:!0,pageCount:0,sortList:[{value:1,label:"按总销量"},{value:2,label:"按总销售额"},{value:3,label:"按关联达人数"},{value:4,label:"按关联直播数"},{value:5,label:"按商品数"}],order:1,page_size:0,goodsSourceList:[],goodsSource:"",sort_order:0,export_size:500}},created:function(){this.getType(),this.goodsList(1),this.channelList()},methods:{followWhEvent:function(t,e,s){var o=this;this.$exportNumber({type_id:8,cb:function(){o.loading=!0,o.$axios.post(o.URL.BASEURL+o.URL[t],{commodity_id:e.commodity_id,channel:e.channel}).then(function(e){e=e.data;o.loading=!1,e&&0==e.errno?o.infoList[s].if_focus="del_userGoodsFollow"==t?0:1:o.$message({message:e.err,type:"warning"})}).catch(function(t){o.loading=!1})}})},channelList:function(){var t=this;this.$axios({url:this.URL.BASEURL+this.URL.channelList,method:"get"}).then(function(e){if((e=e.data)&&0==e.errno){var s=[{label:"不限",value:""}];for(var o in e.rst)s.push({label:e.rst[o],value:o});t.goodsSourceList=s}else t.$message({message:e.err,type:"warning"})})},getType:function(){var t=this;this.$axios({url:this.URL.BASEURL+this.URL.topCategory,method:"get"}).then(function(e){(e=e.data)&&0==e.errno?t.typeList=e.rst:t.$message({message:e.err,type:"warning"})})},sortEvent:function(t,e){if(this.hasAuno||this.noneDone)return this.$cookie.getCookie("isLogin")?(this.$message.closeAll(),void this.$message({message:"当前等级暂不支持使用该功能,请升级会员后操作",type:"warning"})):void this.$Login({visible:!0});2==e?(this.order==t?this.sort_order=0==this.sort_order?1:0:(this.order=t,this.sort_order=0),this.goodsList(1)):this.order==t||(this.order=t,this.sort_order=0,this.goodsList(1))},toDetail:function(t,e,s,o){if(t){var i=this.$router.resolve({path:"goodsDetail/"+t+"?isLive=1"});window.open(i.href,"_blank")}else this.$message({message:"该商品暂无详情,敬请期待!",type:"warning"})},handleCurrentChange:function(t){this.goodsList(t)},goodsList:function(t){var e=this;if(this.$message.closeAll(),this.noneDone||this.hasAuno)return this.$cookie.getCookie("isLogin")?(this.$message.closeAll(),void this.$message({message:"当前等级暂不支持使用该功能,请升级会员后操作",type:"warning"})):void this.$Login({visible:!0});this.infoList=[],this.total=0,this.loading=!0,this.page=t,this.$axios.get(this.URL.BASEURL+this.URL.commodityHotList,{params:{page:this.page,pageSize:20,top_cid:this.dataType,day:this.day,channel:this.goodsSource,order:this.order,sort_order:this.sort_order}}).then(function(t){if(e.loading=!1,4403==(t=t.data).auno?(e.au_nums=t.au_nums,e.hasAuno=!0):e.hasAuno=!1,e.noneDone=4003==t.errno,t&&0==t.errno){var s=t.rst.data;e.total=t.rst.pageInfo.total,e.infoList=s,e.pageCount=t.rst.pageInfo.pages,e.page_size=t.rst.pageInfo.size}else 4003!=t.errno&&e.$message({message:t.err,type:"warning"})}).catch(function(t){e.loading=!1})},getMoreList:function(){var t=this;this.$exportNumber({type_id:2,cb:function(){var e=t.$loading({lock:!0,text:"加载中...",spinner:"el-icon-loading",background:"rgba(255, 2550, 255, 0.7)"});t.$axios.get(t.URL.BASEURL+t.URL.commodityHotList,{params:{page:1,pagesize:t.export_size,top_cid:t.dataType,day:t.day,channel:t.goodsSource,order:t.order,sort_order:t.sort_order,is_export:1}}).then(function(s){s=s.data;if(e.close(),s&&0==s.errno){var o=s.rst.data;t.exportToExcel(o)}else 4003!=s.errno&&t.$message({message:s.err,type:"warning"})}).catch(function(t){e.close()})}})},exportToExcel:function(t){var e=t,s=[];for(var o in e)s.push({title:e[o].title,price:e[o].price,sell_count:e[o].sell_count,sell_money:e[o].sell_money,user_count:e[o].user_count});for(var i="商品名称,商品价格,"+(0==this.day?"近俩小时":1==this.day?"昨日":7==this.day?"上周":"上月")+"销量,"+(0==this.day?"近俩小时":1==this.day?"昨日":7==this.day?"上周":"上月")+"销售额,"+(0==this.day?"近俩小时":1==this.day?"昨日":7==this.day?"上周":"上月")+"平均在线人数\n",a=0;a0&&!t.noneDone?o("li",{staticClass:"common_select_info common_data_export",on:{click:t.getMoreList}},[t._v("导出")]):t._e()])])]),t._v(" "),t.noneDone?t._e():o("div",[o("div",{staticClass:"table_div"},[o("table",[o("tr",[o("td",[t._v("排名")]),t._v(" "),o("td",[t._v("商品名称")]),t._v(" "),o("td",[o("div",{staticClass:"th_title",class:["common_select_td",3==t.order?"common_selected_down":""],on:{click:function(e){return t.sortEvent(3)}}},[t._v("\n 商品价格\n "),t._m(0)])]),t._v(" "),o("td",[o("div",{staticClass:"th_title",class:["common_select_td",2==t.order?"common_selected_down":""],on:{click:function(e){return t.sortEvent(2)}}},[t._v("\n "+t._s(0==t.day?"近俩小时":1==t.day?"昨日":7==t.day?"上周":"上月")+"销量\n "),t._m(1)])]),t._v(" "),o("td",[o("div",{staticClass:"th_title",class:["common_select_td",1==t.order?"common_selected_down":""],on:{click:function(e){return t.sortEvent(1)}}},[t._v("\n "+t._s(0==t.day?"近俩小时":1==t.day?"昨日":7==t.day?"上周":"上月")+"销售额\n "),t._m(2)])]),t._v(" "),o("td",[o("div",{staticClass:"th_title",class:["common_select_td",4==t.order?"common_selected_down":""],on:{click:function(e){return t.sortEvent(4)}}},[t._v("\n 平均在线人数\n "),t._m(3)])]),t._v(" "),o("td",[t._v("收藏")])]),t._v(" "),t._l(t.infoList,function(e,i){return o("tr",{key:i,staticStyle:{cursor:"pointer"},on:{click:function(s){return t.toDetail(e.commodity_id,e.live_stream_id,e.channel,i)}}},[o("td",[(t.page-1)*t.page_size+i+1==1?o("img",{staticClass:"rank_count_icon",attrs:{src:s("uIsc"),alt:""}}):(t.page-1)*t.page_size+i+1==2?o("img",{staticClass:"rank_count_icon",attrs:{src:s("37vy"),alt:""}}):(t.page-1)*t.page_size+i+1==3?o("img",{staticClass:"rank_count_icon",attrs:{src:s("u/A1"),alt:""}}):o("div",{staticClass:"rank_count"},[o("div",[t._v(t._s((t.page-1)*t.page_size+i+1))])])]),t._v(" "),o("td",{staticStyle:{width:"300px"}},[o("div",{staticClass:"goodsInfo clear"},[o("div",{staticClass:"postUrl"},[o("img",{attrs:{src:e.img}})]),t._v(" "),o("div",{staticClass:"right_info"},[o("div",{staticClass:"title"},[t._v(t._s(e.title?e.title:"-"))])])])]),t._v(" "),o("td",{class:3==t.order?"common_selected":""},[t._v(t._s(e.price||0==e.price?e.price:"-"))]),t._v(" "),o("td",{class:2==t.order?"common_selected":""},[t._v(t._s(e.sell_count||0==e.sell_count?t.$NumberHandle(e.sell_count):"-"))]),t._v(" "),o("td",{class:1==t.order?"common_selected":""},[t._v(t._s(e.sell_money||0==e.sell_money?t.$NumberHandle(e.sell_money):"-"))]),t._v(" "),o("td",{class:4==t.order?"common_selected":""},[t._v(t._s(e.user_count||0==e.user_count?t.$NumberHandle(e.user_count):"-"))]),t._v(" "),o("td",[o("div",{on:{click:function(s){return s.stopPropagation(),t.followWhEvent(1==e.if_focus?"del_userGoodsFollow":"create_userGoodsFollow",e,i)}}},[o("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:1==e.if_focus?"取消关注":"关注商品",placement:"top-start"}},[1==e.if_focus?o("img",{staticClass:"followIcon",attrs:{src:s("fXRA"),alt:""}}):o("img",{staticClass:"followIcon",attrs:{src:s("OSUF"),alt:""}})])],1)])])})],2)]),t._v(" "),t.loading||0!=t.infoList.length?t._e():o("div",{staticClass:"noHaveDate"},[t._v("暂无数据")])]),t._v(" "),o("div",{directives:[{name:"show",rawName:"v-show",value:!t.hasAuno&&0!=t.total||t.hasAuno&&t.au_nums<=t.total&&t.page>1,expression:"(!hasAuno&&total!=0)||(hasAuno&&au_nums<=total&&page>1)"}],staticClass:"bottom"},[o("span",{staticClass:"total"},[t._v("共"+t._s(t.total)+"条结果")]),t._v(" "),o("el-pagination",{attrs:{background:"","current-page":t.page,layout:"prev, pager, next","page-count":t.pageCount},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),t.infoList.length>0&&!t.noneDone&&t.hasAuno&&!t.loading?o("list-permission",{attrs:{au_nums:t.au_nums}}):t._e(),t._v(" "),!t.hasAuno&&t.noneDone?o("nopermission"):t._e()],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"table_sortable table_sortable_single"},[e("i",{staticClass:"el-icon-caret-bottom"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"table_sortable table_sortable_single"},[e("i",{staticClass:"el-icon-caret-bottom"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"table_sortable table_sortable_single"},[e("i",{staticClass:"el-icon-caret-bottom"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"table_sortable table_sortable_single"},[e("i",{staticClass:"el-icon-caret-bottom"})])}]};var a=s("C7Lr")(o,i,!1,function(t){s("Zp4D")},"data-v-79a6636f",null);e.default=a.exports},Zp4D:function(t,e){}});