|
@@ -33,7 +33,7 @@
|
|
|
</template>
|
|
|
<van-tabbar v-model="active">
|
|
|
<van-tabbar-item icon="location-o">打卡</van-tabbar-item>
|
|
|
- <van-tabbar-item to="/statistics" icon="records">统计</van-tabbar-item>
|
|
|
+ <van-tabbar-item to="/statistics" replace icon="records">统计</van-tabbar-item>
|
|
|
</van-tabbar>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -46,6 +46,9 @@ import Loading from "@/components/loading";
|
|
|
import { mapState } from "vuex";
|
|
|
import empty from "@/assets/empty.png";
|
|
|
import { Toast,Notify } from "vant";
|
|
|
+import { returnApp } from '@/utils/native'
|
|
|
+import { setStore } from '@/utils/store'
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
import { getButtonState,getTodaySignRecord,signRecord,userInfoHead } from "@/api"
|
|
|
export default {
|
|
|
name: "punch",
|
|
@@ -87,10 +90,17 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.$store.commit('showLoading')
|
|
|
- this.currentTime();
|
|
|
- this.getUserInfoHead()
|
|
|
- this.getButtonStateInfo()
|
|
|
+ let token = this.$route.query.token || getToken();
|
|
|
+ if(token) {
|
|
|
+ setStore({'name':'token', 'content': token, 'type':''})
|
|
|
+ this.$store.commit('showLoading')
|
|
|
+ this.currentTime();
|
|
|
+ this.getUserInfoHead()
|
|
|
+ this.getButtonStateInfo()
|
|
|
+ } else {
|
|
|
+ Notify({ type: 'warning', message: '凭证过期,请重新登录',duration: 1000 })
|
|
|
+ setTimeout(() => returnApp(),1000)
|
|
|
+ }
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
clearInterval(this.interOne)
|
|
@@ -103,7 +113,6 @@ export default {
|
|
|
this.$store.commit('setUserInfo',res.data)
|
|
|
} else {
|
|
|
this.$store.commit('hideLoading')
|
|
|
- Notify({ type: 'warning', message: res.message })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -114,11 +123,11 @@ export default {
|
|
|
this.buttonData = res.data
|
|
|
if(arg) {
|
|
|
this.getTodaySignRecordInfo()
|
|
|
- }
|
|
|
+ }
|
|
|
} else {
|
|
|
+ Notify({ type: 'warning', message: res.message, duration: 1000 })
|
|
|
this.$store.commit('hideLoading')
|
|
|
- clearInterval(this.interOne)
|
|
|
- Notify({ type: 'warning', message: res.data })
|
|
|
+ setTimeout(() => returnApp(),1000)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -133,7 +142,8 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
this.$store.commit('hideLoading')
|
|
|
- Notify({ type: 'warning', message: res.data })
|
|
|
+ Notify({ type: 'warning', message: res.message, duration: 1000 })
|
|
|
+ setTimeout(() => returnApp(),1000)
|
|
|
}
|
|
|
})
|
|
|
},
|