核销联调
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 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/network_or_asset_image.dart';
|
||||||
import 'package:loopin/components/scan_util.dart';
|
import 'package:loopin/components/scan_util.dart';
|
||||||
import 'package:loopin/models/conversation_type.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/models/conversation_view_model.dart';
|
||||||
import 'package:loopin/utils/index.dart';
|
import 'package:loopin/utils/index.dart';
|
||||||
import 'package:loopin/utils/scan_code_type.dart'; // 导入外部枚举
|
import 'package:loopin/utils/scan_code_type.dart'; // 导入外部枚举
|
||||||
@ -98,9 +100,19 @@ class ChatPageState extends State<ChatPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理推广码
|
// 处理推广码
|
||||||
void _handlePromotionCode(String value) {
|
void _handlePromotionCode(String value)async {
|
||||||
print('处理推广码: $value');
|
try {
|
||||||
Get.toNamed('/vloger', arguments: {'memberId':value});
|
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) {
|
void showContextMenu(BuildContext context, ConversationViewModel item) {
|
||||||
|
@ -169,9 +169,33 @@ class SystemState extends State<System> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理推广码
|
// 处理推广码
|
||||||
void _handlePromotionCode(String value) {
|
void _handlePromotionCode(String value)async {
|
||||||
print('处理推广码: $value');
|
try {
|
||||||
Get.toNamed('/vloger', arguments: {'memberId':value});
|
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
|
@override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user