本文实例为大家分享了dropload插件上拉下滑加载数据的具体代码,供大家参考,具体内容如下
效果图:
1.导入js
dropload.min.js zepto.min.js
2.后台查询
rush:js;">
/**
* 我找的劵
*
* @return
*/
@Action("IFindTicket")
public String IFindTicket() {
try {
FuTransaction transaction = fuTransactionService.findByUserId(userId);
Map map = new HashMap();
map.put("transactionId",transaction == null ? 0L : transaction.getId());
List accounts = fuStockAccountService.findAccountByMap(0,5,map);
this.getActionContext().put("accounts",accounts);
} catch (Exception e) {
e.printstacktrace();
logger.equals(e);
}
return SUCCESS;
}
/**
- 我找的劵数据
- @return
*/
@Action("findTicketData")
public String findTicketData() {
try {
FuTransaction transaction = fuTransactionService.findByUserId(userId);
Map<String,Integer.MAX_VALUE,map);
JSONObject json = new JSONObject();
JSONArray array = new JSONArray();
if (accounts.size() > 0) {
for (FuStockAccount account : accounts) {
JSONObject obj = new JSONObject();
obj.put("id",account.getId());
obj.put("openEquity",account.getopenEquity());
obj.put("capitalAccount",account.getCapitalAccount());
obj.put("transactionStatus",account.getTransactionStatus());
obj.put("status",account.getTransactionStatus() == 0 ? "正在操作" : "已退劵");
obj.put("available",new DecimalFormat("#,###,##0.00").format(account.getAvailable() == null ? 0 : account.getAvailable()));
obj.put("ableMoney",##0.00").format(account.getAbleMoney() == null ? 0 : account.getAbleMoney()));
obj.put("createTime",new SimpleDateFormat("yyyy.MM.dd").format(account.getCreateTime()));
array.add(obj);
}
}
json.put("array",array);
write(json.toString());
} catch (Exception e) {
e.printstacktrace();
logger.error(e);
}
return null;
}
3.页面插件的使用
rush:xhtml;">
<Meta http-equiv="X-UA-Compatible" content="IE=Edge">
<Meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<Meta name="apple-mobile-web-app-capable" content="yes">
<Meta name="apple-mobile-web-app-status-bar-style" content="black">
<Meta name="format-detection" content="telephone=no">
<%@ include file="../common/meta.jsp" %>
<%@ include file="/WEB-INF/include/tagtld.jsp"%>
${title}-我找的券
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/css.jsp"%>
irstTd">
可用资金: