You've already forked qlg.frontend
记账OK
This commit is contained in:
@ -20,10 +20,24 @@ const app = new Vue({
|
||||
this.$set(this.noteData[index], 'currentDelete', false)
|
||||
},
|
||||
confirmDelete(index){
|
||||
console.log("删除", this.noteData[index])
|
||||
// some ajax
|
||||
mui.toast("删除")
|
||||
window.location.reload()
|
||||
$.ajax({
|
||||
url: qlgUrl("app/note/delete"),
|
||||
method: "POST",
|
||||
data: {
|
||||
id: this.noteData[index].id,
|
||||
},
|
||||
dataType: "json",
|
||||
success: (res) => {
|
||||
if(res.status != 1){
|
||||
mui.alert(res.msg);
|
||||
}
|
||||
this.loadData();
|
||||
},
|
||||
error: (err) => {
|
||||
mui.alert("请求失败");
|
||||
this.loadData();
|
||||
}
|
||||
})
|
||||
},
|
||||
edit(index){
|
||||
mui.openWindow({
|
||||
@ -49,7 +63,7 @@ const app = new Vue({
|
||||
url: qlgUrl("app/note/index"),
|
||||
method: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
success: (res) => {
|
||||
if(res.status == 1){
|
||||
this.noteData = res.data;
|
||||
localStorage.setItem("LOCAL_NOTE", JSON.stringify(res.data));
|
||||
@ -68,7 +82,13 @@ const app = new Vue({
|
||||
var localData = localStorage.getItem("LOCAL_NOTE");
|
||||
this.loadData();
|
||||
if(localData){
|
||||
this.noteData = JSON.parse(localData);
|
||||
try{
|
||||
JSON.parse(localData);
|
||||
this.noteData = JSON.parse(localData);
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
this.noteData = [];
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user