forked from nsjcy/frontEnd/nsjcy

liuwh
2020-03-25 ec511e31e01a195bfea5145f9e7e929a68cd9f7e
SunshineLnsMinApp/pages/pfyy/pfyy.js
@@ -13,7 +13,8 @@
    id: '',
    picType: '',
    evalList: {},
    picturesInfo: {}
    picturesInfo: {},
    ReplyLogs:[]
  },
  /**
@@ -30,12 +31,14 @@
      success: function (res) {
        console.log(res.data.data.lawAppointment)
        if (res.data.code == 0) {
          var data1 = res.data.data.ReplyLogs || [];
          that.setData({
            picturesInfo: {
              ...res.data.data.lawAppointment,
              createId: userinfo.id,
              activitiesTime: app.formatDateday(res.data.data.lawAppointment.activitiesTime)
            },
            ReplyLogs: data1,
            disabled
          })
        } else {
@@ -59,6 +62,44 @@
  },
  reply: function (e) {
    var that = this;
    var openId = wx.getStorageSync("openId")
    var obj = {
      openId: openId,
      content: that.data.picturesInfo.replyContent,
      busType: 25,
      busId: that.data.picturesInfo.id
    };
    wx.request({
      url: app.globalData.url + '/api/v1/pictures/reply',
      data: obj,
      method: 'POST',
      header: {
        "Content-Type": "application/json"
      },
      success: function (res) {
        if (res.data.code == 0) {
          wx.showToast({
            title: '提交回复成功',
            icon: 'success',
            duration: 2000
          })
          setTimeout(function () {
            wx.navigateBack({
              changed: true
            }); //返回上一页
          }, 2000)
        } else {
          wx.showModal({
            title: '提示',
            content: "提交失败!"
          })
        }
      }
    })
  },
  submit: function (e) {
    var picturesInfo = this.data.picturesInfo;
    if (!picturesInfo.schoolName) {