published.js 2.3 KB

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