qlg.frontend/js/trade_rule.js
2020-05-25 22:03:54 +08:00

44 lines
780 B
JavaScript

mui.plusReady(function(){
// some ajax
})
const app = new Vue({
el: '#app',
data() {
return {
ruleData: [
]
}
},
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();
}
});
}
},
created() {
var localData = localStorage.getItem("LOCAL_RULE");
this.loadData();
if(localData){
this.noteData = JSON.parse(localData);
}
}
})