commodityManage.js 6.4 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pageD/commodityManage/commodityManage"],{1957:function(t,o,e){"use strict";e.r(o);var n=e("705b"),i=e.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){e.d(o,t,(function(){return n[t]}))}(s);o["default"]=i.a},"200d":function(t,o,e){},"35eb":function(t,o,e){"use strict";e.d(o,"b",(function(){return i})),e.d(o,"c",(function(){return s})),e.d(o,"a",(function(){return n}));var n={"u-Input":function(){return Promise.all([e.e("common/vendor"),e.e("uview-ui/components/u--input/u--input")]).then(e.bind(null,"bead"))},uCheckboxGroup:function(){return Promise.all([e.e("common/vendor"),e.e("uview-ui/components/u-checkbox-group/u-checkbox-group")]).then(e.bind(null,"72c8"))},uCheckbox:function(){return Promise.all([e.e("common/vendor"),e.e("uview-ui/components/u-checkbox/u-checkbox")]).then(e.bind(null,"d2b4"))},uToast:function(){return e.e("uview-ui/components/u-toast/u-toast").then(e.bind(null,"36bd"))}},i=function(){var t=this,o=t.$createElement;t._self._c},s=[]},"3bde":function(t,o,e){"use strict";e.r(o);var n=e("35eb"),i=e("1957");for(var s in i)["default"].indexOf(s)<0&&function(t){e.d(o,t,(function(){return i[t]}))}(s);e("f741");var c,u=e("f0c5"),a=Object(u["a"])(i["default"],n["b"],n["c"],!1,null,"19170273",null,!1,n["a"],c);o["default"]=a.exports},"705b":function(t,o,e){"use strict";(function(t){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var n=function(){e.e("pageD/commodityManage/component/goodsInformation").then(function(){return resolve(e("7a07"))}.bind(null,e)).catch(e.oe)},i=function(){e.e("pageD/commodityManage/component/screenPopup").then(function(){return resolve(e("d687"))}.bind(null,e)).catch(e.oe)},s=function(){e.e("pageD/commodityManage/component/discountsPopup").then(function(){return resolve(e("caec"))}.bind(null,e)).catch(e.oe)},c=function(){e.e("pageD/commodityManage/component/batchDiscountPopup").then(function(){return resolve(e("251c"))}.bind(null,e)).catch(e.oe)},u=function(){e.e("pageD/components/agreePopup").then(function(){return resolve(e("1c99"))}.bind(null,e)).catch(e.oe)},a={components:{GoodsInformation:n,ScreenPopup:i,DiscountsPopup:s,BatchDiscountPopup:c,agreePopup:u},data:function(){return{follow:"",status:"1",show:!1,discountsShow:!1,selectGoodsInformation:{},batch:!1,value:!1,batchPopup:!1,goodsList:[],keywords:"",source:"",selectedGoods:[],userId:"",agreeShow:!1,needDeleteGoods:{},title:"",page:1,total:0,limit:10}},computed:{i18n:function(){return this.$t("index")},goodsLength:function(){var t=0;return this.goodsList.map((function(o){"down"!=o.status&&t++})),t}},onLoad:function(o){var e=this;t.getStorage({key:"user_info",success:function(t){var o=t.data;e.userId=o.merchant.id}})},watch:{selectedGoods:function(t){this.goodsLength==t.length?this.value=!0:this.value=!1}},methods:{deleteGoods:function(t){console.log(t),this.agreeShow=!0,this.title=this.i18n.deleteGoods,this.needDeleteGoods=t},closeDelete:function(o){var e=this;this.agreeShow=!1,o&&("是否下架商品"==this.title?this.goodsApi(this.needDeleteGoods,"down"):t.$u.http.post("/api/goods/merchant_goods_del",{merchant_goods_id:this.needDeleteGoods.id}).then((function(o){e.getCommodityList(e.follow),t.showToast({title:e.i18n.beenDeleted,icon:"none"})})))},cancelDiscount:function(o){var e=this;t.$u.http.post("/api/goods/cancel_discount",{merchant_goods_id:o.id}).then((function(o){e.getCommodityList(),t.showToast({title:e.i18n.cannotDiscount,icon:"none"})}))},goodsApi:function(o,e){var n=this;t.$u.http.post("/api/goods/modify_status",{merchant_goods_id:o.id,status:e}).then((function(o){t.showToast({title:"down"==e?n.i18n.takenDown:n.i18n.takenUp}),n.getCommodityList(n.follow)}))},addAndRemove:function(t,o){"down"==o?(this.title=this.i18n.removeGoods,this.agreeShow=!0,this.needDeleteGoods=t):this.goodsApi(t,o)},tabSwitch:function(t){this.follow=t,this.getCommodityList(t)},toPlatform:function(){t.navigateTo({url:"/pageD/platformProducts/platformProducts"})},checkboxChange:function(t){console.log(t)},search:function(t){this.getCommodityList()},openPopup:function(){this.show=!0},close:function(t){this.show=!1,t?(this.keywords=t.keywords,this.source=t.source,this.getCommodityList(t.status)):(this.keywords="",this.source="",this.getCommodityList())},allSelect:function(){var t=this;this.selectedGoods.length==this.goodsLength?this.selectedGoods=[]:this.goodsList.map((function(o){-1==t.selectedGoods.indexOf(o.id)&&"down"!=o.status&&t.selectedGoods.push(o.id)}))},batchDiscount:function(){this.batch=!this.batch,t.setNavigationBarTitle({title:this.i18n.batchDiscount})},cancelBatchDiscount:function(){this.batch=!1,t.setNavigationBarTitle({title:this.i18n.productManagement}),this.selectedGoods=[]},wantDiscount:function(){0!=this.selectedGoods?this.batchPopup=!0:this.$refs.uToast.show({type:"default",title:"默认主题",message:this.i18n.selectGoods})},closeDiscountsPopup:function(o){var e=this;this.batchPopup?(this.batchPopup=!1,o&&(t.$u.http.post("/api/goods/discount",{merchant_goods_id:this.selectedGoods.join(","),mer_discount:o}).then((function(t){e.getCommodityList(e.follow)})),this.batch=!1,t.setNavigationBarTitle({title:this.i18n.productManagement}))):this.discountsShow&&(this.discountsShow=!1,o&&t.$u.http.post("/api/goods/discount",{merchant_goods_id:this.selectGoodsInformation.id,mer_discount:o}).then((function(t){e.getCommodityList(e.follow)})))},openDiscountsPopup:function(t){this.selectGoodsInformation=t,this.discountsShow=!0},toDetail:function(o){t.navigateTo({url:"/pageD/productDetails/productDetails?goodsId=".concat(o.id)})},getCommodityList:function(){var o=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";t.$u.http.post("/api/goods/merchant_goods",{page:this.page,limit:10,merchant_id:this.userId,status:e,keywords:this.keywords,source:this.source}).then((function(t){o.goodsList=n?o.goodsList.concat(t.data):t.data,o.total=t.total}))}},onReachBottom:function(){this.goodsList.length<this.total&&(this.page++,this.getCommodityList("",1))},mounted:function(){this.getCommodityList(),t.setNavigationBarTitle({title:this.i18n.productManagement})}};o.default=a}).call(this,e("543d")["default"])},dfc7:function(t,o,e){"use strict";(function(t,o){var n=e("4ea4");e("f93b");n(e("66fd"));var i=n(e("3bde"));t.__webpack_require_UNI_MP_PLUGIN__=e,o(i.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},f741:function(t,o,e){"use strict";var n=e("200d"),i=e.n(n);i.a}},[["dfc7","common/runtime","common/vendor"]]]);