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