goodstobereceived.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // pages/mine/wxml/goodstobereceived/goodstobereceived.js
  2. var app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. array: [],
  9. btntype:true,
  10. prodUrl:app.globalData.prodUrl
  11. },
  12. modalcnt:function(){
  13. wx.showModal({
  14. title: '提示',
  15. content: '功能敬请期待',
  16. success: function (res) {
  17. if (res.confirm) {
  18. ////console.log('用户点击确定')
  19. } else if (res.cancel) {
  20. //console.log('用户点击取消')
  21. }
  22. }
  23. })
  24. },
  25. //已收货功能
  26. btn:function(e){
  27. var _this = this
  28. // //console.log(e.target.dataset.kid)
  29. wx.showModal({
  30. title: '提示',
  31. content: '请您确定已收货',
  32. success: function (res) {
  33. if (res.confirm) {
  34. //console.log(111)
  35. wx.request({
  36. url: app.globalData.prodUrl + 'web-pm/wx/pm/verify_receive',
  37. header: {
  38. 'ydw-token': wx.getStorageSync('key').ydw_token
  39. },
  40. data: {
  41. item_kid: e.target.dataset.kid
  42. },
  43. success: function (data) {
  44. //console.log(data)
  45. _this.onLoad()
  46. },
  47. });
  48. } else if (res.cancel) {
  49. //console.log('用户点击取消')
  50. }
  51. }
  52. })
  53. },
  54. /**
  55. * 生命周期函数--监听页面加载
  56. */
  57. onLoad: function (options) {
  58. var _this =this
  59. wx.request({
  60. url: app.globalData.prodUrl + 'web-pm/wx/pm/wait_receive',
  61. header: {
  62. 'ydw-token': wx.getStorageSync('key').ydw_token
  63. },
  64. success: function (data) {
  65. //console.log(data)
  66. _this.setData({
  67. array: data.data.data
  68. })
  69. },
  70. });
  71. },
  72. /**
  73. * 生命周期函数--监听页面初次渲染完成
  74. */
  75. onReady: function () {
  76. },
  77. /**
  78. * 生命周期函数--监听页面显示
  79. */
  80. onShow: function () {
  81. },
  82. /**
  83. * 生命周期函数--监听页面隐藏
  84. */
  85. onHide: function () {
  86. },
  87. /**
  88. * 生命周期函数--监听页面卸载
  89. */
  90. onUnload: function () {
  91. },
  92. /**
  93. * 页面相关事件处理函数--监听用户下拉动作
  94. */
  95. onPullDownRefresh: function () {
  96. },
  97. /**
  98. * 页面上拉触底事件的处理函数
  99. */
  100. onReachBottom: function () {
  101. }
  102. })