directlivemodification.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. // pages/mine/wxml/directlivemodification/directlivemodification.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. bindPickerChange: function(e) {
  8. //console.log('picker发送选择改变,携带值为', e.detail.value)
  9. this.setData({
  10. index: e.detail.value
  11. })
  12. },
  13. bindTimeChange: function(e) {
  14. //console.log('picker发送选择改变,携带值为', e.detail.value)
  15. this.setData({
  16. time: e.detail.value
  17. })
  18. },
  19. bindDateChange: function(e) {
  20. //console.log('picker发送选择改变,携带值为', e.detail.value)
  21. this.setData({
  22. date: e.detail.value
  23. })
  24. },
  25. bindTimeChanges: function(e) {
  26. //console.log('picker发送选择改变,携带值为', e.detail.value)
  27. this.setData({
  28. times: e.detail.value
  29. })
  30. },
  31. bindDateChanges: function(e) {
  32. //console.log('picker发送选择改变,携带值为', e.detail.value)
  33. this.setData({
  34. dates: e.detail.value
  35. })
  36. },
  37. //修改后上传拍卖会
  38. formSubmit: function(e) {
  39. let _this = this;
  40. // console.log(_this.data.live_room_id)
  41. // //console.log(Number(e.detail.value.start))
  42. var auction_way = "";
  43. if (e.detail.value.name !== "") {
  44. if (e.detail.value.describe !== "") {
  45. wx.request({
  46. url: app.globalData.prodUrl + 'web-pm/wx/pm/update_live_room',
  47. header: {
  48. 'ydw-token': wx.getStorageSync('key').ydw_token
  49. },
  50. data: {
  51. name: e.detail.value.name,
  52. content: e.detail.value.describe,
  53. live_room_id: _this.data.live_room_id
  54. },
  55. success: function(data) {
  56. //console.log(data)
  57. wx.showToast({
  58. title: '上传拍卖会成功!',
  59. icon: 'none',
  60. duration: 3000,
  61. success: function () {
  62. setTimeout(function () {
  63. wx.navigateBack({
  64. delta: 1,
  65. success: function () {
  66. var pages = getCurrentPages();
  67. var page = getCurrentPages().pop();
  68. //console.log(pages)
  69. if (page == undefined || page == null) return;
  70. pages[2].onLoad(pages[2].options);
  71. }
  72. });
  73. }, 2000)
  74. }
  75. });
  76. }
  77. })
  78. }else{
  79. wx.showToast({
  80. title: '拍卖会描述不得为空!',
  81. icon: 'none',
  82. duration: 2000
  83. })
  84. }
  85. } else {
  86. wx.showToast({
  87. title: '拍卖行名称不得为空!',
  88. icon: 'none',
  89. duration: 2000
  90. })
  91. }
  92. },
  93. /**
  94. * 生命周期函数--监听页面加载
  95. */
  96. onLoad: function(options) {
  97. //console.log(options)
  98. var _this = this
  99. _this.setData({
  100. live_room_id: options.kid
  101. })
  102. wx.request({
  103. url: app.globalData.prodUrl + 'web-pm/wx/pm/get_live_room',
  104. header: {
  105. 'ydw-token': wx.getStorageSync('key').ydw_token
  106. },
  107. data: {
  108. live_room_id: options.kid
  109. },
  110. success: function(data) {
  111. //console.log(data.data.liveroom)
  112. _this.setData({
  113. name: data.data.liveroom.name,
  114. describe: data.data.liveroom.content
  115. })
  116. },
  117. });
  118. },
  119. /**
  120. * 生命周期函数--监听页面初次渲染完成
  121. */
  122. onReady: function() {
  123. },
  124. /**
  125. * 生命周期函数--监听页面显示
  126. */
  127. onShow: function() {
  128. },
  129. /**
  130. * 生命周期函数--监听页面隐藏
  131. */
  132. onHide: function() {
  133. },
  134. /**
  135. * 生命周期函数--监听页面卸载
  136. */
  137. onUnload: function() {
  138. },
  139. /**
  140. * 页面相关事件处理函数--监听用户下拉动作
  141. */
  142. onPullDownRefresh: function() {
  143. },
  144. /**
  145. * 页面上拉触底事件的处理函数
  146. */
  147. onReachBottom: function() {
  148. }
  149. })