text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2102cc"],{b789:function(t,a,s){"use strict";s.r(a);var e=function(){var t=this,a=t.$createElement,s=t._self._c||a;return s("div",{staticClass:"main"},[s("nav",{staticClass:"c-breadcrumb-bg",attrs:{"aria-label":"breadcrumb"}},[s("div",{staticClass:"container"},[s("ol",{staticClass:"breadcrumb"},[s("li",{staticClass:"breadcrumb-item"},[s("router-link",{attrs:{to:{name:"Shop"}}},[t._v("首頁")])],1),s("li",{staticClass:"breadcrumb-item active",attrs:{"aria-current":"page"}},[t._v("購物車")])])])]),t.isCartEmpty?s("div",{staticClass:"container mt-5"},[s("div",{staticClass:"text-center mt-2"},[s("font-awesome-icon",{staticClass:"text-secondary mb-3",attrs:{icon:["fas","shopping-cart"],size:"6x"}}),s("h3",{staticClass:"h5 font-weight-bold"},[t._v("你的購物車是空的")]),s("p",[t._v("記得加入商品到你的購物車")]),s("router-link",{staticClass:"btn btn-info d-inline-block",attrs:{to:"/"}},[t._v("繼續購物")])],1)]):s("div",{staticClass:"container"},[s("div",{staticClass:"row my-5"},[s("div",{staticClass:"col-md-7"},[s("h2",{staticClass:"h3"},[t._v("購物車")]),s("table",{staticClass:"table mt-3"},[s("tbody",[t.cartData.carts?t._l(t.cartData.carts,(function(a){return s("tr",{key:a.id},[s("td",{staticClass:"align-middle text-center"},[s("div",{staticClass:"c-card-img",style:{backgroundImage:"url("+a.product.imageUrl+")"}})]),s("td",{staticClass:"align-middle"},[t._v(" "+t._s(a.product.title)+" "),a.coupon?s("div",{staticClass:"text-success"},[t._v(" 已套用優惠券 ")]):t._e()]),s("td",{staticClass:"align-middle"},[t._v(t._s(a.qty)+t._s(a.product.unit))]),s("td",{staticClass:"align-middle text-right"},[s("span",{class:{"line-through":a.coupon}},[t._v(" "+t._s(t._f("currency")(a.total))+" ")]),a.coupon?s("div",{staticClass:"c-price mt-0"},[t._v(" "+t._s(t._f("currency")(a.final_total))+" ")]):t._e()]),s("td",{staticClass:"align-middle"},[s("font-awesome-icon",{staticClass:"text-danger c-pointer",attrs:{icon:["fas","trash-alt"]},on:{click:function(s){return s.preventDefault(),t.deleteCart(a.id)}}})],1)])})):t._e()],2)])]),s("div",{staticClass:"col-md-5"},[s("h2",{staticClass:"h3 mb-3"},[t._v("訂單小計")]),s("div",{staticClass:"p-3 border"},[s("div",{staticClass:"d-flex justify-content-between mb-2"},[s("span",[t._v("小計")]),s("span",[t._v(t._s(t.cartData.total))])]),s("div",{staticClass:"d-flex justify-content-between mb-3 discount"},[s("span",[t._v("折扣")]),s("span",[t._v(t._s(t.discount))])]),s("div",{staticClass:"d-flex justify-content-between"},[s("span",{staticClass:"c-final-total"},[t._v("總計")]),s("span",[t._v(t._s(t.cartData.final_total))])]),s("div",{staticClass:"input-group"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.couponCode,expression:"couponCode"}],staticClass:"form-control",attrs:{type:"text",placeholder:"輸入優惠券代碼"},domProps:{value:t.couponCode},on:{input:function(a){a.target.composing||(t.couponCode=a.target.value)}}}),s("div",{staticClass:"input-group-append",on:{click:t.addCouponCode}},[s("span",{staticClass:"input-group-text btn-warning c-pointer"},[t._v("套用優惠碼")])])]),s("p",{staticClass:"small text-success mt-1"},[t._v("現在輸入 welcome 即可享有折扣價喔!")]),s("router-link",{staticClass:"btn btn-warning w-100",attrs:{to:{name:"Order"}}},[t._v("前往結帳")])],1)])])])])},i=[],c=s("5530"),n=s("2f62"),o={name:"Cart",computed:Object(c["a"])(Object(c["a"])({},Object(n["c"])(["cartData"])),{},{couponCode:{get:function(){return this.$store.state.couponCode},set:function(t){this.$store.commit("SET_COUPONCODE",t)}},discount:function(){var t=this;return t.cartData.total-t.cartData.final_total},isCartEmpty:function(){return!(this.cartData.carts.length>0)}}),methods:{deleteCart:function(t){this.$store.dispatch("removeCart",t)},addCouponCode:function(){this.$store.dispatch("addCouponCode")}}},r=o,l=s("2877"),d=Object(l["a"])(r,e,i,!1,null,null,null);a["default"]=d.exports}}]);
  //# sourceMappingURL=chunk-2d2102cc.8313f8aa.js.map