1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4e407ce5"],{"12d6":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,".van-button[data-v-f014310c]{padding:0 24px}.search_box[data-v-f014310c]{position:fixed;width:100%;z-index:99;border-bottom:.0625rem solid #efefef}.search_box .search[data-v-f014310c]{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-f014310c],.search_box .search .left[data-v-f014310c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.search_box .search .left[data-v-f014310c]{font-size:16px;font-weight:700}.search_box .search .left i[data-v-f014310c]{color:#333;font-size:1rem}.search_box .search .left span[data-v-f014310c]{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-f014310c]:last-child{font-size:1.125rem}.search_box .search .right[data-v-f014310c]{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-f014310c]{font-size:1.125rem;margin-right:.375rem}.search_box .search .right input[data-v-f014310c]{border:none;width:100%}.search_box .search .right input[data-v-f014310c]::-webkit-input-placeholder,.search_box .search .right textarea[data-v-f014310c]::-webkit-input-placeholder{color:#c9c9c9}.text-over[data-v-f014310c]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.goods-box[data-v-f014310c]{background:#fff;padding:1rem;min-height:100vh}.goods-box li[data-v-f014310c]{padding-bottom:.5rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.goods-box li .left[data-v-f014310c]{-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-f014310c]{width:8rem;height:8rem;border-radius:.313rem}.goods-box li .right[data-v-f014310c]{-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}.goods-box li .title[data-v-f014310c]{font-weight:700;color:#000;font-size:.75rem;height:2.5rem;line-height:1.25rem;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-f014310c]{color:#9f9f9f}.goods-box li .stock[data-v-f014310c]{margin-top:1rem;margin-bottom:.3rem}.goods-box li .price[data-v-f014310c]{color:#f01818;font-size:15px}.goods-box li .repertory[data-v-f014310c]{color:#9f9f9f;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.goods-box li .ticket[data-v-f014310c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.goods-box li .exchange[data-v-f014310c]{background-color:#ffae00;border-radius:15px;color:#fff;padding:2px .5rem;line-height:1rem}.car-btn[data-v-f014310c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:fixed;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-webkit-flex-direction:row-reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse;bottom:0;left:0;width:100%;background:#fff;border-top:1px solid #eee;padding:.5rem 1rem}.car-btn .all[data-v-f014310c]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:left;-webkit-align-self:center;-ms-flex-item-align:center;align-self:center}.car-btn .buy[data-v-f014310c]{font-weight:700;width:5.125rem;height:2rem;line-height:2rem;background-image:-webkit-gradient(linear,left top,right top,from(#f74c4c),to(#f20b0b)),-webkit-gradient(linear,left top,left bottom,from(#000),to(#000));background-image:-webkit-linear-gradient(left,#f74c4c,#f20b0b),-webkit-linear-gradient(#000,#000);background-image:linear-gradient(90deg,#f74c4c,#f20b0b),linear-gradient(#000,#000);background-blend-mode:normal,normal;border-radius:1rem;color:#fff}.select[data-v-f014310c]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.select span[data-v-f014310c]{width:1.5rem}.select input[data-v-f014310c],.select span[data-v-f014310c]{outline:none;border:none;display:inline-block;height:1.5rem;line-height:1.5rem;font-size:14px;text-align:center}.select input[data-v-f014310c]{width:2rem}.select i[data-v-f014310c]:first-child{background-color:#ccc}.select i[data-v-f014310c]:last-child{background-color:#ffae00}.select i[data-v-f014310c]{width:1.5rem;height:1.5rem;text-align:center;line-height:1.5rem;border-radius:.75rem;color:#fff;font-size:16px}.pcStyle[data-v-f014310c]{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}",""]),t.exports=e},"6ffb":function(t,e,i){var a=i("12d6");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var o=i("499e").default;o("0abcb3f0",a,!0,{sourceMap:!1,shadowMode:!1})},e0ef:function(t,e,i){"use strict";i("6ffb")},e71bf:function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"search_box",style:{width:3==t.fun.getPhoneEnv()?"375px":""}},[i("ul",{staticClass:"search"},[i("li",{staticClass:"left"},[i("i",{staticClass:"iconfont icon-back",staticStyle:{"padding-right":"1.5rem"},on:{click:t.goBack}}),i("span",[t._v("发货")])])])]),i("div",{staticStyle:{height:"2.75rem"}}),i("ul",{staticClass:"goods-box",staticStyle:{"padding-top":"0.5rem"}},t._l(t.list,(function(e,a){return i("van-swipe-cell",{key:a,staticClass:"aaa"},[i("li",[i("div",{staticClass:"left"},[i("img",{attrs:{src:e.goods.thumb,alt:""}})]),i("div",{staticClass:"right"},[i("p",{staticClass:"title"},[t._v(t._s(t._f("escapeTitle")(e.goods.title)))]),i("span",{staticClass:"spec text-over"},[t._v("规格:"+t._s(e.option_str?e.option_str:"无规格"))]),i("p",{staticClass:"stock"},[t._v(" 价格:"),i("span",{staticClass:"price"},[t._v(t._s(t.$i18n.t("money"))+t._s(e.goods.price))])]),i("div",{staticClass:"ticket "},[i("p",{staticClass:"repertory text-over"},[t._v("库存 "+t._s(e.goods.stock))]),i("div",{staticClass:"select"},[i("i",{staticClass:"iconfont icon-life-game-sign",on:{click:function(e){return e.stopPropagation(),t.numberLeft(a)}}}),i("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.total,expression:"item.total",modifiers:{lazy:!0}}],ref:"tcInput",refInFor:!0,staticClass:"shownum",attrs:{type:"number"},domProps:{value:e.total},on:{focus:function(e){return t.getActiveOldTotal(a)},keyup:t.getActiveNewTotal,change:function(i){return t.$set(e,"total",i.target.value)}}}),i("i",{staticClass:"iconfont icon-life-game-plus",on:{click:function(e){return e.stopPropagation(),t.numberRight(a)}}})])])])]),i("template",{slot:"right"},[i("van-button",{staticStyle:{height:"100%"},attrs:{square:"",type:"danger",text:"删除"},on:{click:function(e){return t.delCart(a)}}})],1)],2)})),1),i("div",{staticClass:"car-btn",class:[3==t.fun.getPhoneEnv()?"pcStyle":""],style:{width:3==t.fun.getPhoneEnv()?"375px":""}},[i("van-button",{attrs:{type:"danger",round:"",disabled:t.loading,loading:t.loading,size:"small"},on:{click:t.submitGoods}},[t._v(t._s(t.loading?"加载中":"下一步"))])],1)])},o=[],l=(i("e7e5"),i("d399")),s=(i("14d9"),i("a9e3"),i("6968")),n=[],r={data:function(){return{list:[],ActiveIndex:null,timeoutId:null,loading:!1}},activated:function(){n=[],this.getData()},methods:{getData:function(){var t=this;$http.post("plugin.channel.frontend.freedom-cart.index",{},"").then((function(e){if(1===e.result){t.list=e.data;for(var i=0;i<t.list.length;i++)n.push(t.list[i].id)}else t.$dialog.alert({message:e.msg}),t.$router.go(-1)})).catch((function(t){}))},submitGoods:function(){this.$router.push(this.fun.getUrl("placeOrder",{tag:"channel_freedom",cart_ids:n}))},changeCount:function(t,e,i){var a=this,o={id:t,num:e,i:this.fun.getKeyByI(),type:this.fun.getTyep()};this.loading=!0,$http.get("plugin.channel.frontend.freedom-cart.updateNum",o,"").then((function(t){1===t.result?1==e?a.list[i].total=Number(a.list[i].total)+1:-1==e&&(a.list[i].total=Number(a.list[i].total)-1):Object(l["a"])(t.msg),a.loading=!1}),(function(t){a.loading=!1}))},getActiveNewTotal:function(t){if(null!=this.ActiveIndex){this.timeoutId&&clearTimeout(this.timeoutId);var e=this,i=t.target.value,a=null;this.timeoutId=setTimeout((function(){e.list[e.ActiveIndex].total!=i?(i<1&&(Object(l["a"])("订货数量不少于1"),e.$refs.tcInput[e.ActiveIndex].value=1,i=1),i>e.list[e.ActiveIndex].goods.stock&&(Object(l["a"])("当前商品库存为".concat(e.list[e.ActiveIndex].goods.stock)),e.$refs.tcInput[e.ActiveIndex].value=e.list[e.ActiveIndex].goods.stock,i=e.list[e.ActiveIndex].goods.stock),a=Number(-(e.list[e.ActiveIndex].total-i)),e.$refs.tcInput[e.ActiveIndex].blur(),0==a||e.changeCount(e.list[e.ActiveIndex].id,a,e.ActiveIndex)):e.getData()}),50)}},getActiveOldTotal:function(t){this.ActiveIndex=t},numberLeft:function(t){var e=Number(this.list[t].total)-1;if(e<=0)return Object(l["a"])("商品数量不能为负数或零"),void(this.list[t].total=1);this.changeCount(this.list[t].id,-1,t)},numberRight:function(t){this.changeCount(this.list[t].id,1,t)},delCart:function(t){var e=this;e.$dialog.confirm({message:"确认删除该商品吗",confirmButtonText:"确定"}).then((function(){$http.get("plugin.channel.frontend.freedom-cart.destroy",{ids:e.list[t].id},"").then((function(t){1===t.result?(Object(l["a"])("移除成功!"),e.getData()):Object(l["a"])(t.msg)}),(function(t){}))})).catch((function(){}))},goBack:function(){window.history.length<=1?this.$router.push(this.fun.getUrl("home",{})):this.$router.go(-1)}},components:{cTitle:s["a"]}},c=r,d=c,f=(i("e0ef"),i("2877")),b=Object(f["a"])(d,a,o,!1,null,"f014310c",null);e["default"]=b.exports}}]); |