Commit 89e53cef by 展昭

更新数据

parent 2d337ea3
File mode changed
......@@ -4,7 +4,7 @@ import moreRouters from './more-router.js'
import billRouters from './bill-router.js'
import { vuexOidcCreateRouterMiddleware } from 'vuex-oidc'
import store from '../store'
import Mgr from "../assets/js/SecurityService"
Vue.use(VueRouter)
......@@ -30,6 +30,58 @@ const router = new VueRouter({
}
})
const mgr = new Mgr();
function loginByAuthcode(authCode) {
let loginArgs = { extraQueryParams: { authcode: authCode } };
mgr.signIn(loginArgs);
}
function autoLogin(comid, authcode, next) {
localStorage.setItem("comid", comid);
mgr.getUser().then(user => {
if (user == null) {
loginByAuthcode(authcode);
} else {
let companyId = localStorage.getItem("companyId");
if (comid != companyId) {
//如果已经登录,则先退出
localStorage.setItem("authcode", authcode);
mgr.signOut();
} else {
next();
}
}
})
}
router.beforeEach(vuexOidcCreateRouterMiddleware(store));
// router.beforeEach((to, from, next) => {
// let authcode = localStorage.getItem("authcode")
// if (authcode) {
// localStorage.removeItem("authcode");
// loginByAuthcode(authcode)
// }
// else {
// authcode = to.query.authcode;
// const comid = to.query.comId || to.query.comid;
// if (comid && authcode) {
// localStorage.setItem("autoCallback", to.path);
// autoLogin(comid, authcode, next);
// } else {
// mgr.getUser().then(user => {
// if (user == null) {
// mgr.signIn();
// } else {
// next()
// }
// });
// }
// }
// });
export default router
......@@ -11,7 +11,7 @@
<img src="../../assets/images/triangle-arrow-l.png" alt />
</div>
<div class="month">{{month4choose}}</div>
<div class="arrow-r" @click="chooseMonth('right')">
<div class="arrow-r" @click="chooseMonth('right')">
<img src="../../assets/images/triangle-arrow-r.png" alt />
</div>
</div>
......@@ -159,6 +159,7 @@ import { Icon } from "vant";
import { TabHeader } from "@/components";
import * as utils from "../../utils/common";
import { mapGetters, mapActions } from "vuex";
import api from "../../api/Bill";
export default {
components: {
......@@ -168,48 +169,44 @@ export default {
data() {
return {
title: "人事服务",
month4choose: "2019年11月",
cycle: "11.01-11.30",
data:{
balance:0,
toBePayAmount:0,
hosting:8000.00,
socical:{
toPayAmount:600.00,
toBePayAmount:600.00
month4choose: "",
cycle: "",
data: {
balance: 0,
toBePayAmount: 0,
hosting: 0,
socical: {
toPayAmount: 0,
toBePayAmount: 0
},
fund:{
toPayAmount:600.00,
toBePayAmount:600.00
fund: {
toPayAmount: 0,
toBePayAmount: 0
},
tax:{
toPayAmount:600.00,
toBePayAmount:600.00
tax: {
toPayAmount: 0,
toBePayAmount: 0
},
service:{
toPayAmount:600.00,
toBePayAmount:600.00
service: {
toPayAmount: 0,
toBePayAmount: 0
},
annual:{
toPayAmount:600.00,
toBePayAmount:600.00
annual: {
toPayAmount: 0,
toBePayAmount: 0
},
other:{
toPayAmount:600.00,
toBePayAmount:600.00
other: {
toPayAmount: 0,
toBePayAmount: 0
}
}
};
},
computed: {
computed: {
...mapGetters(["getMonth4choose", "getCycle", "getData"])
},
methods: {
...mapActions([
"loadBillMonth",
"loadBillCycle",
"loadBillData"
]),
...mapActions(["loadBillMonth", "loadBillCycle", "loadBillData"]),
toPage(flag) {
switch (flag) {
case 1: // 充值
......@@ -234,13 +231,19 @@ export default {
break;
}
},
chooseMonth(dirct){
if(dirct==='left'){
console.log('-----');
chooseMonth(dirct) {
if (dirct === "left") {
console.log("-----");
}
if(dirct==='right'){
console.log('+++++++');
if (dirct === "right") {
console.log("+++++++");
}
},
async getData() {
await api.getData(1, 1, "a").then(res => {
console.log(res.data);
this.data.balance=res.data.balance;
});
}
}
};
......@@ -264,8 +267,9 @@ export default {
.choose-month {
display: grid;
grid-template-columns: 5% 90% 5%;
justify-items:center;
.arrow-l,.arrow_right{
justify-items: center;
.arrow-l,
.arrow_right {
widows: 16px;
height: 16px;
}
......
......@@ -51,7 +51,7 @@
<i>-160.00</i>
</div>
<p>
<span>11-20 12:20</span>
<span>{{test}}</span>
</p>
</div>
......@@ -69,7 +69,10 @@ export default {
},
data() {
return {
title: "11月资金记录"
title: "11月资金记录",
data:{
test:''
}
};
},
methods: {
......
......@@ -41,7 +41,7 @@
</p>
<p>
<span>待付金额</span>
<i>600.00</i>
<i>{{topay}}</i>
</p>
</div>
</div>
......@@ -59,18 +59,25 @@ export default {
},
data() {
return {
title: "人事服务"
title: "人事服务",
data: {
topay: 0
}
};
},
methods: {
onClickLeft() {
console.log(1);
},
toPage(flag){
toPage(flag) {
if (flag === 2) {
this.$router.push({ name: "morerecord" });
}
},
getData() {
const res = null;
this.data.topay = res.money;
},
navLeftArrowClick() {
this.$router.go(-1);
}
......@@ -82,7 +89,6 @@ export default {
</script>
<style lang="less" scoped>
.contener {
.header {
height: 136px;
......
......@@ -48,7 +48,7 @@ export default {
// this.getOidcUser().then(res => {
// console.log("res=", JSON.stringify(res));
// });
const token=store.state.oidc.access_token;
const token=this.oidcAccessToken;
console.log('token=',token);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment