1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033 |
- import 'dart:convert';
- import 'package:flutter/material.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:ysairplane/base/YSBase.dart';
- import 'package:ysairplane/code/YSCourseDetail.dart';
- import 'package:ysairplane/code/YSMoney.dart';
- import 'package:ysairplane/code/YSSetPayPass.dart';
- import 'package:ysairplane/tools/YSNetWorking.dart';
- import 'package:ysairplane/tools/YSPayKeybord.dart';
- import 'package:ysairplane/tools/YSTools.dart';
- enum payType{
- doctor,
- help,
- goods,
- marry,
- sport,
- short,
- business,//商务
- preferential,//特惠
- sightseeing//游览
- }
- class YSPay extends StatefulWidget {
- final orderDict;
- final payType type;
- const YSPay({Key key, this.orderDict, this.type}) : super(key: key);
- @override
- _YSPayState createState() => _YSPayState();
- }
- class _YSPayState extends State<YSPay> {
- int _selected = 0;
- bool _isSucceed = false;
- @override
- Widget build(BuildContext context) {
- return YSBase(
- ystitle: '支付方式',
- yschild: _isSucceed==true?Column(
- children: [
- Container(
- color: Colors.white,
- width: MediaQuery.of(context).size.width,
- padding: EdgeInsets.only(left: wsp(30),right: wsp(30),top: hsp(60),bottom: hsp(60)),
- child: Column(
- children: [
- Image(
- image: AssetImage('lib/images/succeed.png'),
- height: hsp(130),
- width: wsp(130)
- ),
- Container(
- child: Text('支付成功',style: TextStyle(fontSize: zsp(40),color: Color(0xFF333333)),),
- margin: EdgeInsets.only(top: hsp(40),bottom: hsp(33)),
- ),
- Text('本次支付金额${widget.orderDict['price']}元',style: TextStyle(fontSize: zsp(28),color: Color(0xFF878787)),),
- ],
- ),
- ),
- GestureDetector(
- onTap: (){
- Navigator.pop(context);
- },
- child: Container(
- height: hsp(94),
- width: MediaQuery.of(context).size.width-wsp(24)*2,
- alignment: Alignment.center,
- margin: EdgeInsets.only(top: hsp(58)),
- decoration: BoxDecoration(
- color: Color(0xFF0079FF),
- borderRadius: BorderRadius.all(Radius.circular(5))
- ),
- child: Text('完成',style: TextStyle(color: Colors.white,fontSize: zsp(34)),),
- ),
- ),
- GestureDetector(
- onTap: (){
- Navigator.of(context).push(
- CupertinoPageRoute(
- builder: (context){
- return YSCourseDetail(orderStr: widget.orderDict['orderSn'],);
- }
- ));
- },
- child: Container(
- height: hsp(94),
- width: MediaQuery.of(context).size.width-wsp(24)*2,
- alignment: Alignment.center,
- margin: EdgeInsets.only(top: hsp(58)),
- decoration: BoxDecoration(
- color: Color(0xFF0079FF),
- borderRadius: BorderRadius.all(Radius.circular(5))
- ),
- child: Text('查看订单',style: TextStyle(color: Colors.white,fontSize: zsp(34)),),
- ),
- )
- ],
- ):Column(
- children: [
- Container(
- height: MediaQuery.of(context).size.height-MediaQuery.of(context).padding.top-44-hsp(120),
- width: MediaQuery.of(context).size.width,
- color: Color(0xFFF1F2F3),
- child: SingleChildScrollView(
- child: Column(
- children: [
- Container(
- width: MediaQuery.of(context).size.width,
- padding: EdgeInsets.all(hsp(30)),
- color: Colors.white,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- child: Text('未支付',style: TextStyle(fontSize: zsp(32),color: Color(0xFFFF4747),fontWeight: FontWeight.bold),),
- margin: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
- ),
- Text('请在${_getMin('${widget.orderDict['expireHour']}')}分钟内完成支付, 否则该订单将被自动取消',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),)//${int.parse('${(widget.orderDict['expireHour'])*60}')}
- ],
- ),
- ),
- widget.type==payType.doctor?Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- width: MediaQuery.of(context).size.width*0.6,
- child: ListView.builder(
- itemBuilder: (context,index){
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- Container(
- height: hsp(30),
- width: hsp(30),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.all(Radius.circular(50)),
- border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
- ),
- margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
- ),
- if(index<1)Container(
- height: hsp(30),
- width: hsp(5),
- color: Color(0xFFCACAD4),
- )
- ],
- ),
- Container(
- child: RichText(
- text: TextSpan(
- text: '${widget.orderDict[index==0?'citySetout':'cityArrive']}',
- style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
- children: [
- TextSpan(
- text: ' ${widget.orderDict[index==0?'airportSetout':'airportArrive']}',
- style: TextStyle(color: Color(0xFF999999),fontSize: zsp(20),fontWeight: FontWeight.normal),
- )
- ]
- ),
- ),
- margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
- )
- ],
- );
- },
- itemCount: 2,
- shrinkWrap: true,
- physics: NeverScrollableScrollPhysics(),
- ),
- ),
- Container(
- child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
- padding: EdgeInsets.only(top: hsp(10)),
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- RichText(
- text: TextSpan(
- text: '乘机人数 ',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
- children: [
- TextSpan(
- text: '${widget.orderDict['travelersNumber']}人',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
- )
- ]
- ),
- ),
- Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(170)),),
- RichText(
- text: TextSpan(
- text: '出发时间 ',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
- children: [
- TextSpan(
- text: '${widget.orderDict['flightTime']}',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
- )
- ]
- ),
- ),
- ],
- ),
- ),
- ],
- ):widget.type==payType.help?Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- width: MediaQuery.of(context).size.width*0.6,
- child: ListView.builder(
- itemBuilder: (context,index){
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- Container(
- height: hsp(30),
- width: hsp(30),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.all(Radius.circular(50)),
- border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
- ),
- margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
- ),
- if(index<1)Container(
- height: hsp(30),
- width: hsp(5),
- color: Color(0xFFCACAD4),
- )
- ],
- ),
- Container(
- child: RichText(
- text: TextSpan(
- text: '${widget.orderDict[index==0?'citySetout':'cityArrive']}',
- style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
- ),
- ),
- margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
- )
- ],
- );
- },
- itemCount: 2,
- shrinkWrap: true,
- physics: NeverScrollableScrollPhysics(),
- ),
- ),
- Container(
- child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
- padding: EdgeInsets.only(top: hsp(10)),
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- RichText(
- text: TextSpan(
- text: '人数 ',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
- children: [
- TextSpan(
- text: '${widget.orderDict['travelersNumber']}人',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
- )
- ]
- ),
- ),
- Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(120)),),
- RichText(
- text: TextSpan(
- text: '电话 ',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
- children: [
- TextSpan(
- text: '${widget.orderDict['phone']}',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
- )
- ]
- ),
- ),
- Container(height: 0.5,color: Color(0xFFE5E5E5),margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(120)),),
- RichText(
- text: TextSpan(
- text: '描述 ',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF999999)),
- children: [
- TextSpan(
- text: '${widget.orderDict['des']==null?'无':widget.orderDict['des']}',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF333333)),
- )
- ]
- ),
- ),
- ],
- ),
- ),
- ],
- ):widget.type==payType.goods?Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- child: Text('费用明细',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- ),
- Container(
- width: (MediaQuery.of(context).size.width-hsp(280))*0.55,
- padding: EdgeInsets.only(right: wsp(30)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(widget.orderDict['sourceType']==1?'整机':'拼机',style: TextStyle(fontSize: zsp(32),color: Colors.black,fontWeight: FontWeight.bold),),
- Container(
- margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
- child: Row(
- children: [
- Text('${widget.orderDict['setoutInfo']['display']} ',style: TextStyle(fontSize: zsp(25),color: Color(0xFF9A9A9A))),
- Container(
- height: 1,
- width: wsp(20),
- color: Color(0xFFCCCCCC),
- ),
- Text(' ${widget.orderDict['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF9A9A9A)))
- ],
- ),
- ),
- RichText(
- text: TextSpan(
- text: '预订须知',
- style: TextStyle(fontSize: zsp(24),color: Color(0xFF348AE1)),
- children: [
- TextSpan(
- text: ' >',
- style: TextStyle(color: Color(0xFF000000))
- ),
- ]
- ),
- )
- ],
- ),
- ),
- Container(
- width: (MediaQuery.of(context).size.width-wsp(280))*0.4,
- alignment: Alignment.centerRight,
- child: Text('¥ ${widget.orderDict['price']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
- padding: EdgeInsets.only(top: hsp(10)),
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: wsp(150),
- alignment: Alignment.center,
- child: Text('乘机人 ',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- ),
- Container(
- width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
- child: ListView.separated(
- itemBuilder: (context,index){
- return Container(
- width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
- padding: EdgeInsets.only(bottom: index==1?0:hsp(20),top: index==0?0:hsp(20)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${widget.orderDict['dtAirplaneGoods']['contactPerson']}',style: TextStyle(fontSize: zsp(32),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
- Text('联系方式 ${widget.orderDict['dtAirplaneGoods']['phone']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666),))
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(color: Color(0xFFE5E5E5),height: 0.5,thickness: 0.5,);
- },
- itemCount: 1,
- padding: EdgeInsets.all(0),
- shrinkWrap: true,
- ),
- ),
- ],
- ),
- ),
- ],
- ):widget.type==payType.marry||widget.type==payType.sport||widget.type==payType.sightseeing?Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('${widget.orderDict['orderName']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFF000000)),),
- Text('¥${widget.orderDict['price']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEB423B),fontWeight: FontWeight.bold),)
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(2)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: RichText(
- text: TextSpan(
- text: '联系方式 ',
- style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: zsp(30)),
- children: [
- TextSpan(
- text: '${widget.orderDict['phone']}',
- style: TextStyle(fontWeight: FontWeight.normal,color: Color(0xFF666666))
- )
- ]
- ),
- ),
- ),
- if(widget.type==payType.marry)Container(
- padding: EdgeInsets.only(top: hsp(30),left: hsp(30),right: hsp(30),bottom: hsp(10)),
- margin: EdgeInsets.only(top: hsp(2)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Text('贺卡备注',style: TextStyle(color: Colors.black,fontWeight: FontWeight.bold,fontSize: zsp(30)),),
- ),
- if(widget.type==payType.marry)Container(
- padding: EdgeInsets.only(left: hsp(40),right: hsp(30),bottom: hsp(30)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Text(widget.orderDict['des']==null?'':'${widget.orderDict['des']}',style: TextStyle(color: Color(0xFF666666),fontWeight: FontWeight.normal,fontSize: zsp(30)),),
- )
- ],
- ):widget.type==payType.short?Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- width: MediaQuery.of(context).size.width*0.6,
- child: ListView.builder(
- itemBuilder: (context,index){
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- Container(
- height: hsp(30),
- width: hsp(30),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.all(Radius.circular(50)),
- border: Border.all(color: index==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
- ),
- margin: EdgeInsets.only(top: hsp(7),bottom: hsp(7)),
- ),
- if(index<1)Container(
- height: hsp(30),
- width: hsp(5),
- color: Color(0xFFCACAD4),
- )
- ],
- ),
- Container(
- child: RichText(
- text: TextSpan(
- text: '${widget.orderDict[index==0?'setoutInfo':'arriveInfo']['display']}',
- style: TextStyle(color: Color(0xFF000000),fontSize: zsp(32),fontWeight: FontWeight.bold),
- children: [
- TextSpan(
- text: ' ${widget.orderDict[index==0?'setoutInfo':'arriveInfo']['airplanename']}',
- style: TextStyle(color: Color(0xFF999999),fontSize: zsp(20),fontWeight: FontWeight.normal),
- )
- ]
- ),
- ),
- margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
- )
- ],
- );
- },
- itemCount: 2,
- shrinkWrap: true,
- physics: NeverScrollableScrollPhysics(),
- ),
- ),
- Container(
- child: Text('¥ ${widget.orderDict['retailPrice']} x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
- padding: EdgeInsets.only(top: hsp(10)),
- )
- ],
- ),
- )
- ],
- ):widget.type==payType.business?Container(
- margin: EdgeInsets.only(top: hsp(10)),
- child: Column(
- children: [
- ListView.separated(
- shrinkWrap: true,
- itemBuilder: (context,index){
- return Container(
- color: Colors.white,
- child: Column(
- children: [
- widget.orderDict['charterType']==1?Container(
- padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)),
- child: Column(
- children: [
- Row(
- children: [
- Container(
- child: Text('${widget.orderDict['itineraries'][index]['setOutInfo']['display']}',
- style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
- width: (MediaQuery.of(context).size.width-hsp(210))/2,
- ),
- Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
- Container(
- child: Text('${widget.orderDict['itineraries'][index]['arriveInfo']['display']}',
- style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
- width: (MediaQuery.of(context).size.width-hsp(210))/2,
- alignment: Alignment.centerRight,
- ),
- ],
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- ),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- child: Text('${widget.orderDict['itineraries'][index]['setOutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- width: (MediaQuery.of(context).size.width-hsp(300))/2,
- ),
- Text('${widget.orderDict['itineraries'][index]['time']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- Container(
- child: Text('${widget.orderDict['itineraries'][index]['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- width: (MediaQuery.of(context).size.width-hsp(300))/2,
- alignment: Alignment.centerRight,
- ),
- ],
- )
- ],
- ),
- ):Container(
- width: MediaQuery.of(context).size.width-hsp(60),
- child: ListView.builder(
- itemBuilder: (context,indexSub){
- return Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Column(
- children: [
- Container(
- height: hsp(30),
- width: hsp(30),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.all(Radius.circular(50)),
- border: Border.all(color: indexSub%2==0?Color(0xFF02C094):Color(0xFFFB9658),width: wsp(6))
- ),
- margin: EdgeInsets.only(top: hsp(10),bottom: hsp(7)),
- ),
- if(indexSub<1)Container(
- height: hsp(30),
- width: hsp(5),
- color: Color(0xFFCACAD4),
- )
- ],
- ),
- Container(
- child: RichText(
- text: TextSpan(
- text: '${widget.orderDict['itineraries'][index][indexSub==0?'setout':'arrive']}',
- style: TextStyle(color: Color(0xFF000000),fontSize: hsp(30),fontWeight: FontWeight.bold),
- children: [
- ]
- ),
- ),
- margin: EdgeInsets.only(left: wsp(10),top: hsp(5)),
- )
- ],
- );
- },
- itemCount: 2,
- shrinkWrap: true,
- physics: NeverScrollableScrollPhysics(),
- padding: EdgeInsets.only(top: hsp(10),bottom: hsp(10)),
- ),
- ),
- Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),),
- Container(
- padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(20)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Column(
- children: [
- Text('出发',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
- RichText(
- text: TextSpan(
- text: _getDateStr('${widget.orderDict['itineraries'][index]['timeSetout']}'),style: TextStyle(fontSize: zsp(28),fontWeight: FontWeight.bold,color: Colors.black),
- children: [
- // TextSpan(
- // text: '今天',
- // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
- // )
- ]
- ),
- )],
- crossAxisAlignment: CrossAxisAlignment.start,
- ),
- Column(
- children: [
- Text('到达',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
- RichText(
- text: TextSpan(
- text: _getDateStr('${widget.orderDict['itineraries'][index]['timeArrive']}'),style: TextStyle(fontSize: zsp(28),fontWeight: FontWeight.bold,color: Colors.black),
- children: [
- // TextSpan(
- // text: '今天',
- // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
- // )
- ]
- ),
- )
- ],
- crossAxisAlignment: CrossAxisAlignment.start,
- ),
- // Icon(Icons.keyboard_arrow_right,size: hsp(50),color: Color(0xFFC1C1C1),)
- ],
- ),
- ),
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE9E9E9),indent: wsp(32),endIndent: wsp(32),);
- },
- itemCount: (widget.orderDict['itineraries']).length,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- ),
- ],
- ),
- ):Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- width: (MediaQuery.of(context).size.width-hsp(280))*0.65,
- padding: EdgeInsets.only(right: wsp(30)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Text('${widget.orderDict['setoutInfo']['display']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),),
- Container(
- height: 2,
- width: wsp(40),
- color: Color(0xFFCCCCCC),
- ),
- Text('${widget.orderDict['arriveInfo']['display']}',style: TextStyle(fontSize: zsp(40),color: Colors.black,fontWeight: FontWeight.bold),)
- ],
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- ),
- Container(
- child: Row(
- children: [
- Text('${widget.orderDict['setoutInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),),
- Text('${widget.orderDict['arriveInfo']['airplanename']}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF9A9A9A)),),
- ],
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- ),
- margin: EdgeInsets.only(top: hsp(10),bottom: hsp(20)),
- ),
- // Row(
- // children: [
- // Container(
- // color: Color(0xFF000000),
- // height: hsp(35),
- // child: Row(
- // children: [
- // Image(image: AssetImage('lib/images/vip2.png'),height: hsp(15),width: wsp(16),),
- // Text(' G450',style: TextStyle(fontSize: zsp(18),color: Color(0xFFF9DEAC)),)
- // ],
- // ),
- // padding: EdgeInsets.only(left: wsp(5),right: wsp(5)),
- // ),
- // Container(
- // padding: EdgeInsets.only(left: wsp(5),right: wsp(5)),
- // height: hsp(35),
- // child: Text('座位30',style: TextStyle(fontSize: zsp(20),color: Color(0xFF565656)),),
- // decoration: BoxDecoration(
- // border: Border.all(color: Color(0xFF565656),width: 0.5)
- // ),
- // alignment: Alignment.center,
- // ),
- // ],
- // ),
- ],
- ),
- ),
- Container(
- width: (MediaQuery.of(context).size.width-wsp(280))*0.35,
- child: Text('¥ ${widget.orderDict['price']}x ${widget.orderDict['travelersNumber']}人',style: TextStyle(fontSize: zsp(28),color: Color(0xFFA2A2A2)),),
- padding: EdgeInsets.only(top: hsp(10)),
- )
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: wsp(150),
- alignment: Alignment.center,
- child: Text('乘机人',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- ),
- Container(
- width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
- child: ListView.separated(
- itemBuilder: (context,index){
- return Container(
- width: MediaQuery.of(context).size.width-hsp(60)-wsp(150),
- padding: EdgeInsets.only(bottom: index==1?0:hsp(20),top: index==0?0:hsp(20)),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${widget.orderDict['personnelInfo'][index]['username']} ${widget.orderDict['personnelInfo'][index]['phone']}',style: TextStyle(fontSize: zsp(32),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
- Text('身份证 ${widget.orderDict['personnelInfo'][index]['cardid']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666),))
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(color: Color(0xFFE5E5E5),height: 0.5,thickness: 0.5,);
- },
- itemCount: widget.orderDict['personnelInfo']!=null?widget.orderDict['personnelInfo'].length:0,
- padding: EdgeInsets.all(0),
- shrinkWrap: true,
- ),
- ),
- ],
- ),
- ),
- ],
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: RichText(
- text: TextSpan(
- text: '应付总额:',
- style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),
- children: [
- TextSpan(
- text: '¥${widget.orderDict['price']}',
- style: TextStyle(color: Color(0xFF007EFF),fontWeight: FontWeight.bold),
- )
- ]
- ),
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Text('订单编号:${widget.orderDict['orderSn']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(12)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- child: Text('支付方式',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- ),
- ListView.separated(
- itemBuilder: (context,index){
- return GestureDetector(
- onTap: (){
- setState(() {
- _selected = index;
- });
- },
- behavior: HitTestBehavior.opaque,
- child: Container(
- height: hsp(92),
- color: Colors.white,
- padding: EdgeInsets.only(left: hsp(30),right: hsp(30)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Row(
- children: [
- Container(
- height: hsp(50),
- width: hsp(50),
- margin: EdgeInsets.only(right: hsp(25)),
- child: Image.asset(index==0?'lib/images/wexinLogo.png':index==1?'lib/images/aliLogo.png':'lib/images/wexinLogo.png'),
- ),
- Text(index==0?'余额':index==1?'微信支付':'支付宝',style: TextStyle(fontSize: zsp(30),color: Color(0xFF343434),)),
- ],
- ),
- Icon(Icons.check,color:index==_selected?Color(0xFF007EFF):Colors.transparent,size: hsp(40),),
- ],
- ),
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(height: 0.5,thickness: 0.5,color: Color(0xFFF1F2F3),);
- },
- itemCount: 3,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- )
- ],
- ),
- ),
- ),
- Container(
- height: hsp(120),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- padding: EdgeInsets.only(left: wsp(60),right: wsp(60)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- GestureDetector(
- onTap: (){
- showDialog(
- context: context,
- builder: (context) {
- return AlertDialog(
- actionsPadding: EdgeInsets.all(0),
- title: Text('提示',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(36)),),
- content: Text('确认取消订单吗?',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),
- actions: <Widget>[
- FlatButton(child: Text('取消',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),onPressed: (){
- Navigator.pop(context);
- },),
- FlatButton(child: Text('确认',style: TextStyle(fontWeight: FontWeight.bold,fontSize: zsp(30))),onPressed: (){
- Navigator.pop(context);
- _postCancelOrderData();
- },),
- ],
- );
- }
- );
- },
- child: Container(
- height: hsp(88),
- width: wsp(300),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(50)),
- border: Border.all(color: Color(0xFFD9D9D9),width: 1)
- ),
- alignment: Alignment.center,
- child: Text('取消订单',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434)),),
- ),
- ),
- GestureDetector(
- onTap: (){
- showDialog(context: context,builder: (context){
- return AlertDialog(
- contentPadding: EdgeInsets.all(0),
- actionsPadding: EdgeInsets.all(0),
- buttonPadding: EdgeInsets.all(0),
- insetPadding: EdgeInsets.all(0),
- titlePadding: EdgeInsets.all(0),
- backgroundColor: Colors.transparent,
- content: ysPayKeybord(context,(value){
- _postPayData(value);
- },widget.type==payType.marry||widget.type==payType.sport||widget.type==payType.sightseeing?'${widget.orderDict['orderName']}':(widget.type==payType.doctor||
- widget.type==payType.help)?'${widget.orderDict['citySetout']}到${widget.orderDict['cityArrive']}':widget.type==payType.business?'商旅包机':'${widget.orderDict['setoutInfo']['display']}到'
- '${widget.orderDict['arriveInfo']['display']}',
- '${widget.orderDict['price']}')
- );
- });
- },
- child: Container(
- height: hsp(88),
- width: wsp(300),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(50)),
- color: Color(0xFF007EFF)
- ),
- alignment: Alignment.center,
- child: Text('去付款',style: TextStyle(fontSize: zsp(34),color: Colors.white),),
- ),
- )
- ],
- ),
- )
- ],
- ),
- );
- }
- _getMin(String hours){
- double time = double.parse(hours);
- return '${(time*60)~/1}';
- }
- _postCancelOrderData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/cancelOrder',parameter: {'orderSn':widget.orderDict['orderSn']},isLoading: false,isToken: true);
- if(dict!=null){
- Navigator.pop(context);
- }
- }
- _postPayData(String pass) async{
- var dict = await ysRequestHttpEncrypt(context,type: requestType.post,api: '/app/applets/balance/balancePay',
- parameter: {'orderSn':widget.orderDict['orderSn'],'price':widget.orderDict['price'],'password': pass},isLoading: true,isToken: true);
- if(dict!=null){
- if(dict==''){
- setState(() {
- _isSucceed = true;
- });
- }else if(dict['code']==804){
- _showAlertView(1);
- }else if(dict['code']==801){
- _showAlertView(2);
- }
- }
- }
- _showAlertView (int type) async{
- showCupertinoDialog(
- context: context,
- builder: (context) {
- return CupertinoAlertDialog(
- title: Text('提示\n'),
- content: Text(type==1?'未设置支付密码':'余额不足请充值'),
- actions: <Widget>[
- CupertinoDialogAction(child: Text('取消'),onPressed: (){Navigator.pop(context);},),
- CupertinoDialogAction(child: Text(type==1?'去设置':'去充值'),onPressed: (){
- Navigator.pop(context);
- Navigator.of(context).push(
- CupertinoPageRoute(
- builder: (context){
- return type==1?YSSetPayPass():YSMoney();
- }
- )
- );
- },),
- ],
- );
- }
- );
- }
- _getDateStr(String date){
- return date.substring(0,date.length-3);
- }
- }
|