| | |
| | | picType: '', |
| | | evalList: {}, |
| | | picturesInfo: {}, |
| | | ReplyLogs:[] |
| | | ReplyLogs: [] |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad: function (options) { |
| | | onLoad: function(options) { |
| | | var that = this; |
| | | console.log(options) |
| | | let id = options.id |
| | |
| | | var userinfo = wx.getStorageSync("user"); |
| | | wx.request({ |
| | | url: app.globalData.url + '/api/v1/appointment/find?id=' + id, |
| | | success: function (res) { |
| | | success: function(res) { |
| | | console.log(res.data.data.lawAppointment) |
| | | if (res.data.code == 0) { |
| | | var data1 = res.data.data.ReplyLogs || []; |
| | |
| | | picturesInfo: { |
| | | ...res.data.data.lawAppointment, |
| | | createId: userinfo.id, |
| | | activitiesTime: app.formatDateday(res.data.data.lawAppointment.activitiesTime) |
| | | activitiesTime: app.formatDateday(res.data.data.lawAppointment.activitiesTime || new Date()) |
| | | }, |
| | | ReplyLogs: data1, |
| | | disabled |
| | |
| | | }) |
| | | }, |
| | | |
| | | inputChange: function (e) { |
| | | inputChange: function(e) { |
| | | var name = e.currentTarget.dataset.name; |
| | | this.setData({ |
| | | picturesInfo: { |
| | |
| | | |
| | | }, |
| | | |
| | | reply: function (e) { |
| | | reply: function(e) { |
| | | var that = this; |
| | | var openId = wx.getStorageSync("openId") |
| | | var obj = { |
| | |
| | | busId: that.data.picturesInfo.id |
| | | }; |
| | | wx.request({ |
| | | url: app.globalData.url + '/api/v1/pictures/reply', |
| | | url: app.globalData.url + '/api/v1/appointment/reply', |
| | | data: obj, |
| | | method: 'POST', |
| | | header: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | success: function (res) { |
| | | success: function(res) { |
| | | if (res.data.code == 0) { |
| | | wx.showToast({ |
| | | title: '提交回复成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | setTimeout(function () { |
| | | setTimeout(function() { |
| | | wx.navigateBack({ |
| | | changed: true |
| | | }); //返回上一页 |
| | |
| | | }) |
| | | }, |
| | | |
| | | submit: function (e) { |
| | | submit: function(e) { |
| | | var picturesInfo = this.data.picturesInfo; |
| | | if (!picturesInfo.schoolName) { |
| | | return app.showModal("请填写学校名称!"); |
| | |
| | | return app.showModal("请填写联系人!"); |
| | | } |
| | | if (!picturesInfo.contactPhone) { |
| | | return app.showModal("请填写联系方式!"); |
| | | return app.showModal("请填写手机号码!"); |
| | | } |
| | | if (/^[1]([3-9])[0-9]{9}$/.test(picturesInfo.contactPhone) == false) { |
| | | return app.showModal("手机号码有误!"); |
| | | } |
| | | if (!picturesInfo.activitiesTime) { |
| | | return app.showModal("请填写活动时间!"); |
| | |
| | | if (!picturesInfo.activitiesAddress) { |
| | | return app.showModal("请填写活动场地!"); |
| | | } |
| | | if (!picturesInfo.remake) { |
| | | return app.showModal("请填写备注!"); |
| | | } |
| | | // if (!picturesInfo.remake) { |
| | | // return app.showModal("请填写备注!"); |
| | | // } |
| | | var that = this; |
| | | wx.request({ |
| | | url: app.globalData.url + '/api/v1/appointment/save', |
| | |
| | | header: { |
| | | "Content-Type": "application/json" |
| | | }, |
| | | success: function (res) { |
| | | success: function(res) { |
| | | if (res.data.code == 0) { |
| | | wx.showToast({ |
| | | title: '提交成功', |
| | | icon: 'success', |
| | | duration: 2000 |
| | | }) |
| | | setTimeout(function () { |
| | | setTimeout(function() { |
| | | wx.reLaunch({ |
| | | url: '../zhwj/zhwj', |
| | | }) |