核销联调

This commit is contained in:
Seven Tsui 2025-09-15 10:32:08 +08:00
parent 539cf87c46
commit ec30eb2456
3 changed files with 45 additions and 6 deletions

View File

@ -44,4 +44,7 @@ class ShopApi {
//
static const String confirmWriteOff= '/app/merchant/order/verify';
// 广
static const String bindSpreadCodeId= '/app/member/bind/spread';
}

View File

@ -10,6 +10,8 @@ import 'package:loopin/IM/im_service.dart';
import 'package:loopin/components/network_or_asset_image.dart';
import 'package:loopin/components/scan_util.dart';
import 'package:loopin/models/conversation_type.dart';
import 'package:loopin/api/shop_api.dart';
import 'package:loopin/service/http.dart';
import 'package:loopin/models/conversation_view_model.dart';
import 'package:loopin/utils/index.dart';
import 'package:loopin/utils/scan_code_type.dart'; //
@ -98,10 +100,20 @@ class ChatPageState extends State<ChatPage> {
}
// 广
void _handlePromotionCode(String value) {
print('处理推广码: $value');
void _handlePromotionCode(String value)async {
try {
print('处理推广码111: $value');
final res = await Http.post('${ShopApi.bindSpreadCodeId}', data: {
"socialCode": value
});
if(res != null && res['code'] == 200){
MyDialog.toast('推广码绑定失败', icon: const Icon(Icons.check_circle), style: ToastStyle(backgroundColor: Colors.green.withAlpha(200)));
Get.toNamed('/vloger', arguments: {'memberId':value});
}
} catch (e) {
MyDialog.toast('推广码绑定失败');
}
}
//
void showContextMenu(BuildContext context, ConversationViewModel item) {
bool isLeft = posDX > MediaQuery.of(context).size.width / 2 ? false : true;

View File

@ -169,10 +169,34 @@ class SystemState extends State<System> {
}
// 广
void _handlePromotionCode(String value) {
print('处理推广码: $value');
void _handlePromotionCode(String value)async {
try {
print('处理推广码111: $value');
final res = await Http.post('${ShopApi.bindSpreadCodeId}', data: {
"socialCode": value
});
if(res != null && res['code'] == 200){
MyDialog.toast('推广码绑定失败', icon: const Icon(Icons.check_circle), style: ToastStyle(backgroundColor: Colors.green.withAlpha(200)));
Get.toNamed('/vloger', arguments: {'memberId':value});
}
} catch (e) {
MyDialog.toast('推广码绑定失败');
}
}
// 广
bindSpreadCode(code) async {
try {
final res = await Http.post('${ShopApi.bindSpreadCodeId}', data: {
"socialCode": "01901839908031348736"
});
print('绑定结果-------------->${res['res']}');
} catch (e) {
MyDialog.toast('推广码绑定失败');
}
}
@override
Widget build(BuildContext context) {