index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. const Parse = getApp().Parse;
  2. const company = getApp().globalData.company
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. id: "",
  9. shopOrder: {},
  10. // fileList: {},
  11. content: null,
  12. },
  13. // onChange(event) {
  14. // this.setData({
  15. // value: event.detail,
  16. // });
  17. // },
  18. blur(e) {
  19. let name = e.currentTarget.dataset.name
  20. this.setData({
  21. [name]: e.detail.value
  22. })
  23. },
  24. changeFile(e) {
  25. console.log(e);
  26. let fileList = e.detail
  27. this.setData({
  28. fileList
  29. })
  30. },
  31. async getShopOrder() {
  32. let id = this.data.id
  33. console.log(id);
  34. let ShopOrder = new Parse.Query('ShopOrder')
  35. let shopOrder = await ShopOrder.get(id)
  36. this.setData({
  37. shopOrder: shopOrder.attributes,
  38. })
  39. console.log(this.data.shopOrder);
  40. },
  41. /**
  42. * 生命周期函数--监听页面加载
  43. */
  44. onLoad: function(options) {
  45. let id = options.id
  46. this.setData({
  47. id: id
  48. })
  49. this.getShopOrder()
  50. },
  51. /**
  52. * 生命周期函数--监听页面初次渲染完成
  53. */
  54. onReady: function() {
  55. },
  56. /**
  57. * 生命周期函数--监听页面显示
  58. */
  59. onShow: function() {
  60. },
  61. /**
  62. * 生命周期函数--监听页面隐藏
  63. */
  64. onHide: function() {
  65. },
  66. /**
  67. * 生命周期函数--监听页面卸载
  68. */
  69. onUnload: function() {
  70. },
  71. /**
  72. * 页面相关事件处理函数--监听用户下拉动作
  73. */
  74. onPullDownRefresh: function() {
  75. },
  76. /**
  77. * 页面上拉触底事件的处理函数
  78. */
  79. onReachBottom: function() {
  80. },
  81. /**
  82. * 用户点击右上角分享
  83. */
  84. onShareAppMessage: function() {
  85. }
  86. })