| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["shop-home"],{"0ffe":function(t,e,n){"use strict";n("96cf");var r=n("1da1"),a=n("d4ec"),s=n("bee2"),i=n("262e"),o=n("2caf"),c=n("ff2d"),u=n("bc3a"),l=n.n(u),p=n("f121"),h=n.n(p),d=function(t){Object(i["a"])(n,t);var e=Object(o["a"])(n);function n(){var t;return Object(a["a"])(this,n),t=e.call(this),l.a.defaults.baseURL=h.a.HostShop,t}return Object(s["a"])(n,[{key:"getShopToken",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("Host80","/shop/custom/info/loginByCId",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"customBalance",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/balance",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"customLntegralList",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/integral/search/list",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"commodityTypeList",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/commodity/type/search/list",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"commodityList",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/commodity/search/list",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"commoditySingle",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/commodity/search/single",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderAdd",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/add",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderUpdate",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/update",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderCancel",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/cancel",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderComplete",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/complete",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderList",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/search/list",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"orderSingle",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/order/search/single",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"addressAdd",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/address/add",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"addressDelete",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/address/delete",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"addressUpdate",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/address/update",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()},{key:"addressList",value:function(){var t=Object(r["a"])(regeneratorRuntime.mark((function t(){var e,n,r=arguments;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},t.next=3,this.postAll("HostShop","/custom/address/search/list",e);case 3:return n=t.sent,t.abrupt("return",n);case 5:case"end":return t.stop()}}),t,this)})));function e(){return t.apply(this,arguments)}return e}()}]),n}(c["a"]);e["a"]=new d},"52aa":function(t,e,n){"use strict";var r=n("c142"),a=n.n(r);a.a},c142:function(t,e,n){},f5c6:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.pictLoading,expression:"pictLoading"}],attrs:{id:"ShopHome","element-loading-background":"rgba(43, 48, 67, 0.65)","element-loading-spinner":"el-icon-loading"}},[n("div",{staticClass:"crm-title-box"},[n("div",{staticClass:"header"},[n("span",{staticClass:"user"},[n("i",{staticClass:"iconfont iconyonghu1"}),n("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Global.CID",expression:"'Shop.Global.CID'"}]}),t._v(": "+t._s(t.user)+" ")]),n("span",{staticClass:"point"},[n("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Global.Points",expression:"'Shop.Global.Points'"}]}),t._v(": "+t._s(t._f("NumberFormat1")(t.point)))])])]),n("div",{staticClass:"main-content"},[n("el-row",{staticClass:"recommend",attrs:{gutter:20}},[n("el-col",{staticClass:"left",attrs:{span:6}},[n("div",{staticClass:"section"},[n("div",{staticClass:"head"},[n("i",{staticClass:"el-icon-menu"}),n("span",{directives:[{name:"t",rawName:"v-t",value:"Shop.Index.ProductClassification",expression:"'Shop.Index.ProductClassification'"}]})]),n("div",{staticClass:"body"},t._l(t.typeList,(function(e){return n("div",{key:e.id,staticClass:"item",on:{click:function(n){return t.handleType(e.id)}}},[n("i",{staticClass:"iconfont",class:[e.icon?e.icon:"iconzuanshi"]}),n("span",{staticClass:"text"},[t._v(t._s("cn"==t.lang?e.name:e.nameEn))]),n("i",{staticClass:"i-right el-icon-arrow-right el-icon-arrow-right"})])})),0)])]),n("el-col",{staticClass:"right",attrs:{span:18}},[n("div",{staticClass:"section"},[n("div",{staticClass:"title",attrs:{"data-txt":t.$t("Shop.Index.BoutiqueRecommendation")}}),n("el-row",{staticClass:"body"},[t._l(t.banner1,(function(e){return n("el-col",{key:e.id,staticClass:"item",attrs:{md:8}},[n("div",{staticClass:"good crm-cursor",on:{click:function(n){return t.toDetail(e.id,e.typeId)}}},[n("img",{staticClass:"img",attrs:{src:t.url+t.bannerImg(e.files).path,alt:"",srcset:""}}),n("div",{staticClass:"bottom"},[n("span",{staticClass:"crm-tow-font"},[t._v(t._s(e.name))])])])])})),t.commodityList.length>2?n("el-col",{staticClass:"item",attrs:{md:8}},[n("el-row",{staticClass:"small-item"},t._l(t.banner2,(function(e){return n("el-col",{key:e.id,staticClass:"item",attrs:{span:12}},[n("div",{staticClass:"good crm-cursor",on:{click:function(n){return t.toDetail(e.id,e.typeId)}}},[n("img",{staticClass:"img",attrs:{src:t.url+t.bannerImg(e.files).path,alt:"",srcset:""}}),n("div",{staticClass:"bottom"},[n("span",{staticClass:"crm-tow-font"},[t._v(t._s(e.name))])])])])})),1)],1):t._e(),t.commodityList.length>6?n("el-col",{staticClass:"item",attrs:{md:24}},[n("el-row",{staticClass:"small-item"},t._l(t.banner3,(function(e){return n("el-col",{key:e.id,staticClass:"item",attrs:{span:4}},[n("div",{staticClass:"good crm-cursor",on:{click:function(n){return t.toDetail(e.id,e.typeId)}}},[n("img",{staticClass:"img",attrs:{src:t.url+t.bannerImg(e.files).path,alt:"",srcset:""}}),n("div",{staticClass:"bottom"},[n("span",{staticClass:"crm-tow-font"},[t._v(t._s(e.name))])])])])})),1)],1):t._e()],2)],1)])],1)],1)])},a=[],s=(n("4de4"),n("96cf"),n("1da1")),i=n("bc3a"),o=n.n(i),c=n("0ffe"),u=n("f121"),l=n.n(u),p=l.a.Code,h={name:"ShopHome",data:function(){return{pictLoading:!1,user:"--",point:"--",typeList:[],commodityList:[],url:l.a.HostShopImg,pagerInfo:{row:12,current:1,pageTotal:0,rowTotal:0}}},computed:{lang:function(){return this.Session.Get("lang")},banner1:function(){return this.commodityList.filter((function(t,e){if(e<=1)return!0}))},banner2:function(){return this.commodityList.filter((function(t,e){if(1<e&&e<6)return!0}))},banner3:function(){return this.commodityList.filter((function(t,e){if(e>=6)return!0}))}},methods:{bannerImg:function(t){var e=t.filter((function(t){if(1==t.banner)return!0}));return e[0]},handleType:function(t){this.$router.push({path:"/shop/list",query:{type:t}}).catch((function(t){return t}))},toDetail:function(t,e){this.$router.push({path:"/shop/detail",query:{id:t,type:e}}).catch((function(t){return t}))},getTypeInfo:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].commodityTypeList();case 2:n=e.sent,n.code==p.StatusOK?t.typeList=n.data:t.$pigeon.MessageError(n.msg);case 4:case"end":return e.stop()}}),e)})))()},getCommdityInfo:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.pictLoading=!0,e.next=3,c["a"].commodityList({show:1,recommender:1,lang:t.lang,page:{current:t.pagerInfo.current,row:t.pagerInfo.row}});case 3:n=e.sent,n.code==p.StatusOK?(t.commodityList=n.data||[],null!=n.page?(t.pagerInfo.rowTotal=n.page.rowTotal,t.pagerInfo.pageTotal=n.page.pageTotal):t.pagerInfo.rowTotal=0,t.$pigeon.MessageOK(t.$i18n.t("Msg.SearchSuccess")),t.pictLoading=!1):(t.$pigeon.MessageError(n.msg),t.pictLoading=!1);case 5:case"end":return e.stop()}}),e)})))()},getPoint:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].customBalance();case 2:n=e.sent,n.code==p.StatusOK?t.point=n.data:t.$pigeon.MessageError(n.msg);case 4:case"end":return e.stop()}}),e)})))()},getShop:function(){var t=this;return Object(s["a"])(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,c["a"].getShopToken({});case 2:n=e.sent,n.code==p.StatusOK?n.data.exists?(sessionStorage.setItem("shop_token",n.data.accessToken),o.a.defaults.headers.common["Access-Token"]=n.data.accessToken,t.getPoint(),t.getTypeInfo(),t.getCommdityInfo()):console.log("商城未激活"):t.$pigeon.MessageError(n.msg);case 4:case"end":return e.stop()}}),e)})))()}},mounted:function(){this.user=JSON.parse(this.Session.Get("user",!0)).customInfo.cId,this.Session.Get("shop_token")?(o.a.defaults.headers.common["Access-Token"]=this.Session.Get("shop_token"),this.getPoint(),this.getTypeInfo(),this.getCommdityInfo()):this.getShop()}},d=h,m=(n("52aa"),n("2877")),f=Object(m["a"])(d,r,a,!1,null,null,null);e["default"]=f.exports}}]);
|