Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
0715edf7
Commit
0715edf7
authored
Apr 30, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4.29 接單第三方物流,獲取打印機邏輯修改
parent
2da52ed5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
569 additions
and
419 deletions
+569
-419
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
+12
-3
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
+7
-11
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
+4
-2
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/ServiceCreator.kt
+21
-10
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
+3
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+81
-31
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
+3
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OtherOrderActivity.kt
+0
-2
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/PlaceholderFragment.kt
+2
-4
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
+82
-7
other_order_mode/src/main/res/values/strings.xml
+3
-1
print-module/src/main/AndroidManifest.xml
+0
-1
print-module/src/main/java/com/joe/print/mvp/model/bean/PrinterDeviceBean.java
+0
-91
print-module/src/main/java/com/joe/print/mvp/presenter/PrinterAddPresenter.java
+3
-1
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
+4
-3
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
+10
-7
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
+4
-10
print-module/src/main/java/com/joe/print/mvp/ui/adapter/PrinterListAdapter.java
+38
-34
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
+1
-1
print-module/src/main/res/layout/printer_activity_add.xml
+27
-0
print-module/src/main/res/layout/printer_activity_list.xml
+1
-2
print-module/src/main/res/layout/printer_item.xml
+15
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
+12
-2
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
+16
-2
public-base/src/main/java/com/gingersoft/gsa/cloud/print/bean/OrderDetails.kt
+5
-2
public-base/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/LoadingDialog.java
+1
-1
public-base/src/main/res/drawable/shape_app_btn.xml
+2
-1
public-base/src/main/res/layout/print_kitchen.xml
+0
-1
public-base/src/main/res/values/colors.xml
+3
-0
user-login/src/main/AndroidManifest.xml
+5
-3
user-login/src/main/debug/AndroidManifest.xml
+40
-40
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/ComponentLogin.java
+2
-2
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/LoginComponent.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/SwitchServerComponent.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/WelcomeComponent.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/contract/LoginInterfaceImpl.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/BaseLoginPresenter.java
+1
-7
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/LoginPresenter.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
+72
-50
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/LoginOutActivity.java
+1
-2
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/SwitchServerActivity.java
+1
-1
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+1
-1
user-login/src/main/res/layout/user_login_activity_login.xml
+64
-76
user-login/src/main/res/values/colors.xml
+1
-0
user-login/src/main/res/values/styles.xml
+15
-0
No files found.
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/WeatherRepository.kt
View file @
0715edf7
package
com.gingersoft.gsa.other_order_mode.data
package
com.gingersoft.gsa.other_order_mode.data
import
com.gingersoft.gsa.other_order_mode.data.model.bean.ThirdItem
import
com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import
com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import
com.google.gson.Gson
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.withContext
import
kotlinx.coroutines.withContext
import
okhttp3.FormBody
import
okhttp3.FormBody
...
@@ -21,7 +23,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
...
@@ -21,7 +23,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
heWeather
heWeather
}
}
suspend
fun
updateRestOpenStatus
(
state
:
Boolean
,
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
suspend
fun
updateRestOpenStatus
(
state
:
Boolean
,
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restId"
,
restaurantId
)
.
add
(
"restId"
,
restaurantId
)
.
add
(
"openStatus"
,
if
(
state
)
"1"
else
"2"
)
.
add
(
"openStatus"
,
if
(
state
)
"1"
else
"2"
)
...
@@ -30,7 +32,6 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
...
@@ -30,7 +32,6 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
data
data
}
}
suspend
fun
getOrderInfo
(
orderId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
suspend
fun
getOrderInfo
(
orderId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"orderId"
,
orderId
)
.
add
(
"orderId"
,
orderId
)
...
@@ -53,6 +54,14 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
...
@@ -53,6 +54,14 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
data
data
}
}
suspend
fun
thirdDelivery
(
orderId
:
String
,
thirdItem
:
ThirdItem
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"orderId"
,
orderId
)
.
add
(
"items"
,
Gson
().
toJson
(
thirdItem
))
.
build
()
network
.
thirdDelivery
(
requestBody
)
}
suspend
fun
updateSelfOrderStatus
(
ids
:
String
,
status
:
String
,
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
suspend
fun
updateSelfOrderStatus
(
ids
:
String
,
status
:
String
,
restaurantId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"ids"
,
ids
)
.
add
(
"ids"
,
ids
)
...
@@ -64,7 +73,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
...
@@ -64,7 +73,7 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
}
}
suspend
fun
getDeliveryInfo
(
restId
:
String
,
userId
:
String
)
=
withContext
(
Dispatchers
.
IO
){
suspend
fun
getDeliveryInfo
(
restId
:
String
,
userId
:
String
)
=
withContext
(
Dispatchers
.
IO
)
{
val
requestBody
=
FormBody
.
Builder
()
val
requestBody
=
FormBody
.
Builder
()
.
add
(
"restId"
,
restId
)
.
add
(
"restId"
,
restId
)
.
add
(
"userId"
,
userId
)
.
add
(
"userId"
,
userId
)
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/OrderList.kt
View file @
0715edf7
package
com.gingersoft.gsa.other_order_mode.data.model.bean
package
com.gingersoft.gsa.other_order_mode.data.model.bean
class
OrderList
{
class
OrderList
{
/**
* success : true
* sysTime : 1585282096866
* data : {"data":[{"STATUS":0,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港荔枝角青山道479號麗昌工廠大廈2樓201L室Innovation Design Consultant Ltd.1111","PAY_AMOUNT":89,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200411316057124","Id":48883,"CREATE_TIME":"Mar 27, 2020 12:07:49 PM","takeFoodCode":"0","order_type":2,"RECEIVER":"有 女士"},{"STATUS":3,"MEMBER_NAME":"你好哦","ADDRESS_DETAIL":"香港長沙灣青山道479號麗昌工業大廈303","PAY_AMOUNT":128,"PHONE":"13554770615","orderPayType":1,"ORDER_NO":"26202501369354194","Id":48880,"CREATE_TIME":"Mar 27, 2020 11:43:53 AM","takeFoodCode":"0055","order_type":2,"RECEIVER":"劉先生 先生"},{"STATUS":2,"MEMBER_NAME":"你好哦","ADDRESS_DETAIL":"美國紐約州紐約123123","PAY_AMOUNT":128,"PHONE":"13554770615","orderPayType":1,"ORDER_NO":"26200341332451819","Id":48879,"CREATE_TIME":"Mar 27, 2020 11:39:08 AM","takeFoodCode":"0","order_type":2,"RECEIVER":"asdfasdf 先生"},{"STATUS":3,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港禮頓山禮頓道8號8號 59864香港銅鑼灣皇冠假日酒店一","PAY_AMOUNT":384,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200681397655588","Id":48875,"CREATE_TIME":"Mar 27, 2020 11:33:19 AM","takeFoodCode":"0052","order_type":2,"RECEIVER":"說 先生"},{"STATUS":2,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港半山堅尼地道28號香港特別行政區前任行政長官辦公室111","PAY_AMOUNT":228,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200031363851774","Id":48874,"CREATE_TIME":"Mar 27, 2020 11:33:01 AM","takeFoodCode":"0051","order_type":2,"RECEIVER":"特別 女士"},{"STATUS":3,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港鵝頸駱克道463-464號銅鑼灣廣場二期123","PAY_AMOUNT":128,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26201261317059894","Id":48873,"CREATE_TIME":"Mar 27, 2020 11:31:37 AM","takeFoodCode":"0050","order_type":2,"RECEIVER":"杜 先生"},{"STATUS":2,"MEMBER_NAME":"許立燦","ADDRESS_DETAIL":"香港島大坑電腦大廈","PAY_AMOUNT":78,"PHONE":"18938995556","orderPayType":2,"ORDER_NO":"26202381350555250","Id":48866,"CREATE_TIME":"Mar 27, 2020 10:53:45 AM","takeFoodCode":"0046","order_type":2,"RECEIVER":"許 先生"},{"STATUS":2,"MEMBER_NAME":"許立燦","ADDRESS_DETAIL":"香港島中環餐飲服務公司","PAY_AMOUNT":88,"PHONE":"18938995556","orderPayType":2,"ORDER_NO":"26201801340350065","Id":48854,"CREATE_TIME":"Mar 27, 2020 10:44:41 AM","takeFoodCode":"0045","order_type":2,"RECEIVER":"12345 先生"},{"MaxOrder":200,"selflNum":35,"totalAmount":78,"maxOrderSelf":100,"num":111,"dayOrderNum":1,"Open_Status":"1"}],"count":0,"page":{"pageIndex":1,"pageSize":10,"pageCount":0,"totalCount":8}}
*/
private
var
success
:
Boolean
=
false
private
var
success
:
Boolean
=
false
private
var
sysTime
:
Long
=
0
private
var
sysTime
:
Long
=
0
private
var
data
:
DataBeanX
?
=
null
private
var
data
:
DataBeanX
?
=
null
class
DataBeanX
{
class
DataBeanX
{
/**
* data : [{"STATUS":0,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港荔枝角青山道479號麗昌工廠大廈2樓201L室Innovation Design Consultant Ltd.1111","PAY_AMOUNT":89,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200411316057124","Id":48883,"CREATE_TIME":"Mar 27, 2020 12:07:49 PM","takeFoodCode":"0","order_type":2,"RECEIVER":"有 女士"},{"STATUS":3,"MEMBER_NAME":"你好哦","ADDRESS_DETAIL":"香港長沙灣青山道479號麗昌工業大廈303","PAY_AMOUNT":128,"PHONE":"13554770615","orderPayType":1,"ORDER_NO":"26202501369354194","Id":48880,"CREATE_TIME":"Mar 27, 2020 11:43:53 AM","takeFoodCode":"0055","order_type":2,"RECEIVER":"劉先生 先生"},{"STATUS":2,"MEMBER_NAME":"你好哦","ADDRESS_DETAIL":"美國紐約州紐約123123","PAY_AMOUNT":128,"PHONE":"13554770615","orderPayType":1,"ORDER_NO":"26200341332451819","Id":48879,"CREATE_TIME":"Mar 27, 2020 11:39:08 AM","takeFoodCode":"0","order_type":2,"RECEIVER":"asdfasdf 先生"},{"STATUS":3,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港禮頓山禮頓道8號8號 59864香港銅鑼灣皇冠假日酒店一","PAY_AMOUNT":384,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200681397655588","Id":48875,"CREATE_TIME":"Mar 27, 2020 11:33:19 AM","takeFoodCode":"0052","order_type":2,"RECEIVER":"說 先生"},{"STATUS":2,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港半山堅尼地道28號香港特別行政區前任行政長官辦公室111","PAY_AMOUNT":228,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26200031363851774","Id":48874,"CREATE_TIME":"Mar 27, 2020 11:33:01 AM","takeFoodCode":"0051","order_type":2,"RECEIVER":"特別 女士"},{"STATUS":3,"MEMBER_NAME":"觉得很多很多","ADDRESS_DETAIL":"香港鵝頸駱克道463-464號銅鑼灣廣場二期123","PAY_AMOUNT":128,"PHONE":"15899876018","orderPayType":1,"ORDER_NO":"26201261317059894","Id":48873,"CREATE_TIME":"Mar 27, 2020 11:31:37 AM","takeFoodCode":"0050","order_type":2,"RECEIVER":"杜 先生"},{"STATUS":2,"MEMBER_NAME":"許立燦","ADDRESS_DETAIL":"香港島大坑電腦大廈","PAY_AMOUNT":78,"PHONE":"18938995556","orderPayType":2,"ORDER_NO":"26202381350555250","Id":48866,"CREATE_TIME":"Mar 27, 2020 10:53:45 AM","takeFoodCode":"0046","order_type":2,"RECEIVER":"許 先生"},{"STATUS":2,"MEMBER_NAME":"許立燦","ADDRESS_DETAIL":"香港島中環餐飲服務公司","PAY_AMOUNT":88,"PHONE":"18938995556","orderPayType":2,"ORDER_NO":"26201801340350065","Id":48854,"CREATE_TIME":"Mar 27, 2020 10:44:41 AM","takeFoodCode":"0045","order_type":2,"RECEIVER":"12345 先生"},{"MaxOrder":200,"selflNum":35,"totalAmount":78,"maxOrderSelf":100,"num":111,"dayOrderNum":1,"Open_Status":"1"}]
* count : 0
* page : {"pageIndex":1,"pageSize":10,"pageCount":0,"totalCount":8}
*/
var
count
:
Int
=
0
var
count
:
Int
=
0
var
page
:
PageBean
?
=
null
var
page
:
PageBean
?
=
null
...
@@ -58,7 +49,12 @@ class OrderList {
...
@@ -58,7 +49,12 @@ class OrderList {
* dayOrderNum : 1
* dayOrderNum : 1
* Open_Status : 1
* Open_Status : 1
*/
*/
var
delivery_man_phone_num
:
String
?
=
null
var
delivery_man_name
:
String
?
=
null
var
curStat
:
String
?
=
null
var
deliveryMode
:
String
?
=
null
var
trkNo
:
String
?
=
null
var
isDelete
:
Int
=
0
var
STATUS
:
Int
=
0
//0,1為待確認,2為製作中,3待取餐或送貨中
var
STATUS
:
Int
=
0
//0,1為待確認,2為製作中,3待取餐或送貨中
var
MEMBER_NAME
:
String
?
=
null
var
MEMBER_NAME
:
String
?
=
null
var
ADDRESS_DETAIL
:
String
?
=
null
var
ADDRESS_DETAIL
:
String
?
=
null
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/CoolWeatherNetwork.kt
View file @
0715edf7
package
com.gingersoft.gsa.other_order_mode.data.network
package
com.gingersoft.gsa.other_order_mode.data.network
import
android.util.Log
import
com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import
com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import
okhttp3.RequestBody
import
okhttp3.RequestBody
import
retrofit2.Call
import
retrofit2.Call
...
@@ -16,6 +15,8 @@ class CoolWeatherNetwork {
...
@@ -16,6 +15,8 @@ class CoolWeatherNetwork {
private
val
service
=
ServiceCreator
.
create2
(
WeatherService
::
class
.
java
)
private
val
service
=
ServiceCreator
.
create2
(
WeatherService
::
class
.
java
)
private
val
gsposService
=
ServiceCreator
.
create3
(
WeatherService
::
class
.
java
)
suspend
fun
fetchOrderList
(
requestBody
:
RequestBody
)
=
orderService
.
getOrderList
(
requestBody
).
await
()
suspend
fun
fetchOrderList
(
requestBody
:
RequestBody
)
=
orderService
.
getOrderList
(
requestBody
).
await
()
suspend
fun
updateRestOpenStatus
(
requestBody
:
RequestBody
)
=
service
.
updateRestOpenStatus
(
requestBody
).
await
()
suspend
fun
updateRestOpenStatus
(
requestBody
:
RequestBody
)
=
service
.
updateRestOpenStatus
(
requestBody
).
await
()
...
@@ -24,6 +25,8 @@ class CoolWeatherNetwork {
...
@@ -24,6 +25,8 @@ class CoolWeatherNetwork {
suspend
fun
updateOrderStatus
(
requestBody
:
RequestBody
)
=
orderService
.
updateOrderStatus
(
requestBody
).
await
()
suspend
fun
updateOrderStatus
(
requestBody
:
RequestBody
)
=
orderService
.
updateOrderStatus
(
requestBody
).
await
()
suspend
fun
thirdDelivery
(
requestBody
:
RequestBody
)
=
gsposService
.
thirdDelivery
(
requestBody
).
await
()
suspend
fun
updateSelfOrderStatus
(
requestBody
:
RequestBody
)
=
orderService
.
updateSelfOrderStatus
(
requestBody
).
await
()
suspend
fun
updateSelfOrderStatus
(
requestBody
:
RequestBody
)
=
orderService
.
updateSelfOrderStatus
(
requestBody
).
await
()
suspend
fun
getDeliveryInfo
(
requestBody
:
RequestBody
)
=
orderService
.
getDeliveryInfo
(
requestBody
).
await
()
suspend
fun
getDeliveryInfo
(
requestBody
:
RequestBody
)
=
orderService
.
getDeliveryInfo
(
requestBody
).
await
()
...
@@ -40,7 +43,6 @@ class CoolWeatherNetwork {
...
@@ -40,7 +43,6 @@ class CoolWeatherNetwork {
override
fun
onResponse
(
call
:
Call
<
T
>,
response
:
Response
<
T
>)
{
override
fun
onResponse
(
call
:
Call
<
T
>,
response
:
Response
<
T
>)
{
val
body
=
response
.
body
()
val
body
=
response
.
body
()
Log
.
e
(
"eee"
,
"請求地址:"
+
response
.
raw
().
request
().
url
())
if
(
body
!=
null
)
{
if
(
body
!=
null
)
{
continuation
.
resume
(
body
)
continuation
.
resume
(
body
)
}
else
continuation
.
resumeWithException
(
RuntimeException
(
"response body is null"
)
as
Throwable
)
}
else
continuation
.
resumeWithException
(
RuntimeException
(
"response body is null"
)
as
Throwable
)
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/ServiceCreator.kt
View file @
0715edf7
package
com.gingersoft.gsa.other_order_mode.data.network
package
com.gingersoft.gsa.other_order_mode.data.network
import
com.gingersoft.gsa.cloud.globalconfig.applyOptions.intercept.LoggingInterceptor
import
okhttp3.OkHttpClient
import
okhttp3.OkHttpClient
import
retrofit2.Retrofit
import
retrofit2.Retrofit
import
retrofit2.converter.gson.GsonConverterFactory
import
retrofit2.converter.gson.GsonConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
import
retrofit2.converter.scalars.ScalarsConverterFactory
object
ServiceCreator
{
object
ServiceCreator
{
private
val
httpClient
=
OkHttpClient
.
Builder
().
addInterceptor
(
LoggingInterceptor
())
private
const
val
ROOT_SZ_URL
=
"http://192.168.1.74:6060"
private
const
val
ROOT_HK_TEST_URL
=
"https://hktest.ricepon.com:64377"
private
const
val
ROOT_FORMAL_URL
=
"https://m.ricepon.com"
const
val
ROOT_URL
=
ROOT_HK_TEST_URL
private
const
val
BASE_URL
=
"$ROOT_URL/ricepon-wechat/api/"
private
const
val
BASE_URL2
=
"$ROOT_URL/member-web/api/"
private
const
val
BASE_URL3
=
"$ROOT_URL/member-web/ricepon-gsa/api/"
private
const
val
BASE_URL
=
"https://hktest.ricepon.com:64377/ricepon-wechat/api/"
private
const
val
BASE_URL2
=
"https://hktest.ricepon.com:64377/member-web/api/"
//https://hktest.ricepon.com:64377/member-web/api/wx/updateRestOpenStatus
private
val
httpClient
=
OkHttpClient
.
Builder
()
private
val
builder
=
Retrofit
.
Builder
()
private
val
builder
=
Retrofit
.
Builder
()
.
baseUrl
(
BASE_URL
)
.
baseUrl
(
BASE_URL
)
...
@@ -24,13 +32,15 @@ object ServiceCreator {
...
@@ -24,13 +32,15 @@ object ServiceCreator {
.
addConverterFactory
(
ScalarsConverterFactory
.
create
())
.
addConverterFactory
(
ScalarsConverterFactory
.
create
())
.
addConverterFactory
(
GsonConverterFactory
.
create
())
.
addConverterFactory
(
GsonConverterFactory
.
create
())
private
val
retrofit
=
builder
.
build
()
private
val
builder3
=
Retrofit
.
Builder
()
.
baseUrl
(
BASE_URL3
)
private
val
retrofit2
=
builder2
.
build
(
)
.
client
(
httpClient
.
build
()
)
.
addConverterFactory
(
ScalarsConverterFactory
.
create
())
fun
<
T
>
create
(
serviceClass
:
Class
<
T
>):
T
=
retrofit
.
create
(
serviceClass
)
.
addConverterFactory
(
GsonConverterFactory
.
create
()
)
fun
<
T
>
create
2
(
serviceClass
:
Class
<
T
>):
T
=
retrofit2
.
create
(
serviceClass
)
fun
<
T
>
create
(
serviceClass
:
Class
<
T
>):
T
=
builder
.
build
()
.
create
(
serviceClass
)
fun
<
T
>
create2
(
serviceClass
:
Class
<
T
>):
T
=
builder2
.
build
().
create
(
serviceClass
)
fun
<
T
>
create3
(
serviceClass
:
Class
<
T
>):
T
=
builder3
.
build
().
create
(
serviceClass
)
}
}
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/network/api/WeatherService.kt
View file @
0715edf7
...
@@ -21,6 +21,9 @@ interface WeatherService {
...
@@ -21,6 +21,9 @@ interface WeatherService {
@POST
(
"wechat/updateOrderStatus"
)
@POST
(
"wechat/updateOrderStatus"
)
fun
updateOrderStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
UpdateOrderBean
>
fun
updateOrderStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
UpdateOrderBean
>
@POST
(
"gsa/shipAnyOrdersNew"
)
fun
thirdDelivery
(
@Body
requestBody
:
RequestBody
):
Call
<
ThirdSend
>
@POST
(
"wechat/updateSelfOrderStatus"
)
@POST
(
"wechat/updateSelfOrderStatus"
)
fun
updateSelfOrderStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
UpdateOrderBean
>
fun
updateSelfOrderStatus
(
@Body
requestBody
:
RequestBody
):
Call
<
UpdateOrderBean
>
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
0715edf7
...
@@ -17,18 +17,32 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
...
@@ -17,18 +17,32 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
import
com.gingersoft.gsa.cloud.print.bean.OrderDetails
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
import
com.gingersoft.gsa.other_order_mode.R
import
com.gingersoft.gsa.other_order_mode.R
import
com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import
com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import
com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import
com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import
com.gingersoft.gsa.other_order_mode.data.model.bean.ThirdItem
import
com.gingersoft.gsa.other_order_mode.data.model.bean.UpdateOrderBean
import
com.gingersoft.gsa.other_order_mode.data.model.bean.UpdateOrderBean
import
com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import
com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import
com.jess.arms.utils.ArmsUtils
import
com.jess.arms.utils.ArmsUtils
import
com.zhy.autolayout.utils.ScreenUtils
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.launch
class
PageViewModel
(
private
val
repository
:
WeatherRepository
)
:
ViewModel
()
{
class
PageViewModel
(
private
val
repository
:
WeatherRepository
)
:
ViewModel
()
{
private
fun
showLoading
(
context
:
Context
,
message
:
String
?
=
null
)
{
if
(
message
!=
null
)
LoadingDialog
.
showDialogForLoading
(
context
,
message
,
true
)
else
LoadingDialog
.
showDialogForLoading
(
context
)
}
fun
cancelDialogForLoading
()
{
LoadingDialog
.
cancelDialogForLoading
()
}
companion
object
{
companion
object
{
var
fragmentStatus
=
arrayOf
(
"0,1,2,3"
,
"0,1"
,
"2"
,
"3"
,
"3"
)
var
fragmentStatus
=
arrayOf
(
"0,1,2,3"
,
"0,1"
,
"2"
,
"3"
,
"3"
)
var
fragmentType
=
arrayOf
(
"0"
,
"0"
,
"0"
,
"2"
,
"7"
)
var
fragmentType
=
arrayOf
(
"0"
,
"0"
,
"0"
,
"2"
,
"7"
)
...
@@ -49,7 +63,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -49,7 +63,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
var
deliveryBean
:
DeliveryBean
?
=
null
var
deliveryBean
:
DeliveryBean
?
=
null
/**
/**
* 獲取訂單
信息
* 獲取訂單
*/
*/
fun
getOrderList
(
context
:
Context
,
position
:
Int
,
page
:
String
,
isLoadMore
:
Boolean
,
listener
:
(
String
)
->
Unit
)
{
fun
getOrderList
(
context
:
Context
,
position
:
Int
,
page
:
String
,
isLoadMore
:
Boolean
,
listener
:
(
String
)
->
Unit
)
{
launch
({
launch
({
...
@@ -164,6 +178,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -164,6 +178,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 2 已確認,外賣是指派送單,自取是製作完成
* 2 已確認,外賣是指派送單,自取是製作完成
*/
*/
fun
updateOrderStatus
(
context
:
Context
,
data
:
OrderList
.
DataBeanX
.
DataBean
,
orderDetails
:
OrderDetails
,
listener
:
(
Boolean
)
->
Unit
)
{
fun
updateOrderStatus
(
context
:
Context
,
data
:
OrderList
.
DataBeanX
.
DataBean
,
orderDetails
:
OrderDetails
,
listener
:
(
Boolean
)
->
Unit
)
{
launch
({
launch
({
val
status
=
when
(
data
.
STATUS
)
{
val
status
=
when
(
data
.
STATUS
)
{
0
->
2
0
->
2
...
@@ -209,34 +224,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -209,34 +224,14 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
}
}.
createDialogView
().
show
()
}.
createDialogView
().
show
()
}
else
{
}
else
{
//確認訂單
showLoading
(
context
)
updateOrderStatus
(
data
.
Id
.
toString
(),
""
,
status
,
""
,
""
,
isPush
,
data
.
order_type
).
apply
{
// 確認訂單
if
(
status
==
0
||
status
==
1
||
status
==
2
)
{
val
third
=
true
//確認送單
if
(
third
)
{
if
(
this
.
success
)
{
// 如果是第三方物流,調用第三方接口
//打印
thirdSend
(
data
,
orderDetails
,
status
,
isPush
,
data
.
order_type
,
context
,
listener
)
//初始化用於打印的view
}
else
{
if
(
orderDetails
.
data
!=
null
)
{
updateOrderAndPrint
(
data
,
status
,
isPush
,
orderDetails
,
context
,
listener
)
//訂單信息和廚房單
orderDetails
.
data
!!
[
0
].
order_type
=
data
.
order_type
orderDetails
.
data
!!
[
0
].
orderPayType
=
data
.
orderPayType
MyOrderManage
.
setDataBean
(
orderDetails
.
data
!!
[
0
])
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
"type"
,
5
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
{
_
,
result
->
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
)
MyOrderManage
.
setDataBean
(
null
)
}
}
else
{
ToastUtils
.
show
(
context
,
"沒有訂單內容,打印失敗"
)
}
listener
.
invoke
(
true
)
}
else
{
ToastUtils
.
show
(
context
,
"送單失敗"
)
}
}
}
}
}
}
}
else
{
}
else
{
...
@@ -250,12 +245,67 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
...
@@ -250,12 +245,67 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
})
})
}
}
private
suspend
fun
updateOrderAndPrint
(
data
:
OrderList
.
DataBeanX
.
DataBean
,
status
:
Int
,
isPush
:
Int
,
orderDetails
:
OrderDetails
,
context
:
Context
,
listener
:
(
Boolean
)
->
Unit
)
{
updateOrderStatus
(
data
.
Id
.
toString
(),
""
,
status
,
""
,
""
,
isPush
,
data
.
order_type
).
apply
{
if
(
status
==
0
||
status
==
1
||
status
==
2
)
{
//確認送單
if
(
this
.
success
)
{
//打印
//初始化用於打印的view
if
(
orderDetails
.
data
!=
null
)
{
//訂單信息和廚房單
orderDetails
.
data
!!
[
0
].
order_type
=
data
.
order_type
orderDetails
.
data
!!
[
0
].
orderPayType
=
data
.
orderPayType
MyOrderManage
.
setDataBean
(
orderDetails
.
data
!!
[
0
])
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
"type"
,
5
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
{
_
,
result
->
Log
.
e
(
"error"
,
"是否成功打印:"
+
result
.
isSuccess
)
MyOrderManage
.
setDataBean
(
null
)
}
}
else
{
ToastUtils
.
show
(
context
,
"沒有訂單內容,打印失敗"
)
}
listener
.
invoke
(
true
)
}
else
{
ToastUtils
.
show
(
context
,
"送單失敗"
)
}
}
}
}
/**
* 第三方派送
*/
private
suspend
fun
thirdSend
(
data
:
OrderList
.
DataBeanX
.
DataBean
,
orderDetails
:
OrderDetails
,
status
:
Int
,
isPush
:
Int
,
orderType
:
Int
,
context
:
Context
,
listener
:
(
Boolean
)
->
Unit
)
{
val
third
=
ThirdItem
()
orderDetails
.
data
?.
get
(
0
)
?.
PRODUCT_NAME
?.
let
{
for
(
i
in
it
)
{
val
price
=
ThirdItem
.
ThirdItemItem
.
UntPrice
(
`val`
=
i
.
PRICE
!!
.
toDouble
())
val
thirdItem
=
if
(
i
.
PRODUCT_NAME
!=
null
)
{
ThirdItem
.
ThirdItemItem
(
name
=
i
.
PRODUCT_NAME
!!
,
qty
=
1
,
unt_price
=
price
)
}
else
{
ThirdItem
.
ThirdItemItem
(
name
=
""
,
qty
=
1
,
unt_price
=
price
)
}
third
.
add
(
thirdItem
)
}
}
repository
.
thirdDelivery
(
data
.
Id
.
toString
(),
third
).
apply
{
if
(
success
)
{
cancelDialogForLoading
()
updateOrderAndPrint
(
data
,
status
,
isPush
,
orderDetails
,
context
,
listener
)
}
else
{
ToastUtils
.
show
(
context
,
"訂單派送失敗"
)
}
}
}
suspend
fun
updateOrderStatus
(
orderId
:
String
,
selfOrderId
:
String
?,
status
:
Int
,
mobile
:
String
?,
sender
:
String
?,
isPush
:
Int
,
orderType
:
Int
):
UpdateOrderBean
{
suspend
fun
updateOrderStatus
(
orderId
:
String
,
selfOrderId
:
String
?,
status
:
Int
,
mobile
:
String
?,
sender
:
String
?,
isPush
:
Int
,
orderType
:
Int
):
UpdateOrderBean
{
return
repository
.
updateOrderStatus
(
orderId
,
selfOrderId
,
status
,
mobile
,
sender
,
isPush
,
orderType
)
return
repository
.
updateOrderStatus
(
orderId
,
selfOrderId
,
status
,
mobile
,
sender
,
isPush
,
orderType
)
}
}
/**
/**
* 選擇派送員
* 選擇派送員
*/
*/
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
View file @
0715edf7
...
@@ -7,6 +7,7 @@ import android.os.Handler
...
@@ -7,6 +7,7 @@ import android.os.Handler
import
android.os.IBinder
import
android.os.IBinder
import
android.util.Log
import
android.util.Log
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import
com.gingersoft.gsa.other_order_mode.data.network.ServiceCreator
import
com.google.gson.Gson
import
com.google.gson.Gson
import
okhttp3.*
import
okhttp3.*
import
okio.ByteString
import
okio.ByteString
...
@@ -22,7 +23,8 @@ class GetInfoUpdateService : Service() {
...
@@ -22,7 +23,8 @@ class GetInfoUpdateService : Service() {
* 心跳检测时间
* 心跳检测时间
*/
*/
private
val
HEART_BEAT_RATE
=
(
15
*
1000
).
toLong
()
//每隔15秒进行一次对长连接的心跳检测
private
val
HEART_BEAT_RATE
=
(
15
*
1000
).
toLong
()
//每隔15秒进行一次对长连接的心跳检测
private
val
WEBSOCKET_HOST_AND_PORT
=
"https://hktest.ricepon.com:64377/ricepon-websocket/js/webSocketServer"
//可替换为自己的主机名和端口号
private
val
WEBSOCKET_HOST_AND_PORT
=
"${ServiceCreator.ROOT_URL}/ricepon-websocket/js/webSocketServer"
//可替换为自己的主机名和端口号
private
var
mWebSocket
:
WebSocket
?
=
null
private
var
mWebSocket
:
WebSocket
?
=
null
var
postCallBack
:
PostCallBack
?
=
null
var
postCallBack
:
PostCallBack
?
=
null
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OtherOrderActivity.kt
View file @
0715edf7
...
@@ -80,7 +80,6 @@ class OtherOrderActivity : BaseActivity() {
...
@@ -80,7 +80,6 @@ class OtherOrderActivity : BaseActivity() {
pageViewModel
.
getDeliveryInfo
(
this
)
pageViewModel
.
getDeliveryInfo
(
this
)
}
}
/**
/**
* 加載餐廳營業信息
* 加載餐廳營業信息
*/
*/
...
@@ -192,7 +191,6 @@ class OtherOrderActivity : BaseActivity() {
...
@@ -192,7 +191,6 @@ class OtherOrderActivity : BaseActivity() {
}
}
}
}
})
})
}
}
override
fun
onServiceDisconnected
(
name
:
ComponentName
)
{
override
fun
onServiceDisconnected
(
name
:
ComponentName
)
{
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/fragment/PlaceholderFragment.kt
View file @
0715edf7
...
@@ -5,7 +5,6 @@ import android.util.Log
...
@@ -5,7 +5,6 @@ import android.util.Log
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.MutableLiveData
import
androidx.lifecycle.Observer
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelProvider
...
@@ -16,8 +15,6 @@ import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
...
@@ -16,8 +15,6 @@ import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
import
com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import
com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import
com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import
com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import
com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import
com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import
com.scwang.smartrefresh.layout.header.BezierRadarHeader
import
com.scwang.smartrefresh.layout.header.FalsifyHeader
import
kotlinx.android.synthetic.main.fragment_other_order.*
import
kotlinx.android.synthetic.main.fragment_other_order.*
/**
/**
...
@@ -76,7 +73,6 @@ class PlaceholderFragment : BaseFragment() {
...
@@ -76,7 +73,6 @@ class PlaceholderFragment : BaseFragment() {
}
}
// 綁定當前fragment的數據項
// 綁定當前fragment的數據項
pageViewModel
.
mOrderList
[
arguments
?.
getInt
(
INDEX
)
!!
].
observe
(
viewLifecycleOwner
,
Observer
{
pageViewModel
.
mOrderList
[
arguments
?.
getInt
(
INDEX
)
!!
].
observe
(
viewLifecycleOwner
,
Observer
{
Log
.
e
(
"eee"
,
"刷新數據"
)
it
.
let
{
adapter
.
setData
(
it
)
}
it
.
let
{
adapter
.
setData
(
it
)
}
})
})
...
@@ -123,4 +119,5 @@ class PlaceholderFragment : BaseFragment() {
...
@@ -123,4 +119,5 @@ class PlaceholderFragment : BaseFragment() {
}
}
}
}
}
}
}
}
\ No newline at end of file
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
View file @
0715edf7
...
@@ -80,6 +80,8 @@
...
@@ -80,6 +80,8 @@
android:id=
"@+id/cl_order_info"
android:id=
"@+id/cl_order_info"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<TextView
<TextView
...
@@ -97,10 +99,10 @@
...
@@ -97,10 +99,10 @@
android:id=
"@+id/tv_total_amount"
android:id=
"@+id/tv_total_amount"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"@{@string/amount_unit + MoneyUtil.sub(total_amount, data.discount_amount)}"
android:text=
"@{@string/amount_unit + MoneyUtil.sub(total_amount, data.discount_amount)}"
android:textColor=
"#BE1C42"
android:textColor=
"#BE1C42"
android:textSize=
"@dimen/dp_24"
android:textSize=
"@dimen/dp_24"
android:layout_marginTop=
"@dimen/dp_5"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_total_amount_text"
/>
app:layout_constraintTop_toBottomOf=
"@id/tv_total_amount_text"
/>
...
@@ -145,7 +147,6 @@
...
@@ -145,7 +147,6 @@
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_8"
android:gravity=
"right"
android:gravity=
"right"
android:text=
"收貨人:"
android:text=
"收貨人:"
android:visibility=
"@{isSelf?View.GONE:View.VISIBLE}"
android:visibility=
"@{isSelf?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
...
@@ -157,7 +158,6 @@
...
@@ -157,7 +158,6 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:gravity=
"right"
android:gravity=
"right"
android:text=
"@{data.rECEIVER}"
android:text=
"@{data.rECEIVER}"
android:visibility=
"@{isSelf?View.GONE:View.VISIBLE}"
android:visibility=
"@{isSelf?View.GONE:View.VISIBLE}"
...
@@ -172,7 +172,6 @@
...
@@ -172,7 +172,6 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"@{isSelf?@string/reserved_telephone:@string/receiving_telephone}"
android:text=
"@{isSelf?@string/reserved_telephone:@string/receiving_telephone}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
...
@@ -184,7 +183,6 @@
...
@@ -184,7 +183,6 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:gravity=
"right"
android:gravity=
"right"
android:text=
"@{data.pHONE}"
android:text=
"@{data.pHONE}"
app:layout_constraintLeft_toRightOf=
"@id/tv_receive_phone_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_receive_phone_text"
...
@@ -198,7 +196,6 @@
...
@@ -198,7 +196,6 @@
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"right"
android:gravity=
"right"
android:text=
"@{isSelf?@string/self_taking_time:@string/receiving_time}"
android:text=
"@{isSelf?@string/self_taking_time:@string/receiving_time}"
...
@@ -241,13 +238,91 @@
...
@@ -241,13 +238,91 @@
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_receive_address_text"
/>
app:layout_constraintTop_toTopOf=
"@id/tv_receive_address_text"
/>
<TextView
android:id=
"@+id/tv_delivery_man_name_text"
style=
"@style/otherOrderReceiving_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"right"
android:text=
"@string/deliveryman"
android:visibility=
"@{data.delivery_man_name==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_receive_address_text"
/>
<TextView
android:id=
"@+id/tv_delivery_man_name"
style=
"@style/otherOrderReceiving_information_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:text=
"@{data.delivery_man_name}"
android:visibility=
"@{data.delivery_man_name==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toRightOf=
"@id/tv_delivery_man_name_text"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_delivery_man_name_text"
/>
<TextView
android:id=
"@+id/tv_delivery_man_phone_text"
style=
"@style/otherOrderReceiving_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"right"
android:text=
"@string/deliveryman_phone"
android:visibility=
"@{data.delivery_man_phone_num==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_delivery_man_name_text"
/>
<TextView
android:id=
"@+id/tv_delivery_man_phone"
style=
"@style/otherOrderReceiving_information_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:text=
"@{data.delivery_man_phone_num}"
android:visibility=
"@{data.delivery_man_phone_num==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toRightOf=
"@id/tv_delivery_man_phone_text"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_delivery_man_phone_text"
/>
<TextView
android:id=
"@+id/tv_delivery_num_text"
style=
"@style/otherOrderReceiving_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:layout_marginTop=
"@dimen/dp_10"
android:gravity=
"right"
android:text=
"@string/logistics_number"
android:visibility=
"@{data.trkNo==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_delivery_man_phone_text"
/>
<TextView
android:id=
"@+id/tv_delivery_num"
style=
"@style/otherOrderReceiving_information_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/other_order_info_dialog_content_marginRight"
android:gravity=
"right"
android:text=
"@{data.trkNo}"
android:visibility=
"@{data.trkNo==null?View.GONE:View.VISIBLE}"
app:layout_constraintLeft_toRightOf=
"@id/tv_delivery_num_text"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_delivery_num_text"
/>
<View
<View
android:id=
"@+id/line_info_bottom"
android:id=
"@+id/line_info_bottom"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_10"
android:layout_height=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:background=
"@color/color_ef"
android:background=
"@color/color_ef"
app:layout_constraintTop_toBottomOf=
"@id/tv_
receive_address
"
/>
app:layout_constraintTop_toBottomOf=
"@id/tv_
delivery_num_text
"
/>
<TextView
<TextView
android:id=
"@+id/tv_food_details_text"
android:id=
"@+id/tv_food_details_text"
...
...
other_order_mode/src/main/res/values/strings.xml
View file @
0715edf7
...
@@ -37,5 +37,7 @@
...
@@ -37,5 +37,7 @@
<string
name=
"ricepon_order"
>
ricepon訂單
</string>
<string
name=
"ricepon_order"
>
ricepon訂單
</string>
<string
name=
"order_no"
>
訂單編號:
</string>
<string
name=
"order_no"
>
訂單編號:
</string>
<string
name=
"deliveryman"
>
送貨員:
</string>
<string
name=
"deliveryman_phone"
>
送貨員手機號:
</string>
<string
name=
"logistics_number"
>
物流號:
</string>
</resources>
</resources>
print-module/src/main/AndroidManifest.xml
View file @
0715edf7
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:theme=
"@style/print_TranslucentTheme"
/>
android:theme=
"@style/print_TranslucentTheme"
/>
<activity
android:name=
".mvp.ui.activity.PrinterListActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterListActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterAddActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterAddActivity"
/>
...
...
print-module/src/main/java/com/joe/print/mvp/model/bean/PrinterDeviceBean.java
deleted
100644 → 0
View file @
2da52ed5
//package com.joe.print.mvp.model.bean;
//
//import java.io.Serializable;
//
///**
// * Created by Wyh on 2020/1/16.
// * 打印機實體類
// */
//public class PrinterDeviceBean implements Serializable {
// private int id; //這個類是用來“新增”打印機的,不能有id。解析打印機列表用另一個類
//// private int uid;
// private int restaurantId;
// private String ip;
// private int port;
// private int type;
//// private long createTime;
//
// public PrinterDeviceBean() {
// }
//
// public PrinterDeviceBean(int id, int restaurantId, String ip, int port, int type) {
// this.id = id;
// this.restaurantId = restaurantId;
// this.ip = ip;
// this.port = port;
// this.type = type;
// }
//
// public PrinterDeviceBean(int restaurantId, String ip, int port, int type) {
// this.restaurantId = restaurantId;
// this.ip = ip;
// this.port = port;
// this.type = type;
// }
//
// public int getRestaurantId() {
// return restaurantId;
// }
//
// public void setRestaurantId(int restaurantId) {
// this.restaurantId = restaurantId;
// }
//
// public String getIp() {
// return ip;
// }
//
// public void setIp(String ip) {
// this.ip = ip;
// }
//
// public int getPort() {
// return port;
// }
//
// public void setPort(int port) {
// this.port = port;
// }
//
// public int getType() {
// return type;
// }
//
// public void setType(int type) {
// this.type = type;
// }
//
// public int getId() {
// return id;
// }
//
// public void setId(int id) {
// this.id = id;
// }
//
//// public int getUid() {
//// return uid;
//// }
////
//// public void setUid(int uid) {
//// this.uid = uid;
//// }
////
//// public long getCreateTime() {
//// return createTime;
//// }
////
//// public void setCreateTime(long createTime) {
//// this.createTime = createTime;
//// }
//}
print-module/src/main/java/com/joe/print/mvp/presenter/PrinterAddPresenter.java
View file @
0715edf7
...
@@ -12,6 +12,8 @@ import com.jess.arms.mvp.BasePresenter;
...
@@ -12,6 +12,8 @@ import com.jess.arms.mvp.BasePresenter;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.joe.print.mvp.contract.PrinterAddContract
;
import
com.joe.print.mvp.contract.PrinterAddContract
;
import
java.util.Objects
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
@@ -87,7 +89,7 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
...
@@ -87,7 +89,7 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
* 更新打印機信息
* 更新打印機信息
*/
*/
public
void
updatePrinterInfo
(
PrinterDeviceBean
deviceBean
)
{
public
void
updatePrinterInfo
(
PrinterDeviceBean
deviceBean
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
JsonUtils
.
toJson
(
deviceBean
));
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
Objects
.
requireNonNull
(
JsonUtils
.
toJson
(
deviceBean
)
));
mModel
.
updatePrinter
(
requestBody
)
mModel
.
updatePrinter
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
""
))
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
""
))
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
View file @
0715edf7
...
@@ -333,7 +333,8 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
...
@@ -333,7 +333,8 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
}
}
private
void
defaultPrint
(
List
<
PrinterDeviceBean
>
printerDeviceBeans
,
List
<
Bitmap
>
bitmaps
)
{
private
void
defaultPrint
(
List
<
PrinterDeviceBean
>
printerDeviceBeans
,
List
<
Bitmap
>
bitmaps
)
{
if
(
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
""
),
""
))
{
String
deftultPrint
=
(
String
)
SPUtils
.
get
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
""
);
if
(
deftultPrint
.
equals
(
""
))
{
// 如果沒有默認打印位置,彈出彈窗讓用戶選擇是本機打印還是ip打印
// 如果沒有默認打印位置,彈出彈窗讓用戶選擇是本機打印還是ip打印
new
DialogUtils
(
mContext
,
R
.
layout
.
print_dialog_select_device
)
{
new
DialogUtils
(
mContext
,
R
.
layout
.
print_dialog_select_device
)
{
@Override
@Override
...
@@ -369,7 +370,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
...
@@ -369,7 +370,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
});
});
}
}
}.
createDialogView
().
show
();
}.
createDialogView
().
show
();
}
else
if
(
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
""
),
Constans
.
LOCAL_PRINT
))
{
}
else
if
(
deftultPrint
.
equals
(
Constans
.
LOCAL_PRINT
))
{
// 默認打印方式為本地,進行本地打印
// 默認打印方式為本地,進行本地打印
locationPrint
(
bitmaps
,
new
PrintListener
()
{
locationPrint
(
bitmaps
,
new
PrintListener
()
{
@Override
@Override
...
@@ -387,7 +388,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
...
@@ -387,7 +388,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
setPrintState
(
PrintActivity
.
FINISH
);
setPrintState
(
PrintActivity
.
FINISH
);
}
}
});
});
}
else
if
(
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
""
),
Constans
.
IP_PRINT
))
{
}
else
if
(
deftultPrint
.
equals
(
Constans
.
IP_PRINT
))
{
// 默認打印方式為ip打印,調用ip打印方法
// 默認打印方式為ip打印,調用ip打印方法
// 獲取默認ip打印機,
// 獲取默認ip打印機,
if
(!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
""
),
""
))
{
if
(!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
""
),
""
))
{
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintActivity.java
View file @
0715edf7
...
@@ -67,6 +67,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -67,6 +67,7 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
public
final
static
int
FINISH
=
1003
;
//關閉頁面
public
final
static
int
FINISH
=
1003
;
//關閉頁面
public
final
static
int
ADD_PRINT_DEVICE
=
1004
;
//添加打印機
public
final
static
int
ADD_PRINT_DEVICE
=
1004
;
//添加打印機
private
static
List
<
PrinterDeviceBean
>
printerDeviceBeans
;
private
String
callId
;
private
String
callId
;
private
PrinterRoot
printerInIt
;
private
PrinterRoot
printerInIt
;
...
@@ -106,17 +107,19 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -106,17 +107,19 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
initDialog
();
initDialog
();
PrinterDeviceBean
deviceBean
=
(
PrinterDeviceBean
)
getIntent
().
getSerializableExtra
(
"deviceBean"
);
PrinterDeviceBean
deviceBean
=
(
PrinterDeviceBean
)
getIntent
().
getSerializableExtra
(
"deviceBean"
);
// if (type != PrinterRoot.PRINT_TEST) {
// if (type != PrinterRoot.PRINT_TEST) {
//不是测试才去获取打印机列表,获取到打印机列表之后就进行打印
//不是测试才去获取打印机列表,获取到打印机列表之后就进行打印
mPresenter
.
getPrinterList
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
mPresenter
.
getPrinterList
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
// }
// }
printerInIt
=
PrinterRoot
.
getPrinterByType
(
type
);
printerInIt
=
PrinterRoot
.
getPrinterByType
(
type
);
if
(
printerInIt
!=
null
)
{
if
(
printerInIt
!=
null
)
{
printerInIt
.
setmContext
(
mContext
).
setPrintListener
(
this
);
printerInIt
.
setmContext
(
mContext
).
setPrintListener
(
this
);
}
}
printerInIt
.
print
(
printerDeviceBeans
);
// if (type == PrinterRoot.PRINT_TEST) {
// if (type == PrinterRoot.PRINT_TEST) {
// if (deviceBean != null) {
// if (deviceBean != null) {
// printerInIt.ipDevicePrint(deviceBean, printerInIt.getPrintBitmap(mContext).get(""));
// printerInIt.ipDevicePrint(deviceBean, printerInIt.getPrintBitmap(mContext).get(""));
...
@@ -294,12 +297,12 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
...
@@ -294,12 +297,12 @@ public class PrintActivity extends BaseActivity<PrintPresenter> implements Print
@Override
@Override
public
void
showPrinterList
(
List
<
PrinterDeviceBean
>
deviceBeans
)
{
public
void
showPrinterList
(
List
<
PrinterDeviceBean
>
deviceBeans
)
{
if
(
deviceBeans
!=
null
&&
deviceBeans
.
size
()
>
0
)
{
//
if (deviceBeans != null && deviceBeans.size() > 0) {
printerInIt
.
print
(
deviceBeans
)
;
printerDeviceBeans
=
deviceBeans
;
}
else
{
//
} else {
//沒有配置打印機
//
//沒有配置打印機
addPrintDevice
();
//
addPrintDevice();
}
//
}
}
}
private
void
addPrintDevice
()
{
private
void
addPrintDevice
()
{
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
View file @
0715edf7
...
@@ -7,6 +7,7 @@ import android.text.Editable;
...
@@ -7,6 +7,7 @@ import android.text.Editable;
import
android.text.TextWatcher
;
import
android.text.TextWatcher
;
import
android.view.View
;
import
android.view.View
;
import
android.view.inputmethod.InputMethodManager
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.RadioGroup
;
import
android.widget.RadioGroup
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -55,7 +56,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
...
@@ -55,7 +56,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
TextView
printTest
;
TextView
printTest
;
@BindView
(
R2
.
id
.
printer_type
)
@BindView
(
R2
.
id
.
printer_type
)
RadioGroup
rgPaperType
;
RadioGroup
rgPaperType
;
@BindView
(
R2
.
id
.
cb_set_default
)
CheckBox
mCbDefalute
;
private
PrinterDeviceBean
printerDeviceBean
;
private
PrinterDeviceBean
printerDeviceBean
;
private
boolean
isEditPrinter
=
false
;
//是否是編輯打印機
private
boolean
isEditPrinter
=
false
;
//是否是編輯打印機
...
@@ -79,15 +81,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
...
@@ -79,15 +81,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
isDefault
=
getIntent
().
getBooleanExtra
(
"isDefault"
,
false
);
isDefault
=
getIntent
().
getBooleanExtra
(
"isDefault"
,
false
);
// etPort.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
String
[]
ips
=
new
String
[
4
];
String
[]
ips
=
new
String
[
4
];
// if (BuildConfig.DEBUG) {
// ips[0] = "192";
// ips[1] = "168";
// ips[2] = "1";
// ips[3] = "240";
// }
//如果不為空,則是編輯打印機,初始化信息
//如果不為空,則是編輯打印機,初始化信息
if
(
printerDeviceBean
!=
null
)
{
if
(
printerDeviceBean
!=
null
)
{
mEdPrintName
.
setText
(
String
.
valueOf
(
printerDeviceBean
.
getName
()));
mEdPrintName
.
setText
(
String
.
valueOf
(
printerDeviceBean
.
getName
()));
...
@@ -206,7 +200,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
...
@@ -206,7 +200,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
else
{
}
else
{
deviceBean
=
new
PrinterDeviceBean
(
mEdPrintName
.
getText
().
toString
().
trim
(),
0
,
GsaCloudApplication
.
getRestaurantId
(
mContext
),
ipAddress
.
substring
(
0
,
ipAddress
.
lastIndexOf
(
"."
)),
Integer
.
parseInt
(
port
),
paperType
);
deviceBean
=
new
PrinterDeviceBean
(
mEdPrintName
.
getText
().
toString
().
trim
(),
0
,
GsaCloudApplication
.
getRestaurantId
(
mContext
),
ipAddress
.
substring
(
0
,
ipAddress
.
lastIndexOf
(
"."
)),
Integer
.
parseInt
(
port
),
paperType
);
}
}
deviceBean
.
setStatus
(
mCbDefalute
.
isChecked
()
?
2
:
1
);
//添加打印機
//添加打印機
if
(
v
.
getId
()
==
R
.
id
.
printer_add
)
{
if
(
v
.
getId
()
==
R
.
id
.
printer_add
)
{
if
(
isEditPrinter
&&
printerDeviceBean
!=
null
)
{
if
(
isEditPrinter
&&
printerDeviceBean
!=
null
)
{
...
...
print-module/src/main/java/com/joe/print/mvp/ui/adapter/PrinterListAdapter.java
View file @
0715edf7
package
com
.
joe
.
print
.
mvp
.
ui
.
adapter
;
package
com
.
joe
.
print
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.content.Context
;
import
android.view.View
;
import
android.widget.RadioButton
;
import
android.widget.RadioButton
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -29,35 +30,35 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
...
@@ -29,35 +30,35 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
public
PrinterListAdapter
(
@Nullable
List
<
PrinterDeviceBean
>
data
,
Context
mContext
)
{
public
PrinterListAdapter
(
@Nullable
List
<
PrinterDeviceBean
>
data
,
Context
mContext
)
{
super
(
R
.
layout
.
printer_item
,
data
);
super
(
R
.
layout
.
printer_item
,
data
);
this
.
mContext
=
mContext
;
this
.
mContext
=
mContext
;
selectPrintIp
=
(
String
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_IP
,
""
);
//
selectPrintIp = (String) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_IP, "");
if
((
Integer
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PORT
,
-
1
)
!=
-
1
)
{
//
if ((Integer) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_PORT, -1) != -1) {
selectPrintPort
=
(
int
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PORT
,
0
);
//
selectPrintPort = (int) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_PORT, 0);
}
//
}
paperType
=
(
int
)
SPUtils
.
get
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_PAPER
,
0
);
//
paperType = (int) SPUtils.get(mContext, PrintConstans.DEFAULT_PRINT_PAPER, 0);
}
}
@Override
@Override
protected
void
convert
(
BaseViewHolder
helper
,
PrinterDeviceBean
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
PrinterDeviceBean
item
)
{
if
(
selectPosition
==
-
1
)
{
//
if (selectPosition == -1) {
//ip、端口、紙張類型也要一致才是默認打印機
//
//ip、端口、紙張類型也要一致才是默認打印機
if
(
selectPrintIp
.
equals
(
item
.
getIp
())
&&
paperType
==
item
.
getType
())
{
//
if (selectPrintIp.equals(item.getIp()) && paperType == item.getType()) {
if
(
selectPrintPort
!=
null
&&
item
.
getPort
()
!=
null
)
{
//
if (selectPrintPort != null && item.getPort() != null) {
if
(
selectPrintPort
.
equals
(
item
.
getPort
()))
{
//
if (selectPrintPort.equals(item.getPort())) {
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
true
);
//
((RadioButton) helper.getView(R.id.cb_printer_item)).setChecked(true);
selectPosition
=
helper
.
getAdapterPosition
();
//
selectPosition = helper.getAdapterPosition();
}
//
}
}
else
if
(
selectPrintPort
==
null
&&
item
.
getPort
()
==
null
)
{
//
} else if (selectPrintPort == null && item.getPort() == null) {
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
true
);
//
((RadioButton) helper.getView(R.id.cb_printer_item)).setChecked(true);
selectPosition
=
helper
.
getAdapterPosition
();
//
selectPosition = helper.getAdapterPosition();
}
//
}
}
else
{
//
} else {
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
false
);
//
((RadioButton) helper.getView(R.id.cb_printer_item)).setChecked(false);
}
//
}
}
else
if
(
selectPosition
==
helper
.
getAdapterPosition
())
{
//
} else if (selectPosition == helper.getAdapterPosition()) {
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
true
);
//
((RadioButton) helper.getView(R.id.cb_printer_item)).setChecked(true);
}
else
{
//
} else {
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
false
);
//
((RadioButton) helper.getView(R.id.cb_printer_item)).setChecked(false);
}
//
}
helper
.
setText
(
R
.
id
.
tv_printer_name
,
item
.
getName
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_printer_name
,
item
.
getName
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_printer_ip
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_ip
),
item
.
getIp
()));
helper
.
setText
(
R
.
id
.
tv_printer_ip
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_ip
),
item
.
getIp
()));
...
@@ -66,6 +67,8 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
...
@@ -66,6 +67,8 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
}
else
{
}
else
{
helper
.
setText
(
R
.
id
.
tv_printer_port
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_port
),
item
.
getPort
()
+
""
));
helper
.
setText
(
R
.
id
.
tv_printer_port
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_port
),
item
.
getPort
()
+
""
));
}
}
((
RadioButton
)
helper
.
getView
(
R
.
id
.
cb_printer_item
)).
setChecked
(
item
.
getStatus
()
==
2
);
helper
.
getView
(
R
.
id
.
tv_default_print
).
setVisibility
(
item
.
getStatus
()
==
2
?
View
.
VISIBLE
:
View
.
GONE
);
// helper.setOnCheckedChangeListener(R.id.cb_printer_item, (buttonView, isChecked) -> {
// helper.setOnCheckedChangeListener(R.id.cb_printer_item, (buttonView, isChecked) -> {
// if (getRecyclerView() != null) {
// if (getRecyclerView() != null) {
// if (getRecyclerView().isComputingLayout()) {//如果recyclerView在刷新時
// if (getRecyclerView().isComputingLayout()) {//如果recyclerView在刷新時
...
@@ -75,15 +78,16 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
...
@@ -75,15 +78,16 @@ public class PrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean, Base
// }
// }
// }
// }
// });
// });
helper
.
setOnClickListener
(
R
.
id
.
cb_printer_item
,
v
->
{
if
(
getRecyclerView
()
!=
null
)
{
// helper.setOnClickListener(R.id.cb_printer_item, v -> {
if
(
getRecyclerView
().
isComputingLayout
())
{
//如果recyclerView在刷新時
// if (getRecyclerView() != null) {
getRecyclerView
().
post
(()
->
setSelectPrint
(
helper
,
item
,
true
));
// if (getRecyclerView().isComputingLayout()) {//如果recyclerView在刷新時
}
else
{
// getRecyclerView().post(() -> setSelectPrint(helper, item, true));
setSelectPrint
(
helper
,
item
,
true
);
// } else {
}
// setSelectPrint(helper, item, true);
}
// }
});
// }
// });
}
}
/**
/**
...
...
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
View file @
0715edf7
...
@@ -68,7 +68,7 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
...
@@ -68,7 +68,7 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
LOCAL_PRINT
);
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
LOCAL_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
true
);
ivSetLocationPrintBtn
.
setChecked
(
true
);
}
else
{
}
else
{
//如果默認打印方式為
本地
,修改為IP打印
//如果默認打印方式為
IP
,修改為IP打印
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
false
);
ivSetLocationPrintBtn
.
setChecked
(
false
);
}
}
...
...
print-module/src/main/res/layout/printer_activity_add.xml
View file @
0715edf7
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<com.qmuiteam.qmui.widget.QMUITopBar
<com.qmuiteam.qmui.widget.QMUITopBar
...
@@ -238,6 +239,32 @@
...
@@ -238,6 +239,32 @@
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"設為默認"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/dp_14"
android:textStyle=
"bold"
/>
<CheckBox
android:id=
"@+id/cb_set_default"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.7"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<TextView
<TextView
android:id=
"@+id/print_test"
android:id=
"@+id/print_test"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
print-module/src/main/res/layout/printer_activity_list.xml
View file @
0715edf7
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<com.qmuiteam.qmui.widget.QMUITopBar
<com.qmuiteam.qmui.widget.QMUITopBar
...
@@ -27,5 +28,4 @@
...
@@ -27,5 +28,4 @@
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/printer_item.xml
View file @
0715edf7
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
android:id=
"@+id/cb_printer_item"
android:id=
"@+id/cb_printer_item"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
...
@@ -21,11 +22,25 @@
...
@@ -21,11 +22,25 @@
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginLeft=
"@dimen/dp_10"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"asdasda"
android:textColor=
"@color/normal_color"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/dp_16"
android:textSize=
"@dimen/dp_16"
app:layout_constraintLeft_toRightOf=
"@id/cb_printer_item"
app:layout_constraintLeft_toRightOf=
"@id/cb_printer_item"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_default_print"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
android:background=
"@color/theme_color"
android:padding=
"@dimen/dp_1"
android:text=
"默認"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_10"
app:layout_constraintLeft_toRightOf=
"@id/tv_printer_name"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
<TextView
android:id=
"@+id/tv_printer_ip"
android:id=
"@+id/tv_printer_ip"
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/application/GsaCloudApplication.java
View file @
0715edf7
...
@@ -150,7 +150,7 @@ public class GsaCloudApplication extends BaseApplication {
...
@@ -150,7 +150,7 @@ public class GsaCloudApplication extends BaseApplication {
}
}
}
else
{
}
else
{
//如果當前機型不是上面兩種,那麼設置默認打印為ip打印
//如果當前機型不是上面兩種,那麼設置默認打印為ip打印
SPUtils
.
put
(
this
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
//
SPUtils.put(this, Constans.DEFAULT_PRINT_METHOD, Constans.IP_PRINT);
}
}
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
//需要單獨配置域名URL的,在接口上添加@Headers({"Domain-Name: settlement_report_server"}),不添加則是使用默認域名
setGlobalDomain
();
setGlobalDomain
();
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
View file @
0715edf7
...
@@ -27,6 +27,7 @@ public class PrinterDeviceBean implements Serializable {
...
@@ -27,6 +27,7 @@ public class PrinterDeviceBean implements Serializable {
private
Integer
port
;
//端口
private
Integer
port
;
//端口
private
int
type
;
//打印機紙張類型 為1時是58mm,否則是88mm
private
int
type
;
//打印機紙張類型 為1時是58mm,否則是88mm
private
Integer
status
;
//2為默認打印機,1為普通打印機
@Generated
(
hash
=
626885316
)
@Generated
(
hash
=
626885316
)
public
PrinterDeviceBean
()
{
public
PrinterDeviceBean
()
{
}
}
...
@@ -49,9 +50,9 @@ public class PrinterDeviceBean implements Serializable {
...
@@ -49,9 +50,9 @@ public class PrinterDeviceBean implements Serializable {
this
.
type
=
type
;
this
.
type
=
type
;
}
}
@Generated
(
hash
=
2107713534
)
@Generated
(
hash
=
422399868
)
public
PrinterDeviceBean
(
int
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
Integer
port
,
public
PrinterDeviceBean
(
int
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
Integer
port
,
int
type
)
{
int
type
,
Integer
status
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
dbid
=
dbid
;
this
.
dbid
=
dbid
;
this
.
name
=
name
;
this
.
name
=
name
;
...
@@ -59,6 +60,7 @@ public class PrinterDeviceBean implements Serializable {
...
@@ -59,6 +60,7 @@ public class PrinterDeviceBean implements Serializable {
this
.
ip
=
ip
;
this
.
ip
=
ip
;
this
.
port
=
port
;
this
.
port
=
port
;
this
.
type
=
type
;
this
.
type
=
type
;
this
.
status
=
status
;
}
}
public
String
getName
()
{
public
String
getName
()
{
...
@@ -116,4 +118,12 @@ public class PrinterDeviceBean implements Serializable {
...
@@ -116,4 +118,12 @@ public class PrinterDeviceBean implements Serializable {
public
void
setRestaurantId
(
Integer
restaurantId
)
{
public
void
setRestaurantId
(
Integer
restaurantId
)
{
this
.
restaurantId
=
restaurantId
;
this
.
restaurantId
=
restaurantId
;
}
}
public
int
getStatus
()
{
return
this
.
status
;
}
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
View file @
0715edf7
...
@@ -31,6 +31,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -31,6 +31,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
public
final
static
Property
Ip
=
new
Property
(
4
,
String
.
class
,
"ip"
,
false
,
"IP"
);
public
final
static
Property
Ip
=
new
Property
(
4
,
String
.
class
,
"ip"
,
false
,
"IP"
);
public
final
static
Property
Port
=
new
Property
(
5
,
Integer
.
class
,
"port"
,
false
,
"PORT"
);
public
final
static
Property
Port
=
new
Property
(
5
,
Integer
.
class
,
"port"
,
false
,
"PORT"
);
public
final
static
Property
Type
=
new
Property
(
6
,
int
.
class
,
"type"
,
false
,
"TYPE"
);
public
final
static
Property
Type
=
new
Property
(
6
,
int
.
class
,
"type"
,
false
,
"TYPE"
);
public
final
static
Property
Status
=
new
Property
(
7
,
Integer
.
class
,
"status"
,
false
,
"STATUS"
);
}
}
...
@@ -52,7 +53,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -52,7 +53,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
"\"RESTAURANT_ID\" INTEGER,"
+
// 3: restaurantId
"\"RESTAURANT_ID\" INTEGER,"
+
// 3: restaurantId
"\"IP\" TEXT,"
+
// 4: ip
"\"IP\" TEXT,"
+
// 4: ip
"\"PORT\" INTEGER,"
+
// 5: port
"\"PORT\" INTEGER,"
+
// 5: port
"\"TYPE\" INTEGER NOT NULL );"
);
// 6: type
"\"TYPE\" INTEGER NOT NULL ,"
+
// 6: type
"\"STATUS\" INTEGER);"
);
// 7: status
}
}
/** Drops the underlying database table. */
/** Drops the underlying database table. */
...
@@ -91,6 +93,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -91,6 +93,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
stmt
.
bindLong
(
6
,
port
);
stmt
.
bindLong
(
6
,
port
);
}
}
stmt
.
bindLong
(
7
,
entity
.
getType
());
stmt
.
bindLong
(
7
,
entity
.
getType
());
Integer
status
=
entity
.
getStatus
();
if
(
status
!=
null
)
{
stmt
.
bindLong
(
8
,
status
);
}
}
}
@Override
@Override
...
@@ -123,6 +130,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -123,6 +130,11 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
stmt
.
bindLong
(
6
,
port
);
stmt
.
bindLong
(
6
,
port
);
}
}
stmt
.
bindLong
(
7
,
entity
.
getType
());
stmt
.
bindLong
(
7
,
entity
.
getType
());
Integer
status
=
entity
.
getStatus
();
if
(
status
!=
null
)
{
stmt
.
bindLong
(
8
,
status
);
}
}
}
@Override
@Override
...
@@ -139,7 +151,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -139,7 +151,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getInt
(
offset
+
3
),
// restaurantId
cursor
.
isNull
(
offset
+
3
)
?
null
:
cursor
.
getInt
(
offset
+
3
),
// restaurantId
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
// ip
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
),
// ip
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getInt
(
offset
+
5
),
// port
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getInt
(
offset
+
5
),
// port
cursor
.
getInt
(
offset
+
6
)
// type
cursor
.
getInt
(
offset
+
6
),
// type
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getInt
(
offset
+
7
)
// status
);
);
return
entity
;
return
entity
;
}
}
...
@@ -153,6 +166,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
...
@@ -153,6 +166,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
entity
.
setIp
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
setIp
(
cursor
.
isNull
(
offset
+
4
)
?
null
:
cursor
.
getString
(
offset
+
4
));
entity
.
setPort
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getInt
(
offset
+
5
));
entity
.
setPort
(
cursor
.
isNull
(
offset
+
5
)
?
null
:
cursor
.
getInt
(
offset
+
5
));
entity
.
setType
(
cursor
.
getInt
(
offset
+
6
));
entity
.
setType
(
cursor
.
getInt
(
offset
+
6
));
entity
.
setStatus
(
cursor
.
isNull
(
offset
+
7
)
?
null
:
cursor
.
getInt
(
offset
+
7
));
}
}
@Override
@Override
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/print/bean/OrderDetails.kt
View file @
0715edf7
...
@@ -38,6 +38,10 @@ class OrderDetails {
...
@@ -38,6 +38,10 @@ class OrderDetails {
* RECEIVER : 張學友 先生
* RECEIVER : 張學友 先生
* TOTAL_AMOUNT : 88.0
* TOTAL_AMOUNT : 88.0
*/
*/
var
trkNo
:
String
?
=
null
var
delivery_man_phone_num
:
String
?
=
null
var
deliveryMode
:
String
?
=
null
var
delivery_man_name
:
String
?
=
null
var
Order_ID
:
Int
=
0
var
Order_ID
:
Int
=
0
var
NUMBER
:
Int
=
0
var
NUMBER
:
Int
=
0
var
MEMBER_NAME
:
String
?
=
null
var
MEMBER_NAME
:
String
?
=
null
...
@@ -93,7 +97,6 @@ class OrderDetails {
...
@@ -93,7 +97,6 @@ class OrderDetails {
* PRODUCT_NAME : Pho
* PRODUCT_NAME : Pho
* child : [{"odsId":"1654488","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"Pho"},{"odsId":"1654489","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"rice flour"},{"odsId":"1654490","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"Tang Meng"}]
* child : [{"odsId":"1654488","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"Pho"},{"odsId":"1654489","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"rice flour"},{"odsId":"1654490","PRICE":"0.0","num":"2","pid":"1654487","PRODUCT_NAME":"Tang Meng"}]
*/
*/
var
odsId
:
String
?
=
null
var
odsId
:
String
?
=
null
var
PRICE
:
String
?
=
null
var
PRICE
:
String
?
=
null
var
num
:
String
?
=
null
var
num
:
String
?
=
null
...
@@ -101,6 +104,7 @@ class OrderDetails {
...
@@ -101,6 +104,7 @@ class OrderDetails {
var
PRODUCT_NAME
:
String
?
=
null
var
PRODUCT_NAME
:
String
?
=
null
var
child
:
List
<
ChildBean
>?
=
null
var
child
:
List
<
ChildBean
>?
=
null
var
printseting
:
String
?
=
null
var
printseting
:
String
?
=
null
class
ChildBean
{
class
ChildBean
{
/**
/**
* odsId : 1654488
* odsId : 1654488
...
@@ -109,7 +113,6 @@ class OrderDetails {
...
@@ -109,7 +113,6 @@ class OrderDetails {
* pid : 1654487
* pid : 1654487
* PRODUCT_NAME : Pho
* PRODUCT_NAME : Pho
*/
*/
var
odsId
:
String
?
=
null
var
odsId
:
String
?
=
null
var
PRICE
:
String
?
=
null
var
PRICE
:
String
?
=
null
var
num
:
String
?
=
null
var
num
:
String
?
=
null
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/LoadingDialog.java
View file @
0715edf7
...
@@ -79,7 +79,7 @@ public class LoadingDialog {
...
@@ -79,7 +79,7 @@ public class LoadingDialog {
return
mLoadingDialog
;
return
mLoadingDialog
;
}
}
public
static
Dialog
showDialogForLoading
(
Activity
context
)
{
public
static
Dialog
showDialogForLoading
(
Context
context
)
{
View
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
ui_dialog_loading
,
null
);
View
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
ui_dialog_loading
,
null
);
TextView
loadingText
=
view
.
findViewById
(
R
.
id
.
tv_loading_dialog_text
);
TextView
loadingText
=
view
.
findViewById
(
R
.
id
.
tv_loading_dialog_text
);
loadingText
.
setText
(
context
.
getString
(
R
.
string
.
base_loading
));
loadingText
.
setText
(
context
.
getString
(
R
.
string
.
base_loading
));
...
...
public-base/src/main/res/drawable/shape_app_btn.xml
View file @
0715edf7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"@dimen/dp_
3
"
/>
<corners
android:radius=
"@dimen/dp_
8
"
/>
<solid
android:color=
"@color/theme_color"
/>
<solid
android:color=
"@color/theme_color"
/>
</shape>
</shape>
\ No newline at end of file
public-base/src/main/res/layout/print_kitchen.xml
View file @
0715edf7
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"19"
/>
android:text=
"19"
/>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
public-base/src/main/res/values/colors.xml
View file @
0715edf7
...
@@ -10,6 +10,9 @@
...
@@ -10,6 +10,9 @@
<!--App主色调-->
<!--App主色调-->
<!-- <color name="theme_color">#BF1C42</color>-->
<!-- <color name="theme_color">#BF1C42</color>-->
<color
name=
"theme_color"
>
#398BED
</color>
<color
name=
"theme_color"
>
#398BED
</color>
<color
name=
"transparent_sixty_theme_color"
>
#99398BED
</color>
<color
name=
"normal_color"
>
#333333
</color>
<color
name=
"normal_color"
>
#333333
</color>
<!-- 統一頁面背景色-->
<!-- 統一頁面背景色-->
<color
name=
"theme_bg_color"
>
#F0edf1
</color>
<color
name=
"theme_bg_color"
>
#F0edf1
</color>
...
...
user-login/src/main/AndroidManifest.xml
View file @
0715edf7
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
tools:replace=
"android:label"
>
tools:replace=
"android:label"
>
<activity
<activity
android:name=
".mvp.ui.activity.WelcomeActivity"
android:name=
".mvp.ui.activity.
mvp.ui.activity.
WelcomeActivity"
android:launchMode=
"singleTop"
>
android:launchMode=
"singleTop"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -34,9 +34,11 @@
...
@@ -34,9 +34,11 @@
</intent-filter>
</intent-filter>
</activity>
</activity>
<activity
<activity
android:name=
".mvp.ui.activity.LoginActivity"
android:name=
".mvp.ui.activity.
mvp.ui.activity.
LoginActivity"
android:launchMode=
"singleTop"
/>
android:launchMode=
"singleTop"
/>
<activity
android:name=
".mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity"
/>
<meta-data
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
...
...
user-login/src/main/debug/AndroidManifest.xml
View file @
0715edf7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.gingersoft.gsa.cloud.user.login"
>
package=
"com.gingersoft.gsa.cloud.user.login"
>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<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"
/>
<application
<application
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/user_login_name"
android:label=
"@string/user_login_name"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".mvp.ui.activity.LoginActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.LoginActivity"
/>
<activity
android:name=
"
.mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
".mvp.ui.activity
.mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
"
.mvp.ui.activity.WelcomeActivity"
>
<activity
android:name=
".mvp.ui.activity
.mvp.ui.activity.WelcomeActivity"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</intent-filter>
</activity>
</activity>
<activity
android:name=
"
.mvp.ui.activity.LoginOutActivity"
/>
<activity
android:name=
".mvp.ui.activity
.mvp.ui.activity.LoginOutActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity"
/>
<meta-data
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
android:value=
"ConfigModule"
/>
<meta-data
<meta-data
android:name=
"design_width_in_dp"
android:name=
"design_width_in_dp"
android:value=
"360"
/>
android:value=
"360"
/>
<meta-data
<meta-data
android:name=
"design_height_in_dp"
android:name=
"design_height_in_dp"
android:value=
"540"
/>
android:value=
"540"
/>
</application>
</application>
</manifest>
</manifest>
\ No newline at end of file
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/ComponentLogin.java
View file @
0715edf7
...
@@ -4,8 +4,8 @@ import com.billy.cc.core.component.CC;
...
@@ -4,8 +4,8 @@ import com.billy.cc.core.component.CC;
import
com.billy.cc.core.component.CCResult
;
import
com.billy.cc.core.component.CCResult
;
import
com.billy.cc.core.component.CCUtil
;
import
com.billy.cc.core.component.CCUtil
;
import
com.billy.cc.core.component.IComponent
;
import
com.billy.cc.core.component.IComponent
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
LoginActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.SwitchServerActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
SwitchServerActivity
;
public
class
ComponentLogin
implements
IComponent
{
public
class
ComponentLogin
implements
IComponent
{
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/LoginComponent.java
View file @
0715edf7
...
@@ -8,7 +8,7 @@ import com.gingersoft.gsa.cloud.user.login.di.module.LoginModule;
...
@@ -8,7 +8,7 @@ import com.gingersoft.gsa.cloud.user.login.di.module.LoginModule;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
LoginActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.LoginActivity
;
/**
/**
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/SwitchServerComponent.java
View file @
0715edf7
...
@@ -9,7 +9,7 @@ import com.gingersoft.gsa.cloud.user.login.di.module.SwitchServerModule;
...
@@ -9,7 +9,7 @@ import com.gingersoft.gsa.cloud.user.login.di.module.SwitchServerModule;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.SwitchServerContract
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.SwitchServerActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
SwitchServerActivity
;
/**
/**
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/di/component/WelcomeComponent.java
View file @
0715edf7
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
di
.
component
;
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
di
.
component
;
import
com.gingersoft.gsa.cloud.user.login.di.module.WelcomeModule
;
import
com.gingersoft.gsa.cloud.user.login.di.module.WelcomeModule
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.WelcomeActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
WelcomeActivity
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/contract/LoginInterfaceImpl.java
View file @
0715edf7
...
@@ -11,7 +11,7 @@ import com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean;
...
@@ -11,7 +11,7 @@ import com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.BaseLoginPresenter
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.BaseLoginPresenter
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.SwitchServerActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
SwitchServerActivity
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.base.BaseActivity
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/BaseLoginPresenter.java
View file @
0715edf7
...
@@ -5,21 +5,15 @@ import android.app.Application;
...
@@ -5,21 +5,15 @@ import android.app.Application;
import
android.content.Intent
;
import
android.content.Intent
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.BaseLoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.BaseLoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
LoginActivity
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.PermissionUtil
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
java.util.List
;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/presenter/LoginPresenter.java
View file @
0715edf7
...
@@ -5,7 +5,7 @@ import android.app.Application;
...
@@ -5,7 +5,7 @@ import android.app.Application;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.activity.
mvp.ui.activity.
LoginActivity
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.integration.AppManager
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
→
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/
mvp/ui/activity/
LoginActivity.java
View file @
0715edf7
This diff is collapsed.
Click to expand it.
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginOutActivity.java
→
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/
mvp/ui/activity/
LoginOutActivity.java
View file @
0715edf7
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
ui
.
activity
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/SwitchServerActivity.java
→
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/
mvp/ui/activity/
SwitchServerActivity.java
View file @
0715edf7
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
ui
.
activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/WelcomeActivity.java
→
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/
mvp/ui/activity/
WelcomeActivity.java
View file @
0715edf7
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
.
mvp
.
ui
.
activity
;
import
android.animation.AnimatorSet
;
import
android.animation.AnimatorSet
;
import
android.animation.ObjectAnimator
;
import
android.animation.ObjectAnimator
;
...
...
user-login/src/main/res/layout/user_login_activity_login.xml
View file @
0715edf7
...
@@ -6,7 +6,9 @@
...
@@ -6,7 +6,9 @@
android:background=
"@color/theme_white_color"
android:background=
"@color/theme_white_color"
android:clipChildren=
"true"
android:clipChildren=
"true"
android:fillViewport=
"true"
android:fillViewport=
"true"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/dp_18"
android:paddingRight=
"@dimen/dp_18"
>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -20,40 +22,33 @@
...
@@ -20,40 +22,33 @@
android:layout_marginTop=
"80dp"
android:layout_marginTop=
"80dp"
android:text=
"@string/user_login_welcome_login"
android:text=
"@string/user_login_welcome_login"
android:textColor=
"@color/user_login_title_color"
android:textColor=
"@color/user_login_title_color"
android:textSize=
"@dimen/
title_text_size
"
android:textSize=
"@dimen/
dp_26
"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<
Image
View
<
Text
View
android:id=
"@+id/
login_icon
"
android:id=
"@+id/
tv_account_text
"
android:layout_width=
"40dp
"
style=
"@style/user_login_edit_title_style
"
android:layout_
height=
"40dp
"
android:layout_
width=
"wrap_content
"
android:layout_
marginLeft=
"10dp
"
android:layout_
height=
"wrap_content
"
android:layout_marginTop=
"100dp"
android:layout_marginTop=
"100dp"
android:background=
"@color/theme_color"
android:text=
"賬戶"
android:padding=
"8dp"
android:src=
"@mipmap/ic_user"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/login_title"
/>
app:layout_constraintTop_toBottomOf=
"@id/login_title"
/>
<EditText
<
com.google.android.material.textfield.TextInput
EditText
android:id=
"@+id/ed_login_user_account"
android:id=
"@+id/ed_login_user_account"
style=
"@style/user_login_edit_style"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"
0dp
"
android:layout_height=
"
wrap_content
"
android:
background=
"@null
"
android:
layout_marginTop=
"@dimen/dp_5
"
android:hint=
"請輸入賬戶"
android:hint=
"請輸入賬戶
名或手機號
"
android:maxLength=
"16"
android:maxLength=
"16"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:singleLine=
"true"
app:layout_constraintLeft_toLeftOf=
"parent"
android:textColor=
"@color/theme_333_color"
android:textColorHint=
"@color/user_login_edit_color"
android:textSize=
"@dimen/edit_text_size"
app:layout_constraintBottom_toBottomOf=
"@id/login_icon"
app:layout_constraintLeft_toRightOf=
"@id/login_icon"
app:layout_constraintRight_toLeftOf=
"@id/iv_clear_account"
app:layout_constraintRight_toLeftOf=
"@id/iv_clear_account"
app:layout_constraintTop_to
TopOf=
"@id/login_icon
"
/>
app:layout_constraintTop_to
BottomOf=
"@id/tv_account_text
"
/>
<ImageView
<ImageView
android:id=
"@+id/iv_clear_account"
android:id=
"@+id/iv_clear_account"
...
@@ -67,46 +62,53 @@
...
@@ -67,46 +62,53 @@
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/ed_login_user_account"
/>
app:layout_constraintTop_toTopOf=
"@id/ed_login_user_account"
/>
<ImageView
<View
android:id=
"@+id/iv_login_pwd_icon"
android:id=
"@+id/line_account"
android:layout_width=
"40dp"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_height=
"@dimen/dp_0_5"
android:layout_marginLeft=
"10dp"
android:background=
"@color/user_login_line_color"
android:layout_marginTop=
"10dp"
android:background=
"@color/theme_color"
android:padding=
"8dp"
android:src=
"@mipmap/ic_pwd"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_account"
/>
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_account"
/>
<EditText
<TextView
android:id=
"@+id/tv_password_text"
style=
"@style/user_login_edit_title_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"密碼"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/line_account"
/>
<com.google.android.material.textfield.TextInputEditText
android:id=
"@+id/ed_login_user_pwd"
android:id=
"@+id/ed_login_user_pwd"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"
0dp
"
android:layout_height=
"
wrap_content
"
android:background=
"#00000000
"
style=
"@style/user_login_edit_style
"
android:
gravity=
"center_vertical
"
android:
layout_marginTop=
"@dimen/dp_5
"
android:hint=
"
請輸入密碼
"
android:hint=
"
輸入6~20個字符
"
android:inputType=
"textPassword"
android:inputType=
"textPassword"
android:maxLength=
"16"
android:maxLength=
"20"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:singleLine=
"true"
app:layout_constraintLeft_toLeftOf=
"parent"
android:textColor=
"@color/theme_333_color"
android:textColorHint=
"@color/user_login_edit_color"
android:textSize=
"@dimen/edit_text_size"
app:layout_constraintBottom_toBottomOf=
"@id/iv_login_pwd_icon"
app:layout_constraintLeft_toRightOf=
"@id/iv_login_pwd_icon"
app:layout_constraintRight_toLeftOf=
"@id/ic_look_pwd"
app:layout_constraintRight_toLeftOf=
"@id/ic_look_pwd"
app:layout_constraintTop_to
TopOf=
"@id/iv_login_pwd_icon
"
/>
app:layout_constraintTop_to
BottomOf=
"@id/tv_password_text
"
/>
<View
android:id=
"@+id/line_password"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_0_5"
android:background=
"@color/user_login_line_color"
app:layout_constraintTop_toBottomOf=
"@id/ed_login_user_pwd"
/>
<CheckBox
<CheckBox
android:id=
"@+id/rb_auto_login"
android:id=
"@+id/rb_auto_login"
android:layout_width=
"@dimen/dp_30"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_30"
android:layout_marginTop=
"@dimen/dp_15"
android:layout_marginTop=
"@dimen/dp_15"
app:layout_constraintLeft_toLeftOf=
"
@id/iv_login_pwd_icon
"
app:layout_constraintLeft_toLeftOf=
"
parent
"
app:layout_constraintTop_toBottomOf=
"@id/
ed_login_user_pw
d"
/>
app:layout_constraintTop_toBottomOf=
"@id/
line_passwor
d"
/>
<TextView
<TextView
android:id=
"@+id/tv_auto_login_text"
android:id=
"@+id/tv_auto_login_text"
...
@@ -126,9 +128,8 @@
...
@@ -126,9 +128,8 @@
android:layout_width=
"@dimen/dp_30"
android:layout_width=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_30"
android:layout_height=
"@dimen/dp_30"
android:layout_marginLeft=
"@dimen/dp_15"
android:layout_marginLeft=
"@dimen/dp_15"
android:layout_marginTop=
"@dimen/dp_15"
app:layout_constraintLeft_toRightOf=
"@id/tv_auto_login_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_auto_login_text"
app:layout_constraintTop_to
BottomOf=
"@id/ed_login_user_pwd
"
/>
app:layout_constraintTop_to
TopOf=
"@id/rb_auto_login
"
/>
<TextView
<TextView
android:id=
"@+id/tv_remember_pwd_text"
android:id=
"@+id/tv_remember_pwd_text"
...
@@ -169,40 +170,27 @@
...
@@ -169,40 +170,27 @@
android:id=
"@+id/tv_forget_pwd"
android:id=
"@+id/tv_forget_pwd"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:text=
"找回密碼"
android:text=
"忘記密碼?"
android:textColor=
"@color/color_3c"
android:textSize=
"14dp"
android:textSize=
"@dimen/dp_16"
android:visibility=
"invisible"
android:visibility=
"visible"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/rb_remember_password"
/>
app:layout_constraintBottom_toBottomOf=
"@id/rb_auto_login"
app:layout_constraintTop_toBottomOf=
"@id/rb_auto_login"
app:layout_constraintTop_toTopOf=
"@id/rb_auto_login"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/
tv
_gsa_user_login"
android:id=
"@+id/
btn
_gsa_user_login"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginBottom=
"@dimen/dp_20"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/selector_login_btn"
android:layout_marginRight=
"10dp"
android:background=
"@drawable/shape_app_btn"
android:gravity=
"center"
android:gravity=
"center"
android:padding=
"10dp"
android:text=
"登錄"
android:text=
"登錄"
android:textColor=
"#fff"
android:textColor=
"@color/white"
android:textSize=
"16dp"
android:textSize=
"@dimen/dp_16"
app:layout_constraintTop_toBottomOf=
"@id/tv_forget_pwd"
/>
app:layout_constraintBottom_toBottomOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_app_version"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_10"
android:text=
"v1.0"
android:textSize=
"@dimen/sp_16"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
user-login/src/main/res/values/colors.xml
View file @
0715edf7
...
@@ -2,4 +2,5 @@
...
@@ -2,4 +2,5 @@
<resources>
<resources>
<color
name=
"user_login_title_color"
>
@color/theme_333_color
</color>
<color
name=
"user_login_title_color"
>
@color/theme_333_color
</color>
<color
name=
"user_login_edit_color"
>
@color/theme_hint_color
</color>
<color
name=
"user_login_edit_color"
>
@color/theme_hint_color
</color>
<color
name=
"user_login_line_color"
>
#E4E4E4
</color>
</resources>
</resources>
user-login/src/main/res/values/styles.xml
View file @
0715edf7
<resources>
<resources>
<!-- 登陸頁面輸入框標題字體樣式-->
<style
name=
"user_login_edit_title_style"
>
<item
name=
"android:textSize"
>
@dimen/dp_14
</item>
<item
name=
"android:textColor"
>
@color/color_3c
</item>
</style>
<style
name=
"user_login_edit_style"
>
<item
name=
"android:textSize"
>
@dimen/dp_18
</item>
<item
name=
"android:textColor"
>
@color/theme_333_color
</item>
<item
name=
"android:textColorHint"
>
@color/user_login_edit_color
</item>
<item
name=
"android:background"
>
@null
</item>
<item
name=
"android:paddingTop"
>
@dimen/dp_8
</item>
<item
name=
"android:paddingBottom"
>
@dimen/dp_8
</item>
<item
name=
"android:maxLines"
>
1
</item>
</style>
</resources>
</resources>
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