You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
16 KiB
2 lines
16 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3db281d4"],{"08bb":function(t,e,r){},1781:function(t,e,r){},"1da1":function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));r("d3b7");function n(t,e,r,n,o,i,a){try{var c=t[i](a),s=c.value}catch(l){return void r(l)}c.done?e(s):Promise.resolve(s).then(n,o)}function o(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function c(t){n(a,o,i,c,s,"next",t)}function s(t){n(a,o,i,c,s,"throw",t)}c(void 0)}))}}},"4f8d":function(t,e,r){},"5aa0":function(t,e,r){t.exports=r.p+"img/back.8059563a.svg"},"64a7":function(t,e,r){"use strict";var n=r("1781"),o=r.n(n);o.a},"64ce":function(t,e,r){"use strict";var n=r("7b5c"),o=r.n(n);o.a},"7b5c":function(t,e,r){},"96cf":function(t,e,r){var n=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(I){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new $(n||[]);return i._invoke=C(t,r,a),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(I){return{type:"throw",arg:I}}}t.wrap=l;var d="suspendedStart",f="suspendedYield",h="executing",p="completed",m={};function v(){}function g(){}function y(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,k=w&&w(w(j([])));k&&k!==r&&n.call(k,i)&&(b=k);var x=y.prototype=v.prototype=Object.create(b);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,i,a,c){var s=u(t[o],t,i);if("throw"!==s.type){var l=s.arg,d=l.value;return d&&"object"===typeof d&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(d).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(s.arg)}var o;function i(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}this._invoke=i}function C(t,e,r){var n=d;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===p){if("throw"===o)throw i;return S()}r.method=o,r.arg=i;while(1){var a=r.delegate;if(a){var c=O(a,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var s=u(t,e,r);if("normal"===s.type){if(n=r.done?p:f,s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=p,r.method="throw",r.arg=s.arg)}}}function O(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=e,O(t,r),"throw"===r.method))return m;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=u(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,m;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function j(t){if(t){var r=t[i];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){while(++o<t.length)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:S}}function S(){return{value:e,done:!0}}return g.prototype=x.constructor=y,y.constructor=g,g.displayName=s(y,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},_(L.prototype),L.prototype[a]=function(){return this},t.AsyncIterator=L,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new L(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(x),s(x,c,"Generator"),x[i]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){while(e.length){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=j,$.prototype={constructor:$,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(F),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;F(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:j(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}(t.exports);try{regeneratorRuntime=n}catch(o){Function("r","regeneratorRuntime = r")(n)}},ddb0:function(t,e,r){var n=r("da84"),o=r("fdbc"),i=r("e260"),a=r("9112"),c=r("b622"),s=c("iterator"),l=c("toStringTag"),u=i.values;for(var d in o){var f=n[d],h=f&&f.prototype;if(h){if(h[s]!==u)try{a(h,s,u)}catch(m){h[s]=u}if(h[l]||a(h,l,d),o[d])for(var p in i)if(h[p]!==i[p])try{a(h,p,i[p])}catch(m){h[p]=i[p]}}}},f86d:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"order"},[n("NavBar",{staticClass:"nav-bar"},[n("div",{staticClass:"back",attrs:{slot:"left"},on:{click:t.backClick},slot:"left"},[n("img",{attrs:{src:r("5aa0"),alt:""}})]),n("div",{attrs:{slot:"center"},slot:"center"},[t._v("填写订单")])]),n("scroll",{ref:"scroll",staticClass:"content",attrs:{"probe-type":3,"pull-up-load":!0},on:{pullingUp:t.loadMore,pullingDown:t.pullingDown}},[n("div",{staticClass:"order_box"},[n("el-form",{ref:"orderFormRef",attrs:{"label-width":"0px",model:t.orderForm,rules:t.orderFormRules}},[n("el-form-item",{attrs:{prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入用户名","prefix-icon":"el-icon-user-solid"},model:{value:t.orderForm.name,callback:function(e){t.$set(t.orderForm,"name",e)},expression:"orderForm.name"}})],1),n("el-form-item",{attrs:{prop:"telephone"}},[n("el-input",{attrs:{placeholder:"请输入电话号码","prefix-icon":"el-icon-phone"},model:{value:t.orderForm.telephone,callback:function(e){t.$set(t.orderForm,"telephone",e)},expression:"orderForm.telephone"}})],1),n("VDistpicker",{attrs:{city:t.orderForm.city,area:t.orderForm.area,province:t.orderForm.province},on:{area:t.onChangeArea,province:t.onChangeProvince,city:t.onChangeCity}}),n("el-form-item",{attrs:{prop:"address"}},[n("el-input",{staticClass:"last-input",attrs:{placeholder:"请输入详细地址","prefix-icon":"el-icon-s-goods"},model:{value:t.orderForm.address,callback:function(e){t.$set(t.orderForm,"address",e)},expression:"orderForm.address"}})],1)],1)],1),n("OredertList",{staticClass:"shop-list"}),n("div",{staticClass:"method"},[n("div",{staticClass:"wrap"},[n("div",{staticClass:"header"},[n("div",[t._v("支付方式")]),n("div",[n("i"),t._v(" 在线支付")]),n("div",[n("i"),t._v(" 货到付款")])]),n("div",{staticClass:"footer"},[n("div",[t._v("发票信息")]),n("div",[t._v("不需要发表")])])])])],1),n("div",{directives:[{name:"show",rawName:"v-show",value:t.isShow,expression:"isShow"}],staticClass:"bottom"},[n("OrderBottom",{on:{order:t.order}})],1)],1)},o=[],i=(r("c975"),r("d3b7"),r("ddb0"),r("96cf"),r("1da1")),a=r("5530"),c=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"cart"},t._l(t.list,(function(e,n){return r("OrderListItem",{key:n,attrs:{"item-info":e}},[t._v(t._s(e)+"> ")])})),1)},s=[],l=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{attrs:{id:"shop-item"}},[r("div",{staticClass:"item-img"},[r("img",{attrs:{src:t.itemInfo.image,alt:"商品图片"}})]),r("div",{staticClass:"item-info"},[r("div",{staticClass:"item-title"},[t._v(t._s(t.itemInfo.title))]),r("div",{staticClass:"item-desc"},[t._v("商品描述: "+t._s(t.itemInfo.desc))]),r("div",{staticClass:"info-bottom"},[r("div",{staticClass:"item-price left"},[t._v("¥"+t._s(t.itemInfo.price))]),r("div",{staticClass:"item-count right"},[t._v("x"+t._s(t.itemInfo.count))])])])])},u=[],d={name:"CartListItem",components:{},data:function(){return{orderdata:{name:"",telephone:"",address:"",image:"",title:"",desc:"",price:""}}},props:{itemInfo:{type:Object,default:function(){return{}}}},methods:{checkClick:function(){this.itemInfo.checked=!this.itemInfo.checked}}},f=d,h=(r("64ce"),r("2877")),p=Object(h["a"])(f,l,u,!1,null,"64c6c3a0",null),m=p.exports,v=r("2f62"),g={name:"OrderList",components:{OrderListItem:m},computed:Object(a["a"])({},Object(v["b"])({list:"cartList"}))},y=g,b=Object(h["a"])(y,c,s,!1,null,"1c24133e",null),w=b.exports,k=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"bottom-menu"},[r("CheckButton",{staticClass:"select-all",on:{checkBtnClick:t.checkBtnClick},model:{value:t.isSelectAll,callback:function(e){t.isSelectAll=e},expression:"isSelectAll"}}),r("span",{staticClass:"total-price"},[t._v("合计: "+t._s(t.totalPrice))]),r("span",{staticClass:"buy-product",on:{click:t.btnclick}},[t._v("确定下单")])],1)},x=[],_=(r("4de4"),r("7db0"),r("4160"),r("13d5"),r("b680"),r("159b"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"icon-selector",class:{"selector-active":t.checked},on:{click:t.selectItem}},[n("img",{attrs:{src:r("94a1"),alt:""}})])])}),L=[],C={name:"CheckButton",props:{value:{type:Boolean,default:!0}},data:function(){return{checked:this.value}},methods:{selectItem:function(){this.$emit("checkBtnClick")}},watch:{value:function(t){this.checked=t}}},O=C,E=(r("fc52"),Object(h["a"])(O,_,L,!1,null,"93dddbe8",null)),F=E.exports,$={name:"OrderBottom",components:{CheckButton:F},computed:Object(a["a"])(Object(a["a"])({},Object(v["b"])(["cartList"])),{},{totalPrice:function(){return"¥"+this.cartList.filter((function(t){return t.checked})).reduce((function(t,e){return t+e.price*e.count}),0).toFixed(2)},checkLength:function(){return!this.cartList.filter((function(t){return t.checked})).length},isSelectAll:function(){return 0!==this.cartList.length&&!this.cartList.find((function(t){return!t.checked}))}}),methods:{checkBtnClick:function(){var t=this.$store.getters.cartList.find((function(t){return!t.checked}));t?this.$store.state.cartList.forEach((function(t){t.checked=!0})):this.$store.state.cartList.forEach((function(t){t.checked=!1}))},btnclick:function(){this.$emit("order")}}},j=$,S=(r("64a7"),Object(h["a"])(j,k,x,!1,null,"097e7a80",null)),I=S.exports,P=r("8d33"),B=r("a7ac"),N={name:"Order",components:{OrderBottom:I,NavBar:B["a"],OredertList:w,Scroll:P["a"],VDistpicker:VDistpicker},data:function(){var t=this,e=function(e,r,n){""===r?n(new Error("请输入手机号")):t.isCellPhone(r)?n():n(new Error("请输入正确的手机号!"))};return{clientHeight:document.documentElement.clientHeight,isShow:!0,listdata:[],orderForm:{user_id:"",name:"",telephone:"",province:"",city:"",area:"",address:"",picture:"",title:"",detail:"",price:""},orderFormRules:{name:[{required:!0,message:"请输入用户名",trigger:"blur"},{min:2,max:11,message:"长度在 2 到 11 个字符",trigger:"blur"}],telephone:[{required:!0,message:"请输入手机号",trigger:"blur"},{validator:e,trigger:"blur"}],address:[{required:!0,message:"请输入地址",trigger:"blur"},{min:3,max:6,message:"长度在 3 到 6 个字符",trigger:"blur"}]}}},computed:Object(a["a"])({},Object(v["b"])({length:"cartLength",list:"cartList"})),methods:{backClick:function(){this.$router.push("/cart")},isCellPhone:function(t){return!!/^1(3|4|5|6|7|8|9)\d{9}$/.test(t)},loadMore:function(){this.$refs.scroll.refresh()},pullingDown:function(){var t=this;this.pullingdown=!0,setTimeout((function(){t.pullingdown=!1,t.$refs.scroll.finishPullDown()}),0)},order:function(){var t=this;this.$refs.orderFormRef.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(r){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:t.listdata=t.$store.state.cartList,e.prev=3,e.t0=regeneratorRuntime.keys(t.listdata);case 5:if((e.t1=e.t0()).done){e.next=16;break}return n=e.t1.value,t.orderForm.picture=t.listdata[n].image,t.orderForm.title=t.listdata[n].title,t.orderForm.detail=t.listdata[n].desc,t.orderForm.price=t.listdata[n].price,t.orderForm.count=t.listdata[n].count,e.next=14,t.$http.post("/order/bookorder",t.orderForm);case 14:e.next=5;break;case 16:t.$message.success("下单成功"),t.$store.commit("REMOVE_TO_ALL"),t.$bus.$emit("clearcartlist"),t.$router.push("/cart"),e.next=25;break;case 22:e.prev=22,e.t2=e["catch"](3),t.$message.error("下单失败");case 25:case"end":return e.stop()}}),e,null,[[3,22]])})));return function(t){return e.apply(this,arguments)}}())},onChangeProvince:function(t){this.orderForm.province=t.value},onChangeCity:function(t){this.orderForm.city=t.value},onChangeArea:function(t){this.orderForm.area=t.value}},mounted:function(){var t=this;this.orderForm.user_id=window.localStorage.getItem("userId");var e=document.getElementsByTagName("select");e[0].style.fontSize="8px",e[1].style.fontSize="8px",e[2].style.fontSize="8px";var r=navigator.userAgent;r.indexOf("iPhone")<=-1&&(window.onresize=function(){var e=document.getElementsByClassName("content")[0];"/order"==location.pathname&&(t.clientHeight>document.documentElement.clientHeight?(t.isShow=!1,e.style.bottom=0):(t.isShow=!0,e.style.bottom="44px"))})}},A=N,R=(r("fdc1"),Object(h["a"])(A,n,o,!1,null,"77f663eb",null));e["default"]=R.exports},fc52:function(t,e,r){"use strict";var n=r("08bb"),o=r.n(n);o.a},fdc1:function(t,e,r){"use strict";var n=r("4f8d"),o=r.n(n);o.a}}]);
|
|
//# sourceMappingURL=chunk-3db281d4.b6b1c636.js.map
|