123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- // pages/monthmama/monthmama.js
- const app = getApp()
- var util = require("../../utils/util.js");
- Page({
- data: {
- ysmamalists: []
- },
- onLoad: function(options) {
- let yslist = wx.getStorageSync('yslist')
- let _this = this;
- _this.setData({
- ysmamalists: yslist
- })
- _this.setData({
- navH: app.globalData.navHeight
- })
- },
- goback() {
- util.goHome();
- },
- ysdetail(e) {
- const ysid = e.currentTarget.dataset.id;
- },
- toappointment(e) {
- const that = this;
- const ysname = e.currentTarget.dataset.name;
- let ysindex = e.currentTarget.dataset.index;
- let branche_code = wx.getStorageSync('branche_code');
- let bk_date = wx.getStorageSync('todayDate');
- util.postData('/insertCustomerBooking', {
- bk_phone: app.globalData.userphone,
- bk_type: "2",
- bk_desc: ysname,
- bk_date: bk_date,
- bk_branches_id: branche_code
- }).then(res => {
- if (res == 1) {
- var missionArr = that.data.ysmamalists;
- for (let i in missionArr) {
- //遍历列表数据
- if (i == ysindex) {
- //根据下标找到目标,改变状态
- missionArr[i].status = 0;
- }
- }
- //数组重新赋值
- this.setData({
- ysmamalists: missionArr
- })
- wx.showModal({
- title: '恭喜亲!',
- content: '您已成功解锁简历,悦所客服人员将在24小时内与您联系,为您发送详细月嫂信息,谢谢。',
- showCancel: false,
- confirmColor: "#02BB00",
- success(res) {
- if (res.confirm) {
- // console.log('用户点击确定')
- }
- }
- })
- util.postData('/WXSendBookingMessage', {
- bk_phone: app.globalData.userphone,
- bk_type: "2",
- bk_desc: ysname,
- bk_date: bk_date,
- bk_branches_id: branche_code
- }).then(res => {
- if (res == 1) {
- }
- })
- } else if (res == 99) {
- wx.showToast({
- title: '您已经预约了~',
- icon: 'none',
- duration: 2000
- })
- }
- })
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function() {
- },
- /**
- * 生命周期函数--监听页面显示
- */
- onShow: function() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide: function() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload: function() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh: function() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom: function() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage: function() {
- }
- })
|