You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
6.7 KiB
1 lines
6.7 KiB
require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/goods/index"],{"1d21":function(t,i,e){"use strict";var s=e("ee2d"),n=e.n(s);n.a},3136:function(t,i,e){"use strict";e.r(i);var s=e("8dc3"),n=e.n(s);for(var o in s)["default"].indexOf(o)<0&&function(t){e.d(i,t,(function(){return s[t]}))}(o);i["default"]=n.a},3715:function(t,i,e){"use strict";e.d(i,"b",(function(){return s})),e.d(i,"c",(function(){return n})),e.d(i,"a",(function(){}));var s=function(){var t=this.$createElement,i=(this._self._c,this.goodsList.length),e=0==this.goodsList.length&&!this.loading,s=this.administer?this.getIds().length:null;this.$mp.data=Object.assign({},{$root:{g0:i,g1:e,g2:s}})},n=[]},6631:function(t,i,e){"use strict";e.r(i);var s=e("3715"),n=e("3136");for(var o in n)["default"].indexOf(o)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(o);e("1d21");var a=e("828b"),c=Object(a["a"])(n["default"],s["b"],s["c"],!1,null,"3f50eec6",null,!1,s["a"],void 0);i["default"]=c.exports},"8dc3":function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var s=e("4bab"),n=e("e727"),o=e("8f59"),a={components:{editPrice:function(){e.e("pages/admin/goods/components/editPrice/index").then(function(){return resolve(e("b14c"))}.bind(null,e)).catch(e.oe)},editStock:function(){e.e("pages/admin/goods/components/editStock/index").then(function(){return resolve(e("6e3b"))}.bind(null,e)).catch(e.oe)},editLable:function(){e.e("pages/admin/goods/components/label/index").then(function(){return resolve(e("2033"))}.bind(null,e)).catch(e.oe)},classify:function(){e.e("pages/admin/goods/components/classify/index").then(function(){return resolve(e("f0a1"))}.bind(null,e)).catch(e.oe)},footerPage:function(){Promise.all([e.e("pages/admin/common/vendor"),e.e("pages/admin/components/footerPage/index")]).then(function(){return resolve(e("9a98"))}.bind(null,e)).catch(e.oe)},emptyPage:function(){e.e("components/emptyPage").then(function(){return resolve(e("bc18"))}.bind(null,e)).catch(e.oe)},Loading:function(){e.e("components/Loading/index").then(function(){return resolve(e("b025"))}.bind(null,e)).catch(e.oe)}},computed:(0,o.mapGetters)(["storeNum"]),data:function(){return{getHeight:this.$util.getWXStatusHeight(),navList:[{name:"全部",type:""},{name:"出售中",type:1},{name:"仓库中",type:2},{name:"已售罄",type:4},{name:"库存警告",type:5}],editList:[{name:"修改价格",num:3},{name:"修改库存",num:4},{name:"修改价格/库存",num:0},{name:"商品分类",num:1},{name:"商品标签",num:2}],current:0,administer:0,isAllSelect:!1,goodsList:[],goodsInfo:{},visible:!1,visiblePrice:!1,visibleStock:!1,visibleLable:!1,loadTitle:"加载更多",loading:!1,loadend:!1,limit:20,page:1,keyword:"",type:"",visibleClass:!1}},onShow:function(){},onLoad:function(t){this.type=t.type||"";for(var i=0;i<this.navList.length;i++)if(this.navList[i].type==this.type){this.current=i;break}this.productList()},methods:{goDetail:function(i){i.is_show?(0,s.goShopDetail)(i,this.$store.state.app.uid).catch((function(e){t.navigateTo({url:"/pages/goods_details/index?id=".concat(i.id)})})):this.$util.Tips({title:"商品未上架"})},goarrow:function(){t.navigateBack()},editClass:function(){if(this.getIds().length){this.$refs.classify.category(this.getIds(),"");var t=this;setTimeout((function(){t.visibleClass=!0}),200)}else this.$util.Tips({title:"请选择商品"})},classCloseDrawer:function(){this.visibleClass=!1},successChange:function(){this.visibleClass=!1,this.visibleLable=!1,this.visiblePrice=!1,this.visibleStock=!1,this.init()},editLabels:function(){this.getIds().length?(this.visibleLable=!0,this.$refs.lable.productLabel({},1,this.getIds())):this.$util.Tips({title:"请选择商品"})},getIds:function(){var t=[];return this.goodsList.forEach((function(i){i.checked&&t.push(i.id)})),t.slice(0,100),t},setShow:function(t,i,e){var s=this,o={};if(i){if(!this.getIds().length)return void this.$util.Tips({title:"请选择商品"});o={id:this.getIds(),is_show:e}}else o={id:t.id,is_show:t.is_show?0:1};var a="";a=this.storeNum?n.productSetShow:n.storeProductSetShow,a(o).then((function(t){s.$util.Tips({title:t.msg}),s.init()})).catch((function(t){s.$util.Tips({title:t})}))},init:function(){this.goodsList=[],this.page=1,this.loadend=!1,this.loading=!1,this.productList()},searchSubmit:function(){this.init()},productList:function(){var t=this,i=this;if(!this.loading&&!this.loadend){i.loading=!0,i.loadTitle="";var e="";e=this.storeNum?n.adminProductList:n.storeProductList,e({page:i.page,limit:i.limit,store_name:i.keyword,type:i.type}).then((function(e){var s=e.data.list;s.forEach((function(t){t.checked=!1})),t.isAllSelect=!1;var n=s.length<i.limit;i.goodsList=i.$util.SplitArray(s,i.goodsList),i.$set(i,"goodsList",i.goodsList),i.loadend=n,i.loadTitle=n?"没有更多内容啦~":"加载更多",i.page=i.page+1,i.loading=!1})).catch((function(t){i.loading=!1,i.loadTitle="加载更多"}))}},editInfo:function(i){switch(i){case 0:this.visible=!1,this.goodsInfo.spec_type?t.navigateTo({url:"/pages/admin/goods/specs?id="+this.goodsInfo.id+"&storeNum="+this.storeNum}):this.visiblePrice=!0;break;case 1:this.visible=!1,this.visibleClass=!0;break;case 2:this.visibleLable=!0,this.visible=!1;break;case 4:this.visible=!1,this.goodsInfo.spec_type?t.navigateTo({url:"/pages/admin/goods/specsStock?id="+this.goodsInfo.id+"&storeNum="+this.storeNum}):this.visibleStock=!0;break}},lableCloseDrawer:function(){this.visibleLable=!1},priceCloseDrawer:function(){this.visiblePrice=!1},stockCloseDrawer:function(){this.visibleStock=!1},openDrawer:function(t){this.visible=!0,this.goodsInfo=JSON.parse(JSON.stringify(t)),this.$refs.lable.productLabel(this.goodsInfo,0,[]),this.$refs.classify.category(t.id,t.cate_id)},closeDrawer:function(){this.visible=!1},manageTap:function(){this.administer=!this.administer},navTap:function(t,i){this.current=i,this.type!=t.type&&(this.type=t.type,this.init())},checkboxChange:function(t){var i=t.detail.value;this.goodsList.forEach((function(t){-1!==i.indexOf(t.id+"")?t.checked=!0:t.checked=!1})),i.length==this.goodsList.length?this.isAllSelect=!0:this.isAllSelect=!1},forGoods:function(t){this.goodsList.length&&this.goodsList.forEach((function(i){i.checked=!!t}))},checkboxAllChange:function(t){var i=t.detail.value;i.length?(this.goodsList.length>100&&this.$util.Tips({title:"每次最多只提交100条数据"}),this.isAllSelect=!0,this.forGoods(1)):(this.isAllSelect=!1,this.forGoods(0))}},onReachBottom:function(){this.productList()}};i.default=a}).call(this,e("df3c")["default"])},e7e1:function(t,i,e){"use strict";(function(t,i){var s=e("47a9");e("7561");s(e("3240"));var n=s(e("6631"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(n.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},ee2d:function(t,i,e){}},[["e7e1","common/runtime","common/vendor"]]]); |