扩展消息部分代码提交
This commit is contained in:
parent
cf7aa93d6e
commit
1121cc3f20
@ -75,7 +75,7 @@ import { TextMessageDetailDialog } from '../view/TextMessageDetailDialog';
|
|||||||
import { TeachDialog } from '../view/TeachDialog';
|
import { TeachDialog } from '../view/TeachDialog';
|
||||||
import { NewWaDialog } from '../view/NewWaDialog';
|
import { NewWaDialog } from '../view/NewWaDialog';
|
||||||
import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet'
|
import { PerfactInputSheet } from '@itcast/basic/src/main/ets/Views/PerfactInputSheet'
|
||||||
import { hdHttp, HdResponse,BasicConstant, authStore} from '@itcast/basic'
|
import { hdHttp, HdResponse,BasicConstant, authStore, preferenceStore, ChatParam} from '@itcast/basic'
|
||||||
import { HashMap } from '@kit.ArkTS';
|
import { HashMap } from '@kit.ArkTS';
|
||||||
import { customAttachment } from '../view/MessageComponentBuilder'
|
import { customAttachment } from '../view/MessageComponentBuilder'
|
||||||
|
|
||||||
@ -84,6 +84,8 @@ export struct ChatP2PPage {
|
|||||||
pathStack: NavPathStack = new NavPathStack()
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
sessionId=''//患者的云信id
|
sessionId=''//患者的云信id
|
||||||
patientUuid=''//患者uuid
|
patientUuid=''//患者uuid
|
||||||
|
@Local chat_state:string=''
|
||||||
|
@Local gdxz_sessionType:string= preferenceStore.getItemString('gdxz_sessionType')
|
||||||
@Local statusBarHeight:number=0
|
@Local statusBarHeight:number=0
|
||||||
@Local havestopout:boolean=false;//是否有出诊公告
|
@Local havestopout:boolean=false;//是否有出诊公告
|
||||||
@Local chatUserInfo: ChatUserInfo = new ChatUserInfo();
|
@Local chatUserInfo: ChatUserInfo = new ChatUserInfo();
|
||||||
@ -420,6 +422,11 @@ export struct ChatP2PPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
|
if(this.chat_state=='3')
|
||||||
|
{
|
||||||
|
this.bottomHeight==0
|
||||||
|
}
|
||||||
|
|
||||||
NEEmojiManager.instance.setup();
|
NEEmojiManager.instance.setup();
|
||||||
DeviceUtils.rootDirPath = getContext(this).filesDir
|
DeviceUtils.rootDirPath = getContext(this).filesDir
|
||||||
this.operationMoreDataList = setupMoreOperationData()
|
this.operationMoreDataList = setupMoreOperationData()
|
||||||
@ -574,8 +581,8 @@ export struct ChatP2PPage {
|
|||||||
NavDestination() {
|
NavDestination() {
|
||||||
NavigationBackBuilder({
|
NavigationBackBuilder({
|
||||||
title:this.showName ,
|
title:this.showName ,
|
||||||
rightButtonIcon: this.showMultiSelect ? undefined : $r('app.media.ic_public_more_dot'),
|
rightButtonIcon: this.gdxz_sessionType==BasicConstant.general ? $r('app.media.more') :undefined,
|
||||||
rightButtonTitle: this.showMultiSelect ? $r('app.string.chat_msg_dialog_cancel') : undefined,
|
rightButtonTitle: this.gdxz_sessionType==BasicConstant.consult && this.chat_state!='3'? '关闭会话' : undefined,
|
||||||
top:this.statusBarHeight,
|
top:this.statusBarHeight,
|
||||||
rightButtonAction: () => {
|
rightButtonAction: () => {
|
||||||
this.goToSettingPage(this.pathStack)
|
this.goToSettingPage(this.pathStack)
|
||||||
@ -776,7 +783,7 @@ export struct ChatP2PPage {
|
|||||||
top: { anchor: "chatPageListView", align: VerticalAlign.Bottom },
|
top: { anchor: "chatPageListView", align: VerticalAlign.Bottom },
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.hideInput === false && !this.showMultiSelect) {
|
if (this.hideInput === false && !this.showMultiSelect&&this.chat_state!='3') {
|
||||||
NEChatInputView({
|
NEChatInputView({
|
||||||
controller: this.controller,
|
controller: this.controller,
|
||||||
placeHolder: (this.chatUserInfo.conversationName ?? '').length > 15 ?
|
placeHolder: (this.chatUserInfo.conversationName ?? '').length > 15 ?
|
||||||
@ -1087,9 +1094,11 @@ export struct ChatP2PPage {
|
|||||||
.hideTitleBar(true)
|
.hideTitleBar(true)
|
||||||
.onReady((context: NavDestinationContext) => {
|
.onReady((context: NavDestinationContext) => {
|
||||||
this.pathStack = context.pathStack
|
this.pathStack = context.pathStack
|
||||||
let param = this.pathStack.getParamByName("ChatP2PPage") as string[];
|
let param = this.pathStack.getParamByName("ChatP2PPage") as ChatParam[];
|
||||||
if (param.length > 0) {
|
if (param.length > 0) {
|
||||||
this.conversationId = param[0];
|
this.conversationId = param[0].conversationId;
|
||||||
|
this.showName= param[0].name+'';
|
||||||
|
this.chat_state=param[0].chat_state
|
||||||
this.loadChatData();
|
this.loadChatData();
|
||||||
} else {
|
} else {
|
||||||
this.pathStack.removeByName("ChatP2PPage")
|
this.pathStack.removeByName("ChatP2PPage")
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import {
|
|||||||
V2NIMMessageFileAttachment,
|
V2NIMMessageFileAttachment,
|
||||||
V2NIMMessagePinNotification,
|
V2NIMMessagePinNotification,
|
||||||
V2NIMMessagePinState,
|
V2NIMMessagePinState,
|
||||||
|
V2NIMMessagePushConfig,
|
||||||
V2NIMMessageRevokeNotification,
|
V2NIMMessageRevokeNotification,
|
||||||
V2NIMMessageSendingState,
|
V2NIMMessageSendingState,
|
||||||
V2NIMMessageType,
|
V2NIMMessageType,
|
||||||
@ -57,10 +58,10 @@ import { ChatKitConfig } from '../ChatKitConfig';
|
|||||||
import { sceneMap } from '@kit.MapKit';
|
import { sceneMap } from '@kit.MapKit';
|
||||||
import { clearForwardAtMark, createForwardMessageListFileDetail, sendMessageFailedTips } from '../common/MessageHelper';
|
import { clearForwardAtMark, createForwardMessageListFileDetail, sendMessageFailedTips } from '../common/MessageHelper';
|
||||||
import { instanceToPlain } from 'class-transformer';
|
import { instanceToPlain } from 'class-transformer';
|
||||||
import { NECommonUtils } from '@nimkit/common';
|
import { NECommonUtils, UserUtils } from '@nimkit/common';
|
||||||
import { HashMap, JSON } from '@kit.ArkTS';
|
import { HashMap, JSON } from '@kit.ArkTS';
|
||||||
import { assign } from '@nimsdk/vendor';
|
import { assign } from '@nimsdk/vendor';
|
||||||
import { BasicConstant, ChatExtModel } from '@itcast/basic';
|
import { BasicConstant, ChatExtModel, preferenceStore } from '@itcast/basic';
|
||||||
|
|
||||||
@ObservedV2
|
@ObservedV2
|
||||||
export class ChatBaseViewModel {
|
export class ChatBaseViewModel {
|
||||||
@ -654,13 +655,14 @@ export class ChatBaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 消息发送之前调用,用于配置消息通用参数
|
// 消息发送之前调用,用于配置消息通用参数
|
||||||
beforeSendMessage(msg: V2NIMMessage): V2NIMMessage {
|
beforeSendMessage(msg: V2NIMMessage){
|
||||||
// if (ChatKitConfig.messageReadState) {
|
// if (ChatKitConfig.messageReadState) {
|
||||||
// let msgConfig: V2NIMMessageConfig = {
|
// let msgConfig: V2NIMMessageConfig = {
|
||||||
// readReceiptEnabled: false
|
// readReceiptEnabled: false
|
||||||
// }
|
// }
|
||||||
// msg.messageConfig = msgConfig
|
// msg.messageConfig = msgConfig
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -689,12 +691,7 @@ export class ChatBaseViewModel {
|
|||||||
// let extension = JSON.stringify(instanceToPlain(extensionMap))
|
// let extension = JSON.stringify(instanceToPlain(extensionMap))
|
||||||
// message.serverExtension = extension
|
// message.serverExtension = extension
|
||||||
// }
|
// }
|
||||||
let extension:ChatExtModel= {
|
|
||||||
gdxz_sessionType: '',
|
|
||||||
gdxz_consult_uuid: '',
|
|
||||||
gdxz_nickName: ''
|
|
||||||
}
|
|
||||||
message.serverExtension =JSON.stringify(extension)
|
|
||||||
|
|
||||||
|
|
||||||
//设置推送
|
//设置推送
|
||||||
@ -911,6 +908,19 @@ export class ChatBaseViewModel {
|
|||||||
* @param progress 消息发送进度
|
* @param progress 消息发送进度
|
||||||
*/
|
*/
|
||||||
async sendMessage(msg: V2NIMMessage, params?: V2NIMSendMessageParams, progress?: (percentage: number) => void) {
|
async sendMessage(msg: V2NIMMessage, params?: V2NIMSendMessageParams, progress?: (percentage: number) => void) {
|
||||||
|
let extension:ChatExtModel= {
|
||||||
|
gdxz_sessionType: preferenceStore.getItemString('gdxz_sessionType'),
|
||||||
|
gdxz_consult_uuid: preferenceStore.getItemString('gdxz_consult_uuid')+'',
|
||||||
|
gdxz_nickName:await UserUtils.getAvatarName(ChatKitClient.nim.conversationIdUtil.parseConversationTargetId(this.conversationId),'')
|
||||||
|
}
|
||||||
|
msg.serverExtension =JSON.stringify(extension)
|
||||||
|
// Map<String,Integer> p=new HashMap<>();
|
||||||
|
// p.put("classification",1);
|
||||||
|
// payload.put("vivoField",p);//vivo推送
|
||||||
|
// payload.put("apns-collapse-id", "321");//ios需要
|
||||||
|
// payload.put("apns-from-id", NimUIKit.getAccount());//ios需要
|
||||||
|
// msg.pushConfig = {} as V2NIMMessagePushConfig
|
||||||
|
// msg.pushConfig.pushPayload=''
|
||||||
ChatRepo.sendMessage(this.beforeSendMessage(msg), this.conversationId!, params, progress)
|
ChatRepo.sendMessage(this.beforeSendMessage(msg), this.conversationId!, params, progress)
|
||||||
.catch((err: BusinessError) => {
|
.catch((err: BusinessError) => {
|
||||||
console.error("net ease send message error", err.code, err.message);
|
console.error("net ease send message error", err.code, err.message);
|
||||||
|
|||||||
BIN
chatkit_ui/src/main/resources/base/media/more.png
Normal file
BIN
chatkit_ui/src/main/resources/base/media/more.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 192 B |
@ -53,8 +53,11 @@ export function NavigationBackBuilder(params?: NavigationBackBuilderParams) {
|
|||||||
} else {
|
} else {
|
||||||
Image($r('app.media.top_back'))
|
Image($r('app.media.top_back'))
|
||||||
.margin({ left: 20 })
|
.margin({ left: 20 })
|
||||||
.width(24)
|
.width(65)
|
||||||
.height(24)
|
.height(24)
|
||||||
|
.padding({
|
||||||
|
right:41
|
||||||
|
})
|
||||||
// .padding({
|
// .padding({
|
||||||
// left: 8,
|
// left: 8,
|
||||||
// right: 8,
|
// right: 8,
|
||||||
@ -69,9 +72,13 @@ export function NavigationBackBuilder(params?: NavigationBackBuilderParams) {
|
|||||||
// .fontWeight(FontWeight.Bold)
|
// .fontWeight(FontWeight.Bold)
|
||||||
.height(18)
|
.height(18)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
|
.maxLines(1)
|
||||||
|
.ellipsisMode(EllipsisMode.END)
|
||||||
.margin({
|
.margin({
|
||||||
left: params?.buttonTextWidth ? (params.buttonTextWidth - 32 + 8) : 8,
|
left:5,
|
||||||
right: (params?.rightButtonTitle || params?.rightButtonIcon) ? 8 : 60
|
right:5
|
||||||
|
// left: params?.buttonTextWidth ? (params.buttonTextWidth - 32 + 8) : 8,
|
||||||
|
// right: (params?.rightButtonTitle || params?.rightButtonIcon) ? 8 : 60
|
||||||
})
|
})
|
||||||
.fontColor('#8D2316')
|
.fontColor('#8D2316')
|
||||||
.layoutWeight(1)
|
.layoutWeight(1)
|
||||||
@ -81,28 +88,43 @@ export function NavigationBackBuilder(params?: NavigationBackBuilderParams) {
|
|||||||
|
|
||||||
if (params?.rightButtonTitle) {
|
if (params?.rightButtonTitle) {
|
||||||
Text(params?.rightButtonTitle)
|
Text(params?.rightButtonTitle)
|
||||||
.fontSize(16)
|
.fontSize(14)
|
||||||
.fontColor(params?.rightButtonColor)
|
.fontColor(params?.rightButtonColor??Color.White)
|
||||||
.width(params?.buttonTextWidth ?? 32)
|
.width(params?.buttonTextWidth ?? 80)
|
||||||
.height(18)
|
.height(35)
|
||||||
.margin({ right: 20 })
|
.textAlign(TextAlign.Center)
|
||||||
|
// .padding({
|
||||||
|
// top:10,bottom:10,left:18,right:18
|
||||||
|
// })
|
||||||
|
.borderRadius(4)
|
||||||
|
// .height(18)
|
||||||
|
.backgroundColor($r('app.color.top_title'))
|
||||||
|
.margin({ right: 5 })
|
||||||
.onClick(params?.rightButtonAction)
|
.onClick(params?.rightButtonAction)
|
||||||
.textAlign(TextAlign.End)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (params?.rightButtonIcon) {
|
else if (params?.rightButtonIcon) {
|
||||||
Image(params?.rightButtonIcon)
|
Image(params?.rightButtonIcon)
|
||||||
.width(32)
|
// .width(36)
|
||||||
.height(32)
|
.width(65)
|
||||||
|
.height(4)
|
||||||
|
.objectFit(ImageFit.Contain)
|
||||||
.padding({
|
.padding({
|
||||||
left: 3,
|
left: 47,
|
||||||
right: 3,
|
// right: 3,
|
||||||
top: 3,
|
// top: 3,
|
||||||
bottom: 3
|
// bottom: 3
|
||||||
})
|
})
|
||||||
.margin({ right: 20 })
|
.margin({ right: 20 })
|
||||||
.onClick(params?.rightButtonAction)
|
.onClick(params?.rightButtonAction)
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Text('')
|
||||||
|
.width(85)
|
||||||
|
.height(24)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.height(55)
|
.height(55)
|
||||||
.alignSelf(ItemAlign.Start)
|
.alignSelf(ItemAlign.Start)
|
||||||
|
|||||||
@ -87,4 +87,4 @@ export { ChangePhotoGrids } from './src/main/ets/components/ChangePhotoGrids'
|
|||||||
|
|
||||||
export { InputPopWindow } from './src/main/ets/Views/InputPopWindow'
|
export { InputPopWindow } from './src/main/ets/Views/InputPopWindow'
|
||||||
|
|
||||||
export { ChatExtModel } from './src/main/ets/models/ChatExtModel'
|
export { ChatExtModel,ChatParam } from './src/main/ets/models/ChatExtModel'
|
||||||
@ -101,5 +101,9 @@ export class BasicConstant {
|
|||||||
static readonly CouTeach="[公益咨询]";
|
static readonly CouTeach="[公益咨询]";
|
||||||
static readonly Shopping="[肝胆商城]";
|
static readonly Shopping="[肝胆商城]";
|
||||||
static readonly Hostipal="[互联网医院]";
|
static readonly Hostipal="[互联网医院]";
|
||||||
|
|
||||||
|
//聊天类型普通聊天与公益咨询
|
||||||
|
static readonly general = "general";
|
||||||
|
static readonly consult = "consult";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -6,3 +6,11 @@ export interface ChatExtModel{
|
|||||||
gdxz_nickName:string//患者备注姓名
|
gdxz_nickName:string//患者备注姓名
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface ChatParam extends ChatExtModel{
|
||||||
|
name:string,//患者姓名
|
||||||
|
conversationId:string,//最近会话id
|
||||||
|
chat_state:string//公益咨询状态
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
|
|
||||||
import { ConsulList } from '../model/ConsulModel'
|
import { ConsulList } from '../model/ConsulModel'
|
||||||
import { router } from '@kit.ArkUI'
|
import { router } from '@kit.ArkUI'
|
||||||
|
import { BasicConstant, ChatParam, preferenceStore } from '@itcast/basic';
|
||||||
|
import { ChatKitClient } from '@nimkit/chatkit';
|
||||||
|
|
||||||
|
|
||||||
@Preview
|
@Preview
|
||||||
@ -12,55 +14,99 @@ export struct ItemCompPublic {
|
|||||||
aboutToAppear(): void {
|
aboutToAppear(): void {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
build() {
|
build() {
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
Row()
|
Row() {
|
||||||
{
|
Text(this.item.state == 0 ? $r('app.string.cancellation') : this.item.realName)
|
||||||
Text(this.item.state==0?$r('app.string.cancellation'):this.item.realName).fontSize(19).fontColor($r('app.color.top_title')).layoutWeight(1)
|
.fontSize(19)
|
||||||
Text(this.item.createDate?this.item.createDate.length>16?this.item.createDate.substring(1,16):this.item.createDate:'')
|
.fontColor($r('app.color.top_title'))
|
||||||
|
.layoutWeight(1)
|
||||||
|
Text(this.item.createDate ?
|
||||||
|
this.item.createDate.length > 16 ? this.item.createDate.substring(1, 16) : this.item.createDate : '')
|
||||||
.fontSize(15).fontColor($r('app.color.top_title')).padding({ left: 5 })
|
.fontSize(15).fontColor($r('app.color.top_title')).padding({ left: 5 })
|
||||||
Text('').width(11).height(11).backgroundColor('#ffff3e3e').borderRadius(20).margin({top:-20})
|
Text('')
|
||||||
|
.width(11)
|
||||||
|
.height(11)
|
||||||
|
.backgroundColor('#ffff3e3e')
|
||||||
|
.borderRadius(20)
|
||||||
|
.margin({ top: -20 })
|
||||||
.visibility(this.isHistory ? Visibility.Visible : Visibility.None)
|
.visibility(this.isHistory ? Visibility.Visible : Visibility.None)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text(this.item.content)
|
Text(this.item.content)
|
||||||
.fontSize(14).fontColor($r('app.color.common_gray_03')).padding(9).margin({top:10})
|
.fontSize(14)
|
||||||
.backgroundColor($r('app.color.f6f6f6')).borderRadius(8)
|
.fontColor($r('app.color.common_gray_03'))
|
||||||
|
.padding(9)
|
||||||
|
.margin({ top: 10 })
|
||||||
|
.backgroundColor($r('app.color.f6f6f6'))
|
||||||
|
.borderRadius(8)
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.maxLines(2)
|
.maxLines(2)
|
||||||
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
.textOverflow({ overflow: TextOverflow.Ellipsis })
|
||||||
Row()
|
Row() {
|
||||||
{
|
Text('问题详情')
|
||||||
Text('问题详情').fontSize(11).backgroundColor($r('app.color.top_title')).fontColor(Color.White)
|
.fontSize(11)
|
||||||
.width(63).height(25).borderRadius(17).textAlign(TextAlign.Center)
|
.backgroundColor($r('app.color.top_title'))
|
||||||
|
.fontColor(Color.White)
|
||||||
|
.width(63)
|
||||||
|
.height(25)
|
||||||
|
.borderRadius(17)
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/Netease/ConsultationDetailPage',
|
url: 'pages/Netease/ConsultationDetailPage',
|
||||||
params: { uuid: this.item.uuid, isHistory: this.isHistory + '' }
|
params: { uuid: this.item.uuid, isHistory: this.isHistory + '' }
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
Text(this.item.diseaseName.includes("甲、乙、丙、丁")?'肝炎':this.item.diseaseName).fontSize(11).borderColor($r('app.color.top_title')).fontColor($r('app.color.top_title'))
|
Text(this.item.diseaseName.includes("甲、乙、丙、丁") ? '肝炎' : this.item.diseaseName)
|
||||||
.width(63).height(25).borderRadius(17).borderWidth(1).textAlign(TextAlign.Center).margin({left:10})
|
.fontSize(11)
|
||||||
|
.borderColor($r('app.color.top_title'))
|
||||||
|
.fontColor($r('app.color.top_title'))
|
||||||
|
.width(63)
|
||||||
|
.height(25)
|
||||||
|
.borderRadius(17)
|
||||||
|
.borderWidth(1)
|
||||||
|
.textAlign(TextAlign.Center)
|
||||||
|
.margin({ left: 10 })
|
||||||
|
|
||||||
}.alignSelf(ItemAlign.Start)
|
}.alignSelf(ItemAlign.Start)
|
||||||
.margin({ top: 10 })
|
.margin({ top: 10 })
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.width('100%')
|
.width('100%')
|
||||||
.padding(10)
|
.padding(10)
|
||||||
.onClick(() => {
|
.onClick(() => {
|
||||||
|
if(this.isHistory)
|
||||||
|
{
|
||||||
|
preferenceStore.setItemString('gdxz_consult_uuid', this.item.uuid)
|
||||||
|
preferenceStore.setItemString('gdxz_sessionType', BasicConstant.consult)
|
||||||
|
this.pathStack.pushPath({
|
||||||
|
name: "ChatP2PPage",
|
||||||
|
param: {
|
||||||
|
conversationId: ChatKitClient.nim.conversationIdUtil.p2pConversationId(this.item.patientUuid.toString()
|
||||||
|
.toLowerCase()),
|
||||||
|
name: this.item.realName,
|
||||||
|
chat_state:this.item.state+''
|
||||||
|
} as ChatParam
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/Netease/ConsultationDetailPage',
|
url: 'pages/Netease/ConsultationDetailPage',
|
||||||
params: { uuid: this.item.uuid,isHistory:this.isHistory+''}
|
params: { uuid: this.item.uuid,isHistory:this.isHistory+''}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import HashMap from '@ohos.util.HashMap';
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
export struct ListCompPublic {
|
export struct ListCompPublic {
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
||||||
@Prop
|
@Prop
|
||||||
@Watch('onUpdate')
|
@Watch('onUpdate')
|
||||||
@ -207,7 +207,7 @@ export struct ListCompPublic {
|
|||||||
{
|
{
|
||||||
ForEach(this.list, (item: ConsulList) => {
|
ForEach(this.list, (item: ConsulList) => {
|
||||||
ListItem() {
|
ListItem() {
|
||||||
ItemCompPublic({ item,isHistory:this.isHistory })
|
ItemCompPublic({ item,isHistory:this.isHistory,pathStack: this.pathStack })
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -112,6 +112,7 @@ export struct ConsultationDetailComp {
|
|||||||
if(json.code=='1')
|
if(json.code=='1')
|
||||||
{
|
{
|
||||||
promptAction.showToast({ message: '抢答成功' })
|
promptAction.showToast({ message: '抢答成功' })
|
||||||
|
this.addBonusPoints()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -123,6 +124,21 @@ export struct ConsultationDetailComp {
|
|||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addBonusPoints() {
|
||||||
|
const hashMap: HashMap<string, string> = new HashMap();
|
||||||
|
|
||||||
|
hashMap.clear();
|
||||||
|
hashMap.set('score_type','2');
|
||||||
|
hdHttp.httpReq<string>(BasicConstant.addBonusPoints,hashMap).then(async (res: HdResponse<string>) => {
|
||||||
|
|
||||||
|
let json:Record<string,string> = JSON.parse(res+'') as Record<string,string>;
|
||||||
|
promptAction.showToast({ message: json.message })
|
||||||
|
|
||||||
|
}).catch((err: BusinessError) => {
|
||||||
|
this.dialog.close();
|
||||||
|
})
|
||||||
|
}
|
||||||
build() {
|
build() {
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
|
|||||||
@ -7,14 +7,14 @@ export struct QuictDoctorComp {
|
|||||||
@Watch('onChangeIndex')
|
@Watch('onChangeIndex')
|
||||||
activeIndex: number = 0
|
activeIndex: number = 0
|
||||||
@State type: number=0
|
@State type: number=0
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
onChangeIndex() {
|
onChangeIndex() {
|
||||||
}
|
}
|
||||||
build() {
|
build() {
|
||||||
|
|
||||||
Column() {
|
Column() {
|
||||||
|
|
||||||
TabBarTopComp({activeIndex:this.activeIndex,type:this.type});
|
TabBarTopComp({activeIndex:this.activeIndex,type:this.type,pathStack: this.pathStack});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import { ManyForOneComp } from '../view/ManyForOneComp'
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
export struct TabBarConsultationComp {
|
export struct TabBarConsultationComp {
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
@StorageProp('bottomHeight')
|
@StorageProp('bottomHeight')
|
||||||
bottomHeight: number = 0
|
bottomHeight: number = 0
|
||||||
@Link activeIndex: number
|
@Link activeIndex: number
|
||||||
@ -42,7 +42,7 @@ export struct TabBarConsultationComp {
|
|||||||
TabContent() {
|
TabContent() {
|
||||||
if (index === 0)
|
if (index === 0)
|
||||||
{
|
{
|
||||||
QuictDoctorComp()
|
QuictDoctorComp({pathStack: this.pathStack})
|
||||||
}
|
}
|
||||||
else if(index === 1)
|
else if(index === 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { ListCompMany } from '../components/ListCompMany'
|
|||||||
|
|
||||||
@Component
|
@Component
|
||||||
export struct TabBarTopComp {
|
export struct TabBarTopComp {
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
@StorageProp('bottomHeight')
|
@StorageProp('bottomHeight')
|
||||||
bottomHeight: number = 0
|
bottomHeight: number = 0
|
||||||
@Link activeIndex: number
|
@Link activeIndex: number
|
||||||
@ -46,7 +46,7 @@ export struct TabBarTopComp {
|
|||||||
TabContent() {
|
TabContent() {
|
||||||
if (this.type==0)
|
if (this.type==0)
|
||||||
{
|
{
|
||||||
ListCompPublic({isHistory:this.isHistory})
|
ListCompPublic({isHistory:this.isHistory,pathStack: this.pathStack})
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.type==1)
|
else if(this.type==1)
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { BasicConstant, ChatParam, preferenceStore } from '@itcast/basic';
|
||||||
import { ChatKitClient, ChatRepo, NEUserWithFriend, PersonSelectParam, TeamRepo } from '@nimkit/chatkit';
|
import { ChatKitClient, ChatRepo, NEUserWithFriend, PersonSelectParam, TeamRepo } from '@nimkit/chatkit';
|
||||||
import { CommonEmptyResult, CommonLongLoadingProgress, NetworkBrokenBuilder } from '@nimkit/common';
|
import { CommonEmptyResult, CommonLongLoadingProgress, NetworkBrokenBuilder } from '@nimkit/common';
|
||||||
import { V2NIMConversationType, V2NIMLocalConversation } from '@nimsdk/base';
|
import { V2NIMConversationType, V2NIMLocalConversation } from '@nimsdk/base';
|
||||||
@ -90,7 +91,15 @@ export struct LocalConversationPage {
|
|||||||
*/
|
*/
|
||||||
goToChatPage(conversationInfo: V2NIMLocalConversation) {
|
goToChatPage(conversationInfo: V2NIMLocalConversation) {
|
||||||
if (conversationInfo?.type == V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
|
if (conversationInfo?.type == V2NIMConversationType.V2NIM_CONVERSATION_TYPE_P2P) {
|
||||||
this.pathStack.pushPath({ name: "ChatP2PPage", param: conversationInfo.conversationId })
|
preferenceStore.setItemString('gdxz_consult_uuid','')
|
||||||
|
preferenceStore.setItemString('gdxz_sessionType',BasicConstant.general)
|
||||||
|
this.pathStack.pushPath({ name: "ChatP2PPage",
|
||||||
|
param: {
|
||||||
|
// gdxz_sessionType:BasicConstant.general,
|
||||||
|
conversationId:conversationInfo.conversationId
|
||||||
|
} as ChatParam
|
||||||
|
|
||||||
|
})
|
||||||
} else if (conversationInfo?.type == V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
} else if (conversationInfo?.type == V2NIMConversationType.V2NIM_CONVERSATION_TYPE_TEAM) {
|
||||||
this.pathStack.pushPath({ name: "ChatTeamPage", param: conversationInfo.conversationId })
|
this.pathStack.pushPath({ name: "ChatTeamPage", param: conversationInfo.conversationId })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { TabBarConsultationComp } from 'netease';
|
|||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct PublicConsultationPage {
|
struct PublicConsultationPage {
|
||||||
|
pathStack: NavPathStack = new NavPathStack()
|
||||||
|
|
||||||
@State
|
@State
|
||||||
@Watch('onChangeIndex')
|
@Watch('onChangeIndex')
|
||||||
@ -22,14 +22,17 @@ struct PublicConsultationPage {
|
|||||||
this.onChangeIndex()
|
this.onChangeIndex()
|
||||||
}
|
}
|
||||||
build() {
|
build() {
|
||||||
|
Navigation(this.pathStack) {
|
||||||
Flex() {
|
Flex() {
|
||||||
TabBarConsultationComp({ activeIndex: this.activeIndex})
|
TabBarConsultationComp({ activeIndex: this.activeIndex, pathStack: this.pathStack})
|
||||||
}
|
}
|
||||||
.backgroundColor($r('app.color.white'))
|
.backgroundColor($r('app.color.white'))
|
||||||
// .backgroundColor(Color.Red)
|
// .backgroundColor(Color.Red)
|
||||||
// .height('100%')
|
// .height('100%')
|
||||||
// .width('100%')
|
// .width('100%')
|
||||||
|
|
||||||
|
}
|
||||||
|
.mode(NavigationMode.Auto)
|
||||||
|
.hideTitleBar(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user