Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
machine
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hooloo
android
machine
Commits
e88d0595
Commit
e88d0595
authored
Jun 09, 2022
by
wjg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整列表金额和详情金额逻辑一致
parent
5ac25204
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
14 deletions
+15
-14
app/build.gradle
+1
-1
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
+0
-12
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
+4
-0
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
+10
-1
No files found.
app/build.gradle
View file @
e88d0595
...
@@ -20,7 +20,7 @@ android {
...
@@ -20,7 +20,7 @@ android {
}
}
manifestPlaceholders
=
[
manifestPlaceholders
=
[
JPUSH_PKGNAME
:
applicationId
,
JPUSH_PKGNAME
:
applicationId
,
JPUSH_APPKEY
:
"
682a53c0cd0201792d45c469
"
,
//JPush 上注册的包名对应的 Appkey.
JPUSH_APPKEY
:
"
59c9290134b359212290c075
"
,
//JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL
:
"developer-default"
,
//暂时填写默认值即可.
JPUSH_CHANNEL
:
"developer-default"
,
//暂时填写默认值即可.
]
]
}
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/HLApplication.java
View file @
e88d0595
package
com
.
ihaoin
.
hooloo
.
device
;
package
com
.
ihaoin
.
hooloo
.
device
;
import
android.app.Application
;
import
android.app.Application
;
import
android.os.Handler
;
import
android.os.Message
;
import
android.util.Log
;
import
android.util.Log
;
import
androidx.annotation.NonNull
;
import
com.ihaoin.hooloo.device.config.AppConfig
;
import
com.ihaoin.hooloo.device.config.AppConfig
;
import
com.ihaoin.hooloo.device.data.MainData
;
import
com.ihaoin.hooloo.device.data.MainData
;
import
com.ihaoin.hooloo.device.data.enums.OrderState
;
import
com.ihaoin.hooloo.device.data.vo.Order
;
import
com.ihaoin.hooloo.device.data.vo.OrderPkg
;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.network.HttpUtil
;
import
com.ihaoin.hooloo.device.util.CollectionUtils
;
import
com.ihaoin.hooloo.device.util.JsonUtils
;
import
com.ihaoin.hooloo.device.util.SharedPreferencesUtils
;
import
com.ihaoin.hooloo.device.util.SharedPreferencesUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.ihaoin.hooloo.device.util.StringUtils
;
import
com.umeng.commonsdk.UMConfigure
;
import
com.umeng.commonsdk.UMConfigure
;
import
java.util.ArrayList
;
import
java.util.List
;
import
cn.jpush.android.api.JPushInterface
;
import
cn.jpush.android.api.JPushInterface
;
public
class
HLApplication
extends
Application
{
public
class
HLApplication
extends
Application
{
...
...
app/src/main/java/com/ihaoin/hooloo/device/util/Utils.java
View file @
e88d0595
...
@@ -150,6 +150,10 @@ public class Utils {
...
@@ -150,6 +150,10 @@ public class Utils {
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
return
optional
.
get
();
return
optional
.
get
();
}
}
optional
=
skus
.
stream
().
filter
(
x
->
Base
.
TRUE
.
equals
(
x
.
getIsDefault
())).
findAny
();
if
(
optional
.
isPresent
())
{
return
optional
.
get
();
}
return
skus
.
get
(
0
);
return
skus
.
get
(
0
);
}
}
...
...
app/src/main/java/com/ihaoin/hooloo/device/view/GoodsDetailDialog.java
View file @
e88d0595
...
@@ -39,6 +39,7 @@ import java.util.ArrayList;
...
@@ -39,6 +39,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
public
class
GoodsDetailDialog
extends
Dialog
{
public
class
GoodsDetailDialog
extends
Dialog
{
...
@@ -133,9 +134,17 @@ public class GoodsDetailDialog extends Dialog {
...
@@ -133,9 +134,17 @@ public class GoodsDetailDialog extends Dialog {
}
}
}
}
txtName
.
setText
(
mGoods
.
getName
());
Optional
<
Sku
>
optional
=
mGoods
.
getSkus
().
stream
().
filter
(
x
->
Base
.
TRUE
.
equals
(
x
.
getIsDefault
())).
findAny
();
if
(
optional
.
isPresent
())
{
Sku
defaultSku
=
optional
.
get
();
txtPrice
.
setText
(
Utils
.
toString
(
defaultSku
.
getPrice
()));
txtDiscount
.
setText
(
Utils
.
toString
(
defaultSku
.
getDiscount
()));
}
else
{
txtPrice
.
setText
(
Utils
.
toString
(
mGoods
.
getPrice
()));
txtPrice
.
setText
(
Utils
.
toString
(
mGoods
.
getPrice
()));
txtDiscount
.
setText
(
Utils
.
toString
(
mGoods
.
getDiscount
()));
txtDiscount
.
setText
(
Utils
.
toString
(
mGoods
.
getDiscount
()));
}
txtName
.
setText
(
mGoods
.
getName
());
butnSubtract
.
setOnClickListener
(
v
->
subtractGoods
());
butnSubtract
.
setOnClickListener
(
v
->
subtractGoods
());
butnAdd
.
setOnClickListener
(
v
->
addGoods
());
butnAdd
.
setOnClickListener
(
v
->
addGoods
());
...
...
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