update powerlogger version,用户手机号显示开关对接,我的店铺成员手机号、微信号和销售额显示

master
laiiihz 4 years ago
parent 3e4f92c624
commit 25de741b86

@ -85,6 +85,9 @@ class UserAPI {
///
String get confirmUserCardChange => '/v2/app/user/welfare/notice/look';
///
String get securePhone => '/v2/app/user/secret';
}
class BenefitAPI {

@ -1,6 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:recook/constants/api_v2.dart';
import 'package:recook/constants/header.dart';
import 'package:recook/manager/http_manager.dart';
import 'package:recook/widgets/custom_app_bar.dart';
import 'package:recook/widgets/progress/re_toast.dart';
import 'package:recook/widgets/sc_tile.dart';
@ -14,7 +16,13 @@ class AccountAndSafetyPage extends StatefulWidget {
}
class _AccountAndSafetyPageState extends State<AccountAndSafetyPage> {
bool switchTest = false;
bool secureValue = false;
@override
void initState() {
super.initState();
//TODO
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -48,11 +56,11 @@ class _AccountAndSafetyPageState extends State<AccountAndSafetyPage> {
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: () async {
final cancel = ReToast.loading(text: '修改中');
await Future.delayed(Duration(seconds: 2));
secureValue = !secureValue;
await HttpManager.post(
APIV2.userAPI.securePhone, {'secure': secureValue ? 1 : 0});
cancel();
setState(() {
switchTest = !switchTest;
});
setState(() {});
},
child: Row(
children: [
@ -68,15 +76,15 @@ class _AccountAndSafetyPageState extends State<AccountAndSafetyPage> {
],
).expand(),
CupertinoSwitch(
value: switchTest,
value: secureValue,
trackColor: Color(0xFFDB2D2D),
onChanged: (state) async {
final cancel = ReToast.loading(text: '修改中');
await Future.delayed(Duration(seconds: 2));
secureValue = !secureValue;
await HttpManager.post(APIV2.userAPI.securePhone,
{'secure': secureValue ? 1 : 0});
cancel();
setState(() {
switchTest = !switchTest;
});
setState(() {});
},
),
],

@ -16,10 +16,15 @@ class GroupInviteCard extends StatelessWidget {
final UserCommonModel model;
const GroupInviteCard({Key key, @required this.model}) : super(key: key);
_renderItem(String asset, String value) {
String displayValue = value;
if (displayValue?.isEmpty ?? true) {
displayValue = '';
}
return Row(
children: [
Image.asset(asset, width: 10.w, height: 10.w),
value.text.size(11.sp).color(Color(0xFF999999)).make().expand(),
2.wb,
displayValue.text.size(11.sp).color(Color(0xFF999999)).make().expand(),
],
).expand();
}
@ -184,7 +189,10 @@ class GroupInviteCard extends StatelessWidget {
children: [
_renderItem(
R.ASSETS_USER_ICON_GROUP_PNG, model.count.toString()),
_renderItem(R.ASSETS_USER_ICON_MONEY_PNG, 'TODO 销售额'),
_renderItem(
R.ASSETS_USER_ICON_MONEY_PNG,
model.amount.toStringAsFixed(2),
),
],
),
16.hb,

@ -10,21 +10,24 @@ class UserCommonModel {
int count;
int roleLevel;
int flag;
num amount;
UserRoleLevel get roleLevelEnum => UserLevelTool.roleLevelEnum(roleLevel);
bool get isRecommand => flag == 1;
UserCommonModel(
{this.userId,
this.headImgUrl,
this.nickname,
this.phone,
this.wechatNo,
this.remarkName,
this.count,
this.roleLevel,
this.flag});
UserCommonModel({
this.userId,
this.headImgUrl,
this.nickname,
this.phone,
this.wechatNo,
this.remarkName,
this.count,
this.roleLevel,
this.flag,
this.amount,
});
UserCommonModel.fromJson(Map<String, dynamic> json) {
userId = json['userId'];
@ -36,6 +39,7 @@ class UserCommonModel {
count = json['count'];
roleLevel = json['roleLevel'];
flag = json['flag'];
amount = json['amount'];
}
Map<String, dynamic> toJson() {

@ -713,6 +713,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.19"
logger:
dependency: transitive
description:
name: logger
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.9.4"
logging:
dependency: transitive
description:
@ -982,7 +989,7 @@ packages:
name: power_logger
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3"
version: "0.1.4"
pretty_json:
dependency: transitive
description:

@ -222,7 +222,7 @@ dependencies:
animations:
power_logger: ^0.1.2
power_logger: ^0.1.4
pin_input_text_field: ^3.3.0
device_info: ^1.0.0

Loading…
Cancel
Save