对接 商城订单

对接 消息中心
对接 用户头像
pull/1/head
张萌 3 years ago
parent 04dd9c7e48
commit 18529da4fb

@ -8,6 +8,7 @@ class _MarketApi {
_Rotation rotation = _Rotation();
_ShopCart shopCart = _ShopCart();
_Address address = _Address();
_Order order = _Order();
}
class _ShopCart {
@ -83,3 +84,20 @@ class _Rotation {
///app
String get rotation => '/app/user/shop/rotation/list';
}
class _Order {
///
String get findLogistics => '/app/user/shop/order/findLogistics';
///app
String get confirm => '/app/user/shop/order/confirm';
///app
String get delete => '/app/user/shop/order/appDelete';
///app
String get cancel => '/app/user/shop/order/cancel';
///
String get myOrder => '/app/user/shop/order/myOrder';
}

@ -21,6 +21,8 @@ class SARSAPI {
static _Login login = _Login();
static _User user = _User();
static _House house = _House();
static _File uploadFile = _File();
static _Message message = _Message();
///
static _ProfileApi profile = _ProfileApi();
@ -53,6 +55,9 @@ class _User {
///
String get certification => '/app/user/verified';
///
String get updateAvatar => '/app/user/updateAvatarImg';
}
class _Login {
@ -73,3 +78,57 @@ class _House {
///()
String get allHouses => '/app/estate/findEstateCascade';
}
class _File {
///app
String get uploadImg => '/app/user/upload/uploadImg';
}
class _Message {
///
String get allRead => '/app/user/message/allRead';
///
String get read => '/app/user/message/read';
///
String get allLikes => '/app/user/message/likesMessage';
///
String get allComment => '/app/user/message/commentMessage';
}
class _Community {
///
String get dynamicDetail => '/app/user/community/dynamic/details';
///
String get dynamicLike => '/app/user/community/dynamic/likes';
///
String get commentLike => '/app/user/community/comment/likes';
///
String get commentInsert => '/app/user/community/comment/insert';
///
String get commentList => '/app/user/community/comment/list';
///
String get dynamicInsert => '/app/user/community/dynamic/insert';
///()
String get dynamicMyListH => '/app/user/community/dynamic/myListH';
///()
String get dynamicMyListL => '/app/user/community/dynamic/myListL';
///
String get dynamicList => '/app/user/community/dynamic/list';
///
String get topicList => '/app/user/community/topic/list';
///
String get topNewList => '/app/user/community/topic/newList';
}

@ -5,13 +5,14 @@ class OrderListModel {
int? payType;
double? payPrice;
double? freightFee;
int? jcookAddressId;
int? appGoodsAddressId;
String? receiverName;
String? receiverTel;
String? locationName;
String? addressDetail;
String? createDate;
List<MyOrderListVoList>? myOrderListVoList;
String? remake;
List<MyOrderListVoList>? orderList;
OrderListModel(
{this.id,
@ -25,8 +26,9 @@ class OrderListModel {
this.locationName,
this.addressDetail,
this.createDate,
this.myOrderListVoList,
this.jcookAddressId});
this.remake,
this.appGoodsAddressId,
this.orderList});
OrderListModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -40,14 +42,15 @@ class OrderListModel {
locationName = json['locationName'];
addressDetail = json['addressDetail'];
createDate = json['createDate'];
jcookAddressId = json['jcookAddressId'];
if (json['myOrderListVoList'] != null) {
myOrderListVoList = [];
json['myOrderListVoList'].forEach((v) {
myOrderListVoList!.add(new MyOrderListVoList.fromJson(v));
remake = json['remake'];
appGoodsAddressId = json['appGoodsAddressId'];
if (json['orderList'] != null) {
orderList = [];
json['orderList'].forEach((v) {
orderList!.add(new MyOrderListVoList.fromJson(v));
});
} else {
myOrderListVoList = [];
orderList = [];
}
}
@ -64,10 +67,11 @@ class OrderListModel {
data['locationName'] = this.locationName;
data['addressDetail'] = this.addressDetail;
data['createDate'] = this.createDate;
data['jcookAddressId'] = this.jcookAddressId;
if (this.myOrderListVoList != null) {
data['jcookAddressId'] = this.appGoodsAddressId;
data['remake'] = this.remake;
if (this.orderList != null) {
data['myOrderListVoList'] =
this.myOrderListVoList!.map((v) => v.toJson()).toList();
this.orderList!.map((v) => v.toJson()).toList();
}
return data;
}
@ -75,7 +79,8 @@ class OrderListModel {
class MyOrderListVoList {
int? id;
int? jcookGoodsId;
int? goodsPushId;
int? appSkuId;
String? skuName;
String? mainPhoto;
double? sellPrice;
@ -87,7 +92,8 @@ class MyOrderListVoList {
MyOrderListVoList(
{this.id,
this.jcookGoodsId,
this.appSkuId,
this.goodsPushId,
this.skuName,
this.mainPhoto,
this.sellPrice,
@ -99,7 +105,8 @@ class MyOrderListVoList {
MyOrderListVoList.fromJson(Map<String, dynamic> json) {
id = json['id'];
jcookGoodsId = json['jcookGoodsId'];
goodsPushId = json['goodsPushId'];
appSkuId = json['appSkuId'];
skuName = json['skuName'];
mainPhoto = json['mainPhoto'];
sellPrice = json['sellPrice'];
@ -113,7 +120,8 @@ class MyOrderListVoList {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['jcookGoodsId'] = this.jcookGoodsId;
data['appSkuId'] = this.appSkuId;
data['goodsPushId'] = this.goodsPushId;
data['skuName'] = this.skuName;
data['mainPhoto'] = this.mainPhoto;
data['sellPrice'] = this.sellPrice;

@ -11,18 +11,21 @@ class ChinaRegionModel {
@HiveField(1)
final String name;
@HiveField(2)
final List<ChinaRegionModel> cityList;
final int parentId;
@HiveField(3)
final List<ChinaRegionModel>? cityList;
factory ChinaRegionModel.fromJson(Map<String, dynamic> json) =>
_$ChinaRegionModelFromJson(json);
static ChinaRegionModel empty(int parentId) {
return ChinaRegionModel(id: 0, name: '', cityList: [], parentId: 0);
}
const ChinaRegionModel({
required this.id,
required this.name,
required this.cityList,
required this.parentId,
this.cityList,
});
static ChinaRegionModel empty(int parentId) {
return ChinaRegionModel(id: 0, name: '', cityList: []);
}
}

@ -19,19 +19,22 @@ class ChinaRegionModelAdapter extends TypeAdapter<ChinaRegionModel> {
return ChinaRegionModel(
id: fields[0] as int,
name: fields[1] as String,
cityList: (fields[2] as List).cast<ChinaRegionModel>(),
parentId: fields[2] as int,
cityList: (fields[3] as List?)?.cast<ChinaRegionModel>(),
);
}
@override
void write(BinaryWriter writer, ChinaRegionModel obj) {
writer
..writeByte(3)
..writeByte(4)
..writeByte(0)
..write(obj.id)
..writeByte(1)
..write(obj.name)
..writeByte(2)
..write(obj.parentId)
..writeByte(3)
..write(obj.cityList);
}
@ -54,7 +57,8 @@ ChinaRegionModel _$ChinaRegionModelFromJson(Map<String, dynamic> json) =>
ChinaRegionModel(
id: json['id'] as int,
name: json['name'] as String,
cityList: (json['cityList'] as List<dynamic>)
.map((e) => ChinaRegionModel.fromJson(e as Map<String, dynamic>))
parentId: json['parentId'] as int,
cityList: (json['cityList'] as List<dynamic>?)
?.map((e) => ChinaRegionModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -9,16 +9,16 @@ part of 'good_detail_model.dart';
GoodDetailModel _$GoodDetailModelFromJson(Map<String, dynamic> json) =>
GoodDetailModel(
id: json['id'] as int,
jcookImageVoList: (json['jcookImageVoList'] as List<dynamic>)
.map((e) => JcookImageVoList.fromJson(e as Map<String, dynamic>))
jcookImageVoList: (json['jcookImageVoList'] as List<dynamic>?)
?.map((e) => JcookImageVoList.fromJson(e as Map<String, dynamic>))
.toList(),
sellPrice: json['sellPrice'] as num,
discountPrice: json['discountPrice'] as num,
skuName: json['skuName'] as String,
skuName: json['skuName'] as String?,
status: json['status'] as int,
shopStatus: json['shopStatus'] as int,
sellNum: json['sellNum'] as int,
kind: json['kind'] as int,
sellNum: json['sellNum'] as int?,
kind: json['kind'] as int?,
defaultLocation: json['defaultLocation'] as String,
defaultAddressDetail: json['defaultAddressDetail'] as String,
stockStatus: json['stockStatus'] as int,
@ -51,6 +51,6 @@ JcookSpecificationVoList _$JcookSpecificationVoListFromJson(
);
Attribute _$AttributeFromJson(Map<String, dynamic> json) => Attribute(
name: json['name'] as String,
value: json['value'] as String,
name: json['name'] as String?,
value: json['value'] as String?,
);

@ -10,7 +10,7 @@ MarketAllCategoryModel _$MarketAllCategoryModelFromJson(
Map<String, dynamic> json) =>
MarketAllCategoryModel(
id: json['id'] as int,
name: json['name'] as String,
name: json['name'] as String?,
imgUrls:
(json['imgUrls'] as List<dynamic>).map((e) => e as String).toList(),
categoryList: (json['categoryList'] as List<dynamic>)

@ -9,7 +9,7 @@ part of 'market_category_model.dart';
MarketCategoryModel _$MarketCategoryModelFromJson(Map<String, dynamic> json) =>
MarketCategoryModel(
id: json['id'] as int,
name: json['name'] as String,
name: json['name'] as String?,
imgUrls:
(json['imgUrls'] as List<dynamic>).map((e) => e as String).toList(),
);

@ -6,22 +6,30 @@ part 'reply_list_model.g.dart';
@JsonSerializable()
class ReplyListModel {
final int id;
final String name;
final String date;
final int status;
final String content;
final ImgModel img;
final String title;
final ImgModel pic;
final int sendId;
final String sendName;
final String sendDate;
final List<ImgModel> avatarImgList;
final List<ImgModel> dynamicImgList;
factory ReplyListModel.fromJson(Map<String, dynamic> json) =>
_$ReplyListModelFromJson(json);
String get avatar =>
avatarImgList.isEmpty ? '' : avatarImgList.first.url ?? '';
String get pic =>
dynamicImgList.isEmpty ? '' : dynamicImgList.first.url ?? '';
const ReplyListModel({
required this.id,
required this.name,
required this.date,
required this.status,
required this.content,
required this.img,
required this.title,
required this.pic,
required this.sendId,
required this.sendName,
required this.sendDate,
required this.avatarImgList,
required this.dynamicImgList,
});
}

@ -9,10 +9,15 @@ part of 'reply_list_model.dart';
ReplyListModel _$ReplyListModelFromJson(Map<String, dynamic> json) =>
ReplyListModel(
id: json['id'] as int,
name: json['name'] as String,
date: json['date'] as String,
status: json['status'] as int,
content: json['content'] as String,
img: ImgModel.fromJson(json['img'] as Map<String, dynamic>),
title: json['title'] as String,
pic: ImgModel.fromJson(json['pic'] as Map<String, dynamic>),
sendId: json['sendId'] as int,
sendName: json['sendName'] as String,
sendDate: json['sendDate'] as String,
avatarImgList: (json['avatarImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
dynamicImgList: (json['dynamicImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -1,3 +1,4 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'user_info_model.g.dart';
@ -6,6 +7,7 @@ part 'user_info_model.g.dart';
class UserInfoModel {
final int id;
final int communityId;
final String communityCode;
final String? name;
final String? idCard;
final String tel;
@ -17,6 +19,7 @@ class UserInfoModel {
final bool isPointsSignSetting;
final bool isSign;
final int? points;
final List<ImgModel> imgList;
String get sexValue {
if (sex == 1) return '';
@ -40,6 +43,7 @@ class UserInfoModel {
const UserInfoModel({
required this.id,
required this.communityId,
required this.communityCode,
this.name,
this.idCard,
required this.tel,
@ -49,5 +53,6 @@ class UserInfoModel {
required this.isPointsSignSetting,
required this.isSign,
this.points,
required this.imgList,
});
}

@ -10,6 +10,7 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
UserInfoModel(
id: json['id'] as int,
communityId: json['communityId'] as int,
communityCode: json['communityCode'] as String,
name: json['name'] as String?,
idCard: json['idCard'] as String?,
tel: json['tel'] as String,
@ -19,4 +20,7 @@ UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
isPointsSignSetting: json['isPointsSignSetting'] as bool,
isSign: json['isSign'] as bool,
points: json['points'] as int?,
imgList: (json['imgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),
);

@ -1,11 +1,15 @@
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart';
import 'package:aku_new_community/pages/message_center_page/reply/replay_view.dart';
import 'package:aku_new_community/pages/message_center_page/thumbs_up/thumbs_up_view.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/all_select_button.dart';
import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/src/extensions/string_ext.dart';
class MessageCenterPage extends StatefulWidget {
MessageCenterPage({Key? key}) : super(key: key);
@ -16,10 +20,10 @@ class MessageCenterPage extends StatefulWidget {
class _MessageCenterPageState extends State<MessageCenterPage>
with TickerProviderStateMixin {
EasyRefreshController _refreshController = EasyRefreshController();
List<EasyRefreshController> _controllers =
List.generate(2, (index) => EasyRefreshController());
List<String> _tabs = ['回复我的', '收到的赞', '通知公告'];
late final TabController _tabController;
bool inEdit = false;
@override
void initState() {
@ -34,7 +38,9 @@ class _MessageCenterPageState extends State<MessageCenterPage>
@override
void dispose() {
_refreshController.dispose();
for (var item in _controllers) {
item.dispose();
}
super.dispose();
}
@ -43,13 +49,21 @@ class _MessageCenterPageState extends State<MessageCenterPage>
return BeeScaffold(
title: '消息',
actions: [
// MaterialButton(
// onPressed: () async {
// setState(() {});
// },
// child: '${inEdit ? '取消' : '编辑'}'.text.size(28.sp).black.make(),
// padding: EdgeInsets.symmetric(horizontal: 32.w),
// ),
MaterialButton(
onPressed: () async {
var res = await NetUtil().get(SARSAPI.message.allRead, params: {
'type': _tabController.index + 1,
});
if (res.success) {
_controllers[_tabController.index].callRefresh();
setState(() {});
} else {
BotToast.showText(text: res.msg);
}
},
child: '全部已读'.text.size(28.sp).black.make(),
padding: EdgeInsets.symmetric(horizontal: 32.w),
),
],
appBarBottom: BeeTabBar(
controller: _tabController,
@ -57,18 +71,16 @@ class _MessageCenterPageState extends State<MessageCenterPage>
),
body: TabBarView(
children: [
ReplayView(),
ThumbsUpView(),
ReplayView(
controller: _controllers[0],
),
ThumbsUpView(
controller: _controllers[1],
),
AnnounceView(),
],
controller: _tabController,
),
bottomNavi: Offstage(
offstage: !inEdit,
child: AllSelectButton(
onPressed: () {},
selected: true,
)),
);
}
}

@ -1,7 +1,9 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/model/message/system_message_detail_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
class MessageFunc {
static Future<SystemMessageDetailModel> getSystemMessageDetial(
@ -12,4 +14,16 @@ class MessageFunc {
});
return SystemMessageDetailModel.fromJson(baseModel.data);
}
static Future<bool> readMessage(int? id) async {
BaseModel baseModel = await NetUtil().get(SARSAPI.message.read, params: {
'messageId': id,
});
if (baseModel.success) {
return true;
} else {
BotToast.showText(text: baseModel.msg);
return false;
}
}
}

@ -1,4 +1,6 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/message/reply_list_model.dart';
import 'package:aku_new_community/pages/message_center_page/reply/reply_card.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -6,15 +8,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class ReplayView extends StatefulWidget {
const ReplayView({Key? key}) : super(key: key);
final EasyRefreshController controller;
const ReplayView({Key? key, required this.controller}) : super(key: key);
@override
_ReplayViewState createState() => _ReplayViewState();
}
class _ReplayViewState extends State<ReplayView> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void initState() {
super.initState();
@ -22,22 +23,20 @@ class _ReplayViewState extends State<ReplayView> {
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.host,
controller: _refreshController,
convert: (json) {
return [];
},
path: SARSAPI.message.allComment,
controller: widget.controller,
convert: (models) =>
models.tableList!.map((e) => ReplyListModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
itemBuilder: (context, index) {
return Container();
return ReplyCard(model: items[index]);
},
separatorBuilder: (_, __) => 20.w.heightBox,
itemCount: items.length);

@ -1,6 +1,7 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/models/message/reply_list_model.dart';
import 'package:aku_new_community/pages/message_center_page/message_func.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
@ -12,42 +13,47 @@ class ReplyCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
child: Row(
children: [
ClipOval(
child: Image.network(
API.image(model.img.url),
width: 100.w,
height: 100.w,
return GestureDetector(
onTap: () async {
await MessageFunc.readMessage(model.id);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
child: Row(
children: [
ClipOval(
child: Image.network(
API.image(model.avatar),
width: 100.w,
height: 100.w,
),
),
),
24.w.widthBox,
SizedBox(
width: 350.w,
child: Column(
children: [
model.title.text.size(26.sp).black.bold.make(),
model.content.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(1)
.ellipsis
.make(),
model.date.text.size(24.sp).color(ktextSubColor).make(),
],
24.w.widthBox,
SizedBox(
width: 350.w,
child: Column(
children: [
model.sendName.text.size(26.sp).black.bold.make(),
model.content.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(1)
.ellipsis
.make(),
model.sendDate.text.size(24.sp).color(ktextSubColor).make(),
],
),
),
),
ClipRRect(
borderRadius: BorderRadius.circular(9.w),
child: Image.network(
API.image(model.pic.url),
width: 128.w,
height: 128.w,
ClipRRect(
borderRadius: BorderRadius.circular(9.w),
child: Image.network(
API.image(model.pic),
width: 128.w,
height: 128.w,
),
),
),
],
],
),
),
);
}

@ -2,49 +2,55 @@ import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/message/reply_list_model.dart';
import 'package:aku_new_community/pages/message_center_page/message_func.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class thumbs_up_card extends StatelessWidget {
class ThumbsUpCard extends StatelessWidget {
final ReplyListModel model;
const thumbs_up_card({Key? key, required this.model}) : super(key: key);
const ThumbsUpCard({Key? key, required this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
child: Row(
children: [
ClipOval(
child: Image.network(
API.image(model.img.url),
width: 100.w,
height: 100.w,
return GestureDetector(
onTap: () async {
await MessageFunc.readMessage(model.id);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
child: Row(
children: [
ClipOval(
child: Image.network(
API.image(model.avatar),
width: 100.w,
height: 100.w,
),
),
),
24.w.widthBox,
SizedBox(
width: 350.w,
child: Column(
children: [
model.name.text.size(26.sp).black.bold.make(),
Assets.icons.communityLikeIs
.image(width: 28.w, height: 28.w, fit: BoxFit.contain),
model.date.text.size(24.sp).color(ktextSubColor).make(),
],
24.w.widthBox,
SizedBox(
width: 350.w,
child: Column(
children: [
model.sendName.text.size(26.sp).black.bold.make(),
Assets.icons.communityLikeIs
.image(width: 28.w, height: 28.w, fit: BoxFit.contain),
model.sendDate.text.size(24.sp).color(ktextSubColor).make(),
],
),
),
),
ClipRRect(
borderRadius: BorderRadius.circular(9.w),
child: Image.network(
API.image(model.pic.url),
width: 128.w,
height: 128.w,
ClipRRect(
borderRadius: BorderRadius.circular(9.w),
child: Image.network(
API.image(model.pic),
width: 128.w,
height: 128.w,
),
),
),
],
],
),
),
);
}

@ -1,4 +1,6 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/message/reply_list_model.dart';
import 'package:aku_new_community/pages/message_center_page/thumbs_up/thumbs_up_card.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -6,31 +8,30 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class ThumbsUpView extends StatefulWidget {
const ThumbsUpView({Key? key}) : super(key: key);
final EasyRefreshController controller;
const ThumbsUpView({Key? key, required this.controller}) : super(key: key);
@override
_ThumbsUpViewState createState() => _ThumbsUpViewState();
}
class _ThumbsUpViewState extends State<ThumbsUpView> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.host,
controller: _refreshController,
convert: (json) => [],
path: SARSAPI.message.allLikes,
controller: widget.controller,
convert: (models) =>
models.tableList!.map((e) => ReplyListModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
itemBuilder: (context, index) {
return Container();
return ThumbsUpCard(model: items[index]);
},
separatorBuilder: (_, __) => 20.w.heightBox,
itemCount: items.length);

@ -1,7 +1,7 @@
import 'dart:io';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/pages/personal/change_nick_name_page.dart';
import 'package:aku_new_community/pages/personal/update_tel_page.dart';
import 'package:aku_new_community/provider/user_provider.dart';
@ -69,7 +69,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
//Upload Avatar
Function cancel = BotToast.showLoading();
BaseFileModel model =
await NetUtil().upload(API.upload.uploadAvatar, file);
await NetUtil().upload(SARSAPI.uploadFile.uploadImg, file);
if (model.status ?? false)
userProvider.updateAvatar(model.url);
else

@ -5,9 +5,12 @@ import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:sms_autofill/sms_autofill.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../tab_navigator.dart';
class CodeMessagePage extends StatefulWidget {
final String tel;
@ -85,6 +88,7 @@ class _CodeMessagePageState extends State<CodeMessagePage> {
await UserTool.userProvider
.setLogin(re.data['data'] as int);
await UserTool.dataProvider.addHistories();
Get.offAll(() => TabNavigator());
} else {
_errorMessage = re.data['msg'];
BotToast.showText(text: re.data['msg']);

@ -16,6 +16,8 @@ import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../tab_navigator.dart';
class OtherLoginPage extends StatefulWidget {
const OtherLoginPage({Key? key}) : super(key: key);
@ -106,6 +108,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
if (response.data['success']) {
await UserTool.userProvider.setLogin(response.data['data']);
await UserTool.dataProvider.addHistories();
Get.offAll(() => TabNavigator());
} else {
BotToast.showText(text: response.data['message']);
}
@ -131,6 +134,10 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
BotToast.showText(text: '请先选择小区!');
return false;
}
if (_currentIndex == 0 && _psd.text.isEmpty) {
BotToast.showText(text: '密码不能为空');
return false;
}
return true;
}

@ -15,8 +15,6 @@ import 'package:dio/dio.dart';
import 'package:get/get.dart' hide Response;
import 'package:provider/provider.dart';
import '../tab_navigator.dart';
class SignFunc {
//
static Future<BaseModel> sendMessageCode(
@ -169,8 +167,6 @@ class SignFunc {
await Get.to(() => SetPsdPage());
} else if (UserTool.userProvider.userInfoModel!.nickName == null) {
await Get.to(() => SetNickNamePage());
} else {
Get.offAll(() => TabNavigator());
}
}

@ -20,6 +20,8 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart';
import '../tab_navigator.dart';
class SplashPage extends StatefulWidget {
SplashPage({Key? key}) : super(key: key);
@ -136,6 +138,7 @@ class _SplashPageState extends State<SplashPage> {
MainInitialize.initTheme();
MainInitialize.initWechat();
MainInitialize.initWebSocket();
Get.offAll(() => TabNavigator());
});
}

@ -1,6 +1,7 @@
import 'dart:io';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/models/user/my_house_model.dart';
import 'package:aku_new_community/models/user/user_config_model.dart';
import 'package:aku_new_community/models/user/user_info_model.dart';
@ -161,7 +162,7 @@ class UserProvider extends ChangeNotifier {
///
Future updateAvatar(String? path) async {
BaseModel model = await NetUtil().post(
API.user.udpdateAvatar,
SARSAPI.user.updateAvatar,
params: {
'fileUrls': [path]
},

@ -1,5 +1,6 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/model/order/order_list_model.dart';
import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart';
import 'package:aku_new_community/pages/life_pay/pay_util.dart';
@ -60,9 +61,9 @@ class _OrderCardState extends State<OrderCard> {
@override
void initState() {
super.initState();
widget.model.myOrderListVoList!.forEach((element) {
widget.model.orderList!.forEach((element) {
_goodsList.add(SettlementGoodsDTO(
appGoodsPushId: element.jcookGoodsId, num: element.num));
appGoodsPushId: element.goodsPushId, num: element.num));
});
}
@ -70,7 +71,7 @@ class _OrderCardState extends State<OrderCard> {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().post(API.pay.jcookOrderCreateOrder, params: {
"addressId": widget.model.jcookAddressId,
"addressId": widget.model.appGoodsAddressId,
"settlementGoodsDTOList": _goodsList.map((v) => v.toJson()).toList(),
"payType": 1, //
"payPrice": widget.model.payPrice
@ -105,7 +106,7 @@ class _OrderCardState extends State<OrderCard> {
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().get(API.market.deleteOrder, params: {
await NetUtil().get(SARSAPI.market.order.delete, params: {
"orderId": widget.model.id,
});
if (baseModel.success) {
@ -135,7 +136,7 @@ class _OrderCardState extends State<OrderCard> {
);
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel = await NetUtil().get(API.market.cancelOrder,
BaseModel baseModel = await NetUtil().get(SARSAPI.market.order.cancel,
params: {"orderId": widget.model.id, 'cancelReasonCode': 4});
if (baseModel.success) {
BotToast.showText(text: '取消成功');
@ -165,7 +166,7 @@ class _OrderCardState extends State<OrderCard> {
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().get(API.market.confirmOrder, params: {
await NetUtil().get(SARSAPI.market.order.confirm, params: {
"orderId": widget.model.id,
});
if (baseModel.success) {
@ -211,7 +212,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,
@ -265,7 +266,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,
@ -319,7 +320,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,
@ -379,7 +380,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,
@ -433,7 +434,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,
@ -487,7 +488,7 @@ class _OrderCardState extends State<OrderCard> {
color: Color(0xFFD9D9D9),
),
16.hb,
...widget.model.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.model.orderList!.map((e) => _goodCard(e)),
20.hb,
_priceView(),
20.hb,

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/model/order/logistics_model.dart';
import 'package:aku_new_community/model/order/order_list_model.dart';
import 'package:aku_new_community/pages/life_pay/pay_util.dart';
@ -56,7 +57,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().post(API.pay.jcookOrderCreateOrder, params: {
"addressId": widget.orderModel.jcookAddressId,
"addressId": widget.orderModel.appGoodsAddressId,
"settlementGoodsDTOList": _goodsList.map((v) => v.toJson()).toList(),
"payType": 1, //
"payPrice": widget.orderModel.payPrice
@ -93,7 +94,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().get(API.market.deleteOrder, params: {
await NetUtil().get(SARSAPI.market.order.delete, params: {
"orderId": widget.orderModel.id,
});
if (baseModel.success) {
@ -124,7 +125,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
);
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel = await NetUtil().get(API.market.cancelOrder,
BaseModel baseModel = await NetUtil().get(SARSAPI.market.order.cancel,
params: {"orderId": widget.orderModel.id, 'cancelReasonCode': 4});
if (baseModel.success) {
BotToast.showText(text: '取消成功');
@ -155,7 +156,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
if (result == true) {
Function cancel = BotToast.showLoading();
BaseModel baseModel =
await NetUtil().get(API.market.confirmOrder, params: {
await NetUtil().get(SARSAPI.market.order.confirm, params: {
"orderId": widget.orderModel.id,
});
if (baseModel.success) {
@ -170,9 +171,9 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
@override
void initState() {
super.initState();
widget.orderModel.myOrderListVoList!.forEach((element) {
widget.orderModel.orderList!.forEach((element) {
_goodsList.add(SettlementGoodsDTO(
appGoodsPushId: element.jcookGoodsId, num: element.num));
appGoodsPushId: element.goodsPushId, num: element.num));
});
if (widget.orderModel.tradeStatus == 0) {
timer = Timer.periodic(Duration(seconds: 1), (Timer t) => _checkTime());
@ -294,7 +295,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
),
child: Column(
children: [
...widget.orderModel.myOrderListVoList!.map((e) => _goodCard(e)),
...widget.orderModel.orderList!.map((e) => _goodCard(e)),
_priceView(),
],
),
@ -544,8 +545,8 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
Spacer(),
LineButton(
onPressed: () async {
BaseModel baseModel =
await NetUtil().get(API.market.findLogistics, params: {
BaseModel baseModel = await NetUtil()
.get(SARSAPI.market.order.findLogistics, params: {
"orderId": widget.orderModel.id,
});
if (baseModel.success == true && baseModel.data != null) {
@ -555,7 +556,7 @@ class _OrderDetailPageState extends State<OrderDetailPage> {
if (logisticsModels.isNotEmpty) {
Get.to(() => LogisticsPage(
models: logisticsModels,
goods: widget.orderModel.myOrderListVoList!.first,
goods: widget.orderModel.orderList!.first,
orderModel: widget.orderModel));
} else {
BotToast.showText(text: '未获取到物流信息');

@ -1,4 +1,4 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/model/order/order_list_model.dart';
import 'package:aku_new_community/pages/things_page/widget/bee_list_view.dart';
import 'package:flutter/material.dart';
@ -34,7 +34,7 @@ class _OrderViewState extends State<OrderView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.market.myOrder,
path: SARSAPI.market.order.myOrder,
controller: _refreshController,
extraParams: {"tradeStatus": widget.index, 'orderCode': null},
convert: (models) {

@ -39,9 +39,9 @@ class _BeeCityPickerState extends State<BeeCityPicker> {
? ChinaRegionModel.empty(_pickedCity.id)
: districts[_pickedDistrictIndex];
List<ChinaRegionModel> get cities => _pickedProvince.cityList;
List<ChinaRegionModel> get cities => _pickedProvince.cityList ?? [];
List<ChinaRegionModel> get districts => _pickedCity.cityList;
List<ChinaRegionModel> get districts => _pickedCity.cityList ?? [];
final FixedExtentScrollController _cityController =
FixedExtentScrollController();

Loading…
Cancel
Save