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
34 KiB

4 weeks ago
(function(){"use strict";var e={748:function(e,t,a){a(4114);var n=a(6674),r=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},["Register"!==e.$route.name?t("HeaderNav"):e._e(),"Login"!==e.$route.name?t("main",{staticClass:"main-container"},[t("router-view")],1):e._e(),"Login"==e.$route.name?t("main",{staticClass:"main-containers"},[t("router-view")],1):e._e(),"Register"!==e.$route.name?t("Sidebar"):e._e(),"Register"!==e.$route.name?t("Footer"):e._e(),t("BackToTop")],1)},o=[],i=function(){var e=this,t=e._self._c;return t("header",{staticClass:"header-nav"},[t("div",{staticClass:"top-notice"},[t("div",{staticClass:"container"},[t("p",[e._v(" 欢迎来到时味苏州平台! "),e._e()],1),t("div",{staticClass:"top-links"},[e.isLogin?t("router-link",{staticClass:"user-link",attrs:{to:"/User"}},[t("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.userInfo.avatar,expression:"userInfo.avatar"}],staticClass:"avatar",attrs:{alt:"用户头像"}}),e._v(" "+e._s(e.userInfo.username)+" ")]):t("router-link",{attrs:{to:"/Login"}},[e._v("登录")]),e._e(),e._e(),t("router-link",{attrs:{to:"/User"}},[e._v("采购人中心")]),t("router-link",{staticClass:"cart-link",attrs:{to:"/User/ShoppingCart"}},[e._v(" 购物车"),e.cartTotalCount>0?t("span",[e._v("("+e._s(e.cartTotalCount)+"件)")]):e._e()]),e.isLogin?t("router-link",{attrs:{to:"/User/OrderList"}},[e._v("我的订单")]):e._e(),e.isLogin?t("div",{staticClass:"logout-btn",on:{click:e.handleLogout}},[e._v(" 退出 ")]):e._e()],1)])]),t("div",{staticClass:"main-nav"},[t("div",{staticClass:"container"},[t("div",{staticClass:"logo"},[t("router-link",{attrs:{to:"/"}},[t("img",{staticClass:"logo-img",attrs:{src:"https://static.ticket.sz-trip.com/shiweisuzhou/pc/logo.png",alt:"logo"}})])],1),t("div",{staticClass:"search-box"},[t("el-input",{staticClass:"search-input",attrs:{placeholder:"请输入搜索内容"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleSearch.apply(null,arguments)}},model:{value:e.searchText,callback:function(t){e.searchText=t},expression:"searchText"}},[t("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:e.handleSearch},slot:"append"})],1),t("div",{staticClass:"hot-tags"},[t("span",[e._v("热门搜索:")]),t("div",{staticClass:"hot-tag",on:{click:function(t){e.searchText="手机",e.handleSearch()}}},[e._v(" 手机 ")]),t("div",{staticClass:"hot-tag",on:{click:function(t){e.searchText="电脑",e.handleSearch()}}},[e._v(" 电脑 ")]),t("div",{staticClass:"hot-tag",on:{click:function(t){e.searchText="服装",e.handleSearch()}}},[e._v(" 服装 ")])])],1),t("div",{staticClass:"phone-entry"},[t("div",[t("img",{attrs:{src:"https://static.ticket.sz-trip.com/shiweisuzhou/pc/login/phone.png",alt:"联系电话"}}),t("span",[e._v("0512-680541")]),(e.cartTotalCount,e._e())])])])]),e.categories.length>0?t("div",{staticClass:"category-nav"},[t("div",{staticClass:"container"},[e._e()])]):e._e()])},s=[],c=a(3518),l={name:"HeaderNav",data(){return{searchText:""}},computed:{...(0,c.L8)(["getCategories","getCartTotalCount","isUserLogin","getUserInfo"]),categories(){return this.getCategories||[]},cartTotalCount(){return this.getCartTotalCount||0},isLogin(){return this.isUserLogin},userInfo(){return this.getUserInfo||{}}},created(){this.fetchCategories()},methods:{...(0,c.i0)(["fetchCategories","logout"]),handleSearch(){this.searchText.trim()&&(this.$store.commit("setSearchText",this.searchText),"/ProductList"===this.$route.path?this.$bus.emit("search-product",this.searchText):this.$router.push({path:"/ProductList",query:{keyword:this.searchText,type:"search"}}))},handleLogout(){this.$confirm("确定要退出登录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{this.logout().then(()=>{this.$message.success("退出登录成功"),localStorage.setItem("redirectPath",this.$route.path),this.$router.push("/Login")}).catch(e=>{this.$message.error("退出失败:"+(e.message||"未知错误"))})}).catch(()=>{})}}},u=l,d=a(1656),h=(0,d.A)(u
//# sourceMappingURL=app.71c4eb46.js.map