forked from FoundKeyGang/FoundKey
[Client] Improve UI
This commit is contained in:
parent
76a9ea8d3d
commit
7a2ef04ec3
3 changed files with 34 additions and 15 deletions
|
@ -93,11 +93,18 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
del() {
|
del() {
|
||||||
if (!window.confirm(this.$t('delete-confirm'))) return;
|
this.$root.alert({
|
||||||
this.$root.api('notes/delete', {
|
type: 'warning',
|
||||||
noteId: this.note.id
|
text: this.$t('delete-confirm'),
|
||||||
}).then(() => {
|
showCancelButton: true
|
||||||
this.destroyDom();
|
}).then(res => {
|
||||||
|
if (!res) return;
|
||||||
|
|
||||||
|
this.$root.api('notes/delete', {
|
||||||
|
noteId: this.note.id
|
||||||
|
}).then(() => {
|
||||||
|
this.destroyDom();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -73,13 +73,20 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
block() {
|
block() {
|
||||||
if (!window.confirm(this.$t('block-confirm'))) return;
|
this.$root.alert({
|
||||||
this.$root.api('blocking/create', {
|
type: 'warning',
|
||||||
userId: this.user.id
|
text: this.$t('block-confirm'),
|
||||||
}).then(() => {
|
showCancelButton: true
|
||||||
this.user.isBlocking = true;
|
}).then(res => {
|
||||||
}, () => {
|
if (!res) return;
|
||||||
alert('error');
|
|
||||||
|
this.$root.api('blocking/create', {
|
||||||
|
userId: this.user.id
|
||||||
|
}).then(() => {
|
||||||
|
this.user.isBlocking = true;
|
||||||
|
}, () => {
|
||||||
|
alert('error');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,15 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fn() {
|
fn() {
|
||||||
const ok = window.confirm(this.$t('read-all'));
|
this.$root.alert({
|
||||||
if (!ok) return;
|
type: 'warning',
|
||||||
|
text: this.$t('read-all'),
|
||||||
|
showCancelButton: true
|
||||||
|
}).then(res => {
|
||||||
|
if (!res) return;
|
||||||
|
|
||||||
this.$root.api('notifications/mark_all_as_read');
|
this.$root.api('notifications/mark_all_as_read');
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onFetched() {
|
onFetched() {
|
||||||
Progress.done();
|
Progress.done();
|
||||||
|
|
Loading…
Reference in a new issue