// pages/mine/wxml/establish/establish.js const app = getApp(); Page({ /** * 页面的初始数据 */ data: { textareaVal:'' }, //上传 formSubmit: function(e) { var _this = this; var auction_way = ""; if (e.detail.value.name !== "" && _this.data.textareaVal !== '') { wx.request({ url: app.globalData.prodUrl + 'web-pm/wx/pm/create_live_room', header: { 'ydw-token': wx.getStorageSync('key').ydw_token }, data: { name: e.detail.value.name, content: _this.data.textareaVal, }, success: function(data) { //console.log(data) if (data.data.success) { wx.showToast({ title: '上传拍卖会成功!', icon: 'none', duration: 3000, success: function () { setTimeout(function () { wx.navigateBack({ delta: 1, success: function () { } }); }, 2000) } }); } } }) } else { if (e.detail.value.name == "") { wx.showToast({ title: '拍卖会名称不得为空!', icon: 'none', duration: 2000 }) } else if (_this.data.textareaVal == '') { wx.showToast({ title: '拍卖会描述不得为空!', icon: 'none', duration: 2000 }) } } }, /** * 生命周期函数--监听页面加载 */ onLoad: function(options) { //console.log(options) var _this =this 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) }, }); }, bindTextAreaBlur: function (e) { this.setData({ textareaVal: e.detail.value }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function() { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { } })