Files
kelfy-mini/pages/bookingDetails/bookingDetails.js
2025-11-13 13:39:24 +08:00

135 lines
3.1 KiB
JavaScript

// pages/bookingDetails/bookingDetails.js
Page({
/**
* 页面的初始数据
*/
data: {
showData: {},
showDatas: [],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
this.setData({
showData: JSON.parse(options.item)
})
this.getShowDataPlugs()
},
getShowDataPlugs() {
wx.request({
url: 'https://fy.btlsoln.com:8443/booking/getDoctorScheduling?selectDate&selectKmdm',
method: "GET",
data: {
selectDate: this.data.showData.selectDate,
selectKmdm: this.data.showData.ysdm
},
header: {
'content-type': 'application/json'
},
success: (res) => {
console.log(res, "获取号源")
this.setData({
showDatas: res.data.list
})
}
})
},
naviToyy(e) { //调用预约接口,成功后跳转到预约成功页面
const bookIngDate =e.currentTarget.dataset.item.kssj;
let pbmxid = e.currentTarget.dataset.item.pbmxid
wx.request({
url: 'https://fy.btlsoln.com:8443/his/order?patid&pbmxid&czyh&yyhx&ksmc&ksdm&sjdjl&cardNo&patientName',
method: "GET",
data: {
pbmxid: pbmxid,
patid: wx.getStorageSync("painId"),
czyh: '01',
yyhx: "0",
ksmc: this.data.showData.ksmc,
ksdm: this.data.showData.ksdm,
sjdjl: bookIngDate,
jssj: e.currentTarget.dataset.item.jssj,
zxrq: e.currentTarget.dataset.item.zxrq,
cardNo: wx.getStorageSync('cardNo'),
patientName: wx.getStorageSync('trueName'),
},
header: {
'content-type': 'application/json'
},
success: (res) => {
if (res.data.errCode == 0) {
wx.setStorageSync('ksmc', this.data.showData.ksmc)
wx.setStorageSync('day', e.currentTarget.dataset.item.zxrq)
wx.setStorageSync('date', bookIngDate)
wx.setStorageSync('sjd', bookIngDate + '-' + e.currentTarget.dataset.item.jssj)
wx.setStorageSync('today', bookIngDate)
wx.setStorageSync('money', e.currentTarget.dataset.item.ghf)
wx.setStorageSync('sfId', wx.getStorageSync('sfId1'))
wx.setStorageSync('name', wx.getStorageSync('trueName'))
wx.setStorageSync('xh', res.data.list[0].xh)
wx.navigateTo({
url: '/pages/resInformation/resInformation',
})
} else {
wx.showToast({
title: res.data.errMsg,
icon: "none"
})
}
},
fail(err) {}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})