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

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

@ -427,4 +427,16 @@ class _Pay {
/// ///
String get dailPayMentCheck => '/user/alipay/dailyPaymentCheckAlipay'; 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 String categoryName;
final int subscribeNum; final int subscribeNum;
final String detail; final String detail;
final String arrivalTime; final String? arrivalTime;
final List<ImgModel> goodsImgList; final List<ImgModel> goodsImgList;
final int supplierId; final int supplierId;
final String supplierName; final String supplierName;

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

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

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

Loading…
Cancel
Save