51 lines
944 B
JavaScript
51 lines
944 B
JavaScript
mui.plusReady(function(){
|
|
// some ajax
|
|
})
|
|
const app = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
ruleData: [
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
detail(index){
|
|
JZL.openWindow('trade_rule_detail.html', 'trade_rule_detail.html', {
|
|
ruleId: this.ruleData[index].id,
|
|
parentData: this.ruleData[index],
|
|
})
|
|
},
|
|
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){
|
|
try {
|
|
JSON.parse(localData);
|
|
this.ruleData = JSON.parse(localData);
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
}
|
|
}) |