浏览代码

修改返回

wangxy 6 天之前
父节点
当前提交
855469b79c
共有 1 个文件被更改,包括 12 次插入21 次删除
  1. 12 21
      pages/chanpinXuanze/index.vue

+ 12 - 21
pages/chanpinXuanze/index.vue

@@ -10,18 +10,18 @@
       <view class="ezy-xueke-tab-box">
         <!-- 动画按钮 -->
         <ezyActiveVue class="ezy-btn-active tab-item" v-for="item in data.list"
-                      :key="item.value"
-                      :class="{active: item.value == data.chanpinActiveSelect}"
+                      :key="item.key"
+                      :class="{active: item.key == data.chanpinActiveSelect}"
                       @aclick="handleSelectChanpin(item)">
-          {{ item.name }}
+          {{ item.label }}
         </ezyActiveVue>
       </view>
       <!-- 数学列表 -->
-      <shuxueListVue v-if="data.chanpinActiveSelect == 1" :list="data.shuxueList"></shuxueListVue>
+      <shuxueListVue v-if="data.chanpinActiveSelect == 'shuxue'" :list="data.shuxueList"></shuxueListVue>
       <!-- 英语列表 -->
-      <yingyuListVue v-if="data.chanpinActiveSelect == 2" :list="data.yingyuList"></yingyuListVue>
+      <yingyuListVue v-if="data.chanpinActiveSelect == 'yingyu'" :list="data.yingyuList"></yingyuListVue>
       <!-- 语文列表 -->
-      <yuwenListVue v-if="data.chanpinActiveSelect == 3" :list="data.yuwenList"></yuwenListVue>
+      <yuwenListVue v-if="data.chanpinActiveSelect == 'yuwen'" :list="data.yuwenList"></yuwenListVue>
     </view>
   </view>
   <custom-tab-bar :show="true" :current-index="currentTabIndex"/>
@@ -46,21 +46,12 @@ import {getFullTimer} from "../../utils/common";
 
 let currentTabIndex = ref(0)
 const data = reactive({
-  list: [
-    {
-      name: '数学',
-      value: 1
-    },
-    {
-      name: '英语',
-      value: 2
-    },
-    {
-      name: '语文',
-      value: 3
-    },
+  list:[
+    { key: 'shuxue', label: '数学' },
+    { key: 'yingyu', label: '英语' },
+    { key: 'yuwen', label: '语文' }
   ],
-  chanpinActiveSelect: 1,
+  chanpinActiveSelect: 'shuxue',
 
   shuxueList: [],
 })
@@ -99,7 +90,7 @@ function handleSelectChanpin(item) {
 
 onShow(() => {
   currentTabIndex.value = 0;
-  data.chanpinActiveSelect = 1;
+  data.chanpinActiveSelect = 'shuxue';
 
   if (getFullTimer() !== `2026-01-28`) {
     //每日刷新