优化
This commit is contained in:
parent
70dca249c3
commit
6d442f7563
@ -3,19 +3,19 @@
|
||||
<view class="list">
|
||||
<view class="item" wx:for="{{list}}" bindtap="go" data-item="{{item}}">
|
||||
<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>
|
||||
<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 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>
|
||||
<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 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>
|
||||
<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 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>
|
||||
<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>
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
// TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
|
||||
}
|
||||
})
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-message": "tdesign-miniprogram/message/message"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<!--TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxml-->
|
||||
<view>
|
||||
<t-message id="t-message" />
|
||||
</view>
|
||||
@ -0,0 +1 @@
|
||||
/* TUIKit/components/TUIChat/components/MessageElements/BannerMessage/index.wxss */
|
||||
@ -131,9 +131,9 @@ Component({
|
||||
return renderDom;
|
||||
}
|
||||
//8:消息内页横条(患者->医生)
|
||||
if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.TRABECULA_PATIENT) {
|
||||
if (customMessage.message_type === GDXZ_CUSTOM_MSEEAGE.BANNER_MESSAGE) {
|
||||
const renderDom = [{
|
||||
type: 'trabecula_patient',
|
||||
type: 'banner_message',
|
||||
title: customMessage.title,
|
||||
desc: customMessage.desc,
|
||||
}];
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
<view class="gdxz_custom_message_title">{{renderDom[0].title}}</view>
|
||||
<view class="gdxz_custom_message_desc">{{renderDom[0].desc}}</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_desc">{{renderDom[0].desc}}</view>
|
||||
</view> -->
|
||||
|
||||
@ -2,6 +2,8 @@ import logger from '../../../../utils/logger';
|
||||
import constant from '../../../../utils/constant';
|
||||
import { wechatTimeFormat } from './../../../../../utils/wechatTime'
|
||||
import { API } from '../../../../../utils/network/api';
|
||||
import Message from 'tdesign-miniprogram/message/index';
|
||||
|
||||
const { GDXZ_CUSTOM_MSEEAGE } = constant;
|
||||
// eslint-disable-next-line no-undef
|
||||
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){
|
||||
try {
|
||||
// console.log("messageList refreshMessageRounds message: ", message);
|
||||
@ -364,6 +424,8 @@ Component({
|
||||
let autoToButtom = this.data.autoToButtom;
|
||||
// console.log("autoToButtom:", autoToButtom)
|
||||
const message = value.data[0];
|
||||
//检测是不是横幅消息
|
||||
this.checkNoticeMessage(message)
|
||||
//更新会话数
|
||||
this.refreshMessageRounds(message)
|
||||
if(message.flow == 'out'){
|
||||
@ -556,6 +618,7 @@ Component({
|
||||
wx.vibrateShort({
|
||||
"type": "heavy"
|
||||
})
|
||||
|
||||
// }
|
||||
// }
|
||||
},
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
"MergerMessage": "../MessageElements/MergerMessage/index",
|
||||
"RevokeMessage": "../MessageElements/RevokeMessage/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"
|
||||
}
|
||||
}
|
||||
@ -80,13 +80,19 @@
|
||||
</view>
|
||||
<view wx:if="{{showUpJump}}" bindtap="handleJumpUnreadMessage" >
|
||||
<view class="unread-message-item" >
|
||||
<view class="unread-message-box">
|
||||
<image class="icon-left" src="../../../static/assets/up.svg"/>
|
||||
<text wx:if="{{isLostsOfUnread}}"> 99+条未读</text>
|
||||
<text wx:else> {{unreadCount}}条未读</text>
|
||||
</view>
|
||||
<view class="unread-message-box">
|
||||
<image class="icon-left" src="../../../static/assets/up.svg"/>
|
||||
<text wx:if="{{isLostsOfUnread}}"> 99+条未读</text>
|
||||
<text wx:else> {{unreadCount}}条未读</text>
|
||||
</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'/>
|
||||
|
||||
|
||||
|
||||
@ -260,3 +260,11 @@
|
||||
padding-left: 5px;
|
||||
color: blue;
|
||||
}
|
||||
.content_title{
|
||||
font-size: 32rpx;
|
||||
color: #000;
|
||||
}
|
||||
.content_desc{
|
||||
font-size: 28rpx;
|
||||
color: rgb(146, 144, 144);
|
||||
}
|
||||
@ -48,7 +48,7 @@ const constant = {
|
||||
PATIENT_SYSTEM_MESSAGES: 5,//5:患者端系统消息
|
||||
PRESCRIBE: 6,//6:处方开具成功(医生端)
|
||||
PRESCRIBE_VERIFY: 7,//7:处方审核通过(患者端)
|
||||
TRABECULA_PATIENT: 8,//8:消息内页横条(患者->医生)
|
||||
BANNER_MESSAGE: 8,//8 弹框消息
|
||||
},
|
||||
|
||||
OPERATING_ENVIRONMENT: 'imWxTuikit'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user