home.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Page({
  2. data: {
  3. elements: [
  4. { title: '布局', name: 'layout', color: 'cyan', icon: 'newsfill' },
  5. { title: '背景', name: 'background', color: 'blue', icon: 'colorlens' },
  6. { title: '文本', name: 'text', color: 'purple', icon: 'font' },
  7. { title: '图标 ', name: 'icon', color: 'mauve', icon: 'icon' },
  8. { title: '按钮', name: 'button', color: 'pink', icon: 'btn' },
  9. { title: '标签', name: 'tag', color: 'brown', icon: 'tagfill' },
  10. { title: '头像', name: 'avatar', color: 'red', icon: 'myfill' },
  11. { title: '进度条', name: 'progress', color: 'orange', icon: 'icloading' },
  12. { title: '边框阴影', name: 'shadow', color: 'olive', icon: 'copy' },
  13. { title: '加载', name: 'loading', color: 'green', icon: 'loading2' },
  14. ],
  15. },
  16. onLoad() {
  17. let that = this;
  18. // 获取用户信息
  19. wx.getSetting({
  20. success: res => {
  21. if (!res.authSetting['scope.userInfo']) {
  22. wx.redirectTo({
  23. url: '/pages/auth/auth'
  24. })
  25. }
  26. }
  27. })
  28. },
  29. showModal(e) {
  30. this.setData({
  31. modalName: e.currentTarget.dataset.target
  32. })
  33. },
  34. hideModal(e) {
  35. this.setData({
  36. modalName: null
  37. })
  38. },
  39. onShareAppMessage(){
  40. return {
  41. title: 'ColorUI-高颜值的小程序UI组件库',
  42. imageUrl:'https://image.weilanwl.com/color2.0/share2215.jpg',
  43. path: '/pages/basics/home/home'
  44. }
  45. }
  46. })