|
本帖最后由 wss610 于 2015-8-7 17:59 编辑
取数据打印出来还有错?、
- function getData() {
- var userid = $api.getStorage('userid');
- query.createQuery(function(ret, err) {
- if (ret && ret.qid) {
- api.showProgress({
- title : '正在获取数据...',
- text : ' ',
- modal : true
- });
- model.findAll({
- class : "list",
- qid : ret.qid
- }, function(ret, err) {
- api.hideProgress();
- if (ret) {
- // console.log(JSON.stringify(ret[0].createdAt));
- // console.log(JSON.stringify(ret[0].updatedAt));
- var content = $api.byId('list-content');
- var tpl = $api.byId('list-template').text;
- var tempFn = doT.template(tpl);
- $api.html(content,tempFn(ret));
- api.parseTapmode();
- //优化点击事件 }else{
- console.log(JSON.stringify(err));
- api.toast({
- msg : '没有新数据',
- duration : 1000,
- location : 'bottom'
- });
- }
- });
- }
- });
- }
复制代码 |
|