shop-home.269d7af6.js 7.1 KB

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