monthmama.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. // pages/monthmama/monthmama.js
  2. const app = getApp()
  3. var util = require("../../utils/util.js");
  4. Page({
  5. data: {
  6. ysmamalists: []
  7. },
  8. onLoad: function(options) {
  9. let yslist = wx.getStorageSync('yslist')
  10. let _this = this;
  11. _this.setData({
  12. ysmamalists: yslist
  13. })
  14. _this.setData({
  15. navH: app.globalData.navHeight
  16. })
  17. },
  18. goback() {
  19. util.goHome();
  20. },
  21. ysdetail(e) {
  22. const ysid = e.currentTarget.dataset.id;
  23. },
  24. toappointment(e) {
  25. const that = this;
  26. const ysname = e.currentTarget.dataset.name;
  27. let ysindex = e.currentTarget.dataset.index;
  28. let branche_code = wx.getStorageSync('branche_code');
  29. let bk_date = wx.getStorageSync('todayDate');
  30. util.postData('/insertCustomerBooking', {
  31. bk_phone: app.globalData.userphone,
  32. bk_type: "2",
  33. bk_desc: ysname,
  34. bk_date: bk_date,
  35. bk_branches_id: branche_code
  36. }).then(res => {
  37. if (res == 1) {
  38. var missionArr = that.data.ysmamalists;
  39. for (let i in missionArr) {
  40. //遍历列表数据
  41. if (i == ysindex) {
  42. //根据下标找到目标,改变状态
  43. missionArr[i].status = 0;
  44. }
  45. }
  46. //数组重新赋值
  47. this.setData({
  48. ysmamalists: missionArr
  49. })
  50. wx.showModal({
  51. title: '恭喜亲!',
  52. content: '您已成功解锁简历,悦所客服人员将在24小时内与您联系,为您发送详细月嫂信息,谢谢。',
  53. showCancel: false,
  54. confirmColor: "#02BB00",
  55. success(res) {
  56. if (res.confirm) {
  57. // console.log('用户点击确定')
  58. }
  59. }
  60. })
  61. util.postData('/WXSendBookingMessage', {
  62. bk_phone: app.globalData.userphone,
  63. bk_type: "2",
  64. bk_desc: ysname,
  65. bk_date: bk_date,
  66. bk_branches_id: branche_code
  67. }).then(res => {
  68. if (res == 1) {
  69. }
  70. })
  71. } else if (res == 99) {
  72. wx.showToast({
  73. title: '您已经预约了~',
  74. icon: 'none',
  75. duration: 2000
  76. })
  77. }
  78. })
  79. },
  80. /**
  81. * 生命周期函数--监听页面初次渲染完成
  82. */
  83. onReady: function() {
  84. },
  85. /**
  86. * 生命周期函数--监听页面显示
  87. */
  88. onShow: function() {
  89. },
  90. /**
  91. * 生命周期函数--监听页面隐藏
  92. */
  93. onHide: function() {
  94. },
  95. /**
  96. * 生命周期函数--监听页面卸载
  97. */
  98. onUnload: function() {
  99. },
  100. /**
  101. * 页面相关事件处理函数--监听用户下拉动作
  102. */
  103. onPullDownRefresh: function() {
  104. },
  105. /**
  106. * 页面上拉触底事件的处理函数
  107. */
  108. onReachBottom: function() {
  109. },
  110. /**
  111. * 用户点击右上角分享
  112. */
  113. onShareAppMessage: function() {
  114. }
  115. })