index.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //index.js
  2. // 引入 QCloud 小程序增强 SDK
  3. var qcloud = require('../../vendor/qcloud-weapp-client-sdk/index');
  4. // 引入配置
  5. var config = require('../../config');
  6. // 显示繁忙提示
  7. var showBusy = text => wx.showToast({
  8. title: text,
  9. icon: 'loading',
  10. duration: 10000
  11. });
  12. // 显示成功提示
  13. var showSuccess = text => {
  14. wx.hideToast();
  15. wx.showToast({
  16. title: text,
  17. icon: 'success'
  18. });
  19. };
  20. // 显示失败提示
  21. var showModel = (title, content) => {
  22. wx.hideToast();
  23. wx.showModal({
  24. title,
  25. content: JSON.stringify(content),
  26. showCancel: false
  27. });
  28. };
  29. //获取应用实例
  30. var app = getApp()
  31. Page({
  32. data: {
  33. },
  34. onLoad: function () {
  35. console.log('onLoad');
  36. },
  37. onShow: function () {
  38. console.log('onShow');
  39. app.getUserInfo(function(userInfo){
  40. console.log(userInfo);
  41. });
  42. },
  43. onShareAppMessage: function () {
  44. return {
  45. title: '密件',
  46. desc: '密件',
  47. path: 'pages/index/index'
  48. }
  49. }
  50. })