核销联调
This commit is contained in:
parent
539cf87c46
commit
ec30eb2456
@ -44,4 +44,7 @@ class ShopApi {
|
||||
|
||||
// 确认核销
|
||||
static const String confirmWriteOff= '/app/merchant/order/verify';
|
||||
|
||||
// 绑定推广码
|
||||
static const String bindSpreadCodeId= '/app/member/bind/spread';
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user