This commit is contained in:
haomingming 2023-06-26 18:12:28 +08:00
parent 70dca249c3
commit 6d442f7563
12 changed files with 126 additions and 14 deletions

View File

@ -3,19 +3,19 @@
<view class="list"> <view class="list">
<view class="item" wx:for="{{list}}" bindtap="go" data-item="{{item}}"> <view class="item" wx:for="{{list}}" bindtap="go" data-item="{{item}}">
<view class="item_top"> <view class="item_top">
<view class="item_img" wx:if="{{item.link_params.inquiry_type == 1}}"> <view class="item_img" wx:if="{{item.inquiry_type == 1}}">
<text style="margin-left: 10rpx;">在线问诊</text> <text style="margin-left: 10rpx;">在线问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/online.png" fit="heightFix" height="54rpx" aria-label="qrcode" /> <van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/online.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view> </view>
<view class="item_img" wx:if="{{item.link_params.inquiry_type == 2}}"> <view class="item_img" wx:if="{{item.inquiry_type == 2}}">
<text style="margin-left: 10rpx;">快速问诊</text> <text style="margin-left: 10rpx;">快速问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/kuaisu.png" fit="heightFix" height="54rpx" aria-label="qrcode" /> <van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/kuaisu.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view> </view>
<view class="item_img" wx:if="{{item.link_params.inquiry_type == 3}}"> <view class="item_img" wx:if="{{item.inquiry_type == 3}}">
<text style="margin-left: 10rpx;">公益问诊</text> <text style="margin-left: 10rpx;">公益问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/yizhen.png" fit="heightFix" height="54rpx" aria-label="qrcode" /> <van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/yizhen.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view> </view>
<view class="item_img" wx:if="{{item.link_params.inquiry_type == 4}}"> <view class="item_img" wx:if="{{item.inquiry_type == 4}}">
<text style="margin-left: 10rpx;">问诊购药</text> <text style="margin-left: 10rpx;">问诊购药</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/drug.png" fit="heightFix" height="54rpx" aria-label="qrcode" /> <van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/drug.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view> </view>

View File

@ -0,0 +1,23 @@
// TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"t-message": "tdesign-miniprogram/message/message"
}
}

View File

@ -0,0 +1,4 @@
<!--TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxml-->
<view>
<t-message id="t-message" />
</view>

View File

@ -0,0 +1 @@
/* TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss */

View File

