// 基本信息(包括userAgent) var baseInfo = null, // 基础环境信息(包括当前webview) baseEnv = null; //文章列表 $articleView = $(".mui-table-view"); var article = ''; var batchNo = ""; var mscroll = null; // 获取登录相关信息 var getBaseInfo = function() { // 登录的相关信息 var userAgent = JSON.parse(plus.storage.getItem("userAgent")) return { userAgent: userAgent } }, // 获取基础环境信息 getBaseEnvPromise = function () { var env = { webview: plus&&plus.webview.currentWebview() }; var self = plus.webview.currentWebview(); return Promise.resolve().then(function(res) { return env; }); }, //事件绑定 bindEvents = function(){ $articleView.on('tap','.patient-list li',function() { var patientCode = $(this).attr('data-code'); openWebviewExtras("../../huanzhe/html/huanzhexinxi.html",{patiCode:patientCode}); }) }, loadArticlePromise = function() { plus.nativeUI.showWaiting(); return new Promise(function(resolve, reject) { sendPost("doctor/health/edu/log",{ article: article, batchNo: batchNo },function(res){ plus.nativeUI.closeWaiting(); if(res.msg){ mui.toast(res.msg); }else{ mui.toast("加载失败!"); } },function(res){ plus.nativeUI.closeWaiting(); if(res.status==200){ resolve(res.list) }else{ if(res.msg){ mui.toast(res.msg); }else{ mui.toast("加载失败!"); } } }) }); }, initScroll = function () { var page = 1; mscroll = mui('.mui-scroll-wrapper').pullRefresh({ down: { callback: function() { var self = this; loadArticlePromise() .then(function(list) { if(list && list.length) { var data = list[0]; var txtContent = $('