bztang-admin/addons/yun_shop/static/app/js/chunk-156627e4.8a4aeea6.js

1 line
12 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-156627e4"],{"130a":function(t,e,o){var i=o("39df");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=o("499e").default;a("de0684b4",i,!0,{sourceMap:!1,shadowMode:!1})},"39df":function(t,e,o){var i=o("24fb");e=i(!1),e.push([t.i,".search_box[data-v-62bf72e8]{position:fixed;width:100%}.search_box .search[data-v-62bf72e8]{height:2.75rem;line-height:2.75rem;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:0 .875rem;background-color:#fff}.search_box .search[data-v-62bf72e8],.search_box .search .left[data-v-62bf72e8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.search_box .search .left[data-v-62bf72e8]{font-size:16px;font-weight:700}.search_box .search .left i[data-v-62bf72e8]{color:#333;font-size:1rem}.search_box .search .left span[data-v-62bf72e8]{display:block;margin:0 .25rem;max-width:5.75rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333}.search_box .search .left i[data-v-62bf72e8]:last-child{font-size:1.125rem}.search_box .search .right[data-v-62bf72e8]{width:12.375rem;height:1.875rem;background:#f8f8f8;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;line-height:1.875rem;border-radius:1rem;padding:0 .625rem;font-size:14px;color:#c9c9c9}.search_box .search .right i[data-v-62bf72e8]{font-size:1.125rem;margin-right:.375rem}.search_box .search .right input[data-v-62bf72e8]{border:none;width:100%}.search_box .search .right input[data-v-62bf72e8]::-webkit-input-placeholder,.search_box .search .right textarea[data-v-62bf72e8]::-webkit-input-placeholder{color:#c9c9c9}.bottom-popop-box[data-v-62bf72e8]{text-align:left;margin:1rem}.bottom-popop-box .red[data-v-62bf72e8]{color:#f01818}.bottom-popop-box .title[data-v-62bf72e8]{text-align:center;font-weight:700;font-size:15px;margin-bottom:1rem}.bottom-popop-box .stock-box[data-v-62bf72e8]{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.bottom-popop-box .input-num[data-v-62bf72e8],.bottom-popop-box .stock-box[data-v-62bf72e8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.bottom-popop-box .input-num[data-v-62bf72e8]{padding:.5rem 0;margin:.5rem 0;border-bottom:1px solid #eee}.bottom-popop-box .input-num input[data-v-62bf72e8]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;border:none;outline:none}.bottom-popop-box .allExchange[data-v-62bf72e8]{text-align:center;font-size:13px;width:3.781rem;height:1.25rem;border-radius:.625rem;border:1px solid #f01818;color:#f01818}.bottom-popop-box .remain[data-v-62bf72e8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;font-weight:700;margin-top:2rem}.bottom-popop-box .remain .sure-btn[data-v-62bf72e8]{font-size:15px;text-align:center;line-height:2.5rem;width:8.5rem;height:2.5rem;background-color:#f01818;border-radius:1.234rem;color:#fff}.text-over[data-v-62bf72e8]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.goods-box[data-v-62bf72e8]{background:#fff;padding:1rem;padding-bottom:4rem;min-height:100vh}.goods-box li[data-v-62bf72e8]{padding-bottom:.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.goods-box li .left[data-v-62bf72e8]{-webkit-box-flex:0;-webkit-flex:0 0 8rem;-ms-flex:0 0 8rem;flex:0 0 8rem}.goods-box li .left img[data-v-62bf72e8]{width:8rem;height:8rem;border-radius:.313rem}.goods-box li .right[data-v-62bf72e8]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:left;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin:.5rem 0 .5rem .5rem;font-size:12px;width:13rem}.goods-box li .title[data-v-62bf72e8]{font-weight:700;font-size:15px;margin-bottom:.3rem;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.goods-box li .spec[data-v-62bf72e8]{color:#9f9f9f}.goods-box li .stock[data-v-62bf72e8]{margin-top:1rem;margin-bottom:.3rem}.goods-box li .price[data-v-62bf72e8]{color:#f01818;font-size:15px}.goods-box li .repertory[data-v-62bf72e8]{color:#9f9f9f}.goods-box li .ticket[data-v-62bf72e8]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.goods-box li .number[data-v-62bf72e8]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;color:#fb9a00;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.goods-box li .exchange[data-v-62bf72e8]{background-color:#ffae00;border-radius:15px;color:#fff;padding:2px .5rem;line-height:1rem}.car-btn[data-v-62bf72e8]{position:fixed;bottom:0;left:0;width:100%;height:3.5rem;background:#fff;-webkit-box-shadow:0 0 1rem 0 rgba(0,0,0,.09);box-shadow:0 0 1rem 0 rgba(0,0,0,.09)}.car-btn p[data-v-62bf72e8]{font-size:15px;font-weight:700;color:#fff;background-color:#f01818;border-radius:1.25rem;width:15.625rem;height:2.5rem;margin:.5rem auto;text-align:center;line-height:2.5rem}.pcStyle[data-v-62bf72e8]{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}",""]),t.exports=e},"7a56":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",{staticClass:"search_box",style:{width:3==t.fun.getPhoneEnv()?"375px":""}},[o("ul",{staticClass:"search"},[o("li",{staticClass:"left"},[o("i",{staticClass:"iconfont icon-back",staticStyle:{"padding-right":"1.5rem"},on:{click:t.goBack}}),o("span",[t._v("我的库存")])]),o("li",{staticClass:"right"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.kwd,expression:"kwd"}],staticStyle:{color:"#000"},attrs:{type:"text",title:"搜索",placeholder:"搜索商品"},domProps:{value:t.kwd},on:{input:function(e){e.target.composing||(t.kwd=e.target.value)}}}),o("i",{staticClass:"iconfont icon-sousuo",on:{click:t.getData}})])])]),o("div",{staticStyle:{height:"2.75rem"}}),o("ul",{staticClass:"goods-box"},t._l(t.list,(function(e,i){return o("li",{key:i,on:{click:function(o){return o.stopPropagation(),t.gotoStock(e.goods_id,e.option_id)}}},[o("div",{staticClass:"left"},[o("img",{attrs:{src:e.goods?e.goods.thumb:"",alt:""}})]),o("div",{staticClass:"right"},[o("p",{staticClass:"title"},[t._v(t._s(e.goods?e.goods.title:""))]),o("p",{staticClass:"stock"},[t._v(" 进货价:"),o("span",{staticClass:"price"},[t._v(t._s(t.$i18n.t("money"))+t._s(e.show_price))]),o("span",{staticClass:"repertory"},[t._v("库存"+t._s(e.stock))])]),o("div",{staticClass:"ticket"},[o("p",{staticClass:"number text-over"},[t._v(" 兑换券 "+t._s(e.goods_change?e.goods_change.certificate:"0")+"张 ")]),e.is_exchange?o("p",{staticClass:"exchange",on:{click:function(o){return o.stopPropagation(),t.showPop(e.stock,e.id,e.goods_change.certificate)}}},[t._v(" 兑换券 ")]):t._e()])])])})),0),o("div",{staticClass:"car-btn",class:[3==t.fun.getPhoneEnv()?"pcStyle":""],style:{width:3==t.fun.getPhoneEnv()?"375px":""}},[o("p",{on:{click:t.gotoOrderGoods}},[t._v("订货")])]),o("van-popup",{attrs:{position:"bottom",closeable:"","close-icon":"close"},model:{value:t.show1,callback:function(e){t.show1=e},expression:"show1"}},[o("div",{staticClass:"bottom-popop-box"},[o("p",{staticClass:"title"},[t._v("换取兑换券")]),o("div",{staticClass:"stock-box"},[o("p",[t._v("库存")]),o("div",{staticClass:"input-num"},[o("input",{directives:[{name:"model",rawName:"v-model",value:t.exchangeNum,expression:"exchangeNum"}],attrs:{type:"number",placeholder:"请输入数量"},domProps:{value:t.exchangeNum},on:{input:function(e){e.target.composing||(t.exchangeNum=e.target.value)}}}),o("p",{staticClass:"allExchange",on:{click:t.allExchange}},[t._v("全部兑换")])]),o("p",[t._v(" 可得到"),o("span",{staticClass:"red"},[t._v(t._s(t.canExchangeNum))]),t._v("张兑换券 ")])]),o("div",{staticClass:"remain"},[o("p",{staticStyle:{flex:"1","line-height":"2.5rem"}},[t._v("剩余库存:"+t._s(t.exchangeStock))]),o("p",{staticClass:"sure-btn",on:{click:t.goodsExchange}},[t._v(" "+t._s(t.exchangeStatus?"兑换成功,去换货":"确定")+" ")])])])])],1)},a=[],s=(o("e7e5"),o("d399")),n=(o("99af"),o("6968")),l=o("ac0d"),r={mixins:[l["a"]],data:function(){return{show1:!1,list:[],kwd:"",isLoadMore:!0,page:1,total_page:0,getNum:0,exchangeNum:0,exchageLid:null,exchangeStock:null,exchangeStatus:0}},activated:function(){this.init(),this.getData()},methods:{init:function(){this.show1=!1,this.list=[],this.kwd="",this.isLoadMore=!0,this.page=1,this.total_page=0,this.getNum=0,this.exchangeNum=0,this.exchageLid=null,this.exchangeStock=null,this.exchangeStatus=0},showPop:function(t,e,o){var i=this;this.exchangeStatus=0,this.exchangeStock=t,this.exchageLid=e,this.getNum=o,this.$nextTick((function(){i.show1=!0}))},getData:function(){var t=this,e={};this.kwd&&(e.kwd=this.kwd),$http.post("plugin.channel.frontend.my-stock.getList",e,"").then((function(e){1===e.result?(t.kwd="",t.list=e.data.list.data,t.isLoadMore=!0,t.total_page=e.data.list.last_page,t.total_page||(t.total_page=0)):Object(s["a"])(e.msg)})).catch((function(t){}))},getMoreData:function(){var t=this;if(t.isLoadMore=!1,!(this.page>=this.total_page)){this.page=this.page+1;var e={page:this.page};$http.get("plugin.channel.frontend.my-stock.getList",e,"").then((function(e){if(t.isLoadMore=!0,1===e.result){var o=e.data.list.data;t.list=t.list.concat(o)}else t.page=t.page-1,t.isLoadMore=!1}),(function(t){}))}},goBack:function(){window.history.length<=1?this.$router.push(this.fun.getUrl("home",{})):this.$router.go(-1)},gotoStock:function(t,e){this.$router.push(this.fun.getUrl("distributor_stock",{goods_id:t,option_id:e}))},allExchange:function(){this.exchangeNum=this.exchangeStock},goodsExchange:function(){var t=this;if(this.exchangeStatus)this.$router.push(this.fun.getUrl("exchangeGoods"));else{if(this.exchangeNum)return this.exchangeNum>this.exchangeStock?(Object(s["a"])("兑换数量不能大于库存数量,最多为".concat(this.exchangeStock)),void this.allExchange()):void $http.post("plugin.channel.frontend.my-stock.goodsExchange",{lid:this.exchageLid,num:this.exchangeNum},"").then((function(e){1===e.result?(Object(s["a"])("兑换成功!"),t.exchangeStock=t.exchangeStock-t.exchangeNum,t.exchangeStatus=1):t.$dialog.alert({message:e.msg})})).catch((function(t){}));Object(s["a"])("请输入兑换数量!")}},gotoOrderGoods:function(){this.$router.push(this.fun.getUrl("orderGoods",{}))}},computed:{canExchangeNum:function(){return Math.floor(this.getNum*this.exchangeNum)}},components:{cTitle:n["a"]}},c=r,d=c,h=(o("f916"),o("2877")),f=Object(h["a"])(d,i,a,!1,null,"62bf72e8",null);e["default"]=f.exports},ac0d:function(t,e,o){"use strict";o.d(e,"a",(function(){return s}));var i=document.documentElement,a=document.body,s={data:function(){return{}},activated:function(){window.addEventListener("scroll",this.handleScroll)},deactivated:function(){window.removeEventListener("scroll",this.handleScroll)},methods:{getScrollTop:function(){var t=0;return i&&i.scrollTop?t=i.scrollTop:a&&(t=a.scrollTop),t},getClientHeight:function(){var t=0;return t=a.clientHeight&&i.clientHeight?Math.min(a.clientHeight,i.clientHeight):Math.max(a.clientHeight,i.clientHeight),t},getScrollHeight:function(){return Math.max(a.scrollHeight,i.scrollHeight)},handleScroll:function(){this.otherScroll();var t=document.documentElement.scrollTop||document.body.scrollTop;this.btnFlag=t>60,this.getScrollTop()+this.getClientHeight()+105>this.getScrollHeight()?(this.isLoadMore&&this.getMoreData(),this.isBottom=!0):this.isBottom=!1},otherScroll:function(){}}}},f916:function(t,e,o){"use strict";o("130a")}}]);