index.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // pages/to-pay-order/index.js
  2. let app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. goodsList: [],
  9. allGoodsAndYunPrice: 0,
  10. name: '',
  11. tel: '',
  12. zuowei: '',
  13. remark: '',
  14. oid:'',
  15. imgurl: app.data.resturl,
  16. state:'',
  17. psinfo:''
  18. },
  19. /**
  20. * 生命周期函数--监听页面加载
  21. */
  22. onLoad: function (options) {
  23. this.setData({
  24. oid:options.id
  25. })
  26. },
  27. /**
  28. * 生命周期函数--监听页面显示
  29. */
  30. onShow: function () {
  31. this.showDetail()
  32. },
  33. back(){
  34. wx.navigateBack();
  35. },
  36. showDetail() {
  37. let that = this
  38. let oid = that.data.oid
  39. wx.request({
  40. url: app.data.resturl + '/odetail.action',
  41. method: 'post',
  42. header: {
  43. 'content-type': 'application/x-www-form-urlencoded'
  44. },
  45. data: {
  46. oid: oid
  47. },
  48. success: function (res) {
  49. that.setData({
  50. goodsList: res.data.items,
  51. name: res.data.order.name,
  52. tel:res.data.order.tel,
  53. zuowei: res.data.order.zuowei,
  54. remark: res.data.order.remark,
  55. allGoodsAndYunPrice: res.data.order.sjfk,
  56. state: res.data.order.orderZhuangtai
  57. })
  58. }
  59. })
  60. },
  61. comment: function (e) {
  62. let that = this
  63. let url = e.currentTarget.dataset.url
  64. wx.navigateTo({
  65. url: url,
  66. })
  67. }
  68. })