Commit d0615a497f8b1871c75f14aefcdaa165b7b8d5f4

Authored by wdn127929
1 parent f9c2381a

取酒短信OK

... ... @@ -89,8 +89,10 @@ class HttpUrl {
"?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息
static const String get_seller_photo_by_id =
"?service=App.Photo.getSellerPhotoById"; //查看商家图片
static const String send_vc_code =
"?service=App.SendSMS.SendVcCode"; //绑定手机号码时,给用户发送短信验证码接口
// static const String send_vc_code =
// "?service=App.SendSMS.SendVcCode"; //绑定手机号码时,给用户发送短信验证码接口 免费
static const String send_vc_code =
"?service=App.SaiYouYun.VcCodeMessage"; //绑定手机号码时,给用户发送短信验证码接口 收费
static const String check_seller_acc =
"?service=App.User.CheckSellerAcc"; //APP微信登录后检测是否存在商家
static const String app_sendsms_wxSendSms =
... ...
... ... @@ -108,7 +108,8 @@ getMyPageCountData();
});
EventBus().on('refreshMySms', (arg) {
// _getSmsInfo(context);
getMyPageCountData();
_getSmsInfo(context);
// getMyPageCountData();
});
}
... ... @@ -292,16 +293,16 @@ getMyPageCountData()async{
}
///获取短信余量
// _getSmsInfo(context) async {
// // myModel = Provider.of<MyModel>(context, listen: false);
// smsInfoData = await myModel.getSmsInfo(context);
// // setState(() {
// // if (smsInfoData != null) {
// // smsInfo = smsInfoData?.lastNum;
// // }
// // });
// }
_getSmsInfo(context) async {
myModel = Provider.of<MyModel>(context, listen: false);
SmsInfoData smsInfoData = await myModel.getSmsInfo(context);
setState(() {
if (smsInfoData != null) {
collectStoreProvider.smsInfo = smsInfoData?.lastNum;
}
});
}
///获取我的积分
// _getMyIntegral(context) async {
... ...
... ... @@ -54,6 +54,7 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
}
storeWineProvider.code = Utils.randomBit(6);
Map<String, String> params = {
'sid':Provider.of<UserModel>(context,listen: false).user.sellerid,
"phone": widget.wineManageDetail.phone.replaceAll(' ', ''),
"code": storeWineProvider.code,
};
... ... @@ -62,6 +63,10 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> {
if (!success) {
// _timer.cancel();
} else {
//刷新我的页面短信余量
//
bus.emit('refreshMySms');
Utils.showToast('短信验证码已发送,请注意查收');
}
}
... ...
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) {
... ...