// pages/mine/wxml/directlivemodification/directlivemodification.js const app = getApp(); Page({ /** * 页面的初始数据 */ bindPickerChange: function(e) { //console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ index: e.detail.value }) }, bindTimeChange: function(e) { //console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ time: e.detail.value }) }, bindDateChange: function(e) { //console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ date: e.detail.value }) }, bindTimeChanges: function(e) { //console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ times: e.detail.value }) }, bindDateChanges: function(e) { //console.log('picker发送选择改变,携带值为', e.detail.value) this.setData({ dates: e.detail.value }) }, //修改后上传拍卖会 formSubmit: function(e) { let _this = this; // console.log(_this.data.live_room_id) // //console.log(Number(e.detail.value.start)) var auction_way = ""; if (e.detail.value.name !== "") { if (e.detail.value.describe !== "") { wx.request({ url: app.globalData.prodUrl + 'web-pm/wx/pm/update_live_room', header: { 'ydw-token': wx.getStorageSync('key').ydw_token }, data: { name: e.detail.value.name, content: e.detail.value.describe, live_room_id: _this.data.live_room_id }, success: function(data) { //console.log(data) wx.showToast({ title: '上传拍卖会成功!', icon: 'none', duration: 3000, success: function () { setTimeout(function () { wx.navigateBack({ delta: 1, success: function () { var pages = getCurrentPages(); var page = getCurrentPages().pop(); //console.log(pages) if (page == undefined || page == null) return; pages[2].onLoad(pages[2].options); } }); }, 2000) } }); } }) }else{ wx.showToast({ title: '拍卖会描述不得为空!', icon: 'none', duration: 2000 }) } } else { wx.showToast({ title: '拍卖行名称不得为空!', icon: 'none', duration: 2000 }) } }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { //console.log(options) var _this = this _this.setData({ live_room_id: options.kid }) wx.request({ url: app.globalData.prodUrl + 'web-pm/wx/pm/get_live_room', header: { 'ydw-token': wx.getStorageSync('key').ydw_token }, data: { live_room_id: options.kid }, success: function(data) { //console.log(data.data.liveroom) _this.setData({ name: data.data.liveroom.name, describe: data.data.liveroom.content }) }, }); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function() { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { } })