Showing
4 changed files
with
34 additions
and
19 deletions
| @@ -89,8 +89,10 @@ class HttpUrl { | @@ -89,8 +89,10 @@ class HttpUrl { | ||
| 89 | "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息 | 89 | "?service=App.Activity.GetCustomerActivityBaseinfo"; //客户经理获取基本信息 |
| 90 | static const String get_seller_photo_by_id = | 90 | static const String get_seller_photo_by_id = |
| 91 | "?service=App.Photo.getSellerPhotoById"; //查看商家图片 | 91 | "?service=App.Photo.getSellerPhotoById"; //查看商家图片 |
| 92 | - static const String send_vc_code = | ||
| 93 | - "?service=App.SendSMS.SendVcCode"; //绑定手机号码时,给用户发送短信验证码接口 | 92 | + // static const String send_vc_code = |
| 93 | + // "?service=App.SendSMS.SendVcCode"; //绑定手机号码时,给用户发送短信验证码接口 免费 | ||
| 94 | + static const String send_vc_code = | ||
| 95 | + "?service=App.SaiYouYun.VcCodeMessage"; //绑定手机号码时,给用户发送短信验证码接口 收费 | ||
| 94 | static const String check_seller_acc = | 96 | static const String check_seller_acc = |
| 95 | "?service=App.User.CheckSellerAcc"; //APP微信登录后检测是否存在商家 | 97 | "?service=App.User.CheckSellerAcc"; //APP微信登录后检测是否存在商家 |
| 96 | static const String app_sendsms_wxSendSms = | 98 | static const String app_sendsms_wxSendSms = |
| @@ -108,7 +108,8 @@ getMyPageCountData(); | @@ -108,7 +108,8 @@ getMyPageCountData(); | ||
| 108 | }); | 108 | }); |
| 109 | EventBus().on('refreshMySms', (arg) { | 109 | EventBus().on('refreshMySms', (arg) { |
| 110 | // _getSmsInfo(context); | 110 | // _getSmsInfo(context); |
| 111 | - getMyPageCountData(); | 111 | + _getSmsInfo(context); |
| 112 | + // getMyPageCountData(); | ||
| 112 | }); | 113 | }); |
| 113 | } | 114 | } |
| 114 | 115 | ||
| @@ -292,16 +293,16 @@ getMyPageCountData()async{ | @@ -292,16 +293,16 @@ getMyPageCountData()async{ | ||
| 292 | } | 293 | } |
| 293 | 294 | ||
| 294 | ///获取短信余量 | 295 | ///获取短信余量 |
| 295 | - // _getSmsInfo(context) async { | ||
| 296 | - // // myModel = Provider.of<MyModel>(context, listen: false); | ||
| 297 | - // smsInfoData = await myModel.getSmsInfo(context); | ||
| 298 | - | ||
| 299 | - // // setState(() { | ||
| 300 | - // // if (smsInfoData != null) { | ||
| 301 | - // // smsInfo = smsInfoData?.lastNum; | ||
| 302 | - // // } | ||
| 303 | - // // }); | ||
| 304 | - // } | 296 | + _getSmsInfo(context) async { |
| 297 | + myModel = Provider.of<MyModel>(context, listen: false); | ||
| 298 | + SmsInfoData smsInfoData = await myModel.getSmsInfo(context); | ||
| 299 | + | ||
| 300 | + setState(() { | ||
| 301 | + if (smsInfoData != null) { | ||
| 302 | + collectStoreProvider.smsInfo = smsInfoData?.lastNum; | ||
| 303 | + } | ||
| 304 | + }); | ||
| 305 | + } | ||
| 305 | 306 | ||
| 306 | ///获取我的积分 | 307 | ///获取我的积分 |
| 307 | // _getMyIntegral(context) async { | 308 | // _getMyIntegral(context) async { |
| @@ -54,6 +54,7 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | @@ -54,6 +54,7 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | ||
| 54 | } | 54 | } |
| 55 | storeWineProvider.code = Utils.randomBit(6); | 55 | storeWineProvider.code = Utils.randomBit(6); |
| 56 | Map<String, String> params = { | 56 | Map<String, String> params = { |
| 57 | + 'sid':Provider.of<UserModel>(context,listen: false).user.sellerid, | ||
| 57 | "phone": widget.wineManageDetail.phone.replaceAll(' ', ''), | 58 | "phone": widget.wineManageDetail.phone.replaceAll(' ', ''), |
| 58 | "code": storeWineProvider.code, | 59 | "code": storeWineProvider.code, |
| 59 | }; | 60 | }; |
| @@ -62,6 +63,10 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | @@ -62,6 +63,10 @@ class _SmsCodeInputPageState extends State<SmsCodeInputPage> { | ||
| 62 | if (!success) { | 63 | if (!success) { |
| 63 | // _timer.cancel(); | 64 | // _timer.cancel(); |
| 64 | } else { | 65 | } else { |
| 66 | + //刷新我的页面短信余量 | ||
| 67 | + // | ||
| 68 | + bus.emit('refreshMySms'); | ||
| 69 | + | ||
| 65 | Utils.showToast('短信验证码已发送,请注意查收'); | 70 | Utils.showToast('短信验证码已发送,请注意查收'); |
| 66 | } | 71 | } |
| 67 | } | 72 | } |
| 1 | +import 'dart:convert'; | ||
| 2 | + | ||
| 1 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 2 | import 'package:one_key/constant/state.dart'; | 4 | import 'package:one_key/constant/state.dart'; |
| 3 | import 'package:one_key/provider/user_model.dart'; | 5 | import 'package:one_key/provider/user_model.dart'; |
| @@ -28,23 +30,28 @@ class StoreWineProvider with ChangeNotifier { | @@ -28,23 +30,28 @@ class StoreWineProvider with ChangeNotifier { | ||
| 28 | List<OutWineRecordSunModel> outWineRecordData; //某个存酒详情的出库记录 | 30 | List<OutWineRecordSunModel> outWineRecordData; //某个存酒详情的出库记录 |
| 29 | List<OutWineRecordSunModel> outWineRecordHomeData; //存酒详情的出库记录 | 31 | List<OutWineRecordSunModel> outWineRecordHomeData; //存酒详情的出库记录 |
| 30 | String code; //验证码 | 32 | String code; //验证码 |
| 31 | - PhoneCodeSunModel phoneCodeSunModel; | 33 | + // PhoneCodeSunModel phoneCodeSunModel; |
| 32 | 34 | ||
| 33 | /// 给手机发送短信验证码 | 35 | /// 给手机发送短信验证码 |
| 34 | Future<bool> getPhoneCode(BuildContext context, Map<String, String> params, | 36 | Future<bool> getPhoneCode(BuildContext context, Map<String, String> params, |
| 35 | {isShowLoading = true}) async { | 37 | {isShowLoading = true}) async { |
| 36 | - BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | ||
| 37 | - .request<Map<String, dynamic>>( | 38 | + BaseResp<dynamic> baseResp = await DioUtil() |
| 39 | + .request<dynamic>( | ||
| 38 | context, Method.post, HttpUrl.send_vc_code, | 40 | context, Method.post, HttpUrl.send_vc_code, |
| 39 | data: params, showLoading: false) | 41 | data: params, showLoading: false) |
| 40 | .catchError((error) {}); | 42 | .catchError((error) {}); |
| 41 | if (baseResp.code == Constant.status_success) { | 43 | if (baseResp.code == Constant.status_success) { |
| 42 | - if (baseResp.data.isEmpty) { | 44 | + if (baseResp.data == null) { |
| 43 | return false; | 45 | return false; |
| 44 | } else { | 46 | } else { |
| 45 | //解析解析 | 47 | //解析解析 |
| 46 | - phoneCodeSunModel = PhoneCodeModel.fromJson(baseResp.responseData).data; | ||
| 47 | - return true; | 48 | + if(jsonDecode( baseResp.data)['status'] == 'success'){ |
| 49 | +return true; | ||
| 50 | + }else{ | ||
| 51 | + return false; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + | ||
| 48 | } | 55 | } |
| 49 | } else { | 56 | } else { |
| 50 | if (baseResp != null) { | 57 | if (baseResp != null) { |
-
Please register or login to post a comment