glhcp/server/public/business/static/js/bundle-pages-spec_edit-spec...

1 line
16 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["bundle-pages-spec_edit-spec_edit"],{"0f93":function(t,e,i){"use strict";i.r(e);var n=i("6a63"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"365e":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={uImage:i("4902").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"goods bg-white"},[i("v-uni-view",{staticClass:"goods-wrap flex",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.toDetail(t.data.id)}}},[i("v-uni-view",{staticClass:"image"},[i("u-image",{attrs:{src:t.data.image,width:"160",height:"160"}})],1),i("v-uni-view",{staticClass:"m-l-16 line-1"},[i("v-uni-view",{staticClass:"goods-name line-1 m-t-10"},[t._v(t._s(t.data.name))]),i("v-uni-view",{staticClass:"goods-price primary m-t-10"},[t._v("¥"+t._s(t.data.min_price))]),i("v-uni-view",{staticClass:"muted flex row-between xs m-t-10"},[i("v-uni-view",[t._v("总库存: "+t._s(t.data.stock))]),i("v-uni-view",[t._v("总销量: "+t._s(t.data.sales_actual))])],1)],1)],1),i("v-uni-view",{staticClass:"goods-footer flex row-right"},[t._t("default")],2)],1)},o=[]},3703:function(t,e,i){"use strict";i.r(e);var n=i("365e"),a=i("4d21");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("c1f3");var s,r=i("f0c5"),c=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"260e1ff2",null,!1,n["a"],s);e["default"]=c.exports},"485b":function(t,e,i){var n=i("5cad");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("60368dde",n,!0,{sourceMap:!1,shadowMode:!1})},"4d21":function(t,e,i){"use strict";i.r(e);var n=i("d085"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},"5cad":function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,"@charset \"UTF-8\";\n/* 颜色变量 */\n/** S Font's size **/\n/** E Font's size **/[data-v-26b6161e]:export{red_theme:#ff2c3c;orange_theme:#f7971e;pink_theme:#fa444d;gold_theme:#e0a356;blue_theme:#2f80ed;green_theme:#2ec840}.goods-detail[data-v-26b6161e]{padding-bottom:%?200?%}.goods-detail .primary[data-v-26b6161e]{color:#40affa}.goods-detail .input[data-v-26b6161e]{width:%?300?%;padding:%?10?%;margin:0 %?20?%;border-radius:%?4?%;border:1px solid #dbdbdb}.goods-detail .item[data-v-26b6161e]{padding:%?30?%;display:flex;flex-direction:row;align-items:center;background-color:#fff;justify-content:flex-start}.goods-detail .item > uni-view[data-v-26b6161e]:first-child{width:%?180?%;color:#101010;font-size:%?28?%;font-weight:500}.goods-detail .item > uni-view[data-v-26b6161e]:last-child{width:%?400?%;text-align:left;height:%?76?%;padding:0 %?12?%;border-radius:%?6?%;border:1px solid #dbdbdb}.goods-detail .title[data-v-26b6161e]{color:#fff;display:inline-block;margin:0 %?20?%;padding:%?6?% %?16?%;border-radius:%?8?%;background-color:#40affa}.goods-detail .footer[data-v-26b6161e]{position:fixed;bottom:0;left:0;right:0;z-index:100;height:%?110?%;padding:0 %?30?%;box-sizing:initial;padding-bottom:env(safe-area-inset-bottom)}.goods-detail .footer .btn[data-v-26b6161e]{width:100%;height:%?88?%;line-height:%?88?%;background-color:#40affa}",""]),t.exports=e},6717:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={goodsCard:i("3703").default,modal:i("4ca1").default,uToast:i("af9c").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"goods-detail"},[i("v-uni-view",{staticClass:"m-t-20"},[i("goods-card",{attrs:{data:t.goodsInfo}})],1),i("v-uni-view",{staticClass:"muted xs p-l-20 p-b-20 p-t-20 flex row-between"},[t._v(t._s(1==t.goodsInfo.spec_type?"规格型号(统一规格)":"规格型号(多规格)")),2==t.goodsInfo.spec_type?i("v-uni-view",{staticClass:"p-r-20",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.spec_type=!t.spec_type}}},[t._v(t._s(t.spec_type?"取消批量":"批量设置"))]):t._e()],1),i("v-uni-view",{directives:[{name:"show",rawName:"v-show",value:t.spec_type,expression:"spec_type"}],staticClass:"primary flex p-b-20"},[i("v-uni-view",{staticClass:"m-l-20",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.openSpecEditFunc("price")}}},[t._v("价格")]),i("v-uni-view",{staticClass:"m-l-20",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.openSpecEditFunc("market_price")}}},[t._v("市场价")]),i("v-uni-view",{staticClass:"m-l-20",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.openSpecEditFunc("chengben_price")}}},[t._v("成本价")]),i("v-uni-view",{staticClass:"m-l-20",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.openSpecEditFunc("stock")}}},[t._v("库存")])],1),t._l(t.goodsInfo.goods_item,(function(e,n){return[i("v-uni-view",{key:n+"_0",staticClass:"m-b-20 p-t-20 bg-white"},[i("v-uni-view",{staticClass:"m-b-10 primary nr title"},[t._v(t._s(e.spec_value_str))]),i("v-uni-view",{staticClass:"item bb"},[i("v-uni-view",[t._v("价格:")]),i("v-uni-view",{staticClass:"flex row-between"},[i("v-uni-input",{attrs:{type:"text",placeholder:"请输入价格"},model:{value:e.price,callback:function(i){t.$set(e,"price",i)},expression:"item.price"}}),t._v("元")],1)],1),i("v-uni-view",{staticClass:"item bb"},[i("v-uni-view",[t._v("市场价:")]),i("v-uni-view",{staticClass:"flex row-between"},[i("v-uni-input",{attrs:{type:"text",placeholder:"请输入市场价"},model:{value:e.market_price,callback:function(i){t.$set(e,"market_price",i)},expression:"item.market_price"}}),t._v("元")],1)],1),i("v-uni-view",{staticClass:"item bb"},[i("v-uni-view",[t._v("成本价:")]),i("v-uni-view",{staticClass:"flex row-between"},[i("v-uni-input",{attrs:{type:"text",placeholder:"请输入成本价"},model:{value:e.chengben_price,callback:function(i){t.$set(e,"chengben_price",i)},expression:"item.chengben_price"}}),t._v("元")],1)],1),i("v-uni-view",{staticClass:"item bb"},[i("v-uni-view",[t._v("库存:")]),i("v-uni-view",{staticClass:"flex row-between"},[i("v-uni-input",{attrs:{type:"text",placeholder:"请输入库存"},model:{value:e.stock,callback:function(i){t.$set(e,"stock",i)},expression:"item.stock"}})],1)],1)],1)]})),i("v-uni-view",{staticClass:"footer bg-white flex row-between fixed"},[i("v-uni-button",{staticClass:"btn br60 md white",attrs:{size:"md","hover-class":"none"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.onSubmit.apply(void 0,arguments)}}},[t._v("确认")])],1),i("modal",{attrs:{title:"批量设置",height:"200rpx"},on:{confirm:function(e){arguments[0]=e=t.$handleEvent(e),t.specEditFunc(t.action)}},model:{value:t.flag,callback:function(e){t.flag=e},expression:"flag"}},["price"==t.action?[i("v-uni-view",{staticClass:"black nr flex",staticStyle:{height:"200rpx"}},[t._v("价格:"),i("v-uni-input",{staticClass:"input",attrs:{type:"text"},model:{value:t.price,callback:function(e){t.price=e},expression:"price"}}),t._v("元")],1)]:t._e(),"market_price"==t.action?[i("v-uni-view",{staticClass:"black nr flex",staticStyle:{height:"200rpx"}},[t._v("市场价:"),i("v-uni-input",{staticClass:"input",attrs:{type:"text"},model:{value:t.market_price,callback:function(e){t.market_price=e},expression:"market_price"}}),t._v("元")],1)]:t._e(),"chengben_price"==t.action?[i("v-uni-view",{staticClass:"black nr flex",staticStyle:{height:"200rpx"}},[t._v("成本价:"),i("v-uni-input",{staticClass:"input",attrs:{type:"text"},model:{value:t.chengben_price,callback:function(e){t.chengben_price=e},expression:"chengben_price"}}),t._v("元")],1)]:t._e(),"stock"==t.action?[i("v-uni-view",{staticClass:"black nr flex",staticStyle:{height:"200rpx"}},[t._v("库存:"),i("v-uni-input",{staticClass:"input",attrs:{type:"text"},model:{value:t.stock,callback:function(e){t.stock=e},expression:"stock"}})],1)]:t._e()],2),i("u-toast",{ref:"uToast"})],2)},o=[]},"6a63":function(t,e,i){"use strict";i("c975"),i("a9e3"),i("b64b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"u-toast",props:{zIndex:{type:[Number,String],default:""}},data:function(){return{isShow:!1,timer:null,config:{params:{},title:"",type:"",duration:2e3,isTab:!1,url:"",icon:!0,position:"center",callback:null,back:!1},tmpConfig:{}}},computed:{iconName:function(){if(["error","warning","success","info"].indexOf(this.tmpConfig.type)>=0&&this.tmpConfig.icon){var t=this.$u.type2icon(this.tmpConfig.type);return t}},uZIndex:function(){return this.isShow?this.zIndex?this.zIndex:this.$u.zIndex.toast:"999999"}},methods:{show:function(t){var e=this;this.tmpConfig=this.$u.deepMerge(this.config,t),this.timer&&(clearTimeout(this.timer),this.timer=null),this.isShow=!0,this.timer=setTimeout((function(){e.isShow=!1,clearTimeout(e.timer),e.timer=null,"function"===typeof e.tmpConfig.callback&&e.tmpConfig.callback(),e.timeEnd()}),this.tmpConfig.duration)},hide:function(){this.isShow=!1,this.timer&&(clearTimeout(this.timer),this.timer=null)},timeEnd:function(){if(this.tmpConfig.url){if("/"!=this.tmpConfig.url[0]&&(this.tmpConfig.url="/"+this.tmpConfig.url),Object.keys(this.tmpConfig.params).length){var t="";/.*\/.*\?.*=.*/.test(this.tmpConfig.url)?(t=this.$u.queryParams(this.tmpConfig.params,!1),this.tmpConfig.url=this.tmpConfig.url+"&"+t):(t=this.$u.queryParams(this.tmpConfig.params),this.tmpConfig.url+=t)}this.tmpConfig.isTab?uni.switchTab({url:this.tmpConfig.url}):uni.navigateTo({url:this.tmpConfig.url})}else this.tmpConfig.back&&this.$u.route({type:"back"})}}};e.default=n},"70ee":function(t,e,i){"use strict";var n=i("f9c8"),a=i.n(n);a.a},"75c1":function(t,e,i){"use strict";var n=i("485b"),a=i.n(n);a.a},"817f":function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,"@charset \"UTF-8\";\n/* 颜色变量 */\n/** S Font's size **/\n/** E Font's size **/[data-v-52764960]:export{red_theme:#ff2c3c;orange_theme:#f7971e;pink_theme:#fa444d;gold_theme:#e0a356;blue_theme:#2f80ed;green_theme:#2ec840}.u-toast[data-v-52764960]{position:fixed;z-index:-1;transition:opacity .3s;text-align:center;color:#fff;border-radius:%?8?%;background:#585858;display:flex;flex-direction:row;align-items:center;justify-content:center;font-size:%?28?%;opacity:0;pointer-events:none;padding:%?18?% %?40?%}.u-toast.u-show[data-v-52764960]{opacity:1}.u-icon[data-v-52764960]{margin-right:%?10?%;display:flex;flex-direction:row;align-items:center;line-height:normal}.u-position-center[data-v-52764960]{left:50%;top:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);max-width:70%}.u-position-top[data-v-52764960]{left:50%;top:20%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.u-position-bottom[data-v-52764960]{left:50%;bottom:20%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.u-type-primary[data-v-52764960]{color:#2979ff;background-color:#ecf5ff;border:1px solid #d7eafe}.u-type-success[data-v-52764960]{color:#19be6b;background-color:#dbf1e1;border:1px solid #bef5c8}.u-type-error[data-v-52764960]{color:#fa3534;background-color:#fef0f0;border:1px solid #fde2e2}.u-type-warning[data-v-52764960]{color:#f90;background-color:#fdf6ec;border:1px solid #faecd8}.u-type-info[data-v-52764960]{color:#909399;background-color:#f4f4f5;border:1px solid #ebeef5}.u-type-default[data-v-52764960]{color:#fff;background-color:#585858}",""]),t.exports=e},"890d":function(t,e,i){"use strict";var n=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.apiGoodsEdit=e.apiGoodsDetail=e.apiGoodsOperation=e.apiGoodsLists=void 0;var a=n(i("04cb")),o=function(t){return a.default.get("goods/lists",{params:t})};e.apiGoodsLists=o;var s=function(t){return a.default.post("goods/operation",t)};e.apiGoodsOperation=s;var r=function(t){return a.default.get("goods/detail",{params:t})};e.apiGoodsDetail=r;var c=function(t){return a.default.post("goods/edit",t)};e.apiGoodsEdit=c},"9def":function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={uIcon:i("031d").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"u-toast",class:[t.isShow?"u-show":"","u-type-"+t.tmpConfig.type,"u-position-"+t.tmpConfig.position],style:{zIndex:t.uZIndex}},[i("v-uni-view",{staticClass:"u-icon-wrap"},[t.tmpConfig.icon?i("u-icon",{staticClass:"u-icon",attrs:{name:t.iconName,size:30,color:t.tmpConfig.type}}):t._e()],1),i("v-uni-text",{staticClass:"u-text"},[t._v(t._s(t.tmpConfig.title))])],1)},o=[]},af9c:function(t,e,i){"use strict";i.r(e);var n=i("9def"),a=i("0f93");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("70ee");var s,r=i("f0c5"),c=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"52764960",null,!1,n["a"],s);e["default"]=c.exports},be86:function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,"@charset \"UTF-8\";\n/* 颜色变量 */\n/** S Font's size **/\n/** E Font's size **/[data-v-260e1ff2]:export{red_theme:#ff2c3c;orange_theme:#f7971e;pink_theme:#fa444d;gold_theme:#e0a356;blue_theme:#2f80ed;green_theme:#2ec840}.goods[data-v-260e1ff2]{width:100%;padding:%?20?%;margin-bottom:%?20?%}.goods-wrap[data-v-260e1ff2]{width:100%}.goods-wrap .goods-name[data-v-260e1ff2]{color:#101010;font-size:%?28?%}.goods-wrap .goods-price[data-v-260e1ff2]{color:red;font-size:%?28?%}.goods-wrap > uni-view[data-v-260e1ff2]{width:100%}.goods-wrap .image[data-v-260e1ff2]{flex:0}",""]),t.exports=e},c1f3:function(t,e,i){"use strict";var n=i("f024"),a=i.n(n);a.a},d085:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={name:"GoodsCard",props:{data:{type:Object,default:function(){}}},methods:{toDetail:function(t){this.$Router.push({path:"/pages/goods_detail/goods_detail",query:{id:t}})}}};e.default=n},df55:function(t,e,i){"use strict";i.r(e);var n=i("6717"),a=i("e8dd");for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);i("75c1");var s,r=i("f0c5"),c=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"26b6161e",null,!1,n["a"],s);e["default"]=c.exports},e181:function(t,e,i){"use strict";var n=i("4ea4");i("4160"),i("d81d"),i("d3b7"),i("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("96cf");var a=n(i("1da1")),o=n(i("2909")),s=i("890d"),r=(i("a9eb"),{name:"GoodsDetail",data:function(){return{goodsInfo:{},action:"",spec_type:!1,flag:!1,price:"",market_price:"",chengben_price:"",stock:""}},methods:{initGoodsDetail:function(){var t=this;return new Promise((function(e,i){(0,s.apiGoodsDetail)({id:t.goods_id,visit:1}).then((function(e){t.goodsInfo=e})).catch((function(t){i(t)}))}))},openSpecEditFunc:function(t){this.action=t,this.flag=!0},specEditFunc:function(t){var e=this;this.goodsInfo.goods_item.forEach((function(i){i[t]=e[t]})),this.goodsInfo.goods_item=(0,o.default)(this.goodsInfo.goods_item)},onSubmit:function(){var t=this;return(0,a.default)(regeneratorRuntime.mark((function e(){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return i=[],i=t.goodsInfo.goods_item.map((function(t){var e=t.id,i=t.market_price,n=t.price,a=t.stock,o=t.chengben_price;return{id:e,market_price:i,price:n,stock:a,chengben_price:o}})),e.next=4,(0,s.apiGoodsEdit)({items:i});case 4:t.$refs.uToast.show({title:"设置成功",type:"success"}),setTimeout((function(){t.$Router.back()}),1e3);case 6:case"end":return e.stop()}}),e)})))()}},onLoad:function(){var t=this;return(0,a.default)(regeneratorRuntime.mark((function e(){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.$Route.query,t.goods_id=i.id,e.prev=2,t.goods_id){e.next=5;break}throw new Error("该商品不存在");case 5:return e.next=7,t.initGoodsDetail();case 7:e.next=12;break;case 9:e.prev=9,e.t0=e["catch"](2),console.log(e.t0);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})))()}});e.default=r},e8dd:function(t,e,i){"use strict";i.r(e);var n=i("e181"),a=i.n(n);for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=a.a},f024:function(t,e,i){var n=i("be86");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("48e355e2",n,!0,{sourceMap:!1,shadowMode:!1})},f9c8:function(t,e,i){var n=i("817f");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("4f897604",n,!0,{sourceMap:!1,shadowMode:!1})}}]);