255 lines
5.4 KiB
JavaScript
255 lines
5.4 KiB
JavaScript
// pages/my.js
|
|
const app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
hasPer: "",
|
|
htmlSnip: `
|
|
<div>
|
|
<p>fsfsfsfs</p>
|
|
<img style="width:100%" src="https://img-blog.csdnimg.cn/20190107191524297.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3UwMTE0MTU3ODI=,size_16,color_FFFFFF,t_70" />
|
|
</div>
|
|
`,
|
|
phone: '',
|
|
menuList: [{
|
|
id: 0,
|
|
name: '管理就诊人',
|
|
icon: "menu1"
|
|
},
|
|
{id:6,name:'管理儿童体检人',icon:"menu1"},
|
|
{id:7,name:'管理康复人员',icon:"menu1"},
|
|
{id:8,name:'管理体检人',icon:"menu1"},
|
|
{
|
|
id: 1,
|
|
name: '预约就诊记录',
|
|
icon: "menu2"
|
|
},
|
|
{
|
|
id: 2,
|
|
name: '门诊缴费记录',
|
|
icon: "menu3"
|
|
},
|
|
{
|
|
id: 3,
|
|
name: '门诊充值记录',
|
|
icon: "menu4"
|
|
},
|
|
{
|
|
id: 4,
|
|
name: '历史就诊记录',
|
|
icon: "menu6"
|
|
},
|
|
{
|
|
id: 5,
|
|
name: '问题反馈',
|
|
icon: "menu5"
|
|
},
|
|
],
|
|
num: ''
|
|
},
|
|
getPhoneNumber(e) {
|
|
console.log(e)
|
|
var that = this;
|
|
console.log(e.detail.errMsg == "getPhoneNumber:ok");
|
|
wx.request({
|
|
url: 'https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token',
|
|
method: "GEt",
|
|
data: {
|
|
access_token: access_token,
|
|
code: e.detail.iv
|
|
},
|
|
success: res => {
|
|
console.log(res.data, 123456789)
|
|
this.globalData.openId = res.data
|
|
}
|
|
})
|
|
},
|
|
getUserProfile(e) {
|
|
wx.getUserProfile({
|
|
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
|
success: (res) => {
|
|
console.log(res, "用户信息")
|
|
this.setData({
|
|
nickName: res.userInfo.nickName,
|
|
url: res.userInfo.avatarUrl
|
|
})
|
|
}
|
|
})
|
|
},
|
|
onTabItemTap: function (item) {
|
|
if (this.data.hasPer == true) {
|
|
wx.showModal({
|
|
title: '',
|
|
content: '您还未绑定就诊人,请先绑定就诊人信息!',
|
|
cancelText: "否",
|
|
confirmText: '是',
|
|
success: function (res) {
|
|
if (res.confirm) {
|
|
wx.navigateTo({
|
|
url: '/pages/userMsgDel/userMsgDel?state=0',
|
|
})
|
|
} else {
|
|
wx.switchTab({
|
|
url: '/pages/index/index',
|
|
});
|
|
}
|
|
}
|
|
})
|
|
}
|
|
},
|
|
naviToMsg() {
|
|
wx.navigateTo({
|
|
url: '/pages/notification/notification',
|
|
})
|
|
},
|
|
naviTo(e) {
|
|
let id = e.currentTarget.dataset.item.id
|
|
if (id == 0) {
|
|
wx.navigateTo({
|
|
url: '/pages/userMgr/userMgr',
|
|
})
|
|
} else if (id == 1 || id == 2 || id == 3) {
|
|
wx.navigateTo({
|
|
url: '/pages/record/record?id=' + id,
|
|
})
|
|
} else if (id == 5) {
|
|
wx.navigateTo({
|
|
url: '/pages/feedBack/feedBack',
|
|
})
|
|
} else if (id == 4) {
|
|
wx.navigateTo({
|
|
url: '/pages/historicalvisitrecords/historicalvisitrecords',
|
|
})
|
|
}else if(id == 6){
|
|
wx.navigateTo({
|
|
url: '/pages/studentMgr/studentMgr',
|
|
})
|
|
}else if(id == 7){
|
|
wx.navigateTo({
|
|
url: '/pages/kfdjMgr/kfdjMgr',
|
|
})
|
|
}else if(id == 8){
|
|
wx.navigateTo({
|
|
url: '/pages/tjsmMgr/tjsmMgr',
|
|
})
|
|
}
|
|
},
|
|
getPhone() {
|
|
var tel = 18810399133;
|
|
tel = "" + tel;
|
|
var tel1 = tel.substr(0, 3) + "****" + tel.substr(7)
|
|
this.setData({
|
|
phone: tel1
|
|
})
|
|
},
|
|
getList() {
|
|
wx.request({
|
|
url:'https://fy.btlsoln.com:8443/findMessageNotice?openid',
|
|
method: "GET",
|
|
data: {
|
|
openid: app.globalData.openId
|
|
},
|
|
header: {
|
|
'content-type': 'application/json'
|
|
},
|
|
success: (res) => {
|
|
this.setData({
|
|
num: res.data.length
|
|
})
|
|
if (res.data.length > 0) {
|
|
wx.showTabBarRedDot({
|
|
index: 1,
|
|
});
|
|
}else{
|
|
wx.hideTabBarRedDot({
|
|
index: 1,
|
|
})
|
|
}
|
|
|
|
}
|
|
})
|
|
},
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
if (wx.getUserProfile) {
|
|
this.setData({
|
|
isLogin: true
|
|
})
|
|
}
|
|
this.setData({
|
|
hasPer: app.globalData.hasPer
|
|
})
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
if(app.globalData.openId == ''){
|
|
wx.showModal({
|
|
title: '',
|
|
content: '未获取到用户信息,请关闭小程序重新打开!',
|
|
showCancel: false,
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
wx.switchTab({
|
|
url: '/pages/index/index',
|
|
});
|
|
}else{
|
|
wx.switchTab({
|
|
url: '/pages/index/index',
|
|
});
|
|
}
|
|
}
|
|
})
|
|
}
|
|
this.getList()
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
}) |