You've already forked qlg.frontend
对接接口
This commit is contained in:
@ -9,20 +9,36 @@ const app = new Vue({
|
||||
]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
console.log("Vue")
|
||||
},
|
||||
methods: {
|
||||
detail(index){
|
||||
console.log(this.ruleData[index])
|
||||
// some jump
|
||||
},
|
||||
loadData(){
|
||||
$.ajax({
|
||||
url: qlgUrl("app/trade_rule/index"),
|
||||
method: "GET",
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
if(res.status == 1){
|
||||
this.ruleData = res.data;
|
||||
localStorage.setItem("LOCAL_RULE", JSON.stringify(res.data));
|
||||
}else{
|
||||
mui.alert(res.msg);
|
||||
}
|
||||
},
|
||||
error: function(err){
|
||||
mui.alert("请求失败");
|
||||
self.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// some ajax
|
||||
this.ruleData = [
|
||||
{id: 1, name: '这个是个开发中的页面呢', announced_at: "2019-09-09 18:09:01"},
|
||||
{id: 2, name: '待我来继续开发呢', announced_at: "2019-09-09 19:09:01"},
|
||||
]
|
||||
created() {
|
||||
var localData = localStorage.getItem("LOCAL_RULE");
|
||||
this.loadData();
|
||||
if(localData){
|
||||
this.noteData = JSON.parse(localData);
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user