|
|
@@ -46,7 +46,6 @@
|
|
|
@click="tutorial"
|
|
|
/>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 通知 -->
|
|
|
<div class="notice-box" v-if="news.length > 0">
|
|
|
<van-notice-bar ref="noticeBarRef" left-icon="volume-o">
|
|
|
@@ -341,15 +340,32 @@ const getStatus = info => {
|
|
|
}
|
|
|
|
|
|
const profitList = ref([])
|
|
|
+function randomS() {
|
|
|
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'
|
|
|
+ return chars[Math.floor(Math.random() * chars.length)]
|
|
|
+}
|
|
|
function getRank() {
|
|
|
- http.get('/user/rankByInvite').then(res => {
|
|
|
- profitList.value = res.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- val: randomNum(100, 1000)
|
|
|
- }
|
|
|
- })
|
|
|
+ let profitListJson = localStorage.getItem('profitList')
|
|
|
+ if (profitListJson) {
|
|
|
+ profitListJson = JSON.parse(profitListJson)
|
|
|
+ if (new Date().getTime() < profitListJson.expire) {
|
|
|
+ profitList.value = profitListJson.data
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ profitList.value = Array.from({ length: 10 }, (v, i) => {
|
|
|
+ return {
|
|
|
+ nickname: randomS() + '***' + randomS(),
|
|
|
+ val: randomNum(100, 1000)
|
|
|
+ }
|
|
|
})
|
|
|
+ localStorage.setItem(
|
|
|
+ 'profitList',
|
|
|
+ JSON.stringify({
|
|
|
+ data: profitList.value,
|
|
|
+ expire: new Date().getTime() + 1000 * 60 * 60 * 24
|
|
|
+ })
|
|
|
+ )
|
|
|
}
|
|
|
|
|
|
function randomNum(minNum, maxNum) {
|