Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
177b2e53
authored
Dec 12, 2017
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
android 1.1.0
parent
96ae58af
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
452 additions
and
129 deletions
annotation_lib/build/libs/annotation_lib.jar
app/build.gradle
app/proguard-rules.pro
app/src/main/java/com/dayu/bigfish/Constants.java
app/src/main/java/com/dayu/bigfish/api/APIService.java
app/src/main/java/com/dayu/bigfish/api/Api.java
app/src/main/java/com/dayu/bigfish/api/HttpLoggingInterceptor.java
app/src/main/java/com/dayu/bigfish/api/ServerException.java
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
app/src/main/java/com/dayu/bigfish/presenter/homefourtab/HomeFourContract.java
app/src/main/java/com/dayu/bigfish/presenter/homefourtab/HomeFourPresenter.java → app/src/main/java/com/dayu/bigfish/presenter/homefourtab/HomePersonPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/orderdetail/OrderDetailPresenter.java
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
app/src/main/java/com/dayu/bigfish/ui/OrderDetailsActivity.java
app/src/main/java/com/dayu/bigfish/ui/SopWebViewActivity.java
app/src/main/java/com/dayu/bigfish/ui/SubcribeTimeActivity.java
app/src/main/java/com/dayu/bigfish/ui/fragment/HomePersonFragment.java
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDatailsFragment.java → app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDateilsFragment.java
app/src/main/java/com/dayu/bigfish/utils/BindingAdapter.java
app/src/main/java/com/dayu/bigfish/utils/GlideImageLoader.java
app/src/main/java/com/dayu/bigfish/utils/UIUtils.java
app/src/main/res/layout/fragment_order_datails.xml
app/src/main/res/layout/fragment_personal_center.xml
app/src/main/res/values/strings.xml
annotation_lib/build/libs/annotation_lib.jar
View file @
177b2e53
No preview for this file type
app/build.gradle
View file @
177b2e53
...
...
@@ -105,7 +105,6 @@ dependencies {
compile
'com.squareup.retrofit2:retrofit:2.3.0'
compile
'com.squareup.retrofit2:converter-gson:2.3.0'
compile
'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
compile
'com.squareup.okhttp3:logging-interceptor:3.8.0'
//jsbridge
compile
'com.github.lzyzsd:jsbridge:1.0.4'
...
...
app/proguard-rules.pro
View file @
177b2e53
...
...
@@ -106,6 +106,9 @@
-keepclassmembers class * extends android.webkit.WebViewClient {
public void *(android.webkit.WebView, jav.lang.String);
}
-keepclassmembers class * extends android.webkit.WebChromeClient{
public void openFileChooser(...);
}
#-------------------------------------------定制化区域----------------------------------------------
...
...
app/src/main/java/com/dayu/bigfish/Constants.java
View file @
177b2e53
...
...
@@ -53,13 +53,13 @@ public class Constants {
//个人中心,今日收益
public
static
final
String
PERSONAL_ACOUNT_BALANCE
=
"/api-settlement/"
+
"payAccount/queryAccountBalanceAndtodayIncrease/accountId/{accountId}"
;
//账户余额
public
static
final
String
PERSONAL_ACCOUT_LIST
=
"/api-settlement/"
+
"
/
payStream/queryPayStream/"
;
public
static
final
String
PERSONAL_ACCOUT_LIST
=
"/api-settlement/"
+
"payStream/queryPayStream/"
;
//绑定支付宝账号
public
static
final
String
PERSONAL_ALIPAY_BOUND
=
"/api-settlement/"
+
"
/
alipay/save"
;
public
static
final
String
PERSONAL_ALIPAY_BOUND
=
"/api-settlement/"
+
"alipay/save"
;
//查询支付宝账号
public
static
final
String
PERSONAL_ALIPAY_QUERY
=
"/api-settlement/"
+
"
/
alipay/queryAlipayByAccountId/accountId/{accountId}"
;
public
static
final
String
PERSONAL_ALIPAY_QUERY
=
"/api-settlement/"
+
"alipay/queryAlipayByAccountId/accountId/{accountId}"
;
//修改支付宝账号
public
static
final
String
PERSONAL_ALIPAY_MODIFY
=
"/api-settlement/"
+
"
/
alipay/modifyAlipay"
;
public
static
final
String
PERSONAL_ALIPAY_MODIFY
=
"/api-settlement/"
+
"alipay/modifyAlipay"
;
//单表查询工单记录
public
final
static
String
SELECT_ORDER_LITTLE
=
"/api-order/"
+
"orders/{accountId}"
;
//根据工程师id和工程师id获取今日业绩(今日收益)
...
...
@@ -79,6 +79,10 @@ public class Constants {
public
final
static
String
TAB_NUM
=
"/api-order/"
+
"orders/{userId}/count/siteId/{siteId}"
;
//环信
public
final
static
String
MESSAGE_HX
=
"/api-message/"
+
"hXMessage"
;
public
final
static
String
MESSAGE_HX_LIST
=
"/api-message/hXMessage/hxAccount/{hxAccount}/category/{category}"
;
//获取消息数量
public
final
static
String
MESSAGE_NUM
=
" /api-message/"
+
"hXMessage/count/hxAccount/{hxAccount}"
;
...
...
app/src/main/java/com/dayu/bigfish/api/APIService.java
View file @
177b2e53
...
...
@@ -277,21 +277,21 @@ public interface APIService {
* @return
*/
@GET
(
Constants
.
TAB_NUM
)
Observable
<
BaseResponse
<
Tab
>>
getTabNum
(
@Path
(
"userId"
)
int
userId
,
@Path
(
"siteId"
)
int
siteId
);
Observable
<
BaseResponse
<
Tab
>>
getTabNum
(
@Path
(
"userId"
)
int
userId
,
@Path
(
"siteId"
)
int
siteId
);
/**
* 获取环信信息.
*
* @param hxAccount
* @param category
* @param category
1:系统消息,2:大鱼通知.
* @param page
* @param pageSize
* @return
*/
@GET
(
Constants
.
MESSAGE_HX
)
Observable
<
BaseResponse
<
BasePageBean
<
NewMessage
>>>
getHxMessage
(
@
Query
(
"hxAccount"
)
String
hxAccount
,
@
Query
(
"category"
)
int
category
,
@GET
(
Constants
.
MESSAGE_HX
_LIST
)
Observable
<
BaseResponse
<
BasePageBean
<
NewMessage
>>>
getHxMessage
(
@
Path
(
"hxAccount"
)
String
hxAccount
,
@
Path
(
"category"
)
int
category
,
@Query
(
"page"
)
int
page
,
@Query
(
"pageSize"
)
int
pageSize
);
...
...
app/src/main/java/com/dayu/bigfish/api/Api.java
View file @
177b2e53
...
...
@@ -7,6 +7,7 @@ import com.dayu.bigfish.Constants;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.base.BaseResponse
;
import
com.dayu.bigfish.utils.GetUserInfo
;
import
com.dayu.bigfish.utils.LogUtils
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
...
...
@@ -24,7 +25,6 @@ import okhttp3.Interceptor;
import
okhttp3.OkHttpClient
;
import
okhttp3.Request
;
import
okhttp3.Response
;
import
okhttp3.logging.HttpLoggingInterceptor
;
import
retrofit2.Retrofit
;
import
retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
;
import
retrofit2.converter.gson.GsonConverterFactory
;
...
...
@@ -48,7 +48,7 @@ public class Api {
Gson
gson
=
new
GsonBuilder
()
.
setDateFormat
(
"yyyy-MM-dd'T'HH:mm:ssZ"
)
.
create
();
HttpLoggingInterceptor
httpLoggingInterceptor
=
new
HttpLoggingInterceptor
(
m
->
Log
.
i
(
"request"
,
m
));
HttpLoggingInterceptor
httpLoggingInterceptor
=
new
HttpLoggingInterceptor
(
m
->
Log
Utils
.
i
(
"request"
,
m
));
httpLoggingInterceptor
.
setLevel
(
HttpLoggingInterceptor
.
Level
.
BODY
);
TokenInterceptord
tokenInterceptord
=
new
TokenInterceptord
();
OkHttpClient
okHttpClient
=
new
OkHttpClient
.
Builder
()
...
...
app/src/main/java/com/dayu/bigfish/api/HttpLoggingInterceptor.java
0 → 100644
View file @
177b2e53
/*
* Copyright (C) 2015 Square, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
dayu
.
bigfish
.
api
;
import
java.io.EOFException
;
import
java.io.IOException
;
import
java.nio.charset.Charset
;
import
java.util.concurrent.TimeUnit
;
import
okhttp3.Connection
;
import
okhttp3.Headers
;
import
okhttp3.Interceptor
;
import
okhttp3.MediaType
;
import
okhttp3.OkHttpClient
;
import
okhttp3.Protocol
;
import
okhttp3.Request
;
import
okhttp3.RequestBody
;
import
okhttp3.Response
;
import
okhttp3.ResponseBody
;
import
okhttp3.internal.http.HttpHeaders
;
import
okhttp3.internal.platform.Platform
;
import
okio.Buffer
;
import
okio.BufferedSource
;
import
static
okhttp3
.
internal
.
platform
.
Platform
.
INFO
;
/**
* An OkHttp interceptor which logs request and response information. Can be applied as an
* {@linkplain OkHttpClient#interceptors() application interceptor} or as a {@linkplain
* OkHttpClient#networkInterceptors() network interceptor}. <p> The format of the logs created by
* this class should not be considered stable and may change slightly between releases. If you need
* a stable logging format, use your own interceptor.
*/
public
final
class
HttpLoggingInterceptor
implements
Interceptor
{
private
static
final
Charset
UTF8
=
Charset
.
forName
(
"UTF-8"
);
public
enum
Level
{
/**
* No logs.
*/
NONE
,
/**
* Logs request and response lines.
* <p>
* <p>Example:
* <pre>{@code
* --> POST /greeting http/1.1 (3-byte body)
*
* <-- 200 OK (22ms, 6-byte body)
* }</pre>
*/
BASIC
,
/**
* Logs request and response lines and their respective headers.
* <p>
* <p>Example:
* <pre>{@code
* --> POST /greeting http/1.1
* Host: example.com
* Content-Type: plain/text
* Content-Length: 3
* --> END POST
*
* <-- 200 OK (22ms)
* Content-Type: plain/text
* Content-Length: 6
* <-- END HTTP
* }</pre>
*/
HEADERS
,
/**
* Logs request and response lines and their respective headers and bodies (if present).
* <p>
* <p>Example:
* <pre>{@code
* --> POST /greeting http/1.1
* Host: example.com
* Content-Type: plain/text
* Content-Length: 3
*
* Hi?
* --> END POST
*
* <-- 200 OK (22ms)
* Content-Type: plain/text
* Content-Length: 6
*
* Hello!
* <-- END HTTP
* }</pre>
*/
BODY
}
public
interface
Logger
{
void
log
(
String
message
);
/**
* A {@link Logger} defaults output appropriate for the current platform.
*/
Logger
DEFAULT
=
new
Logger
()
{
@Override
public
void
log
(
String
message
)
{
Platform
.
get
().
log
(
INFO
,
message
,
null
);
}
};
}
public
HttpLoggingInterceptor
()
{
this
(
Logger
.
DEFAULT
);
}
public
HttpLoggingInterceptor
(
Logger
logger
)
{
this
.
logger
=
logger
;
}
private
final
Logger
logger
;
private
volatile
Level
level
=
Level
.
NONE
;
/**
* Change the level at which this interceptor logs.
*/
public
HttpLoggingInterceptor
setLevel
(
Level
level
)
{
if
(
level
==
null
)
throw
new
NullPointerException
(
"level == null. Use Level.NONE instead."
);
this
.
level
=
level
;
return
this
;
}
public
Level
getLevel
()
{
return
level
;
}
@Override
public
Response
intercept
(
Chain
chain
)
throws
IOException
{
Level
level
=
this
.
level
;
Request
request
=
chain
.
request
();
if
(
level
==
Level
.
NONE
)
{
return
chain
.
proceed
(
request
);
}
boolean
logBody
=
level
==
Level
.
BODY
;
boolean
logHeaders
=
logBody
||
level
==
Level
.
HEADERS
;
RequestBody
requestBody
=
request
.
body
();
boolean
hasRequestBody
=
requestBody
!=
null
;
Connection
connection
=
chain
.
connection
();
Protocol
protocol
=
connection
!=
null
?
connection
.
protocol
()
:
Protocol
.
HTTP_1_1
;
String
requestStartMessage
=
"--> "
+
request
.
method
()
+
' '
+
request
.
url
()
+
' '
+
protocol
;
if
(!
logHeaders
&&
hasRequestBody
)
{
requestStartMessage
+=
" ("
+
requestBody
.
contentLength
()
+
"-byte body)"
;
}
logger
.
log
(
requestStartMessage
);
if
(
logHeaders
)
{
if
(
hasRequestBody
)
{
// Request body headers are only present when installed as a network interceptor. Force
// them to be included (when available) so there values are known.
if
(
requestBody
.
contentType
()
!=
null
)
{
logger
.
log
(
"Content-Type: "
+
requestBody
.
contentType
());
}
if
(
requestBody
.
contentLength
()
!=
-
1
)
{
logger
.
log
(
"Content-Length: "
+
requestBody
.
contentLength
());
}
}
Headers
headers
=
request
.
headers
();
for
(
int
i
=
0
,
count
=
headers
.
size
();
i
<
count
;
i
++)
{
String
name
=
headers
.
name
(
i
);
// Skip headers from the request body as they are explicitly logged above.
if
(!
"Content-Type"
.
equalsIgnoreCase
(
name
)
&&
!
"Content-Length"
.
equalsIgnoreCase
(
name
))
{
logger
.
log
(
name
+
": "
+
headers
.
value
(
i
));
}
}
if
(!
logBody
||
!
hasRequestBody
)
{
logger
.
log
(
"--> END "
+
request
.
method
());
}
else
if
(
bodyEncoded
(
request
.
headers
()))
{
logger
.
log
(
"--> END "
+
request
.
method
()
+
" (encoded body omitted)"
);
}
else
{
Buffer
buffer
=
new
Buffer
();
requestBody
.
writeTo
(
buffer
);
Charset
charset
=
UTF8
;
MediaType
contentType
=
requestBody
.
contentType
();
if
(
contentType
!=
null
)
{
charset
=
contentType
.
charset
(
UTF8
);
}
logger
.
log
(
""
);
if
(
isPlaintext
(
buffer
))
{
logger
.
log
(
"body:"
+
buffer
.
readString
(
charset
));
logger
.
log
(
"--> END "
+
request
.
method
()
+
" ("
+
requestBody
.
contentLength
()
+
"-byte body)"
);
}
else
{
logger
.
log
(
"--> END "
+
request
.
method
()
+
" (binary "
+
requestBody
.
contentLength
()
+
"-byte body omitted)"
);
}
}
}
long
startNs
=
System
.
nanoTime
();
Response
response
;
try
{
response
=
chain
.
proceed
(
request
);
}
catch
(
Exception
e
)
{
logger
.
log
(
"<-- HTTP FAILED: "
+
e
);
throw
e
;
}
long
tookMs
=
TimeUnit
.
NANOSECONDS
.
toMillis
(
System
.
nanoTime
()
-
startNs
);
ResponseBody
responseBody
=
response
.
body
();
long
contentLength
=
responseBody
.
contentLength
();
String
bodySize
=
contentLength
!=
-
1
?
contentLength
+
"-byte"
:
"unknown-length"
;
logger
.
log
(
"<-- "
+
response
.
code
()
+
' '
+
response
.
message
()
+
' '
+
response
.
request
().
url
()
+
" ("
+
tookMs
+
"ms"
+
(!
logHeaders
?
", "
+
bodySize
+
" body"
:
""
)
+
')'
);
if
(
logHeaders
)
{
Headers
headers
=
response
.
headers
();
for
(
int
i
=
0
,
count
=
headers
.
size
();
i
<
count
;
i
++)
{
logger
.
log
(
headers
.
name
(
i
)
+
": "
+
headers
.
value
(
i
));
}
if
(!
logBody
||
!
HttpHeaders
.
hasBody
(
response
))
{
logger
.
log
(
"<-- END HTTP"
);
}
else
if
(
bodyEncoded
(
response
.
headers
()))
{
logger
.
log
(
"<-- END HTTP (encoded body omitted)"
);
}
else
{
BufferedSource
source
=
responseBody
.
source
();
source
.
request
(
Long
.
MAX_VALUE
);
// Buffer the entire body.
Buffer
buffer
=
source
.
buffer
();
Charset
charset
=
UTF8
;
MediaType
contentType
=
responseBody
.
contentType
();
if
(
contentType
!=
null
)
{
charset
=
contentType
.
charset
(
UTF8
);
}
if
(!
isPlaintext
(
buffer
))
{
logger
.
log
(
""
);
logger
.
log
(
"<-- END HTTP (binary "
+
buffer
.
size
()
+
"-byte body omitted)"
);
return
response
;
}
if
(
contentLength
!=
0
)
{
logger
.
log
(
""
);
logger
.
log
(
buffer
.
clone
().
readString
(
charset
));
}
logger
.
log
(
"<-- END HTTP ("
+
buffer
.
size
()
+
"-byte body)"
);
}
}
return
response
;
}
/**
* Returns true if the body in question probably contains human readable text. Uses a small sample
* of code points to detect unicode control characters commonly used in binary file signatures.
*/
static
boolean
isPlaintext
(
Buffer
buffer
)
{
try
{
Buffer
prefix
=
new
Buffer
();
long
byteCount
=
buffer
.
size
()
<
64
?
buffer
.
size
()
:
64
;
buffer
.
copyTo
(
prefix
,
0
,
byteCount
);
for
(
int
i
=
0
;
i
<
16
;
i
++)
{
if
(
prefix
.
exhausted
())
{
break
;
}
int
codePoint
=
prefix
.
readUtf8CodePoint
();
if
(
Character
.
isISOControl
(
codePoint
)
&&
!
Character
.
isWhitespace
(
codePoint
))
{
return
false
;
}
}
return
true
;
}
catch
(
EOFException
e
)
{
return
false
;
// Truncated UTF-8 sequence.
}
}
private
boolean
bodyEncoded
(
Headers
headers
)
{
String
contentEncoding
=
headers
.
get
(
"Content-Encoding"
);
return
contentEncoding
!=
null
&&
!
contentEncoding
.
equalsIgnoreCase
(
"identity"
);
}
}
app/src/main/java/com/dayu/bigfish/api/ServerException.java
View file @
177b2e53
...
...
@@ -52,6 +52,13 @@ public class ServerException extends Exception {
case
"USER0005"
:
message
=
MyApplication
.
getContext
().
getString
(
R
.
string
.
account_frozen
);
break
;
/** 账户相关*/
case
"SETTLEMENT0015"
:
message
=
MyApplication
.
getContext
().
getString
(
R
.
string
.
not_show
);
break
;
case
"SETTLEMENT0001"
:
message
=
MyApplication
.
getContext
().
getString
(
R
.
string
.
perameter_is_null
);
break
;
default
:
message
=
MyApplication
.
getContext
().
getString
(
R
.
string
.
get_info_failed
);
break
;
...
...
app/src/main/java/com/dayu/bigfish/base/BasePresenter.java
View file @
177b2e53
...
...
@@ -138,9 +138,9 @@ public abstract class BasePresenter<V> {
}
return
exception
;
}
if
(
mView
instanceof
BaseActivity
)
{
if
(
!
"not_show"
.
equals
(
message
)
&&
mView
instanceof
BaseActivity
)
{
((
BaseActivity
)
mView
).
showToast
(
message
);
}
else
if
(
mView
instanceof
BaseFragment
)
{
}
else
if
(
!
"not_show"
.
equals
(
message
)
&&
mView
instanceof
BaseFragment
)
{
((
BaseFragment
)
mView
).
showToast
(
message
);
}
return
exception
;
...
...
app/src/main/java/com/dayu/bigfish/presenter/homefourtab/HomeFourContract.java
View file @
177b2e53
...
...
@@ -3,7 +3,6 @@ package com.dayu.bigfish.presenter.homefourtab;
import
com.dayu.bigfish.base.BasePresenter
;
import
com.dayu.bigfish.base.BaseView
;
import
com.dayu.bigfish.bean.AlipayInfo
;
import
com.dayu.bigfish.bean.EngineerInfo
;
import
com.dayu.bigfish.bean.OrderRecord
;
import
com.dayu.bigfish.bean.TodayAchievement
;
...
...
@@ -23,7 +22,10 @@ public interface HomeFourContract {
void
getAccountBalanceSuccess
(
TodayBalance
todayBalance
);
void
getAlipayAccountSuccess
(
AlipayInfo
info
);
/**
* 是否显示绑定alipay的对话框.
*/
void
showAlipayDialog
();
/**
* 跳转账户余额.
...
...
app/src/main/java/com/dayu/bigfish/presenter/homefourtab/Home
Four
Presenter.java
→
app/src/main/java/com/dayu/bigfish/presenter/homefourtab/Home
Person
Presenter.java
View file @
177b2e53
...
...
@@ -15,7 +15,7 @@ import io.reactivex.functions.Consumer;
* Created by luofan on 2017/11/8.
*/
@InstanceFactory
public
class
Home
Four
Presenter
extends
HomeFourContract
.
Presenter
{
public
class
Home
Person
Presenter
extends
HomeFourContract
.
Presenter
{
@Override
public
void
onAttached
()
{
...
...
@@ -27,7 +27,10 @@ public class HomeFourPresenter extends HomeFourContract.Presenter {
ApiFactory
.
queryAlipay
(
accountId
).
subscribe
(
baseObserver
(
new
Consumer
<
AlipayInfo
>()
{
@Override
public
void
accept
(
AlipayInfo
info
)
throws
Exception
{
mView
.
getAlipayAccountSuccess
(
info
);
}
},
responeThrowable
->
{
if
(
"SETTLEMENT0015"
.
equals
(
responeThrowable
.
subCode
))
{
mView
.
showAlipayDialog
();
}
}));
}
...
...
app/src/main/java/com/dayu/bigfish/presenter/orderdetail/OrderDetailPresenter.java
View file @
177b2e53
...
...
@@ -50,7 +50,7 @@ public class OrderDetailPresenter extends OrderDetailContract.Presenter {
}
else
if
(
staus
==
7
)
{
return
mActivity
.
getString
(
R
.
string
.
order_close
);
}
else
{
return
null
;
return
mActivity
.
getString
(
R
.
string
.
no_data
)
;
}
}
}
app/src/main/java/com/dayu/bigfish/ui/MainActivity.java
View file @
177b2e53
...
...
@@ -199,8 +199,9 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
intent
.
setDataAndType
(
contentUri
,
"application/vnd.android.package-archive"
);
}
else
{
intent
.
setDataAndType
(
Uri
.
fromFile
(
file
),
"application/vnd.android.package-archive"
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
}
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
mActivity
.
startActivity
(
intent
);
}
...
...
app/src/main/java/com/dayu/bigfish/ui/OrderDetailsActivity.java
View file @
177b2e53
...
...
@@ -9,7 +9,7 @@ import com.dayu.bigfish.R;
import
com.dayu.bigfish.base.DataBindingActivity
;
import
com.dayu.bigfish.databinding.ActivityOrderDetailsBinding
;
import
com.dayu.bigfish.ui.adapter.FragmentOrderAdapter
;
import
com.dayu.bigfish.ui.fragment.OrderDat
a
ilsFragment
;
import
com.dayu.bigfish.ui.fragment.OrderDat
e
ilsFragment
;
import
com.dayu.bigfish.ui.fragment.OrderDatailsServeFragment
;
import
com.dayu.bigfish.utils.TabLayoutUtils
;
...
...
@@ -25,7 +25,7 @@ public class OrderDetailsActivity extends DataBindingActivity<ActivityOrderDetai
private
List
<
Fragment
>
list
;
private
FragmentOrderAdapter
fragmentAdapter
;
private
int
orderId
;
private
OrderDat
a
ilsFragment
orderDatailsFragment
;
private
OrderDat
e
ilsFragment
orderDatailsFragment
;
private
OrderDatailsServeFragment
orderDatailsServeFragment
;
...
...
@@ -48,7 +48,7 @@ public class OrderDetailsActivity extends DataBindingActivity<ActivityOrderDetai
Intent
intent
=
getIntent
();
orderId
=
intent
.
getIntExtra
(
"orderId"
,
0
);
list
=
new
ArrayList
<>();
orderDatailsFragment
=
new
OrderDat
a
ilsFragment
();
orderDatailsFragment
=
new
OrderDat
e
ilsFragment
();
list
.
add
(
orderDatailsFragment
);
orderDatailsServeFragment
=
new
OrderDatailsServeFragment
();
list
.
add
(
orderDatailsServeFragment
);
...
...
app/src/main/java/com/dayu/bigfish/ui/SopWebViewActivity.java
View file @
177b2e53
...
...
@@ -101,6 +101,7 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
mWebView
.
setDefaultHandler
(
new
MyHandler
());
mWebView
.
setWebChromeClient
(
new
WebChromeClient
()
{
public
void
openFileChooser
(
ValueCallback
<
Uri
>
uploadMsg
,
String
AcceptType
,
String
capture
)
{
this
.
openFileChooser
(
uploadMsg
);
}
...
...
@@ -162,7 +163,7 @@ public class SopWebViewActivity extends DataBindingActivity<ActivityWebviewBindi
mWebView
.
callHandler
(
"getToken"
,
json
,
new
CallBackFunction
()
{
@Override
public
void
onCallBack
(
String
data
)
{
ToastUtils
.
showShortToast
(
"获取token成功"
+
mOrderId
);
ToastUtils
.
showShortToast
(
"获取token成功"
+
mOrderId
);
}
});
}
...
...
app/src/main/java/com/dayu/bigfish/ui/SubcribeTimeActivity.java
View file @
177b2e53
...
...
@@ -42,9 +42,9 @@ import static com.dayu.bigfish.utils.UtilsDate.LONG_TIME_FORMAT_TWO;
public
class
SubcribeTimeActivity
extends
BaseActivity
<
SubcribeTimePresenter
,
ActivitySubscribeTimeBinding
>
implements
SubcribeContract
.
View
{
private
int
o
rderId
;
private
int
mO
rderId
;
private
String
mInfo
;
private
int
finsh
Position
;
private
int
m
Position
;
private
boolean
mIsToday
;
private
int
mState
;
private
String
mTime
;
...
...
@@ -60,8 +60,8 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Ac
public
void
initView
()
{
mBind
.
setPresenter
(
mPresenter
);
Intent
intent
=
getIntent
();
o
rderId
=
intent
.
getIntExtra
(
Constants
.
ORDER_ID
,
0
);
finsh
Position
=
intent
.
getIntExtra
(
Constants
.
ORDER_POSTION
,
0
);
mO
rderId
=
intent
.
getIntExtra
(
Constants
.
ORDER_ID
,
0
);
m
Position
=
intent
.
getIntExtra
(
Constants
.
ORDER_POSTION
,
0
);
mState
=
intent
.
getIntExtra
(
Constants
.
ORDER_STATE
,
0
);
if
(
mState
==
SUBCRIBE_TIME
)
{
mBind
.
tvTile
.
setText
(
getString
(
R
.
string
.
tv_home_tab_one_subscribe_time
));
...
...
@@ -83,7 +83,7 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Ac
EventBus
.
getDefault
().
post
(
new
RefreshApoiment
(
1
));
EventBus
.
getDefault
().
post
(
new
RefreshServe
(
1
));
}
else
if
(
mState
==
ORDER_YUYUE
||
mState
==
ORDER_DOING
)
{
EventBus
.
getDefault
().
post
(
new
OrderState
(
ORDER_YUYUE
,
finsh
Position
,
mTime
));
EventBus
.
getDefault
().
post
(
new
OrderState
(
ORDER_YUYUE
,
m
Position
,
mTime
));
}
}
...
...
@@ -105,7 +105,7 @@ public class SubcribeTimeActivity extends BaseActivity<SubcribeTimePresenter, Ac
try
{
String
d
=
UtilsDate
.
changeFormat
(
day
,
LONG_DATE
,
LONG_DATE_FORMAT
);
mTime
=
d
+
" "
+
time
+
":00"
;
mPresenter
.
subcribeTime
(
o
rderId
,
mTime
,
mInfo
);
mPresenter
.
subcribeTime
(
mO
rderId
,
mTime
,
mInfo
);
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/HomePersonFragment.java
View file @
177b2e53
package
com
.
dayu
.
bigfish
.
ui
.
fragment
;
import
android.content.Intent
;
import
android.content.res.AssetManager
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
...
...
@@ -12,21 +10,17 @@ import android.view.ViewGroup;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.dayu.bigfish.Constants
;
import
com.dayu.bigfish.MyApplication
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.bean.AlipayInfo
;
import
com.dayu.bigfish.bean.EngineerInfo
;
import
com.dayu.bigfish.bean.OrderRecord
;
import
com.dayu.bigfish.bean.TodayAchievement
;
import
com.dayu.bigfish.bean.TodayBalance
;
import
com.dayu.bigfish.databinding.FragmentPersonalCenterBinding
;
import
com.dayu.bigfish.presenter.homefourtab.HomeFourContract
;
import
com.dayu.bigfish.presenter.homefourtab.Home
Four
Presenter
;
import
com.dayu.bigfish.presenter.homefourtab.Home
Person
Presenter
;
import
com.dayu.bigfish.ui.AccountBalanceActivity
;
import
com.dayu.bigfish.ui.OrderRecordActivity
;
import
com.dayu.bigfish.ui.SettingActivity
;
...
...
@@ -40,11 +34,10 @@ import com.dayu.bigfish.utils.SPUtils;
* Created by luofan on 2017/11/20.
*/
public
class
HomePersonFragment
extends
BaseFragment
<
Home
Four
Presenter
,
FragmentPersonalCenterBinding
>
public
class
HomePersonFragment
extends
BaseFragment
<
Home
Person
Presenter
,
FragmentPersonalCenterBinding
>
implements
HomeFourContract
.
View
{
private
int
userId
;
private
int
siteId
;
private
static
String
mHeaderUrl
;
private
String
mUserName
;
private
String
mUserPhone
;
private
String
mScore
;
...
...
@@ -58,45 +51,30 @@ public class HomePersonFragment extends BaseFragment<HomeFourPresenter, Fragment
}
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_personal_center
;
}
@Override
public
View
initView
(
View
view
)
{
mBind
.
setPresenter
(
mPresenter
);
userId
=
GetUserInfo
.
getACCOUNT_ID
(
MyApplication
.
getContext
());
siteId
=
GetUserInfo
.
getSITE_ID
(
MyApplication
.
getContext
());
AssetManager
mgr
=
mActivity
.
getAssets
();
Typeface
tf
=
Typeface
.
createFromAsset
(
mgr
,
"fonts/DIN Alternate Bold.ttf"
);
mBind
.
tvAchivement
.
setTypeface
(
tf
);
mBind
.
tvAccountBalance
.
setTypeface
(
tf
);
mBind
.
tvAllAchivement
.
setTypeface
(
tf
);
mBind
.
tvOrderRecord
.
setTypeface
(
tf
);
mHeaderUrl
=
GetUserInfo
.
getUserHead
(
mActivity
);
if
(!
TextUtils
.
isEmpty
(
mHeaderUrl
))
{
RequestOptions
options
=
new
RequestOptions
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
);
Glide
.
with
(
view
.
getContext
())
.
load
(
mHeaderUrl
)
.
apply
(
options
)
.
into
(
mBind
.
ivHeader
);
}
mBind
.
setImgurl
(
GetUserInfo
.
getUserHead
(
mActivity
));
return
view
;
}
@Override
public
int
getLayoutId
()
{
return
R
.
layout
.
fragment_personal_center
;
}
@Override
protected
void
lazyLoad
()
{
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getAllData
(
userId
,
siteId
);
mPresenter
.
getAlipayAccount
(
userId
);
}
public
void
fillData
(
EngineerInfo
info
)
{
@Override
public
void
getPersonalInfoSuccess
(
EngineerInfo
info
)
{
mUserName
=
info
.
getRealName
();
mBind
.
tvName
.
setText
(
mUserName
);
SPUtils
.
put
(
mActivity
,
"USER_NAME"
,
mUserName
);
if
(
info
.
getGender
()
==
1
)
{
mBind
.
tvSex
.
setText
(
mActivity
.
getString
(
R
.
string
.
man
));
}
else
if
(
info
.
getGender
()
==
0
)
{
...
...
@@ -108,28 +86,7 @@ public class HomePersonFragment extends BaseFragment<HomeFourPresenter, Fragment
mUserPhone
=
info
.
getMobile
();
mBind
.
tvPhone
.
setText
(
mUserPhone
);
SPUtils
.
put
(
mActivity
,
"USER_PHONE"
,
mUserPhone
);
}
private
void
showAlertDialog
()
{
CustomDialog
dialog
=
new
CustomDialog
(
mActivity
,
R
.
style
.
custom_dialog2
,
mActivity
.
getString
(
R
.
string
.
not_set_account
)
,
(
dialog1
,
confirm
)
->
{
if
(
confirm
)
{
Intent
intent
=
new
Intent
(
mActivity
,
WithdrawalsActivity
.
class
);
startActivity
(
intent
);
dialog1
.
dismiss
();
}
else
{
}
dialog1
.
dismiss
();
});
dialog
.
setTitle
(
mActivity
.
getString
(
R
.
string
.
notice
))
.
setNegativeButton
(
mActivity
.
getString
(
R
.
string
.
not_set_up
))
.
setPositiveButton
(
mActivity
.
getString
(
R
.
string
.
go_set_up
));
dialog
.
show
();
}
@Override
public
void
getPersonalInfoSuccess
(
EngineerInfo
info
)
{
fillData
(
info
);
SPUtils
.
put
(
mActivity
,
"USER_NAME"
,
mUserName
);
}
@Override
...
...
@@ -164,9 +121,9 @@ public class HomePersonFragment extends BaseFragment<HomeFourPresenter, Fragment
}
@Override
public
void
getAlipayAccountSuccess
(
AlipayInfo
info
)
{
public
void
showAlipayDialog
(
)
{
boolean
isShow
=
(
boolean
)
SPUtils
.
get
(
mActivity
,
Constants
.
IS_SHOW_ALIPAY_DILAOG
,
true
);
if
(
isShow
&&
TextUtils
.
isEmpty
(
info
.
getAlipayAccount
())
)
{
if
(
isShow
)
{
showAlertDialog
();
SPUtils
.
put
(
mActivity
,
Constants
.
IS_SHOW_ALIPAY_DILAOG
,
false
);
}
...
...
@@ -191,6 +148,23 @@ public class HomePersonFragment extends BaseFragment<HomeFourPresenter, Fragment
startActivity
(
intent
);
}
private
void
showAlertDialog
()
{
CustomDialog
dialog
=
new
CustomDialog
(
mActivity
,
R
.
style
.
custom_dialog2
,
mActivity
.
getString
(
R
.
string
.
not_set_account
)
,
(
dialog1
,
confirm
)
->
{
if
(
confirm
)
{
Intent
intent
=
new
Intent
(
mActivity
,
WithdrawalsActivity
.
class
);
startActivity
(
intent
);
dialog1
.
dismiss
();
}
else
{
}
dialog1
.
dismiss
();
});
dialog
.
setTitle
(
mActivity
.
getString
(
R
.
string
.
notice
))
.
setNegativeButton
(
mActivity
.
getString
(
R
.
string
.
not_set_up
))
.
setPositiveButton
(
mActivity
.
getString
(
R
.
string
.
go_set_up
));
dialog
.
show
();
}
/**
* drawStars.
*
...
...
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDat
a
ilsFragment.java
→
app/src/main/java/com/dayu/bigfish/ui/fragment/OrderDat
e
ilsFragment.java
View file @
177b2e53
...
...
@@ -4,6 +4,7 @@ import android.support.v7.widget.LinearLayoutManager;
import
android.text.TextUtils
;
import
android.view.View
;
import
com.dayu.bigfish.BR
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.base.BaseFragment
;
import
com.dayu.bigfish.base.CoreAdapter
;
...
...
@@ -20,7 +21,7 @@ import com.dayu.bigfish.utils.UIUtils;
* on 2017/9/13.
*/
public
class
OrderDat
a
ilsFragment
extends
BaseFragment
<
OrderDetailPresenter
,
FragmentOrderDatailsBinding
>
public
class
OrderDat
e
ilsFragment
extends
BaseFragment
<
OrderDetailPresenter
,
FragmentOrderDatailsBinding
>
implements
OrderDetailContract
.
View
{
private
int
orderId
;
...
...
@@ -33,6 +34,7 @@ public class OrderDatailsFragment extends BaseFragment<OrderDetailPresenter, Fra
ProgressUtil
.
startLoad
(
mActivity
);
mPresenter
.
getOrderDetailInfo
(
orderId
);
mBind
.
setPresenter
(
mPresenter
);
mBind
.
setVariable
(
BR
.
item
,
new
OrderDetail
());
return
view
;
}
...
...
app/src/main/java/com/dayu/bigfish/utils/BindingAdapter.java
0 → 100644
View file @
177b2e53
package
com
.
dayu
.
bigfish
.
utils
;
import
android.databinding.BindingConversion
;
import
android.graphics.Typeface
;
import
android.text.TextUtils
;
import
android.widget.ImageView
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.dayu.bigfish.MyApplication
;
/**
* Created by luofan on 2017/12/12.
*/
public
class
BindingAdapter
{
/**
* databing加载图片.
*
* @param view
* @param url
*/
@android
.
databinding
.
BindingAdapter
({
"imageUrl"
})
public
static
void
loadImage
(
ImageView
view
,
String
url
)
{
if
(
TextUtils
.
isEmpty
(
url
))
{
return
;
}
RequestOptions
options
=
new
RequestOptions
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
);
Glide
.
with
(
view
.
getContext
())
.
load
(
url
)
.
apply
(
options
)
.
into
(
view
);
}
/**
* 设置字体转换器.
*
* @param s
* @return
*/
@BindingConversion
public
static
Typeface
convertStringToFace
(
String
s
)
{
try
{
return
Typeface
.
createFromAsset
(
MyApplication
.
getContext
().
getAssets
(),
s
);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
}
app/src/main/java/com/dayu/bigfish/utils/GlideImageLoader.java
View file @
177b2e53
package
com
.
dayu
.
bigfish
.
utils
;
import
android.content.Context
;
import
android.databinding.BindingAdapter
;
import
android.support.annotation.DrawableRes
;
import
android.widget.ImageView
;
...
...
@@ -36,21 +35,6 @@ public class GlideImageLoader {
.
into
(
view
);
}
/**
* databing加载图片.
* @param view
* @param url
*/
@BindingAdapter
({
"imageUrl"
})
public
static
void
loadImage
(
ImageView
view
,
String
url
)
{
RequestOptions
options
=
new
RequestOptions
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
);
Glide
.
with
(
view
.
getContext
())
.
load
(
url
)
.
apply
(
options
)
.
into
(
view
);
}
/* *//**
* 下载图片转换圆角
...
...
app/src/main/java/com/dayu/bigfish/utils/UIUtils.java
View file @
177b2e53
...
...
@@ -2,9 +2,7 @@ package com.dayu.bigfish.utils;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.databinding.BindingConversion
;
import
android.graphics.Paint
;
import
android.graphics.Typeface
;
import
android.widget.TextView
;
import
com.dayu.bigfish.MyApplication
;
...
...
@@ -91,15 +89,6 @@ public class UIUtils {
return
false
;
}
}
@BindingConversion
public
static
Typeface
convertStringToFace
(
String
s
)
{
try
{
return
Typeface
.
createFromAsset
(
MyApplication
.
getContext
().
getAssets
(),
s
);
}
catch
(
Exception
e
)
{
throw
e
;
}
}
}
app/src/main/res/layout/fragment_order_datails.xml
View file @
177b2e53
...
...
@@ -60,7 +60,7 @@
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_13"
android:layout_toRightOf=
"@id/text_one"
android:text=
'@{!TextUtils.isEmpty(item.orderNum)?item.orderNum:@string/no_data}'
android:text=
'@{!TextUtils.isEmpty(item.orderNum)?item.orderNum:@string/no_data
,default = @string/no_data
}'
android:textColor=
"@color/cl_home_title_text_color"
android:textSize=
"@dimen/sp_13.3"
/>
...
...
@@ -235,8 +235,10 @@
>
<TextView
android:id=
"@+id/tv_fujian"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"附 件"
android:textColor=
"@color/cl_order_text_one"
android:textSize=
"@dimen/sp_13.3"
/>
...
...
@@ -246,7 +248,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_13"
android:layout_toRightOf=
"@id/t
ext_foure
"
>
android:layout_toRightOf=
"@id/t
v_fujian
"
>
</android.support.v7.widget.RecyclerView>
</LinearLayout>
...
...
@@ -516,7 +518,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/line_three"
android:visibility=
"@{item.isPay ==1?View.
VISIBLE:View.GON
E}"
android:visibility=
"@{item.isPay ==1?View.
GONE:View.VISIBL
E}"
>
<TextView
...
...
@@ -676,7 +678,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@id/line_three"
android:visibility=
"@{item.isPay ==1?View.
GONE:View.VISIBL
E}"
android:visibility=
"@{item.isPay ==1?View.
VISIBLE:View.GON
E}"
>
<TextView
...
...
app/src/main/res/layout/fragment_personal_center.xml
View file @
177b2e53
...
...
@@ -3,11 +3,11 @@
<data>
<import
type=
"com.dayu.bigfish.presenter.homefourtab.Home
Four
Presenter"
/>
<import
type=
"com.dayu.bigfish.presenter.homefourtab.Home
Person
Presenter"
/>
<variable
name=
"presenter"
type=
"
HomeFour
Presenter"
/>
type=
"
com.dayu.bigfish.presenter.homefourtab.HomePerson
Presenter"
/>
<variable
name=
"imgurl"
...
...
@@ -60,6 +60,7 @@
<com.dayu.bigfish.ui.views.CircleImageView
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/iv_header"
imageUrl=
"@{imgurl}"
android:layout_width=
"@dimen/size_login_mlcircleimageview_width"
android:layout_height=
"@dimen/size_login_mlcircleimageview_height"
android:layout_centerHorizontal=
"true"
...
...
@@ -196,6 +197,7 @@
android:text=
"0"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"30sp"
android:typeface=
"@{@string/tv_fonts}"
/>
</RelativeLayout>
...
...
@@ -230,6 +232,7 @@
android:text=
"0"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"30sp"
android:typeface=
"@{@string/tv_fonts}"
/>
<LinearLayout
...
...
@@ -298,6 +301,7 @@
android:text=
"0"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"@dimen/sp_30"
android:typeface=
"@{@string/tv_fonts}"
/>
</RelativeLayout>
...
...
@@ -330,17 +334,10 @@
android:text=
"0"
android:textColor=
"@color/cl_tab_yellow"
android:textSize=
"@dimen/sp_30"
android:typeface=
"@{@string/tv_fonts}"
/>
</RelativeLayout>
</LinearLayout>
<!--<ImageView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_alignParentBottom="true"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true"-->
<!--android:src="@mipmap/person_bottom_view"/>-->
</RelativeLayout>
</layout>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
177b2e53
...
...
@@ -259,6 +259,7 @@
<!--error-->
<string
name=
"not_show"
>
not_show
</string>
<string
name=
"error_token"
>
token失效
</string>
<string
name=
"error_time_out"
>
连接服务器超时
</string>
<string
name=
"error_connect"
>
连接服务器失败
</string>
...
...
@@ -275,6 +276,7 @@
<string
name=
"order_cancle_not_begin"
>
工单已取消,不能上门了
</string>
<string
name=
"order_cancle_not_process"
>
工单已取消,不能处理了
</string>
<string
name=
"order_receive_already"
>
已被接单,请选择其他工单
</string>
<string
name=
"perameter_is_null"
>
参数为空
</string>
<string
name=
"agreement"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment