adata-ui 0.1.60 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adata-ui.common.js +121 -53
- package/dist/adata-ui.common.js.map +1 -1
- package/dist/adata-ui.css +1 -1
- package/dist/adata-ui.umd.js +121 -53
- package/dist/adata-ui.umd.js.map +1 -1
- package/dist/adata-ui.umd.min.js +2 -2
- package/dist/adata-ui.umd.min.js.map +1 -1
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/components/Header/Header.vue +20 -9
- package/src/components/Header/InfoHeader.vue +2 -2
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
</a>
|
|
40
40
|
</div>
|
|
41
41
|
</div>
|
|
42
|
-
<div class="header__right">
|
|
42
|
+
<div class="header__right" v-show="!noAuth">
|
|
43
43
|
<slot name="chooseCountry"></slot>
|
|
44
44
|
<Profile
|
|
45
45
|
:profileDropDown="profileDropDown"
|
|
@@ -237,11 +237,11 @@
|
|
|
237
237
|
</div>
|
|
238
238
|
</div>
|
|
239
239
|
<div class="menu-mobile__info-footer">
|
|
240
|
-
<div
|
|
240
|
+
<div class="menu-mobile__info-footer-item" v-show="requestCount === 0 || requestCount">
|
|
241
241
|
<span class="menu-mobile__info-footer-title">Суточный лимит запросов:</span>
|
|
242
242
|
<span class="menu-mobile__info-footer-circle">{{ requestCount }}</span>
|
|
243
243
|
</div>
|
|
244
|
-
<div
|
|
244
|
+
<div class="menu-mobile__info-footer-item" v-show="daysRemaining === 0 || daysRemaining">
|
|
245
245
|
<span class="menu-mobile__info-footer-title">Остаток дней:</span>
|
|
246
246
|
<span class="menu-mobile__info-footer-circle">{{ daysRemaining }}</span>
|
|
247
247
|
</div>
|
|
@@ -275,6 +275,10 @@ export default {
|
|
|
275
275
|
return ["prod", "dev", "staging"].indexOf(value) !== -1;
|
|
276
276
|
},
|
|
277
277
|
},
|
|
278
|
+
noAuth: {
|
|
279
|
+
type: Boolean,
|
|
280
|
+
default: false
|
|
281
|
+
},
|
|
278
282
|
isAuthenticated: {
|
|
279
283
|
type: Boolean,
|
|
280
284
|
default: false,
|
|
@@ -379,17 +383,12 @@ export default {
|
|
|
379
383
|
},
|
|
380
384
|
mounted() {
|
|
381
385
|
this.setBalance(this.balance);
|
|
382
|
-
this.
|
|
386
|
+
this.notificationShow()
|
|
383
387
|
},
|
|
384
388
|
watch: {
|
|
385
389
|
balance(newBalance) {
|
|
386
390
|
this.setBalance(newBalance);
|
|
387
391
|
},
|
|
388
|
-
isOpenNotification() {
|
|
389
|
-
if(!this.isOpenNotification) {
|
|
390
|
-
clearTimeout(this.timer);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
392
|
},
|
|
394
393
|
methods: {
|
|
395
394
|
async fetchNotification() {
|
|
@@ -400,12 +399,24 @@ export default {
|
|
|
400
399
|
if (data.details.length) {
|
|
401
400
|
this.systemMessage = data.details[0].message;
|
|
402
401
|
this.isOpenNotification = true;
|
|
402
|
+
localStorage.setItem('start_time', JSON.stringify(new Date()))
|
|
403
403
|
}
|
|
404
404
|
|
|
405
405
|
} catch(e) {
|
|
406
406
|
console.log(e.message)
|
|
407
407
|
}
|
|
408
408
|
},
|
|
409
|
+
notificationShow() {
|
|
410
|
+
const startTime = localStorage.getItem('start_time');
|
|
411
|
+
let diffTime = startTime ? Math.round((new Date() - new Date(JSON.parse(startTime))) / 3600000): 0
|
|
412
|
+
if (startTime) {
|
|
413
|
+
if (diffTime >= 24) {
|
|
414
|
+
localStorage.removeItem('start_time')
|
|
415
|
+
}
|
|
416
|
+
} else {
|
|
417
|
+
this.fetchNotification()
|
|
418
|
+
}
|
|
419
|
+
},
|
|
409
420
|
async fetchCurrencies() {
|
|
410
421
|
try {
|
|
411
422
|
const response = await fetch('https://users.adata.kz/api/v1/information/currency');
|
|
@@ -131,11 +131,11 @@
|
|
|
131
131
|
</div>
|
|
132
132
|
<div v-if="isAuthenticated" class="info-header__item">
|
|
133
133
|
<div class="info-header__item-elem">
|
|
134
|
-
<div class="info-header__inner-item" v-show="requestCount">
|
|
134
|
+
<div class="info-header__inner-item" v-show="requestCount === 0 || requestCount">
|
|
135
135
|
<span class="info-header__title">Суточный лимит запросов</span>
|
|
136
136
|
<span class="info-header__result info-header__result_circled">{{ requestCount }}</span>
|
|
137
137
|
</div>
|
|
138
|
-
<div class="info-header__inner-item" v-show="daysRemaining">
|
|
138
|
+
<div class="info-header__inner-item" v-show="daysRemaining === 0 || daysRemaining">
|
|
139
139
|
<span class="info-header__title">остаток дней</span>
|
|
140
140
|
<span class="info-header__result info-header__result_circled">{{ daysRemaining }}</span>
|
|
141
141
|
</div>
|