Commit b46bcea8 by 罗翻

android 框架改版

parent 43755525
Showing with 741 additions and 3692 deletions
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" /> <option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-4.1" />
<option name="modules"> <option name="modules">
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager"> <component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" /> <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
...@@ -27,17 +24,7 @@ ...@@ -27,17 +24,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'org.greenrobot.greendao' apply plugin: 'org.greenrobot.greendao'
apply plugin: 'me.tatarka.retrolambda'
android { android {
signingConfigs { signingConfigs {
config { release {
keyAlias 'app_key' keyAlias 'keybigfish'
keyPassword '123456789' keyPassword '123456789'
storeFile file('/Users/yu/Desktop/app_key.jks') storeFile file('/Users/luofan/AndroidStudioProjects/app_key.jks')
storePassword '123456789' storePassword '123456789'
} }
// debug {
// keyAlias 'keybigfish'
// keyPassword '123456789'
// storeFile file('/Users/luofan/AndroidStudioProjects/app_key.jks')
// storePassword '123456789'
// }
} }
compileSdkVersion 23 compileSdkVersion 25
buildToolsVersion "25.0.3" buildToolsVersion '26.0.2'
aaptOptions { aaptOptions {
cruncherEnabled = false cruncherEnabled = false
useNewCruncher = false useNewCruncher = false
...@@ -21,8 +25,8 @@ android { ...@@ -21,8 +25,8 @@ android {
applicationId "com.dayu.bigfish" applicationId "com.dayu.bigfish"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 23 targetSdkVersion 23
versionCode 3 versionCode 4
versionName "1.0.2" versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true multiDexEnabled true
} }
...@@ -33,6 +37,13 @@ android { ...@@ -33,6 +37,13 @@ android {
} }
buildTypes { buildTypes {
release { release {
signingConfig android.signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
signingConfig android.signingConfigs.release
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
...@@ -64,26 +75,17 @@ dependencies { ...@@ -64,26 +75,17 @@ dependencies {
}) })
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
//网络请求框架
compile 'com.lzy.net:okgo:2.1.4'
compile 'com.android.support:design:23.4.0' compile 'com.android.support:design:25.0.0'
//注解工具 //注解工具
compile 'com.jakewharton:butterknife:8.1.0' compile 'com.jakewharton:butterknife:8.1.0'
apt 'com.jakewharton:butterknife-compiler:8.1.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.1.0'
//友盟统计
compile 'com.umeng.analytics:analytics:latest.integration'
compile files('libs/hyphenatechat_3.3.4.jar')
compile files('libs/eventbus-3.0.0.jar')
//上拉加载,下拉刷新
compile 'com.cjj.materialrefeshlayout:library:1.3.0'
//greendao数据库 //greendao数据库
compile 'org.greenrobot:greendao:3.2.0' compile 'org.greenrobot:greendao:3.2.0'
//日期选择器 //日期选择器
compile 'com.contrarywind:Android-PickerView:3.2.4' compile 'com.contrarywind:Android-PickerView:3.2.4'
compile 'com.afollestad.material-dialogs:core:0.8.5.9'
compile files('libs/xUtils-2.6.14.jar') compile files('libs/xUtils-2.6.14.jar')
//adapter //adapter
......
...@@ -23,3 +23,111 @@ ...@@ -23,3 +23,111 @@
# If you keep the line number information, uncomment this to # If you keep the line number information, uncomment this to
# hide the original source file name. # hide the original source file name.
#-renamesourcefileattribute SourceFile #-renamesourcefileattribute SourceFile
#retrofit
-dontwarn okio.**
-dontwarn javax.annotation.**
#############################################
#PictureSelector 2.0
-keep class com.luck.picture.lib.** { *; }
-dontwarn com.yalantis.ucrop**
-keep class com.yalantis.ucrop** { *; }
-keep interface com.yalantis.ucrop** { *; }
#rxjava
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
#rxandroid
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
#glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# for DexGuard only
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
#########################################
#BaseRecyclerViewAdapterHelper
-keep class com.chad.library.adapter.** {
*;
}
-keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
-keep public class * extends com.chad.library.adapter.base.BaseViewHolder
-keepclassmembers class **$** extends com.chad.library.adapter.base.BaseViewHolder {
<init>(...);
}
#okgo
#okhttp
-dontwarn okhttp3.**
-keep class okhttp3.**{*;}
#okio
-dontwarn okio.**
-keep class okio.**{*;}
#greendao
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
# If you do not use SQLCipher:
-dontwarn org.greenrobot.greendao.database.**
# If you do not use Rx:
-dontwarn rx.**
#xutils
-keep class * extends java.lang.annotation.Annotation { *; }
#eventbus
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
#环信
-keep class com.hyphenate.** {*;}
-dontwarn com.hyphenate.**
#高德地图
-keep class com.amap.api.location.**{*;}
-keep class com.amap.api.fence.**{*;}
-keep class com.autonavi.aps.amapapi.model.**{*;}
...@@ -12,18 +12,29 @@ ...@@ -12,18 +12,29 @@
<uses-permission android:name="android.permission.VIBRATE"/> <uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.GET_TASKS"/> <uses-permission android:name="android.permission.GET_TASKS"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.access_network_state"/>
<!--用于进行网络定位-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<!--用于访问GPS定位-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<!--用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
<!--用于写入缓存数据到扩展存储卡-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<!--用于申请调用A-GPS模块-->
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
<!--用于申请获取蓝牙信息进行室内定位-->
<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>
<!--7.0以上拍照适配--> <!--7.0以上拍照适配-->
<!--<provider--> <!--<provider-->
...@@ -56,16 +67,13 @@ ...@@ -56,16 +67,13 @@
</provider> </provider>
<activity android:name=".MainActivity"> <activity android:name=".SplashActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".activity.HomeActivityPre"
android:hardwareAccelerated="true"/>
//友盟统计相关配置: //友盟统计相关配置:
<uses-sdk android:minSdkVersion="8"></uses-sdk> <uses-sdk android:minSdkVersion="8"></uses-sdk>
//配置应用Appkey //配置应用Appkey
...@@ -77,6 +85,11 @@ ...@@ -77,6 +85,11 @@
android:name="UMENG_CHANNEL" android:name="UMENG_CHANNEL"
android:value="Channel ID"/> android:value="Channel ID"/>
<!--高德地图-->
<meta-data
android:name="com.amap.api.v2.apikey"
android:value="05936ed54259770e56ffd1e67ac77958"/>
<service android:name="com.amap.api.location.APSService"></service>
<!-- 设置环信应用的AppKey --> <!-- 设置环信应用的AppKey -->
<meta-data <meta-data
android:name="EASEMOB_APPKEY" android:name="EASEMOB_APPKEY"
...@@ -102,20 +115,19 @@ ...@@ -102,20 +115,19 @@
</receiver> </receiver>
<activity android:name=".ui.LoginActivity"/> <activity android:name=".ui.LoginActivity"/>
<activity android:name=".activity.ReceivingActivityPre"/> <activity android:name=".ui.ReceivingActivity"/>
<activity android:name=".activity.PersonalCenterActivityPre"/> <activity android:name=".ui.SettingActivity"/>
<activity android:name=".activity.SettingActivityPre"/> <activity android:name=".ui.SubcribeTimeActivity"/>
<activity android:name=".activity.CheckTimeActivityPre"/> <activity android:name=".ui.OrderDetailsActivity"/>
<activity android:name=".activity.OrderDetailsActivityPre"/> <activity android:name=".ui.ProcessOrderActivity"/>
<activity android:name=".activity.OrderFinishActivityPre"/>
<activity android:name=".ui.PreviewActivty"/> <activity android:name=".ui.PreviewActivty"/>
<activity android:name=".ui.AboutUs"/> <activity android:name=".ui.AboutUs"/>
<activity android:name=".activity.IdeaActivityPre"/> <activity android:name=".ui.FeedBackActivity"/>
<activity android:name=".activity.WorksRecordActivityPre"/> <activity android:name=".ui.WorksRecordActivity"/>
<activity android:name=".activity.MessageActivity"/>
<activity android:name=".ui.AccountBalanceActivity"/> <activity android:name=".ui.AccountBalanceActivity"/>
<activity android:name=".ui.WithdrawalsActivity"/> <activity android:name=".ui.WithdrawalsActivity"/>
<activity android:name=".ui.AgreementActivity"/> <activity android:name=".ui.AgreementActivity"/>
<activity android:name=".ui.MainActivity"/>
<receiver android:name=".utils.NetworkConnectChangedReceiver"> <receiver android:name=".utils.NetworkConnectChangedReceiver">
<intent-filter> <intent-filter>
......
...@@ -20,69 +20,12 @@ public class Constants { ...@@ -20,69 +20,12 @@ public class Constants {
public static final String BASE_COUNT = "https://47.94.101.239:7500/"; public static final String BASE_COUNT = "https://47.94.101.239:7500/";
/***********************测试环境配置**********************************/ /***********************测试环境配置**********************************/
//控制Log日志的输出,具体常量控制规则由LogUtils类参数说明 public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL;
// public static final int DEBUGLEVEL = LogUtils.LEVEL_ALL; public static final String BASE_URL = "http://47.94.101.239:3112";
// public static final String BASE_URL = "http://47.94.101.239:3112";
// public static final String LOGIN_URL = BASE_URL + "/check";
// //登录时发送验证码的URL
// public static final String REGISTER_URL = BASE_URL + "/api-user/" + "account/loginSms/";
// //根据工单状态获取分页工单信息的路径
// public static final String ORDER_URL = BASE_URL + "/api-order/" + "orders/findSimpleOrderVOByPage";
// //异常单获取
// public static final String ERROR_ORDER = BASE_URL + "/api-order/" + "orders/findExceptionSimpleOrderVO";
// //工程师接单
// public static final String ORDER_RECEIVING = BASE_URL + "/api-order/" + "orders/";
// //再次上门、重新预约时间
// public static final String ORDER_DOOR = BASE_URL + "/api-order/" + "orders/bespeakDoor";
// //开始出发
// public static final String START_ORDER = BASE_URL + "/api-order/" + "orders/onWay/";
// //开始服务
// public static final String START_SERVE = BASE_URL + "/api-order/" + "orders/onWorking/";
// //工单详情信息,包含评价,投诉,服务记录
// public static final String ORDER_DETAILS = BASE_URL + "/api-order/" + "orders/";
// //工单完成,提交验收报告
// public static final String ORDER_FINISH = BASE_URL + "/api-order/" + "orders/waitCustomerCheck";
// //个人中心
// public static final String PERSONAL_CENTER = BASE_URL + "/api-user/" + "engineerInfo/accountId/";
// //个人中心,今日收益
// public static final String PERSONAL_ACOUNT_BALANCE = BASE_URL + "/api-settlement/" + "payAccount/queryAccountBalanceAndtodayIncrease/accountId/";
// //账户余额
// public static final String PERSONAL_ACCOUT_LIST = BASE_URL + "/api-settlement/" + "/payStream/queryPayStream/";
// //绑定支付宝账号
// public static final String PERSONAL_ALIPAY_BOUND = BASE_URL + "/api-settlement/" + "/alipay/save";
// //查询支付宝账号
// public static final String PERSONAL_ALIPAY_QUERY = BASE_URL + "/api-settlement/" + "alipay/queryAlipayByAccountId/accountId/";
// //修改支付宝账号
// public static final String PERSONAL_ALIPAY_MODIFY = BASE_URL + "/api-settlement/" + "/alipay/modifyAlipay";
// //单表查询工单记录
// public final static String SELECT_ORDER = BASE_URL + "/api-order/" + "orders/";
// //根据工程师id和工程师id获取今日业绩(今日收益)
// public final static String USER_ORDER_REVENUE = BASE_URL + "/api-count/" + "ordersStatistics/income/";
// //根据站点id和工程师id获取工程师今日接单数量
// public final static String USER_ORDER_RECEIVING = BASE_URL + "/api-count/" + "ordersStatistics/tasks/";
// //服务记录、工程师评价
// public final static String USER_REVENUE = BASE_URL + "/api-count/" + "ordersStatistics/total/";
// //反馈提交
// public final static String SET_IDEA_COMMIT = BASE_URL + "/api-base/" + "suggest";
// //版本更新检测
// public final static String UPDATA_VERSION = BASE_URL + "/api-base/" + "appVersion/newestVersion/appId/";
// //版本更新、获取新版本信息
// public final static String UPGRADE_VERSION = BASE_URL + "/api-base/" + "appVersion/versionInfo";
// public final static String COMMIT_VERSION_INFO = BASE_URL + "/api-base/" + "versionUpgrade";
// //工单记录/搜索工单
// public final static String WORKSSHEET_RECORD = BASE_URL + "/api-order/" + "orders/findSimpleOrderVOByPage";
// //获取首页tab状态的数量
// public final static String TAB_NUM = BASE_URL + "/api-order/" + "orders/";
// //环信
// public final static String MESSAGE_HX = BASE_URL + "/api-message/" + "hXMessage";
// //处理工单上传照片
// public final static String UP_PHOTO = "http://47.94.101.239:3111/file/uploadMore";
/**************************正式环境*******************************/ /**************************正式环境*******************************/
//控制Log日志的输出,具体常量控制规则由LogUtils类参数说明 // public static final int DEBUGLEVEL = LogUtils.LEVEL_OFF;
public static final int DEBUGLEVEL = LogUtils.LEVEL_OFF; // public static final String BASE_URL = "https://mobile.dayu.ai";
public static final String BASE_URL = "https://mobile.dayu.ai";
//登录的URL
public static final String LOGIN_URL = BASE_URL + "/check"; public static final String LOGIN_URL = BASE_URL + "/check";
//登录时发送验证码的URL //登录时发送验证码的URL
public static final String REGISTER_URL = BASE_URL + "/api-user/" + "account/loginSms/"; public static final String REGISTER_URL = BASE_URL + "/api-user/" + "account/loginSms/";
...@@ -104,6 +47,16 @@ public class Constants { ...@@ -104,6 +47,16 @@ public class Constants {
public static final String ORDER_FINISH = BASE_URL + "/api-order/" + "orders/waitCustomerCheck"; public static final String ORDER_FINISH = BASE_URL + "/api-order/" + "orders/waitCustomerCheck";
//个人中心 //个人中心
public static final String PERSONAL_CENTER = BASE_URL + "/api-user/" + "engineerInfo/accountId/"; public static final String PERSONAL_CENTER = BASE_URL + "/api-user/" + "engineerInfo/accountId/";
//个人中心,今日收益
public static final String PERSONAL_ACOUNT_BALANCE = BASE_URL + "/api-settlement/" + "payAccount/queryAccountBalanceAndtodayIncrease/accountId/";
//账户余额
public static final String PERSONAL_ACCOUT_LIST = BASE_URL + "/api-settlement/" + "/payStream/queryPayStream/";
//绑定支付宝账号
public static final String PERSONAL_ALIPAY_BOUND = BASE_URL + "/api-settlement/" + "/alipay/save";
//查询支付宝账号
public static final String PERSONAL_ALIPAY_QUERY = BASE_URL + "/api-settlement/" + "alipay/queryAlipayByAccountId/accountId/";
//修改支付宝账号
public static final String PERSONAL_ALIPAY_MODIFY = BASE_URL + "/api-settlement/" + "/alipay/modifyAlipay";
//单表查询工单记录 //单表查询工单记录
public final static String SELECT_ORDER = BASE_URL + "/api-order/" + "orders/"; public final static String SELECT_ORDER = BASE_URL + "/api-order/" + "orders/";
//根据工程师id和工程师id获取今日业绩(今日收益) //根据工程师id和工程师id获取今日业绩(今日收益)
...@@ -123,20 +76,10 @@ public class Constants { ...@@ -123,20 +76,10 @@ public class Constants {
public final static String WORKSSHEET_RECORD = BASE_URL + "/api-order/" + "orders/findSimpleOrderVOByPage"; public final static String WORKSSHEET_RECORD = BASE_URL + "/api-order/" + "orders/findSimpleOrderVOByPage";
//获取首页tab状态的数量 //获取首页tab状态的数量
public final static String TAB_NUM = BASE_URL + "/api-order/" + "orders/"; public final static String TAB_NUM = BASE_URL + "/api-order/" + "orders/";
//环信消息 //环信
public final static String MESSAGE_HX = BASE_URL + "/api-message/" + "hXMessage"; public final static String MESSAGE_HX = BASE_URL + "/api-message/" + "hXMessage";
//处理工单上传照片 //处理工单上传照片
public final static String UP_PHOTO = BASE_URL + "/file/uploadMore"; public final static String UP_PHOTO = "http://47.94.101.239:3111/file/uploadMore";
//账户余额
public static final String PERSONAL_ACCOUT_LIST = BASE_URL + "/api-settlement/" + "/payStream/queryPayStream/";
//绑定支付宝账号
public static final String PERSONAL_ALIPAY_BOUND = BASE_URL + "/api-settlement/" + "/alipay/save";
//查询支付宝账号
public static final String PERSONAL_ALIPAY_QUERY = BASE_URL + "/api-settlement/" + "/alipay/queryAlipayByAccountId/accountId/";
//修改支付宝账号
public static final String PERSONAL_ALIPAY_MODIFY = BASE_URL + "/api-settlement/" + "/alipay/modifyAlipay";
//个人中心,今日收益
public static final String PERSONAL_ACOUNT_BALANCE = BASE_URL + "/api-settlement/" + "payAccount/queryAccountBalanceAndtodayIncrease/accountId/";
/***********************其他配置**********************************/ /***********************其他配置**********************************/
//相册选择照片删除时传递的key //相册选择照片删除时传递的key
...@@ -157,4 +100,14 @@ public class Constants { ...@@ -157,4 +100,14 @@ public class Constants {
public final static String OLD_PAKAGENUM = "old_pakegnum"; public final static String OLD_PAKAGENUM = "old_pakegnum";
//订单进行状态 //订单进行状态
public final static String ORDER_STATE = "order_state"; public final static String ORDER_STATE = "order_state";
public final static String DUMP_INDEX = "dump_index";
//订单状态
public final static int WATING_ORDER = 1;
public final static int APPOIMENT_ORDER = 2;
public final static int WATING_SERVER = 110;
public final static int CANCLE_ORDER = 6;
public final static int FINISH_ORDER = 5;
} }
...@@ -8,20 +8,16 @@ import android.net.ConnectivityManager; ...@@ -8,20 +8,16 @@ import android.net.ConnectivityManager;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.os.Handler; import android.os.Handler;
import com.amap.api.location.AMapLocationClient;
import com.amap.api.location.AMapLocationListener;
import com.dayu.bigfish.greendao.GreenDaoManager; import com.dayu.bigfish.greendao.GreenDaoManager;
import com.dayu.bigfish.utils.LocationUtils;
import com.dayu.bigfish.utils.NetworkConnectChangedReceiver; import com.dayu.bigfish.utils.NetworkConnectChangedReceiver;
import com.hyphenate.chat.EMClient; import com.hyphenate.chat.EMClient;
import com.hyphenate.chat.EMOptions; import com.hyphenate.chat.EMOptions;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.interceptor.HttpLoggingInterceptor;
import com.lzy.okgo.model.HttpHeaders;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import okhttp3.OkHttpClient;
/** /**
* 全局的相关配置 * 全局的相关配置
...@@ -35,6 +31,10 @@ public class MyApplication extends Application { ...@@ -35,6 +31,10 @@ public class MyApplication extends Application {
private static int mMainThreadId; private static int mMainThreadId;
// 记录环信是否已经初始化 // 记录环信是否已经初始化
private boolean isInit = false; private boolean isInit = false;
//声明AMapLocationClient类对象
public AMapLocationClient mLocationClient = null;
//声明定位回调监听器
public AMapLocationListener mLocationListener ;
/** /**
* 程序的入口方法 * 程序的入口方法
...@@ -47,9 +47,6 @@ public class MyApplication extends Application { ...@@ -47,9 +47,6 @@ public class MyApplication extends Application {
filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(new NetworkConnectChangedReceiver(), filter); registerReceiver(new NetworkConnectChangedReceiver(), filter);
//捕获错误报告并上传到友盟服务器
/* public static void reportError(Context mContext, String error)
public static void reportError(Context mContext, Throwable e)*/
//上下文 //上下文
mContext = getApplicationContext(); mContext = getApplicationContext();
//初始化greendao //初始化greendao
...@@ -58,7 +55,6 @@ public class MyApplication extends Application { ...@@ -58,7 +55,6 @@ public class MyApplication extends Application {
mHandler = new Handler(); mHandler = new Handler();
//当前线程(主线程)的线程id //当前线程(主线程)的线程id
mMainThreadId = android.os.Process.myTid(); mMainThreadId = android.os.Process.myTid();
initOkGo();
// 初始化环信SDK // 初始化环信SDK
EMOptions options = new EMOptions(); EMOptions options = new EMOptions();
options.setAutoLogin(true); options.setAutoLogin(true);
...@@ -67,8 +63,11 @@ public class MyApplication extends Application { ...@@ -67,8 +63,11 @@ public class MyApplication extends Application {
//在做打包混淆时,关闭debug模式,避免消耗不必要的资源 //在做打包混淆时,关闭debug模式,避免消耗不必要的资源
EMClient.getInstance().setDebugMode(true); EMClient.getInstance().setDebugMode(true);
initEasemob(); initEasemob();
//初始化高德地图
LocationUtils.init(getApplicationContext());
} }
private void initEasemob() { private void initEasemob() {
// 获取当前进程 id 并取得进程名 // 获取当前进程 id 并取得进程名
int pid = android.os.Process.myPid(); int pid = android.os.Process.myPid();
...@@ -117,75 +116,6 @@ public class MyApplication extends Application { ...@@ -117,75 +116,6 @@ public class MyApplication extends Application {
} }
/** /**
* Okgo的一些全局基本参数配置,具体到请求时再配置一遍的话就会覆盖现有的参数配置
*/
private void initOkGo() {
OkGo.init(this);
//---------这里给出的是示例代码,告诉你可以这么传,实际使用的时候,根据需要传,不需要就不传-------------//
HttpHeaders headers = new HttpHeaders();
headers.put("Accept", "application/json"); //header不支持中文,不允许有特殊字符
// headers.put("commonHeaderKey2", "commonHeaderValue2");
// HttpParams params = new HttpParams();
// params.put("commonParamsKey1", "commonParamsValue1"); //param支持中文,直接传,不要自己编码
// params.put("commonParamsKey2", "这里支持中文参数");
//----------------------------------------------------------------------------------------//
OkHttpClient.Builder builder = new OkHttpClient.Builder();
//log相关
HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor("OkGo");
//log打印级别,决定了log显示的详细程度
loggingInterceptor.setPrintLevel(HttpLoggingInterceptor.Level.BODY);
//log颜色级别,决定了log在控制台显示的颜色
loggingInterceptor.setColorLevel(Level.INFO);
builder.addInterceptor(loggingInterceptor); //添加OkGo默认debug日志
//第三方的开源库,使用通知显示当前请求的log,不过在做文件下载的时候,这个库好像有问题,对文件判断不准确
//builder.addInterceptor(new ChuckInterceptor(this));
/* //超时时间设置,默认60秒
builder.readTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的读取超时时间
builder.writeTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的写入超时时间
builder.connectTimeout(OkGo.DEFAULT_MILLISECONDS, TimeUnit.MILLISECONDS); //全局的连接超时时间 */
//超时时间设置,默认60秒
builder.readTimeout(15000, TimeUnit.MILLISECONDS); //全局的读取超时时间
builder.writeTimeout(15000, TimeUnit.MILLISECONDS); //全局的写入超时时间
builder.connectTimeout(15000, TimeUnit.MILLISECONDS); //全局的连接超时时间
//自动管理cookie(或者叫session的保持),以下几种任选其一就行
//builder.cookieJar(new CookieJarImpl(new SPCookieStore(this))); //使用sp保持cookie,如果cookie不过期,则一直有效
//builder.cookieJar(new CookieJarImpl(new DBCookieStore(this))); //使用数据库保持cookie,如果cookie不过期,则一直有效
//builder.cookieJar(new CookieJarImpl(new MemoryCookieStore())); //使用内存保持cookie,app退出后,cookie消失
//https相关设置,以下几种方案根据需要自己设置
//方法一:信任所有证书,不安全有风险
// HttpsUtils.SSLParams sslParams1 = HttpsUtils.getSslSocketFactory();
// //方法二:自定义信任规则,校验服务端证书
// HttpsUtils.SSLParams sslParams2 = HttpsUtils.getSslSocketFactory(new SafeTrustManager());
// //方法三:使用预埋证书,校验服务端证书(自签名证书)
// //HttpsUtils.SSLParams sslParams3 = HttpsUtils.getSslSocketFactory(getAssets().open("srca.cer"));
// //方法四:使用bks证书和密码管理客户端证书(双向认证),使用预埋证书,校验服务端证书(自签名证书)
// //HttpsUtils.SSLParams sslParams4 = HttpsUtils.getSslSocketFactory(getAssets().open("xxx.bks"), "123456", getAssets().open("yyy.cer"));
// builder.sslSocketFactory(sslParams1.sSLSocketFactory, sslParams1.trustManager);
// //配置https的域名匹配规则,详细看demo的初始化介绍,不需要就不要加入,使用不当会导致https握手失败
// builder.hostnameVerifier(new SafeHostnameVerifier());
// 其他统一的配置
// 详细说明看GitHub文档:https://github.com/jeasonlzy/
OkGo.getInstance()
.addCommonHeaders(headers);//全局公共头
//必须调用初始化
// .setOkHttpClient(builder.build()) //必须设置OkHttpClient
// .setCacheMode(CacheMode.NO_CACHE) //全局统一缓存模式,默认不使用缓存,可以不传
// .setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE) //全局统一缓存时间,默认永不过期,可以不传
// .setRetryCount(3);
// 全局统一超时重连次数,默认为三次,最差的情况会请求4次(一次原始请求,三次重连请求),不需要可以设置为0
// .addCommonParams(params); //全局公共参数
}
/**
* 得到全局上下文,慎用 * 得到全局上下文,慎用
*/ */
public static Context getContext() { public static Context getContext() {
......
package com.dayu.bigfish.activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.widget.ImageView;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.adapter.FragmentOrderAdapter;
import com.dayu.bigfish.fragment.order.message.BigFishMessageFragment;
import com.dayu.bigfish.fragment.order.message.SystemMessageFragment;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 消息中心页面,包含两个Fragment
* 2017/10/14.
* Created by yu
*/
public class MessageActivity extends FragmentActivity {
@BindView(R.id.message_back)
ImageView messageBack;
@BindView(R.id.text_title)
TextView textTitle;
@BindView(R.id.message_tablayout)
TabLayout messageTablayout;
@BindView(R.id.message_view_pager)
ViewPager messageViewPager;
private List<Fragment> list;
private String orderValue;
private int orderId;
private FragmentOrderAdapter fragmentAdapter;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message);
ButterKnife.bind(this);
initData();
}
public void initData() {
/* Intent intent = getIntent();
orderValue = intent.getStringExtra("orderId");
orderId = Integer.parseInt(orderValue);
*/
list = new ArrayList<>();
list.add(new SystemMessageFragment());
list.add(new BigFishMessageFragment());
fragmentAdapter = new FragmentOrderAdapter(getSupportFragmentManager(), list);
messageViewPager.setAdapter(fragmentAdapter);
messageTablayout.setupWithViewPager(messageViewPager);
messageTablayout.removeAllTabs();
messageTablayout.addTab(messageTablayout.newTab().setText("系统通知"));
messageTablayout.addTab(messageTablayout.newTab().setText("大鱼通知"));
messageTablayout.setTabMode(TabLayout.MODE_FIXED);
}
@OnClick(R.id.message_back)
public void onViewClicked() {
finish();
}
}
\ No newline at end of file
package com.dayu.bigfish.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.adapter.ReceivingAdapter;
import com.dayu.bigfish.base.PreBaseActivity;
import com.dayu.bigfish.bean.ReceivingBean;
import com.dayu.bigfish.eventbus.RefreshTabNum;
import com.dayu.bigfish.moudle.receiving.Receiving;
import com.dayu.bigfish.moudle.receiving.ReceivingPresenterPre;
import com.dayu.bigfish.moudle.receiving.ReceivingView;
import com.dayu.bigfish.tip.TipsHelper;
import com.dayu.bigfish.utils.GetUserInfo;
import com.dayu.bigfish.utils.ToastUtils;
import com.dayu.bigfish.views.CustomProgressDialog;
import org.greenrobot.eventbus.EventBus;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 待接单列表
* on 2017/8/28.
* Created by yu
*/
public class ReceivingActivityPre extends PreBaseActivity<ReceivingView, ReceivingPresenterPre> implements ReceivingView, Receiving {
@BindView(R.id.receiving_back)
ImageView receivingBack;
public ReceivingAdapter mReceiviingAdapter;
public ReceivingPresenterPre mReceivingPresenter;
public List<ReceivingBean.DataBeanX.DataBean> list;
@BindView(R.id.receiving_title)
RelativeLayout receivingTitle;
@BindView(R.id.receiving_refersh)
SwipeRefreshLayout receivingRefersh;
@BindView(R.id.order_title_num)
TextView orderTitleNum;
@BindView(R.id.image_empty)
ImageView imageEmpty;
@BindView(R.id.textView_empty)
TextView textViewEmpty;
@BindView(R.id.view)
RelativeLayout view;
@BindView(R.id.receiving_listview)
ListView receivingListview;
/* @BindView(R.id.receiving_listview)
ListView receivingListview;*/
private int userId;
private CustomProgressDialog dialog;
TipsHelper mTipsHelper;
private String token;
private int orderId;
// private Boolean refershState;;
// public LayoutInflater inflater; //加载更多的布局
// private View loadmoreView;//用来接收加载更多的布局
// public int last_index; //
//public int total_index;
// public boolean isLoading = false;//表示是否正处于加载状态
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_receiving);
ButterKnife.bind(this);
userId = GetUserInfo.getACCOUNT_ID(this);
token = GetUserInfo.getToken(this);
dialog = new CustomProgressDialog(this, R.style.CustomDialog);
//初始化receivingRefersh的颜色
//第一次进入的时候就刷新数据
initView();
//下拉刷新的监听
initListener();
// initData();
}
@Override
public void initListener() {
receivingListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
orderId = list.get(position).getId();
Intent intent = new Intent(ReceivingActivityPre.this, OrderDetailsActivityPre.class);
intent.putExtra("orderId", orderId + "");
startActivity(intent);
}
});
receivingRefersh.setOnRefreshListener(
() -> initNetWork(1, 1, 20, GetUserInfo.getSITE_ID(ReceivingActivityPre.this)));
}
@Override
public void initView() {
mTipsHelper = createTipsHelper(receivingRefersh);
receivingRefersh.setColorSchemeColors(getResources().getColor(R.color.cl_receiving_order_item_data));
/* inflater = LayoutInflater.from(this);
loadmoreView = inflater.inflate(R.layout.listview_bottom_view,null);
//设置加载更多的视图是默认不可见的
loadmoreView.setVisibility(View.VISIBLE);
// receivingListview.setOnScrollListener(this);
receivingListview.addFooterView(loadmoreView,null,false);*/
//---------分割线------------//
receivingRefersh.post(new Runnable() {
@Override
public void run() {
receivingRefersh.setRefreshing(true);
}
});
initNetWork(1, 1, 20, GetUserInfo.getSITE_ID(this));
}
@Override
public void initData() {
}
//请求列表数据
public void initNetWork(int getState, int pagerId, int PagerSize, int siteId) {
mReceivingPresenter.get(getState, pagerId, PagerSize, siteId, token, userId);
}
@Override
public ReceivingPresenterPre initPresenter() {
this.mReceivingPresenter = new ReceivingPresenterPre(this);
return mReceivingPresenter;
}
@OnClick(R.id.receiving_back)
public void onViewClicked() {
finish();
}
@Override
public void loginSuccess(ReceivingBean receivingBean) {
}
@Override
public void refershSuccess(ReceivingBean receivingBean) {
mTipsHelper.hideError();
// int userId = (int) SPUtils.get(this,"ACCOUNTId","");
list = receivingBean.getData().getData();
if (list.size() == 0 || list == null) {
// mTipsHelper.showEmpty();
view.setVisibility(View.VISIBLE);
receivingListview.setVisibility(View.GONE);
dialog.dismiss();
receivingRefersh.post(() -> receivingRefersh.setRefreshing(false));
} else {
// mTipsHelper.hideEmpty();
view.setVisibility(View.GONE);
receivingListview.setVisibility(View.VISIBLE);
orderTitleNum.setText(getResources().getText(R.string.tv_order_list_num) + (String.valueOf(list.size())) + ")");
mReceiviingAdapter = new ReceivingAdapter(ReceivingActivityPre.this, list, this);
receivingListview.setAdapter(mReceiviingAdapter);
receivingRefersh.post(() -> receivingRefersh.setRefreshing(false));
mReceiviingAdapter.notifyDataSetChanged();
}
//initData();
}
//网络请求失败的回调
@Override
public void loginFailed(String msg) {
ToastUtils.showShortToast(msg);
}
/**
* 接单成功的回调
* */
@Override
public void receivingSuccess() {
ToastUtils.showShortToast("接单成功");
//initNetWork(1, 1, 20, GetUserInfo.getSITE_ID(this));
//接单成功,刷新首页tab状态数量
EventBus.getDefault().post(new RefreshTabNum(0));
dialog.dismiss();
finish();
}
@Override
public void refershFailed(String msg) {
dialog.dismiss();
receivingRefersh.post(() -> receivingRefersh.setRefreshing(false));
view.setVisibility(View.VISIBLE);
receivingListview.setVisibility(View.GONE);
}
//接单的回调
@Override
public void receivingOrder(int orderId) {
int userId = GetUserInfo.getACCOUNT_ID(this);
dialog.show();
mReceivingPresenter.receivingOrder(orderId, userId, token);
}
}
...@@ -6,13 +6,11 @@ import android.graphics.Typeface; ...@@ -6,13 +6,11 @@ import android.graphics.Typeface;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.dayu.bigfish.R; import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.MessageBean; import com.dayu.bigfish.bean.NewMessage;
import com.dayu.bigfish.bean.NewMessageBean;
import com.dayu.bigfish.utils.DateUtils; import com.dayu.bigfish.utils.DateUtils;
import java.util.List; import java.util.List;
...@@ -26,13 +24,13 @@ import butterknife.ButterKnife; ...@@ -26,13 +24,13 @@ import butterknife.ButterKnife;
*/ */
public class BigFishMessageAdapter extends BaseAdapter { public class BigFishMessageAdapter extends BaseAdapter {
private List<NewMessageBean.DataBeanX.DataBean> bigFishList; private List<NewMessage> bigFishList;
private DateUtils myDateUtils; private DateUtils myDateUtils;
private Context context; private Context context;
private String dataMD; private String dataMD;
private String dataTime; private String dataTime;
public BigFishMessageAdapter(List<NewMessageBean.DataBeanX.DataBean> bigFishList, Context context,DateUtils dateUtils) { public BigFishMessageAdapter(List<NewMessage> bigFishList, Context context, DateUtils dateUtils) {
this.bigFishList = bigFishList; this.bigFishList = bigFishList;
this.context = context; this.context = context;
this.myDateUtils = dateUtils; this.myDateUtils = dateUtils;
......
package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.OrderFinishBean;
import com.dayu.bigfish.utils.DateUtils;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 已取消列表的适配器
* on 2017/9/12.
*/
public class HomeEndTabAdapter extends BaseAdapter {
private Context context;
private List<OrderFinishBean.DataBeanX.DataBean> list;
private String dateMD = null;
private String dateTime = null;
private DateUtils dateUtils = new DateUtils();
public HomeEndTabAdapter(Context context, List<OrderFinishBean.DataBeanX.DataBean> finishBean) {
this.context = context;
this.list = finishBean;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder viewHolder;
if (convertView == null) {
view = View.inflate(context, R.layout.fragment_tabend_item, null);
viewHolder = new ViewHolder(view, context);
view.setTag(viewHolder);
} else {
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
initData(position, viewHolder);
return view;
}
private void initData(int position, ViewHolder viewHolder) {
try {
dateMD = dateUtils.stringDateToDate(list.get(position).getCreateTime());
dateTime = dateUtils.stringTimeToDate(list.get(position).getCreateTime());
} catch (Exception e) {
e.printStackTrace();
}
viewHolder.itemTody.setText(dateMD);
viewHolder.itemTime.setText(dateTime);
//服务类型
viewHolder.itemTextWeixiu.setText(list.get(position).getProviderName());
// 维修类型
viewHolder.itemTextWeixiuLeixing.setText(list.get(position).getCategoryName());
//拼接省市区街道地址
viewHolder.itemTextDizhi.setText(
//省一级城市名称
(String) list.get(position).getProvinceName()
//市一级城市名称
+ list.get(position).getCityName() +
//区/地区一级城市名称
list.get(position).getDistrictName() +
//详细到街道
list.get(position).getAddress());
}
static class ViewHolder {
@BindView(R.id.item_line)
ImageView itemLine;
@BindView(R.id.item_tody)
TextView itemTody;
@BindView(R.id.item_time)
TextView itemTime;
@BindView(R.id.item_image_weixiu)
ImageView itemImageWeixiu;
@BindView(R.id.item_image_dizhi)
ImageView itemImageDizhi;
@BindView(R.id.item_text_weixiu)
TextView itemTextWeixiu;
@BindView(R.id.text_line)
TextView textLine;
@BindView(R.id.item_text_weixiu_leixing)
TextView itemTextWeixiuLeixing;
@BindView(R.id.item_text_dizhi)
TextView itemTextDizhi;
@BindView(R.id.item)
RelativeLayout item;
ViewHolder(View view,Context context) {
ButterKnife.bind(this, view);
ButterKnife.bind(this, view);
AssetManager mgr = context.getAssets();//得到AssetManager
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");//根据路径得到Typeface
itemTime.setTypeface(tf);//设置字体
}
}
}
package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.R;
import com.dayu.bigfish.activity.CheckTimeActivityPre;
import com.dayu.bigfish.bean.HomeOneTabBean;
import com.dayu.bigfish.utils.DateUtils;
import com.dayu.bigfish.utils.ToastUtils;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.dayu.bigfish.activity.HomeActivityPre.SUBCRIBE_TIME;
/**
* 未预约列表的适配器
* 2017/9/9.
*/
public class HomeOneTabAdapter extends BaseAdapter {
private Context context;
private List<HomeOneTabBean.DataBeanX.DataBean> oneTablist;
private String dateMD = null;
private String dateTime = null;
private DateUtils dateUtils = new DateUtils();
public HomeOneTabAdapter(Context contex, List<HomeOneTabBean.DataBeanX.DataBean> oneTablist) {
this.context = contex;
this.oneTablist = oneTablist;
}
@Override
public int getCount() {
return oneTablist.size();
}
@Override
public Object getItem(int position) {
return oneTablist.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder viewHolder;
if (convertView == null) {
view = View.inflate(context, R.layout.activity_listview_item, null);
viewHolder = new ViewHolder(view, context);
view.setTag(viewHolder);
} else {
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
try {
initData(position, viewHolder);
} catch (Exception e) {
e.printStackTrace();
ToastUtils.showShortToast("待预约列表适配器解析异常");
}
return view;
}
static class ViewHolder {
@BindView(R.id.item_line)
ImageView itemLine;
@BindView(R.id.item_tody)
TextView itemTody;
@BindView(R.id.item_time)
TextView itemTime;
@BindView(R.id.item_image_user)
ImageView itemImageUser;
@BindView(R.id.item_text_user_name)
TextView itemTextUserName;
@BindView(R.id.item_text_user_phone)
TextView itemTextUserPhone;
@BindView(R.id.item_image_weixiu)
ImageView itemImageWeixiu;
@BindView(R.id.item_image_dizhi)
ImageView itemImageDizhi;
@BindView(R.id.item_text_weixiu)
TextView itemTextWeixiu;
@BindView(R.id.text_line)
TextView textLine;
@BindView(R.id.item_text_weixiu_leixing)
TextView itemTextWeixiuLeixing;
@BindView(R.id.item_text_dizhi)
TextView itemTextDizhi;
@BindView(R.id.item)
RelativeLayout item;
@BindView(R.id.item_text_phone)
TextView itemTextPhone;
@BindView(R.id.item_text_time)
TextView itemTextTime;
ViewHolder(View view, final Context context) {
ButterKnife.bind(this, view);
AssetManager mgr = context.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
itemTime.setTypeface(tf);//设置字体
}
}
private void initData(final int position, final ViewHolder viewHolder) throws Exception {
final int value = oneTablist.get(position).getId();
dateMD = dateUtils.stringDateToDate(oneTablist.get(position).getCreateTime());
viewHolder.itemTody.setText(dateMD);
dateTime = dateUtils.stringTimeToDate(oneTablist.get(position).getCreateTime());
viewHolder.itemTime.setText(dateTime);
//服务类型
viewHolder.itemTextWeixiu.setText(oneTablist.get(position).getProviderName());
// 维修类型
viewHolder.itemTextWeixiuLeixing.setText(oneTablist.get(position).getCategoryName());
//拼接省市区街道地址
viewHolder.itemTextDizhi.setText(oneTablist.get(position).getProvinceName()
+ oneTablist.get(position).getCityName() +
oneTablist.get(position).getDistrictName() +
oneTablist.get(position).getAddress());
//用户名
viewHolder.itemTextUserName.setText( oneTablist.get(position).getCustomerName());
//用户手机号
viewHolder.itemTextUserPhone.setText(oneTablist.get(position).getCustomerMobile());
viewHolder.itemTextPhone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + oneTablist.get(position).getCustomerMobile()));
context.startActivity(intent);
}
});
viewHolder.itemTextTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, CheckTimeActivityPre.class);
intent.putExtra("orderId", value + "");
intent.putExtra(Constants.ORDER_STATE, SUBCRIBE_TIME);
context.startActivity(intent);
}
});
}
}
package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.ErrorOrderBean;
import com.dayu.bigfish.utils.DateUtils;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.dayu.bigfish.R.id.error_state;
/**
* 异常单列表的适配器
* on 2017/9/12.
*/
public class HomeThreeTabAdapter extends BaseAdapter {
private Context context;
private List<ErrorOrderBean.DataBean> errorList;
private String dateMD = null;
private String dateTime = null;
private DateUtils dateUtils = new DateUtils();
private int errorState;
public HomeThreeTabAdapter(Context context, List<ErrorOrderBean.DataBean> errorList) {
this.context = context;
this.errorList = errorList;
}
@Override
public int getCount() {
return errorList.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder viewHolder;
if (convertView == null) {
view = View.inflate(context, R.layout.fragment_tabthree_item, null);
viewHolder = new ViewHolder(view,context);
view.setTag(viewHolder);
} else {
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
initData(position, viewHolder);
return view;
}
private void initData(int position, ViewHolder viewHolder) {
try {
dateMD = dateUtils.stringDateToDate(errorList.get(position).getCreateTime());
dateTime = dateUtils.stringTimeToDate(errorList.get(position).getCreateTime());
} catch (Exception e) {
e.printStackTrace();
}
viewHolder.itemTody.setText(dateMD);
viewHolder.itemTime.setText(dateTime);
//服务类型
viewHolder.itemTextWeixiu.setText(errorList.get(position).getProviderName());
// 维修类型
viewHolder.itemTextWeixiuLeixing.setText(errorList.get(position).getCategoryName());
//拼接省市区街道地址
viewHolder.itemTextDizhi.setText(
//省一级城市名称
(String) errorList.get(position).getProvinceName()
//市一级城市名称
+ errorList.get(position).getCityName() +
//区/地区一级城市名称
errorList.get(position).getDistrictName() +
//详细到街道
errorList.get(position).getAddress());
errorState = errorList.get(position).getExcptionCode();
if (errorState==1){
viewHolder.errorState.setText("["+"接单超时"+"]");
}else if (errorState == 2){
viewHolder.errorState.setText("["+"预约超时"+"]");
} else if (errorState == 3){
viewHolder.errorState.setText("["+"服务超时"+"]");
}else if (errorState == 4){
viewHolder.errorState.setText("["+"验收超时"+"]");
}
}
static class ViewHolder {
@BindView(R.id.item_line)
ImageView itemLine;
@BindView(R.id.item_tody)
TextView itemTody;
@BindView(R.id.item_time)
TextView itemTime;
@BindView(error_state)
TextView errorState;
@BindView(R.id.item_image_weixiu)
ImageView itemImageWeixiu;
@BindView(R.id.item_image_dizhi)
ImageView itemImageDizhi;
@BindView(R.id.item_text_weixiu)
TextView itemTextWeixiu;
@BindView(R.id.text_line)
TextView textLine;
@BindView(R.id.item_text_weixiu_leixing)
TextView itemTextWeixiuLeixing;
@BindView(R.id.item_text_dizhi)
TextView itemTextDizhi;
@BindView(R.id.item)
RelativeLayout item;
ViewHolder(View view,Context context) {
ButterKnife.bind(this, view);
AssetManager mgr = context.getAssets();//得到AssetManager
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");//根据路径得到Typeface
itemTime.setTypeface(tf);//设置字体
}
}
}
package com.dayu.bigfish.adapter;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.net.Uri;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.Order;
import com.dayu.bigfish.ui.SubcribeTimeActivity;
import com.dayu.bigfish.utils.DateUtils;
import static com.dayu.bigfish.ui.fragment.HomeSecondTabFragment.SUBCRIBE_TIME;
/**
* 未预约列表的适配器
* 2017/9/9.
*/
public class OrderFirstTabAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
private DateUtils mDateUtils;
public OrderFirstTabAdapter(int layoutResId) {
super(layoutResId);
mDateUtils = new DateUtils();
}
@Override
protected void convert(BaseViewHolder helper, Order item) {
try {
initData(helper, item);
} catch (Exception e) {
e.printStackTrace();
}
}
private void initData(final BaseViewHolder holder, Order item) throws Exception {
final int id = item.getId();
String dateMD = mDateUtils.stringDateToDate(item.getCreateTime());
String dateTime = mDateUtils.stringTimeToDate(item.getCreateTime());
AssetManager mgr = mContext.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
holder.setText(R.id.item_tody, dateMD);
holder.setText(R.id.item_time, dateTime);
holder.setTypeface(R.id.item_time, tf);
holder.setText(R.id.item_text_weixiu_leixing, item.getCategoryName());
holder.setText(R.id.item_text_weixiu, item.getProviderName());
holder.setText(R.id.item_text_dizhi, item.getProvinceName() + item.getCityName() +
item.getDistrictName() + item.getAddress());
holder.setText(R.id.item_text_user_name, item.getCustomerName());
holder.setText(R.id.item_text_user_phone, item.getCustomerMobile());
holder.getView(R.id.item_text_phone).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + item.getCustomerMobile()));
mContext.startActivity(intent);
}
});
holder.getView(R.id.item_text_time).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, SubcribeTimeActivity.class);
intent.putExtra("orderId", id + "");
intent.putExtra("position", holder.getAdapterPosition() + "");
intent.putExtra(Constants.ORDER_STATE, SUBCRIBE_TIME);
mContext.startActivity(intent);
}
});
}
}
package com.dayu.bigfish.adapter;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.Order;
import com.dayu.bigfish.utils.DateUtils;
/**
* 已取消列表的适配器
* on 2017/9/12.
*/
public class OrderFourTabAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
private String dateMD = null;
private String dateTime = null;
private DateUtils dateUtils = new DateUtils();
public OrderFourTabAdapter(int layoutResId) {
super(layoutResId);
}
@Override
protected void convert(BaseViewHolder helper, Order item) {
initData(helper, item);
}
@Override
public long getItemId(int position) {
return position;
}
private void initData(BaseViewHolder helper, Order item) {
try {
dateMD = dateUtils.stringDateToDate(item.getCreateTime());
dateTime = dateUtils.stringTimeToDate(item.getCreateTime());
} catch (Exception e) {
e.printStackTrace();
}
AssetManager mgr = mContext.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
helper.setText(R.id.item_tody, dateMD);
helper.setText(R.id.item_text_time, dateTime);
helper.setTypeface(R.id.item_text_time, tf);
helper.setText(R.id.item_text_weixiu, item.getProviderName());
helper.setText(R.id.item_text_weixiu_leixing, item.getCategoryName());
helper.setText(R.id.item_text_dizhi, item.getProvinceName() + item.getCityName() +
item.getDistrictName() + item.getAddress());
}
}
package com.dayu.bigfish.adapter;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.net.Uri;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.Constants;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.Order;
import com.dayu.bigfish.ui.ProcessOrderActivity;
import com.dayu.bigfish.ui.SubcribeTimeActivity;
import com.dayu.bigfish.utils.DateUtils;
import static com.dayu.bigfish.ui.fragment.HomeSecondTabFragment.SUBCRIBE_TIME;
import static com.dayu.bigfish.ui.fragment.HomeSecondTabFragment.UPDOOR_TIME;
/**
* 待服务列表的适配器
* on 2017/9/11.
*/
public class OrderSecondTabAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
private DateUtils mDateUtils;
public OrderSecondTabAdapter(int layoutResId) {
super(layoutResId);
mDateUtils = new DateUtils();
}
@Override
protected void convert(BaseViewHolder helper, Order item) {
try {
initData(helper, item);
} catch (Exception e) {
e.printStackTrace();
}
}
private void initData(BaseViewHolder holder, Order item) throws Exception {
final int id = item.getId();
String dateMD = mDateUtils.stringDateToDate(item.getCreateTime());
String dateTime = mDateUtils.stringTimeToDate(item.getCreateTime());
AssetManager mgr = mContext.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
holder.setText(R.id.item_tody, dateMD);
holder.setText(R.id.item_time, dateTime);
holder.setTypeface(R.id.item_time, tf);
holder.setText(R.id.item_text_weixiu_leixing, item.getCategoryName());
holder.setText(R.id.item_text_weixiu, item.getProviderName());
holder.setText(R.id.item_text_dizhi, item.getProvinceName() + item.getCityName() +
item.getDistrictName() + item.getAddress());
holder.setText(R.id.item_text_user_name, item.getCustomerName());
holder.setText(R.id.item_text_user_phone, item.getCustomerMobile());
holder.getView(R.id.item_text_phone).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:" + item.getCustomerMobile()));
mContext.startActivity(intent);
}
});
holder.getView(R.id.item_text_time).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, SubcribeTimeActivity.class);
intent.putExtra("orderId", id + "");
intent.putExtra("position", holder.getAdapterPosition());
intent.putExtra(Constants.ORDER_STATE, SUBCRIBE_TIME);
mContext.startActivity(intent);
}
});
holder.getView(R.id.item_restrt).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, SubcribeTimeActivity.class);
intent.putExtra("orderId", id + "");
intent.putExtra("position", holder.getAdapterPosition());
intent.putExtra(Constants.ORDER_STATE, UPDOOR_TIME);
mContext.startActivity(intent);
}
});
holder.getView(R.id.item_order).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(mContext, ProcessOrderActivity.class);
intent.putExtra("orderId", id + "");
intent.putExtra("position", holder.getAdapterPosition());
mContext.startActivity(intent);
}
});
}
}
package com.dayu.bigfish.adapter;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.ErrorOrder;
import com.dayu.bigfish.utils.DateUtils;
/**
* 异常单列表的适配器
* on 2017/9/12.
*/
public class OrderThreeTabAdapter extends BaseQuickAdapter<ErrorOrder, BaseViewHolder> {
private DateUtils mDateUtils;
public OrderThreeTabAdapter(int layoutResId) {
super(layoutResId);
mDateUtils = new DateUtils();
}
@Override
protected void convert(BaseViewHolder helper, ErrorOrder item) {
initData(helper, item);
}
private void initData(BaseViewHolder helper, ErrorOrder item) {
try {
String dateMD = mDateUtils.stringDateToDate(item.getCreateTime());
String dateTime = mDateUtils.stringTimeToDate(item.getCreateTime());
AssetManager mgr = mContext.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
helper.setText(R.id.item_tody, dateMD);
helper.setText(R.id.item_time, dateTime);
helper.setTypeface(R.id.item_time, tf);
helper.setText(R.id.item_text_weixiu_leixing, item.getCategoryName());
helper.setText(R.id.item_text_weixiu, item.getProviderName());
helper.setText(R.id.item_text_dizhi, item.getProvinceName() + item.getCityName() +
item.getDistrictName() + item.getAddress());
} catch (Exception e) {
e.printStackTrace();
}
int errorState = item.getExcptionCode();
if (errorState == 1) {
helper.setText(R.id.error_state,"[" + "接单超时" + "]");
} else if (errorState == 2) {
helper.setText(R.id.error_state,"[" + "预约超时" + "]");
} else if (errorState == 3) {
helper.setText(R.id.error_state,"[" + "服务超时" + "]");
} else if (errorState == 4) {
helper.setText(R.id.error_state,"[" + "验收超时" + "]");
}
}
}
package com.dayu.bigfish.adapter;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.MyApplication;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.Order;
import com.dayu.bigfish.utils.DateUtils;
/**
* Created by luofan on 2017/11/16.
*/
public class ReceiveAdapter extends BaseQuickAdapter<Order, BaseViewHolder> {
private DateUtils dateUtils = new DateUtils();
public ReceiveAdapter(int layoutResId) {
super(layoutResId);
}
@Override
protected void convert(BaseViewHolder helper, Order item) {
AssetManager mgr = MyApplication.getContext().getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
try {
String dateMD = dateUtils.stringDateToDate(item.getCreateTime());
String dateTime = dateUtils.stringTimeToDate(item.getCreateTime());
helper.setText(R.id.item_tody, dateMD);
helper.setText(R.id.item_time, dateTime);
helper.setTypeface(R.id.item_time, tf);
} catch (Exception e) {
e.printStackTrace();
}
helper.setText(R.id.item_text_weixiu, item.getProviderName());
helper.setText(R.id.item_text_weixiu_leixing, item.getCategoryName());
helper.setText(R.id.item_text_dizhi, item.getProvinceName() + item.getCityName() +
item.getDistrictName() +
item.getAddress());
helper.addOnClickListener(R.id.image_receiving);
}
}
package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.res.AssetManager;
import android.graphics.Typeface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.ReceivingBean;
import com.dayu.bigfish.moudle.receiving.Receiving;
import com.dayu.bigfish.utils.DateUtils;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 待接单列表的适配器
* on 2017/8/30.
*/
public class ReceivingAdapter extends BaseAdapter {
@BindView(R.id.text_line)
TextView textLine;
private Context context;
//private Test test;
private Receiving receiving;
private List<ReceivingBean.DataBeanX.DataBean> list;
private DateUtils dateUtils = new DateUtils();//初始化截取时间的工具类
public ReceivingAdapter(Context context, List<ReceivingBean.DataBeanX.DataBean> list,Receiving receiving) {
this.context = context;
this.list = list;
this.receiving = receiving;
// this.receivingBean = receivingBean;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view;
ViewHolder viewHolder;
if (convertView == null) {
view = View.inflate(context, R.layout.activity_receiving_item, null);
viewHolder = new ViewHolder(view, context);
view.setTag(viewHolder);
} else {
view = convertView;
viewHolder = (ViewHolder) view.getTag();
}
//----------分割线----------------//
try {
initData(viewHolder, position);
} catch (Exception e) {
e.printStackTrace();
}
receivingOrder(viewHolder, position);
return view;
}
static class ViewHolder {
@BindView(R.id.item_line)
ImageView itemLine;
@BindView(R.id.item_tody)
TextView itemTody;
@BindView(R.id.item_time)
TextView itemTime;
@BindView(R.id.item_image_weixiu)
ImageView itemImageWeixiu;
@BindView(R.id.item_image_dizhi)
ImageView itemImageDizhi;
@BindView(R.id.item_text_weixiu)
TextView itemTextWeixiu;
@BindView(R.id.item_text_weixiu_leixing)
TextView itemTextWeixiuLeixing;
@BindView(R.id.item_text_dizhi)
TextView itemTextDizhi;
@BindView(R.id.item)
RelativeLayout item;
@BindView(R.id.image_receiving)
ImageView imageReceiving;
ViewHolder(View view, final Context context) {
ButterKnife.bind(this, view);
AssetManager mgr = context.getAssets();//得到AssetManager
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");//根据路径得到Typeface
itemTime.setTypeface(tf);//设置字体
}
}
public void receivingOrder(ViewHolder viewHolder, final int position) {
viewHolder.imageReceiving.setOnClickListener(new View.OnClickListener() {
//获取订单id
int orderId = list.get(position).getId();
@Override
public void onClick(View v) {
//将订单id传递过去
receiving.receivingOrder(orderId);
}
});
}
public void initData(ViewHolder viewHolder, int position) throws Exception {
String dateMD;
String dateTime;
dateMD = dateUtils.stringDateToDate(list.get(position).getCreateTime());
viewHolder.itemTody.setText(dateMD);
dateTime = dateUtils.stringTimeToDate(list.get(position).getCreateTime());
viewHolder.itemTime.setText(dateTime);
//服务类型
viewHolder.itemTextWeixiu.setText(list.get(position).getProviderName());
// 维修类型
viewHolder.itemTextWeixiuLeixing.setText(list.get(position).getCategoryName());
//拼接省市区街道地址
viewHolder.itemTextDizhi.setText(
//省一级城市名称
list.get(position).getProvinceName()
//市一级城市名称
+ list.get(position).getCityName() +
//区/地区一级城市名称
list.get(position).getDistrictName() +
//详细到街道
list.get(position).getAddress());
}
}
...@@ -7,7 +7,7 @@ import android.widget.BaseAdapter; ...@@ -7,7 +7,7 @@ import android.widget.BaseAdapter;
import android.widget.TextView; import android.widget.TextView;
import com.dayu.bigfish.R; import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.ServeDetailsBean; import com.dayu.bigfish.bean.OrderDetail;
import java.util.List; import java.util.List;
...@@ -21,9 +21,9 @@ import butterknife.ButterKnife; ...@@ -21,9 +21,9 @@ import butterknife.ButterKnife;
public class ServeDatailsAdapter extends BaseAdapter { public class ServeDatailsAdapter extends BaseAdapter {
public Context context; public Context context;
private List<ServeDetailsBean.DataBean.RecordBean> recordBeen; private List<OrderDetail.RecordBean> recordBeen;
public ServeDatailsAdapter(Context context, List<ServeDetailsBean.DataBean.RecordBean> recordBean) { public ServeDatailsAdapter(Context context, List<OrderDetail.RecordBean> recordBean) {
this.context = context; this.context = context;
this.recordBeen = recordBean; this.recordBeen = recordBean;
} }
......
...@@ -6,17 +6,13 @@ import android.graphics.Typeface; ...@@ -6,17 +6,13 @@ import android.graphics.Typeface;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.dayu.bigfish.R; import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.MessageBean; import com.dayu.bigfish.bean.NewMessage;
import com.dayu.bigfish.bean.NewMessageBean;
import com.dayu.bigfish.utils.DateUtils; import com.dayu.bigfish.utils.DateUtils;
import org.w3c.dom.Text;
import java.util.List; import java.util.List;
import butterknife.BindView; import butterknife.BindView;
...@@ -28,12 +24,12 @@ import butterknife.ButterKnife; ...@@ -28,12 +24,12 @@ import butterknife.ButterKnife;
*/ */
public class SystemMessageAdapter extends BaseAdapter { public class SystemMessageAdapter extends BaseAdapter {
private List<NewMessageBean.DataBeanX.DataBean> dataBeenList; private List<NewMessage> dataBeenList;
private DateUtils dateUtils = new DateUtils(); private DateUtils dateUtils = new DateUtils();
private Context context; private Context context;
private String dataMD; private String dataMD;
private String dataTime; private String dataTime;
public SystemMessageAdapter(List<NewMessageBean.DataBeanX.DataBean> dataBeenList, Context context) { public SystemMessageAdapter(List<NewMessage> dataBeenList, Context context) {
this.dataBeenList = dataBeenList; this.dataBeenList = dataBeenList;
this.context = context; this.context = context;
} }
......
package com.dayu.bigfish.adapter; package com.dayu.bigfish.adapter;
import android.content.Context;
import android.content.res.AssetManager; import android.content.res.AssetManager;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.dayu.bigfish.R; import com.dayu.bigfish.R;
import com.dayu.bigfish.bean.WorksheetBean; import com.dayu.bigfish.bean.Order;
import com.dayu.bigfish.utils.DateUtils; import com.dayu.bigfish.utils.DateUtils;
import java.util.ArrayList;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
...@@ -25,62 +21,39 @@ import butterknife.ButterKnife; ...@@ -25,62 +21,39 @@ import butterknife.ButterKnife;
* on 2017/9/29. * on 2017/9/29.
*/ */
public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.WorksheetHolder> { public class WorksheetAdapter extends BaseQuickAdapter<Order,WorksheetAdapter.WorksheetHolder> {
private Context mContext;
private ArrayList<WorksheetBean.DataBeanX.DataBean> list1;
private String dateMD = null; private String dateMD = null;
private String dateTime = null; private String dateTime = null;
private DateUtils dateUtils = new DateUtils(); private DateUtils dateUtils = new DateUtils();
private OnItemLongClickListener mOnItemLongClickListener;
private int myOrderStatu; private int myOrderStatu;
public void setDatas(ArrayList<WorksheetBean.DataBeanX.DataBean> list) { public WorksheetAdapter(int layoutResId) {
list1 = list; super(layoutResId);
}
public WorksheetAdapter(Context context, ArrayList<WorksheetBean.DataBeanX.DataBean> list) {
this.mContext = context;
this.list1 = list;
}
public void setOnItemLongClickListener(OnItemLongClickListener onItemLongClickListener) {
this.mOnItemLongClickListener = onItemLongClickListener;
}
@Override
public WorksheetHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new WorksheetHolder(LayoutInflater.from(mContext).inflate(R.layout.activity_list, parent, false));
} }
@Override @Override
public void onBindViewHolder(WorksheetHolder holder, int position) { protected void convert(WorksheetHolder holder, Order item) {
try { try {
dateMD = dateUtils.stringDateToDate(list1.get(position).getCreateTime()); dateMD = dateUtils.stringDateToDate(item.getCreateTime());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
holder.itemTody.setText(dateMD); holder.itemTody.setText(dateMD);
try { try {
dateTime = dateUtils.stringTimeToDate(list1.get(position).getCreateTime()); dateTime = dateUtils.stringTimeToDate(item.getCreateTime());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
holder.itemTime.setText(dateTime); holder.itemTime.setText(dateTime);
//服务类型 //服务类型
holder.itemTextWeixiu.setText(list1.get(position).getProviderName()); holder.itemTextWeixiu.setText(item.getProviderName());
// 维修类型 // 维修类型
holder.itemTextWeixiuLeixing.setText(list1.get(position).getCategoryName()); holder.itemTextWeixiuLeixing.setText(item.getCategoryName());
//拼接省市区街道地址 holder.itemTextUserPhone.setText(item.getCustomerMobile());
holder.itemTextDizhi.setText( holder.itemTextUserName.setText(item.getCustomerName());
//省一级城市名称 holder.itemTextDizhi.setText(item.getProvinceName() + item.getCityName() +
(String) list1.get(position).getProvinceName() item.getDistrictName() + item.getAddress());
//市一级城市名称 myOrderStatu = item.getStatus();
+ list1.get(position).getCityName() +
//区/地区一级城市名称
list1.get(position).getDistrictName() +
//详细到街道
list1.get(position).getAddress());
myOrderStatu = list1.get(position).getStatus();
if (myOrderStatu == 1) { if (myOrderStatu == 1) {
holder.orderTv.setText("未接单"); holder.orderTv.setText("未接单");
} else if (myOrderStatu == 2) { } else if (myOrderStatu == 2) {
...@@ -96,23 +69,9 @@ public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.Work ...@@ -96,23 +69,9 @@ public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.Work
} else if (myOrderStatu == 7) { } else if (myOrderStatu == 7) {
holder.orderTv.setText("订单关闭"); holder.orderTv.setText("订单关闭");
} }
//用户名
holder.itemTextUserName.setText((String) list1.get(position).getCustomerName());
//用户手机号
holder.itemTextUserPhone.setText((String) list1.get(position).getCustomerMobile());
//
if (mOnItemLongClickListener != null) {
holder.itemView.setOnClickListener(v -> mOnItemLongClickListener.OnItemLongClick(v, holder.getAdapterPosition()));
}
} }
@Override public class WorksheetHolder extends BaseViewHolder {
public int getItemCount() {
return list1.size();
}
public class WorksheetHolder extends RecyclerView.ViewHolder {
@BindView(R.id.item_line) @BindView(R.id.item_line)
ImageView itemLine; ImageView itemLine;
@BindView(R.id.item_tody) @BindView(R.id.item_tody)
...@@ -137,13 +96,10 @@ public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.Work ...@@ -137,13 +96,10 @@ public class WorksheetAdapter extends RecyclerView.Adapter<WorksheetAdapter.Work
public WorksheetHolder(View itemView) { public WorksheetHolder(View itemView) {
super(itemView); super(itemView);
ButterKnife.bind(this, itemView); ButterKnife.bind(this, itemView);
AssetManager mgr = mContext.getAssets();//得到AssetManager AssetManager mgr = mContext.getAssets();
Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");//根据路径得到Typeface Typeface tf = Typeface.createFromAsset(mgr, "fonts/DIN Alternate Bold.ttf");
itemTime.setTypeface(tf);//设置字体 itemTime.setTypeface(tf);
} }
} }
public interface OnItemLongClickListener {
void OnItemLongClick(View view, int position);
}
} }
...@@ -127,8 +127,4 @@ public class APIException { ...@@ -127,8 +127,4 @@ public class APIException {
} }
} }
public class ServerException extends RuntimeException {
public int code;
public String message;
}
} }
...@@ -16,7 +16,6 @@ import java.util.concurrent.TimeUnit; ...@@ -16,7 +16,6 @@ import java.util.concurrent.TimeUnit;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.ObservableEmitter; import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe; import io.reactivex.ObservableOnSubscribe;
import okhttp3.HttpUrl;
import okhttp3.Interceptor; import okhttp3.Interceptor;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
...@@ -33,22 +32,14 @@ public class Api { ...@@ -33,22 +32,14 @@ public class Api {
private static APIService service; private static APIService service;
private static Retrofit retrofit; private static Retrofit retrofit;
private static final int DEFAULT_TIMEOUT = 20; private static final int DEFAULT_TIMEOUT = 20;
private static boolean flag = true;
private static String token;
public static APIService getService() { public static APIService getService() {
if (service == null || flag) {
service = getRetrofit().create(APIService.class); service = getRetrofit().create(APIService.class);
}
return service; return service;
} }
private static Retrofit getRetrofit() { private static Retrofit getRetrofit() {
if (retrofit == null || flag) { if (retrofit == null) {
token = GetUserInfo.getToken(MyApplication.getContext());
if (!TextUtils.isEmpty(token)) {
flag = false;
}
Gson gson = new GsonBuilder() Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ") .setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.create(); .create();
...@@ -57,7 +48,7 @@ public class Api { ...@@ -57,7 +48,7 @@ public class Api {
TokenInterceptord tokenInterceptord = new TokenInterceptord(); TokenInterceptord tokenInterceptord = new TokenInterceptord();
OkHttpClient okHttpClient = new OkHttpClient.Builder() OkHttpClient okHttpClient = new OkHttpClient.Builder()
.addInterceptor(httpLoggingInterceptor) .addInterceptor(httpLoggingInterceptor)
// .addInterceptor(tokenInterceptord) .addInterceptor(tokenInterceptord)
.connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS) .connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS)
.build(); .build();
...@@ -98,7 +89,8 @@ public class Api { ...@@ -98,7 +89,8 @@ public class Api {
} }
} else { } else {
if (!e.isDisposed()) { if (!e.isDisposed()) {
e.onError(new APIException(response.getCode(), response.getMsg())); Log.d("request", response.getMsg());
e.onError(new ServerException(response.getCode(), response.getMsg()));
} }
return; return;
} }
...@@ -111,46 +103,22 @@ public class Api { ...@@ -111,46 +103,22 @@ public class Api {
/** /**
* 自定义异常,当接口返回的{@link BaseResponse#code}不为{@link #"0"}时,需要跑出此异常 * 统一加上token.
* eg:登陆时验证码错误;参数为传递等
*/ */
public static class APIException extends Exception {
public int code;
public String message;
public APIException(int code, String message) {
this.code = code;
this.message = message;
}
@Override
public String getMessage() {
return message;
}
}
public static class TokenInterceptord implements Interceptor { public static class TokenInterceptord implements Interceptor {
private String mToken;
private final String TAG = "respond";
@Override @Override
public Response intercept(Chain chain) throws IOException { public Response intercept(Chain chain) throws IOException {
Request oldRequest = chain.request(); if (TextUtils.isEmpty(mToken)) {
mToken = GetUserInfo.getToken(MyApplication.getContext());
// 新的请求,添加参数
HttpUrl.Builder builder = oldRequest.url()
.newBuilder();
if (!TextUtils.isEmpty(token)) {
builder.setEncodedQueryParameter("token", token);
} }
Request request = chain.request()
Request newRequest = oldRequest.newBuilder() .newBuilder()
.method(oldRequest.method(), oldRequest.body()) .header("token", mToken)
.url(builder.build())
.build(); .build();
// Log.e("request", request.headers().toString());
return chain.proceed(newRequest); return chain.proceed(request);
} }
} }
......
package com.dayu.bigfish.api;
/**
* Created by luofan on 2017/11/15.
*/
public class ServerException extends Exception {
public int code;
public String message;
public ServerException(int code, String message) {
this.code = code;
this.message = message;
processCode(code);
}
private void processCode(int code) {
switch (code) {
case 1:
message = "访问失败";
break;
default:
break;
}
}
}
...@@ -11,6 +11,7 @@ import android.view.ViewGroup; ...@@ -11,6 +11,7 @@ import android.view.ViewGroup;
import com.dayu.bigfish.utils.TUtil; import com.dayu.bigfish.utils.TUtil;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.Unbinder;
/** /**
* Created by luo on 2017/11/14. * Created by luo on 2017/11/14.
...@@ -19,6 +20,12 @@ public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel> ...@@ -19,6 +20,12 @@ public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel>
protected Context mContext; protected Context mContext;
public T mPresenter; public T mPresenter;
public E mModel; public E mModel;
private Unbinder mKnife;
/**
* 视图是否已经初初始化
*/
protected boolean isInit = false;
protected boolean isLoad = false;
@Override @Override
...@@ -39,18 +46,74 @@ public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel> ...@@ -39,18 +46,74 @@ public abstract class BaseFragment<T extends BasePresenter, E extends BaseModel>
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(getLayoutId(), container, false); View view = inflater.inflate(getLayoutId(), container, false);
ButterKnife.bind(this, view); mKnife = ButterKnife.bind(this, view);
initView(view); initView(view);
isInit = true;
isCanLoadData();
return view; return view;
} }
@Override @Override
public void onDestroy() { public void onDestroy() {
super.onDestroy(); super.onDestroy();
mKnife.unbind();
if (mPresenter != null) mPresenter.onDestroy(); if (mPresenter != null) mPresenter.onDestroy();
} }
public abstract View initView(View view); public abstract View initView(View view);
public abstract int getLayoutId(); public abstract int getLayoutId();
/**
* 视图是否已经对用户可见,系统的方法
*/
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
isCanLoadData();
}
/**
* 是否可以加载数据
* 可以加载数据的条件:
* 1.视图已经初始化
* 2.视图对用户可见
*/
private void isCanLoadData() {
if (!isInit) {
return;
}
if (getUserVisibleHint()) {
lazyLoad();
isLoad = true;
} else {
if (isLoad) {
stopLoad();
}
}
}
/**
* 视图销毁的时候讲Fragment是否初始化的状态变为false
*/
@Override
public void onDestroyView() {
super.onDestroyView();
isInit = false;
isLoad = false;
}
/**
* 当视图初始化并且对用户可见的时候去真正的加载数据
*/
protected abstract void lazyLoad();
/**
* 当视图已经对用户不可见并且加载过数据,如果需要在切换到其他页面时停止加载数据,可以覆写此方法
*/
protected void stopLoad() {
}
} }
package com.dayu.bigfish.base; package com.dayu.bigfish.base;
import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import com.dayu.bigfish.R;
import com.dayu.bigfish.api.APIException;
import com.dayu.bigfish.managers.UserManager;
import com.dayu.bigfish.ui.LoginActivity;
import com.dayu.bigfish.utils.ProgressUtil; import com.dayu.bigfish.utils.ProgressUtil;
import com.dayu.bigfish.views.CustomDialog;
import java.net.ConnectException; import com.hyphenate.chat.EMClient;
import java.net.SocketTimeoutException;
import java.util.concurrent.TimeoutException;
import io.reactivex.Observer; import io.reactivex.Observer;
import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
import static com.dayu.bigfish.utils.UIUtils.getString;
/** /**
* Created by luofan on 17/11/02. * Created by luofan on 17/11/02.
*/ */
...@@ -64,13 +70,7 @@ public abstract class BasePresenter<M, T> { ...@@ -64,13 +70,7 @@ public abstract class BasePresenter<M, T> {
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
ProgressUtil.stopLoad(); ProgressUtil.stopLoad();
if (e instanceof ConnectException || processException(e);
e instanceof SocketTimeoutException ||
e instanceof TimeoutException) {
((BaseActivity) mView).showToast("网络请求失败");
return;
}
((BaseActivity) mView).showToast(e.getMessage());
} }
@Override @Override
...@@ -107,11 +107,7 @@ public abstract class BasePresenter<M, T> { ...@@ -107,11 +107,7 @@ public abstract class BasePresenter<M, T> {
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
ProgressUtil.stopLoad(); ProgressUtil.stopLoad();
if (e instanceof ConnectException || processException(e);
e instanceof SocketTimeoutException ||
e instanceof TimeoutException) {
((BaseActivity) mView).showToast("网络请求失败");
}
try { try {
tconsumer.accept(e); tconsumer.accept(e);
} catch (Exception e1) { } catch (Exception e1) {
...@@ -125,4 +121,42 @@ public abstract class BasePresenter<M, T> { ...@@ -125,4 +121,42 @@ public abstract class BasePresenter<M, T> {
} }
}; };
} }
private void processException(Throwable e) {
APIException.ResponeThrowable exception = APIException.APIException(e);
int code = exception.code;
String message = exception.message;
if (code == 403) {
showLoginDialog();
}
// ((BaseActivity) mView).showToast(message);
}
/**
* 重新登录的提示框.
*/
private void showLoginDialog() {
CustomDialog dialog = new CustomDialog(mContext, R.style.custom_dialog2, getString(R.string.login_state_no)
, new CustomDialog.OnCloseListener() {
@Override
public void onClick(Dialog dialog, boolean confirm) {
if (confirm) {
UserManager.getInstance().clearUserInfo(mContext);
EMClient.getInstance().logout(true);
Intent Intents = new Intent(mContext, LoginActivity.class);
Intents.setFlags(
Intent.FLAG_ACTIVITY_CLEAR_TASK |
Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(Intents);
} else {
}
dialog.dismiss();
}
});
dialog.setTitle(getString(R.string.notice))
.setNegativeButton(getString(R.string.cancle))
.setPositiveButton(getString(R.string.login_again));
dialog.show();
}
} }
...@@ -6,6 +6,7 @@ package com.dayu.bigfish.base; ...@@ -6,6 +6,7 @@ package com.dayu.bigfish.base;
*/ */
public class BaseResponse<T> { public class BaseResponse<T> {
private int code; private int code;
private int subCode;
private String msg; private String msg;
private T data; private T data;
...@@ -36,4 +37,12 @@ public class BaseResponse<T> { ...@@ -36,4 +37,12 @@ public class BaseResponse<T> {
public boolean isSuccess() { public boolean isSuccess() {
return code == 0; return code == 0;
} }
public int getSubCode() {
return subCode;
}
public void setSubCode(int subCode) {
this.subCode = subCode;
}
} }
package com.dayu.bigfish.base;
import android.app.Activity;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.dayu.bigfish.tip.DefaultTipsHelper;
import com.dayu.bigfish.tip.TipsHelper;
import com.umeng.analytics.MobclickAgent;
/**
* Activity的基类
* on 2017/8/20.
*/
public abstract class PreBaseActivity<V, T extends PreBasePresenter<V>> extends AppCompatActivity {
//交由子类去调用的p层,我一般都是在活动使用成员变量自己记录
public T presenter;
protected Activity mActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//初始化p层
presenter = initPresenter();
mActivity = this;
//设置友盟数据统计到测试设备,避免数据污染
// MobclickAgent.setDebugMode( true );
}
protected TipsHelper createTipsHelper(View view) {
return new DefaultTipsHelper(this, view);
}
@Override
public void onResume() {
super.onResume();
//友盟的基础埋点
MobclickAgent.onResume(this);
presenter.attachView((V) this);
}
@Override
protected void onPause() {
super.onPause();
//友盟的基础埋点
MobclickAgent.onPause(this);
}
@Override
public void onDestroy() {
presenter.detachView();
super.onDestroy();
}
//强制子类初始化监听的方法
public abstract void initListener();
//强制子类初始化视图的方法
public abstract void initView();
//强制子类初始化数据的方法
public abstract void initData();
// 强制子类初始化自己的presenter
public abstract T initPresenter();
private long mPressedTime = 0;
}
package com.dayu.bigfish.base;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.dayu.bigfish.tip.DefaultTipsHelper;
import com.dayu.bigfish.tip.TipsHelper;
import com.lzy.okgo.OkGo;
import org.greenrobot.eventbus.EventBus;
/**
* Fragment的基类,如有具体需求可再添加
* Created by yu
* on 2017/9/11.
*/
public abstract class PreBaseFragment<V, T extends PreBasePresenter<V>> extends Fragment {
public T presenter;
//标志位,Fragment是否可见
protected boolean isVisible;
protected Context mContext;
@Override
public void onAttach(Context context) {
super.onAttach(context);
mContext = context;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
presenter = initPresenter();
initEvent();
return super.onCreateView(inflater, container, savedInstanceState);
}
private void initEvent() {
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
}
protected TipsHelper createTipsHelper(View view) {
return new DefaultTipsHelper(getContext(), view);
}
@Override
public void onResume() {
super.onResume();
presenter.attachView((V) this);
}
@Override
public void onDestroy() {
presenter.detachView();
OkGo.getInstance().cancelTag(this);
super.onDestroy();
}
@Override
public void onDetach() {
super.onDetach();
mContext = null;
}
protected abstract void initData();
public abstract T initPresenter();
protected void initView(View view, Bundle savedInstanceState) {
}
//强制子类初始化监听的方法
public abstract void initListener();
//强制子类初始化视图的方法
public abstract void initView();
private long mPressedTime = 0;
protected void onVisible() {
this.lazyLoad();
}
protected abstract void lazyLoad();
protected void onInvisible() {
}
}
package com.dayu.bigfish.base;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
/**
* presenter层基类构建,这里attachView和detachView主要是统一管理view周期
* 2017/9/20.
*/
public abstract class PreBasePresenter<T> {
protected Reference<T> viewRef; //弱引用,防止内存泄漏
public void attachView(T view) {
viewRef = new WeakReference<T>(view);
}
/**
* 页面销毁时调用的方法,释放内存
*/
public void detachView() {
if (viewRef != null) {
viewRef.clear();
viewRef = null;
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* 获取工程师的累计信息(包含工单记录,评分,和累计收益)
* on 2017/9/29.
*/
public class AccountBalanceBean implements Serializable {
/**
* code : 0
* data : {"评分":0,"累计收益":0,"工单记录":0}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
private int accountBalance;
private double todaySubSidymoney;
public int getAccountBalance() {
return accountBalance;
}
public void setAccountBalance(int accountBalance) {
this.accountBalance = accountBalance;
}
public double getTodaySubSidymoney() {
return todaySubSidymoney;
}
public void setTodaySubSidymoney(double todaySubSidymoney) {
this.todaySubSidymoney = todaySubSidymoney;
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by luofan on 2017/11/1.
*/
public class AccountListBean implements Serializable {
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean implements Serializable {
/**
* "data": {
* "pageNo": 1,
* "pageSize": 10,
* "totalRows": 3,
* "data": [
* {
* "id": 1,
* "accountId": 1,
* "operateActionStatus": 1,
* "operateActionComment": "补贴",
* "streamPrice": 5,
* "createTime": "2017-11-01 09:45:44"
* },
* "previousPageNo": 1,
* "nextPageNo": 1,
* "totalPages": 1
* },
*/
private int pageNo;
private int pageSize;
private int totalRows;
private List<Account> data;
private int previousPageNo;
private int nextPageNo;
private int totalPages;
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getPreviousPageNo() {
return previousPageNo;
}
public void setPreviousPageNo(int previousPageNo) {
this.previousPageNo = previousPageNo;
}
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public List<Account> getData() {
return data;
}
public void setData(List<Account> data) {
this.data = data;
}
public static class Account implements Serializable {
private int id;
private int accountId;
private int operateActionStatus;
private String operateActionComment;
private double streamPrice;
private String createTime;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public int getOperateActionStatus() {
return operateActionStatus;
}
public void setOperateActionStatus(int operateActionStatus) {
this.operateActionStatus = operateActionStatus;
}
public String getOperateActionComment() {
return operateActionComment;
}
public void setOperateActionComment(String operateActionComment) {
this.operateActionComment = operateActionComment;
}
public double getStreamPrice() {
return streamPrice;
}
public void setStreamPrice(int streamPrice) {
this.streamPrice = streamPrice;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
}
}
}
package com.dayu.bigfish.bean;
/**
* Created by luofan on 2017/11/2.
*/
public class AlipayBean {
/**
* code : 0
* data : {"id":2,"accountId":454,"alipayAccount":"guj","alipayName":"chj","alipayMobile":"13567810832","createTime":"2017-11-02 10:06:36","updateTime":"2017-11-02 11:02:19"}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
/**
* id : 2
* accountId : 454
* alipayAccount : guj
* alipayName : chj
* alipayMobile : 13567810832
* createTime : 2017-11-02 10:06:36
* updateTime : 2017-11-02 11:02:19
*/
private int id;
private int accountId;
private String alipayAccount;
private String alipayName;
private String alipayMobile;
private String createTime;
private String updateTime;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public String getAlipayAccount() {
return alipayAccount;
}
public void setAlipayAccount(String alipayAccount) {
this.alipayAccount = alipayAccount;
}
public String getAlipayName() {
return alipayName;
}
public void setAlipayName(String alipayName) {
this.alipayName = alipayName;
}
public String getAlipayMobile() {
return alipayMobile;
}
public void setAlipayMobile(String alipayMobile) {
this.alipayMobile = alipayMobile;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
}
}
package com.dayu.bigfish.bean;
/**
* 服务器常规返回的bean
* on 2017/9/16.
*/
public class BaseBean {
/**
* code : 0
* data : true
* msg : string
*/
private int code;
private boolean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public boolean isData() {
return data;
}
public void setData(boolean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.dayu.bigfish.bean;
/**
* Created by luofan on 2017/11/1.
*/
public class BaseDateBean {
protected int code;
protected String msg;
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* Created by yu on 2017/9/25.
*/
public class CheckOrderInit implements Serializable {
/**
* code : 0
* data : {"id":48,"orderNum":"20171013151641110126","source":1,"partnerNum":null,"partnerName":null,"status":2,"repairType":1,"customerType":1,"customerName":"测试363","customerCompany":"测试363","customerMobile":"15265895425","customerTelphome":"010-2569548","provinceId":1,"provinceName":"北京市","cityId":2,"cityName":"北京城区","districtId":3,"districtName":"东城区","address":"某某大厦","providerTypeId":328,"providerName":"安装","categoryId":"C_727","categoryName":"海贼王","categorySource":null,"brandId":438,"brandName":"春兰","productModel":"256","createId":285,"created":"大鱼鱼头","createTime":"2017-10-13 15:16:41","appointmentTime":"2017-10-14 15:16:20","comment":"测试363测试363","confirmDoorTime":null,"confirmDoorComment":null,"serviceRecordComment":null,"customerCheckComment":null,"isPay":null,"payType":null,"doorPrice":null,"doorPriceComment":null,"servicePrice":null,"servicePriceComment":null,"materialCost":null,"materialCostComment":null,"otherPrice":null,"otherPriceComment":null,"totalPrice":null,"cancelOrderReason":null,"closePhase":null,"siteId":143,"engineerId":288,"update":null,"key":null,"startTime":null,"endTime":null,"excptionCode":null}
* msg : 成功
*/
private int code;
private OrderBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public OrderBean getData() {
return data;
}
public void setData(OrderBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
}
}
package com.dayu.bigfish.bean; package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/** /**
* Created by yu on 2017/9/29. * Created by luofan on 2017/11/19.
*/
public class ErrorOrderBean implements Serializable {
/**
* code : 0
* data : [{"id":534,"orderNum":"20170929151419511330","createTime":"2017-09-29 15:14:20","confirmDoorTime":"2017-09-29 17:23:00","providerName":"安装","categoryName":"","provinceName":"内蒙古自治区","cityName":"鄂尔多斯市","districtName":"准格尔旗","address":"哈哈哈哈哈","customerType":2,"customerName":"哇哈哈","customerCompany":"王策鱼","customerMobile":"17310890230","customerTelphome":"01056873678","status":6,"excptionCode":3}]
* msg : 成功
*/
private int code;
private String msg;
private List<DataBean> data;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* id : 534
* orderNum : 20170929151419511330
* createTime : 2017-09-29 15:14:20
* confirmDoorTime : 2017-09-29 17:23:00
* providerName : 安装
* categoryName :
* provinceName : 内蒙古自治区
* cityName : 鄂尔多斯市
* districtName : 准格尔旗
* address : 哈哈哈哈哈
* customerType : 2
* customerName : 哇哈哈
* customerCompany : 王策鱼
* customerMobile : 17310890230
* customerTelphome : 01056873678
* status : 6
* excptionCode : 3
*/ */
public class ErrorOrder {
private int id; private int id;
private String orderNum; private String orderNum;
private String createTime; private String createTime;
...@@ -82,6 +22,7 @@ public class ErrorOrderBean implements Serializable { ...@@ -82,6 +22,7 @@ public class ErrorOrderBean implements Serializable {
private String customerTelphome; private String customerTelphome;
private int status; private int status;
private int excptionCode; private int excptionCode;
public int getId() { public int getId() {
return id; return id;
} }
...@@ -217,5 +158,4 @@ public class ErrorOrderBean implements Serializable { ...@@ -217,5 +158,4 @@ public class ErrorOrderBean implements Serializable {
public void setExcptionCode(int excptionCode) { public void setExcptionCode(int excptionCode) {
this.excptionCode = excptionCode; this.excptionCode = excptionCode;
} }
}
} }
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* 首页未预约状态的bean
* on 2017/9/12.
*/
public class HomeOneTabBean implements Serializable {
/**
* code : 0
* data : {"pageNo":1,"pageSize":10,"totalRows":3,"data":[{"id":15,"orderNum":"201708240044506489720","createTime":"2017-08-28 08:45:06","confirmDoorTime":null,"providerName":"安装","categoryName":"空调4","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":2},{"id":36,"orderNum":"201709249052804728589","createTime":"2017-09-06 09:28:04","confirmDoorTime":"2017-09-06 20:00:00","providerName":"维修","categoryName":"笔记本","provinceName":"北京","cityName":"海淀区","districtName":"知春路","address":"北京海淀知春路","customerType":1,"customerName":"大鱼创想","customerCompany":"大鱼创想","customerMobile":"15811366263","customerTelphome":"010-88888888","status":2},{"id":110,"orderNum":"20170912162957293836","createTime":"2017-09-12 08:29:57","confirmDoorTime":null,"providerName":"","categoryName":"自定义电视","provinceName":"辽宁省","cityName":"抚顺市","districtName":"清原满族自治县","address":"得到的","customerType":2,"customerName":"李四","customerCompany":"5对对对滴滴滴多多多多多","customerMobile":"15848959864","customerTelphome":"010-5874599","status":2}],"totalPages":1,"previousPageNo":1,"nextPageNo":1}
* msg : 成功
*/
private int code;
private DataBeanX data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBeanX getData() {
return data;
}
public void setData(DataBeanX data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBeanX {
/**
* pageNo : 1
* pageSize : 10
* totalRows : 3
* data : [{"id":15,"orderNum":"201708240044506489720","createTime":"2017-08-28 08:45:06","confirmDoorTime":null,"providerName":"安装","categoryName":"空调4","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":2},{"id":36,"orderNum":"201709249052804728589","createTime":"2017-09-06 09:28:04","confirmDoorTime":"2017-09-06 20:00:00","providerName":"维修","categoryName":"笔记本","provinceName":"北京","cityName":"海淀区","districtName":"知春路","address":"北京海淀知春路","customerType":1,"customerName":"大鱼创想","customerCompany":"大鱼创想","customerMobile":"15811366263","customerTelphome":"010-88888888","status":2},{"id":110,"orderNum":"20170912162957293836","createTime":"2017-09-12 08:29:57","confirmDoorTime":null,"providerName":"","categoryName":"自定义电视","provinceName":"辽宁省","cityName":"抚顺市","districtName":"清原满族自治县","address":"得到的","customerType":2,"customerName":"李四","customerCompany":"5对对对滴滴滴多多多多多","customerMobile":"15848959864","customerTelphome":"010-5874599","status":2}]
* totalPages : 1
* previousPageNo : 1
* nextPageNo : 1
*/
private int pageNo;
private int pageSize;
private int totalRows;
private int totalPages;
private int previousPageNo;
private int nextPageNo;
private List<DataBean> data;
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public int getPreviousPageNo() {
return previousPageNo;
}
public void setPreviousPageNo(int previousPageNo) {
this.previousPageNo = previousPageNo;
}
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* id : 15
* orderNum : 201708240044506489720
* createTime : 2017-08-28 08:45:06
* confirmDoorTime : null
* providerName : 安装
* categoryName : 空调4
* provinceName : null
* cityName : null
* districtName : null
* address : xx
* customerType : 1
* customerName : null
* customerCompany : null
* customerMobile : null
* customerTelphome : null
* status : 2
*/
private int id;
private String orderNum;
private String createTime;
private String confirmDoorTime;
private String providerName;
private String categoryName;
private String provinceName;
private String cityName;
private String districtName;
private String address;
private int customerType;
private String customerName;
private String customerCompany;
private String customerMobile;
private String customerTelphome;
private int status;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public Object getConfirmDoorTime() {
return confirmDoorTime;
}
public void setConfirmDoorTime(String confirmDoorTime) {
this.confirmDoorTime = confirmDoorTime;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public Object getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public Object getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getCustomerType() {
return customerType;
}
public void setCustomerType(int customerType) {
this.customerType = customerType;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public Object getCustomerCompany() {
return customerCompany;
}
public void setCustomerCompany(String customerCompany) {
this.customerCompany = customerCompany;
}
public String getCustomerMobile() {
return customerMobile;
}
public void setCustomerMobile(String customerMobile) {
this.customerMobile = customerMobile;
}
public Object getCustomerTelphome() {
return customerTelphome;
}
public void setCustomerTelphome(String customerTelphome) {
this.customerTelphome = customerTelphome;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by yu on 2017/9/13.
*/
public class HomeTwoTabBean implements Serializable {
/**
* code : 0
* data : {"pageNo":1,"pageSize":10,"totalRows":3,"data":[{"id":16,"orderNum":"201708240044800321749","createTime":"2017-08-28 08:48:01","confirmDoorTime":"2017-08-30 09:03:08","providerName":"安装","categoryName":"空调1","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":3},{"id":17,"orderNum":"201708241111436833037","createTime":"2017-08-29 03:14:37","confirmDoorTime":"2017-08-30 09:16:43","providerName":"安装","categoryName":"空调5","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":3},{"id":34,"orderNum":"201709249050812459604","createTime":"2017-09-06 09:08:12","confirmDoorTime":"2017-09-06 20:00:00","providerName":"维修","categoryName":"空调安装","provinceName":"北京","cityName":"海淀区","districtName":"知春路","address":"北京海淀知春路","customerType":1,"customerName":"大鱼创想","customerCompany":"大鱼创想","customerMobile":"15811366263","customerTelphome":"010-88888888","status":3}],"totalPages":1,"previousPageNo":1,"nextPageNo":1}
* msg : 成功
*/
private int code;
private DataBeanX data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBeanX getData() {
return data;
}
public void setData(DataBeanX data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBeanX {
/**
* pageNo : 1
* pageSize : 10
* totalRows : 3
* data : [{"id":16,"orderNum":"201708240044800321749","createTime":"2017-08-28 08:48:01","confirmDoorTime":"2017-08-30 09:03:08","providerName":"安装","categoryName":"空调1","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":3},{"id":17,"orderNum":"201708241111436833037","createTime":"2017-08-29 03:14:37","confirmDoorTime":"2017-08-30 09:16:43","providerName":"安装","categoryName":"空调5","provinceName":null,"cityName":null,"districtName":null,"address":"xx","customerType":1,"customerName":null,"customerCompany":null,"customerMobile":null,"customerTelphome":null,"status":3},{"id":34,"orderNum":"201709249050812459604","createTime":"2017-09-06 09:08:12","confirmDoorTime":"2017-09-06 20:00:00","providerName":"维修","categoryName":"空调安装","provinceName":"北京","cityName":"海淀区","districtName":"知春路","address":"北京海淀知春路","customerType":1,"customerName":"大鱼创想","customerCompany":"大鱼创想","customerMobile":"15811366263","customerTelphome":"010-88888888","status":3}]
* totalPages : 1
* previousPageNo : 1
* nextPageNo : 1
*/
private int pageNo;
private int pageSize;
private int totalRows;
private int totalPages;
private int previousPageNo;
private int nextPageNo;
private List<DataBean> data;
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public int getPreviousPageNo() {
return previousPageNo;
}
public void setPreviousPageNo(int previousPageNo) {
this.previousPageNo = previousPageNo;
}
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* id : 16
* orderNum : 201708240044800321749
* createTime : 2017-08-28 08:48:01
* confirmDoorTime : 2017-08-30 09:03:08
* providerName : 安装
* categoryName : 空调1
* provinceName : null
* cityName : null
* districtName : null
* address : xx
* customerType : 1
* customerName : null
* customerCompany : null
* customerMobile : null
* customerTelphome : null
* status : 3
*/
private int id;
private String orderNum;
private String createTime;
private String confirmDoorTime;
private String providerName;
private String categoryName;
private Object provinceName;
private Object cityName;
private Object districtName;
private String address;
private int customerType;
private Object customerName;
private Object customerCompany;
private Object customerMobile;
private Object customerTelphome;
private int status;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getConfirmDoorTime() {
return confirmDoorTime;
}
public void setConfirmDoorTime(String confirmDoorTime) {
this.confirmDoorTime = confirmDoorTime;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public Object getProvinceName() {
return provinceName;
}
public void setProvinceName(Object provinceName) {
this.provinceName = provinceName;
}
public Object getCityName() {
return cityName;
}
public void setCityName(Object cityName) {
this.cityName = cityName;
}
public Object getDistrictName() {
return districtName;
}
public void setDistrictName(Object districtName) {
this.districtName = districtName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getCustomerType() {
return customerType;
}
public void setCustomerType(int customerType) {
this.customerType = customerType;
}
public Object getCustomerName() {
return customerName;
}
public void setCustomerName(Object customerName) {
this.customerName = customerName;
}
public Object getCustomerCompany() {
return customerCompany;
}
public void setCustomerCompany(Object customerCompany) {
this.customerCompany = customerCompany;
}
public Object getCustomerMobile() {
return customerMobile;
}
public void setCustomerMobile(Object customerMobile) {
this.customerMobile = customerMobile;
}
public Object getCustomerTelphome() {
return customerTelphome;
}
public void setCustomerTelphome(Object customerTelphome) {
this.customerTelphome = customerTelphome;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
}
}
}
package com.dayu.bigfish.bean;
/**
* Created by yu on 2017/9/26.
*/
public class ImageBean {
private String originArg;
private String thumbArg;
private String image;
public ImageBean(String image) {
this.image = image;
}
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* 登录时返回的数据bean
* on 2017/9/6.
*/
public class LoginBean implements Serializable {
/**
* code : 0
* data : {"accountId":"9","siteId":"1","hxAccount":"76717b28913c47ab9f421f5b5ff9f6e3","accessToken":"6dffd7fb44ec41acbc2d4144bab22071","hxPwd":"h7g8P4KK","headerImg":"https://dayuoss.oss-cn-beijing.aliyuncs.com/saas/WechatIMG46.png","token":"e6545561ebe140b3b0205a0324e95a09"}
* msg : 成功
*/
private int code;
private UserInfo data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public UserInfo getUserInfo() {
return data;
}
public void setUserInfo(UserInfo data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.dayu.bigfish.bean;
/**
* Created by yu on 2017/10/24.
*/
public class LoginTestBean {
/**
* code : 0
* data : {"accountId":"407","siteId":"209","hxAccount":"bff06f06ea094d158b599908296b0aa1","accessToken":"b1ac52a96ab34f76ac42c55073dc0cfa","hxPwd":"ADsj63J8","token":"a53723f05fdd4532843eb5a3c9048a06"}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
/**
* accountId : 407
* siteId : 209
* hxAccount : bff06f06ea094d158b599908296b0aa1
* accessToken : b1ac52a96ab34f76ac42c55073dc0cfa
* hxPwd : ADsj63J8
* token : a53723f05fdd4532843eb5a3c9048a06
*/
private String accountId;
private String siteId;
private String hxAccount;
private String accessToken;
private String hxPwd;
private String token;
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getSiteId() {
return siteId;
}
public void setSiteId(String siteId) {
this.siteId = siteId;
}
public String getHxAccount() {
return hxAccount;
}
public void setHxAccount(String hxAccount) {
this.hxAccount = hxAccount;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public String getHxPwd() {
return hxPwd;
}
public void setHxPwd(String hxPwd) {
this.hxPwd = hxPwd;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
}
}
package com.dayu.bigfish.bean;
/**
* Created by Administrator on 2017/10/9.
*/
public class MessageTell {
private String action ;
private String functionType;
private String customJson;
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getFunctionType() {
return functionType;
}
public void setFunctionType(String functionType) {
this.functionType = functionType;
}
public String getCustomJson() {
return customJson;
}
public void setCustomJson(String customJson) {
this.customJson = customJson;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
private String orderId;
private String title;
}
...@@ -41,6 +41,15 @@ public class Order { ...@@ -41,6 +41,15 @@ public class Order {
private String customerMobile; private String customerMobile;
private String customerTelphome; private String customerTelphome;
private int status; private int status;
private int subStatus;
public int getSubStatus() {
return subStatus;
}
public void setSubStatus(int subStatus) {
this.subStatus = subStatus;
}
public int getId() { public int getId() {
return id; return id;
......
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by yu on 2017/9/30.
*/
public class OrderFinishBean implements Serializable {
/**
* code : 0
* data : {"pageNo":1,"pageSize":10,"totalRows":2,"data":[{"id":529,"orderNum":"20170929132104719015","createTime":"2017-09-29 13:21:04","confirmDoorTime":"2017-09-29 13:21:00","providerName":"安装","categoryName":"","provinceName":"河北省","cityName":"邯郸市","districtName":"大名县","address":"0106868686801068686868","customerType":1,"customerName":"哇哈哈","customerCompany":"哇哈哈","customerMobile":"17310890230","customerTelphome":"01068686868","status":5,"excptionCode":null},{"id":537,"orderNum":"20170929153456084291","createTime":"2017-09-29 15:34:57","confirmDoorTime":"2017-09-29 15:35:00","providerName":"安装","categoryName":"","provinceName":"北京市","cityName":"北京城区","districtName":"东城区","address":"wdqwdqwd","customerType":1,"customerName":"ja","customerCompany":"ja","customerMobile":"17310890230","customerTelphome":"01078456782","status":5,"excptionCode":null}],"previousPageNo":1,"nextPageNo":1,"totalPages":1}
* msg : 成功
*/
private int code;
private DataBeanX data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBeanX getData() {
return data;
}
public void setData(DataBeanX data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBeanX {
/**
* pageNo : 1
* pageSize : 10
* totalRows : 2
* data : [{"id":529,"orderNum":"20170929132104719015","createTime":"2017-09-29 13:21:04","confirmDoorTime":"2017-09-29 13:21:00","providerName":"安装","categoryName":"","provinceName":"河北省","cityName":"邯郸市","districtName":"大名县","address":"0106868686801068686868","customerType":1,"customerName":"哇哈哈","customerCompany":"哇哈哈","customerMobile":"17310890230","customerTelphome":"01068686868","status":5,"excptionCode":null},{"id":537,"orderNum":"20170929153456084291","createTime":"2017-09-29 15:34:57","confirmDoorTime":"2017-09-29 15:35:00","providerName":"安装","categoryName":"","provinceName":"北京市","cityName":"北京城区","districtName":"东城区","address":"wdqwdqwd","customerType":1,"customerName":"ja","customerCompany":"ja","customerMobile":"17310890230","customerTelphome":"01078456782","status":5,"excptionCode":null}]
* previousPageNo : 1
* nextPageNo : 1
* totalPages : 1
*/
private int pageNo;
private int pageSize;
private int totalRows;
private int previousPageNo;
private int nextPageNo;
private int totalPages;
private List<DataBean> data;
public int getPageNo() {
return pageNo;
}
public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getPreviousPageNo() {
return previousPageNo;
}
public void setPreviousPageNo(int previousPageNo) {
this.previousPageNo = previousPageNo;
}
public int getNextPageNo() {
return nextPageNo;
}
public void setNextPageNo(int nextPageNo) {
this.nextPageNo = nextPageNo;
}
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}
public List<DataBean> getData() {
return data;
}
public void setData(List<DataBean> data) {
this.data = data;
}
public static class DataBean {
/**
* id : 529
* orderNum : 20170929132104719015
* createTime : 2017-09-29 13:21:04
* confirmDoorTime : 2017-09-29 13:21:00
* providerName : 安装
* categoryName :
* provinceName : 河北省
* cityName : 邯郸市
* districtName : 大名县
* address : 0106868686801068686868
* customerType : 1
* customerName : 哇哈哈
* customerCompany : 哇哈哈
* customerMobile : 17310890230
* customerTelphome : 01068686868
* status : 5
* excptionCode : null
*/
private int id;
private String orderNum;
private String createTime;
private String confirmDoorTime;
private String providerName;
private String categoryName;
private String provinceName;
private String cityName;
private String districtName;
private String address;
private int customerType;
private String customerName;
private String customerCompany;
private String customerMobile;
private String customerTelphome;
private int status;
private Object excptionCode;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getConfirmDoorTime() {
return confirmDoorTime;
}
public void setConfirmDoorTime(String confirmDoorTime) {
this.confirmDoorTime = confirmDoorTime;
}
public String getProviderName() {
return providerName;
}
public void setProviderName(String providerName) {
this.providerName = providerName;
}
public String getCategoryName() {
return categoryName;
}
public void setCategoryName(String categoryName) {
this.categoryName = categoryName;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName;
}
public String getDistrictName() {
return districtName;
}
public void setDistrictName(String districtName) {
this.districtName = districtName;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getCustomerType() {
return customerType;
}
public void setCustomerType(int customerType) {
this.customerType = customerType;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerCompany() {
return customerCompany;
}
public void setCustomerCompany(String customerCompany) {
this.customerCompany = customerCompany;
}
public String getCustomerMobile() {
return customerMobile;
}
public void setCustomerMobile(String customerMobile) {
this.customerMobile = customerMobile;
}
public String getCustomerTelphome() {
return customerTelphome;
}
public void setCustomerTelphome(String customerTelphome) {
this.customerTelphome = customerTelphome;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public Object getExcptionCode() {
return excptionCode;
}
public void setExcptionCode(Object excptionCode) {
this.excptionCode = excptionCode;
}
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* Created by yu on 2017/9/18.
*/
public class PersonalCenterBean implements Serializable {
/**
* code : 0
* data : {"id":30,"accountId":115,"realName":"工程师","identity":"110200198802021561","identityUrl":null,"accountUrl":null,"aduitStatus":2,"createTime":null,"created":null,"updateTime":null,"updated":null,"gender":0,"age":29,"mobile":"15811366263","siteId":null,"password":null,"categorys":null,"providerTypeList":null,"messageCheckcode":null}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
/**
* id : 30
* accountId : 115
* realName : 工程师
* identity : 110200198802021561
* identityUrl : null
* accountUrl : null
* aduitStatus : 2
* createTime : null
* created : null
* updateTime : null
* updated : null
* gender : 0
* age : 29
* mobile : 15811366263
* siteId : null
* password : null
* categorys : null
* providerTypeList : null
* messageCheckcode : null
*/
private int id;
private int accountId;
private String realName;
private String identity;
private Object identityUrl;
private Object accountUrl;
private int aduitStatus;
private Object createTime;
private Object created;
private Object updateTime;
private Object updated;
private int gender;
private int age;
private String mobile;
private Object siteId;
private Object password;
private Object categorys;
private Object providerTypeList;
private Object messageCheckcode;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getAccountId() {
return accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public String getRealName() {
return realName;
}
public void setRealName(String realName) {
this.realName = realName;
}
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
public Object getIdentityUrl() {
return identityUrl;
}
public void setIdentityUrl(Object identityUrl) {
this.identityUrl = identityUrl;
}
public Object getAccountUrl() {
return accountUrl;
}
public void setAccountUrl(Object accountUrl) {
this.accountUrl = accountUrl;
}
public int getAduitStatus() {
return aduitStatus;
}
public void setAduitStatus(int aduitStatus) {
this.aduitStatus = aduitStatus;
}
public Object getCreateTime() {
return createTime;
}
public void setCreateTime(Object createTime) {
this.createTime = createTime;
}
public Object getCreated() {
return created;
}
public void setCreated(Object created) {
this.created = created;
}
public Object getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Object updateTime) {
this.updateTime = updateTime;
}
public Object getUpdated() {
return updated;
}
public void setUpdated(Object updated) {
this.updated = updated;
}
public int getGender() {
return gender;
}
public void setGender(int gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
public Object getSiteId() {
return siteId;
}
public void setSiteId(Object siteId) {
this.siteId = siteId;
}
public Object getPassword() {
return password;
}
public void setPassword(Object password) {
this.password = password;
}
public Object getCategorys() {
return categorys;
}
public void setCategorys(Object categorys) {
this.categorys = categorys;
}
public Object getProviderTypeList() {
return providerTypeList;
}
public void setProviderTypeList(Object providerTypeList) {
this.providerTypeList = providerTypeList;
}
public Object getMessageCheckcode() {
return messageCheckcode;
}
public void setMessageCheckcode(Object messageCheckcode) {
this.messageCheckcode = messageCheckcode;
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
import java.util.List;
/**
* Created by yu on 2017/9/25.
*/
public class PhotoBean implements Serializable {
/**
* code : 0
* data : true
* msg : string
*/
private int code;
private List data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public List getData() {
return data;
}
public void setData(List data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.dayu.bigfish.bean;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/**
* Created by yu on 2017/9/29.
*/
public class ReceOrderBean implements Serializable {
/**
* code : 0
* data : {"今日.....":0}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
@SerializedName("今日业绩(元)")
private int _$216; // FIXME check this code
public int get_$216() {
return _$216;
}
public void set_$216(int _$216) {
this._$216 = _$216;
}
}
}
package com.dayu.bigfish.bean;
/**
* Created by yu on 2017/9/29.
*/
public class ReceOrderNum {
/**
* code : 0
* data : {"今日接单":0}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
/**
* 今日接单 : 0
*/
private int 今日接单;
public int get今日接单() {
return 今日接单;
}
public void set今日接单(int 今日接单) {
this.今日接单 = 今日接单;
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* 获取工程师的累计信息(包含工单记录,评分,和累计收益)
* on 2017/9/29.
*/
public class ReceUserRevenue implements Serializable {
/**
* code : 0
* data : {"评分":0,"累计收益":0,"工单记录":0}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
/**
* 评分 : 0
* 累计收益 : 0
* 工单记录 : 0
*/
private double 评分;
private double 累计收益;
private int 工单记录;
public double get评分() {
return 评分;
}
public void set评分(int 评分) {
this.评分 = 评分;
}
public double get累计收益() {
return 累计收益;
}
public void set累计收益(int 累计收益) {
this.累计收益 = 累计收益;
}
public int get工单记录() {
return 工单记录;
}
public void set工单记录(int 工单记录) {
this.工单记录 = 工单记录;
}
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* Created by yu on 2017/9/14.
*/
public class ReceivingOrderBean implements Serializable {
/**
* code : 0
* data : true
* msg : 成功
*/
private int code;
private boolean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public boolean isData() {
return data;
}
public void setData(boolean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
package com.dayu.bigfish.bean;
import java.io.Serializable;
/**
* 获取验证码
* 2017/9/6.
*/
public class RegisterBean implements Serializable {
/**
* code : 0
* data : true
* msg : 成功
*/
private int code;
private boolean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public boolean isData() {
return data;
}
public void setData(boolean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Override
public String toString() {
return "RegisterBean{" +
"code=" + code +
", data=" + data +
", msg='" + msg + '\'' +
'}';
}
}
package com.dayu.bigfish.bean;
import com.google.gson.annotations.SerializedName;
/**
* Created by yu on 2017/9/29.
*/
public class TodayPerformanceBean {
/**
* code : 0
* data : {"今日业绩(元)":0}
* msg : 成功
*/
private int code;
private DataBean data;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static class DataBean {
@SerializedName("今日业绩(元)")
private int _$208; // FIXME check this code
public int get_$208() {
return _$208;
}
public void set_$208(int _$208) {
this._$208 = _$208;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment