index.js 658 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // pages/user/setting/index.js
  2. const {
  3. globalData: {
  4. util: {
  5. regeneratorRuntime,
  6. goHome,
  7. showTip,
  8. logout
  9. }
  10. }
  11. } = getApp()
  12. Page({
  13. data: {
  14. list: {
  15. title: '分享小程序',
  16. icon: 'fenxiang',
  17. url: '',
  18. },
  19. },
  20. logout() {
  21. wx.showModal({
  22. content: '确定退出登录?',
  23. success: async ({ confirm }) => {
  24. if (!confirm) return
  25. logout()
  26. await goHome()
  27. showTip('已退出')
  28. }
  29. })
  30. },
  31. preview: function () {
  32. wx.previewImage({
  33. urls: ['http://img.mp.itc.cn/upload/20160428/b52be3dc215d4ecd844bf922be46f278_th.jpg'],
  34. })
  35. }
  36. })