bug fixed
This commit is contained in:
@@ -114,8 +114,9 @@ class _HomePageState extends State<HomePage> {
|
||||
|
||||
List<BannerModel> listBanner = [];
|
||||
|
||||
getBanner() {
|
||||
/* getBanner() {
|
||||
Api.get(context, Api.banner).then((value) => {
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
value.forEach((v) {
|
||||
@@ -128,26 +129,65 @@ class _HomePageState extends State<HomePage> {
|
||||
else
|
||||
{}
|
||||
});
|
||||
}*/
|
||||
getBanner() {
|
||||
Api.get(context, Api.banner).then((value) {
|
||||
if (value != null) {
|
||||
DateTime now = DateTime.now(); // วันปัจจุบัน
|
||||
value.forEach((v) {
|
||||
if (v["file_url"] != null &&
|
||||
v["start_date"] != null &&
|
||||
v["end_date"] != null) {
|
||||
DateTime startDate = DateTime.parse(v["start_date"]);
|
||||
DateTime endDate = DateTime.parse(v["end_date"]);
|
||||
if (startDate.isBefore(now) && endDate.isAfter(now)) {
|
||||
listBanner.add(BannerModel.fromJson(v));
|
||||
}
|
||||
}
|
||||
});
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
List<PromotionModel> listPromotion = [];
|
||||
|
||||
// getPromotion() {
|
||||
// Api.get(context, Api.promotion).then((value) => {
|
||||
// if (value != null)
|
||||
// {
|
||||
// value.forEach((v) {
|
||||
// if (v["file_url"] != null) {
|
||||
// listPromotion.add(PromotionModel.fromJson(v));
|
||||
// }
|
||||
// }),
|
||||
// refresh()
|
||||
// }
|
||||
// else
|
||||
// {}
|
||||
// });
|
||||
// }
|
||||
getPromotion() {
|
||||
Api.get(context, Api.promotion).then((value) => {
|
||||
if (value != null)
|
||||
{
|
||||
value.forEach((v) {
|
||||
if (v["file_url"] != null) {
|
||||
listPromotion.add(PromotionModel.fromJson(v));
|
||||
}
|
||||
}),
|
||||
refresh()
|
||||
Api.get(context, Api.promotion).then((value) {
|
||||
if (value != null) {
|
||||
DateTime now = DateTime.now(); // วันปัจจุบัน
|
||||
value.forEach((v) {
|
||||
if (v["file_url"] != null &&
|
||||
v["start_date"] != null &&
|
||||
v["end_date"] != null) {
|
||||
DateTime startDate = DateTime.parse(v["start_date"]);
|
||||
DateTime endDate = DateTime.parse(v["end_date"]);
|
||||
if (startDate.isBefore(now) && endDate.isAfter(now)) {
|
||||
listPromotion.add(PromotionModel.fromJson(v));
|
||||
}
|
||||
else
|
||||
{}
|
||||
}
|
||||
});
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
getTokenAdmin() {
|
||||
// Api.get(context, Api.getTokenAdmin).then((value) => {tokenAdmin = value["token"]});
|
||||
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
import '../Pay/PayPromptPay.dart';
|
||||
import '../PinCodeVadidate.dart';
|
||||
import '../api/api.dart';
|
||||
import '../utils/color_custom.dart';
|
||||
import 'TransferCathayPayDialog.dart';
|
||||
|
||||
TextEditingController _phone = TextEditingController();
|
||||
class TransferCathayPay extends StatefulWidget {
|
||||
const TransferCathayPay({Key? key}) : super(key: key);
|
||||
|
||||
@@ -16,7 +20,7 @@ class TransferCathayPay extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TransferCathayPayState extends State<TransferCathayPay> {
|
||||
TextEditingController _phone = TextEditingController();
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -118,6 +122,31 @@ class TransferCathayPayDetail extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
@override
|
||||
void initState() {
|
||||
initPromptPay(context);
|
||||
super.initState();
|
||||
}
|
||||
TextEditingController _price = TextEditingController();
|
||||
String name ="";
|
||||
initPromptPay(BuildContext context) {
|
||||
_phone.text = '${_phone.text .substring(0, 3)}-${_phone.text .substring(3, 6)}-${_phone.text .substring(6)}';
|
||||
var param = jsonEncode(<dynamic, dynamic>{"idCardOrMobileDeviceNo": _phone.text, "amount": 0});
|
||||
Api.post(context, Api.transferedPromptPayInitial, param).then((value) => {
|
||||
if (value != null)
|
||||
{
|
||||
name = value["prompPayname"].toString()
|
||||
// refresh()
|
||||
}
|
||||
else
|
||||
{}
|
||||
|
||||
});
|
||||
refresh();
|
||||
}
|
||||
refresh() {
|
||||
setState(() {});
|
||||
}
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -178,7 +207,7 @@ class _TransferCathayPayDetailState extends State<TransferCathayPayDetail> {
|
||||
children: [
|
||||
Spacer(),
|
||||
Text(
|
||||
"",
|
||||
name,
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
color: Color(0xff65676b),
|
||||
|
||||
@@ -24,25 +24,37 @@ class _TopUpHistoryState extends State<TransferHistory> {
|
||||
getTransaction() {
|
||||
listTrans.clear();
|
||||
var date = DateTime.now();
|
||||
var start = DateFormat('yyyy-MM-dd').format(DateTime.now());
|
||||
var end = DateFormat('yyyy-MM-dd').format(DateTime(date.year - 1, date.month, date.day));
|
||||
var start = DateFormat('yyyy-MM-dd').format(DateTime(date.year - 1, date.month, date.day));
|
||||
var end = DateFormat('yyyy-MM-dd').format(DateTime.now());
|
||||
|
||||
var param = jsonEncode(<dynamic, dynamic>{
|
||||
"id": "",
|
||||
"payeeUserAccountId": "",
|
||||
"payerUserAccountId": profile!.id,
|
||||
"requestUserID": profile!.id,
|
||||
"invoiceId": "",
|
||||
"referencE1": "",
|
||||
"referencE2": "",
|
||||
"referencE3": "",
|
||||
"paymentStatus": "",
|
||||
"paymentChannel": "",
|
||||
"qrId": "",
|
||||
"createDatefrom": null,
|
||||
"createDateto": null,
|
||||
"sattleDate": null,
|
||||
"voidDate": null,
|
||||
"refundDate": null,
|
||||
"cancelDate": null
|
||||
"createDatefrom": start,
|
||||
"createDateto": end,
|
||||
"requestName": "",
|
||||
"fullName": ""
|
||||
// "id": "",
|
||||
// "payeeUserAccountId": "",
|
||||
// "payerUserAccountId": profile!.id,
|
||||
// "invoiceId": "",
|
||||
// "referencE1": "",
|
||||
// "referencE2": "",
|
||||
// "referencE3": "",
|
||||
// "paymentStatus": "",
|
||||
// "paymentChannel": "",
|
||||
// "qrId": "",
|
||||
// "createDatefrom": null,
|
||||
// "createDateto": null,
|
||||
// "sattleDate": null,
|
||||
// "voidDate": null,
|
||||
// "refundDate": null,
|
||||
// "cancelDate": null
|
||||
});
|
||||
|
||||
Api.post(context, Api.getTransaction, param).then((value) => {
|
||||
|
||||
@@ -53,14 +53,14 @@ class Api {
|
||||
static String otpEmail = BaseUrlCathay+"common/user_login/otp/";
|
||||
static String menuIcons = BaseUrlCathay+"common/icon?is_use=true";
|
||||
|
||||
static String banner = BaseUrlCathay + "common/banner/";
|
||||
static String promotion = BaseUrlCathay + "common/promotion/";
|
||||
static String banner = BaseUrlCathay + "common/banner?is_use=true";
|
||||
static String promotion = BaseUrlCathay + "common/promotion?is_use=true";
|
||||
static String getTokenAdmin = BaseUrlBuilding + "api/v3/User/Login";
|
||||
static String c2bCreate = BaseUrlBuilding + "api/v2/QR/create/C2B";
|
||||
static String c2bInitial = BaseUrlBuilding + "api/v2/Payment/transaction/initialC2B";
|
||||
static String c2bConfirm = BaseUrlBuilding + "api/v2/Payment/transaction/confirmC2B";
|
||||
static String getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransaction";
|
||||
|
||||
//static String getTransaction = BaseUrlBuilding + "api/v2/Payment/getTransaction";
|
||||
static String getTransaction = BaseUrlBuilding + "api/v2/EPaymentReport/GetModelLogCriteria";
|
||||
// static String BaseUrlBuildingCathay = "https://sathorn.cathay-pay.com/";
|
||||
static String payPromptPayInitial = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDInitial";
|
||||
static String payPromptPayConfirm = BaseUrlBuilding + "api/v2/EPaymentBBL/TransferedPromptPayIDConfirm";
|
||||
|
||||
Reference in New Issue
Block a user