index.js 834 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import {
  2. imgServerUrl
  3. } from '../../config/config.js'
  4. import {
  5. showToast
  6. } from '../../utils/tips.js'
  7. Page({
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. imgServerUrl: imgServerUrl,
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad: function (options) {
  18. },
  19. toclear(){
  20. wx.showModal({
  21. title: '清除缓存',
  22. content: '是否清除所有缓存内容',
  23. success(res) {
  24. if (res.confirm) {
  25. try {
  26. wx.clearStorage()
  27. wx.clearStorageSync()
  28. showToast('清除成功')
  29. } catch (e) {
  30. // Do something when catch error
  31. }
  32. } else if (res.cancel) {
  33. console.log('用户点击取消')
  34. }
  35. }
  36. })
  37. },
  38. toabout(){
  39. wx.navigateTo({
  40. url: '../about/index',
  41. })
  42. }
  43. })