Commit 6b06d97c by liuquan

F:修改处方笺页面为webview页面

U:新增用户购药页订阅消息提醒
parent 794161d0
...@@ -1022,34 +1022,34 @@ Page({ ...@@ -1022,34 +1022,34 @@ Page({
}); });
}).then((imResponse) => { }).then((imResponse) => {
console.log("%c第一次拉取消息列表", "color:#04BE02", imResponse) console.log("%c第一次拉取消息列表", "color:#04BE02", imResponse)
// let msgList = Util.deepClone(imResponse.data.messageList); let msgList = Util.deepClone(imResponse.data.messageList);
// let messageList = that.messageListParser(msgList); let messageList = that.messageListParser(msgList);
// let length = Number(messageList.length - 1); let length = Number(messageList.length - 1);
// console.log("length", length) console.log("length", length)
// if (length >= 0) { if (length >= 0) {
// that.data.lastShowTimeStamp = messageList[length].time; that.data.lastShowTimeStamp = messageList[length].time;
// console.log("messageList[length].payload.data", messageList[length].payload.data) console.log("messageList[length].payload.data", messageList[length].payload.data)
// if (messageList[length].payload.data == "InitiateEndService") { if (messageList[length].payload.data == "InitiateEndService") {
// wx.showModal({ wx.showModal({
// title: '提示', title: '提示',
// content: '对方发起了一个结束当前服务的请求', content: '对方发起了一个结束当前服务的请求',
// success(res) { success(res) {
// if (res.confirm) { if (res.confirm) {
// that.endInquiry(0); that.endInquiry(0);
// that.userPayList(that.data.orderId ? that.data.orderId : ''); that.userPayList(that.data.orderId ? that.data.orderId : '');
// } else if (res.cancel) { } else if (res.cancel) {
// that.endInquiry(1); that.endInquiry(1);
// that.userPayList(that.data.orderId ? that.data.orderId : ''); that.userPayList(that.data.orderId ? that.data.orderId : '');
// } }
// } }
// }) })
// } }
// } }
// that.setData({ that.setData({
// messageList: that.showTimestamp(messageList), // 消息列表。 messageList: that.showTimestamp(messageList), // 消息列表。
// nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。 nextReqMessageID: imResponse.data.nextReqMessageID, // 用于续拉,分页续拉时需传入该字段。
// isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。 isCompleted: imResponse.data.isCompleted // 表示是否已经拉完所有消息。
// }) })
//延时500ms避免scroll-view的防止抖动生效 //延时500ms避免scroll-view的防止抖动生效
setTimeout(() => { setTimeout(() => {
that.scrollToBottom(); //使滑动条到最底部 that.scrollToBottom(); //使滑动条到最底部
...@@ -1545,9 +1545,10 @@ Page({ ...@@ -1545,9 +1545,10 @@ Page({
console.log('message',message) console.log('message',message)
let msg = Util.deepClone(message); let msg = Util.deepClone(message);
that.unsentMessageInsert(msg); that.unsentMessageInsert(msg);
Tim.createCustomMessage(message).then((imResponse) => { Tim.createCustomMessage(message).then((imMessage) => {
console.log("%c报告消息发送成功", "color:#04BE02", imResponse) 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.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.description = JSON.parse(imResponse.data.message.payload.data.content);
imResponse.data.message.payload.data = imResponse.data.message.payload.data.type; imResponse.data.message.payload.data = imResponse.data.message.payload.data.type;
......
...@@ -26,7 +26,8 @@ Page({ ...@@ -26,7 +26,8 @@ Page({
value: '0' value: '0'
}], }],
isInvoice: -1, //是否开具发票 isInvoice: -1, //是否开具发票
isBtnAsh: true //支付按钮置灰 isBtnAsh: true, //支付按钮置灰
remind:false//订阅消息
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
...@@ -49,6 +50,7 @@ Page({ ...@@ -49,6 +50,7 @@ Page({
} }
console.log("options", options) console.log("options", options)
that.data.options = options that.data.options = options
that.getSetting();
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
...@@ -58,6 +60,7 @@ Page({ ...@@ -58,6 +60,7 @@ Page({
that.login = that.selectComponent("#login"); that.login = that.selectComponent("#login");
that.modal = that.selectComponent("#modal"); that.modal = that.selectComponent("#modal");
that.answer = that.selectComponent("#answer"); that.answer = that.selectComponent("#answer");
if (wx.getStorageSync('data').unionid == undefined || wx.getStorageSync('data').unionid == '') { if (wx.getStorageSync('data').unionid == undefined || wx.getStorageSync('data').unionid == '') {
wx.login({ wx.login({
success: function (msg) { success: function (msg) {
...@@ -255,6 +258,49 @@ Page({ ...@@ -255,6 +258,49 @@ Page({
agree: agree 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() { gosite() {
wx.navigateTo({ wx.navigateTo({
......
...@@ -131,6 +131,14 @@ ...@@ -131,6 +131,14 @@
</view> </view>
<view wx:if="{{iPhoneX}}" class="height"></view> <view wx:if="{{iPhoneX}}" class="height"></view>
</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="three-wrap" style="height:{{iPhoneX?160:100}}rpx;">
<view class="flex-zf"> <view class="flex-zf">
......
...@@ -52,6 +52,58 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { ...@@ -52,6 +52,58 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
justify-content: space-between; 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 { .wrap {
position: absolute; position: absolute;
width: 100%; 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