Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MiYaFastCashier
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangjiantao
MiYaFastCashier
Commits
33bca812
Commit
33bca812
authored
Mar 18, 2022
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改完成
parent
1a5458da
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
232 additions
and
109 deletions
+232
-109
build.gradle
app/build.gradle
+1
-1
PrintService.kt
...rc/main/java/com/miya/fastcashier/service/PrintService.kt
+6
-6
PayActivity.kt
app/src/main/java/com/miya/fastcashier/ui/PayActivity.kt
+1
-11
SearchOrderActivity.kt
.../main/java/com/miya/fastcashier/ui/SearchOrderActivity.kt
+38
-9
BaseFunction.kt
app/src/main/java/com/miya/fastcashier/utils/BaseFunction.kt
+9
-1
DateSelectHelper.kt
.../main/java/com/miya/fastcashier/utils/DateSelectHelper.kt
+5
-2
PayViewModel.kt
.../main/java/com/miya/fastcashier/viewmodel/PayViewModel.kt
+8
-5
Divider.java
app/src/main/java/com/miya/fastcashier/widget/Divider.java
+4
-3
app_bg_search_order_card.xml
app/src/main/res/drawable/app_bg_search_order_card.xml
+6
-0
activity_login.xml
app/src/main/res/layout/activity_login.xml
+25
-23
activity_search_order.xml
app/src/main/res/layout/activity_search_order.xml
+0
-1
fragment_search_order.xml
app/src/main/res/layout/fragment_search_order.xml
+1
-1
item_search_order_list.xml
app/src/main/res/layout/item_search_order_list.xml
+91
-24
title.xml
app/src/main/res/layout/title.xml
+35
-22
colors.xml
app/src/main/res/values/colors.xml
+2
-0
No files found.
app/build.gradle
View file @
33bca812
...
@@ -84,6 +84,6 @@ dependencies {
...
@@ -84,6 +84,6 @@ dependencies {
implementation
'com.github.ybq:Android-SpinKit:1.4.0'
implementation
'com.github.ybq:Android-SpinKit:1.4.0'
implementation
'com.github.d-max:spots-dialog:1.1@aar'
implementation
'com.github.d-max:spots-dialog:1.1@aar'
implementation
'com.elvishew:xlog:1.10.1'
implementation
'com.elvishew:xlog:1.10.1'
i
mplementation
'com.squareup.leakcanary:leakcanary-android:2.7'
debugI
mplementation
'com.squareup.leakcanary:leakcanary-android:2.7'
implementation
'com.contrarywind:Android-PickerView:4.1.9'
implementation
'com.contrarywind:Android-PickerView:4.1.9'
}
}
\ No newline at end of file
app/src/main/java/com/miya/fastcashier/service/PrintService.kt
View file @
33bca812
...
@@ -70,12 +70,12 @@ object PrintService {
...
@@ -70,12 +70,12 @@ object PrintService {
//检查打印机状态
//检查打印机状态
printer
.
printerStatus
printer
.
printerStatus
printer
.
set58mm
()
printer
.
set58mm
()
if
(
BuildConfig
.
DEBUG
)
{
//
if (BuildConfig.DEBUG) {
printCashier
(
printer
,
payServiceResponse
,
selfCashierAccountInfo
)
//
printCashier(printer, payServiceResponse, selfCashierAccountInfo)
}
else
{
//
} else {
printCashier
(
printer
,
payServiceResponse
,
selfCashierAccountInfo
)
printCashier
(
printer
,
payServiceResponse
,
selfCashierAccountInfo
)
printCustomer
(
printer
,
payServiceResponse
,
selfCashierAccountInfo
)
printCustomer
(
printer
,
payServiceResponse
,
selfCashierAccountInfo
)
}
//
}
printer
.
feedPaper
()
printer
.
feedPaper
()
printer
.
endPrint
()
printer
.
endPrint
()
}
}
...
...
app/src/main/java/com/miya/fastcashier/ui/PayActivity.kt
View file @
33bca812
...
@@ -6,17 +6,11 @@ import android.view.KeyEvent
...
@@ -6,17 +6,11 @@ import android.view.KeyEvent
import
android.widget.Toast
import
android.widget.Toast
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelProvider
import
com.miya.fastcashier.databinding.ActivityPayBinding
import
com.miya.fastcashier.databinding.ActivityPayBinding
import
com.miya.fastcashier.databinding.ActivityRefundBinding
import
com.miya.fastcashier.ui.dialog.MessageDialog
import
com.miya.fastcashier.ui.dialog.NumberManualDialog
import
com.miya.fastcashier.ui.dialog.NumberManualDialog.NumberInputListener
import
com.miya.fastcashier.ui.dialog.RefundInfoDialog
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.DateUtils
import
com.miya.fastcashier.utils.DateUtils
import
com.miya.fastcashier.utils.ScanGunKeyEventHelper
import
com.miya.fastcashier.utils.ScanGunKeyEventHelper
import
com.miya.fastcashier.utils.clickWithTrigger
import
com.miya.fastcashier.utils.clickWithTrigger
import
com.miya.fastcashier.viewmodel.PayViewModel
import
com.miya.fastcashier.viewmodel.PayViewModel
import
com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import
com.tencent.mmkv.MMKV
import
com.tencent.mmkv.MMKV
import
java.util.*
import
java.util.*
...
@@ -57,11 +51,7 @@ class PayActivity : BaseActivity() {
...
@@ -57,11 +51,7 @@ class PayActivity : BaseActivity() {
startActivity
(
intent
)
startActivity
(
intent
)
}
}
})
})
val
tvBack
=
binding
.
clTitle
.
tvBack
binding
.
clTitle
.
llBack
.
clickWithTrigger
{
finish
()
}
val
ivBack
=
binding
.
clTitle
.
ivBack
tvBack
.
clickWithTrigger
{
finish
()
}
ivBack
.
clickWithTrigger
{
finish
()
}
scanGunKeyEventHelper
.
setOnBarCodeCatchListener
{
scanGunKeyEventHelper
.
setOnBarCodeCatchListener
{
showProgressDialog
(
"正在支付.."
)
showProgressDialog
(
"正在支付.."
)
...
...
app/src/main/java/com/miya/fastcashier/ui/SearchOrderActivity.kt
View file @
33bca812
package
com.miya.fastcashier.ui
package
com.miya.fastcashier.ui
import
android.content.Context
import
android.content.Context
import
android.graphics.Rect
import
android.os.Bundle
import
android.os.Bundle
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
android.widget.Toast
import
android.widget.Toast
import
androidx.core.content.res.ResourcesCompat
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.Observer
import
androidx.lifecycle.Observer
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelProvider
...
@@ -20,10 +22,7 @@ import com.miya.fastcashier.dao.PayDataDao
...
@@ -20,10 +22,7 @@ import com.miya.fastcashier.dao.PayDataDao
import
com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import
com.miya.fastcashier.databinding.ActivitySearchOrderBinding
import
com.miya.fastcashier.databinding.FragmentSearchOrderBinding
import
com.miya.fastcashier.databinding.FragmentSearchOrderBinding
import
com.miya.fastcashier.databinding.ItemSearchOrderListBinding
import
com.miya.fastcashier.databinding.ItemSearchOrderListBinding
import
com.miya.fastcashier.utils.CenterToasty
import
com.miya.fastcashier.utils.*
import
com.miya.fastcashier.utils.MiYaPayPlantformPayWayEnum
import
com.miya.fastcashier.utils.StringPriceFormat
import
com.miya.fastcashier.utils.clickWithTrigger
import
com.miya.fastcashier.viewmodel.SearchOrderViewModel
import
com.miya.fastcashier.viewmodel.SearchOrderViewModel
import
com.miya.fastcashier.widget.Divider
import
com.miya.fastcashier.widget.Divider
...
@@ -37,8 +36,7 @@ class SearchOrderActivity : BaseActivity() {
...
@@ -37,8 +36,7 @@ class SearchOrderActivity : BaseActivity() {
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
binding
=
ActivitySearchOrderBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
binding
=
ActivitySearchOrderBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
setContentView
(
binding
.
root
)
setContentView
(
binding
.
root
)
binding
.
title
.
tvBack
.
clickWithTrigger
{
finish
()
}
binding
.
title
.
llBack
.
clickWithTrigger
{
finish
()
}
binding
.
title
.
ivBack
.
clickWithTrigger
{
finish
()
}
binding
.
vpPage
.
adapter
=
object
:
FragmentStateAdapter
(
this
)
{
binding
.
vpPage
.
adapter
=
object
:
FragmentStateAdapter
(
this
)
{
override
fun
getItemCount
():
Int
{
override
fun
getItemCount
():
Int
{
...
@@ -98,7 +96,19 @@ class SearchOrderFragment(val payType: MiYaPayPlantformPayWayEnum.MiyaPayType) :
...
@@ -98,7 +96,19 @@ class SearchOrderFragment(val payType: MiYaPayPlantformPayWayEnum.MiyaPayType) :
adapter
=
SearchOrderListAdapter
(
act
,
arrayListOf
())
adapter
=
SearchOrderListAdapter
(
act
,
arrayListOf
())
rvContent
.
layoutManager
=
LinearLayoutManager
(
act
,
LinearLayoutManager
.
VERTICAL
,
false
)
rvContent
.
layoutManager
=
LinearLayoutManager
(
act
,
LinearLayoutManager
.
VERTICAL
,
false
)
rvContent
.
adapter
=
adapter
rvContent
.
adapter
=
adapter
rvContent
.
addItemDecoration
(
Divider
(
act
))
rvContent
.
addItemDecoration
(
object
:
RecyclerView
.
ItemDecoration
()
{
val
itemMargin
=
dp2px
(
act
,
16F
)
override
fun
getItemOffsets
(
outRect
:
Rect
,
view
:
View
,
parent
:
RecyclerView
,
state
:
RecyclerView
.
State
)
{
outRect
.
set
(
itemMargin
,
itemMargin
,
itemMargin
,
0
)
}
}
)
rvContent
.
addOnScrollListener
(
object
:
RecyclerView
.
OnScrollListener
()
{
rvContent
.
addOnScrollListener
(
object
:
RecyclerView
.
OnScrollListener
()
{
//用来标记是否正在向最后一个滑动
//用来标记是否正在向最后一个滑动
var
isSlidingToLast
=
false
var
isSlidingToLast
=
false
...
@@ -199,16 +209,35 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
...
@@ -199,16 +209,35 @@ class SearchOrderViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView)
fun
setData
(
data
:
ViewPayOrderData
)
{
fun
setData
(
data
:
ViewPayOrderData
)
{
binding
.
tvDate
.
text
=
data
.
chanelOrderTradeTime
binding
.
tvDate
.
text
=
data
.
chanelOrderTradeTime
binding
.
tvDateTitle
.
text
=
"下单时间"
if
(
data
.
refundOrderNo
!=
null
&&
data
.
refundPrice
!=
null
)
{
if
(
data
.
refundOrderNo
!=
null
&&
data
.
refundPrice
!=
null
)
{
binding
.
tvRefundTag
.
visibility
=
View
.
VISIBLE
binding
.
tvPrice
.
text
=
binding
.
tvPrice
.
text
=
"¥"
+
StringPriceFormat
.
transStringPriceToDecimalString
(
data
.
refundPrice
)
"¥"
+
StringPriceFormat
.
transStringPriceToDecimalString
(
data
.
refundPrice
)
binding
.
tvOrderNo
.
text
=
data
.
refundOrderNo
binding
.
tvOrderNo
.
text
=
data
.
refundOrderNo
binding
.
tvSerialNo
.
text
=
data
.
tradeNo
binding
.
tvOrderNoTitle
.
text
=
"退款订单号"
binding
.
tvSerialNoTitle
.
text
=
"退款流水号"
binding
.
tvPriceTitle
.
text
=
"退款金额"
binding
.
tvPrice
.
setTextColor
(
ResourcesCompat
.
getColor
(
itemView
.
resources
,
R
.
color
.
color_FF4E33
,
null
)
)
}
else
{
}
else
{
binding
.
tvRefundTag
.
visibility
=
View
.
GONE
binding
.
tvPrice
.
text
=
binding
.
tvPrice
.
text
=
"¥"
+
StringPriceFormat
.
transStringPriceToDecimalString
(
data
.
tradPrice
)
"¥"
+
StringPriceFormat
.
transStringPriceToDecimalString
(
data
.
tradPrice
)
binding
.
tvOrderNo
.
text
=
data
.
orderNo
binding
.
tvOrderNo
.
text
=
data
.
orderNo
binding
.
tvOrderNoTitle
.
text
=
"订单号"
binding
.
tvSerialNoTitle
.
text
=
"流水号"
binding
.
tvPriceTitle
.
text
=
"订单金额"
binding
.
tvSerialNo
.
text
=
data
.
tradeNo
binding
.
tvPrice
.
setTextColor
(
ResourcesCompat
.
getColor
(
itemView
.
resources
,
R
.
color
.
color_333333
,
null
)
)
}
}
}
}
...
...
app/src/main/java/com/miya/fastcashier/utils/BaseFunction.kt
View file @
33bca812
...
@@ -15,3 +15,11 @@ fun sp2px(context: Context, spValue: Float): Int {
...
@@ -15,3 +15,11 @@ fun sp2px(context: Context, spValue: Float): Int {
val
fontScale
:
Float
=
context
.
resources
.
displayMetrics
.
scaledDensity
val
fontScale
:
Float
=
context
.
resources
.
displayMetrics
.
scaledDensity
return
(
spValue
*
fontScale
+
0.5f
).
toInt
()
return
(
spValue
*
fontScale
+
0.5f
).
toInt
()
}
}
/**
* 根据分辨率从 dp 的单位 转成为 px(像素)
*/
fun
dp2px
(
context
:
Context
,
dpValue
:
Float
):
Int
{
val
scale
=
context
.
resources
.
displayMetrics
.
density
return
(
dpValue
*
scale
+
0.5f
).
toInt
()
}
app/src/main/java/com/miya/fastcashier/utils/DateSelectHelper.kt
View file @
33bca812
package
com.miya.fastcashier.utils
package
com.miya.fastcashier.utils
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
android.graphics.Color
import
android.graphics.Color
import
android.view.View
import
android.view.View
...
@@ -11,7 +12,7 @@ import com.bigkoo.pickerview.view.TimePickerView
...
@@ -11,7 +12,7 @@ import com.bigkoo.pickerview.view.TimePickerView
import
com.miya.fastcashier.R
import
com.miya.fastcashier.R
import
java.util.*
import
java.util.*
class
DateSelectHelper
(
val
context
:
Context
,
val
callback
:
(
Date
)
->
Unit
)
{
class
DateSelectHelper
(
val
act
:
Activity
,
val
callback
:
(
Date
)
->
Unit
)
{
var
timePickerView
:
TimePickerView
?
=
null
var
timePickerView
:
TimePickerView
?
=
null
fun
showDatePicker
()
{
fun
showDatePicker
()
{
...
@@ -50,7 +51,7 @@ class DateSelectHelper(val context: Context, val callback: (Date) -> Unit) {
...
@@ -50,7 +51,7 @@ class DateSelectHelper(val context: Context, val callback: (Date) -> Unit) {
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
),
calendar
.
get
(
Calendar
.
HOUR_OF_DAY
),
calendar
.
get
(
Calendar
.
MINUTE
)
calendar
.
get
(
Calendar
.
MINUTE
)
)
)
timePickerView
=
TimePickerBuilder
(
contex
t
,
OnTimeSelectListener
{
date
,
v
->
timePickerView
=
TimePickerBuilder
(
ac
t
,
OnTimeSelectListener
{
date
,
v
->
callback
(
date
)
callback
(
date
)
})
})
.
setTitleText
(
"请选择开始时间"
)
.
setTitleText
(
"请选择开始时间"
)
...
@@ -60,6 +61,8 @@ class DateSelectHelper(val context: Context, val callback: (Date) -> Unit) {
...
@@ -60,6 +61,8 @@ class DateSelectHelper(val context: Context, val callback: (Date) -> Unit) {
.
setTitleSize
(
30
)
.
setTitleSize
(
30
)
.
setSubCalSize
(
30
)
.
setSubCalSize
(
30
)
.
setRangDate
(
startDate
,
endDate
)
.
setRangDate
(
startDate
,
endDate
)
.
setOutSideCancelable
(
false
)
.
setDecorView
(
act
.
findViewById
(
android
.
R
.
id
.
content
))
.
build
()
.
build
()
}
}
...
...
app/src/main/java/com/miya/fastcashier/viewmodel/PayViewModel.kt
View file @
33bca812
...
@@ -21,6 +21,7 @@ import com.sdy.miya.moblie.component.pay.core.error.ParamInvalidException
...
@@ -21,6 +21,7 @@ import com.sdy.miya.moblie.component.pay.core.error.ParamInvalidException
import
com.sdy.miya.moblie.component.pay.platform.bean.MiyaOrderRefundResponse
import
com.sdy.miya.moblie.component.pay.platform.bean.MiyaOrderRefundResponse
import
com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import
com.sdy.miya.moblie.component.pay.platform.bean.PayServiceResponse
import
kotlinx.coroutines.*
import
kotlinx.coroutines.*
import
java.lang.RuntimeException
import
java.util.*
import
java.util.*
import
kotlin.collections.HashMap
import
kotlin.collections.HashMap
...
@@ -87,7 +88,7 @@ class PayViewModel : ViewModel() {
...
@@ -87,7 +88,7 @@ class PayViewModel : ViewModel() {
fun
generatePayCode
(
price
:
String
,
payType
:
String
)
{
fun
generatePayCode
(
price
:
String
,
payType
:
String
)
{
XLog
.
d
(
"开始生成主扫码"
)
XLog
.
d
(
"开始生成主扫码"
)
if
(
TextUtils
.
isEmpty
(
price
))
{
if
(
TextUtils
.
isEmpty
(
price
))
{
payServiceResponseLiveData
.
value
=
Result
.
failure
(
ParamInvalid
Exception
(
"请输入金额!"
))
payServiceResponseLiveData
.
value
=
Result
.
failure
(
Runtime
Exception
(
"请输入金额!"
))
return
return
}
}
...
@@ -96,7 +97,7 @@ class PayViewModel : ViewModel() {
...
@@ -96,7 +97,7 @@ class PayViewModel : ViewModel() {
priceFen
=
price
.
toDouble
().
times
(
100
).
toInt
().
toString
()
priceFen
=
price
.
toDouble
().
times
(
100
).
toInt
().
toString
()
}
catch
(
e
:
java
.
lang
.
Exception
)
{
}
catch
(
e
:
java
.
lang
.
Exception
)
{
e
.
printStackTrace
()
e
.
printStackTrace
()
payServiceResponseLiveData
.
value
=
Result
.
failure
(
ParamInvalid
Exception
(
"金额有误!"
))
payServiceResponseLiveData
.
value
=
Result
.
failure
(
Runtime
Exception
(
"金额有误!"
))
return
return
}
}
...
@@ -129,6 +130,8 @@ class PayViewModel : ViewModel() {
...
@@ -129,6 +130,8 @@ class PayViewModel : ViewModel() {
val
payServiceResponseResult
=
val
payServiceResponseResult
=
PayRepository
.
payResultQuery
(
payServiceResponse
.
shopTradeNo
)
PayRepository
.
payResultQuery
(
payServiceResponse
.
shopTradeNo
)
XLog
.
d
(
"支付查询结果:${JSON.toJSONString(payServiceResponseResult)}"
)
XLog
.
d
(
"支付查询结果:${JSON.toJSONString(payServiceResponseResult)}"
)
//加入数据库
ViewPayOrderData
.
insert
(
payServiceResponseResult
)
payResultLiveData
.
postValue
(
Result
.
success
(
payServiceResponseResult
))
payResultLiveData
.
postValue
(
Result
.
success
(
payServiceResponseResult
))
break
break
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
...
@@ -167,12 +170,12 @@ class PayViewModel : ViewModel() {
...
@@ -167,12 +170,12 @@ class PayViewModel : ViewModel() {
fun
pay
(
price
:
String
,
payCode
:
String
)
{
fun
pay
(
price
:
String
,
payCode
:
String
)
{
XLog
.
d
(
"被扫开始"
)
XLog
.
d
(
"被扫开始"
)
if
(
TextUtils
.
isEmpty
(
price
))
{
if
(
TextUtils
.
isEmpty
(
price
))
{
payResultLiveData
.
value
=
Result
.
failure
(
ParamInvalid
Exception
(
"请输入金额!"
))
payResultLiveData
.
value
=
Result
.
failure
(
Runtime
Exception
(
"请输入金额!"
))
return
return
}
}
if
(
TextUtils
.
isEmpty
(
payCode
))
{
if
(
TextUtils
.
isEmpty
(
payCode
))
{
payResultLiveData
.
value
=
Result
.
failure
(
ParamInvalid
Exception
(
"付款码为空!"
))
payResultLiveData
.
value
=
Result
.
failure
(
Runtime
Exception
(
"付款码为空!"
))
return
return
}
}
...
@@ -181,7 +184,7 @@ class PayViewModel : ViewModel() {
...
@@ -181,7 +184,7 @@ class PayViewModel : ViewModel() {
priceFen
=
price
.
toDouble
().
times
(
100
).
toInt
().
toString
()
priceFen
=
price
.
toDouble
().
times
(
100
).
toInt
().
toString
()
}
catch
(
e
:
java
.
lang
.
Exception
)
{
}
catch
(
e
:
java
.
lang
.
Exception
)
{
e
.
printStackTrace
()
e
.
printStackTrace
()
payResultLiveData
.
value
=
Result
.
failure
(
ParamInvalid
Exception
(
"金额有误!"
))
payResultLiveData
.
value
=
Result
.
failure
(
Runtime
Exception
(
"金额有误!"
))
return
return
}
}
...
...
app/src/main/java/com/miya/fastcashier/widget/Divider.java
View file @
33bca812
...
@@ -16,11 +16,12 @@ public class Divider extends RecyclerView.ItemDecoration {
...
@@ -16,11 +16,12 @@ public class Divider extends RecyclerView.ItemDecoration {
private
Paint
paint
;
private
Paint
paint
;
private
int
divideWidth
;
private
int
divideWidth
;
public
Divider
(
Context
context
)
{
public
Divider
(
int
divideWidth
,
int
color
)
{
super
();
this
.
paint
=
new
Paint
();
this
.
paint
=
new
Paint
();
paint
.
setAntiAlias
(
true
);
paint
.
setAntiAlias
(
true
);
paint
.
setColor
(
co
ntext
.
getResources
().
getColor
(
R
.
color
.
color_ECECEC
)
);
paint
.
setColor
(
co
lor
);
divideWidth
=
1
;
this
.
divideWidth
=
divideWidth
;
}
}
@Override
@Override
...
...
app/src/main/res/drawable/app_bg_search_order_card.xml
0 → 100644
View file @
33bca812
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<solid
android:color=
"@color/white"
/>
<corners
android:radius=
"16dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/activity_login.xml
View file @
33bca812
...
@@ -14,14 +14,15 @@
...
@@ -14,14 +14,15 @@
android:layout_marginStart=
"46dp"
android:layout_marginStart=
"46dp"
android:layout_marginTop=
"475dp"
android:layout_marginTop=
"475dp"
android:layout_marginEnd=
"46dp"
android:layout_marginEnd=
"46dp"
android:singleLine=
"true"
android:hint=
"请输入用户名"
android:hint=
"请输入用户名"
android:textSize=
"32sp"
android:imeOptions=
"actionNext"
android:imeOptions=
"actionNext"
android:selectAllOnFocus=
"true"
android:selectAllOnFocus=
"true"
android:singleLine=
"true"
android:textSize=
"32sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
app:met_bottomTextSize=
"26sp"
/>
<com.rengwuxian.materialedittext.MaterialEditText
<com.rengwuxian.materialedittext.MaterialEditText
android:id=
"@+id/password"
android:id=
"@+id/password"
...
@@ -32,13 +33,14 @@
...
@@ -32,13 +33,14 @@
android:layout_marginEnd=
"46dp"
android:layout_marginEnd=
"46dp"
android:hint=
"请输入密码"
android:hint=
"请输入密码"
android:imeActionLabel=
"登录"
android:imeActionLabel=
"登录"
android:textSize=
"32sp"
android:imeOptions=
"actionDone"
android:imeOptions=
"actionDone"
android:inputType=
"textPassword"
android:inputType=
"textPassword"
android:selectAllOnFocus=
"true"
android:selectAllOnFocus=
"true"
android:textSize=
"32sp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/username"
/>
app:layout_constraintTop_toBottomOf=
"@+id/username"
app:met_bottomTextSize=
"26sp"
/>
<Button
<Button
android:id=
"@+id/login"
android:id=
"@+id/login"
...
@@ -46,11 +48,11 @@
...
@@ -46,11 +48,11 @@
android:layout_height=
"100dp"
android:layout_height=
"100dp"
android:layout_gravity=
"start"
android:layout_gravity=
"start"
android:layout_marginTop=
"142dp"
android:layout_marginTop=
"142dp"
android:background=
"@drawable/app_login_btn"
android:enabled=
"false"
android:enabled=
"false"
android:text=
"登录"
android:text=
"登录"
android:background=
"@drawable/app_login_btn"
android:textSize=
"32sp"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"32sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -61,55 +63,55 @@
...
@@ -61,55 +63,55 @@
android:id=
"@+id/ivLogo"
android:id=
"@+id/ivLogo"
android:layout_width=
"120dp"
android:layout_width=
"120dp"
android:layout_height=
"120dp"
android:layout_height=
"120dp"
android:layout_marginTop=
"259dp"
android:layout_marginLeft=
"39dp"
android:layout_marginStart=
"39dp"
android:layout_marginStart=
"39dp"
android:layout_marginLeft=
"39dp"
android:layout_marginTop=
"259dp"
android:background=
"@mipmap/app_store_round_logo"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
android:background=
"@mipmap/app_store_round_logo"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"23dp"
android:layout_marginLeft=
"26dp"
android:text=
"您好,欢迎登录!"
android:text=
"您好,欢迎登录!"
android:textSize=
"48sp"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:
layout_marginStart=
"23d
p"
android:
textSize=
"48s
p"
app:layout_constraintStart_toEndOf=
"@+id/ivLogo"
app:layout_constraintStart_toEndOf=
"@+id/ivLogo"
app:layout_constraintTop_toTopOf=
"@+id/ivLogo"
app:layout_constraintTop_toTopOf=
"@+id/ivLogo"
/>
android:layout_marginLeft=
"26dp"
/>
<TextView
<TextView
android:id=
"@+id/tvSlog"
android:id=
"@+id/tvSlog"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"23dp"
android:layout_marginLeft=
"26dp"
android:text=
"欢迎使用匡威商米收银"
android:text=
"欢迎使用匡威商米收银"
android:textSize=
"28sp"
android:textColor=
"#666666"
android:textColor=
"#666666"
android:layout_marginStart=
"23dp"
android:textSize=
"28sp"
app:layout_constraintStart_toEndOf=
"@+id/ivLogo"
app:layout_constraintBottom_toBottomOf=
"@+id/ivLogo"
app:layout_constraintBottom_toBottomOf=
"@+id/ivLogo"
a
ndroid:layout_marginLeft=
"26dp
"
/>
a
pp:layout_constraintStart_toEndOf=
"@+id/ivLogo
"
/>
<TextView
<TextView
android:id=
"@+id/tvErrInfo"
android:id=
"@+id/tvErrInfo"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"账号或密码输入错误,请重新输入"
android:text=
"账号或密码输入错误,请重新输入"
android:textSize=
"24sp"
android:textColor=
"#FF5A59"
android:textColor=
"#FF5A59"
android:textSize=
"24sp"
android:visibility=
"gone"
android:visibility=
"gone"
app:layout_constraintStart_toStartOf=
"@+id/username"
app:layout_constraintStart_toEndOf=
"@+id/ivLogo"
app:layout_constraintStart_toEndOf=
"@+id/ivLogo"
app:layout_constraintStart_toStartOf=
"@+id/username"
app:layout_constraintTop_toBottomOf=
"@+id/password"
/>
app:layout_constraintTop_toBottomOf=
"@+id/password"
/>
<!--封装成一个View-->
<!--封装成一个View-->
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:visibility=
"gone"
android:id=
"@+id/loading"
android:id=
"@+id/loading"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:visibility=
"gone"
>
<LinearLayout
<LinearLayout
android:layout_width=
"306dp"
android:layout_width=
"306dp"
...
...
app/src/main/res/layout/activity_search_order.xml
View file @
33bca812
...
@@ -28,7 +28,6 @@
...
@@ -28,7 +28,6 @@
android:id=
"@+id/vpPage"
android:id=
"@+id/vpPage"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:background=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tlIndicator"
/>
app:layout_constraintTop_toBottomOf=
"@id/tlIndicator"
/>
...
...
app/src/main/res/layout/fragment_search_order.xml
View file @
33bca812
...
@@ -6,6 +6,6 @@
...
@@ -6,6 +6,6 @@
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rvContent"
android:id=
"@+id/rvContent"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:
paddingStart=
"40dp
"
android:
background=
"@color/color_F8F8F8
"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/item_search_order_list.xml
View file @
33bca812
...
@@ -5,15 +5,94 @@
...
@@ -5,15 +5,94 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<View
android:id=
"@+id/vBg"
android:layout_width=
"0dp"
android:layout_height=
"0dp"
android:background=
"@drawable/app_bg_search_order_card"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
<TextView
android:id=
"@+id/tv
OrderNo
"
android:id=
"@+id/tv
SerialNoTitle
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"40dp"
android:layout_marginTop=
"24dp"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"28sp"
android:textSize=
"26sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"@id/vBg"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/vBg"
app:layout_goneMarginStart=
"24dp"
tools:text=
"流水号"
/>
<TextView
android:id=
"@+id/tvOrderNoTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"40dp"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/color_333333"
android:textSize=
"26sp"
app:layout_constraintStart_toStartOf=
"@id/vBg"
app:layout_constraintTop_toBottomOf=
"@id/tvSerialNoTitle"
app:layout_goneMarginStart=
"24dp"
tools:text=
"订单号"
/>
<TextView
android:id=
"@+id/tvDateTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"40dp"
android:layout_marginTop=
"24dp"
android:textColor=
"@color/color_333333"
android:textSize=
"26sp"
app:layout_constraintStart_toStartOf=
"@id/vBg"
app:layout_constraintTop_toBottomOf=
"@id/tvOrderNoTitle"
app:layout_goneMarginStart=
"24dp"
tools:text=
"下单时间"
/>
<TextView
android:id=
"@+id/tvPriceTitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"40dp"
android:layout_marginTop=
"24dp"
android:layout_marginBottom=
"24dp"
android:textColor=
"@color/color_333333"
android:textSize=
"26sp"
app:layout_constraintBottom_toBottomOf=
"@id/vBg"
app:layout_constraintStart_toStartOf=
"@id/vBg"
app:layout_constraintTop_toBottomOf=
"@id/tvDateTitle"
app:layout_goneMarginStart=
"24dp"
tools:text=
"订单金额"
/>
<TextView
android:id=
"@+id/tvSerialNo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:layout_marginEnd=
"24dp"
android:textColor=
"@color/color_999999"
android:textSize=
"26sp"
app:layout_constraintBaseline_toBaselineOf=
"@id/tvSerialNoTitle"
app:layout_constraintEnd_toEndOf=
"@id/vBg"
tools:text=
"流水号1"
/>
<TextView
android:id=
"@+id/tvOrderNo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"24dp"
android:layout_marginEnd=
"24dp"
android:textColor=
"@color/color_999999"
android:textSize=
"26sp"
app:layout_constraintBaseline_toBaselineOf=
"@id/tvOrderNoTitle"
app:layout_constraintEnd_toEndOf=
"@id/vBg"
tools:text=
"流水号1"
/>
tools:text=
"流水号1"
/>
<TextView
<TextView
...
@@ -21,12 +100,12 @@
...
@@ -21,12 +100,12 @@
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:layout_marginTop=
"10dp"
android:layout_marginEnd=
"24dp"
android:layout_marginBottom=
"26dp"
android:layout_marginBottom=
"26dp"
android:textColor=
"@color/color_
666666
"
android:textColor=
"@color/color_
999999
"
android:textSize=
"24sp"
android:textSize=
"24sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBaseline_toBaselineOf=
"@id/tvDateTitle"
app:layout_constraintStart_toStartOf=
"@id/tvOrderNo"
app:layout_constraintEnd_toEndOf=
"@id/vBg"
app:layout_constraintTop_toBottomOf=
"@id/tvOrderNo"
tools:text=
"2022-02-28 13:51:00"
/>
tools:text=
"2022-02-28 13:51:00"
/>
<TextView
<TextView
...
@@ -35,22 +114,10 @@
...
@@ -35,22 +114,10 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"40dp"
android:layout_marginEnd=
"40dp"
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"32sp"
android:textSize=
"30sp"
app:layout_constraintBaseline_toBaselineOf=
"@id/tvOrderNo"
app:layout_constraintBaseline_toBaselineOf=
"@id/tvPriceTitle"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"@id/vBg"
app:layout_goneMarginEnd=
"24dp"
tools:text=
"¥200.99"
/>
tools:text=
"¥200.99"
/>
<TextView
android:id=
"@+id/tvRefundTag"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:textColor=
"@color/color_FF4E33"
android:textSize=
"20sp"
android:visibility=
"gone"
app:layout_constraintEnd_toEndOf=
"@id/tvPrice"
app:layout_constraintTop_toBottomOf=
"@id/tvPrice"
android:text=
"退款金额"
tools:visibility=
"visible"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/title.xml
View file @
33bca812
...
@@ -11,22 +11,23 @@
...
@@ -11,22 +11,23 @@
android:background=
"@color/colorPrimary"
android:background=
"@color/colorPrimary"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tvBack"
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/llBack"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"0dp"
android:layout_marginStart=
"60dp"
android:descendantFocusability=
"blocksDescendants"
android:layout_marginTop=
"32dp"
android:gravity=
"center_vertical"
android:text=
"@string/back"
android:orientation=
"horizontal"
android:textColor=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"parent"
android:textSize=
"24sp"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/
>
app:layout_constraintTop_toTopOf=
"parent"
>
<ImageView
<ImageView
android:id=
"@+id/ivBack"
android:id=
"@+id/ivBack"
android:layout_width=
"24dp"
android:layout_width=
"24dp"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
android:layout_marginStart=
"32dp"
android:contentDescription=
"@string/back"
android:contentDescription=
"@string/back"
android:padding=
"6dp"
android:padding=
"6dp"
android:src=
"@mipmap/ic_left_arrow"
android:src=
"@mipmap/ic_left_arrow"
...
@@ -35,13 +36,25 @@
...
@@ -35,13 +36,25 @@
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/tvBack"
/>
app:layout_constraintTop_toTopOf=
"@+id/tvBack"
/>
<TextView
android:id=
"@+id/tvBack"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:text=
"@string/back"
android:textColor=
"@color/white"
android:textSize=
"24sp"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
<ImageView
<ImageView
android:layout_width=
"195dp"
android:layout_width=
"195dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:layout_marginEnd=
"32dp"
android:layout_marginEnd=
"32dp"
android:src=
"@mipmap/ic_logo_white"
android:src=
"@mipmap/ic_logo_white"
app:layout_constraintBottom_toBottomOf=
"@+id/
tv
Back"
app:layout_constraintBottom_toBottomOf=
"@+id/
ll
Back"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"@+id/
tv
Back"
/>
app:layout_constraintTop_toTopOf=
"@+id/
ll
Back"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
33bca812
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
<color
name=
"blue"
>
#2E6CFB
</color>
<color
name=
"blue"
>
#2E6CFB
</color>
<color
name=
"color_333333"
>
#333333
</color>
<color
name=
"color_333333"
>
#333333
</color>
<color
name=
"color_666666"
>
#666666
</color>
<color
name=
"color_666666"
>
#666666
</color>
<color
name=
"color_999999"
>
#999999
</color>
<color
name=
"color_FF4E33"
>
#FF4E33
</color>
<color
name=
"color_FF4E33"
>
#FF4E33
</color>
<color
name=
"color_ECECEC"
>
#ECECEC
</color>
<color
name=
"color_ECECEC"
>
#ECECEC
</color>
<color
name=
"color_F8F8F8"
>
#F8F8F8
</color>
</resources>
</resources>
\ No newline at end of file
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