1、订单修改
2、增加好友视频
This commit is contained in:
parent
1903385ff3
commit
be7a137b07
@ -5,7 +5,7 @@ class CommonApi {
|
||||
|
||||
///---------post
|
||||
static const String login = '/auth/login'; // 登录 {'phonenumber': '', 'smsCode': '', 'clientId': '428a8310cd442757ae699df5d894f051', 'grantType': 'sms'};
|
||||
static const String checkVersion = '/system/version/list'; // 查询app版本 {'platformType': Platform.isAndroid ? 'android' : 'ios','status': 1}
|
||||
static const String checkVersion = '/app/version/page'; // 查询app版本 {'platformType': Platform.isAndroid ? 'android' : 'ios','status': 1}
|
||||
static const String uploadFile = '/resource/oss/upload';
|
||||
|
||||
///[source]=wechat_open [clientId]=428a8310cd442757ae699df5d894f051 [grantType]=social [socialState]=1
|
||||
|
@ -24,4 +24,7 @@ class ShopApi {
|
||||
// 查询订单状态
|
||||
static const String goodsOrderStatus= '/trans/easypay/paymentQuery';
|
||||
|
||||
// 取消订单
|
||||
static const String cancelGoodsOrder= '/app/order/cancel';
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
library;
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:loopin/service/http.dart';
|
||||
import 'package:loopin/api/shop_api.dart';
|
||||
@ -49,14 +53,15 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
final res = await Http.get('${ShopApi.goodsOrderStatus}/$orderId');
|
||||
// transState
|
||||
var orderStatus = res['data']['transState'];
|
||||
|
||||
print('状态-------------->${orderStatus}');
|
||||
// orderStatus
|
||||
setState(() {
|
||||
orderGoodsInfo['orderStatus'] = orderStatus;
|
||||
});
|
||||
if (orderStatus == 2) { // 已支付
|
||||
MyDialog.toast('支付成功');
|
||||
} else {
|
||||
MyDialog.toast('支付尚未完成,请稍后查看');
|
||||
}
|
||||
|
||||
|
||||
} catch (e) {
|
||||
print('报错-------------->${e}');
|
||||
}
|
||||
@ -75,6 +80,19 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
}
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
void _cancelOrder() async {
|
||||
print('取消订单: $_orderId');
|
||||
try {
|
||||
final res = await Http.post('${ShopApi.cancelGoodsOrder}/$_orderId');
|
||||
print('取消订单成功-------------->${res}');
|
||||
getOrderDetail(orderId: _orderId); // 刷新订单详情数据
|
||||
} catch (e) {
|
||||
print('取消订单失败-------------->${e}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 显示支付结果弹框
|
||||
void _showPaymentResultDialog() {
|
||||
|
||||
@ -139,6 +157,7 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
child: OutlinedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
// getOrderDetail(orderId: _orderId);
|
||||
getOrderRealStatus(orderId: _orderId); // 主动再次拉取订单状态
|
||||
},
|
||||
style: OutlinedButton.styleFrom(
|
||||
@ -336,13 +355,6 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
}
|
||||
}
|
||||
|
||||
// 取消订单
|
||||
void _cancelOrder() {
|
||||
print('取消订单: $_orderId');
|
||||
// 实现取消订单的逻辑
|
||||
}
|
||||
|
||||
|
||||
Widget emptyTip() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -403,7 +415,7 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
Icons.info,
|
||||
size: 16.0,
|
||||
)),
|
||||
TextSpan(text: '待支付, '),
|
||||
TextSpan(text: getOrderStatusText(orderStatus)),
|
||||
TextSpan(text: _countdownFinished ? '倒计时已结束' : ' 剩余 '),
|
||||
if (!_countdownFinished)
|
||||
WidgetSpan(
|
||||
@ -423,6 +435,7 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
interval: const Duration(seconds: 1),
|
||||
onFinished: () {
|
||||
print("倒计时结束");
|
||||
_cancelOrder();
|
||||
setState(() {
|
||||
_countdownFinished = true; // 倒计时结束时更新标志位
|
||||
});
|
||||
@ -533,8 +546,9 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
|
||||
color: Colors.grey,
|
||||
size: 14.0,
|
||||
),
|
||||
onTap: () {
|
||||
MyDialog.toast('复制订单信息', icon: Icon(Icons.check_circle));
|
||||
onTap: ()async {
|
||||
await Clipboard.setData(ClipboardData(text: _orderId));
|
||||
MyDialog.toast('订单已复制到剪切板', icon: Icon(Icons.check_circle));
|
||||
},
|
||||
)
|
||||
],
|
||||
|
@ -676,7 +676,11 @@ class _AttentionModuleState extends State<AttentionModule> {
|
||||
});
|
||||
final data = res['data'];
|
||||
logger.d('关注用户的视频列表:$data');
|
||||
if (data == null || (data is List && data.isEmpty)) {
|
||||
// 处理空数据情况
|
||||
if (data == null || data['records'] == null || (data['records'] is List && data['records'].isEmpty)) {
|
||||
setState(() {
|
||||
videoList = []; // 清空视频列表
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1014,6 +1018,20 @@ class _AttentionModuleState extends State<AttentionModule> {
|
||||
color: Colors.black,
|
||||
child: Column(
|
||||
children: [
|
||||
// 添加暂无数据提示
|
||||
if (videoList.isEmpty && !isLoadingMore)
|
||||
Expanded(
|
||||
child: Center(
|
||||
child: Text(
|
||||
'暂无数据',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
else
|
||||
Expanded(
|
||||
child: Stack(
|
||||
children: [
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user