|
@@ -17,7 +17,7 @@
|
|
|
<view class="centent">
|
|
<view class="centent">
|
|
|
<view class="title">待上课程</view>
|
|
<view class="title">待上课程</view>
|
|
|
<view class="text">待完成数</view>
|
|
<view class="text">待完成数</view>
|
|
|
- <view class="number">394<text>个</text></view>
|
|
|
|
|
|
|
+ <view class="number">{{dai}}<text>个</text></view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="right" @click="nav('/pages/course/courseWan')">
|
|
<view class="right" @click="nav('/pages/course/courseWan')">
|
|
@@ -25,7 +25,7 @@
|
|
|
<view class="centent">
|
|
<view class="centent">
|
|
|
<view class="title">完成课程</view>
|
|
<view class="title">完成课程</view>
|
|
|
<view class="text">总完成数</view>
|
|
<view class="text">总完成数</view>
|
|
|
- <view class="number">65<text>个</text></view>
|
|
|
|
|
|
|
+ <view class="number">{{wan}}<text>个</text></view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -50,6 +50,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import { getCourse } from '@/api/course.js'
|
|
|
import { mapState, mapMutations } from 'vuex';
|
|
import { mapState, mapMutations } from 'vuex';
|
|
|
import { saveUrl, interceptor } from '@/utils/loginUtils.js';
|
|
import { saveUrl, interceptor } from '@/utils/loginUtils.js';
|
|
|
import { getUserInfo,} from '@/api/user.js';
|
|
import { getUserInfo,} from '@/api/user.js';
|
|
@@ -57,6 +58,12 @@ export default {
|
|
|
computed: {
|
|
computed: {
|
|
|
...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
|
|
...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
|
|
|
},
|
|
},
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ dai: '0',//待上课程
|
|
|
|
|
+ wan: '0',//完成课程
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
onShow() {
|
|
onShow() {
|
|
|
// 判断是否已经登录
|
|
// 判断是否已经登录
|
|
|
if (this.hasLogin) {
|
|
if (this.hasLogin) {
|
|
@@ -78,6 +85,13 @@ export default {
|
|
|
.catch(e => {
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
console.log(e);
|
|
|
});
|
|
});
|
|
|
|
|
+ getCourse({})
|
|
|
|
|
+ .then(e => {
|
|
|
|
|
+ this.dai = e.data.count;
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(e => {
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
navT(){
|
|
navT(){
|
|
|
if (!this.hasLogin) {
|
|
if (!this.hasLogin) {
|