@ -131,9 +131,9 @@ Component({
return renderDom; return renderDom;
} }
//8:消息内页横条(患者->医生) //8:消息内页横条(患者->医生)
if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.TRABECULA_PATIENT) { if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.BANNER_MESSAGE) {
const renderDom = [{ const renderDom = [{
type: 'trabecula_patient', type: 'banner_message',
title: customMessage.title, title: customMessage.title,
desc: customMessage.desc, desc: customMessage.desc,
}]; }];

View File

@ -45,7 +45,7 @@
<view class="gdxz_custom_message_title">{{renderDom[0].title}}</view> <view class="gdxz_custom_message_title">{{renderDom[0].title}}</view>
<view class="gdxz_custom_message_desc">{{renderDom[0].desc}}</view> <view class="gdxz_custom_message_desc">{{renderDom[0].desc}}</view>
</view> </view>
<!-- <view wx:if="{{renderDom[0].type==='trabecula_patient'}}" class="gdxz_custom_trabecula_message"> <!-- <view wx:if="{{renderDom[0].type==='banner_message'}}" class="gdxz_custom_trabecula_message">
<view class="gdxz_custom_message_title">{{renderDom[0].title}}</view> <view class="gdxz_custom_message_title">{{renderDom[0].title}}</view>
<view class="gdxz_custom_message_desc">{{renderDom[0].desc}}</view> <view class="gdxz_custom_message_desc">{{renderDom[0].desc}}</view>
</view> --> </view> -->

View File

@ -2,6 +2,8 @@ import logger from '../../../../utils/logger';
import constant from '../../../../utils/constant'; import constant from '../../../../utils/constant';
import { wechatTimeFormat } from './../../../../../utils/wechatTime' import { wechatTimeFormat } from './../../../../../utils/wechatTime'
import { API } from '../../../../../utils/network/api'; import { API } from '../../../../../utils/network/api';
import Message from 'tdesign-miniprogram/message/index';
const { GDXZ_CUSTOM_MSEEAGE } = constant; const { GDXZ_CUSTOM_MSEEAGE } = constant;
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
const app = getApp(); const app = getApp();
@ -233,6 +235,64 @@ Component({
}); });
} }
}, },
//检测是不是横幅消息
checkNoticeMessage(message){
console.log("messageList checkNoticeMessage message: ", message);
let cloudCustomData = "";
let cloudCustomDataJson = "";
if(message.cloudCustomData){
cloudCustomData = message.cloudCustomData;
}
if(cloudCustomData){
cloudCustomDataJson = JSON.parse(cloudCustomData);
}
let is_system = cloudCustomDataJson.is_system;
if(is_system != 1){//不是系统消息直接返回
return false
}
let payload = message.payload.data;
if(!payload){//没有payload
return false
}
const payloadData = JSON.parse(message.payload.data);
if(!payloadData){
return false
}
const { GDXZ_CUSTOM_MSEEAGE } = constant;
let message_type = payloadData.message_type
if (message_type === GDXZ_CUSTOM_MSEEAGE.BANNER_MESSAGE) {
let message_title = payloadData.title
let message_desc = payloadData.desc
let message_path = payloadData.data.message_path
this.setData({
message_title: message_title,
message_desc: message_desc,
message_path: message_path,
})
this.showTextMessage()
}
},
showTextMessage() {
Message.info({
context: this,
offset: [80, 20],
duration: 5000,
icon: false,
closeBtn: true,
});
wx.vibrateShort({
"type": "light"
})
},
handleMessagePath(){
console.log("handleMessagePath")
let url = this.data.message_path
console.log(url)
wx.switchTab({
url: url,
})
},
refreshMessageRounds(message){ refreshMessageRounds(message){
try { try {
// console.log("messageList refreshMessageRounds message: ", message); // console.log("messageList refreshMessageRounds message: ", message);
@ -364,6 +424,8 @@ Component({
let autoToButtom = this.data.autoToButtom; let autoToButtom = this.data.autoToButtom;
// console.log("autoToButtom:", autoToButtom) // console.log("autoToButtom:", autoToButtom)
const message = value.data[0]; const message = value.data[0];
//检测是不是横幅消息
this.checkNoticeMessage(message)
//更新会话数 //更新会话数
this.refreshMessageRounds(message) this.refreshMessageRounds(message)
if(message.flow == 'out'){ if(message.flow == 'out'){
@ -556,6 +618,7 @@ Component({
wx.vibrateShort({ wx.vibrateShort({
"type": "heavy" "type": "heavy"
}) })
// } // }
// } // }
}, },

View File

@ -14,6 +14,7 @@
"MergerMessage": "../MessageElements/MergerMessage/index", "MergerMessage": "../MessageElements/MergerMessage/index",
"RevokeMessage": "../MessageElements/RevokeMessage/index", "RevokeMessage": "../MessageElements/RevokeMessage/index",
"van-loading": "@vant/weapp/loading/index", "van-loading": "@vant/weapp/loading/index",
"van-icon": "@vant/weapp/icon/index" "van-icon": "@vant/weapp/icon/index",
"t-message": "tdesign-miniprogram/message/message"
} }
} }

View File

@ -80,13 +80,19 @@
</view> </view>
<view wx:if="{{showUpJump}}" bindtap="handleJumpUnreadMessage" > <view wx:if="{{showUpJump}}" bindtap="handleJumpUnreadMessage" >
<view class="unread-message-item" > <view class="unread-message-item" >
<view class="unread-message-box"> <view class="unread-message-box">
<image class="icon-left" src="../../../static/assets/up.svg"/> <image class="icon-left" src="../../../static/assets/up.svg"/>
<text wx:if="{{isLostsOfUnread}}"> 99+条未读</text> <text wx:if="{{isLostsOfUnread}}"> 99+条未读</text>
<text wx:else> {{unreadCount}}条未读</text> <text wx:else> {{unreadCount}}条未读</text>
</view> </view>
</view> </view>
</view> </view>
<t-message id="t-message" bindtap="handleMessagePath">
<view slot="content">
<view class="content_title">{{message_title}}</view>
<view class="content_desc">{{message_desc}}</view>
</view>
</t-message>
<wxs src = './concat.wxs' module = 'concat'/> <wxs src = './concat.wxs' module = 'concat'/>

View File

@ -260,3 +260,11 @@
padding-left: 5px; padding-left: 5px;
color: blue; color: blue;
} }
.content_title{
font-size: 32rpx;
color: #000;
}
.content_desc{
font-size: 28rpx;
color: rgb(146, 144, 144);
}

View File

@ -48,7 +48,7 @@ const constant = {
PATIENT_SYSTEM_MESSAGES: 5,//5:患者端系统消息 PATIENT_SYSTEM_MESSAGES: 5,//5:患者端系统消息
PRESCRIBE: 6,//6:处方开具成功(医生端) PRESCRIBE: 6,//6:处方开具成功(医生端)
PRESCRIBE_VERIFY: 7,//7:处方审核通过(患者端) PRESCRIBE_VERIFY: 7,//7:处方审核通过(患者端)
TRABECULA_PATIENT: 8,//8:消息内页横条(患者->医生) BANNER_MESSAGE: 8,//8 弹框消息
}, },
OPERATING_ENVIRONMENT: 'imWxTuikit' OPERATING_ENVIRONMENT: 'imWxTuikit'