增加数据缓存,去除部分请求的重复/
This commit is contained in:
@@ -113,15 +113,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { $cache_chasingDrama} from '@/store/cashe.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isErQd: false, //昨天是否签到
|
||||
isQd: false, //今日是否已签到
|
||||
day: 0, //签到天数
|
||||
isErQd: $cache_chasingDrama.isErQd|| false, //昨天是否签到
|
||||
isQd: $cache_chasingDrama.isQd||false, //今日是否已签到
|
||||
day: $cache_chasingDrama.day|| 0, //签到天数
|
||||
numList: this.getThisWeekDates(),
|
||||
list: [],
|
||||
zhuiju: [],
|
||||
list: $cache_chasingDrama.list||[],
|
||||
zhuiju: $cache_chasingDrama.zhuiju|| [],
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -171,6 +172,9 @@
|
||||
this.isQd = false
|
||||
this.isErQd = false
|
||||
}
|
||||
$cache_chasingDrama.set('day',this.day)
|
||||
$cache_chasingDrama.set('isQd',this.isQd)
|
||||
$cache_chasingDrama.set('isErQd',this.isErQd)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
@@ -201,6 +205,7 @@
|
||||
this.$Request.getT('/app/courseCollect/selectByUserId', data).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.zhuiju = res.data.records
|
||||
$cache_chasingDrama.set('zhuiju',this.zhuiju)
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -217,6 +222,7 @@
|
||||
this.$nextTick(() => {
|
||||
this.videPage = 1
|
||||
})
|
||||
$cache_chasingDrama.set('list',this.list)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user