index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. const Parse = getApp().Parse;
  2. const company = getApp().globalData.company
  3. // const login = require('../../../utils/login')
  4. Component({
  5. /**
  6. * 组件的属性列表
  7. */
  8. properties: {
  9. },
  10. /**
  11. * 组件的初始数据
  12. */
  13. data: {
  14. user: null,
  15. },
  16. ready: async function () {
  17. // this.getmy()
  18. },
  19. /**
  20. * 组件的方法列表
  21. */
  22. methods: {
  23. async getmy() {
  24. // let userLogin = wx.getStorageSync("userLogin");
  25. // if (userLogin == "") {
  26. // login.loginNow();
  27. // return;
  28. // }
  29. let uid = Parse.User.current().id
  30. console.log(uid);
  31. let ShopOrder = new Parse.Query('_User')
  32. let shopOrder = await ShopOrder.get(uid)
  33. this.setData({
  34. user: shopOrder.toJSON()
  35. })
  36. console.log(this.data.user);
  37. },
  38. goodsorder() {
  39. wx.navigateTo({
  40. url: `/nova-tourism/pages/my/shop-order/index?type=shop&themeColor=#46a9a4`
  41. });
  42. },
  43. myinformation() {
  44. wx.navigateTo({
  45. url: '/common-page/pages/info/index'
  46. });
  47. },
  48. refund() {
  49. wx.navigateTo({
  50. url: '/nova-tourism/pages/my/refund/refund-list/index'
  51. });
  52. },
  53. homestayorder() {
  54. wx.navigateTo({
  55. url: '/nova-tourism/pages/my/homestay-order/index'
  56. });
  57. },
  58. orderdetails() {
  59. wx.navigateTo({
  60. url: '/nova-tourism/pages/my/order-details/index'
  61. });
  62. },
  63. comments() {
  64. wx.navigateTo({
  65. url: '/nova-tourism/pages/my/comments/index'
  66. });
  67. },
  68. merchant() {
  69. let merchant = wx.getStorageSync('merchant');
  70. if (merchant) {
  71. wx.navigateTo({
  72. url: '/nova-tourism/pages/my/merchant/merchant-home/index'
  73. });
  74. } else {
  75. wx.navigateTo({
  76. url: '/nova-tourism/pages/my/merchant/login/index'
  77. });
  78. }
  79. },
  80. feedback() {
  81. wx.navigateTo({
  82. url: '/nova-tourism/pages/my/feedback/index'
  83. });
  84. },
  85. foodorder() {
  86. wx.navigateTo({
  87. url: '/nova-tourism/pages/my/eat/index'
  88. });
  89. }
  90. }
  91. })