Commit 794161d0 by liuquan

修改处方笺

parent 1e7d6644
const Service = require('../../utils/service.js'); const config = require("../../utils/config.js");
const Util = require('../../utils/util.js');
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
list: { id:''
status: 3
},
id: '',
iphonex: false,
inquiry_id: '',
time: '',
time1: '',
setInter: '',
type:0
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
var that = this var that = this
that.checkModal();
that.data.id = options.id; that.data.id = options.id;
that.setData({
type:options.type
})
that.data.inquiry_id = Util.isEmpty(options.inquiry_id) ? "" : options.inquiry_id;
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: options.type=='1'?"医生建议":"处方建议" title: options.type=='1'?"医生建议":"处方建议"
}) })
that.getDrugDetail(); let src = config.HOST + '/appIteration.php?s=/Prescription/hfive&id=' + options.id ;
}, this.setData({
/** src: src,
* 生命周期函数--监听页面显示 })
*/
onShow: function () {
var that = this
that.data.setInter = setInterval(function () {
var yourtime = that.data.time;
yourtime = yourtime.replace("-", "/"); //替换字符,变成标准格式
var d2 = new Date(); //取今天的日期
var d1 = new Date(Date.parse(yourtime));
if (d1 > d2) {
that.setData({
time1: that.showtime()
})
} else {
that.setData({
time1: '00:00:00'
})
that.onShow();
clearInterval(that.data.setInter)
}
}, 1000);
},
getDrugDetail() {
let that = this;
var data = {
id: that.data.id,
inquiry_id: that.data.inquiry_id
};
Service.getDrugDetail(data).then((res) => {
if (res.code == 1) {
that.setData({
list: res.data,
id:that.data.id,
inquiry_id: that.data.inquiry_id,
time: res.data.preexpired_time
})
} else {
wx.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success(res) {
if (res.confirm) {
wx.navigateBack({
complete: (res) => {
delta: 1
},
})
}
}
})
}
})
},
showtime: function () {
var nowtime = new Date()
var regs = new RegExp('-', "g")
var newstr = this.data.time.replace(regs, '/')
var endtime = new Date(newstr); //定义结束时间
var lefttime = endtime.getTime() - nowtime.getTime(), //距离结束时间的毫秒数
leftd = Math.floor(lefttime / (1000 * 60 * 60 * 24)), //计算天数
lefth = Math.floor(lefttime / (1000 * 60 * 60) % 24 + leftd * 24), //计算小时数
leftm = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
lefts = Math.floor(lefttime / 1000 % 60); //计算秒数
return (lefth.toString().length == '1' ? "0" + lefth : lefth) + ":" + (leftm.toString().length == '1' ? "0" + leftm : leftm) + ":" + (lefts.toString().length == '1' ? "0" + lefts : lefts) //返回倒计时的字符串
},
putDemand() {
var that = this
wx.navigateTo({
url: '/packageA/drugOrderInfo/drugOrderInfo?scene=' + that.data.id + '&inquiry_id=' + that.data.inquiry_id + "&Pid=1",
})
},
///查看订单
seeOrder: function () {
var that = this
wx.navigateTo({
url: '/packageA/drugOrder/drugOrder?status=' + that.data.list.drug_order_status,
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
clearInterval(this.data.setInter)
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
clearInterval(this.data.setInter)
},
//判断是否是iPhonex
checkModal: function () {
let that = this;
wx.getSystemInfo({
success: (res) => {
// iPhone X iPhone XR iPhone XS Max iPhone XS
if (/^iPhone X.*/i.test(res.model) || /^iPhone XR.*/i.test(res.model) || /^iPhone XS.*/i.test(res.model) || /^iPhone 11*/i.test(res.model) || /^iPhone 11 Pro Max*/i.test(res.model)) {
that.setData({
iPhoneX: true,
})
} else {
that.setData({
iPhoneX: false,
})
}
}
});
}, },
}) })
\ No newline at end of file
<!--pages/prescription/details/details.wxml--> <web-view src="{{src}}"></web-view>
<answer id='answer'></answer> <answer id='answer'></answer>
<view class="wrap" wx:if="{{type==1}}" > \ No newline at end of file
<view class="hd-title">
<view>小懂健康互联网医院</view>
<view>医生建议</view>
</view>
<view class="line1"></view>
<view class="diagnose">
<view class="userinfo">
<view>
<text>姓名</text>
<text>{{list.user_info.name}}</text>
</view>
<view>
<text>性别</text>
<text>{{list.user_info.sex}}</text>
</view>
<view>
<text>年龄</text>
<text>{{list.user_info.age}}</text>
</view>
<view>
<text>科别</text>
<text>便民门诊</text>
</view>
</view>
</view>
<!-- <view class="zdjg">
<view class="zdjg-name">诊断结果</view>
<view class="zdjg-con">{{list.diagnosis}}</view>
</view> -->
<view class="medicine">
<!-- <view class="yaof">
<view class="h6">RP</view>
<view class="yaof-con"></view>
</view> -->
<block wx:for="{{list.prescription}}" wx:key="index">
<view class="flex">
<view class="medicine-list">
<view class="medicine-name">{{item.name}}</view>
<view class="medicine-number">
<text>用法用量:</text>
<text>{{item.usage}}</text>
</view>
<view class="medicine-number" wx:if="{{item.remarks!=''}}">备注:{{item.remarks}}</view>
</view>
<view class="medicine-num">x {{item.num}}</view>
</view>
</block>
</view>
<view class="line2"></view>
<view class="yaoshi">
<view class="yishi">
<text>医师:</text>
<text>{{list.doctor_info}}</text>
</view>
<view class="yishi">
<text>时间:</text>
<text>{{list.create_time}}</text>
</view>
<!-- <view class="yishi">
<text>审核:</text>
<text>栾文娟</text>
</view>
<view class="yishi">
<text>复审:</text>
<text>傅美来</text>
</view> -->
<!-- <image class="img" src="/images/zhang.png"></image> -->
</view>
<!-- <view class="specialTips">
<view>备注</view>
<view>1.本用药建议只限于在本平台或者本平台定点药房使用;</view>
<view>2.本用药建议有效期为24小时,超出有效期作废,请及时购药;</view>
<view>3.用药过程中遇到不适感,请及时联系医生或去医院诊疗。</view>
</view> -->
<!-- <view class="height"></view>
<view class="btns" wx:if="{{list.status!=3}}">
<view class="date2"><image src="/images/sf.png"></image><text>顺丰配送</text><text style="margin-left:20rpx;">闪电发货</text> </view>
<view class="btn" style="" bindtap="putDemand" wx:if='{{list.status==0}}'>立即购药</view>
<view class="btn" style="" bindtap="checkorder" wx:if='{{list.status==1}}'>查看订单</view>
</view> -->
</view>
<view class="wrap" wx:else>
<view class="header" wx:if='{{list.status==0}}'>
<view class="pre">
<view>药师审核通过,请放心购药,处方将在{{time1}}后失效</view>
</view>
</view>
<view class="header" wx:if='{{list.status==1}}'>
<view class="pre">
<view>药师审核通过,购药更放心</view>
</view>
</view>
<view class="header" wx:if='{{list.status==3}}'>
<view class="pre">
<view>处方已超出有效期,若需购买药品,请申请续方</view>
</view>
</view>
<view class="hd-title">
<view>小懂健康互联网医院</view>
<view>{{list.prescription.length>5?'用药建议':'电子处方笺'}}</view>
</view>
<view class="line1"></view>
<view class="diagnose">
<view class="userinfo">
<view>
<text>姓名</text>
<text>{{list.user_info.name}}</text>
</view>
<view>
<text>性别</text>
<text>{{list.user_info.sex}}</text>
</view>
<view>
<text>年龄</text>
<text>{{list.user_info.age}}</text>
</view>
<view>
<text>科别</text>
<text>便民门诊</text>
</view>
</view>
</view>
<view class="zdjg">
<view class="zdjg-name">诊断结果</view>
<view class="zdjg-con">{{list.diagnosis}}</view>
</view>
<view class="medicine">
<view class="yaof">
<view class="h6">RP</view>
<view class="yaof-con"></view>
</view>
<block wx:for="{{list.prescription}}" wx:key="index">
<view class="flex">
<view class="medicine-list">
<view class="medicine-name">{{item.name}}</view>
<view class="medicine-number">
<text>用法用量:</text>
<text>{{item.usage}}</text>
</view>
<view class="medicine-number" wx:if="{{item.remarks!=''}}">备注:{{item.remarks}}</view>
</view>
<view class="medicine-num">x {{item.num}}</view>
</view>
</block>
</view>
<view class="line2"></view>
<view class="yaoshi">
<view class="yishi">
<text>医师:</text>
<text>{{list.doctor_info}}</text>
</view>
<view class="yishi">
<text>审核:</text>
<text>欧兆智</text>
</view>
<!-- <view class="yishi">
<text>复审:</text>
<text>傅美来</text>
</view> -->
<image class="img" src="/images/zhang.png"></image>
</view>
<view class="specialTips">
<view>备注</view>
<view>1.本处方只限于在本平台或者本平台定点药房使用;</view>
<view>2.本处方有效期为24小时,超出有效期处方作废,请及时购药;</view>
<view>3.用药过程中遇到不适感,请及时联系医生或去医院诊疗。</view>
</view>
<!-- <view class="height"></view>
<view class="btns" wx:if="{{list.status!=3}}">
<view class="date2"><image src="/images/sf.png"></image><text>顺丰配送</text><text style="margin-left:20rpx;">闪电发货</text> </view>
<view class="btn" style="" bindtap="putDemand" wx:if='{{list.status==0}}'>立即购药</view>
<view class="btn" style="" bindtap="checkorder" wx:if='{{list.status==1}}'>查看订单</view>
</view> -->
</view>
\ No newline at end of file
page{ page{
width: 100%; width: 100%;
background: rgb(249, 249, 249) background: rgb(249, 249, 249)
}
.wrap{
position: absolute;
width: 100%;
min-height: 100%;
top: 0;
left: 0;
background: #fff;
}
.header{
width: 100%;
height: 80rpx;
background: rgb(253, 247, 231);
display: flex;
align-items: center;
}
.header1{
width: 100%;
height: 154rpx;
background: #626775;
}
.header2{
width: 100%;
height: 154rpx;
background: #79BF40;
}
.pre{
display: flex;
align-items: center;
}
.pre i{
display: inline-block;
width: 26rpx;
height: 32rpx;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAgCAYAAAAMq2gFAAAAsklEQVRIS+2X0Q3CIBRF753AVRyhbmQnqSO5gY7iBrehBdM0EoHA6wflk8A74XIgQEkXAFcAT7RpA4A3Jb08qA1mrbqA5AkPkmNNmqQJwN3V/IJIsiYk1AoL6QDkLXQGfkjeNhE4O5P7/0ZnBqotREcymEW3uSmymLEDH90jM1DWMhIGn9YlhPR7SHUZ9phg4fGg4owiE0/rihM9XobSuy5b7+KM+rUOQPMnsdkj3+TbMgPryitw4WiWkwAAAABJRU5ErkJggg==);
background-size: auto 100%;
}
.pre view{
margin-left: 30rpx;
font-size: 25rpx;
font-weight: 500;
color: #666;
}
.date{
font-size: 24rpx;
color: #fff;
margin-left: 72rpx;
}
.hd-title{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
margin-top: 60rpx;
}
.hd-title>view{
font-size: 46rpx;
font-weight: 500;
}
.kf-date{
display: flex;
font-size:28rpx;
color: #999;
width: 690rpx;
margin-left: 30rpx;
}
.line1{
width: 690rpx;
height: 3rpx;
border-top: 3rpx solid #333333;
border-bottom: 1rpx solid #999999;
margin-top: 35rpx;
margin-left: 30rpx;
}
.diagnose{
width: 690rpx;
margin-left: 30rpx;
padding:38rpx 0rpx;
background: #ffffff;
border-bottom: 1rpx solid #999;
}
.userinfo{
display: flex;
flex-wrap: wrap;
}
.userinfo>view{
margin-bottom: 10rpx;
}
.userinfo>view>text:first-child{
font-size: 26rpx;
color: #999;
}
.userinfo>view>text:last-child{
margin-left: 20rpx;
margin-right: 20rpx;
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.zdjg{
width: 690rpx;
margin-left: 30rpx;
padding-bottom: 40rpx;
border-bottom: 2rpx dashed rgb(216, 215, 215);
}
.zdjg-name{
margin-top: 30rpx;
color: #999;
}
.zdjg-con{
margin-top: 28rpx;
font-weight: 600;
color: #333;
font-size: 32rpx;
}
.yaof{
display: flex;
margin-left: 30rpx;
margin-top: 30rpx;
}
.medicine .h6{
display: block;
font-size: 40rpx;
width: 60rpx;
height: 60rpx;
font-weight: 500;
line-height: 60rpx;
text-align: center;
border-radius: 50%;
color: #fff;
background: rgb(102,102,102);
}
.yaof-con{
margin-left: 20rpx;
}
.flex{
display: flex;
justify-content: space-between;
margin: 0 60rpx 0 30rpx;
}
.medicine-list{
padding:30rpx 0 30rpx 0;
}
.medicine-name{
font-size: 30rpx;
color: #333333;
font-weight: 600;
}
.medicine-number{
display: flex;
font-size: 24rpx;
color: #999999;
margin-top: 16rpx;
}
.medicine-number>text:last-child{
display: block;
width: 450rpx;
}
.medicine-num{
margin-top: 32rpx;
font-size: 26rpx;
}
.line2{
width: 690rpx;
height: 3rpx;
border-bottom: 2rpx solid #333333;
border-top: 1rpx solid #999999;
margin-top: 35rpx;
margin-left: 30rpx;
}
.yaoshi{
display: flex;
flex-wrap: wrap;
width: 690rpx;
margin-left: 30rpx;
border-bottom: 2rpx dashed rgb(216, 215, 215);
padding-bottom: 40rpx;
}
.yishi{
font-size: 27rpx;
margin-right: 20rpx;
margin-top: 40rpx;
}
.yishi>text:first-child{
color: #999;
}
.yishi>text:last-child{
color: #000;
}
.specialTips{
font-size: 25rpx;
padding:30rpx 30rpx 80rpx 30rpx;
color: #999;
}
.specialTips :nth-child(1){
margin-bottom: 10rpx;
}
.specialTips :nth-child(2){
margin-bottom: 10rpx;
}
.specialTips :nth-child(3){
margin-bottom: 10rpx;
}
.height{
width: 100%;
height: 240rpx;
background: rgb(249, 249, 249)
}
.btns{
width: 100%;
height: 270rpx;
background: #fff;
position: fixed;
bottom: 0;
cursor:pointer;
display: flex;
flex-direction: column;
align-items: center;
box-shadow: 0px 0px 1px #ccc;
}
.date2{
margin-top: 20rpx;
font-size: 30rpx;
color: #666;
display: flex;
align-items: center;
font-weight: 500;
}
.date2>image{
margin-right: 15rpx;
width: 36rpx;
height: 36rpx;
}
.btn{
width: 690rpx;
border-radius: 50rpx;
height: 100rpx;
line-height: 100rpx;
color: #ffffff;
font-size: 34rpx;
background: #2684FF;
text-align: center;
margin-top: 20rpx;
margin-bottom: 30rpx;
}
.img{
width: 260rpx;
height: 260rpx;
position: absolute;
margin-left: 400rpx;
margin-top: -100rpx;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment