2026-03-23 14:57:47 +08:00

1 line
6.3 KiB
JavaScript

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/admin/goods/index"],{"0200":function(t,i,e){"use strict";(function(t,i){var s=e("47a9");e("89bd");s(e("3240"));var n=s(e("d201"));t.__webpack_require_UNI_MP_PLUGIN__=e,i(n.default)}).call(this,e("3223")["default"],e("df3c")["createPage"])},3541:function(t,i,e){},"432d":function(t,i,e){"use strict";var s=e("3541"),n=e.n(s);n.a},"5a89":function(t,i,e){"use strict";e.r(i);var s=e("fac1"),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},"6b74":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=[]},d201:function(t,i,e){"use strict";e.r(i);var s=e("6b74"),n=e("5a89");for(var o in n)["default"].indexOf(o)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(o);e("432d");var a=e("828b"),l=Object(a["a"])(n["default"],s["b"],s["c"],!1,null,"0eb10540",null,!1,s["a"],void 0);i["default"]=l.exports},fac1:function(t,i,e){"use strict";(function(t){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var s=e("8633"),n=e("df17"),o={components:{editPrice:function(){e.e("pages/admin/goods/components/editPrice/index").then(function(){return resolve(e("0754"))}.bind(null,e)).catch(e.oe)},editLable:function(){e.e("pages/admin/goods/components/label/index").then(function(){return resolve(e("b9a1"))}.bind(null,e)).catch(e.oe)},classify:function(){e.e("pages/admin/goods/components/classify/index").then(function(){return resolve(e("0b27"))}.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("82a0"))}.bind(null,e)).catch(e.oe)},emptyPage:function(){e.e("components/emptyPage").then(function(){return resolve(e("5c67"))}.bind(null,e)).catch(e.oe)},Loading:function(){e.e("components/Loading/index").then(function(){return resolve(e("f6e0"))}.bind(null,e)).catch(e.oe)},baseDrawer:function(){e.e("components/tuiDrawer/tui-drawer").then(function(){return resolve(e("16fe"))}.bind(null,e)).catch(e.oe)}},data:function(){return{getHeight:this.$util.getWXStatusHeight(),navList:[{name:"全部",type:""},{name:"出售中",type:1},{name:"仓库中",type:2},{name:"已售罄",type:4},{name:"库存警告",type:5}],editList:[{name:"修改价格/库存"},{name:"商品分类"},{name:"商品标签"}],current:0,administer:0,isAllSelect:!1,goodsList:[],goodsInfo:{},visible:!1,visiblePrice:!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||"",this.keyword=t.keyword||"";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.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};(0,n.productSetShow)(o).then((function(i){s.$util.Tips({title:i.msg});var e=s.goodsList.findIndex((function(i){return i.id==t.id}));s.goodsList.splice(e,1)})).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;this.loading||this.loadend||(i.loading=!0,i.loadTitle="",(0,n.adminProductList)({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}):this.visiblePrice=!0;break;case 1:this.visible=!1,this.visibleClass=!0;break;case 2:this.visibleLable=!0,this.visible=!1;break}},lableCloseDrawer:function(){this.visibleLable=!1},priceCloseDrawer:function(){this.visiblePrice=!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=o}).call(this,e("df3c")["default"])}},[["0200","common/runtime","common/vendor"]]]);