1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9ed7a666"],{2034:function(e,t,i){var s=i("24fb"),o=i("1de5"),d=i("857d3");t=s(!1);var a=o(d);t.push([e.i,"#distributor[data-v-25c3703f]{background:#fff;min-height:100vh;padding-bottom:100px}.head-bg[data-v-25c3703f]{background-image:url("+a+");background-repeat:no-repeat;background-size:contain;width:100%;height:6.25rem;color:#fff;text-align:left;padding:1rem}.address-box[data-v-25c3703f]{width:90%;min-height:5.844rem;background-color:#fff;-webkit-box-shadow:0 0 .563rem 0 hsla(0,0%,47.1%,.27);box-shadow:0 0 .563rem 0 hsla(0,0%,47.1%,.27);border-radius:5px;position:absolute;top:6.5rem;left:5%;text-align:left;padding:.7rem}.address-box[data-v-25c3703f],.address-box .name[data-v-25c3703f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.address-box .name[data-v-25c3703f]{margin-bottom:.5rem;font-weight:700}.address-box .name span[data-v-25c3703f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.address-box .name span[data-v-25c3703f]:last-child{text-align:right}.address-box .icon-advertise-next[data-v-25c3703f]{font-size:24px;font-weight:700;color:#999}.address-box.PCstyle[data-v-25c3703f]{width:375px;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.goods-box[data-v-25c3703f]{padding:1rem;margin-top:3.5rem;text-align:left}.goods-box li[data-v-25c3703f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-bottom:.5rem}.goods-box li .left[data-v-25c3703f]{-webkit-box-flex:0;-webkit-flex:0 0 4rem;-ms-flex:0 0 4rem;flex:0 0 4rem}.goods-box li .left img[data-v-25c3703f]{width:4rem;height:4rem;border-radius:5px}.goods-box li .right[data-v-25c3703f]{margin-left:.5rem;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;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;padding:.2rem;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between}.goods-box li .right .title[data-v-25c3703f]{font-weight:700;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.goods-box li .right .bottom[data-v-25c3703f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.goods-box li .right .stock[data-v-25c3703f]{color:#9f9f9f;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.goods-box li .right .number[data-v-25c3703f]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:right}.talk-box[data-v-25c3703f]{text-align:left;padding:0 1rem 1rem}.talk-box .title[data-v-25c3703f]{font-weight:700}.talk-box input[data-v-25c3703f]{background-color:#f8f8f8;border:none;outline:none;width:100%;height:2rem;line-height:2rem;margin-top:.5rem;padding:0 .5rem;border-radius:5px}.car-btn[data-v-25c3703f]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:fixed;bottom:0;left:0;width:100%;background:#fff;border-top:1px solid #eee;padding:.5rem 1rem}.car-btn .buy[data-v-25c3703f]{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;margin-left:75%}.add-info[data-v-25c3703f]{overflow-y:scroll;width:100%;background:#fff;max-height:50vh;padding-top:.625rem}input[data-v-25c3703f]{border:none}.text_adderss[data-v-25c3703f]{background-color:#fff}.text_adderss input[data-v-25c3703f]{text-wrap:unset;padding:.625rem .875rem;font-size:14px;line-height:1.5rem;width:100%;min-height:3.25rem}.pcStyle[data-v-25c3703f]{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.default-address .van-cell[data-v-25c3703f]{height:50px;padding:0 12px}.default-address .van-cell .van-cell__title[data-v-25c3703f]{text-align:left;-webkit-box-flex:0;-webkit-flex:none;-ms-flex:none;flex:none}.default-address .van-cell .van-cell__value input[data-v-25c3703f]{width:100%}[data-v-25c3703f] .van-cell--clickable:active{background-color:#fff}",""]),e.exports=t},"4d976":function(e,t,i){var s=i("2034");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[e.i,s,""]]),s.locals&&(e.exports=s.locals);var o=i("499e").default;o("6e5ff4ae",s,!0,{sourceMap:!1,shadowMode:!1})},"857d3":function(e,t,i){e.exports=i.p+"static/app/img/kc_orderbg@2x.ae496dc5.png"},b335:function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{attrs:{id:"distributor"}},[i("c-title",{attrs:{hide:!1,text:"下单"}}),i("div",{staticClass:"head-bg"},[i("p",{staticStyle:{"font-weight":"bold","font-size":"16px"}},[e._v("下单")]),i("p",[e._v("共"+e._s(e.order_data.length)+"件商品")])]),i("div",{staticClass:"address-box",class:{PCstyle:3==e.fun.getPhoneEnv()},on:{click:e.showAddressFun}},[i("div",{staticStyle:{flex:"1"}},[i("p",{staticClass:"name"},[i("span",[e._v("收件人:"+e._s(e.realname))]),e._v(" "),i("span",[e._v(e._s(e.mobile))])]),i("p",{staticClass:"address"},[e._v("地址:"+e._s(e.address))])]),e._m(0)]),e._l(e.order_data,(function(t,s){return i("div",{key:s},[i("ul",{staticClass:"goods-box"},e._l(t.order_goods,(function(t,s){return i("li",{key:s},[i("div",{staticClass:"left"},[i("img",{attrs:{src:t.thumb,alt:""}})]),i("div",{staticClass:"right"},[i("p",{staticClass:"title"},[e._v(e._s(t.title))]),i("p",{staticClass:"bottom"},[i("span",{staticClass:"stock"},[e._v("规格:"+e._s(t.goods_option_title))]),i("span",{staticClass:"number"},[e._v("x"+e._s(t.total))])])])])})),0),i("div",{staticClass:"talk-box"},[i("p",{staticClass:"title"},[e._v("留言")]),i("input",{directives:[{name:"model",rawName:"v-model.lazy",value:e.note[t.pre_id],expression:"note[item.pre_id]",modifiers:{lazy:!0}}],attrs:{placeholder:"50字以内(选填)",maxlength:"50",type:"text",title:""},domProps:{value:e.note[t.pre_id]},on:{change:[function(i){return e.$set(e.note,t.pre_id,i.target.value)},function(i){return e.noteHandle(i,t,e.note[t.pre_id])}]}})])])})),i("div",{staticClass:"car-btn",class:[3==e.fun.getPhoneEnv()?"pcStyle":""],style:{width:3==e.fun.getPhoneEnv()?"375px":""}},[i("div",{staticClass:"buy",on:{click:e.submit}},[e._v("确认下单")])]),i("yz-address-list",{on:{confirm:e.confirmSelectAddress},model:{value:e.showAddress,callback:function(t){e.showAddress=t},expression:"showAddress"}})],2)},o=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticStyle:{display:"flex","align-self":"center"}},[i("i",{staticClass:"iconfont icon-advertise-next"})])}],d=(i("e7e5"),i("d399")),a=(i("14d9"),i("e9c4"),i("d81d"),i("a434"),i("a234")),n="channel_freedom",r="",c="",l={},f=[],h=0,u={data:function(){return{integral:window.localStorage.integral,order_data:"",goodsInfo:{},realname:"",mobile:"",address:"",price:0,showAddress:!1,checkDeductionList:[],submit_active:!0,defaultAddress:{},note:[]}},activated:function(){this.initData(),r=this.$route.params.tag,this.fun.isTextEmpty(r)&&this.$router.push(this.fun.getUrl("home",{})),r==n&&(f=this.$route.params.cart_ids,this.getDataActionCart())},methods:{initData:function(){this.order_data=[],this.goodsInfo={},this.realname="",this.mobile="",this.address="",this.price=0,this.showAddress=!1,this.checkDeductionList=[],this.submit_active=!0,this.defaultAddress={},this.note=[],c="",l={},f=[]},getDataActionCart:function(){var e=this,t={dispatch_type_id:1,channel_type:3,cart_ids:f,member_coupon_ids:[],orders:JSON.stringify(this.assembleDeduction()),address:encodeURIComponent(JSON.stringify(l))},i="plugin.channel.frontend.freedom-cart-buy.index";$http.get(i,t,"生成中").then((function(t){1===t.result?(e.goodsInfo=t.data,e.setViewData(t.data),e.setAddressViewData(t.data.dispatch.default_member_address)):(Object(d["a"])(t.msg),e.$router.go(-1))}),(function(e){}))},setViewData:function(e){this.order_data=e.orders,this.price=e.total_price},setAddressViewData:function(e){void 0!=e&&""!=e&&e!=[]&&(c=e.id,l=e,this.realname=this.fun.isTextEmpty(e.username)?"":e.username,this.mobile=this.fun.isTextEmpty(e.mobile)?"":e.mobile,this.address=this.fun.isTextEmpty(e.province)?"":e.province+" "+e.city+" "+e.district+" "+(this.fun.isTextEmpty(e.street)?"":e.street+" ")+e.address)},requestByAddress:function(){r==n&&(this.order_data="",this.getDataActionCart())},showAddressFun:function(){this.showAddress=!0},confirmSelectAddress:function(e){this.setAddressViewData(e),this.requestByAddress(),this.showAddress=!1},submit:function(){if(1==this.submit_active){if(this.submit_active=!1,!this.order_data[0].need_address&&this.fun.isTextEmpty(c))return Object(d["a"])("请选择收货地址"),void(this.submit_active=!0);var e=this,t=this.assembleJson();if(0===h){h=1;var i="plugin.channel.frontend.freedom-create.index";$http.post(i,t,"提交中").then((function(t){1===t.result?(Object(d["a"])("下单成功!"),e.$router.push(e.fun.getUrl("distributorIndex",{}))):Object(d["a"])(t.msg),e.submit_active=!0,setTimeout((function(){h=0}),1e3)}),(function(t){e.submit_active=!0})).catch((function(e){}))}}},assembleJson:function(){var e={address:encodeURIComponent(JSON.stringify(l)),goods:JSON.stringify(this.assembleGoods()),member_coupon_ids:JSON.stringify([]),orders:JSON.stringify(this.assembleDeduction()),invoice_type:0,rise_type:1,call:"",company_number:""};return r==n&&(e.dispatch_type_id=1,e.channel_type=3,e.cart_ids=JSON.stringify(f)),e},assembleGoods:function(){for(var e=[],t=0;t<this.goodsInfo.orders.length;t++)for(var i=0;i<this.goodsInfo.orders[t].order_goods.length;i++){var s={};s.goods_id=this.goodsInfo.orders[t].order_goods[i].goods_id,s.total=this.goodsInfo.orders[t].order_goods[i].total,s.option_id=this.goodsInfo.orders[t].order_goods[i].goods_option_id,e.push(s)}return e},assembleDeduction:function(){for(var e=[],t=0;t<this.checkDeductionList.length;t++)e.push(this.checkDeductionList[t]);return e},noteHandle:function(e,t){var i=this;if(t.order_deductions[0])this.screenDiscount(t,t.order_deductions[0]);else{var s=!1;this.checkDeductionList.length>0&&this.checkDeductionList.map((function(e,o){e.pre_id==t.pre_id&&(s=!0,e.note=i.note[t.pre_id])})),s||this.checkDeductionList.push({deduction_ids:[],pre_id:t.pre_id,note:this.note[t.pre_id]}),this.checkDeductionList.reverse()}},screenDiscount:function(e,t){var i=this;this.checkDeductionList.length>0?(this.checkDeductionList.map((function(s,o){s.pre_id==e.pre_id&&(t.checked?s.deduction_ids&&-1==s.deduction_ids.indexOf(t.code)&&s.deduction_ids.push(t.code):s.deduction_ids&&s.deduction_ids.indexOf(t.code)>-1&&s.deduction_ids.splice(s.deduction_ids.indexOf(t.code),1),s.note=i.note[e.pre_id],s.service_fee=i.service_fee[e.pre_id])})),this.checkDeductionList.reverse()):this.checkDeductionList.push({deduction_ids:[t.code],pre_id:e.pre_id,note:this.note[e.pre_id]})}},components:{yzAddressList:a["default"]}},b=u,p=b,m=(i("e63f"),i("2877")),g=Object(m["a"])(p,s,o,!1,null,"25c3703f",null);t["default"]=g.exports},e63f:function(e,t,i){"use strict";i("4d976")}}]); |