Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lshaoshuai committed Jun 12, 2019
1 parent 3f2eb93 commit 3aa60c1
Show file tree
Hide file tree
Showing 64 changed files with 5,452 additions and 910 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ android {
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
Expand Down
Binary file added assets/fonts/jindian.ttf
Binary file not shown.
Binary file added assets/images/banner1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/banner3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/login_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions lib/common/api.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

import 'dart:core';

/**
*
* api
**/

String BASE_URL = "http://192.168.1.106";

const String CODE_BASE_PORT = ":12223";

const String ROOM_BASE_PORT = ":12222";

const String HOTEL_BASE_PORT = ":12224";

const String ORDER_BASE_PORT = ":12225";

String CODE_URL = BASE_URL + CODE_BASE_PORT + "/auth/code/";

String TOKEN_URL = BASE_URL + CODE_BASE_PORT + "/auth/checkcode";

String HOTEL_URL = BASE_URL + HOTEL_BASE_PORT + "/hotel/info/0/1";

String ROOM_URL = BASE_URL + ROOM_BASE_PORT + "/room/detail/1";

String ROOM_COUNT_URL = BASE_URL + ROOM_BASE_PORT + "/room/count/1";

String SINGLE_ROOM_COUNT_URL = BASE_URL + ROOM_BASE_PORT + "/room/single/count/1";

String ORDER_URL = BASE_URL + ORDER_BASE_PORT + "/order/detail/";


String COMMIT_ORDER_URL = BASE_URL + ORDER_BASE_PORT + "/order/commit/";

String CREATE_ORDER_URL = BASE_URL + ORDER_BASE_PORT + "/order/create/body";
18 changes: 18 additions & 0 deletions lib/common/constant.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import 'dart:core';

const String TOKEN_KEY = "TOKEN_KEY";

const String USER_NAME = "USER_NAME";

String gobalUserName = "";

String fontname = 'jindian';

DateTime selectDate = new DateTime.now();

int counttime = 100;



DateTime secselectDate = new DateTime.now().add(Duration(days: 1));

33 changes: 20 additions & 13 deletions lib/common/tu_chong_repository.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import 'package:dio/dio.dart';
import 'package:hotel/entity/hotelview.dart';
import 'package:hotel/entity/roomview.dart';
import 'package:http_client_helper/http_client_helper.dart';
import '../ui/widget/loading_more/loading_more_list.dart';
import '../common/tu_chong_source.dart';
import 'dart:async';
import 'dart:convert';

class TuChongRepository extends LoadingMoreBase<TuChongItem> {
import 'api.dart';

class TuChongRepository extends LoadingMoreBase<HotelView> {
int pageindex = 1;

@override
Expand Down Expand Up @@ -40,31 +45,33 @@ class TuChongRepository extends LoadingMoreBase<TuChongItem> {
Future<bool> loadData([bool isloadMoreAction = false]) async {
// TODO: implement getData
String url = "";
Dio dio = new Dio();
if (this.length == 0) {
url = "https://api.tuchong.com/feed-app";
url = HOTEL_URL;
} else {
int lastPostId = this[this.length - 1].post_id;
url = "https://api.tuchong.com/feed-app?post_id=${lastPostId}&page=${pageindex}&type=loadmore";
url = HOTEL_URL;
}
bool isSuccess = false;
try {
//to show loading more clearly, in your app,remove this
await Future.delayed(Duration(milliseconds: 500, seconds: 1));
// await Future.delayed(Duration(milliseconds: 500, seconds: 1));

var result = await HttpClientHelper.get(url);
var result = await dio.post(url);

var source = TuChongSource.fromJson(json.decode(result.body));
var source = HotelView.fromJson(result.data);
if (pageindex == 1) {
this.clear();
}

source.feedList.forEach((item) {
if (item.hasImage && !this.contains(item) && hasMore) {
this.add(item);
}
});
this.add(source);

// source.feedList.forEach((item) {
// if (item.hasImage && !this.contains(item) && hasMore) {
// this.add(item);
// }
// });

_hasMore = source.feedList.length != 0;
_hasMore = true;
pageindex++;
// this.clear();
// _hasMore=false;
Expand Down
1 change: 1 addition & 0 deletions lib/config/application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ class Application {
static navigateTo({ @required BuildContext context, @required String route, transition = TransitionType.inFromRight }) {
router.navigateTo(context, route, transition: transition);
}

}

44 changes: 44 additions & 0 deletions lib/entity/hotelview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

class HotelView{

int id;

String hotel_name;

String hotel_location;

String hotel_pic;

String hotel_grade;

String neighbor_location;

String tap;

String commuser_num;

HotelView();

HotelView.fromJson(Map<String, dynamic> json)
: id = json['id'],
hotel_name = json['hotel_name'],
hotel_location = json['hotel_location'],
hotel_pic = json['hotel_pic'],
hotel_grade = json['hotel_grade'],
neighbor_location = json['neighbor_location'],
tap = json['tap'],
commuser_num = json['commuser_num'];

Map<String, dynamic> toJson() =>
{
'id': id,
'hotel_name': hotel_name,
'hotel_location': hotel_location,
'hotel_pic': hotel_pic,
'hotel_grade': hotel_grade,
'neighbor_location': neighbor_location,
'tap': tap,
'commuser_num': commuser_num,

};
}
12 changes: 12 additions & 0 deletions lib/entity/mobile.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//import 'package:json_annotation/json_annotation.dart';
//
//@JsonSerializable(nullable: false)
//class Mobile{
//
// String code;
//
// String mobilenum;
//
// Mobile({this.code,this.mobilenum});
//
//}
41 changes: 41 additions & 0 deletions lib/entity/orderdetail.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

import 'dart:core';

class OrderDetail{

double collection_price;

String user_id;

String room_name;

String hotel_name;

int room_count;

String room_in_time;

String room_out_time;

OrderDetail.fromJson(Map<String, dynamic> json)
: room_name = json['room_name'],
room_count = json['room_count'],
collection_price = json['collection_price'],
room_in_time = json['room_in_time'],
room_out_time = json['room_out_time'],
hotel_name = json['hotel_name'],
user_id = json['user_id'];

Map<String, dynamic> toJson() =>
{
'room_name': room_name,
'room_count': room_count,
'collection_price': collection_price,
'room_out_time': room_out_time,
'room_in_time': room_in_time,
'user_id': user_id,
'hotel_name': hotel_name,

};

}
59 changes: 59 additions & 0 deletions lib/entity/orderview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

import 'dart:core';

import 'dart:core';

class OrderView{

int id;

double collection_price;

int order_id;

String user_id;

String room_name;

int pay_status;

String hotel_name;

int room_count;

String order_set_time;

String room_in_time;

String room_out_time;

OrderView.fromJson(Map<String, dynamic> json)
: id = json['id'],
room_name = json['room_name'],
room_count = json['room_count'],
collection_price = json['collection_price'],
order_id = json['order_id'],
pay_status = json['pay_status'],
room_in_time = json['room_in_time'],
room_out_time = json['room_out_time'],
order_set_time = json['order_set_time'],
hotel_name = json['hotel_name'],
user_id = json['user_id'];

Map<String, dynamic> toJson() =>
{
'id': id,
'room_name': room_name,
'room_count': room_count,
'collection_price': collection_price,
'order_id': order_id,
'pay_status': pay_status,
'room_out_time': room_out_time,
'order_set_time': order_set_time,
'room_in_time': room_in_time,
'user_id': user_id,
'hotel_name': hotel_name,

};

}
38 changes: 38 additions & 0 deletions lib/entity/roomview.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

class RoomView{

int id;

int room_count;

String room_name;

double room_price;

String room_detail;

String room_pic;

bool _cancel;

RoomView.fromJson(Map<String, dynamic> json)
: id = json['id'],
room_name = json['room_name'],
room_count = json['room_count'],
room_price = json['room_price'],
room_detail = json['room_detail'],
room_pic = json['room_pic'],
_cancel = json['_cancel'];

Map<String, dynamic> toJson() =>
{
'id': id,
'room_name': room_name,
'room_count': room_count,
'room_price': room_price,
'room_detail': room_detail,
'room_pic': room_pic,
'_cancel': _cancel,

};
}
20 changes: 20 additions & 0 deletions lib/entity/usertoken.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

class UserToken{

String phone_num;

String acesstoken;

UserToken.fromJson(Map<String, dynamic> json)
:phone_num = json['phone_num'],
acesstoken = json['acesstoken'];


Map<String, dynamic> toJson() =>
{

'phone_num': phone_num,
'acesstoken': acesstoken

};
}
Loading

0 comments on commit 3aa60c1

Please sign in to comment.