修复商品详情可能会刷新不出来的问题

商品数量默认为1
商品订单接入支付功能
hmxc
张萌 3 years ago
parent fd66b06c7e
commit a96f7beb87

@ -427,4 +427,16 @@ class _Pay {
///
String get dailPayMentCheck => '/user/alipay/dailyPaymentCheckAlipay';
///app ( APP )
String get shoppingAlipay => '/user/alipay/shoppingAlipay';
///
String get shoppingCheck => '/user/alipay/shoppingCheckAlipay';
///app
String get reportRepairAlipay => '/user/alipay/reportRepairAlipay';
///
String get reportReapirCheck => '/user/alipay/reportRepairCheckAlipay';
}

@ -15,7 +15,7 @@ class GoodsDetailModel extends Equatable {
final String categoryName;
final int subscribeNum;
final String detail;
final String arrivalTime;
final String? arrivalTime;
final List<ImgModel> goodsImgList;
final int supplierId;
final String supplierName;

@ -16,7 +16,7 @@ GoodsDetailModel _$GoodsDetailModelFromJson(Map<String, dynamic> json) {
json['categoryName'] as String,
json['subscribeNum'] as int,
json['detail'] as String,
json['arrivalTime'] as String,
json['arrivalTime'] as String?,
(json['goodsImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(),

@ -337,6 +337,8 @@ class _LifePayPageState extends State<LifePayPage> {
),
),
],
//TODO:listview;
body: BeeListView<LifePayModel>(
path: API.manager.dailyPaymentList,
controller: _controller,

@ -126,8 +126,8 @@ class _GoodsDetailPageState extends State<GoodsDetailPage> {
.size(40.sp)
.bold
.color(ktextPrimary)
.make(),
Spacer(),
.make()
.expand(),
'¥${_goodsModel.sellingPrice}'
.text
.size(36.sp)
@ -233,7 +233,7 @@ class _GoodsDetailPageState extends State<GoodsDetailPage> {
color: kPrimaryColor,
height: 80.w,
onPressed: () async {
Get.to(GoodsOrderDetailPage(
Get.off(GoodsOrderDetailPage(
model: _goodsModel,
name: _nameController.text,
phone: _phoneController.text));

@ -3,6 +3,7 @@ import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/market/goods_detail_model.dart';
import 'package:aku_community/pages/life_pay/pay_finish_page.dart';
import 'package:aku_community/pages/life_pay/pay_util.dart';
import 'package:aku_community/ui/profile/house/house_owners_page.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
@ -36,7 +37,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
bool _onload = true;
///
int _num = 0;
int _num = 1;
@override
void initState() {
super.initState();
@ -83,19 +84,28 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
onPressed: () async {
final cancel = BotToast.showLoading();
BaseModel baseModel = await NetUtil().post(
API.market.appointment,
API.pay.shoppingAlipay,
params: {
'goodsId': widget.model.id,
'userName': widget.name,
'userTel': widget.phone,
'num': _num,
'payType': 1,
'payPrice': widget.model.sellingPrice,
},
showMessage: false,
);
cancel();
if (baseModel.status == true) {
Get.off(() => PayFinishPage());
if ((baseModel.status ?? false) &&
!baseModel.message.isEmptyOrNull) {
bool result = await PayUtil()
.callAliPay(baseModel.message!, API.pay.shoppingCheck);
if (result) {
Get.off(PayFinishPage());
}
} else {
BotToast.showText(text: '未能生成订单');
}
cancel();
},
child: '立即支付'.text.size(32.sp).color(ktextPrimary).bold.make()),
);
@ -178,7 +188,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
widget.model.title.text
.size(28.sp)
@ -186,8 +196,10 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
.maxLines(2)
.overflow(TextOverflow.ellipsis)
.bold
.make(),
Spacer(),
.maxLines(2)
.ellipsis
.make()
.expand(),
'¥${widget.model.sellingPrice}'
.text
.size(28.sp)
@ -239,7 +251,7 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
],
),
_rowTile('配送方式', '商家配送'),
_rowTile('订单备注', widget.model.arrivalTime),
_rowTile('订单备注', widget.model.arrivalTime ?? ''),
].sepWidget(
separate: 20.w.heightBox,
),

Loading…
Cancel
Save