123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257 |
- import 'dart:async';
- import 'package:flutter/material.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:ysairplane2/code/YSContact.dart';
- import 'package:ysairplane2/code/YSPay.dart';
- import 'package:ysairplane2/tools/YSNetWorking.dart';
- import 'package:ysairplane2/tools/YSTools.dart';
- class YSContractPlaneDetail extends StatefulWidget {
- final contractId,isWhole,arriveId;
- const YSContractPlaneDetail({Key key, this.contractId, this.isWhole, this.arriveId}) : super(key: key);
- @override
- _YSContractPlaneDetailState createState() => _YSContractPlaneDetailState();
- }
- class _YSContractPlaneDetailState extends State<YSContractPlaneDetail> {
- //List _tags = ['服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)','服务热情(346)',];
- bool _isDetail = false;
- bool _isOrder = false;
- Map _msgDict,_detailDict;
- List _chooses = [];
- String _timeStr;
- List _packList = [];
- List _priceList = [];
- int _selected = 0;
- int _index = 9999;
- List _customer = [];
- bool _isShow = false;
- String _noticeStr = '';
- Timer _timer;
- int _timeNum = 0;
- List _allPrices = [];
- var _timeSet;
- @override
- void dispose() {
- if(_timer!=null){
- _timer.cancel();
- }
- super.dispose();
- }
- @override
- void initState() {
- Future.delayed(Duration(seconds: 0)).then((value){
- _getBackImageData();
- _getContractPlaneDetailData();
- _getNoticeData();
- _getPackData();
- });
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- backgroundColor: Color(0xFFF1F2F4),
- body: Stack(
- children: [
- SingleChildScrollView(
- child: Column(
- children: [
- Container(
- height: MediaQuery.of(context).size.height-hsp(120),
- child: SingleChildScrollView(
- child: Stack(
- children: [
- Container(
- height: MediaQuery.of(context).padding.top+hsp(380),
- width: MediaQuery.of(context).size.width,
- child: Image(
- image: _msgDict==null?AssetImage('lib/images/home3.png'):NetworkImage('${_msgDict['background']}'),
- fit: BoxFit.fill,
- ),
- ),
- GestureDetector(
- onTap: (){Navigator.pop(context);},
- child: Container(
- margin: EdgeInsets.only(left: wsp(32),top: MediaQuery.of(context).padding.top+hsp(30)),
- child: Icon(Icons.arrow_back_ios,size: hsp(40),color: Colors.white,),
- ),
- ),
- if(_msgDict!=null)Container(
- margin: EdgeInsets.only(left: wsp(50),top: MediaQuery.of(context).padding.top+hsp(200)),
- child: RichText(
- text: TextSpan(
- text: '${_msgDict['name']} ',
- style: TextStyle(fontSize: zsp(50),color: Colors.white,fontWeight: FontWeight.bold),
- children: [
- TextSpan(
- text: '${_msgDict['subtitle']}',
- style: TextStyle(fontWeight: FontWeight.normal,fontSize: zsp(28),color: Colors.white.withOpacity(0.5))
- )
- ]
- ),
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top+hsp(300)),
- child: Column(
- children: [
- Container(
- width: MediaQuery.of(context).size.width-wsp(60),
- margin: EdgeInsets.only(left: wsp(30),bottom: hsp(20)),
- padding: EdgeInsets.all(hsp(30)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(10)),
- color: Colors.white,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- if(_detailDict!=null)Container(
- margin: EdgeInsets.only(bottom: hsp(30)),
- child: Row(
- children: [
- GestureDetector(
- onTap: (){
- showInformAlert(context,title: '${_detailDict['dtPartner']['companyName']}',content: _detailDict['dtPartner']['content']);
- },
- child: RichText(
- text: TextSpan(
- text: '${_detailDict['dtPartner']['companyName']}'.length>7?
- '${_detailDict['dtPartner']['companyName']}'.substring(0,7)+'..':'${_detailDict['dtPartner']['companyName']}',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),
- children: [
- TextSpan(
- text: ' >',
- style: TextStyle(color: Color(0xFF2C7CF6))
- )
- ]
- ),
- ),
- ),
- Container(
- margin: EdgeInsets.only(left: wsp(40),right: wsp(40)),
- child: GestureDetector(
- onTap: (){
- showInformAlert(context,title: '${_detailDict['dtFlightInformation']['model']}',
- content: '${_detailDict['dtFlightInformation']['content']}');
- },
- child: RichText(
- text: TextSpan(
- text: '${_detailDict!=null?_detailDict['dtFlightInformation']['model']:''}',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),
- children: [
- TextSpan(
- text: ' >',
- style: TextStyle(color: Color(0xFF2C7CF6))
- )
- ]
- ),
- ),
- ),
- ),
- if(_detailDict!=null)RichText(
- text: TextSpan(
- text: '可乘坐人数${_detailDict['dtFlightInformation']['seatNum']}人',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),
- children: [
- ]
- ),
- )
- ],
- ),
- ),
- Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
- Container(
- padding: EdgeInsets.only(top: hsp(20)),
- child: Column(
- children: [
- Row(
- children: [
- Container(
- child: Text('${_detailDict!=null?_detailDict['setoutInfo']['display']:''}',
- style: TextStyle(fontSize: zsp(40),fontWeight: FontWeight.bold,color: Colors.black),),
- width: (MediaQuery.of(context).size.width-hsp(210))/2,
- alignment: Alignment.centerLeft,
- ),
- Image(height: hsp(60),width: hsp(60),image: AssetImage('lib/images/plane.png'),),
- Container(
- child: Text('${_detailDict!=null?_detailDict['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('${_detailDict!=null?_detailDict['setoutInfo']['airplaneName']:''}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- width: (MediaQuery.of(context).size.width-hsp(400))/2,
- alignment: Alignment.centerLeft,
- ),
- Text('${_detailDict!=null?_detailDict['hour']:''}',style: TextStyle(fontSize: zsp(20),color: Color(0xFF343434)),),
- Container(
- child: Text('${_detailDict!=null?_detailDict['arriveInfo']['airplaneName']:''}',style: TextStyle(fontSize: zsp(24),color: Color(0xFF999999)),),
- width: (MediaQuery.of(context).size.width-hsp(400))/2,
- alignment: Alignment.centerRight,
- ),
- ],
- ),
- ],
- ),
- ),
- Divider(height: 0.5,thickness: 0.5,color: Color(0xFFEAEAEA),),
- Container(
- padding: EdgeInsets.only(top: hsp(20)),
- child: Column(
- children: [
- Text('出发',style: TextStyle(fontSize: zsp(24),color: Color(0xFF666666)),),
- RichText(
- text: TextSpan(
- text: '${_detailDict!=null?_detailDict['flightTime']:''}',
- style: TextStyle(fontSize: zsp(36),fontWeight: FontWeight.bold,color: Colors.black),
- children: [
- // TextSpan(
- // text: '今天',
- // style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
- // )
- ]
- ),
- )
- ],
- crossAxisAlignment: CrossAxisAlignment.start,
- ),
- )
- ],
- ),
- ),
- if(widget.isWhole==1)if(_detailDict!=null)Container(
- width: MediaQuery.of(context).size.width-wsp(60),
- margin: EdgeInsets.only(left: wsp(30),top: hsp(20)),
- child: Row(
- children: [
- Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('拼座价(元/座): ${_detailDict['discountPrice']}起',style: TextStyle(fontSize: zsp(30),color: Colors.white),),
- Text('原价(元/座): ${_detailDict['price']}起',style: TextStyle(fontSize: zsp(26),color: Colors.white),),
- Text('剩${_detailDict['dtFlightInformation']['seatNum']}座',style: TextStyle(fontSize: zsp(24),color: Colors.white),),
- ],
- ),
- width: (MediaQuery.of(context).size.width-wsp(60))*0.6,
- height: hsp(170),
- decoration: BoxDecoration(
- color: Color(0xFFDC402F),
- borderRadius: BorderRadius.only(topLeft: Radius.circular(5),bottomLeft: Radius.circular(5))
- ),
- alignment: Alignment.centerLeft,
- padding: EdgeInsets.all(hsp(20)),
- ),
- StatefulBuilder(
- builder: (context,set){
- _timeSet = set;
- return Container(
- child: _timeNum==0?Text('拼团已截止',style: TextStyle(fontSize: zsp(32),color: Color(0xFFAA2E1D)),):Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('截止拼团时间',style: TextStyle(fontSize: zsp(26),color: Color(0xFFAA2E1D)),),
- Text('${_timeNum~/86400>0?'${_timeNum~/86400}天 ':''}'
- '${'${_timeNum%86400~/3600}'.padLeft(2,'0')}:'
- '${'${_timeNum%3600~/60}'.padLeft(2,'0')}:'
- '${'${_timeNum%3600%60}'.padLeft(2,'0')}'
- ,style: TextStyle(fontSize: zsp(32),color: Color(0xFFAA2E1D)),),
- ],
- ),
- width: (MediaQuery.of(context).size.width-wsp(60))*0.4,
- height: hsp(170),
- decoration: BoxDecoration(
- color: Color(0xFFEAC364),
- borderRadius: BorderRadius.only(bottomRight: Radius.circular(5),topRight: Radius.circular(5))
- ),
- alignment: Alignment.center,
- padding: EdgeInsets.only(left: hsp(20),right: hsp(20),top: hsp(35),bottom: hsp(35)),
- );
- },
- )
- ],
- ),
- ),
- Container(
- width: MediaQuery.of(context).size.width-wsp(60),
- margin: EdgeInsets.only(left: wsp(30),top: hsp(30)),
- padding: EdgeInsets.all(hsp(30)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(10)),
- color: Colors.white,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- padding: EdgeInsets.only(bottom: hsp(20)),
- child: Text('选择套餐',style: TextStyle(fontSize: zsp(30),color: Color(0xFF222222)),),
- ),
- ListView.builder(
- itemBuilder: (context,index){
- return Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${_packList[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF333333)),),
- Container(height: hsp(10),),
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- RichText(
- text: TextSpan(
- children: [
- TextSpan(
- text: '¥${_packList[index]['discountPrice']}',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFFEB423B),fontWeight: FontWeight.bold)
- )
- ]
- ),
- ),
- GestureDetector(
- onTap: (){
- _index = index;
- _isOrder = true;
- _getPriceData();
- },
- child: Container(
- height: hsp(50),
- width: hsp(150),
- decoration: BoxDecoration(
- color: Color(0xFFEA4D45),
- borderRadius: BorderRadius.all(Radius.circular(3))
- ),
- alignment: Alignment.center,
- child: Text('立即预订',style: TextStyle(fontSize: zsp(20),color: Colors.white),),
- ),
- )
- ],
- )
- ],
- ),
- );
- },
- itemCount: _packList.length,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- shrinkWrap: true,
- ),
- ],
- ),
- ),
- Container(
- width: MediaQuery.of(context).size.width-wsp(60),
- margin: EdgeInsets.only(left: wsp(30),top: hsp(20)),
- padding: EdgeInsets.all(hsp(30)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(10)),
- color: Colors.white,
- ),
- child: Column(
- children: [
- Row(
- children: [
- Text('评价(${_detailDict!=null?_detailDict['dtOrderScoringNum']:''})',style: TextStyle(fontSize: zsp(36),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- Text('更多',style: TextStyle(fontSize: zsp(28),color: Color(0xFF444444)),),
- ],
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- ),
- Container(
- margin: EdgeInsets.only(top: hsp(30),bottom: hsp(30),right: wsp(10)),
- height: hsp(120),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(
- child: Column(
- children: [
- RichText(
- text: TextSpan(
- text: '${_detailDict!=null?_detailDict['averageRating']:'0'}',
- style: TextStyle(fontSize: zsp(60),color: Color(0xFFED5E58),fontWeight: FontWeight.bold),
- children: [
- TextSpan(
- text: ' 超赞',
- style: TextStyle(fontSize: zsp(24),fontWeight: FontWeight.normal),
- )
- ]
- ),
- ),
- Text('高于${_detailDict!=null?_detailDict['scoreScale']:'0'}同类型航空',style: TextStyle(fontSize: zsp(20),color: Color(0xFF202020)),),
- ],
- ),
- width: wsp(200),
- ),
- Container(
- height: hsp(120),
- width: MediaQuery.of(context).size.width-hsp(120)-wsp(210)-wsp(60),
- margin: EdgeInsets.only(left: wsp(10),right: wsp(0)),
- child: GridView.builder(
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 2,
- childAspectRatio: (MediaQuery.of(context).size.width-hsp(120)-wsp(210)-wsp(60))/2/hsp(60)
- ),
- itemBuilder: (context, index) {
- return Container(
- height: hsp(60),
- child: Row(
- children: [
- Text('${_detailDict['dtOrderScoringTypeList'][index]['name']} ${_detailDict['dtOrderScoringTypeList'][index]['avatarOrderScoring']} ',style: TextStyle(fontSize: zsp(22),color: Color(0xFF202020)),),
- Container(
- height: hsp(8),
- decoration: BoxDecoration(
- color: Color(0xFFED5E58),
- borderRadius: BorderRadius.all(Radius.circular(50))
- ),
- width: wsp(60)*(double.parse('${_detailDict['dtOrderScoringTypeList'][index]['avatarOrderScoring']}')/
- double.parse('${_detailDict['dtOrderScoringTypeList'][index]['totalScore']}')),
- )
- ],
- ),
- );
- },
- itemCount: _detailDict!=null?_detailDict['dtOrderScoringTypeList'].length:0,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- ),
- )
- ],
- ),
- ),
- // Container(
- // width: MediaQuery.of(context).size.width-hsp(120),
- // child: Wrap(
- // alignment: WrapAlignment.start,
- // children: <Widget>[
- // for (int i =0;i<_tags.length;i++ ) GestureDetector(
- // behavior: HitTestBehavior.opaque,
- // onTap: (){
- //
- // },
- // child: Container(
- // margin: EdgeInsets.symmetric(vertical: hsp(10), horizontal: hsp(10)),
- // decoration: BoxDecoration(
- // color: Color(0xFFFDF1F1),
- // borderRadius: BorderRadius.all(Radius.circular(5))
- // ),
- // padding: EdgeInsets.only(left: wsp(15), right: wsp(15),top: hsp(10),bottom: hsp(10)),
- // child: Text('${_tags[i]}', style: TextStyle(fontSize: zsp(22),color: Color(0xFF000000)), textAlign: TextAlign.center,),
- // ),
- // )
- // ]
- // ),
- // ),
- ListView.separated(
- shrinkWrap: true,
- itemBuilder: (context,index){
- return Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Row(
- children: [
- Container(
- height: hsp(90),
- width: hsp(90),
- margin: EdgeInsets.only(right: wsp(20)),
- decoration: BoxDecoration(
- color: Colors.lightGreen,
- borderRadius: BorderRadius.all(Radius.circular(50)),
- image: DecorationImage(image: NetworkImage('${_detailDict['dtOrderScoringContentList'][index]['dtUsers']['avatar']}'),fit: BoxFit.fill)
- ),
- ),
- Container(
- height: hsp(80),
- child: Column(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${_detailDict['dtOrderScoringContentList'][index]['dtUsers']['nickname']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- Text('${_detailDict['dtOrderScoringContentList'][index]['createTime']}',style: TextStyle(fontSize: zsp(22),color: Color(0xFF9A9A9A)),)
- ],
- ),
- )
- ],
- ),
- Container(
- margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
- child: ysTextExpend(text: '${_detailDict['dtOrderScoringContentList'][index]['content']}',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF000000)),maxLines: 3,)
- ),
- if(_detailDict['dtOrderScoringContentList'][index]['picture']!=null)GridView.builder(
- shrinkWrap: true,
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 3,
- childAspectRatio: (MediaQuery.of(context).size.width-hsp(140)-wsp(60))/3/hsp(160),
- crossAxisSpacing: hsp(10),
- mainAxisSpacing: hsp(10)
- ),
- itemBuilder: (context, indexSub) {
- return Container(
- height: hsp(160),
- child: Image(
- image: NetworkImage('${(_detailDict['dtOrderScoringContentList'][index]['picture']).split(',')[indexSub]}'),
- fit: BoxFit.fill,
- ),
- );
- },
- itemCount: _detailDict!=null?(_detailDict['dtOrderScoringContentList'][index]['picture']).split(',').length:0,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- )
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(color: Colors.white,height: hsp(20),thickness: hsp(20),);
- },
- itemCount: (_detailDict!=null&&_detailDict['dtOrderScoringContentList']!=null)?_detailDict['dtOrderScoringContentList'].length:0,
- padding: EdgeInsets.only(left: hsp(15),right: hsp(15),top: hsp(15)),
- physics: NeverScrollableScrollPhysics(),
- ),
- ],
- ),
- ),
- Container(
- width: MediaQuery.of(context).size.width-wsp(60),
- margin: EdgeInsets.only(left: wsp(30),bottom: hsp(50),top: hsp(20)),
- padding: EdgeInsets.all(hsp(30)),
- decoration: BoxDecoration(
- borderRadius: BorderRadius.all(Radius.circular(10)),
- color: Colors.white,
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('航线详情',style: TextStyle(fontSize: zsp(36),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- Container(
- margin: EdgeInsets.only(top: hsp(30),bottom: hsp(10)),
- child: RichText(
- text: TextSpan(
- text: '航线: ',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF929292)),
- children: [
- TextSpan(
- text: '${_detailDict!=null?_detailDict['setoutInfo']['display']:''} - ${_detailDict!=null?_detailDict['arriveInfo']['display']:''}',
- style: TextStyle(color: Color(0xFF343434))
- )
- ]
- ),
- )
- ),
- RichText(
- text: TextSpan(
- text: '日期: ',
- style: TextStyle(fontSize: zsp(28),color: Color(0xFF929292)),
- children: [
- TextSpan(
- text: '${_detailDict!=null?_detailDict['flightTime']:''}',
- style: TextStyle(color: Color(0xFF343434))
- )
- ]
- ),
- )
- ],
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- Row(
- children: [
- GestureDetector(
- onTap: (){
- alertPhone(context, '');
- },
- child: Container(
- width: MediaQuery.of(context).size.width*0.2,
- height: hsp(120),
- color: Colors.white,
- alignment: Alignment.center,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Icon(Icons.headset,color: Color(0xFF2C7CF6),size: hsp(40),),
- Text('咨询',style: TextStyle(fontSize: zsp(22),color: Color(0xFF007EFF),fontWeight: FontWeight.bold),)
- ],
- ),
- ),
- ),
- GestureDetector(
- onTap: (){
- _index = 9999;
- _isOrder = true;
- _getPriceData();
- // _getPackData();
- },
- child: Container(
- width: MediaQuery.of(context).size.width*0.8,
- height: hsp(120),
- color: widget.isWhole==true?Color(0xFF51A2F5):Color(0xFF007EFF),
- alignment: Alignment.center,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- Text('${widget.isWhole==1?'拼机':'整机'}特惠价 (元)',style: TextStyle(fontSize: zsp(20),color: Colors.white,fontWeight: FontWeight.bold),),
- Text('¥${_detailDict!=null?_detailDict[widget.isWhole==1?'retailPrice':'retailPrice']:''}',style: TextStyle(fontSize: zsp(36),color: Colors.white,fontWeight: FontWeight.bold),)
- ],
- ),
- ),
- ),
- ],
- )
- ],
- ),
- ),
- if(_isOrder==true)GestureDetector(
- onTap: (){
- setState(() {
- _isOrder = false;
- });
- },
- child: Container(
- height: MediaQuery.of(context).size.height,
- width: MediaQuery.of(context).size.width,
- color: Colors.black54,
- child: GestureDetector(
- onTap: (){},
- child: Column(
- children: [
- Container(
- height: MediaQuery.of(context).size.height*0.8-hsp(120),
- width: MediaQuery.of(context).size.width,
- margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.2),
- decoration: BoxDecoration(
- color: Color(0xFFF1F2F3),
- borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
- ),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- height: hsp(100),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
- ),
- padding: EdgeInsets.only(left: 15,right: 15),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Container(width: wsp(50),),
- Text('订单确认',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
- GestureDetector(
- child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
- onTap: (){
- setState(() {
- _isOrder = false;
- });
- },
- ),
- ],
- ),
- ),
- Divider(height: 0.5,thickness: 0.5,color: Color(0xFFE5E5E5),),
- Container(
- height: MediaQuery.of(context).size.height*0.8-hsp(220)-0.5,
- child: SingleChildScrollView(
- padding: EdgeInsets.all(0),
- child: Column(
- children: [
- Container(
- padding: EdgeInsets.all(hsp(30)),
- color: Colors.white,
- width: MediaQuery.of(context).size.width,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('使用日期',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- Container(
- margin: EdgeInsets.only(top: hsp(20)),
- child: Row(
- children: [
- Container(
- height: hsp(120),
- width: MediaQuery.of(context).size.width-hsp(200),
- child: ListView.separated(
- itemBuilder: (context,index){
- return GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: (){
- _timeStr = _priceList[index]['time'];
- setState(() {
- _selected = index;
- });
- },
- child: Stack(
- children: [
- Container(
- height: hsp(120),
- width: (MediaQuery.of(context).size.width-hsp(230))/3,
- decoration: BoxDecoration(
- color: index==_selected?Color(0xFF007EFF):Color(0xFFF0EEEE),
- borderRadius: BorderRadius.all(Radius.circular(5))
- ),
- alignment: Alignment.center,
- child: Text('${_priceList[index]['time']} \n¥${_priceList[index]['price']}',
- style: TextStyle(fontSize: zsp(20),color: index==_selected?Colors.white:Color(0xFF8B8B8B)),textAlign: TextAlign.center,),
- ),
- if(_selected==index)Container(
- child: Text(timeTag('${_priceList[index]['time']}'),style: TextStyle(fontSize: zsp(16),color: Color(0xFF007EFF)),),
- height: hsp(30),
- padding: EdgeInsets.only(left: wsp(3),right: wsp(3)),
- decoration: BoxDecoration(
- color: Color(0xFFF7F7F7),
- borderRadius: BorderRadius.only(topLeft: Radius.circular(3),bottomRight: Radius.circular(5))
- ),
- alignment: Alignment.center,
- ),
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Container(width: hsp(15),color: Colors.white,);
- },
- itemCount: _priceList.length,
- padding: EdgeInsets.all(0),
- scrollDirection: Axis.horizontal,
- ),
- ),
- if(_allPrices.length>1)GestureDetector(
- onTap: (){
- dateChooseAlert(
- context,
- dateValue: (dateValue){
- int index = 0;
- _priceList.clear();
- _priceList.addAll(_allPrices);
- for(int i=0;i<_priceList.length;i++){
- DateTime date1 = DateTime.parse('${_priceList[i]['time']}');
- DateTime date2 = DateTime.parse('$dateValue 00:00:00');
- if(date1.year==date2.year&&date1.month==date2.month&&date1.day==date2.day){
- index = i;
- }
- }
- _priceList.removeRange(0, index);
- _selected = 0;
- _timeStr = _priceList[_selected]['time'];
- setState(() {});
- },
- count: 45,
- startStr: _allPrices[0]['time']
- );
- },
- behavior: HitTestBehavior.opaque,
- child: Container(
- height: hsp(120),
- width: hsp(140),
- alignment: Alignment.center,
- child: Text('更多\n日期',style: TextStyle(fontSize: zsp(26),color: Color(0xFF007EFF)),),
- ),
- )
- ],
- ),
- ),
- ],
- ),
- ),
- Container(
- padding: EdgeInsets.all(hsp(30)),
- margin: EdgeInsets.only(top: hsp(10)),
- color: Colors.white,
- width: MediaQuery.of(context).size.width,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- if(_index!=9999)Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('${_chooses[0]['name']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- Text('¥${_chooses[0]['discountPrice']}',style: TextStyle(fontSize: zsp(40),color: Color(0xFFEB423B)),),
- ],
- ),
- Container(
- margin: EdgeInsets.only(top: hsp(20),bottom: hsp(20)),
- child: Text('${_detailDict!=null?_detailDict['setoutInfo']['display']:''} - ${_detailDict!=null?_detailDict['arriveInfo']['display']:''}',
- style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),fontWeight: FontWeight.bold),),
- ),
- GestureDetector(
- onTap: (){
- showInformAlert(context,title: '预定须知',content: _noticeStr);
- },
- child: RichText(
- text: TextSpan(
- text: '预订须知',
- style: TextStyle(fontSize: zsp(24),color: Color(0xFF027FFF)),
- children: [
- TextSpan(
- text: ' >',
- style: TextStyle(color: Color(0xFF000000))
- )
- ]
- ),
- ),
- )
- ],
- ),
- ),
- Container(
- child: Text('出行人',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- alignment: Alignment.centerLeft,
- height: hsp(80),
- padding: EdgeInsets.only(left: hsp(30)),
- margin: EdgeInsets.only(top: hsp(10)),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- ),
- Container(
- padding: EdgeInsets.only(left: hsp(30),right: hsp(30),top: hsp(20)),
- margin: EdgeInsets.only(top: hsp(1)),
- color: Colors.white,
- width: MediaQuery.of(context).size.width,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- padding: EdgeInsets.only(left: hsp(30),right: hsp(30),bottom: hsp(20)),
- child: GestureDetector(
- onTap: (){
- Navigator.of(context).push(
- CupertinoPageRoute(
- builder: (context){
- return YSContact();
- }
- )
- ).then((value){
- if(value!=null){
- if(_customer.contains(value)){
- _customer.remove(value);
- }
- setState(() {
- _customer.insert(0, value);
- });
- }
- });
- },
- child: Container(
- height: hsp(60),
- width: hsp(160),
- decoration: BoxDecoration(
- color: Color(0xFF007EFF),
- borderRadius: BorderRadius.all(Radius.circular(5))
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Icon(Icons.add_circle,color: Colors.white,size: hsp(30),),
- Text(' 新增',style: TextStyle(fontSize: zsp(28),color: Colors.white),),
- ],
- ),
- alignment: Alignment.center,
- ),
- )
- ,
- ),
- ],
- ),
- ),
- Container(
- color: Colors.white,
- child: ListView.separated(
- itemBuilder: (context,index){
- return Container(
- color: Colors.white,
- padding: EdgeInsets.only(top: hsp(20),bottom: hsp(20),left: hsp(50),right: hsp(50)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- GestureDetector(
- child: Icon(Icons.remove_circle,color: Colors.red,size: hsp(50),),
- onTap: (){
- setState(() {
- _customer.removeAt(index);
- });
- },
- ),
- Container(
- width: MediaQuery.of(context).size.width-hsp(180),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('${_customer[index]['username']} ${_customer[index]['phone']}',style: TextStyle(fontSize: zsp(34),color: Color(0xFF343434),fontWeight: FontWeight.bold),),
- Text('身份证 ${_customer[index]['cardid']}',style: TextStyle(fontSize: zsp(25),color: Color(0xFF666666)),)
- ],
- ),
- ),
- //Icon(Icons.mode_edit,color: Color(0xFF9A9A9A),size: hsp(50),),
- ],
- ),
- );
- },
- separatorBuilder: (context,index){
- return Divider(height: 0.5,thickness: 0.5,indent: hsp(100),);
- },
- itemCount: _customer.length,
- shrinkWrap: true,
- padding: EdgeInsets.all(0),
- physics: NeverScrollableScrollPhysics(),
- ),
- ),
- // GestureDetector(
- // onTap: (){
- // setState(() {
- // _isShow = !_isShow;
- // });
- // },
- // behavior: HitTestBehavior.opaque,
- // child: Container(
- // padding: EdgeInsets.only(left: wsp(40),right: wsp(40),top: hsp(20),bottom: hsp(20)),
- // margin: EdgeInsets.only(top: hsp(10)),
- // color: Colors.white,
- // child: Row(
- // mainAxisAlignment: MainAxisAlignment.spaceBetween,
- // children: [
- // Text('更多服务',style: TextStyle(fontSize: zsp(30),color: Color(0xFF9A9A9A)),),
- // Icon(Icons.keyboard_arrow_down,size: hsp(50),color: Color(0xFFC1C1C1),)
- // ],
- // )
- // ),
- // ),
- // if(_isShow==true)Container(
- // padding: EdgeInsets.only(left: wsp(32),right: wsp(32),top: hsp(20),bottom: hsp(10)),
- // decoration: BoxDecoration(
- // color: Color(0xFFFAFAFA),
- // borderRadius: BorderRadius.only(bottomRight: Radius.circular(10),bottomLeft: Radius.circular(10))
- // ),
- // child: ListView.builder(
- // shrinkWrap: true,
- // itemBuilder: (context,index){
- // return Container(
- // padding: EdgeInsets.only(bottom: wsp(20)),
- // child: Row(
- // mainAxisAlignment: MainAxisAlignment.spaceBetween,
- // children: [
- // Row(
- // children: [
- // Text('${_packList[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF999999)),),
- // Container(
- // width: wsp(50),
- // child: GestureDetector(
- // child: Icon(Icons.error_outline,size: hsp(40),color: Color(0xFF999999)),
- // ),
- // ),
- // Text('${_packList[index]['price']}元',style: TextStyle(fontSize: zsp(28),color: Colors.black),),
- // ],
- // ),
- // GestureDetector(
- // child: Container(
- // height: hsp(60),
- // width: hsp(100),
- // child: Image.asset(_chooses.contains(_packList[index])==true?'lib/images/kaiguankai.png':'lib/images/kaiguanguan.png'),
- // ),
- // onTap: (){
- // setState(() {
- // if(_chooses.contains(_packList[index])==true){
- // _chooses.remove(_packList[index]);
- // }else{
- // _chooses.add(_packList[index]);
- // }
- // });
- // },
- // )
- // ],
- // ),
- // );
- // },
- // itemCount: _packList.length,
- // padding: EdgeInsets.only(bottom: hsp(30)),
- // physics: NeverScrollableScrollPhysics(),
- // ),
- // )
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- Container(
- height: hsp(120),
- width: MediaQuery.of(context).size.width,
- color: Colors.white,
- padding: EdgeInsets.only(left: wsp(30),right: wsp(30)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- RichText(
- text: TextSpan(
- text: '参考价(¥)',
- style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),
- children: [
- TextSpan(
- text: ' ${_getPrice()}',
- style: TextStyle(fontSize: zsp(40),color: Color(0xFFFF6600)),
- )
- ]
- ),
- ),
- GestureDetector(
- child: Row(
- children: [
- Text('明细',style: TextStyle(fontSize: zsp(22),color: Color(0xFF181818)),),
- Icon(Icons.keyboard_arrow_up,size: hsp(30),color: Color(0xFF007EFF),),
- ],
- ),
- onTap: (){
- setState(() {
- _isDetail = !_isDetail;
- });
- },
- ),
- GestureDetector(
- onTap: (){
- _postPlaneOrderData();
- },
- child: Container(
- height: hsp(70),
- padding: EdgeInsets.only(left: wsp(50),right: wsp(50)),
- decoration: BoxDecoration(
- color: Color(0xFF007EFF),
- borderRadius: BorderRadius.all(Radius.circular(50))
- ),
- alignment: Alignment.center,
- child: Text('立即预约',style: TextStyle(fontSize: zsp(30),color: Colors.white,fontWeight: FontWeight.bold),),
- ),
- )
- ],
- ),
- )
- ],
- ),
- ),
- ),
- ),
- if(_isDetail==true)GestureDetector(
- onTap: (){
- setState(() {
- _isDetail = false;
- });
- },
- child: Container(
- height: MediaQuery.of(context).size.height-hsp(120),
- color: Colors.black45,
- child: Container(
- margin: EdgeInsets.only(top: MediaQuery.of(context).size.height-hsp(120)-hsp(370)),
- height: hsp(370),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.only(topLeft: Radius.circular(10),topRight: Radius.circular(10))
- ),
- child: GestureDetector(
- onTap: (){},
- behavior: HitTestBehavior.opaque,
- child: Column(
- children: [
- Container(
- height: hsp(100),
- padding: EdgeInsets.only(left: 15,right: 15),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- GestureDetector(
- child: Text('关闭',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
- onTap: (){
- setState(() {
- _isDetail = false;
- });
- },
- ),
- Text('明细',style: TextStyle(fontSize: 15,color: Color(0xFF000000),decoration: TextDecoration.none,fontWeight: FontWeight.bold),),
- Container(width: wsp(50),),
- ],
- ),
- ),
- Container(
- height: hsp(100),
- color: Color(0xFFF7F8F9),
- padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(20),top: hsp(20)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [//x ${_customer.length==0?1:_customer.length}人
- Text('座位',style: TextStyle(fontSize: zsp(32),color: Color(0xFF000000),decoration: TextDecoration.none),),
- Text('¥ ${_priceList[_selected]['price']}',style: TextStyle(fontSize: 15,color: Color(0xFF007EFF),decoration: TextDecoration.none),),
- ],
- ),
- ),
- Container(
- color: Color(0xFFF7F8F9),
- height: hsp(170),
- child: ListView.builder(
- padding: EdgeInsets.all(0),
- itemBuilder: (context,index){
- return Container(
- padding: EdgeInsets.only(left: wsp(40),right: wsp(40),bottom: hsp(10)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Text('${_chooses[index]['name']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
- Text('¥ ${_chooses[index]['discountPrice']}',style: TextStyle(fontSize: zsp(28),color: Color(0xFF9A9A9A)),),
- ],
- ),
- );
- },
- itemCount: _chooses.length,
- ),
- )
- ],
- ),
- ),
- ),
- ),
- )
- ],
- ),
- );
- }
- _getBackImageData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/wallconfigure/get',parameter: {'type':8},isLoading: false,isToken: false);
- if(dict!=null){
- setState(() {
- _msgDict = dict['data'];
- });
- }
- }
- _getContractPlaneDetailData() async{
- Map request = {};
- request['type'] = 8;
- request['id'] = widget.contractId;
- if(widget.arriveId!=null){
- request['airportIdArrive'] = widget.arriveId;
- }
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/AirTour/getTour',parameter: request,isLoading: false,isToken: false);
- if(dict!=null){
- setState(() {
- _detailDict = dict['data'];
- });
- if(_detailDict['groupDeadline']!=null){
- DateTime date1 = DateTime.now();
- DateTime date2 = DateTime.parse('${_detailDict['groupDeadline']}');
- _timeNum = date2.difference(date1).inSeconds.toInt();
- _timer = Timer.periodic(Duration(seconds: 1), (timer){
- if(_timeNum<=1){
- _timer.cancel();
- }else{
- _timeNum--;
- }
- _timeSet(() {});
- });
- }
- }
- }
- _getPackData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/get',parameter: {'type':8,'tourId':widget.contractId},
- isLoading: true,isToken: false);
- if(dict!=null){
- _packList = dict['data'];
- setState(() {
- });
- }
- }
- _getPriceData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneorder/getDateAndTime',
- parameter: {'type':8,'tourId':widget.contractId},isLoading: true,isToken: true);
- if(dict!=null){
- _priceList = dict['data'];
- _allPrices.clear();
- _allPrices.addAll(_priceList);
- _chooses.clear();
- if(_index!=9999){
- _chooses.add(_packList[_index]);
- }
- if(_priceList.length>0){
- _timeStr = _priceList[0]['time'];
- }
- _selected = 0;
- setState(() {});
- }
- }
- _getPrice(){
- double price = double.parse('${_priceList[_selected]['price']}');
- // _chooses.forEach((element) {
- // price+=double.parse('${element['price']}');
- // });
- if(_index!=9999){
- price+=double.parse('${_chooses[0]['discountPrice']}');
- }
- return price.toStringAsFixed(2);
- }
- _postPlaneOrderData() async{
- if(_customer.length==0){
- ysFlutterToast(context, '出行人数不能为空');
- return;
- }
- Map requestDict = {};
- requestDict['flightTime'] = _timeStr;
- requestDict['type'] = 8;
- requestDict['airplaneid'] = _detailDict['airplaneid'];
- requestDict['personnelInfo'] = _customer;
- requestDict['charterType'] = widget.isWhole==1?1:2;
- requestDict['airportidSetout'] = _detailDict['setoutInfo']['id'];
- requestDict['airportidArrive'] = _detailDict['arriveInfo']['id'];
- requestDict['tourId'] = widget.contractId;
- if(_index!=9999)requestDict['setmealIds'] = requestDict[_index]['id'];
- List array = [];
- _chooses.forEach((element) {
- array.add(element['id']);
- });
- requestDict['serviceIds'] = array.join(',');
- showNegotiateAlertDio(
- context,
- content: _noticeStr,
- sure: () async{
- Map dict = await ysRequestHttp(context,type: requestType.post,api: '/app/applets/airplaneorder/createOrder',parameter: requestDict,isLoading: true,isToken: true);
- if(dict!=null){
- Navigator.of(context).push(
- CupertinoPageRoute(
- builder: (context){
- return YSPay(orderDict: dict['data'],type: payType.preferential,);
- }
- )
- );
- }
- }
- );
- }
- _getNoticeData() async{
- Map dict = await ysRequestHttp(context,type: requestType.get,api: '/app/applets/airplaneservice/ctrip',parameter: {'type':8});
- if(dict!=null){
- _noticeStr = dict['data']['value'];
- }
- }
- }
|