|
|
|
@ -1509,16 +1509,15 @@ class ChatController extends GetxController { |
|
|
|
int quantity = 1, |
|
|
|
}) async { |
|
|
|
try { |
|
|
|
// 准备请求参数(聊天界面不需要channelId,type为2表示添加好友/聊天送礼) |
|
|
|
// 准备请求参数(IM 聊天送礼接口) |
|
|
|
final requestData = { |
|
|
|
'type': 2, // 1.送礼(频道) 2.添加好友/聊天送礼 |
|
|
|
'toUId': int.tryParse(userId) ?? 0, |
|
|
|
'toUserId': int.tryParse(userId) ?? 0, |
|
|
|
'productSpecId': int.tryParse(gift.productSpecId) ?? 0, |
|
|
|
'quantity': quantity, |
|
|
|
}; |
|
|
|
|
|
|
|
// 调用消费接口 |
|
|
|
final response = await _networkService.rtcApi.costChannelGift( |
|
|
|
// 调用 IM 送礼接口 |
|
|
|
final response = await _networkService.rtcApi.costImGift( |
|
|
|
requestData, |
|
|
|
); |
|
|
|
|
|
|
|
|