java-mall-app/unpackage/dist/build/mp-weixin/seller/product/pool.js
2025-12-12 17:04:03 +08:00

1 line
5.5 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["seller/product/pool"],{"0133":function(t,e,a){"use strict";var r=a("c06f"),o=a.n(r);o.a},"563a":function(t,e,a){"use strict";(function(t){var r=a("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=r(a("7ca3")),i=a("8f59");function s(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function c(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?s(Object(a),!0).forEach((function(e){(0,o.default)(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):s(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}var n={data:function(){return{isdata:!1,tapindex:1,page:1,rows:100,ispage:!0,flag:!0,type:0,formId:"",productlist:[],imgLogo:"",show:!1,Info:"",sord:"desc",bannerShow:!1,iscancel:0,search_name:"",product_verify_id:3001,product_state_id:1001,product_category:[],category_id:0,parent_id:0,leaf_items:[],curIndex:0,detail:[],product_items:[]}},computed:(0,i.mapState)(["Config","StateCode","notice","plantformInfo","shopInfo","userInfo","hasLogin"]),onLoad:function(e){var a=this;t.setNavigationBarTitle({title:this.__("商品管理")}),this.setData({page:1,rows:100,productlist:[],type:e.type?e.type:0,product_state_id:e.type?e.type:1001});this.notice.addNotification("RefreshMessage",this.RefreshMessage,this),a.$.request({url:a.Config.URL.product.category,loading:!1,ajaxCache:{timeout:a.Config.CACHE_EXPIRE},success:function(t){a.setData({product_category:t.items,parent_id:t.items[a.curIndex].category_id}),a.loadCategory(!0)}})},methods:c(c({},(0,i.mapMutations)(["login","logout","getPlantformInfo","forceUserInfo","getUserInfo"])),{},{getProductlist:function(){var t=this,e={product_verify_id:t.product_verify_id,product_state_id:t.product_state_id,product_fx_enable:1,store_type:2,rows:t.rows,page:t.page,sidx:"product_order",sord:t.sord,product_name:t.search_name,category_id:t.category_id};t.$.request({url:this.Config.URL.seller.product_pool,data:e,success:function(e,a,r,o){200==a&&e.items.length>0?(e.page>=e.total?t.setData({flag:!1,ispage:!1,productlist:t.productlist.concat(e.items)}):t.setData({flag:!0,ispage:!0,productlist:t.productlist.concat(e.items)}),t.setData({isdata:!0})):t.setData({flag:!1,ispage:!1,isdata:!1})}})},setparentcategoryid:function(t){this.setData({parent_id:t.currentTarget.dataset.id}),this.loadCategory()},all:function(){this.loadCategory(!0)},loadCategory:function(t){var e=this;e.$.request({url:e.Config.URL.product.category,data:{category_id:e.parent_id,recursive:1},ajaxCache:{timeout:e.Config.CACHE_EXPIRE},success:function(a){for(var r=[],o=0;o<a.items.length;o++)r=r.concat(a.items[o].sub);0==r.length&&(r=a.items),e.setData({detail:r,category_id:t?0:r[0].category_id,parent_id:t?0:e.parent_id,page:1,productlist:[],ispage:!0,flag:!0,type:0}),e.getProductlist()}})},inputSearch:function(t){this.setData({search_name:t.detail.value})},gocancel:function(t){this.setData({search_name:""})},goSearch:function(t){this.setData({page:1,rows:100,productlist:[],ispage:!0,flag:!0,type:0}),this.getProductlist()},setcategoryid:function(t){this.setData({category_id:t.currentTarget.dataset.id,page:1,product_name:"",productlist:[]}),this.getProductlist()},AddDistProduct:function(t){var e=this,a={product_id:t.target.dataset.product_id,product_is_dist:1};e.$.request({url:e.Config.URL.seller.add_DistProduct,data:a,success:function(t,a,r,o){200==a&&e.$.alert(e.__("分销成功!"),(function(){setTimeout((function(){e.setData({page:1,rows:100,productlist:[],ispage:!0,flag:!0,type:0}),e.getProductlist()}),1500)}))}})},scrollbottom:function(){if(this.flag){var t=this;t.setData({flag:!1}),clearTimeout(e);var e=setTimeout((function(){t.setData({state_type:t.type,flag:!1,page:parseInt(t.page)+1,rows:t.rows}),t.getProductlist()}),1e3)}}})};e.default=n}).call(this,a("df3c")["default"])},"57d1":function(t,e,a){"use strict";(function(t,e){var r=a("47a9");a("ec76");r(a("3240"));var o=r(a("dcad"));t.__webpack_require_UNI_MP_PLUGIN__=a,e(o.default)}).call(this,a("3223")["default"],a("df3c")["createPage"])},8903:function(t,e,a){"use strict";a.d(e,"b",(function(){return r})),a.d(e,"c",(function(){return o})),a.d(e,"a",(function(){}));var r=function(){var t=this,e=t.$createElement,a=(t._self._c,t.__("请输入商品标题进行搜索")),r=t.__("全部"),o=t.productlist.length,i=o>0?t.__map(t.productlist,(function(e,a){var r=t.__get_orig(e),o=t.__("店铺"),i=t.__("编辑"),s=1==e.product_is_dist?t.__("已经分销"):null,c=1!=e.product_is_dist?t.__("加入商品库"):null;return{$orig:r,m2:o,m3:i,m4:s,m5:c}})):null,s=o>0&&t.ispage?t.__("正在加载"):null,c=o>0&&!t.ispage?t.__("没有更多数据啦!"):null;t.$mp.data=Object.assign({},{$root:{m0:a,m1:r,g0:o,l0:i,m6:s,m7:c}})},o=[]},c06f:function(t,e,a){t.exports={theme_bg:"#f30213"}},dcad:function(t,e,a){"use strict";a.r(e);var r=a("8903"),o=a("f1ad");for(var i in o)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return o[t]}))}(i);a("0133");var s=a("828b"),c=Object(s["a"])(o["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],void 0);e["default"]=c.exports},f1ad:function(t,e,a){"use strict";a.r(e);var r=a("563a"),o=a.n(r);for(var i in r)["default"].indexOf(i)<0&&function(t){a.d(e,t,(function(){return r[t]}))}(i);e["default"]=o.a}},[["57d1","common/runtime","common/vendor"]]]);