index.js 782 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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){
  25. wx.clearStorageSync()
  26. wx.reLaunch({
  27. url: '/pages/login/login',
  28. })
  29. }
  30. }
  31. })
  32. },
  33. preview: function () {
  34. wx.previewImage({
  35. urls: ['https://mp.weixin.qq.com/wxopen/qrcode?action=download&fakeid=3827135683&token=849973044&type=0&pixsize=336&line_r=undefined&line_g=undefined&line_b=undefined'],
  36. })
  37. }
  38. })