diff --git a/src/components/common/AddressFormDialog.vue b/src/components/common/AddressFormDialog.vue new file mode 100644 index 0000000..2dc4400 --- /dev/null +++ b/src/components/common/AddressFormDialog.vue @@ -0,0 +1,317 @@ + + + + + \ No newline at end of file diff --git a/src/components/layout/HeaderNav.vue b/src/components/layout/HeaderNav.vue index 3bb8646..1d4ec3b 100644 --- a/src/components/layout/HeaderNav.vue +++ b/src/components/layout/HeaderNav.vue @@ -94,7 +94,7 @@
- +
联系电话{{ cartTotalCount }} - +
@@ -175,18 +175,14 @@ export default { methods: { ...mapActions(["fetchCategories", "logout"]), handleSearch() { - if (!this.searchText.trim()) return; // 避免空搜索 + if (!this.searchText.trim()) return; this.$store.commit("setSearchText", this.searchText); // 判断当前是否在搜索结果页 - const isSearchPage = - this.$route.path === "/ProductList" && - this.$route.query.type === "search"; - - if (isSearchPage) { + if (this.$route.path === "/ProductList") { // 如果在搜索页,触发父组件更新或重新获取数据 - this.$emit("search", this.searchText); + this.$bus.emit("search-product", this.searchText); } else { // 不在搜索页则跳转 this.$router.push({ @@ -206,6 +202,8 @@ export default { .then(() => { // 假设logout是异步操作 this.$message.success("退出登录成功"); + // 跳转到登录页,并记录当前路径用于登录后跳转 + localStorage.setItem("redirectPath", this.$route.path); this.$router.push("/Login"); // 退出后跳转到登录页 }) .catch((err) => { diff --git a/src/components/layout/HomeLayout.vue b/src/components/layout/HomeLayout.vue index 7968458..45940ea 100644 --- a/src/components/layout/HomeLayout.vue +++ b/src/components/layout/HomeLayout.vue @@ -1,13 +1,19 @@ diff --git a/src/components/layout/Sidebar.vue b/src/components/layout/Sidebar.vue index 54c72b9..fa09546 100644 --- a/src/components/layout/Sidebar.vue +++ b/src/components/layout/Sidebar.vue @@ -1,28 +1,22 @@ diff --git a/src/components/product/AddToCartDialog.vue b/src/components/product/AddToCartDialog.vue new file mode 100644 index 0000000..03d850b --- /dev/null +++ b/src/components/product/AddToCartDialog.vue @@ -0,0 +1,213 @@ + + + + + \ No newline at end of file diff --git a/src/components/product/Evaluate.vue b/src/components/product/Evaluate.vue index b1ec80f..83da011 100644 --- a/src/components/product/Evaluate.vue +++ b/src/components/product/Evaluate.vue @@ -152,6 +152,7 @@ import { Empty, Pagination } from "element-ui"; export default { name: "ProductReviews", + props: ["id"], components: { ElEmpty: Empty, ElPagination: Pagination, @@ -394,7 +395,20 @@ export default { return this.filteredReviews.slice(startIndex, endIndex); }, }, + mounted() { + this.getList() + }, methods: { + // 评价列表 + getList() { + this.get({ + product_id: this.id, + offset: 0, + limit: 999 + }, '/api/product/product_comment_list').then(res => { + + }) + }, // 筛选条件改变 handleFilterChange(filterType) { this.activeFilter = filterType; diff --git a/src/components/product/ProductList.vue b/src/components/product/ProductList.vue index 5e501d7..9e5f41b 100644 --- a/src/components/product/ProductList.vue +++ b/src/components/product/ProductList.vue @@ -1,15 +1,18 @@ @@ -467,10 +532,12 @@ export default { .hot-recommend-sidebar { min-width: 200px; + max-width: 200px; padding: 10px; // border: 1px solid #eee; background-color: #f7f9fa; margin-right: 20px; + cursor: pointer; .hot-title { border-left: 4px solid #ff4d4f; diff --git a/src/views/Index.vue b/src/views/Index.vue index 0a23313..499c619 100644 --- a/src/views/Index.vue +++ b/src/views/Index.vue @@ -97,7 +97,6 @@ export default { this.getTopBanner(); this.getTags(); this.getProductList(); - this.post({}, "/api/uservice/user/getMyInfo").then((res) => {}); }, methods: { // 头部banner @@ -118,11 +117,12 @@ export default { getTags() { this.post( { - pid: 662, + pid: 683, }, "/api/product/tag_list" ).then((res) => { this.tagList = res.data; + this.tagList[0].id = 662; }); }, // 三个分类商品 diff --git a/src/views/Login.vue b/src/views/Login.vue index 5ba44fd..b011f2f 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -265,8 +265,10 @@ export default { token: res.data.token, }); - // 登录成功后跳转首页 - this.$router.push("/"); + // 登录成功后获取存储的跳转路径 + const redirectPath = localStorage.getItem('redirectPath'); + this.$router.push(redirectPath || '/'); + localStorage.removeItem('redirectPath'); } }); diff --git a/src/views/Order/Index.vue b/src/views/Order/Index.vue index 6f38e4e..13fa574 100644 --- a/src/views/Order/Index.vue +++ b/src/views/Order/Index.vue @@ -3,7 +3,11 @@ @@ -12,7 +16,7 @@

收货人信息

- 收货人地址: + 收货地址:
{{ addr.name }} {{ addr.province }} {{ addr.address }} {{ addr.phone }} - 设为默认 - 编辑 - 删除 + + 编辑 + 删除
-
+ -

发票信息

+
@@ -188,34 +182,32 @@
+ + + + \ No newline at end of file diff --git a/src/views/User/UserAddress.vue b/src/views/User/UserAddress.vue index 19b31a9..0ac058b 100644 --- a/src/views/User/UserAddress.vue +++ b/src/views/User/UserAddress.vue @@ -1,201 +1,198 @@ + - \ No newline at end of file