Compare commits

..

No commits in common. "e90837a9b7adf9e0dedb8b0cb655fc527b308a85" and "127102726bfa90a20ce07da7b3bae4c12caa0c9c" have entirely different histories.

5 changed files with 36 additions and 1456 deletions

View File

@ -5,7 +5,7 @@ class CommonApi {
///---------post
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';
///[source]=wechat_open [clientId]=428a8310cd442757ae699df5d894f051 [grantType]=social [socialState]=1

View File

@ -24,7 +24,4 @@ class ShopApi {
//
static const String goodsOrderStatus= '/trans/easypay/paymentQuery';
//
static const String cancelGoodsOrder= '/app/order/cancel';
}

View File

@ -1,9 +1,5 @@
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';
@ -53,16 +49,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) {
} catch (e) {
print('报错-------------->${e}');
}
}
@ -70,29 +65,16 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
//
void getOrderDetail({required String orderId}) async {
try {
final res = await Http.get('${ShopApi.goodsOrderDetail}/$orderId');
print('订单详情-------------->${res['data']}');
setState(() {
orderGoodsInfo = res['data']; // data
});
} catch (e) {
Get.back();
}
final res = await Http.get('${ShopApi.goodsOrderDetail}/$orderId');
print('订单详情-------------->${res['data']}');
setState(() {
orderGoodsInfo = res['data']; // data
});
} catch (e) {
Get.back();
}
}
//
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() {
@ -157,7 +139,6 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
child: OutlinedButton(
onPressed: () {
Navigator.of(context).pop();
// getOrderDetail(orderId: _orderId);
getOrderRealStatus(orderId: _orderId); //
},
style: OutlinedButton.styleFrom(
@ -355,6 +336,13 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
}
}
//
void _cancelOrder() {
print('取消订单: $_orderId');
//
}
Widget emptyTip() {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -415,7 +403,7 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
Icons.info,
size: 16.0,
)),
TextSpan(text: getOrderStatusText(orderStatus)),
TextSpan(text: '待支付, '),
TextSpan(text: _countdownFinished ? '倒计时已结束' : ' 剩余 '),
if (!_countdownFinished)
WidgetSpan(
@ -435,7 +423,6 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
interval: const Duration(seconds: 1),
onFinished: () {
print("倒计时结束");
_cancelOrder();
setState(() {
_countdownFinished = true; //
});
@ -546,9 +533,8 @@ class _OrderDetailState extends State<OrderDetail> with SingleTickerProviderStat
color: Colors.grey,
size: 14.0,
),
onTap: ()async {
await Clipboard.setData(ClipboardData(text: _orderId));
MyDialog.toast('订单已复制到剪切板', icon: Icon(Icons.check_circle));
onTap: () {
MyDialog.toast('复制订单信息', icon: Icon(Icons.check_circle));
},
)
],

View File

@ -676,11 +676,7 @@ class _AttentionModuleState extends State<AttentionModule> {
});
final data = res['data'];
logger.d('关注用户的视频列表:$data');
//
if (data == null || data['records'] == null || (data['records'] is List && data['records'].isEmpty)) {
setState(() {
videoList = []; //
});
if (data == null || (data is List && data.isEmpty)) {
return;
}
@ -1019,20 +1015,6 @@ 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