index.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // index.ts
  2. // 获取应用实例
  3. const app = getApp<IAppOption>()
  4. // pages/orders/orders.ts
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. goodsImgList: [
  11. 'https://oss.dayaedu.com/ktyq/1739524049205.png',
  12. 'https://oss.dayaedu.com/ktyq/1739523564827.png',
  13. 'https://oss.dayaedu.com/ktyq/1739523574402.png',
  14. 'https://oss.dayaedu.com/ktyq/1739523583463.png'
  15. ],
  16. },
  17. isLogin() {
  18. // 判断是否登录
  19. if (!app.globalData.isLogin) {
  20. wx.navigateTo({
  21. url: '../login/login',
  22. })
  23. return false
  24. }
  25. return true
  26. },
  27. /** 我的订单 */
  28. onOrder() {
  29. // 判断是否登录
  30. if (!this.isLogin()) {
  31. return
  32. }
  33. wx.navigateTo({
  34. url: '../orders/orders',
  35. })
  36. },
  37. /** 申请加入 */
  38. onBuyGoods() {
  39. // 判断是否登录
  40. if (!this.isLogin()) {
  41. return
  42. }
  43. wx.navigateTo({
  44. url: '../select-goods/index',
  45. })
  46. },
  47. onShareAppMessage() {
  48. return {
  49. title: '翼时代器乐数字Ai',
  50. path: '/pages/index/index',
  51. imageUrl: 'https://oss.dayaedu.com/ktyq/1739865626350.png'
  52. }
  53. },
  54. onShareTimeline() {
  55. return {
  56. title: '翼时代器乐数字Ai',
  57. path: '/pages/index/index',
  58. imageUrl: 'https://oss.dayaedu.com/ktyq/1739865626350.png'
  59. }
  60. }
  61. })