243 lines
5.3 KiB
JavaScript
243 lines
5.3 KiB
JavaScript
// pages/ghMsg/ghMsg.js
|
|
var app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
ksmc:'',
|
|
date:'',
|
|
week:'',
|
|
day:'',
|
|
money:'',
|
|
pbmxid:'',
|
|
sfId:'',
|
|
name:'',
|
|
hosName:'',
|
|
hosLocation:'',
|
|
isShow:'true',
|
|
id:'',
|
|
yylsh:'',
|
|
jlzt:'',
|
|
xh:''
|
|
},
|
|
naviToDh(){
|
|
wx.openLocation({
|
|
latitude: app.globalData.lat,
|
|
longitude: app.globalData.lon,
|
|
scale:12,
|
|
name:app.globalData.hosName,
|
|
address:app.globalData.hosLocation
|
|
})
|
|
},
|
|
cancel(){
|
|
var _this = this;
|
|
if(_this.data.id == 0){
|
|
let yylsh = _this.data.xh
|
|
wx.showModal({
|
|
title: '',
|
|
content: '确定取消这次预约吗?',
|
|
cancelText:"否",
|
|
confirmText:'是',
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
wx.request({
|
|
url:'https://fy.btlsoln.com:8443/his/cancelOrder?yylsh',
|
|
method:"GET",
|
|
data:{
|
|
yylsh:yylsh,
|
|
},
|
|
header: {
|
|
'content-type': 'application/json'
|
|
},
|
|
success: (res)=> {
|
|
if(res.data.errCode == 0){
|
|
wx.showToast({
|
|
title: '取消成功',
|
|
icon: 'success',
|
|
duration: 2000
|
|
})
|
|
}else{
|
|
wx.showToast({
|
|
title: res.data.errMsg,
|
|
icon: 'error',
|
|
duration: 2000
|
|
})
|
|
}
|
|
setTimeout(item => {
|
|
wx.switchTab({
|
|
url: '/pages/index/index',
|
|
})
|
|
},1000)
|
|
_this.setData({
|
|
isShow:false
|
|
})
|
|
},
|
|
fail (err) {
|
|
console.error('失败', err)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
})
|
|
}else{
|
|
let yylsh = _this.data.yylsh
|
|
wx.showModal({
|
|
title: '',
|
|
content: '确定取消这次预约吗?',
|
|
cancelText:"否",
|
|
confirmText:'是',
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
wx.request({
|
|
url:'https://fy.btlsoln.com:8443/his/cancelOrder?yylsh',
|
|
method:"GET",
|
|
data:{
|
|
yylsh:yylsh,
|
|
},
|
|
header: {
|
|
'content-type': 'application/json'
|
|
},
|
|
success: (res)=> {
|
|
if(res.data.errCode == 0){
|
|
wx.showToast({
|
|
title: '取消成功',
|
|
icon: 'success',
|
|
duration: 2000
|
|
})
|
|
|
|
}else{
|
|
wx.showToast({
|
|
title: res.data.errMsg,
|
|
icon: 'error',
|
|
duration: 2000
|
|
})
|
|
}
|
|
setTimeout(item => {
|
|
wx.navigateBack({
|
|
delta: 1 //返回上一级页面
|
|
})
|
|
},1000)
|
|
_this.setData({
|
|
isShow:false
|
|
})
|
|
},
|
|
fail (err) {
|
|
console.error('失败', err)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
},
|
|
|
|
back(){
|
|
wx.switchTab({
|
|
url: '/pages/index/index',
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
console.log(options,"999999")
|
|
let id = options.stateId
|
|
this.setData({
|
|
id:id
|
|
})
|
|
let ksmc = options.ksmc
|
|
let date = options.date
|
|
let num = options.time
|
|
let name = options.name
|
|
let sfId = options.card
|
|
let yylsh= options.yylsh
|
|
let jlzt = options.jlzt
|
|
// let sfId = options.name
|
|
var year = String(num).substr(0,4)
|
|
var month = String(num).substr(4,5).substr(0,2)
|
|
var date1 = String(num).substr(6,7)
|
|
var result2 = year+'年'+ month +'月'+date1+'日'
|
|
var day = options.time
|
|
var that = this
|
|
if(id == 0){
|
|
that.setData({
|
|
hosName:app.globalData.hosName,
|
|
hosLocation:app.globalData.hosLocation,
|
|
ksmc:wx.getStorageSync('ksmc') ,
|
|
day:wx.getStorageSync('day') ,
|
|
date:wx.getStorageSync('sjd') ,
|
|
money:wx.getStorageSync('money') ,
|
|
sfId:wx.getStorageSync('sfId') ,
|
|
name:wx.getStorageSync('name'),
|
|
xh:wx.getStorageSync('xh')
|
|
})
|
|
}else{
|
|
that.setData({
|
|
hosName:app.globalData.hosName,
|
|
hosLocation:app.globalData.hosLocation,
|
|
ksmc:ksmc,
|
|
date:date,
|
|
day:day,
|
|
name:name,
|
|
sfId:sfId,
|
|
yylsh:yylsh,
|
|
jlzt:jlzt,
|
|
})
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
wx.setNavigationBarTitle({
|
|
title: "预约就诊详情"
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
}) |