From 1e0b41fbc9823412fa2037b90bf5519eda8251ef Mon Sep 17 00:00:00 2001 From: Junling Bu Date: Thu, 11 Jul 2019 12:17:33 +0800 Subject: [PATCH] =?UTF-8?q?feat[litemall-vue]:=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E4=B8=93=E9=A2=98=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=92=8C?= =?UTF-8?q?=E4=B8=93=E9=A2=98=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litemall-vue/src/api/api.js | 21 +++ litemall-vue/src/router/items.js | 12 ++ litemall-vue/src/views/home/tabbar-home.vue | 28 +++- .../src/views/items/brand-list/index.vue | 1 - .../src/views/items/topic-list/index.vue | 141 ++++++++++++++++++ litemall-vue/src/views/items/topic/index.vue | 87 +++++++++++ 6 files changed, 288 insertions(+), 2 deletions(-) create mode 100644 litemall-vue/src/views/items/topic-list/index.vue create mode 100644 litemall-vue/src/views/items/topic/index.vue diff --git a/litemall-vue/src/api/api.js b/litemall-vue/src/api/api.js index 52d08215..b76b03a8 100644 --- a/litemall-vue/src/api/api.js +++ b/litemall-vue/src/api/api.js @@ -219,8 +219,29 @@ const CommentCount='wx/comment/count'; //评论总数 const CommentPost='wx/comment/post'; //发表评论 const TopicList='wx/topic/list'; //专题列表 +export function topicList(query) { + return request({ + url: TopicList, + method: 'get', + params: query + }) +} const TopicDetail='wx/topic/detail'; //专题详情 +export function topicDetail(query) { + return request({ + url: TopicDetail, + method: 'get', + params: query + }) +} const TopicRelated='wx/topic/related'; //相关专题 +export function topicRelated(query) { + return request({ + url: TopicRelated, + method: 'get', + params: query + }) +} const SearchIndex='wx/search/index'; //搜索关键字 const SearchResult='wx/search/result'; //搜索结果 diff --git a/litemall-vue/src/router/items.js b/litemall-vue/src/router/items.js index 2569041e..58d01698 100644 --- a/litemall-vue/src/router/items.js +++ b/litemall-vue/src/router/items.js @@ -61,5 +61,17 @@ export default [ name: 'brandList', component: () => import('@/views/items/brand-list'), props: route => route.query + }, + { + path: '/items/topic/:topicId', + name: 'topic', + props: true, + component: () => import('@/views/items/topic') + }, + { + path: '/items/topic-list', + name: 'topicList', + component: () => import('@/views/items/topic-list'), + props: route => route.query } ]; diff --git a/litemall-vue/src/views/home/tabbar-home.vue b/litemall-vue/src/views/home/tabbar-home.vue index 95191d34..1223d869 100755 --- a/litemall-vue/src/views/home/tabbar-home.vue +++ b/litemall-vue/src/views/home/tabbar-home.vue @@ -91,7 +91,7 @@ :url="goBrand(brand.id)"> -
{{ brand.name }}
+
{{ brand.name }}
@@ -152,6 +152,29 @@
+ + + + +
{{ topic.title }}
+
{{ topic.subtitle }}
+
+
+
+ + + 更多专题精选 + + +
+
+ @@ -200,6 +223,9 @@ export default { goBrand(id) { return `#/items/brand/${id}`; }, + goTopic(id) { + return `#/items/topic/${id}`; + }, getCoupon(id) { couponReceive({ couponId: id }).then(res => { Toast.success('领取成功'); diff --git a/litemall-vue/src/views/items/brand-list/index.vue b/litemall-vue/src/views/items/brand-list/index.vue index b7e00753..522ff0c8 100644 --- a/litemall-vue/src/views/items/brand-list/index.vue +++ b/litemall-vue/src/views/items/brand-list/index.vue @@ -56,7 +56,6 @@ export default { getBrandList() { this.page++; brandList({ - isNew: true, page: this.page, limit: this.limit }).then(res => { diff --git a/litemall-vue/src/views/items/topic-list/index.vue b/litemall-vue/src/views/items/topic-list/index.vue new file mode 100644 index 00000000..23bcadd3 --- /dev/null +++ b/litemall-vue/src/views/items/topic-list/index.vue @@ -0,0 +1,141 @@ + + + + + \ No newline at end of file diff --git a/litemall-vue/src/views/items/topic/index.vue b/litemall-vue/src/views/items/topic/index.vue new file mode 100644 index 00000000..665efb28 --- /dev/null +++ b/litemall-vue/src/views/items/topic/index.vue @@ -0,0 +1,87 @@ + + + + + \ No newline at end of file