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,
}"
>
@@ -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);
},
},
};
diff --git a/plugins/api/seckill.js b/plugins/api/seckill.js
index b81e283..7ae20e2 100644
--- a/plugins/api/seckill.js
+++ b/plugins/api/seckill.js
@@ -25,3 +25,9 @@ const BASE_URL = `${ENV.base_url}/mall/marketing`;
export const ApiGetSeckillGoods = (params) =>
ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/product`, { params }));
+/**
+ * 获取当前服务器时间
+ */
+ export const ApiGetCurrentTime = () =>
+ ToAsyncAwait(axios.get(`${BASE_URL}/app/activity/timestamp`));
+