coys 2 年 前
コミット
49d8a32695
1 ファイル変更29 行追加34 行削除
  1. 29 34
      src/views/home/works.vue

+ 29 - 34
src/views/home/works.vue

@@ -1,22 +1,12 @@
 <template>
   <div class="index-container">
     <top-bar ref="topbar"></top-bar>
-   
-    <!-- 步骤条 -->
-    <div :class="workList.length<=1? 'oneItem':''">
-      <div class="clas">
 
-        <van-steps :active="active" active-icon="success" active-color="#38f">
-          <van-step v-for="item in workList" :key="item.taskType" 
-          ><van-badge :content="item.nums" color="#1989fa" >
-            <a :href="`#${worksLink(1, item.taskType)}`">{{ item.taskTypeText }}</a>
-          </van-badge>
-          
-        </van-step>
-       
-      </van-steps>
-      </div>
-  </div>
+    <!-- 步骤条 -->
+    <van-tabs color="#1989fa" @click="tabClickHandler">
+      <van-tab  :title="item.taskTypeText" :name="worksLink(1, item.taskType)" v-for="item in workList" :key="item.taskType" :badge="item.nums"></van-tab>
+    </van-tabs>
+ 
     <div class="big_box" @scroll="scrolling">
       <!-- 列表 -->
       <div class="cellMargin" v-for="item in workList" :key="item.taskType">
@@ -79,10 +69,9 @@ export default {
     }
   },
   mounted() {
-    if(this.orgId){
-
-this.$refs.topbar.getTheWeather()
-}
+    if (this.orgId) {
+      this.$refs.topbar.getTheWeather()
+    }
   },
   created() {
     this.getList()
@@ -198,8 +187,8 @@ this.$refs.topbar.getTheWeather()
           strName = '待登记'
         } else if (val == 5 && taskType == 1) {
           strName = '待签名'
-        } else if(val==5&&taskType==4){
-          strName='待提交'
+        } else if (val == 5 && taskType == 4) {
+          strName = '待提交'
         }
         return strName
       } else if (type == 3) {
@@ -266,6 +255,20 @@ this.$refs.topbar.getTheWeather()
           this.$router.push('/consultInfo/' + this.taskId)
         }
       })
+    },
+    //tab栏点击
+    tabClickHandler(name){
+       
+        const filePath = `/#${name}`
+        const tempLink = document.createElement('a')
+        tempLink.style.display = 'none'
+        tempLink.href = filePath
+        
+        tempLink.setAttribute('target', '_self')
+        document.body.appendChild(tempLink)
+        tempLink.click()
+        document.body.removeChild(tempLink)
+       
     }
   },
   beforeDestroy() {
@@ -273,7 +276,10 @@ this.$refs.topbar.getTheWeather()
   }
 }
 </script>
-
+<style>
+.van-info {
+    background-color: #1989fa;
+  }</style>
 <style lang="scss" scoped>
 .van-cell__right-icon {
 }
@@ -337,16 +343,5 @@ a {
   margin-right: 10px;
 }
 
-::v-deep.oneItem{
-  .van-step--horizontal:last-child{
-    left: 1px;
-  }
-  
-  .van-step--horizontal:last-child .van-step__circle-container{
-    display: none;
-  }
-}
-.clas{
-  width: auto;
-}
+
 </style>