|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
...
|
...
|
@@ -28,23 +30,28 @@ class StoreWineProvider with ChangeNotifier { |
|
|
|
List<OutWineRecordSunModel> outWineRecordData; //某个存酒详情的出库记录
|
|
|
|
List<OutWineRecordSunModel> outWineRecordHomeData; //存酒详情的出库记录
|
|
|
|
String code; //验证码
|
|
|
|
PhoneCodeSunModel phoneCodeSunModel;
|
|
|
|
// PhoneCodeSunModel phoneCodeSunModel;
|
|
|
|
|
|
|
|
/// 给手机发送短信验证码
|
|
|
|
Future<bool> getPhoneCode(BuildContext context, Map<String, String> params,
|
|
|
|
{isShowLoading = true}) async {
|
|
|
|
BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
|
|
|
|
.request<Map<String, dynamic>>(
|
|
|
|
BaseResp<dynamic> baseResp = await DioUtil()
|
|
|
|
.request<dynamic>(
|
|
|
|
context, Method.post, HttpUrl.send_vc_code,
|
|
|
|
data: params, showLoading: false)
|
|
|
|
.catchError((error) {});
|
|
|
|
if (baseResp.code == Constant.status_success) {
|
|
|
|
if (baseResp.data.isEmpty) {
|
|
|
|
if (baseResp.data == null) {
|
|
|
|
return false;
|
|
|
|
} else {
|
|
|
|
//解析解析
|
|
|
|
phoneCodeSunModel = PhoneCodeModel.fromJson(baseResp.responseData).data;
|
|
|
|
return true;
|
|
|
|
if(jsonDecode( baseResp.data)['status'] == 'success'){
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (baseResp != null) {
|
...
|
...
|
|