init version kelfy-mini for new gitea
This commit is contained in:
231
pages/departmentMsg/departmentMsg.js
Normal file
231
pages/departmentMsg/departmentMsg.js
Normal file
@@ -0,0 +1,231 @@
|
||||
// pages/departmentMsg/departmentMsg.js
|
||||
// pages/articleDetails/articleDetails.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
minDate: '',
|
||||
maxDate: '',
|
||||
defaultDate: '',
|
||||
|
||||
selectDate: '',
|
||||
selectDept: '',
|
||||
|
||||
doctorList: [],
|
||||
|
||||
},
|
||||
// getWeek(date) {
|
||||
// let myDate = new Date(date);
|
||||
// let wk = myDate.getDay();
|
||||
// let yy = String(myDate.getFullYear());
|
||||
// let mm = myDate.getMonth() + 1;
|
||||
// let dd = String(
|
||||
// myDate.getDate() < 10 ? "0" + myDate.getDate() : myDate.getDate()
|
||||
// );
|
||||
// let hou = String(
|
||||
// myDate.getHours() < 10 ? "0" + myDate.getHours() : myDate.getHours()
|
||||
// );
|
||||
// let min = String(
|
||||
// myDate.getMinutes() < 10 ?
|
||||
// "0" + myDate.getMinutes() :
|
||||
// myDate.getMinutes()
|
||||
// );
|
||||
// let sec = String(
|
||||
// myDate.getSeconds() < 10 ?
|
||||
// "0" + myDate.getSeconds() :
|
||||
// myDate.getSeconds()
|
||||
// );
|
||||
// let weeks = [
|
||||
// "周日",
|
||||
// "周一",
|
||||
// "周二",
|
||||
// "周三",
|
||||
// "周四",
|
||||
// "周五",
|
||||
// "周六"
|
||||
// ];
|
||||
// let week = weeks[wk];
|
||||
// let nowDate;
|
||||
// let nowTime;
|
||||
// let nowWeek;
|
||||
// nowDate = yy + "-" + mm + "-" + dd;
|
||||
// nowTime = hou + ":" + min + ":" + sec;
|
||||
// nowWeek = week;
|
||||
// return week;
|
||||
// },
|
||||
formatDate(date) {
|
||||
date = new Date(date);
|
||||
let year = date.getFullYear(); //年
|
||||
let month = date.getMonth() + 1; //月
|
||||
let day = date.getDate(); //天数
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = `0${month}`;
|
||||
}
|
||||
if (day >= 1 && day <= 9) {
|
||||
day = `0${day}`;
|
||||
}
|
||||
return `${year}${month}${day}`;
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.setData({
|
||||
doctorList:[]
|
||||
})
|
||||
let str = this.formatDate(e.detail)
|
||||
this.setData({
|
||||
selectDate:str
|
||||
})
|
||||
wx.request({
|
||||
url: 'https://fy.btlsoln.com:8443/booking/getDoctorList?selectDate&selectKsdm',
|
||||
method: "GET",
|
||||
data: {
|
||||
selectDate: str,
|
||||
selectKsdm: this.data.selectDept
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
// console.log(res, "获取医生信息")
|
||||
this.setData({
|
||||
doctorList: res.data.list
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
initData() {
|
||||
this.setData({
|
||||
doctorList:[]
|
||||
})
|
||||
var today= new Date()
|
||||
let str = this.formatDate(today)
|
||||
this.setData({
|
||||
selectDate:str
|
||||
})
|
||||
wx.request({
|
||||
url: 'https://fy.btlsoln.com:8443/booking/getDoctorList?selectDate&selectKsdm',
|
||||
method: "GET",
|
||||
data: {
|
||||
selectDate: str,
|
||||
selectKsdm: this.data.selectDept
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
this.setData({
|
||||
doctorList: res.data.list
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
navigateToBooking(e){
|
||||
console.log(e)
|
||||
let a = e.currentTarget.dataset.item
|
||||
a.selectDate = this.data.selectDate
|
||||
wx.navigateTo({
|
||||
url: `/pages/bookingDetails/bookingDetails?item=${JSON.stringify(a)}`,
|
||||
})
|
||||
},
|
||||
// naviToyy(e) {
|
||||
// let pbmxid = e.currentTarget.dataset.item.pbmxid
|
||||
// let day = e.currentTarget.dataset.item.zxrq
|
||||
// let week = e.currentTarget.dataset.item.weekday
|
||||
// let date = e.currentTarget.dataset.item.kssj
|
||||
// let date2 = e.currentTarget.dataset.item.jssj
|
||||
// let zxrq = e.currentTarget.dataset.item.zxrq
|
||||
// let ksmc = this.data.ksmc
|
||||
// let ksdm = this.data.ksdm
|
||||
// let num = e.currentTarget.dataset.item.ghf + e.currentTarget.dataset.item.zlf
|
||||
// let today = this.data.today
|
||||
// var t1 = this.data.t1
|
||||
// var t2 = this.data.t2
|
||||
// if ((t2 - t1) / (24 * 3600 * 1000) > 30) {
|
||||
// wx.showToast({
|
||||
// title: '暂未开放预约',
|
||||
// icon: "error"
|
||||
// })
|
||||
// } else {
|
||||
// wx.navigateTo({
|
||||
// url: '/pages/confirmation/confirmation?pbmxid=' + pbmxid + '&day=' + day + '&week=' + week + '&date=' + date + '&ksmc=' + ksmc + '&num=' + num + '&ksdm=' + ksdm + '&today=' + today + '&date2=' + date2 + '&zxrq=' + zxrq,
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
this.setData({
|
||||
selectDept: options.deptId
|
||||
})
|
||||
this.initData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
var today = new Date(new Date().setHours(0, 0, 0, 0))
|
||||
var todayTime = new Date(new Date().setHours(0, 0, 0, 0))
|
||||
var weekend = today.setDate(today.getDate() + 6)
|
||||
this.setData({
|
||||
minDate: todayTime.valueOf(),
|
||||
maxDate: weekend,
|
||||
defaultDate: todayTime.valueOf()
|
||||
})
|
||||
// this.setData({
|
||||
// days:[this.getDays(0).substr(8,2), this.getDays(1).substr(8,2), this.getDays(2).substr(8,2), this.getDays(3).substr(8,2), this.getDays(4).substr(8,2), this.getDays(5).substr(8,2), this.getDays(6).substr(8,2)],
|
||||
// weeks:[this.getWeek(this.getDays(0)), this.getWeek(this.getDays(1)), this.getWeek(this.getDays(2)),
|
||||
// this.getWeek(this.getDays(3)), this.getWeek(this.getDays(4)), this.getWeek(this.getDays(5)), this.getWeek(this.getDays(6))
|
||||
// ],
|
||||
// today:this.getDays(0)
|
||||
// })
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
// console.log(this.data.ksdm,"ksdm")
|
||||
// let ksdm = this.data.ksdm
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
5
pages/departmentMsg/departmentMsg.json
Normal file
5
pages/departmentMsg/departmentMsg.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"van-calendar": "@vant/weapp/calendar/index"
|
||||
}
|
||||
}
|
||||
17
pages/departmentMsg/departmentMsg.wxml
Normal file
17
pages/departmentMsg/departmentMsg.wxml
Normal file
@@ -0,0 +1,17 @@
|
||||
<!--pages/departmentMsg/departmentMsg.wxml-->
|
||||
<view class="main">
|
||||
<view class="content">
|
||||
<!-- <view class="item"> -->
|
||||
<van-calendar tyep="single" poppable="{{ false }}" show-confirm="{{ false }}" default-date="{{defaultDate}}" color="#07c160" class="calendar" min-date="{{minDate}}" max-date="{{maxDate}}" bind:select="onConfirm" />
|
||||
<scroll-view style='height:100%' scroll-y="true">
|
||||
<van-cell-group inset wx:for="{{doctorList}}">
|
||||
<van-cell label-class="textHidden" value="{{item.doctorzc}}" label="{{item.introduction}}" is-link center data-item="{{item}}" bindtap="navigateToBooking" >
|
||||
<view slot="title" class="name_title">
|
||||
<van-image width='50' height='60' round src="{{item.imageUrl}}"></van-image>
|
||||
<view>{{item.ysmc}}</view>
|
||||
</view>
|
||||
</van-cell>
|
||||
</van-cell-group>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
170
pages/departmentMsg/departmentMsg.wxss
Normal file
170
pages/departmentMsg/departmentMsg.wxss
Normal file
@@ -0,0 +1,170 @@
|
||||
/* pages/departmentMsg/departmentMsg.wxss */
|
||||
.banner {
|
||||
margin: 30rpx 0;
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.content {
|
||||
height: 100%;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.item {
|
||||
height: 300rpx;
|
||||
width: 95%;
|
||||
border-radius: 5rpx;
|
||||
margin: 40rpx auto;
|
||||
box-shadow: 0px 0px 15rpx #e2e2e2;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.weeks {
|
||||
height: 120rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.item1 {
|
||||
height: 120rpx;
|
||||
width: 14%;
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
line-height: 120rpx;
|
||||
}
|
||||
|
||||
.days {
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.item2 {
|
||||
padding: 20rpx;
|
||||
font-size: 32rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
background: rgba(229, 241, 255);
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.active {
|
||||
background: rgba(0, 110, 255);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.listWrap {
|
||||
height: 100%;
|
||||
width: 95%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.item3 {
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0px 0px 15rpx #e2e2e2;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.zw {
|
||||
height: 150rpx;
|
||||
width: 100%;
|
||||
border-radius: 5rpx;
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0px 0px 15rpx #e2e2e2;
|
||||
padding: 0 20rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #666;
|
||||
font-size: 35rpx;
|
||||
}
|
||||
|
||||
.date {
|
||||
width: 40%;
|
||||
color: #333;
|
||||
font-size: 38rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
|
||||
.je {
|
||||
width: 35%;
|
||||
color: rgba(198, 36, 29);
|
||||
}
|
||||
|
||||
.yyNum {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: rgba(0, 110, 255);
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
padding: 5px;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.ml {
|
||||
margin-left: 5rpx;
|
||||
}
|
||||
|
||||
.yyNum2 {
|
||||
width: 25%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background: rgba(242, 242, 242);
|
||||
color: #666666;
|
||||
font-size: 32rpx;
|
||||
padding: 5px;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.calendar {
|
||||
--calendar-height: 830rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.textHidden {
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
/*超出隐藏*/
|
||||
text-overflow: ellipsis;
|
||||
/*隐藏后添加省略号*/
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
/*想显示多少行*/
|
||||
}
|
||||
|
||||
.name_title {
|
||||
width: 35vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.titleClass {
|
||||
display: -webkit-box;
|
||||
overflow: visible;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
/*想显示多少行*/
|
||||
}
|
||||
Reference in New Issue
Block a user