text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b8a74e4e"],{1255:function(e,t,s){"use strict";var i=s("51eb"),a=s.n(i);a.a},"2c69":function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"order-confirm"},[s("order-header",{attrs:{title:"订单确认"},scopedSlots:e._u([{key:"tip",fn:function(){return[s("span",[e._v("请认真填写收货地址")])]},proxy:!0}])}),s("svg",{staticStyle:{position:"absolute",width:"0px",height:"0px",overflow:"hidden"},attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}},[s("defs",[s("symbol",{attrs:{id:"icon-add",viewBox:"0 0 31 32"}},[s("title",[e._v("add")]),s("path",{staticClass:"path1",attrs:{d:"M30.745 15.152h-14.382v-14.596c0-0.308-0.243-0.557-0.543-0.557s-0.543 0.249-0.543 0.557v14.596h-14.665c-0.3 0-0.543 0.249-0.543 0.557s0.243 0.557 0.543 0.557h14.665v15.177c0 0.307 0.243 0.557 0.543 0.557s0.543-0.249 0.543-0.557v-15.177h14.382c0.3 0 0.543-0.249 0.543-0.557s-0.243-0.557-0.543-0.557z"}})]),s("symbol",{attrs:{id:"icon-edit",viewBox:"0 0 32 32"}},[s("title",[e._v("edit")]),s("path",{staticClass:"path1",attrs:{d:"M28.287 8.51l-4.805-4.806 0.831-0.831c0.472-0.472 1.086-0.777 1.564-0.777 0.248 0 0.452 0.082 0.622 0.253l3.143 3.144c0.539 0.54 0.133 1.529-0.524 2.186l-0.831 0.831zM26.805 9.992l-1.138 1.138-4.805-4.806 1.138-1.138 4.805 4.806zM24.186 12.612l-14.758 14.762-4.805-4.806 14.758-14.762 4.805 4.806zM7.379 28.288l-4.892 1.224 1.223-4.894 3.669 3.67zM31.123 4.011l-3.143-3.144c-0.567-0.567-1.294-0.867-2.103-0.867-1.036 0-2.174 0.52-3.045 1.391l-20.429 20.436c-0.135 0.134-0.23 0.302-0.276 0.487l-2.095 8.385c-0.089 0.355 0.017 0.736 0.276 0.995 0.198 0.198 0.461 0.307 0.741 0.307 0.085 0 0.171-0.010 0.254-0.031l8.381-2.096c0.185-0.047 0.354-0.142 0.487-0.276l20.43-20.436c1.409-1.41 2.042-3.632 0.524-5.15v0z"}})]),s("symbol",{attrs:{id:"icon-del",viewBox:"0 0 32 32"}},[s("title",[e._v("delete")]),s("path",{staticClass:"path1",attrs:{d:"M11.355 4.129v-2.065h9.29v2.065h-9.29zM6.194 29.935v-23.742h19.613v23.742h-19.613zM30.968 4.129h-8.258v-3.097c0-0.569-0.463-1.032-1.032-1.032h-11.355c-0.569 0-1.032 0.463-1.032 1.032v3.097h-8.258c-0.569 0-1.032 0.463-1.032 1.032s0.463 1.032 1.032 1.032h3.097v24.774c0 0.569 0.463 1.032 1.032 1.032h21.677c0.569 0 1.032-0.463 1.032-1.032v-24.774h3.097c0.569 0 1.032-0.463 1.032-1.032s-0.463-1.032-1.032-1.032v0z"}}),s("path",{staticClass:"path2",attrs:{d:"M10.323 9.806c-0.569 0-1.032 0.463-1.032 1.032v14.452c0 0.569 0.463 1.032 1.032 1.032s1.032-0.463 1.032-1.032v-14.452c0-0.569-0.463-1.032-1.032-1.032z"}}),s("path",{staticClass:"path3",attrs:{d:"M16 9.806c-0.569 0-1.032 0.463-1.032 1.032v14.452c0 0.569 0.463 1.032 1.032 1.032s1.032-0.463 1.032-1.032v-14.452c0-0.569-0.463-1.032-1.032-1.032z"}}),s("path",{staticClass:"path4",attrs:{d:"M21.677 9.806c-0.569 0-1.032 0.463-1.032 1.032v14.452c0 0.569 0.463 1.032 1.032 1.032s1.032-0.463 1.032-1.032v-14.452c0-0.569-0.463-1.032-1.032-1.032z"}})])])]),s("div",{staticClass:"wrapper"},[s("div",{staticClass:"container"},[s("div",{staticClass:"order-box"},[s("div",{staticClass:"item-address"},[s("h2",{staticClass:"addr-title"},[e._v("收货地址")]),s("div",{staticClass:"addr-list clearfix"},[e._l(e.list,(function(t,i){return s("div",{key:i,staticClass:"addr-info",class:{checked:i==e.checkIndex},on:{click:function(t){e.checkIndex=i}}},[s("h2",[e._v(e._s(t.receiverName))]),s("div",{staticClass:"phone"},[e._v(e._s(t.receiverMobile))]),s("div",{staticClass:"street"},[e._v(e._s(t.receiverProvince+" "+t.receiverCity+" "+t.receiverDistrict+" "+t.receiverAddress))]),s("div",{staticClass:"action"},[s("a",{staticClass:"fl",attrs:{href:"javascript:;"},on:{click:function(s){return e.delAddress(t)}}},[s("svg",{staticClass:"icon icon-del"},[s("use",{attrs:{"xlink:href":"#icon-del"}})])]),s("a",{staticClass:"fr",attrs:{href:"javascript:;"},on:{click:function(s){return e.editAddressModal(t)}}},[s("svg",{staticClass:"icon icon-edit"},[s("use",{attrs:{"xlink:href":"#icon-edit"}})])])])])})),s("div",{staticClass:"addr-add",on:{click:e.openAddressModal}},[s("div",{staticClass:"icon-add"}),s("div",[e._v("添加新地址")])])],2)]),s("div",{staticClass:"item-good"},[s("h2",[e._v("商品")]),s("ul",e._l(e.cartList,(function(t,i){return s("li",{key:i},[s("div",{staticClass:"good-name"},[s("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.productMainImage,expression:"item.productMainImage"}],attrs:{alt:""}}),s("span",[e._v(e._s(t.productName+" "+t.productSubtitle))])]),s("div",{staticClass:"good-price"},[e._v(e._s(t.productPrice)+"元x"+e._s(t.quantity))]),s("div",{staticClass:"good-total"},[e._v(e._s(t.productTotalPrice)+"元")])])})),0)]),e._m(0),e._m(1),s("div",{staticClass:"detail"},[s("div",{staticClass:"item"},[s("span",{staticClass:"item-name"},[e._v("商品件数：")]),s("span",{staticClass:"item-val"},[e._v(e._s(e.count)+"件")])]),s("div",{staticClass:"item"},[s("span",{staticClass:"item-name"},[e._v("商品总价：")]),s("span",{staticClass:"item-val"},[e._v(e._s(e.cartTotalPrice)+"元")])]),e._m(2),e._m(3),s("div",{staticClass:"item-total"},[s("span",{staticClass:"item-name"},[e._v("应付总额：")]),s("span",{staticClass:"item-val"},[e._v(e._s(e.cartTotalPrice)+"元")])])]),s("div",{staticClass:"btn-group"},[s("a",{staticClass:"btn btn-default btn-large",attrs:{href:"/#/cart"}},[e._v("返回购物车")]),s("a",{staticClass:"btn btn-large",attrs:{href:"javascript:;"},on:{click:e.orderSubmit}},[e._v("去结算")])])])])]),s("modal",{attrs:{title:"新增确认",btnType:"1",showModal:e.showEditModal},on:{cancel:function(t){e.showEditModal=!1},submit:e.submitAddress},scopedSlots:e._u([{key:"body",fn:function(){return[s("div",{staticClass:"edit-wrap"},[s("div",{staticClass:"item"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverName,expression:"checkedItem.receiverName"}],staticClass:"input",attrs:{type:"text",placeholder:"姓名"},domProps:{value:e.checkedItem.receiverName},on:{input:function(t){t.target.composing||e.$set(e.checkedItem,"receiverName",t.target.value)}}}),s("input",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverMobile,expression:"checkedItem.receiverMobile"}],staticClass:"input",attrs:{type:"text",placeholder:"手机号"},domProps:{value:e.checkedItem.receiverMobile},on:{input:function(t){t.target.composing||e.$set(e.checkedItem,"receiverMobile",t.target.value)}}})]),s("div",{staticClass:"item"},[s("select",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverProvince,expression:"checkedItem.receiverProvince"}],attrs:{name:"province"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.checkedItem,"receiverProvince",t.target.multiple?s:s[0])}}},[s("option",{attrs:{value:"北京"}},[e._v("北京")]),s("option",{attrs:{value:"天津"}},[e._v("天津")]),s("option",{attrs:{value:"河北"}},[e._v("河北")])]),s("select",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverCity,expression:"checkedItem.receiverCity"}],attrs:{name:"city"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.checkedItem,"receiverCity",t.target.multiple?s:s[0])}}},[s("option",{attrs:{value:"北京"}},[e._v("北京")]),s("option",{attrs:{value:"天津"}},[e._v("天津")]),s("option",{attrs:{value:"河北"}},[e._v("石家庄")])]),s("select",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverDistrict,expression:"checkedItem.receiverDistrict"}],attrs:{name:"district"},on:{change:function(t){var s=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.checkedItem,"receiverDistrict",t.target.multiple?s:s[0])}}},[s("option",{attrs:{value:"北京"}},[e._v("昌平区")]),s("option",{attrs:{value:"天津"}},[e._v("海淀区")]),s("option",{attrs:{value:"河北"}},[e._v("东城区")]),s("option",{attrs:{value:"天津"}},[e._v("西城区")]),s("option",{attrs:{value:"河北"}},[e._v("顺义区")]),s("option",{attrs:{value:"天津"}},[e._v("房山区")])])]),s("div",{staticClass:"item"},[s("textarea",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverAddress,expression:"checkedItem.receiverAddress"}],attrs:{name:"street"},domProps:{value:e.checkedItem.receiverAddress},on:{input:function(t){t.target.composing||e.$set(e.checkedItem,"receiverAddress",t.target.value)}}})]),s("div",{staticClass:"item"},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.checkedItem.receiverZip,expression:"checkedItem.receiverZip"}],staticClass:"input",attrs:{type:"text",placeholder:"邮编"},domProps:{value:e.checkedItem.receiverZip},on:{input:function(t){t.target.composing||e.$set(e.checkedItem,"receiverZip",t.target.value)}}})])])]},proxy:!0}])}),s("modal",{attrs:{title:"删除确认",btnType:"1",showModal:e.showDelModal},on:{cancel:function(t){e.showDelModal=!1},submit:e.submitAddress},scopedSlots:e._u([{key:"body",fn:function(){return[s("p",[e._v("您确认要删除此地址吗？")])]},proxy:!0}])})],1)},a=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"item-shipping"},[s("h2",[e._v("配送方式")]),s("span",[e._v("包邮")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"item-invoice"},[s("h2",[e._v("发票")]),s("a",{attrs:{href:"javascript:;"}},[e._v("电子发票")]),s("a",{attrs:{href:"javascript:;"}},[e._v("个人")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"item"},[s("span",{staticClass:"item-name"},[e._v("优惠活动：")]),s("span",{staticClass:"item-val"},[e._v("0元")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"item"},[s("span",{staticClass:"item-name"},[e._v("运费：")]),s("span",{staticClass:"item-val"},[e._v("0元")])])}],r=(s("4de4"),s("d81d"),s("c3d4")),c=s("714b"),n={name:"order-confirm",data:function(){return{list:[],cartList:[],cartTotalPrice:0,count:0,checkedItem:{},userAction:"",showDelModal:!1,showEditModal:!1,checkIndex:0}},components:{OrderHeader:r["a"],Modal:c["a"]},mounted:function(){this.getAddressList(),this.getCartList()},methods:{getAddressList:function(){var e=this;this.axios.get("/shippings").then((function(t){e.list=t.list}))},openAddressModal:function(){this.userAction=0,this.checkedItem={},this.showEditModal=!0},editAddressModal:function(e){this.userAction=1,this.checkedItem=e,this.showEditModal=!0},delAddress:function(e){this.checkedItem=e,this.userAction=2,this.showDelModal=!0},submitAddress:function(){var e,t,s=this,i=this.checkedItem,a=this.userAction,r={};if(0==a?(e="post",t="/shippings"):1==a?(e="put",t="/shippings/".concat(i.id)):(e="delete",t="/shippings/".concat(i.id)),0==a||1==a){var c=i.receiverName,n=i.receiverMobile,o=i.receiverProvince,l=i.receiverCity,d=i.receiverDistrict,v=i.receiverAddress,u=i.receiverZip,m="";if(c?n&&/\d{11}/.test(n)?o?l?v&&d?/\d{6}/.test(u)||(m="请输入六位邮编"):m="请输入收货地址":m="请选择对应的城市":m="请选择省份":m="请输入正确格式的手机号":m="请输入收货人名称",m)return void this.$message.error(m);r={receiverName:c,receiverMobile:n,receiverProvince:o,receiverCity:l,receiverDistrict:d,receiverAddress:v,receiverZip:u}}this.axios[e](t,r).then((function(){s.closeModal(),s.getAddressList(),s.$message.success("操作成功")}))},closeModal:function(){this.checkedItem={},this.userAction="",this.showDelModal=!1,this.showEditModal=!1},getCartList:function(){var e=this;this.axios.get("/carts").then((function(t){var s=t.cartProductVoList;e.cartTotalPrice=t.cartTotalPrice,e.cartList=s.filter((function(e){return e.productSelected})),e.cartList.map((function(t){e.count+=t.quantity}))}))},orderSubmit:function(){var e=this,t=this.list[this.checkIndex];t?this.axios.post("/orders",{shippingId:t.id}).then((function(t){e.$router.push({path:"/order/pay",query:{orderNo:t.orderNo}})})):this.$message.error("请选择一个收货地址")}}},o=n,l=(s("1255"),s("2877")),d=Object(l["a"])(o,i,a,!1,null,null,null);t["default"]=d.exports},"511f":function(e,t,s){},"51eb":function(e,t,s){},"6b4a":function(e,t,s){"use strict";var i=s("511f"),a=s.n(i);a.a},c3d4:function(e,t,s){"use strict";var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"order-header"},[s("div",{staticClass:"container clearfix"},[e._m(0),s("div",{staticClass:"title"},[s("h2",[e._v(e._s(e.title)),e._t("tip")],2)]),s("div",{staticClass:"username"},[s("a",{attrs:{href:"javascript:;"}},[e._v(e._s(e.username))])])])])},a=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"header-logo"},[s("a",{attrs:{href:"/#/index"}})])}],r=s("5530"),c=s("2f62"),n={name:"order-header",props:{title:String},computed:Object(r["a"])({},Object(c["c"])(["username"]))},o=n,l=(s("6b4a"),s("2877")),d=Object(l["a"])(o,i,a,!1,null,null,null);t["a"]=d.exports},d81d:function(e,t,s){"use strict";var i=s("23e7"),a=s("b727").map,r=s("1dde"),c=s("ae40"),n=r("map"),o=c("map");i({target:"Array",proto:!0,forced:!n||!o},{map:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})}}]);