|
@@ -3,7 +3,7 @@
|
|
|
<van-nav-bar title="学习积分" left-arrow @click-left="onClickLeft" />
|
|
|
<div class="user-manual-div">
|
|
|
<div class="user-manual-grades-div">
|
|
|
- <div class="user-manual-grades">{{ userTotalPonits }}</div>
|
|
|
+ <div class="user-manual-grades">{{ this.user.userInfo.points }}</div>
|
|
|
<div class="user-manual-description" @click="clickLearnRule">
|
|
|
积分说明
|
|
|
</div>
|
|
@@ -67,7 +67,8 @@ export default {
|
|
|
isFinish: false,
|
|
|
getPoints: 2,
|
|
|
totaPonits: 6,
|
|
|
- rightButton: "去答题"
|
|
|
+ rightButton: "去答题",
|
|
|
+ router: ""
|
|
|
},
|
|
|
{
|
|
|
name: "今日必读",
|
|
@@ -75,23 +76,26 @@ export default {
|
|
|
isFinish: false,
|
|
|
getPoints: 0,
|
|
|
totaPonits: 6,
|
|
|
- rightButton: "去看看"
|
|
|
- },
|
|
|
- {
|
|
|
- name: "每周必答",
|
|
|
- rule: "2分/每发表一个有效观点",
|
|
|
- isFinish: false,
|
|
|
- getPoints: 0,
|
|
|
- totaPonits: 6,
|
|
|
- rightButton: "去答题"
|
|
|
+ rightButton: "去看看",
|
|
|
+ router: ""
|
|
|
}
|
|
|
+ // ,
|
|
|
+ // {
|
|
|
+ // name: "每周必答",
|
|
|
+ // rule: "2分/每发表一个有效观点",
|
|
|
+ // isFinish: false,
|
|
|
+ // getPoints: 0,
|
|
|
+ // totaPonits: 6,
|
|
|
+ // rightButton: "去答题"
|
|
|
+ // }
|
|
|
],
|
|
|
- userTotalPonits: 165, // 用户的总积分
|
|
|
- todayEarnPoints: 6 // 今日已累计的积分
|
|
|
+ userTotalPonits: 0, // 用户的总积分
|
|
|
+ todayEarnPoints: 0 // 今日已累计的积分
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getEvents();
|
|
|
+ this.getDailyPoints();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
@@ -108,7 +112,34 @@ export default {
|
|
|
.get(this.$pathParams(this.$_API.JTXT_GET_EVENTS_USERNAME_DATE, path))
|
|
|
.then(res => {
|
|
|
console.log("--event--" + JSON.stringify(res));
|
|
|
- this.todayPoints = res.data;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$store.commit("toggleLoading", false);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取今日分数
|
|
|
+ getDailyPoints() {
|
|
|
+ let path = {
|
|
|
+ userName: this.user.userInfo.userName
|
|
|
+ };
|
|
|
+ this.$_http
|
|
|
+ .get(this.$pathParams(this.$_API.JTXT_GET_USER_DAIYL_POINTS, path))
|
|
|
+ .then(res => {
|
|
|
+ this.todayEarnPoints = res.data;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$store.commit("toggleLoading", false);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 查询总积分
|
|
|
+ getAllPoints() {
|
|
|
+ let path = {
|
|
|
+ userName: this.user.userInfo.userName
|
|
|
+ };
|
|
|
+ this.$_http
|
|
|
+ .get(this.$pathParams(this.$_API.JTXT_GET_USER_ALL_POINTS, path))
|
|
|
+ .then(res => {
|
|
|
+ this.userTotalPonits = res.data;
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$store.commit("toggleLoading", false);
|
|
@@ -128,7 +159,16 @@ export default {
|
|
|
},
|
|
|
// 操作:点击了去看看、去学习、去训练
|
|
|
toManualEarnFun(item) {
|
|
|
- console.log(item);
|
|
|
+ console.log("item" + JSON.stringify(item));
|
|
|
+ if (item.name === "今日必答") {
|
|
|
+ this.$store.commit("updateAnswerItemStore", {
|
|
|
+ field: "answerRecruitId",
|
|
|
+ value: "daily-questions" // item.id
|
|
|
+ });
|
|
|
+ this.$router.push({ name: "answerRecruit" });
|
|
|
+ } else if (item.name === "今日必读") {
|
|
|
+ this.$router.back(-1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|