index.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. const _my = require("../../../__antmove/api/index.js")(my);
  2. const wx = _my; // pages/meeting/renewalContract/index.js
  3. import { continueMeetingSpan, continueMeeting } from "../../../utils/api/meeting";
  4. const app = getApp()
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. item: {},
  11. startTime: null,
  12. endTime: null
  13. },
  14. getValue(e) {
  15. let type = e.currentTarget.dataset.type;
  16. this.setData({
  17. [`${type}`]: e.detail
  18. });
  19. },
  20. submit() {
  21. let {
  22. continueAppointmentEndTime,
  23. item
  24. } = this.data;
  25. if (!continueAppointmentEndTime) {
  26. wx.showToast({
  27. title: "请将内容填写完整",
  28. icon: "none"
  29. });
  30. return;
  31. }
  32. let data = {
  33. continueAppointmentEndTime: continueAppointmentEndTime,
  34. meetingRecordId: item.meetingRecordId
  35. };
  36. wx.requestSubscribeMessage({
  37. entityIds: ["96dbb1e83377423789c846313681ac6e"],
  38. success(res) {
  39. continueMeeting(data).then(res => {
  40. wx.showToast({
  41. title: "操作成功",
  42. icon: "none",
  43. duration: 800,
  44. mask: true,
  45. success: function () {
  46. setTimeout(function () {
  47. wx.switchTab({
  48. url: "/pages/home/home"
  49. });
  50. }, 800);
  51. }
  52. });
  53. });
  54. }
  55. });
  56. },
  57. continueMeetingSpan() {
  58. continueMeetingSpan({
  59. meetingRecordId: this.data.item.meetingRecordId
  60. }).then(res => {
  61. this.setData({
  62. startTime: this.data.item.appointmentEndTime,
  63. endTime: res.data.continueAppointmentEndTime
  64. });
  65. });
  66. },
  67. /**
  68. * 生命周期函数--监听页面加载 修改1
  69. */
  70. onLoad(options) {
  71. let item = JSON.parse(JSON.stringify(app.data.roomContentInfo));
  72. app.data.roomContentInfo = null;
  73. this.setData({
  74. item: item
  75. });
  76. // this.setData({
  77. // item: JSON.parse(options.item)
  78. // });
  79. this.continueMeetingSpan();
  80. },
  81. /**
  82. * 生命周期函数--监听页面初次渲染完成
  83. */
  84. onReady() { },
  85. /**
  86. * 生命周期函数--监听页面显示
  87. */
  88. onShow() { },
  89. /**
  90. * 生命周期函数--监听页面隐藏
  91. */
  92. onHide() { },
  93. /**
  94. * 生命周期函数--监听页面卸载
  95. */
  96. onUnload() { },
  97. /**
  98. * 页面相关事件处理函数--监听用户下拉动作
  99. */
  100. onPullDownRefresh() { },
  101. /**
  102. * 页面上拉触底事件的处理函数
  103. */
  104. onReachBottom() { },
  105. /**
  106. * 用户点击右上角分享
  107. */
  108. onShareAppMessage() { },
  109. antmoveAction: function () {
  110. //执行时动态赋值,请勿删除
  111. }
  112. });