From 1dadcc18e4c519eaef923fbf20fe8a5f003c56cd Mon Sep 17 00:00:00 2001 From: xiaoguang Date: Thu, 12 May 2022 14:54:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E7=A7=92=E6=9D=80=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8=E5=80=92=E8=AE=A1=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants/index.js | 8 ++- pages/index/index.vue | 25 +++++++-- pages/index/module/Seckill.vue | 49 ++++++++-------- pages/seckill/index.vue | 100 +++++++++++++++++++++++++-------- plugins/api/seckill.js | 6 ++ 5 files changed, 135 insertions(+), 53 deletions(-) diff --git a/constants/index.js b/constants/index.js index 074b3ab..1df4ae8 100644 --- a/constants/index.js +++ b/constants/index.js @@ -25,4 +25,10 @@ const CATEGROY_LEVEL = { TWO: 2, }; -export { TOKEN_KEY, ORDER_STATUS, SEX_TYPE, CATEGROY_LEVEL }; +// 秒杀活动状态 +const SECKILL_STATUS = { + NOT_START: 1, // 未开始 + GOING: 2, // 进行中 +}; + +export { TOKEN_KEY, ORDER_STATUS, SEX_TYPE, CATEGROY_LEVEL, SECKILL_STATUS }; diff --git a/pages/index/index.vue b/pages/index/index.vue index 4323a3d..53842f2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -9,24 +9,41 @@
- +
diff --git a/pages/seckill/module/TabBar.vue b/pages/seckill/module/TabBar.vue index b7feb2f..4ede728 100644 --- a/pages/seckill/module/TabBar.vue +++ b/pages/seckill/module/TabBar.vue @@ -6,7 +6,7 @@ @click="onTabClick(item.id)" class="sckill-header-tabbar__item flex flex-middle flex-center" :class="{ - 'sckill-header-tabbar__item--active': item.id === value, + 'sckill-header-tabbar__item--active': item.id === tabId, }" > {{ item.timeName }} @@ -24,7 +24,7 @@ export default { type: Array, default: () => [], }, - value: { + tabId: { type: Number, default: 0, }, @@ -32,11 +32,10 @@ export default { methods: { onTabClick(id) { // 点击同一个tab - if (id === this.value) { + if (id === this.tabId) { return; } - this.$emit("input", id); - this.$emit("tab-click"); + this.$emit("tab-change", id); }, }, };