1.在*.js文件中
//过滤器,用于返回获取的“ 我的借款-出借中 的状态值”
vx.module("ibsapp").filter("queryLoaningState",[function(){
return function(input){
var stateValue = "";
if(input=="1"){
stateValue = "准备发布";
}else if(input=="2"){
stateValue = "初审";
}else if(input=="3"){
stateValue = "终审";
}else if(input=="4"){
stateValue = "初审拒绝";
}else if(input=="5"){
stateValue = "终审拒绝";
}else if(input=="6"){
stateValue = "招标失败";
}else if(input=="7"){
stateValue = "招标中";
}else if(input=="8"){
stateValue = "已撤销";
}
return stateValue;
};
}]);
2.在*.html文件中
<tr v-repeat="item in queryLoaningList">
<td>{{item.State | queryLoaningState}}</td>
</tr>
或者其他方式在vx2-locale_zh_cn.js文件。
//用于返回获取的“状态值”
messages["queryLoaningState"]={
"1": "准备发布",
"2": "初审",
"3": "终审",
"4": "初审拒绝",
"5": "终审拒绝",
"6": "招标失败",
"7": "招标中",
"8": "已撤销",
};
在*.html文件中
<tr v-repeat="item in queryLoaningList">
<td>{{$msg('queryLoaningState')[item.state]}}</td>
</tr>