Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

67 linhas
2.1 KiB

  1. // 有关“空白”模板的简介,请参阅以下文档:
  2. // http://go.microsoft.com/fwlink/?LinkID=397704
  3. // 若要在 cordova-simulate 或 Android 设备/仿真器上在页面加载时调试代码: 启动应用,设置断点,
  4. // 然后在 JavaScript 控制台中运行 "window.location.reload()"。
  5. (function ($, learun) {
  6. "use strict";
  7. // 初始化页面
  8. var tabdata = [
  9. {
  10. page: 'workspace',
  11. text: '首页',
  12. img: 'images/tab10.png',
  13. fillimg: 'images/tab11.png'
  14. },
  15. {
  16. page: 'message',
  17. text: '消息',
  18. img: 'images/tab20.png',
  19. fillimg: 'images/tab21.png'
  20. },
  21. {
  22. page: 'contacts',
  23. text: '通讯录',
  24. img: 'images/tab30.png',
  25. fillimg: 'images/tab31.png'
  26. },
  27. {
  28. page: 'my',
  29. text: '我的',
  30. img: 'images/tab40.png',
  31. fillimg: 'images/tab41.png'
  32. }
  33. ];
  34. learun.init(function () {
  35. // 处理 Cordova 暂停并恢复事件
  36. document.addEventListener('pause', onPause.bind(this), false);
  37. document.addEventListener('resume', onResume.bind(this), false);
  38. learun.tab.init(tabdata);
  39. var logininfo = learun.storage.get('logininfo');
  40. if (logininfo) {// 有登录的token
  41. learun.tab.go('workspace');
  42. $.ajax({
  43. url: config.webapi + "weixinapi/weixinconfig",
  44. type: "get",
  45. success: function (res) {
  46. learun.storage.set('weixinappid', res.data.appid );
  47. learun.storage.set('weixinappsecret', res.data.secret );
  48. }
  49. });
  50. }
  51. else {
  52. learun.nav.go({ path: 'login', isBack: false, isHead: false });
  53. }
  54. learun.splashscreen.hide();
  55. });
  56. function onPause() {
  57. // TODO: 此应用程序已挂起。在此处保存应用程序状态。
  58. }
  59. function onResume() {
  60. // TODO: 此应用程序已重新激活。在此处还原应用程序状态。
  61. }
  62. })(window.jQuery, window.lrmui);