untriedproducts.js 2.3 KB

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