Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Y
YPPos
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
朱世闯
YPPos
Commits
02187684
Commit
02187684
authored
Sep 16, 2021
by
UIUANG\Zsc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复问题
parent
d995e729
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
187 additions
and
74 deletions
+187
-74
.gitignore
.gitignore
+2
-0
build.gradle
app/build.gradle
+18
-6
PosApp.kt
app/src/main/java/com/ypsx/yppos/PosApp.kt
+3
-0
InsertOrderProductDTO.kt
...va/com/ypsx/yppos/http/data/bean/InsertOrderProductDTO.kt
+4
-5
PosBuyRepository.kt
...n/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
+1
-1
PosProductRepository.kt
...va/com/ypsx/yppos/room/repository/PosProductRepository.kt
+1
-1
MainActivity.kt
app/src/main/java/com/ypsx/yppos/ui/activity/MainActivity.kt
+18
-4
SettingsPopupWindow.kt
.../main/java/com/ypsx/yppos/ui/popup/SettingsPopupWindow.kt
+2
-1
PrintUtils.kt
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
+30
-2
ToastUtils.kt
app/src/main/java/com/ypsx/yppos/utils/ToastUtils.kt
+1
-1
RequestMainViewModel.kt
.../com/ypsx/yppos/viewmodel/request/RequestMainViewModel.kt
+6
-1
SettingsViewModel.kt
.../java/com/ypsx/yppos/viewmodel/state/SettingsViewModel.kt
+4
-1
activity_main.xml
app/src/main/res/layout/activity_main.xml
+49
-38
item_pos_product.xml
app/src/main/res/layout/item_pos_product.xml
+15
-6
popup_settings.xml
app/src/main/res/layout/popup_settings.xml
+8
-0
build.gradle
base/build.gradle
+15
-1
BaseApp.kt
base/src/main/java/com/ypsx/base/base/BaseApp.kt
+1
-3
gradle.properties
gradle.properties
+9
-3
No files found.
.gitignore
View file @
02187684
...
@@ -13,3 +13,5 @@
...
@@ -13,3 +13,5 @@
.externalNativeBuild
.externalNativeBuild
.cxx
.cxx
local.properties
local.properties
app/sit/output-metadata.json
app/sit/yppos-v-sit.apk
app/build.gradle
View file @
02187684
...
@@ -45,12 +45,18 @@ android {
...
@@ -45,12 +45,18 @@ android {
signingConfig
signingConfigs
.
config
signingConfig
signingConfigs
.
config
}
}
// return_test {
sit
{
// buildConfigField 'String', 'HOST', RETURN_DEBUG_HOST
buildConfigField
'String'
,
'HOST'
,
SIT_HOST
// minifyEnabled false
minifyEnabled
false
//
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig
signingConfigs
.
config
// }
}
pre
{
buildConfigField
'String'
,
'HOST'
,
PRE_HOST
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
release
{
release
{
buildConfigField
'String'
,
'HOST'
,
RELEASE_HOST
buildConfigField
'String'
,
'HOST'
,
RELEASE_HOST
minifyEnabled
false
minifyEnabled
false
...
@@ -80,6 +86,12 @@ android {
...
@@ -80,6 +86,12 @@ android {
]
]
}
}
android
.
applicationVariants
.
all
{
variant
->
variant
.
outputs
.
all
{
outputFileName
=
'yppos-v-'
+
variant
.
buildType
.
name
+
'.apk'
}
}
}
}
dependencies
{
dependencies
{
...
...
app/src/main/java/com/ypsx/yppos/PosApp.kt
View file @
02187684
...
@@ -20,6 +20,7 @@ import com.elvishew.xlog.printer.file.backup.FileSizeBackupStrategy2
...
@@ -20,6 +20,7 @@ import com.elvishew.xlog.printer.file.backup.FileSizeBackupStrategy2
import
com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
import
com.elvishew.xlog.printer.file.backup.NeverBackupStrategy
import
com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy
import
com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy
import
com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import
com.elvishew.xlog.printer.file.naming.DateFileNameGenerator
import
com.hjq.toast.ToastUtils
import
com.tencent.mmkv.MMKV
import
com.tencent.mmkv.MMKV
import
com.ypsx.base.base.BaseApp
import
com.ypsx.base.base.BaseApp
import
com.ypsx.yppos.app.event.AppViewModel
import
com.ypsx.yppos.app.event.AppViewModel
...
@@ -45,6 +46,8 @@ class PosApp : BaseApp() {
...
@@ -45,6 +46,8 @@ class PosApp : BaseApp() {
override
fun
onCreate
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
super
.
onCreate
()
MMKV
.
initialize
(
this
)
MMKV
.
initialize
(
this
)
// 初始化 Toast 框架
ToastUtils
.
init
(
this
);
instance
=
this
instance
=
this
PosDatabase
.
getDatabase
(
instance
)
PosDatabase
.
getDatabase
(
instance
)
eventViewModelInstance
=
getAppViewModelProvider
().
get
(
EventViewModel
::
class
.
java
)
eventViewModelInstance
=
getAppViewModelProvider
().
get
(
EventViewModel
::
class
.
java
)
...
...
app/src/main/java/com/ypsx/yppos/http/data/bean/InsertOrderProductDTO.kt
View file @
02187684
...
@@ -4,7 +4,7 @@ data class InsertOrderProductDTO(
...
@@ -4,7 +4,7 @@ data class InsertOrderProductDTO(
var
activityPrice
:
Double
=
0.0
,
var
activityPrice
:
Double
=
0.0
,
var
activitys
:
ActivityInfoDTO
?=
null
,
var
activitys
:
List
<
ActivityInfoDTO
>?
=
null
,
//成交价
//成交价
var
amount
:
Double
=
0.0
,
var
amount
:
Double
=
0.0
,
var
barCode
:
String
,
var
barCode
:
String
,
...
@@ -24,7 +24,7 @@ data class InsertOrderProductDTO(
...
@@ -24,7 +24,7 @@ data class InsertOrderProductDTO(
var
payApportionAmount
:
Double
=
0.0
,
var
payApportionAmount
:
Double
=
0.0
,
var
pluLevel
:
String
?
=
null
,
var
pluLevel
:
String
?
=
null
,
var
price
:
Double
,
var
price
:
Double
,
var
quantity
:
Double
,
var
quantity
:
Double
,
var
priceType
:
String
,
var
priceType
:
String
,
var
productId
:
String
,
var
productId
:
String
,
var
productNumber
:
String
,
var
productNumber
:
String
,
...
@@ -35,10 +35,9 @@ data class InsertOrderProductDTO(
...
@@ -35,10 +35,9 @@ data class InsertOrderProductDTO(
var
tailAmount
:
Int
=
0
,
var
tailAmount
:
Int
=
0
,
var
unit
:
String
,
var
unit
:
String
,
//商家商品Id
//商家商品Id
var
merchantItemId
:
String
?
=
null
,
var
merchantItemId
:
String
?
=
null
,
//称重码
//称重码
var
weightCode
:
String
?
=
null
,
var
weightCode
:
String
?
=
null
,
)
)
app/src/main/java/com/ypsx/yppos/room/repository/PosBuyRepository.kt
View file @
02187684
...
@@ -111,7 +111,7 @@ class PosBuyRepository {
...
@@ -111,7 +111,7 @@ class PosBuyRepository {
}
}
fun
queryPosBuyPartByOrderNo
(
orderNo
:
String
):
List
<
PosBuyPart
>?
{
fun
queryPosBuyPartByOrderNo
(
orderNo
:
String
):
List
<
PosBuyPart
>?
{
return
getPosBuyPartDao
().
queryByOrderNo
(
orderNo
,
tru
e
)
return
getPosBuyPartDao
().
queryByOrderNo
(
orderNo
,
fals
e
)
}
}
fun
queryPosBuyPaymentByOrderNo
(
orderNo
:
String
):
PosBuyPayment
?
{
fun
queryPosBuyPaymentByOrderNo
(
orderNo
:
String
):
PosBuyPayment
?
{
...
...
app/src/main/java/com/ypsx/yppos/room/repository/PosProductRepository.kt
View file @
02187684
...
@@ -40,7 +40,7 @@ class PosProductRepository {
...
@@ -40,7 +40,7 @@ class PosProductRepository {
}
}
fun
queryAllIn
(
productIds
:
ArrayList
<
String
>):
List
<
PosProduct
>
{
fun
queryAllIn
(
productIds
:
ArrayList
<
String
>):
List
<
PosProduct
>
{
productIds
.
toArray
().
t
oString
().
dXLog
()
productIds
.
toArray
().
contentT
oString
().
dXLog
()
return
getPosProductDao
().
queryAllByProductId
(
productIds
)
return
getPosProductDao
().
queryAllByProductId
(
productIds
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/ypsx/yppos/ui/activity/MainActivity.kt
View file @
02187684
...
@@ -7,11 +7,13 @@ import android.os.Process.myPid
...
@@ -7,11 +7,13 @@ import android.os.Process.myPid
import
android.util.Log
import
android.util.Log
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.View
import
android.view.View
import
android.view.inputmethod.EditorInfo
import
androidx.activity.viewModels
import
androidx.activity.viewModels
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.ypsx.base.ext.view.textStringTrim
import
com.ypsx.base.ext.view.textStringTrim
import
com.ypsx.yppos.R
import
com.ypsx.yppos.R
import
com.ypsx.yppos.app.base.BaseActivity
import
com.ypsx.yppos.app.base.BaseActivity
import
com.ypsx.yppos.app.ext.hideKeyboard
import
com.ypsx.yppos.databinding.ActivityMainBinding
import
com.ypsx.yppos.databinding.ActivityMainBinding
import
com.ypsx.yppos.http.data.bean.InsertOrderProductDTO
import
com.ypsx.yppos.http.data.bean.InsertOrderProductDTO
import
com.ypsx.yppos.http.data.bean.OrderActivityResponse
import
com.ypsx.yppos.http.data.bean.OrderActivityResponse
...
@@ -29,6 +31,7 @@ import com.ypsx.yppos.viewmodel.state.MainViewModel
...
@@ -29,6 +31,7 @@ import com.ypsx.yppos.viewmodel.state.MainViewModel
import
kotlinx.android.synthetic.main.activity_main.*
import
kotlinx.android.synthetic.main.activity_main.*
import
razerdp.basepopup.BasePopupWindow.*
import
razerdp.basepopup.BasePopupWindow.*
import
java.util.*
import
java.util.*
import
kotlin.collections.ArrayList
import
kotlin.system.exitProcess
import
kotlin.system.exitProcess
...
@@ -122,7 +125,9 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
...
@@ -122,7 +125,9 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
var
promotionOnSaleTotal
=
mViewModel
.
discountSpecial
.
get
()
var
promotionOnSaleTotal
=
mViewModel
.
discountSpecial
.
get
()
var
discountTotal
=
mViewModel
.
discount
.
get
()
var
discountTotal
=
mViewModel
.
discount
.
get
()
var
data
=
orderProductAdapter
.
data
var
data
=
orderProductAdapter
.
data
data
.
addAll
(
posBuyPartsDeleted
)
var
arrayList
=
ArrayList
<
InsertOrderProductDTO
>()
arrayList
.
addAll
(
data
)
arrayList
.
addAll
(
posBuyPartsDeleted
)
"$realName 付款方式:${payMethod.name} 支付码:$barcode"
.
dXLog
()
"$realName 付款方式:${payMethod.name} 支付码:$barcode"
.
dXLog
()
requestMainViewModel
.
createOrder
(
requestMainViewModel
.
createOrder
(
...
@@ -131,7 +136,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
...
@@ -131,7 +136,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
payAmount
.
toDouble
(),
payAmount
.
toDouble
(),
promotionOnSaleTotal
.
toDouble
(),
promotionOnSaleTotal
.
toDouble
(),
discountTotal
.
toDouble
(),
discountTotal
.
toDouble
(),
data
,
arrayList
,
payMethod
,
payMethod
,
barcode
barcode
)
)
...
@@ -169,10 +174,10 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
...
@@ -169,10 +174,10 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
recyclerView
.
adapter
=
orderProductAdapter
recyclerView
.
adapter
=
orderProductAdapter
orderProductAdapter
.
addHeaderView
(
View
.
inflate
(
this
,
R
.
layout
.
item_order_header
,
null
))
orderProductAdapter
.
addHeaderView
(
View
.
inflate
(
this
,
R
.
layout
.
item_order_header
,
null
))
orderProductAdapter
.
run
{
orderProductAdapter
.
run
{
addChildClickViewIds
(
R
.
id
.
iv
_item_delete
,
R
.
id
.
tv_count_add
,
R
.
id
.
tv_count_reduce
)
addChildClickViewIds
(
R
.
id
.
rl
_item_delete
,
R
.
id
.
tv_count_add
,
R
.
id
.
tv_count_reduce
)
setOnItemChildClickListener
{
adapter
,
view
,
position
->
setOnItemChildClickListener
{
adapter
,
view
,
position
->
when
(
view
.
id
)
{
when
(
view
.
id
)
{
R
.
id
.
iv
_item_delete
->
{
R
.
id
.
rl
_item_delete
->
{
var
messageDialog
=
MessagePopupWindow
(
this
@MainActivity
)
var
messageDialog
=
MessagePopupWindow
(
this
@MainActivity
)
messageDialog
.
showPopupWindow
()
messageDialog
.
showPopupWindow
()
messageDialog
.
setData
(
"单品删除"
,
"是否取消当前商品"
,
"取消"
,
"确定"
)
messageDialog
.
setData
(
"单品删除"
,
"是否取消当前商品"
,
"取消"
,
"确定"
)
...
@@ -269,6 +274,15 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
...
@@ -269,6 +274,15 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(),
scanGunKeyEventHelper
?.
setOnBarCodeCatchListener
(
this
)
scanGunKeyEventHelper
?.
setOnBarCodeCatchListener
(
this
)
}
}
}
}
et_search_content
.
setOnEditorActionListener
{
v
,
actionId
,
event
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
hideKeyboard
()
val
textStringTrim
=
et_search_content
.
textStringTrim
()
requestMainViewModel
.
getKeyWords
(
textStringTrim
)
}
return
@setOnEditorActionListener
false
}
}
}
...
...
app/src/main/java/com/ypsx/yppos/ui/popup/SettingsPopupWindow.kt
View file @
02187684
...
@@ -55,6 +55,7 @@ class SettingsPopupWindow(context: Context?) : BasePopupWindow(context) {
...
@@ -55,6 +55,7 @@ class SettingsPopupWindow(context: Context?) : BasePopupWindow(context) {
inner
class
ProxyClick
{
inner
class
ProxyClick
{
fun
print
()
{
fun
print
()
{
dismiss
()
"${CacheUtil.getRealName()}打印最后一条付款成功记录"
.
dXLog
()
"${CacheUtil.getRealName()}打印最后一条付款成功记录"
.
dXLog
()
scope
.
launch
{
scope
.
launch
{
kotlin
.
runCatching
{
kotlin
.
runCatching
{
...
@@ -74,7 +75,7 @@ class SettingsPopupWindow(context: Context?) : BasePopupWindow(context) {
...
@@ -74,7 +75,7 @@ class SettingsPopupWindow(context: Context?) : BasePopupWindow(context) {
}
}
}
}
}.
onSuccess
{
}.
onSuccess
{
"打印完成"
.
toastSuccess
()
}.
onFailure
{
}.
onFailure
{
}
}
}
}
...
...
app/src/main/java/com/ypsx/yppos/utils/PrintUtils.kt
View file @
02187684
package
com.ypsx.yppos.utils
package
com.ypsx.yppos.utils
import
android.device.PrinterManager
import
android.device.PrinterManager
import
android.widget.Toast
import
com.blankj.utilcode.util.Utils.runOnUiThread
import
com.ypsx.yppos.http.data.bean.OrderDetailsResponse
import
com.ypsx.yppos.http.data.bean.OrderDetailsResponse
import
com.ypsx.yppos.http.data.entity.PosPayMethod
import
com.ypsx.yppos.http.data.entity.PosPayMethod
import
com.ypsx.yppos.room.entity.PosBuy
import
com.ypsx.yppos.room.entity.PosBuy
...
@@ -319,6 +321,7 @@ object PrintUtils {
...
@@ -319,6 +321,7 @@ object PrintUtils {
status
=
printerManager
.
printPage
(
0
)
//Execution printing
status
=
printerManager
.
printPage
(
0
)
//Execution printing
printerManager
.
paperFeed
(
16
)
//paper feed
printerManager
.
paperFeed
(
16
)
//paper feed
}
}
updatePrintStatus
(
status
)
}
}
...
@@ -334,11 +337,10 @@ object PrintUtils {
...
@@ -334,11 +337,10 @@ object PrintUtils {
builder
.
append
(
" "
)
builder
.
append
(
" "
)
}
}
builder
.
append
(
content
)
builder
.
append
(
content
)
builder
.
toString
().
dXLog
()
return
builder
.
toString
()
return
builder
.
toString
()
}
}
fun
getPriceSpace
(
private
fun
getPriceSpace
(
barCode
:
String
,
barCode
:
String
,
paymentProductQuantity
:
Double
,
paymentProductQuantity
:
Double
,
price
:
Double
,
price
:
Double
,
...
@@ -398,6 +400,31 @@ object PrintUtils {
...
@@ -398,6 +400,31 @@ object PrintUtils {
return
valueLength
return
valueLength
}
}
private
fun
updatePrintStatus
(
status
:
Int
)
{
runOnUiThread
(
Runnable
{
when
(
status
)
{
PRNSTS_OUT_OF_PAPER
->
{
"缺纸!!!"
.
toast
()
}
PRNSTS_OVER_HEAT
->
{
"过温保护!!!"
.
toast
()
}
PRNSTS_UNDER_VOLTAGE
->
{
"电池电压过低!!!"
.
toast
()
}
PRNSTS_BUSY
->
{
"打印机忙!!!"
.
toast
()
}
PRNSTS_ERR
->
{
"打印机出错!!!"
.
toast
()
}
PRNSTS_ERR_DRIVER
->
{
"打印机驱动出错!!!"
.
toast
()
}
}
})
}
fun
printLast
(
fun
printLast
(
posConfig
:
PosConfig
,
posConfig
:
PosConfig
,
...
@@ -696,6 +723,7 @@ object PrintUtils {
...
@@ -696,6 +723,7 @@ object PrintUtils {
status
=
printerManager
.
printPage
(
0
)
//Execution printing
status
=
printerManager
.
printPage
(
0
)
//Execution printing
printerManager
.
paperFeed
(
16
)
//paper feed
printerManager
.
paperFeed
(
16
)
//paper feed
}
}
updatePrintStatus
(
status
)
}
}
}
}
\ No newline at end of file
app/src/main/java/com/ypsx/yppos/utils/ToastUtils.kt
View file @
02187684
...
@@ -17,7 +17,7 @@ fun String.toastSign() {
...
@@ -17,7 +17,7 @@ fun String.toastSign() {
fun
String
.
toastSuccess
()
{
fun
String
.
toastSuccess
()
{
ToastUtils
.
setView
(
R
.
layout
.
toast_
failed
)
ToastUtils
.
setView
(
R
.
layout
.
toast_
success
)
ToastUtils
.
setGravity
(
Gravity
.
CENTER
)
ToastUtils
.
setGravity
(
Gravity
.
CENTER
)
ToastUtils
.
show
(
this
)
ToastUtils
.
show
(
this
)
}
}
...
...
app/src/main/java/com/ypsx/yppos/viewmodel/request/RequestMainViewModel.kt
View file @
02187684
...
@@ -221,9 +221,13 @@ class RequestMainViewModel : BaseViewModel() {
...
@@ -221,9 +221,13 @@ class RequestMainViewModel : BaseViewModel() {
}
}
}
}
var
activitys
=
product
.
activityInfo
var
activitys
=
product
.
activityInfo
var
activitysList
:
ArrayList
<
ActivityInfoDTO
>?
=
null
if
(
activitys
!=
null
)
{
activitysList
=
arrayListOf
(
activitys
)
}
var
activityPrice
=
activitys
?.
activityPrice
?:
0.0
var
activityPrice
=
activitys
?.
activityPrice
?:
0.0
val
posBuyPart
=
InsertOrderProductDTO
(
val
posBuyPart
=
InsertOrderProductDTO
(
activitys
=
activitys
,
activitys
=
activitys
List
,
activityPrice
=
activityPrice
,
activityPrice
=
activityPrice
,
amount
=
product
.
payApportionAmount
?:
0.0
,
amount
=
product
.
payApportionAmount
?:
0.0
,
discountTotal
=
product
.
discountTotal
?:
0.0
,
discountTotal
=
product
.
discountTotal
?:
0.0
,
...
@@ -326,6 +330,7 @@ class RequestMainViewModel : BaseViewModel() {
...
@@ -326,6 +330,7 @@ class RequestMainViewModel : BaseViewModel() {
PrintUtils
.
print
(
posConfig
!!
,
it
)
PrintUtils
.
print
(
posConfig
!!
,
it
)
},
{
},
{
"打印完成"
.
dXLog
()
"打印完成"
.
dXLog
()
"打印完成"
.
toastSuccess
()
})
})
})
})
...
...
app/src/main/java/com/ypsx/yppos/viewmodel/state/SettingsViewModel.kt
View file @
02187684
...
@@ -10,6 +10,8 @@ class SettingsViewModel : BaseViewModel() {
...
@@ -10,6 +10,8 @@ class SettingsViewModel : BaseViewModel() {
var
version
=
StringObservableField
()
var
version
=
StringObservableField
()
var
storeName
=
StringObservableField
()
var
storeName
=
StringObservableField
()
var
userName
=
StringObservableField
()
var
userName
=
StringObservableField
()
var
posCode
=
StringObservableField
()
...
@@ -19,7 +21,8 @@ class SettingsViewModel : BaseViewModel() {
...
@@ -19,7 +21,8 @@ class SettingsViewModel : BaseViewModel() {
version
.
set
(
"版本号:V${AppUtils.getAppVersionName()}"
)
version
.
set
(
"版本号:V${AppUtils.getAppVersionName()}"
)
val
loginResponse
=
CacheUtil
.
getLoginResponse
()
val
loginResponse
=
CacheUtil
.
getLoginResponse
()
storeName
.
set
(
loginResponse
!!
.
loginUser
.
orgName
)
storeName
.
set
(
loginResponse
!!
.
loginUser
.
orgName
)
userName
.
set
(
"用户:${loginResponse.loginUser.realName}${loadConfig?.code}"
)
userName
.
set
(
"用户:${loginResponse.loginUser.realName}"
)
posCode
.
set
(
"机号:${loadConfig?.code}"
)
}
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
02187684
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<data>
<data>
<variable
<variable
name=
"click"
name=
"click"
type=
"com.ypsx.yppos.ui.activity.MainActivity.ProxyClick"
/>
type=
"com.ypsx.yppos.ui.activity.MainActivity.ProxyClick"
/>
...
@@ -50,6 +51,18 @@
...
@@ -50,6 +51,18 @@
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/textView13"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{vm.orderNo}"
android:textColor=
"@color/colorAccent"
android:textSize=
"14sp"
app:layout_constraintBottom_toBottomOf=
"@+id/tv_store_name"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
...
@@ -66,12 +79,12 @@
...
@@ -66,12 +79,12 @@
android:layout_height=
"30dp"
android:layout_height=
"30dp"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:background=
"@drawable/bg_search"
android:background=
"@drawable/bg_search"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:paddingStart=
"10dp"
android:paddingStart=
"10dp"
android:paddingEnd=
"10dp"
android:paddingEnd=
"10dp"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/tv_search"
app:layout_constraintEnd_toStartOf=
"@+id/tv_search"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
@@ -91,6 +104,7 @@
...
@@ -91,6 +104,7 @@
android:background=
"@android:color/transparent"
android:background=
"@android:color/transparent"
android:digits=
"1234567890"
android:digits=
"1234567890"
android:hint=
"搜索商品条码/PLU"
android:hint=
"搜索商品条码/PLU"
android:imeOptions=
"actionSearch"
android:inputType=
"number"
android:inputType=
"number"
android:lines=
"1"
android:lines=
"1"
android:maxLength=
"20"
android:maxLength=
"20"
...
@@ -105,9 +119,9 @@
...
@@ -105,9 +119,9 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:gravity=
"center"
android:onClick=
"@{()->click.search()}"
android:padding=
"10dp"
android:padding=
"10dp"
android:text=
"搜索"
android:text=
"搜索"
android:onClick=
"@{()->click.search()}"
android:textColor=
"#d9000000"
android:textColor=
"#d9000000"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
...
@@ -136,96 +150,94 @@
...
@@ -136,96 +150,94 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"35dp"
android:layout_height=
"35dp"
android:background=
"#FEFCEC"
android:background=
"#FEFCEC"
android:visibility=
"@{vm.tipsVisible}"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
android:visibility=
"@{vm.tipsVisible}"
>
<ImageView
<ImageView
android:layout_width=
"20dp"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_temp_trumpet"
android:src=
"@mipmap/ic_temp_trumpet"
/>
/>
<TextView
<TextView
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"点击按钮 扫描条形码/秤码添加商品"
android:text=
"点击按钮 扫描条形码/秤码添加商品"
android:textSize=
"16sp"
android:textColor=
"#FFF77D3E"
android:textColor=
"#FFF77D3E"
android:textSize=
"16sp"
/>
/>
<ImageView
<ImageView
android:layout_width=
"20dp"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:onClick=
"@{()->click.tips()}"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginEnd=
"10dp"
android:layout_marginEnd=
"10dp"
android:src=
"@mipmap/ic_temp_tips_close
"
android:onClick=
"@{()->click.tips()}
"
/>
android:src=
"@mipmap/ic_temp_tips_close"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:id=
"@+id/recyclerView"
android:visibility=
"@{vm.recyclerVisible}"
android:background=
"#F8F8F8"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
android:layout_weight=
"1"
android:background=
"#F8F8F8"
android:visibility=
"@{vm.recyclerVisible}"
/>
<View
<View
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"2dp"
android:layout_height=
"2dp"
android:
visibility=
"@{vm.recyclerVisible}
"
android:
background=
"@drawable/bg_shadow
"
android:
background=
"@drawable/bg_shadow
"
/>
android:
visibility=
"@{vm.recyclerVisible}
"
/>
<androidx.appcompat.widget.LinearLayoutCompat
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/ll_amount"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"60dp"
android:layout_height=
"60dp"
android:id=
"@+id/ll_amount"
android:orientation=
"horizontal"
android:visibility=
"@{vm.recyclerVisible}"
android:visibility=
"@{vm.recyclerVisible}"
>
android:orientation=
"horizontal"
>
<androidx.appcompat.widget.LinearLayoutCompat
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:orientation=
"vertical"
android:background=
"@color/white"
android:background=
"@color/white"
android:backgroundTint=
"@color/white"
>
android:backgroundTint=
"@color/white"
android:orientation=
"vertical"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:
orientation=
"horizontal
"
android:
layout_marginStart=
"10dp
"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:
layout_marginStart=
"10dp
"
>
android:
orientation=
"horizontal
"
>
<TextView
<TextView
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:text
Size=
"15sp
"
android:text
Color=
"#FF333333
"
android:text
Color=
"#FF333333
"
/>
android:text
Size=
"15sp
"
/>
<TextView
<TextView
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=
"18sp"
android:textColor=
"#FFFF4400"
android:textColor=
"#FFFF4400"
android:textSize=
"18sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{vm.payAmount}"
android:text=
"@{vm.payAmount}"
android:textSize=
"24sp"
android:textColor=
"#FFFF4400"
android:textColor=
"#FFFF4400"
android:textSize=
"24sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
</LinearLayout>
</LinearLayout>
...
@@ -233,42 +245,41 @@ android:src="@mipmap/ic_temp_tips_close"
...
@@ -233,42 +245,41 @@ android:src="@mipmap/ic_temp_tips_close"
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginStart=
"10dp"
android:layout_marginStart=
"10dp"
android:layout_marginTop=
"-3dp"
android:onClick=
"@{()->click.discount()}"
android:onClick=
"@{()->click.discount()}"
android:
layout_marginTop=
"-3dp
"
>
android:
orientation=
"horizontal
"
>
<TextView
<TextView
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:text
Size=
"15sp
"
android:text
Color=
"#FF333333
"
android:text
Color=
"#FF333333
"
/>
android:text
Size=
"15sp
"
/>
<TextView
<TextView
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=
"16sp"
android:textColor=
"#FFFF4400"
android:textColor=
"#FFFF4400"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@{vm.discount}"
android:text=
"@{vm.discount}"
android:textSize=
"16sp"
android:textColor=
"#FFFF4400"
android:textColor=
"#FFFF4400"
android:textSize=
"16sp"
android:textStyle=
"bold"
/>
android:textStyle=
"bold"
/>
<ImageView
<ImageView
android:id=
"@+id/iv_arrow"
android:id=
"@+id/iv_arrow"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_temp_up"
android:layout_marginStart=
"@dimen/dp_10"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
/>
android:layout_marginStart=
"@dimen/dp_10"
android:src=
"@mipmap/ic_temp_up"
/>
</LinearLayout>
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
...
@@ -279,8 +290,8 @@ android:src="@mipmap/ic_temp_tips_close"
...
@@ -279,8 +290,8 @@ android:src="@mipmap/ic_temp_tips_close"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#A14EFF"
android:background=
"#A14EFF"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"结算"
android:onClick=
"@{()->click.payAmount()}"
android:onClick=
"@{()->click.payAmount()}"
android:text=
"结算"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"20sp"
android:textSize=
"20sp"
...
...
app/src/main/res/layout/item_pos_product.xml
View file @
02187684
...
@@ -30,14 +30,23 @@
...
@@ -30,14 +30,23 @@
tools:text=
"条码:289771828928229"
tools:text=
"条码:289771828928229"
/>
/>
<RelativeLayout
<ImageView
android:id=
"@+id/rl_item_delete"
android:id=
"@+id/iv_item_delete"
android:layout_width=
"@dimen/dp_40"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/ic_item_delete"
/>
>
<ImageView
android:id=
"@+id/iv_item_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:src=
"@mipmap/ic_item_delete"
/>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/layout/popup_settings.xml
View file @
02187684
...
@@ -59,6 +59,14 @@
...
@@ -59,6 +59,14 @@
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"15sp"
/>
android:textSize=
"15sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:text=
"@{vm.posCode}"
android:textColor=
"@color/white"
android:textSize=
"15sp"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
base/build.gradle
View file @
02187684
...
@@ -20,10 +20,24 @@ android {
...
@@ -20,10 +20,24 @@ android {
}
}
buildTypes
{
buildTypes
{
debug
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
sit
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
pre
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
release
{
release
{
minifyEnabled
false
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
}
}
}
}
buildFeatures
{
buildFeatures
{
dataBinding
=
true
dataBinding
=
true
...
@@ -43,7 +57,7 @@ dependencies {
...
@@ -43,7 +57,7 @@ dependencies {
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation
'androidx.appcompat:appcompat:1.3.0'
implementation
'androidx.appcompat:appcompat:1.3.0'
//kotlin
//kotlin
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
'androidx.core:core-ktx:1.3.2'
implementation
'androidx.core:core-ktx:1.3.2'
//lifecycle
//lifecycle
api
'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
api
'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0'
...
...
base/src/main/java/com/ypsx/base/base/BaseApp.kt
View file @
02187684
...
@@ -4,7 +4,6 @@ import android.app.Application
...
@@ -4,7 +4,6 @@ import android.app.Application
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.ViewModelStore
import
androidx.lifecycle.ViewModelStore
import
androidx.lifecycle.ViewModelStoreOwner
import
androidx.lifecycle.ViewModelStoreOwner
import
com.hjq.toast.ToastUtils
/**
/**
* 作者 : hegaojian
* 作者 : hegaojian
...
@@ -27,8 +26,7 @@ open class BaseApp : Application(), ViewModelStoreOwner {
...
@@ -27,8 +26,7 @@ open class BaseApp : Application(), ViewModelStoreOwner {
override
fun
onCreate
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
super
.
onCreate
()
// 初始化 Toast 框架
ToastUtils
.
init
(
this
);
mAppViewModelStore
=
ViewModelStore
()
mAppViewModelStore
=
ViewModelStore
()
}
}
...
...
gradle.properties
View file @
02187684
...
@@ -23,6 +23,12 @@ RELEASE_STORE_PASSWORD=yppos123456
...
@@ -23,6 +23,12 @@ RELEASE_STORE_PASSWORD=yppos123456
RELEASE_STORE_FILE
=
./yppos.jks
RELEASE_STORE_FILE
=
./yppos.jks
# Kotlin code style for this project: "official" or "obsolete":
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style
=
official
kotlin.code.style
=
official
DEBUG_HOST
=
"http://139.196.77.98:81/"
DEBUG_HOST
=
"https://test-cpos.ypshengxian.com/"
RETURN_DEBUG_HOST
=
"http://se-regression.wmdigit.com/"
SIT_HOST
=
"https://sit-cpos.ypshengxian.com/"
RELEASE_HOST
=
"http://demo2.wmdigit.com/"
PRE_HOST
=
"https://pre-cpos.ypshengxian.com/"
\ No newline at end of file
RELEASE_HOST
=
"https://cpos.ypshengxian.com/"
#https://cpos.ypshengxian.com ʽ
#https://pre-cpos.ypshengxian.com
#https://sit-cpos.ypshengxian.com
#
https
:
//test-cpos.ypshengxian.com
\ 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