Commit 89dee7c8 by liuquan

合并分支 'test' 到 'XDJK-master'

feature.recipe.v3.2.11.20210609.liuquan

查看合并请求 !19
parents b49c4963 9660b33c
......@@ -1022,34 +1022,34 @@ Page({
});
}).then((imResponse) => {
console.log("%c第一次拉取消息列表", "color:#04BE02", imResponse)
// let msgList = Util.deepClone(imResponse.data.messageList);
// let messageList = that.messageListParser(msgList);
// let length = Number(messageList.length - 1);
// console.log("length", length)
// if (length >= 0) {
// that.data.lastShowTimeStamp = messageList[length].time;
// console.log("messageList[length].payload.data", messageList[length].payload.data)
// if (messageList[length].payload.data == "InitiateEndService") {
// wx.showModal({
// title: '提示',
// content: '对方发起了一个结束当前服务的请求',
// success(res) {
// if (res.confirm) {
// that.endInquiry(0);
// that.userPayList(that.data.orderId ? that.data.orderId : '');
// } else if (res.cancel) {
// that.endInquiry(1);
// that.userPayList(that.data.orderId ? that.data.orderId : '');
// }
// }
// })
// }
// }
// that.setData({
// messageList: that.showTimestamp(messageList), // 消息列表。
// nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。
// isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。
// })
let msgList = Util.deepClone(imResponse.data.messageList);
let messageList = that.messageListParser(msgList);
let length = Number(messageList.length - 1);
console.log("length", length)
if (length >= 0) {
that.data.lastShowTimeStamp = messageList[length].time;
console.log("messageList[length].payload.data", messageList[length].payload.data)
if (messageList[length].payload.data == "InitiateEndService") {
wx.showModal({
title: '提示',
content: '对方发起了一个结束当前服务的请求',
success(res) {
if (res.confirm) {
that.endInquiry(0);
that.userPayList(that.data.orderId ? that.data.orderId : '');
} else if (res.cancel) {
that.endInquiry(1);
that.userPayList(that.data.orderId ? that.data.orderId : '');
}
}
})
}
}
that.setData({
messageList: that.showTimestamp(messageList), // 消息列表。
nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。
isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。
})
//延时500ms避免scroll-view的防止抖动生效
setTimeout(() => {
that.scrollToBottom(); //使滑动条到最底部
......@@ -1545,9 +1545,10 @@ Page({
console.log('message',message)
let msg = Util.deepClone(message);
that.unsentMessageInsert(msg);
Tim.createCustomMessage(message).then((imResponse) => {
console.log("%c报告消息发送成功", "color:#04BE02", imResponse)
Tim.createCustomMessage(message).then((imMessage) => {
console.log("%c报告消息发送成功", "color:#04BE02", imMessage)
//插入新消息删除待发消息
let imResponse=Util.deepClone(imMessage);
imResponse.data.message.payload.data = JSON.parse(imResponse.data.message.payload.data);
imResponse.data.message.payload.description = JSON.parse(imResponse.data.message.payload.data.content);
imResponse.data.message.payload.data = imResponse.data.message.payload.data.type;
......
const Service = require('../../utils/service.js');
const Util = require('../../utils/util.js');
const config = require("../../utils/config.js");
Page({
/**
* 页面的初始数据
*/
data: {
list: {
status: 3
},
id: '',
iphonex: false,
inquiry_id: '',
time: '',
time1: '',
setInter: '',
type:0
id:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
var that = this
that.checkModal();
that.data.id = options.id;
that.setData({
type:options.type
})
that.data.inquiry_id = Util.isEmpty(options.inquiry_id) ? "" : options.inquiry_id;
wx.setNavigationBarTitle({
title: options.type=='1'?"医生建议":"处方建议"
})
that.getDrugDetail();
},
/**
* 生命周期函数--监听页面显示
*/
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,
})
}
}
});
let src = config.HOST + '/appIteration.php?s=/Prescription/hfive&id=' + options.id ;
this.setData({
src: src,
})
},
})
\ No newline at end of file
<!--pages/prescription/details/details.wxml-->
<answer id='answer'></answer>
<view class="wrap" wx:if="{{type==1}}" >
<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
<web-view src="{{src}}"></web-view>
<answer id='answer'></answer>
\ No newline at end of file
page{
width: 100%;
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
......@@ -26,7 +26,8 @@ Page({
value: '0'
}],
isInvoice: -1, //是否开具发票
isBtnAsh: true //支付按钮置灰
isBtnAsh: true, //支付按钮置灰
remind:false//订阅消息
},
/**
* 生命周期函数--监听页面加载
......@@ -49,6 +50,7 @@ Page({
}
console.log("options", options)
that.data.options = options
that.getSetting();
},
/**
* 生命周期函数--监听页面显示
......@@ -58,6 +60,7 @@ Page({
that.login = that.selectComponent("#login");
that.modal = that.selectComponent("#modal");
that.answer = that.selectComponent("#answer");
if (wx.getStorageSync('data').unionid == undefined || wx.getStorageSync('data').unionid == '') {
wx.login({
success: function (msg) {
......@@ -255,6 +258,49 @@ Page({
agree: agree
})
},
/**
* 查询是否接收订阅消息
*/
getSetting: function () {
let that = this;
wx.getSetting({
withSubscriptions: true,
success(res) {
let itemSettings = !Util.isEmpty(res.subscriptionsSetting) ? res.subscriptionsSetting.itemSettings : "";
console.log('itemSettings', res, itemSettings)
if (itemSettings) {
if (itemSettings['FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'] == 'accept' ) {
that.setData({
remind: false
});
} else {
that.setData({
remind: true
});
}
} else {
that.setData({
remind: true
});
}
}
})
},
/**
* 提示允许接收订阅消息
*/
remind: function () {
var that = this;
that.setData({
remind: false
})
wx.requestSubscribeMessage({
tmplIds: ['FfvTlT9HNBt1zHNWKYUBs5dJ5n-bG7bcVpPcVZrH8jk'],
success(res) {
console.log('requestSubscribeMessage', res)
}
})
},
//选择地址
gosite() {
wx.navigateTo({
......
......@@ -131,6 +131,14 @@
</view>
<view wx:if="{{iPhoneX}}" class="height"></view>
</view>
<!-- 订阅消息 -->
<view class='warp-up1' wx:if="{{remind}}">
<view class='remind'>
<view class="remind-title">请允许接收订阅消息</view>
<view class="remind-text">为了及时的告知您医生生成处方提醒,请允许接收消息。</view>
<button class="remind-btn" bindtap="remind">我知道了</button>
</view>
</view>
<!-- 微信支付 -->
<view class="three-wrap" style="height:{{iPhoneX?160:100}}rpx;">
<view class="flex-zf">
......
......@@ -52,6 +52,58 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
justify-content: space-between;
}
.warp-up1 {
display: block;
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 1001;
}
.remind {
width: 100%;
height: 540rpx;
background: #ffffff;
border-radius: 30rpx 30rpx 0 0;
position: absolute;
bottom: 0;
left: 0;
text-align: center;
}
.remind-title {
font-size: 50rpx;
font-weight: bold;
color: #000000;
letter-spacing: 2rpx;
margin-top: 84rpx;
margin-bottom: 50rpx;
}
.remind-text {
width: 618rpx;
font-size: 32rpx;
margin: 0 auto;
font-weight: 400;
text-align: left;
color: #555;
line-height: 46rpx;
letter-spacing: 2rpx;
}
.remind-btn {
width: 620rpx;
height: 88rpx;
line-height: 88rpx;
background: #2684ff;
border-radius: 10rpx;
margin: 0 auto;
margin-top: 50rpx;
}
.wrap {
position: absolute;
width: 100%;
......
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