Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
M
magicbox
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
magicbox
Commits
4f723dc8
Commit
4f723dc8
authored
Mar 16, 2022
by
王雪伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :测试环境 [实现方案] :完整的Google支付流程
parent
499bc8e1
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
682 additions
and
384 deletions
+682
-384
MainActivity.java
...ain/java/com/zhangxin/magicbox/activity/MainActivity.java
+7
-1
version.properties
app/version.properties
+2
-2
build.gradle
build.gradle
+3
-0
NetConfig.java
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
+1
-1
GooglePayActivity.kt
...src/main/java/com/zxhl/cms/googlepay/GooglePayActivity.kt
+6
-9
GooglePayCallBack.kt
...src/main/java/com/zxhl/cms/googlepay/GooglePayCallBack.kt
+1
-3
GooglePayHelper.kt
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
+29
-28
GooglePayResult.kt
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayResult.kt
+1
-1
IShopApi.kt
cms/src/main/java/com/zxhl/cms/net/api/IShopApi.kt
+9
-0
IUserInfoApi.java
cms/src/main/java/com/zxhl/cms/net/api/IUserInfoApi.java
+3
-13
AppInEntity.kt
cms/src/main/java/com/zxhl/cms/net/model/box/AppInEntity.kt
+4
-0
PayActivity.kt
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
+110
-68
PayPresenter.kt
cms/src/main/java/com/zxhl/cms/pay/PayPresenter.kt
+27
-7
icon_google.png
cms/src/main/res/drawable-xhdpi/icon_google.png
+0
-0
activity_member.xml
cms/src/main/res/layout/activity_member.xml
+65
-7
strings.xml
cms/src/main/res/values/strings.xml
+3
-1
OrderDetailActivity.kt
...n/java/com/zxhl/main/page/activity/OrderDetailActivity.kt
+142
-41
activity_layout_order_detail.xml
...Main/src/main/res/layout/activity_layout_order_detail.xml
+264
-202
dialog_layout_box_result.xml
moduleMain/src/main/res/layout/dialog_layout_box_result.xml
+5
-0
No files found.
app/src/main/java/com/zhangxin/magicbox/activity/MainActivity.java
View file @
4f723dc8
...
@@ -4,8 +4,13 @@ import android.annotation.SuppressLint;
...
@@ -4,8 +4,13 @@ import android.annotation.SuppressLint;
import
android.app.Dialog
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageInfo
;
import
android.content.pm.PackageManager
;
import
android.content.pm.Signature
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Base64
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
...
@@ -40,6 +45,8 @@ import com.zxhl.main.page.view.DiscountDialog;
...
@@ -40,6 +45,8 @@ import com.zxhl.main.page.view.DiscountDialog;
import
com.zxhl.main.page.view.NavigationBottomView
;
import
com.zxhl.main.page.view.NavigationBottomView
;
import
com.zxhl.uc.page.fragment.UserCenterFragment
;
import
com.zxhl.uc.page.fragment.UserCenterFragment
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -121,7 +128,6 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
...
@@ -121,7 +128,6 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
}
}
});
});
}
}
private
void
initListener
()
{
private
void
initListener
()
{
...
...
app/version.properties
View file @
4f723dc8
PACKAGE_NAME
=
com.zhangxin.magicbox
PACKAGE_NAME
=
com.zhangxin.magicbox
VERSION_CODE
=
2
VERSION_CODE
=
3
VERSION_NAME
=
1.0.
0
VERSION_NAME
=
1.0.
1
build.gradle
View file @
4f723dc8
...
@@ -17,6 +17,9 @@ buildscript {
...
@@ -17,6 +17,9 @@ buildscript {
classpath
"com.mob.sdk:MobSDK:2018.0319.1724"
classpath
"com.mob.sdk:MobSDK:2018.0319.1724"
// NOTE: Do not place your application dependencies here; they belong
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
configurations
.
all
{
resolutionStrategy
.
cacheDynamicVersionsFor
0
,
'seconds'
}
}
}
}
}
...
...
cms/src/main/java/com/zxhl/cms/common/NetConfig.java
View file @
4f723dc8
...
@@ -28,6 +28,7 @@ public class NetConfig {
...
@@ -28,6 +28,7 @@ public class NetConfig {
public
static
String
BASE_FEED_URL
=
""
;
public
static
String
BASE_FEED_URL
=
""
;
public
static
final
String
URL_REPORT_BASE
=
"http://report.zhangxinhulian.com/"
;
public
static
final
String
URL_REPORT_BASE
=
"http://report.zhangxinhulian.com/"
;
public
static
final
String
HOME_BANNER_BASE_URL
=
"https://bs.zhangxinhulian.com/"
;
public
static
final
String
HOME_BANNER_BASE_URL
=
"https://bs.zhangxinhulian.com/"
;
public
static
final
String
URL_PAY_BASE
=
"http://paytest.zhangxinhulian.com/"
;
public
static
void
setBase_Url
(
Environment
s
)
{
public
static
void
setBase_Url
(
Environment
s
)
{
sEnvironment
=
s
;
sEnvironment
=
s
;
...
@@ -146,7 +147,6 @@ public class NetConfig {
...
@@ -146,7 +147,6 @@ public class NetConfig {
public
static
final
String
URL_AUTH_GOOGLE_LOGIN
=
"app/v1/auth/googleLogin"
;
//绑定谷歌登录
public
static
final
String
URL_AUTH_GOOGLE_LOGIN
=
"app/v1/auth/googleLogin"
;
//绑定谷歌登录
public
static
final
String
URL_PAY_BASE
=
"http://pay.linking100.com/"
;
///unifiedpay/gateway/google/替换包名/notify/order
///unifiedpay/gateway/google/替换包名/notify/order
public
static
final
String
URL_GOOGLE_NOTIFY
=
URL_PAY_BASE
+
"unifiedpay/gateway/google/com.zhangxin.magicbox/notify/order"
;
public
static
final
String
URL_GOOGLE_NOTIFY
=
URL_PAY_BASE
+
"unifiedpay/gateway/google/com.zhangxin.magicbox/notify/order"
;
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayActivity.kt
View file @
4f723dc8
package
com.zxhl.cms.googlepay
package
com.zxhl.cms.googlepay
import
android.util.Log
import
android.view.View
import
android.view.View
import
com.android.billingclient.api.*
import
com.android.billingclient.api.BillingClient.SkuType
import
com.ishin.google.bean.GooglePayResult
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.R
import
com.zxhl.cms.R
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.widget.LoadingDialog
import
com.zxhl.cms.widget.LoadingDialog
...
@@ -34,6 +29,7 @@ class GooglePayActivity : BaseActivity() {
...
@@ -34,6 +29,7 @@ class GooglePayActivity : BaseActivity() {
override
fun
layoutID
():
Int
{
override
fun
layoutID
():
Int
{
return
R
.
layout
.
activity_google_pay
return
R
.
layout
.
activity_google_pay
}
}
private
var
mLoading
:
LoadingDialog
?
=
null
private
var
mLoading
:
LoadingDialog
?
=
null
override
fun
init
()
{
override
fun
init
()
{
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
...
@@ -43,11 +39,12 @@ class GooglePayActivity : BaseActivity() {
...
@@ -43,11 +39,12 @@ class GooglePayActivity : BaseActivity() {
false
false
)
)
id_btn_google_pay
.
setOnClickListener
{
id_btn_google_pay
.
setOnClickListener
{
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
show
()
mLoading
?.
show
()
googlePay
?.
googlePay
(
"
0.1
"
,
object
:
GooglePayCallBack
{
googlePay
?.
googlePay
(
"
box_text_0001_1cent"
,
"6
"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
)
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
showToast
(
"success"
+
purchase
.
orderId
)
showToast
(
"success"
+
purchase
.
orderId
)
mLoading
?.
setResult
(
true
,
"
pay
success"
,
1000
)
mLoading
?.
setResult
(
true
,
"
Pay for
success"
,
1000
)
}
}
override
fun
onCancel
()
{
override
fun
onCancel
()
{
...
@@ -62,7 +59,7 @@ class GooglePayActivity : BaseActivity() {
...
@@ -62,7 +59,7 @@ class GooglePayActivity : BaseActivity() {
})
})
}
}
// startConnection()
// startConnection()
googlePay
=
GooglePayHelper
(
this
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
googlePay
?.
init
()
}
}
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayCallBack.kt
View file @
4f723dc8
package
com.zxhl.cms.googlepay
package
com.zxhl.cms.googlepay
import
com.ishin.google.bean.GooglePayResult
/**
/**
* @author (wangXuewei)
* @author (wangXuewei)
* @datetime 2022-03-14 16:49 GMT+8
* @datetime 2022-03-14 16:49 GMT+8
...
@@ -9,7 +7,7 @@ import com.ishin.google.bean.GooglePayResult
...
@@ -9,7 +7,7 @@ import com.ishin.google.bean.GooglePayResult
*/
*/
interface
GooglePayCallBack
{
interface
GooglePayCallBack
{
fun
onPaySuccess
(
purchase
:
GooglePayResult
)
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
fun
onCancel
()
fun
onCancel
()
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayHelper.kt
View file @
4f723dc8
...
@@ -5,15 +5,12 @@ import android.util.Log
...
@@ -5,15 +5,12 @@ import android.util.Log
import
com.android.billingclient.api.*
import
com.android.billingclient.api.*
import
com.android.billingclient.api.BillingClient.BillingResponseCode
import
com.android.billingclient.api.BillingClient.BillingResponseCode
import
com.android.billingclient.api.BillingClient.SkuType
import
com.android.billingclient.api.BillingClient.SkuType
import
com.ishin.google.bean.GooglePayResult
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.AppContext
import
com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.ApiClient
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.RxSchedulers
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.net.callback.BaseObserver
import
com.zxhl.cms.net.model.other.AnyEntity
import
com.zxhl.cms.net.model.other.AnyEntity
import
com.zxhl.cms.net.model.uc.AliPayEntity
import
com.zxhl.cms.net.model.uc.GooglePayEntity
import
com.zxhl.cms.net.model.uc.GooglePayEntity
import
com.zxhl.cms.pay.alipay.AlipayServer
import
com.zxhl.cms.utils.EventUtils
import
com.zxhl.cms.utils.EventUtils
...
@@ -48,6 +45,8 @@ class GooglePayHelper {
...
@@ -48,6 +45,8 @@ class GooglePayHelper {
if
(!
purchases
.
isNullOrEmpty
())
{
if
(!
purchases
.
isNullOrEmpty
())
{
for
(
i
in
0
until
purchases
.
size
)
{
for
(
i
in
0
until
purchases
.
size
)
{
var
purchase
=
purchases
[
i
];
var
purchase
=
purchases
[
i
];
Log
.
d
(
TAG
,
"detail ${purchase.originalJson}"
)
Log
.
d
(
TAG
,
"obfuscatedAccountid $obfuscatedAccountid"
)
var
googlePayResult
=
GooglePayResult
()
var
googlePayResult
=
GooglePayResult
()
googlePayResult
.
packageName
=
purchase
.
packageName
googlePayResult
.
packageName
=
purchase
.
packageName
googlePayResult
.
orderId
=
purchase
.
orderId
googlePayResult
.
orderId
=
purchase
.
orderId
...
@@ -57,8 +56,8 @@ class GooglePayHelper {
...
@@ -57,8 +56,8 @@ class GooglePayHelper {
googlePayResult
.
purchaseTime
=
purchase
.
purchaseTime
.
toString
()
googlePayResult
.
purchaseTime
=
purchase
.
purchaseTime
.
toString
()
googlePayResult
.
purchaseState
=
purchase
.
purchaseState
.
toString
()
googlePayResult
.
purchaseState
=
purchase
.
purchaseState
.
toString
()
googlePayResult
.
purchaseToken
=
purchase
.
purchaseToken
googlePayResult
.
purchaseToken
=
purchase
.
purchaseToken
//
同步后台
消耗掉
//
购买成功
消耗掉
updateToService
(
googlePayResult
)
consume
(
googlePayResult
,
purchase
)
}
}
}
}
}
else
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
ITEM_ALREADY_OWNED
)
{
}
else
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
ITEM_ALREADY_OWNED
)
{
...
@@ -198,7 +197,7 @@ class GooglePayHelper {
...
@@ -198,7 +197,7 @@ class GooglePayHelper {
*
*
* @param purchaseToken 商品token
* @param purchaseToken 商品token
*/
*/
private
fun
consume
(
googlePayResult
:
GooglePayResult
)
{
private
fun
consume
(
googlePayResult
:
GooglePayResult
,
purchase
:
Purchase
)
{
if
(
billingClient
.
isReady
)
{
if
(
billingClient
.
isReady
)
{
val
consumeParams
=
val
consumeParams
=
ConsumeParams
.
newBuilder
()
ConsumeParams
.
newBuilder
()
...
@@ -210,7 +209,8 @@ class GooglePayHelper {
...
@@ -210,7 +209,8 @@ class GooglePayHelper {
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
OK
)
{
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
OK
)
{
// Handle the success of the consume operation.
// Handle the success of the consume operation.
Log
.
d
(
TAG
,
"consume 消耗成功${googlePayResult.purchaseToken}"
)
Log
.
d
(
TAG
,
"consume 消耗成功${googlePayResult.purchaseToken}"
)
mPayCallBack
?.
onPaySuccess
(
googlePayResult
)
//支付成功
//同步后台 消耗掉
updateToService
(
googlePayResult
,
purchase
)
productId
=
""
productId
=
""
obfuscatedAccountid
=
""
obfuscatedAccountid
=
""
}
else
{
}
else
{
...
@@ -233,7 +233,10 @@ class GooglePayHelper {
...
@@ -233,7 +233,10 @@ class GooglePayHelper {
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
OK
)
{
if
(
billingResult
.
responseCode
==
BillingResponseCode
.
OK
)
{
// Handle the success of the consume operation.
// Handle the success of the consume operation.
Log
.
d
(
TAG
,
"consume 消耗成功${googlePayResult.purchaseToken}"
)
Log
.
d
(
TAG
,
"consume 消耗成功${googlePayResult.purchaseToken}"
)
mPayCallBack
?.
onPaySuccess
(
googlePayResult
)
//支付成功
//同步后台 消耗掉
updateToService
(
googlePayResult
,
purchase
)
productId
=
""
obfuscatedAccountid
=
""
}
else
{
}
else
{
Log
.
d
(
TAG
,
"consume 消耗失败 code:"
+
billingResult
.
responseCode
)
Log
.
d
(
TAG
,
"consume 消耗失败 code:"
+
billingResult
.
responseCode
)
mPayCallBack
?.
onError
(
"consume 消耗失败 code:"
+
billingResult
.
responseCode
+
" msg:"
+
billingResult
.
debugMessage
)
mPayCallBack
?.
onError
(
"consume 消耗失败 code:"
+
billingResult
.
responseCode
+
" msg:"
+
billingResult
.
debugMessage
)
...
@@ -248,7 +251,7 @@ class GooglePayHelper {
...
@@ -248,7 +251,7 @@ class GooglePayHelper {
override
fun
onBillingServiceDisconnected
()
{
override
fun
onBillingServiceDisconnected
()
{
// Try to restart the connection on the next request to
// Try to restart the connection on the next request to
// Google Play by calling the startConnection() method.
// Google Play by calling the startConnection() method.
mPayCallBack
?.
onError
(
"consume onBillingServiceDisconnected"
)
mPayCallBack
?.
onError
(
"consume onBillingServiceDisconnected"
)
}
}
})
})
}
}
...
@@ -356,16 +359,17 @@ class GooglePayHelper {
...
@@ -356,16 +359,17 @@ class GooglePayHelper {
/**
/**
* google支付
* google支付
*/
*/
fun
googlePay
(
goodsId
:
String
,
payCallBack
:
GooglePayCallBack
)
{
fun
googlePay
(
goodsId
:
String
,
payMode
:
String
,
payCallBack
:
GooglePayCallBack
)
{
mPayCallBack
=
payCallBack
mPayCallBack
=
payCallBack
//向服务端获取订单ID
//向服务端获取订单ID
ApiClient
.
userInfoAPi
.
googlePay
(
goodsId
,
"4"
,
""
,
""
,
"6"
)
ApiClient
.
userInfoAPi
.
googlePay
(
goodsId
,
"4"
,
""
,
""
,
payMode
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
GooglePayEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
GooglePayEntity
>()
{
override
fun
onSuccess
(
result
:
GooglePayEntity
?)
{
override
fun
onSuccess
(
result
:
GooglePayEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
Log
.
d
(
TAG
,
"请求支付"
)
var
sku
=
goodsId
.
replace
(
"-"
,
"_"
)
purchase
(
"box_text_0001_1cent"
,
result
.
outTradeNo
?:
""
)
Log
.
d
(
TAG
,
"请求支付${sku}"
)
purchase
(
"xymh_$sku"
,
result
.
outTradeNo
?:
""
)
}
else
{
}
else
{
Log
.
d
(
TAG
,
"未获取到订单"
)
Log
.
d
(
TAG
,
"未获取到订单"
)
mPayCallBack
?.
onError
(
"GooglePay 未获取到订单数据"
)
mPayCallBack
?.
onError
(
"GooglePay 未获取到订单数据"
)
...
@@ -379,29 +383,26 @@ class GooglePayHelper {
...
@@ -379,29 +383,26 @@ class GooglePayHelper {
})
})
}
}
fun
updateToService
(
purchase
:
GooglePayResult
)
{
/**
* google支付 成功后 同步给服务器
*/
private
fun
updateToService
(
googlePayResult
:
GooglePayResult
,
purchase
:
Purchase
)
{
//支付成功 向后端同步 网络问题再次重试
//支付成功 向后端同步 网络问题再次重试
ApiClient
.
userInfoAPi
.
googlePaySuccess
(
ApiClient
.
shopApi
.
googlePaySuccess
(
googlePayResult
)
purchase
.
packageName
,
.
compose
(
RxSchedulers
.
observableIO2Main
())
purchase
.
orderId
,
.
subscribe
(
object
:
BaseObserver
<
Any
>()
{
purchase
.
productId
,
override
fun
onSuccess
(
result
:
Any
?)
{
purchase
.
developerPayload
,
purchase
.
obfuscatedAccountid
,
purchase
.
purchaseTime
,
purchase
.
purchaseState
,
purchase
.
purchaseToken
).
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
AnyEntity
?>()
{
override
fun
onSuccess
(
result
:
AnyEntity
?)
{
EventUtils
.
onEvent
(
"googlepaysuccess_onsuccess"
)
EventUtils
.
onEvent
(
"googlepaysuccess_onsuccess"
)
mPayCallBack
?.
onPaySuccess
(
googlePayResult
,
purchase
.
originalJson
)
//支付成功
if
(
result
!=
null
)
{
}
}
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
EventUtils
.
onEvent
(
"googlepaysuccess_onfailure"
,
"${errorMsg}"
)
EventUtils
.
onEvent
(
"googlepaysuccess_onfailure"
,
"${errorMsg}"
)
mPayCallBack
?.
onError
(
"服务器同步失败 code:$code msg:$errorMsg"
)
}
}
})
})
//同步成功 消耗掉
consume
(
purchase
)
}
}
...
...
cms/src/main/java/com/zxhl/cms/googlepay/GooglePayResult.kt
View file @
4f723dc8
package
com.
ishin.google.bean
package
com.
zxhl.cms.googlepay
class
GooglePayResult
{
class
GooglePayResult
{
...
...
cms/src/main/java/com/zxhl/cms/net/api/IShopApi.kt
View file @
4f723dc8
...
@@ -2,6 +2,8 @@ package com.zxhl.cms.net.api
...
@@ -2,6 +2,8 @@ package com.zxhl.cms.net.api
import
com.zxhl.cms.ad.upload.model.Response
import
com.zxhl.cms.ad.upload.model.Response
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.googlepay.GooglePayResult
import
com.zxhl.cms.net.model.box.AddressEntity
import
com.zxhl.cms.net.model.shop.ShopEntity
import
com.zxhl.cms.net.model.shop.ShopEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
retrofit2.http.*
import
retrofit2.http.*
...
@@ -16,5 +18,12 @@ interface IShopApi {
...
@@ -16,5 +18,12 @@ interface IShopApi {
@Query
(
"category"
)
category
:
String
@Query
(
"category"
)
category
:
String
):
Observable
<
Response
<
ShopEntity
>>
):
Observable
<
Response
<
ShopEntity
>>
/**
* google支付成功后 通知后台
*/
@POST
(
NetConfig
.
User
.
URL_GOOGLE_NOTIFY
)
fun
googlePaySuccess
(
@Body
entity
:
GooglePayResult
?
):
Observable
<
Response
<
Any
>>
}
}
\ No newline at end of file
cms/src/main/java/com/zxhl/cms/net/api/IUserInfoApi.java
View file @
4f723dc8
...
@@ -2,6 +2,8 @@ package com.zxhl.cms.net.api;
...
@@ -2,6 +2,8 @@ package com.zxhl.cms.net.api;
import
com.zxhl.cms.ad.upload.model.Response
;
import
com.zxhl.cms.ad.upload.model.Response
;
import
com.zxhl.cms.common.NetConfig
;
import
com.zxhl.cms.common.NetConfig
;
import
com.zxhl.cms.googlepay.GooglePayResult
;
import
com.zxhl.cms.net.model.box.AddressEntity
;
import
com.zxhl.cms.net.model.other.AnyEntity
;
import
com.zxhl.cms.net.model.other.AnyEntity
;
import
com.zxhl.cms.net.model.uc.AliPayEntity
;
import
com.zxhl.cms.net.model.uc.AliPayEntity
;
import
com.zxhl.cms.net.model.uc.GooglePayEntity
;
import
com.zxhl.cms.net.model.uc.GooglePayEntity
;
...
@@ -14,6 +16,7 @@ import com.zxhl.cms.net.model.uc.WeChatPayEntity;
...
@@ -14,6 +16,7 @@ import com.zxhl.cms.net.model.uc.WeChatPayEntity;
import
com.zxhl.cms.net.model.video.MemberEntity
;
import
com.zxhl.cms.net.model.video.MemberEntity
;
import
io.reactivex.Observable
;
import
io.reactivex.Observable
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.GET
;
import
retrofit2.http.POST
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
import
retrofit2.http.Query
;
...
@@ -90,19 +93,6 @@ public interface IUserInfoApi {
...
@@ -90,19 +93,6 @@ public interface IUserInfoApi {
@POST
(
NetConfig
.
User
.
URL_PAY_ORDER
)
@POST
(
NetConfig
.
User
.
URL_PAY_ORDER
)
Observable
<
Response
<
GooglePayEntity
>>
googlePay
(
@Query
(
"goodsId"
)
String
goodsId
,
@Query
(
"payType"
)
String
payType
,
@Query
(
"voucherId"
)
String
voucherId
,
@Query
(
"appId"
)
String
appId
,
@Query
(
"payMode"
)
String
payMode
);
Observable
<
Response
<
GooglePayEntity
>>
googlePay
(
@Query
(
"goodsId"
)
String
goodsId
,
@Query
(
"payType"
)
String
payType
,
@Query
(
"voucherId"
)
String
voucherId
,
@Query
(
"appId"
)
String
appId
,
@Query
(
"payMode"
)
String
payMode
);
/**
* google支付成功后 通知后台
*/
@POST
(
NetConfig
.
User
.
URL_GOOGLE_NOTIFY
)
Observable
<
Response
<
AnyEntity
>>
googlePaySuccess
(
@Query
(
"packageName"
)
String
packageName
,
@Query
(
"orderId"
)
String
orderId
,
@Query
(
"productId"
)
String
productId
,
@Query
(
"developerPayload"
)
String
developerPayload
,
@Query
(
"obfuscatedAccountid"
)
String
obfuscatedAccountid
,
@Query
(
"purchaseTime"
)
String
purchaseTime
,
@Query
(
"purchaseState"
)
String
purchaseState
,
@Query
(
"purchaseToken"
)
String
purchaseToken
);
/**
/**
* 商城商品支付宝支付
* 商城商品支付宝支付
...
...
cms/src/main/java/com/zxhl/cms/net/model/box/AppInEntity.kt
View file @
4f723dc8
package
com.zxhl.cms.net.model.box
package
com.zxhl.cms.net.model.box
import
com.umeng.commonsdk.debug.I
class
AppInEntity
{
class
AppInEntity
{
var
pay_ali
:
String
?
=
""
var
pay_ali
:
String
?
=
""
var
pay_wx
:
String
?
=
""
var
pay_wx
:
String
?
=
""
var
pay_google
:
String
=
"0"
var
pay_paypal
:
String
=
"0"
var
pay_wx_type
:
Int
?
=
0
var
pay_wx_type
:
Int
?
=
0
var
feedback_open
:
String
?
=
""
var
feedback_open
:
String
?
=
""
var
depots_text
:
String
?
=
""
var
depots_text
:
String
?
=
""
...
...
cms/src/main/java/com/zxhl/cms/pay/PayActivity.kt
View file @
4f723dc8
package
com.zxhl.cms.pay
package
com.zxhl.cms.pay
import
android.content.Intent
import
android.os.Handler
import
android.os.Handler
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
android.util.Log
import
android.view.View
import
android.view.View
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.GridLayoutManager
import
com.paypal.checkout.PayPalCheckout
import
com.paypal.checkout.approve.OnApprove
import
com.paypal.checkout.approve.OnApprove
import
com.paypal.checkout.cancel.OnCancel
import
com.paypal.checkout.cancel.OnCancel
import
com.paypal.checkout.createorder.CreateOrder
import
com.paypal.checkout.createorder.CreateOrder
...
@@ -23,14 +21,15 @@ import com.zxhl.cms.R
...
@@ -23,14 +21,15 @@ import com.zxhl.cms.R
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.googlepay.GooglePayActivity
import
com.zxhl.cms.googlepay.GooglePayCallBack
import
com.zxhl.cms.googlepay.GooglePayHelper
import
com.zxhl.cms.googlepay.GooglePayResult
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.SettingPreference
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.utils.*
import
com.zxhl.cms.utils.*
import
com.zxhl.cms.utils.EventUtils.onEvent
import
com.zxhl.cms.utils.EventUtils.onEvent
import
com.zxhl.cms.widget.LoadingDialog
import
com.zxhl.cms.widget.LoadingDialog
import
com.zxhl.cms.widget.RecyclerViewSpacesItemDecoration
import
com.zxhl.novel.utils.server.PayResultEntity
import
com.zxhl.novel.utils.server.PayResultEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
...
@@ -51,7 +50,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -51,7 +50,7 @@ class PayActivity : BaseActivity(), PayContract.View,
private
var
mPresenter
:
PayContract
.
Presenter
?
=
null
private
var
mPresenter
:
PayContract
.
Presenter
?
=
null
private
var
mAdapter
:
PayAdapter
?
=
null
private
var
mAdapter
:
PayAdapter
?
=
null
private
var
needPrice
:
String
?
=
""
private
var
needPrice
:
String
?
=
"
0
"
private
var
mLoading
:
LoadingDialog
?
=
null
private
var
mLoading
:
LoadingDialog
?
=
null
private
var
payResultObservable
:
Observable
<
PayResultEntity
>?
=
null
private
var
payResultObservable
:
Observable
<
PayResultEntity
>?
=
null
...
@@ -64,6 +63,8 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -64,6 +63,8 @@ class PayActivity : BaseActivity(), PayContract.View,
companion
object
{
companion
object
{
const
val
ALI_PAY
=
1
//支付宝支付类型
const
val
ALI_PAY
=
1
//支付宝支付类型
const
val
WECHAT_PAY
=
2
//微信支付类型
const
val
WECHAT_PAY
=
2
//微信支付类型
const
val
GOOGLE_PAY
=
4
//Google支付类型
const
val
PAY_PAL_PAY
=
5
//PayPal支付类型
const
val
MINI_PROGRAM
=
11
//微信支付类型
const
val
MINI_PROGRAM
=
11
//微信支付类型
const
val
MIN_PAY_PROGRAM
=
12
//敏付
const
val
MIN_PAY_PROGRAM
=
12
//敏付
}
}
...
@@ -76,13 +77,16 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -76,13 +77,16 @@ class PayActivity : BaseActivity(), PayContract.View,
override
fun
init
()
{
override
fun
init
()
{
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
this
,
this
,
getString
(
com
.
zxhl
.
cms
.
R
.
string
.
wait_ing
),
getString
(
com
.
zxhl
.
cms
.
R
.
string
.
wait_ing
),
false
,
false
,
false
false
)
)
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
id_img_back
?.
setOnClickListener
{
id_img_back
?.
setOnClickListener
{
finish
()
finish
()
}
}
...
@@ -97,19 +101,24 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -97,19 +101,24 @@ class PayActivity : BaseActivity(), PayContract.View,
}
}
id_rl_wechat_pay
?.
setOnClickListener
{
id_rl_wechat_pay
?.
setOnClickListener
{
//pay_type = MIN_PAY_PROGRAM
//pay_type = MIN_PAY_PROGRAM
id_img_wechat
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
selectPayType
(
2
)
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
}
}
id_rl_zfb_pay
?.
setOnClickListener
{
id_rl_zfb_pay
?.
setOnClickListener
{
pay_type
=
ALI_PAY
pay_type
=
ALI_PAY
id_img_wechat
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
selectPayType
(
1
)
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
id_rl_google_pay
?.
setOnClickListener
{
pay_type
=
GOOGLE_PAY
selectPayType
(
3
)
}
id_rl_paypal_pay
?.
setOnClickListener
{
pay_type
=
PAY_PAL_PAY
selectPayType
(
4
)
}
}
EventUtils
.
onEvent
(
"pay_page_show"
,
"充值页展示"
)
EventUtils
.
onEvent
(
"pay_page_show"
,
"充值页展示"
)
boxid
=
intent
?.
data
?.
getQueryParameter
(
"boxid"
)
?:
""
boxid
=
intent
?.
data
?.
getQueryParameter
(
"boxid"
)
?:
""
needPrice
=
intent
?.
data
?.
getQueryParameter
(
"price"
)
?:
"0"
//
needPrice = intent?.data?.getQueryParameter("price") ?: "0"
Log
.
e
(
"MXL"
,
"NeedPrice"
+
needPrice
)
//
Log.e("MXL", "NeedPrice" + needPrice)
if
(!
TextUtils
.
isEmpty
(
needPrice
))
{
if
(!
TextUtils
.
isEmpty
(
needPrice
))
{
if
(
needPrice
?.
toDouble
()
?.
toString
()
?.
contains
(
"."
)
==
true
)
{
if
(
needPrice
?.
toDouble
()
?.
toString
()
?.
contains
(
"."
)
==
true
)
{
if
(
TextUtils
.
equals
(
needPrice
?.
toDouble
()
?.
toString
(),
"9.9"
))
{
if
(
TextUtils
.
equals
(
needPrice
?.
toDouble
()
?.
toString
(),
"9.9"
))
{
...
@@ -142,10 +151,10 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -142,10 +151,10 @@ class PayActivity : BaseActivity(), PayContract.View,
id_ll_pay_bottom
?.
setOnClickListener
{
id_ll_pay_bottom
?.
setOnClickListener
{
if
(
pay_type
==
0
)
{
if
(
pay_type
==
0
)
{
Utils
.
showToast
(
this
,
"
请选择支付类型
"
)
Utils
.
showToast
(
this
,
"
Please select payment type
"
)
return
@setOnClickListener
return
@setOnClickListener
}
}
mLoading
?.
setLoading
(
"
请稍后
"
)
mLoading
?.
setLoading
(
"
Loading
"
)
mLoading
?.
show
()
mLoading
?.
show
()
EventUtils
.
onEvent
(
"pay_page_pay_btn"
,
product
?.
cash
+
""
)
EventUtils
.
onEvent
(
"pay_page_pay_btn"
,
product
?.
cash
+
""
)
if
(
ifChooseNeedPrice
!!
)
{
if
(
ifChooseNeedPrice
!!
)
{
...
@@ -176,13 +185,17 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -176,13 +185,17 @@ class PayActivity : BaseActivity(), PayContract.View,
}
else
{
}
else
{
if
(
pay_type
==
1
)
{
if
(
pay_type
==
ALI_PAY
)
{
mPresenter
?.
requestAliPay
(
mPresenter
?.
requestAliPay
(
this
,
this
,
product
?.
goodsId
?:
""
,
product
?.
goodsId
?:
""
,
pay_type
.
toString
(),
pay_type
.
toString
(),
"6"
"6"
)
)
}
else
if
(
pay_type
==
GOOGLE_PAY
)
{
googlePay
(
product
?.
goodsId
?:
""
)
}
else
if
(
pay_type
==
PAY_PAL_PAY
)
{
}
else
{
}
else
{
if
(
pay_type
==
2
)
{
if
(
pay_type
==
2
)
{
Log
.
e
(
"MXL"
,
"2微信原生支付"
)
Log
.
e
(
"MXL"
,
"2微信原生支付"
)
...
@@ -242,9 +255,10 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -242,9 +255,10 @@ class PayActivity : BaseActivity(), PayContract.View,
}
}
EventUtils
.
onEvent
(
"member_page_show"
)
EventUtils
.
onEvent
(
"member_page_show"
)
startActivity
(
Intent
(
this
,
GooglePayActivity
::
class
.
java
))
//
startActivity(Intent(this,GooglePayActivity::class.java))
initPaypal
()
//
initPaypal()
// payPalPay()
// payPalPay()
}
}
...
@@ -275,37 +289,17 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -275,37 +289,17 @@ class PayActivity : BaseActivity(), PayContract.View,
}
}
}
}
mAdapter
=
PayAdapter
(
this
,
itemlayout
)
mAdapter
=
PayAdapter
(
this
,
itemlayout
)
// val widthScreen = windowManager?.defaultDisplay?.width
// val widthDecoration = (widthScreen!! - Utils.dip2px(20 * 2) - Utils.dip2px(93 * 3)) / 6
val
gridLayoutManager
:
GridLayoutManager
=
object
:
GridLayoutManager
(
this
,
3
)
{
val
gridLayoutManager
:
GridLayoutManager
=
object
:
GridLayoutManager
(
this
,
3
)
{
override
fun
canScrollVertically
():
Boolean
{
override
fun
canScrollVertically
():
Boolean
{
return
false
return
false
}
}
}
}
id_activity_member_list
?.
layoutManager
=
gridLayoutManager
id_activity_member_list
?.
layoutManager
=
gridLayoutManager
// val stringIntegerHashMap: HashMap<String, Int> = HashMap()
// stringIntegerHashMap[RecyclerViewSpacesItemDecoration.TOP_DECORATION] =
// Utils.dip2px(7) //top间距
// stringIntegerHashMap[RecyclerViewSpacesItemDecoration.BOTTOM_DECORATION] =
// Utils.dip2px(7) //底部间距
// stringIntegerHashMap[RecyclerViewSpacesItemDecoration.LEFT_DECORATION] =
// widthDecoration //左间距
// stringIntegerHashMap[RecyclerViewSpacesItemDecoration.RIGHT_DECORATION] =
// widthDecoration //右间距
// id_activity_member_list?.addItemDecoration(
// RecyclerViewSpacesItemDecoration(
// stringIntegerHashMap
// )
// )
id_activity_member_list
?.
adapter
=
mAdapter
id_activity_member_list
?.
adapter
=
mAdapter
mAdapter
?.
clear
()
mAdapter
?.
clear
()
mAdapter
?.
appendToList
(
data
)
mAdapter
?.
appendToList
(
data
)
checkChoose
()
checkChoose
()
// if (data.size >= 3) {
// mAdapter?.setPosition(2)
// }
mAdapter
?.
notifyDataSetChanged
()
mAdapter
?.
notifyDataSetChanged
()
}
}
...
@@ -316,7 +310,6 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -316,7 +310,6 @@ class PayActivity : BaseActivity(), PayContract.View,
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
,
data
:
MemberEntity
.
ProductDetail
?)
{
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
,
data
:
MemberEntity
.
ProductDetail
?)
{
this
.
product
=
data
this
.
product
=
data
ifChooseNeedPrice
=
false
ifChooseNeedPrice
=
false
id_rl_buy_bg
?.
setBackgroundResource
(
R
.
drawable
.
shape_need_price_bg
)
id_rl_buy_bg
?.
setBackgroundResource
(
R
.
drawable
.
shape_need_price_bg
)
EventUtils
.
onEvent
(
"member_page_item_click"
,
data
?.
cash
+
""
)
EventUtils
.
onEvent
(
"member_page_item_click"
,
data
?.
cash
+
""
)
}
}
...
@@ -324,10 +317,10 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -324,10 +317,10 @@ class PayActivity : BaseActivity(), PayContract.View,
private
fun
showResultLoading
(
isPaySuc
:
Boolean
)
{
private
fun
showResultLoading
(
isPaySuc
:
Boolean
)
{
if
(
isPaySuc
)
{
if
(
isPaySuc
)
{
EventUtils
.
onEvent
(
"pay_suc"
)
EventUtils
.
onEvent
(
"pay_suc"
)
mLoading
?.
setResult
(
true
,
"
支付成功
"
,
1000
)
mLoading
?.
setResult
(
true
,
"
Pay for success
"
,
1000
)
}
else
{
}
else
{
EventUtils
.
onEvent
(
"pay_fail"
)
EventUtils
.
onEvent
(
"pay_fail"
)
mLoading
?.
setResult
(
false
,
"
支付失败
"
,
1000
)
mLoading
?.
setResult
(
false
,
"
Pay for failure
"
,
1000
)
}
}
}
}
...
@@ -350,16 +343,16 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -350,16 +343,16 @@ class PayActivity : BaseActivity(), PayContract.View,
override
fun
verifyOrderSuc
(
orsder
:
String
)
{
override
fun
verifyOrderSuc
(
orsder
:
String
)
{
Log
.
e
(
"MXL"
,
"充值成功,更新余额"
)
Log
.
e
(
"MXL"
,
"充值成功,更新余额"
)
showResultLoading
(
true
)
RxBus
.
get
().
post
(
Constant
.
finish_activity
,
1
)
RxBus
.
get
().
post
(
Constant
.
finish_activity
,
1
)
UserDataUtils
.
updateUserInfo
(
this
)
UserDataUtils
.
updateUserInfo
(
this
)
showResultLoading
(
true
)
}
}
override
fun
setCanInvest
(
boolean
:
Boolean
?)
{
override
fun
setCanInvest
(
boolean
:
Boolean
?)
{
if
(
boolean
==
true
)
{
if
(
boolean
==
true
)
{
}
else
{
}
else
{
Utils
.
showToast
(
this
,
"
充值上限,无法充值
"
)
Utils
.
showToast
(
this
,
"
Top up limit, unable to top up
"
)
}
}
}
}
...
@@ -369,37 +362,57 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -369,37 +362,57 @@ class PayActivity : BaseActivity(), PayContract.View,
override
fun
setAppInfo
(
result
:
AppInEntity
?)
{
override
fun
setAppInfo
(
result
:
AppInEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
id_rl_wechat_pay
.
visibility
=
View
.
GONE
if
(
result
.
pay_ali
.
equals
(
"1"
)
&&
result
.
pay_wx
.
equals
(
"0"
))
{
id_rl_zfb_pay
.
visibility
=
View
.
GONE
pay_type
=
ALI_PAY
id_rl_google_pay
.
visibility
=
View
.
GONE
id_rl_wechat_pay
.
visibility
=
View
.
GONE
id_rl_paypal_pay
.
visibility
=
View
.
GONE
if
(
result
.
pay_ali
==
"1"
)
{
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
pay_type
=
ALI_PAY
}
else
{
selectPayType
(
1
)
if
(
result
?.
pay_ali
.
equals
(
"0"
))
{
id_rl_zfb_pay
.
visibility
=
View
.
GONE
}
else
{
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
}
if
(
result
?.
pay_wx
.
equals
(
"0"
))
{
id_rl_wechat_pay
.
visibility
=
View
.
GONE
}
else
{
id_rl_wechat_pay
.
visibility
=
View
.
VISIBLE
pay_type
=
result
?.
pay_wx_type
id_img_wechat
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
}
}
}
if
(
result
.
pay_wx
==
"1"
)
{
id_rl_wechat_pay
.
visibility
=
View
.
VISIBLE
pay_type
=
result
.
pay_wx_type
selectPayType
(
2
)
}
if
(
result
.
pay_paypal
==
"1"
)
{
id_rl_paypal_pay
.
visibility
=
View
.
VISIBLE
pay_type
=
PAY_PAL_PAY
selectPayType
(
4
)
}
if
(
result
.
pay_google
==
"1"
)
{
id_rl_google_pay
.
visibility
=
View
.
VISIBLE
pay_type
=
GOOGLE_PAY
selectPayType
(
3
)
}
}
}
private
fun
selectPayType
(
type
:
Int
)
{
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_wechat
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_google
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_paypal
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
when
(
type
)
{
1
->
{
id_img_ali
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
2
->
{
id_img_wechat
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
3
->
{
id_img_google
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
4
->
{
id_img_paypal
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
}
}
}
}
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
googlePay
?.
release
()
if
(
payResultObservable
!=
null
)
if
(
payResultObservable
!=
null
)
RxBus
.
get
().
unregister
(
Constant
.
PAY_RESULT
,
payResultObservable
!!
)
RxBus
.
get
().
unregister
(
Constant
.
PAY_RESULT
,
payResultObservable
!!
)
}
}
...
@@ -408,7 +421,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -408,7 +421,7 @@ class PayActivity : BaseActivity(), PayContract.View,
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
if
(
isPause
)
{
if
(
isPause
)
{
mHandler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
//
mHandler?.sendEmptyMessageDelayed(0, 2000)
}
}
}
}
...
@@ -455,7 +468,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -455,7 +468,7 @@ class PayActivity : BaseActivity(), PayContract.View,
0
->
{
0
->
{
if
(
mLoading
!=
null
)
{
if
(
mLoading
!=
null
)
{
EventUtils
?.
onEvent
(
"canle_pay"
,
"取消支付"
)
EventUtils
?.
onEvent
(
"canle_pay"
,
"取消支付"
)
mLoading
?.
setResult
(
false
,
"
取消支付
"
,
1000
)
mLoading
?.
setResult
(
false
,
"
cancel
"
,
1000
)
}
}
}
}
}
}
...
@@ -497,6 +510,7 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -497,6 +510,7 @@ class PayActivity : BaseActivity(), PayContract.View,
Log
.
d
(
"id_PayPal_btn"
,
" OnCancel Buyer canceled the PayPal experience."
)
Log
.
d
(
"id_PayPal_btn"
,
" OnCancel Buyer canceled the PayPal experience."
)
}
}
)
)
// id_PayPal_btn?.callOnClick()
}
}
fun
payPalPay
()
{
fun
payPalPay
()
{
...
@@ -539,4 +553,32 @@ class PayActivity : BaseActivity(), PayContract.View,
...
@@ -539,4 +553,32 @@ class PayActivity : BaseActivity(), PayContract.View,
id_PayPal_btn
.
callOnClick
()
id_PayPal_btn
.
callOnClick
()
}
}
var
googlePay
:
GooglePayHelper
?
=
null
private
fun
googlePay
(
goodsId
:
String
)
{
if
(
goodsId
==
""
)
{
return
}
mLoading
?.
setLoading
(
getString
(
R
.
string
.
wait_ing2
))
mLoading
?.
show
()
googlePay
?.
googlePay
(
goodsId
,
"6"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
mPresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
//mLoading?.setResult(true, "Pay for success", 1000)
}
override
fun
onCancel
()
{
runOnUiThread
{
mLoading
?.
setResult
(
false
,
"pay cancel"
,
1000
)
}
}
override
fun
onError
(
error
:
String
)
{
Log
.
d
(
"wxw"
,
"PayError:$error"
)
runOnUiThread
{
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
}
}
})
}
}
}
\ No newline at end of file
cms/src/main/java/com/zxhl/cms/pay/PayPresenter.kt
View file @
4f723dc8
...
@@ -81,14 +81,22 @@ class PayPresenter : PayContract.Presenter {
...
@@ -81,14 +81,22 @@ class PayPresenter : PayContract.Presenter {
goodIds
:
String
,
goodIds
:
String
,
orderNotes
:
String
orderNotes
:
String
)
{
)
{
ApiClient
.
userInfoAPi
.
shopwechatPay
(
goodsId
,
payType
,
payMode
,
addressId
,
discount
,
goodIds
,
orderNotes
)
ApiClient
.
userInfoAPi
.
shopwechatPay
(
goodsId
,
payType
,
payMode
,
addressId
,
discount
,
goodIds
,
orderNotes
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
WeChatPayEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
WeChatPayEntity
>()
{
override
fun
onSuccess
(
result
:
WeChatPayEntity
?)
{
override
fun
onSuccess
(
result
:
WeChatPayEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
WeChatPay
.
startWeChatPay
(
result
,
payType
)
WeChatPay
.
startWeChatPay
(
result
,
payType
)
mView
?.
requestOrderSuc
()
mView
?.
requestOrderSuc
()
}
else
{
}
else
{
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
...
@@ -113,7 +121,15 @@ class PayPresenter : PayContract.Presenter {
...
@@ -113,7 +121,15 @@ class PayPresenter : PayContract.Presenter {
goodIds
:
String
,
goodIds
:
String
,
orderNotes
:
String
orderNotes
:
String
)
{
)
{
ApiClient
.
userInfoAPi
.
shopaliPay
(
goodsId
,
payType
,
payMode
,
addressId
,
discount
,
goodIds
,
orderNotes
)
ApiClient
.
userInfoAPi
.
shopaliPay
(
goodsId
,
payType
,
payMode
,
addressId
,
discount
,
goodIds
,
orderNotes
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
AliPayEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
AliPayEntity
>()
{
override
fun
onSuccess
(
result
:
AliPayEntity
?)
{
override
fun
onSuccess
(
result
:
AliPayEntity
?)
{
...
@@ -143,7 +159,7 @@ class PayPresenter : PayContract.Presenter {
...
@@ -143,7 +159,7 @@ class PayPresenter : PayContract.Presenter {
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
SettingPreference
.
setOutTradeNo
(
result
?.
outTradeNo
)
SettingPreference
.
setOutTradeNo
(
result
?.
outTradeNo
)
WeChatPay
.
startWeChatProgromPay
(
result
,
payType
)
WeChatPay
.
startWeChatProgromPay
(
result
,
payType
)
mView
?.
requestOrderSuc
()
mView
?.
requestOrderSuc
()
}
else
{
}
else
{
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
...
@@ -167,7 +183,7 @@ class PayPresenter : PayContract.Presenter {
...
@@ -167,7 +183,7 @@ class PayPresenter : PayContract.Presenter {
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_suc"
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
mView
?.
setOrderNo
(
result
?.
outTradeNo
)
WeChatPay
.
startWeChatPay
(
result
,
payType
)
WeChatPay
.
startWeChatPay
(
result
,
payType
)
mView
?.
requestOrderSuc
()
mView
?.
requestOrderSuc
()
}
else
{
}
else
{
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
EventUtils
.
onEvent
(
"member_page_pay_get_order_fail"
)
...
@@ -227,10 +243,15 @@ class PayPresenter : PayContract.Presenter {
...
@@ -227,10 +243,15 @@ class PayPresenter : PayContract.Presenter {
if
(!
TextUtils
.
isEmpty
(
order
))
{
if
(!
TextUtils
.
isEmpty
(
order
))
{
requestVerify
(
order
?:
""
,
""
,
payType
)
requestVerify
(
order
?:
""
,
""
,
payType
)
}
}
}
else
if
(
payType
==
12
)
{
}
else
if
(
payType
==
12
)
{
if
(!
TextUtils
.
isEmpty
(
order
))
{
if
(!
TextUtils
.
isEmpty
(
order
))
{
requestVerify
(
order
?:
""
,
""
,
payType
)
requestVerify
(
order
?:
""
,
""
,
payType
)
}
}
}
else
if
(
payType
==
4
)
{
val
googleJson
=
JSONObject
(
order
)
val
tradeOrder
=
googleJson
.
optString
(
"orderId"
)
?:
""
val
outTradeOrder
=
googleJson
.
optString
(
"obfuscatedAccountId"
)
?:
""
requestVerify
(
outTradeOrder
,
tradeOrder
,
payType
)
}
}
}
catch
(
e
:
Exception
)
{
}
catch
(
e
:
Exception
)
{
mView
?.
verifyOrderFail
()
mView
?.
verifyOrderFail
()
...
@@ -250,7 +271,6 @@ class PayPresenter : PayContract.Presenter {
...
@@ -250,7 +271,6 @@ class PayPresenter : PayContract.Presenter {
}
else
{
}
else
{
EventUtils
.
onEvent
(
"member_page_pay_query_order_fail"
,
result
.
toString
())
EventUtils
.
onEvent
(
"member_page_pay_query_order_fail"
,
result
.
toString
())
mView
?.
verifyOrderFail
()
mView
?.
verifyOrderFail
()
}
}
}
}
...
...
cms/src/main/res/drawable-xhdpi/icon_google.png
0 → 100644
View file @
4f723dc8
1.27 KB
cms/src/main/res/layout/activity_member.xml
View file @
4f723dc8
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
android:background=
"@drawable/shape_need_price_bg"
android:background=
"@drawable/shape_need_price_bg"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:visibility=
"
visibl
e"
>
android:visibility=
"
gon
e"
>
<TextView
<TextView
android:id=
"@+id/id_tv_need"
android:id=
"@+id/id_tv_need"
...
@@ -130,7 +130,7 @@
...
@@ -130,7 +130,7 @@
android:layout_below=
"@+id/id_ll_content"
android:layout_below=
"@+id/id_ll_content"
android:background=
"@drawable/shape_white_r5"
android:background=
"@drawable/shape_white_r5"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<!--微信-->
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_wechat_pay"
android:id=
"@+id/id_rl_wechat_pay"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -159,7 +159,7 @@
...
@@ -159,7 +159,7 @@
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
</RelativeLayout>
<!--支付宝-->
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_zfb_pay"
android:id=
"@+id/id_rl_zfb_pay"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -187,6 +187,63 @@
...
@@ -187,6 +187,63 @@
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
</RelativeLayout>
<!--Google-->
<RelativeLayout
android:id=
"@+id/id_rl_google_pay"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:background=
"@color/white"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_google"
android:drawablePadding=
"5dp"
android:gravity=
"center_vertical"
android:text=
"@string/pay_google"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/id_img_google"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
<!--PayPal-->
<RelativeLayout
android:id=
"@+id/id_rl_paypal_pay"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:background=
"@color/white"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/zhifub"
android:drawablePadding=
"5dp"
android:text=
"@string/pay_paypal"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/id_img_paypal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
<!-- 支付按钮-->
<!-- 支付按钮-->
...
@@ -244,7 +301,7 @@
...
@@ -244,7 +301,7 @@
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"30dp"
android:layout_marginBottom=
"30dp"
android:gravity=
"center"
android:gravity=
"center"
android:visibility=
"visible"
>
android:visibility=
"
in
visible"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -302,8 +359,9 @@
...
@@ -302,8 +359,9 @@
<com.paypal.checkout.paymentbutton.PayPalButton
<com.paypal.checkout.paymentbutton.PayPalButton
android:id=
"@+id/id_PayPal_btn"
android:id=
"@+id/id_PayPal_btn"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_alignParentBottom=
"true"
android:layout_height=
"wrap_content"
/>
android:layout_marginBottom=
"-100dp"
android:visibility=
"gone"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
cms/src/main/res/values/strings.xml
View file @
4f723dc8
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
<string
name=
"recycle_desc2"
>
You can exchange high-value goods
</string>
<string
name=
"recycle_desc2"
>
You can exchange high-value goods
</string>
<string
name=
"empty_trip"
>
Empty,go open some boxes
</string>
<string
name=
"empty_trip"
>
Empty,go open some boxes
</string>
//请选择要发货的商品
//请选择要发货的商品
<string
name=
"select_deliver"
>
Please select the goods you want to deliver
</string>
<string
name=
"select_deliver"
>
please select the goods to be shipped
</string>
//请选择要回收的商品
//请选择要回收的商品
<string
name=
"select_reclaim"
>
Please select the goods you want to reclaim
</string>
<string
name=
"select_reclaim"
>
Please select the goods you want to reclaim
</string>
<string
name=
"recycle_suc"
>
Reclaim successful
</string>
<string
name=
"recycle_suc"
>
Reclaim successful
</string>
...
@@ -120,6 +120,8 @@
...
@@ -120,6 +120,8 @@
<string
name=
"pay_button"
>
Top-up
</string>
<string
name=
"pay_button"
>
Top-up
</string>
<string
name=
"pay_wechat"
>
微信支付
</string>
<string
name=
"pay_wechat"
>
微信支付
</string>
<string
name=
"pay_zfb"
>
支付宝支付
</string>
<string
name=
"pay_zfb"
>
支付宝支付
</string>
<string
name=
"pay_google"
>
GooglePay
</string>
<string
name=
"pay_paypal"
>
PayPal
</string>
<string
name=
"pay_need_desc"
>
Needed:
</string>
<string
name=
"pay_need_desc"
>
Needed:
</string>
<!-- 填写地址-->
<!-- 填写地址-->
...
...
moduleMain/src/main/java/com/zxhl/main/page/activity/OrderDetailActivity.kt
View file @
4f723dc8
...
@@ -11,11 +11,13 @@ import com.zxhl.cms.AppContext
...
@@ -11,11 +11,13 @@ import com.zxhl.cms.AppContext
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.Constant
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.common.NetConfig
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.common.base.BaseActivity
import
com.zxhl.cms.googlepay.GooglePayCallBack
import
com.zxhl.cms.googlepay.GooglePayHelper
import
com.zxhl.cms.googlepay.GooglePayResult
import
com.zxhl.cms.net.model.box.AddressEntity
import
com.zxhl.cms.net.model.box.AddressEntity
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.box.AppInEntity
import
com.zxhl.cms.net.model.box.OrderEntity
import
com.zxhl.cms.net.model.box.OrderEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.net.model.video.MemberEntity
import
com.zxhl.cms.pay.PayActivity
import
com.zxhl.cms.pay.PayContract
import
com.zxhl.cms.pay.PayContract
import
com.zxhl.cms.pay.PayPresenter
import
com.zxhl.cms.pay.PayPresenter
import
com.zxhl.cms.utils.*
import
com.zxhl.cms.utils.*
...
@@ -31,9 +33,13 @@ import io.reactivex.functions.Consumer
...
@@ -31,9 +33,13 @@ import io.reactivex.functions.Consumer
import
kotlinx.android.synthetic.main.activity_layout_order_detail.*
import
kotlinx.android.synthetic.main.activity_layout_order_detail.*
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_ali
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_ali
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_back
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_back
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_google
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_wechat
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_img_wechat
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_google_pay
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_paypal_pay
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_wechat_pay
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_wechat_pay
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_zfb_pay
import
kotlinx.android.synthetic.main.activity_layout_order_detail.id_rl_zfb_pay
class
OrderDetailActivity
:
BaseActivity
(),
OrderDetailContract
.
View
,
PayContract
.
View
{
class
OrderDetailActivity
:
BaseActivity
(),
OrderDetailContract
.
View
,
PayContract
.
View
{
private
var
mPresenter
:
OrderDetailPresenter
?
=
null
private
var
mPresenter
:
OrderDetailPresenter
?
=
null
private
var
mAdapter
:
OrderAdapter
?
=
null
private
var
mAdapter
:
OrderAdapter
?
=
null
...
@@ -51,6 +57,8 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -51,6 +57,8 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
companion
object
{
companion
object
{
const
val
ALI_PAY
=
1
//支付宝支付类型
const
val
ALI_PAY
=
1
//支付宝支付类型
const
val
WECHAT_PAY
=
2
//微信支付类型
const
val
WECHAT_PAY
=
2
//微信支付类型
const
val
GOOGLE_PAY
=
4
//Google支付类型
const
val
PAY_PAL_PAY
=
5
//PayPal支付类型
const
val
MINI_PROGRAM
=
11
//微信支付类型
const
val
MINI_PROGRAM
=
11
//微信支付类型
}
}
...
@@ -96,15 +104,23 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -96,15 +104,23 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
}
}
id_rl_wechat_pay
?.
setOnClickListener
{
id_rl_wechat_pay
?.
setOnClickListener
{
pay_type
=
MINI_PROGRAM
pay_type
=
MINI_PROGRAM
id_img_wechat
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong
)
selectPayType
(
2
)
id_img_ali
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong_default
)
}
}
id_rl_zfb_pay
?.
setOnClickListener
{
id_rl_zfb_pay
?.
setOnClickListener
{
pay_type
=
ALI_PAY
pay_type
=
ALI_PAY
id_img_wechat
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong_default
)
selectPayType
(
1
)
id_img_ali
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong
)
}
id_rl_google_pay
?.
setOnClickListener
{
pay_type
=
GOOGLE_PAY
selectPayType
(
3
)
}
id_rl_paypal_pay
?.
setOnClickListener
{
pay_type
=
PAY_PAL_PAY
selectPayType
(
4
)
}
}
id_tv_to_pay
?.
setOnClickListener
{
id_tv_to_pay
?.
setOnClickListener
{
gotoPay
()
gotoPay
()
}
}
...
@@ -118,7 +134,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -118,7 +134,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
sb
.
append
(
dataBean
)
sb
.
append
(
dataBean
)
}
}
depotIds
=
sb
.
toString
()
depotIds
=
sb
.
toString
()
mPresenter
?.
getShipping
(
sb
.
toString
(),
addressId
)
mPresenter
?.
getShipping
(
sb
.
toString
(),
addressId
)
mAdapter
=
OrderAdapter
(
this
)
mAdapter
=
OrderAdapter
(
this
)
id_rl_order_goods
?.
layoutManager
=
LinearLayoutManager
(
this
)
id_rl_order_goods
?.
layoutManager
=
LinearLayoutManager
(
this
)
id_rl_order_goods
?.
adapter
=
mAdapter
id_rl_order_goods
?.
adapter
=
mAdapter
...
@@ -136,8 +152,8 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -136,8 +152,8 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
resultCode
==
1001
)
{
if
(
resultCode
==
1001
)
{
addrees
=
data
?.
getSerializableExtra
(
"address"
)
as
AddressEntity
?
addrees
=
data
?.
getSerializableExtra
(
"address"
)
as
AddressEntity
?
Log
.
e
(
"MXL"
,
"选了地址回来"
)
Log
.
e
(
"MXL"
,
"选了地址回来"
)
mPresenter
?.
getShipping
(
depotIds
.
toString
(),
addrees
?.
id
)
mPresenter
?.
getShipping
(
depotIds
.
toString
(),
addrees
?.
id
)
updateAddreeInfo
(
addrees
)
updateAddreeInfo
(
addrees
)
}
}
...
@@ -176,10 +192,10 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -176,10 +192,10 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
}
}
id_tv_goods_num
?.
text
=
mActivity
?.
getString
(
R
.
string
.
goods_list
,
"${result?.size}"
)
id_tv_goods_num
?.
text
=
mActivity
?.
getString
(
R
.
string
.
goods_list
,
"${result?.size}"
)
if
(
result
?.
packingFee
!!
>
0
&&
result
?.
size
.
equals
(
"1"
))
{
if
(
result
?.
packingFee
!!
>
0
&&
result
?.
size
.
equals
(
"1"
))
{
id_rl_dabaofei
.
visibility
=
View
.
VISIBLE
id_rl_dabaofei
.
visibility
=
View
.
VISIBLE
id_tv_yunfei_price_trip
.
text
=
"
打包费
"
id_tv_yunfei_price_trip
.
text
=
"
Packaging fee
"
id_tv_price_trip
.
text
=
mActivity
?.
getString
(
R
.
string
.
express_fee
)
id_tv_price_trip
.
text
=
mActivity
?.
getString
(
R
.
string
.
express_fee
)
id_tv_yunfei
?.
text
=
"$0"
id_tv_yunfei
?.
text
=
"$0"
id_tv_dabaofei
?.
text
=
"$${result?.packingFee}"
id_tv_dabaofei
?.
text
=
"$${result?.packingFee}"
...
@@ -222,31 +238,39 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -222,31 +238,39 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
fun
gotoPay
()
{
fun
gotoPay
()
{
if
(
TextUtils
.
isEmpty
(
addressId
))
{
if
(
TextUtils
.
isEmpty
(
addressId
))
{
Utils
.
showToast
(
this
,
"
请填写地址
"
)
Utils
.
showToast
(
this
,
"
Please fill in your address
"
)
return
return
}
}
orderNotes
=
id_edit_beizhu
?.
text
.
toString
()
orderNotes
=
id_edit_beizhu
?.
text
.
toString
()
if
(
mPayPrice
?.
toDouble
()
!!
>
0
)
{
if
(
mPayPrice
?.
toDouble
()
!!
>
0
)
{
if
(
pay_type
==
0
)
{
if
(
pay_type
==
0
)
{
Utils
.
showToast
(
this
,
"
请选择支付类型
"
)
Utils
.
showToast
(
this
,
"
Please select payment type
"
)
return
return
}
}
mLoading
?.
show
()
mLoading
?.
show
()
mLoading
?.
setLoading
(
"
请稍后
"
)
mLoading
?.
setLoading
(
"
Loading
"
)
if
(
pay_type
==
1
)
{
if
(
pay_type
==
1
)
{
mPayresenter
?.
requestAliPay
(
this
,
payGoodsId
?:
""
,
pay_type
.
toString
(),
"7"
)
mPayresenter
?.
requestAliPay
(
this
,
payGoodsId
?:
""
,
pay_type
.
toString
(),
"7"
)
}
else
if
(
pay_type
==
GOOGLE_PAY
)
{
googlePay
(
payGoodsId
)
}
else
if
(
pay_type
==
PAY_PAL_PAY
)
{
}
else
{
}
else
{
mPayresenter
?.
requestMiniProgrom
(
payGoodsId
?:
""
,
pay_type
.
toString
(),
"7"
)
mPayresenter
?.
requestMiniProgrom
(
payGoodsId
?:
""
,
pay_type
.
toString
(),
"7"
)
}
}
}
else
{
}
else
{
mLoading
?.
show
()
mLoading
?.
show
()
mLoading
?.
setLoading
(
"
请稍后
"
)
mLoading
?.
setLoading
(
"
Loading
"
)
mPresenter
?.
createOrder
(
addressId
,
depotIds
,
orderNotes
,
outTradeNo
)
mPresenter
?.
createOrder
(
addressId
,
depotIds
,
orderNotes
,
outTradeNo
)
}
}
}
}
fun
initPayConfig
()
{
fun
initPayConfig
()
{
googlePay
=
GooglePayHelper
(
this
)
googlePay
?.
init
()
mPayresenter
=
PayPresenter
(
this
)
mPayresenter
=
PayPresenter
(
this
)
mPayresenter
?.
appInfo
()
mPayresenter
?.
appInfo
()
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
...
@@ -274,9 +298,9 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -274,9 +298,9 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
private
fun
showResultLoading
(
isPaySuc
:
Boolean
)
{
private
fun
showResultLoading
(
isPaySuc
:
Boolean
)
{
if
(
isPaySuc
)
{
if
(
isPaySuc
)
{
mLoading
?.
setResult
(
true
,
"
支付成功
"
,
1000
)
mLoading
?.
setResult
(
true
,
"
Pay for success
"
,
1000
)
}
else
{
}
else
{
mLoading
?.
setResult
(
false
,
"
支付失败
"
,
1000
)
mLoading
?.
setResult
(
false
,
"
Pay for failure
"
,
1000
)
}
}
}
}
...
@@ -291,6 +315,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -291,6 +315,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
override
fun
onDestroy
()
{
override
fun
onDestroy
()
{
super
.
onDestroy
()
super
.
onDestroy
()
googlePay
?.
release
()
if
(
payResultObservable
!=
null
)
if
(
payResultObservable
!=
null
)
RxBus
.
get
().
unregister
(
Constant
.
PAY_RESULT
,
payResultObservable
!!
)
RxBus
.
get
().
unregister
(
Constant
.
PAY_RESULT
,
payResultObservable
!!
)
if
(
updateAddress
!=
null
)
{
if
(
updateAddress
!=
null
)
{
...
@@ -299,12 +324,12 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -299,12 +324,12 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
}
}
override
fun
requestOrderSuc
()
{
override
fun
requestOrderSuc
()
{
mLoading
?.
setLoading
(
"
正在支付
"
)
mLoading
?.
setLoading
(
"
Loading...
"
)
}
}
override
fun
verifyOrderSuc
(
orsder
:
String
)
{
override
fun
verifyOrderSuc
(
orsder
:
String
)
{
showResultLoading
(
true
)
showResultLoading
(
true
)
EventUtils
.
onEvent
(
"CREATE_ORDER"
,
"创建订单"
)
EventUtils
.
onEvent
(
"CREATE_ORDER"
,
"创建订单"
)
id_rl_hava_address
?.
postDelayed
({
id_rl_hava_address
?.
postDelayed
({
mPresenter
?.
createOrder
(
addressId
,
depotIds
,
orderNotes
,
outTradeNo
)
mPresenter
?.
createOrder
(
addressId
,
depotIds
,
orderNotes
,
outTradeNo
)
...
@@ -322,29 +347,75 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -322,29 +347,75 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
override
fun
setAppInfo
(
result
:
AppInEntity
?)
{
override
fun
setAppInfo
(
result
:
AppInEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
id_tv_depots_text
?.
text
=
result
?.
depots_text
id_tv_depots_text
?.
text
=
result
?.
depots_text
if
(
result
.
pay_ali
.
equals
(
"1"
)
&&
result
.
pay_wx
.
equals
(
"0"
))
{
/* if (result.pay_ali.equals("1") && result.pay_wx.equals("0")) {
pay_type
=
PayActivity
.
ALI_PAY
pay_type = PayActivity.ALI_PAY
id_rl_wechat_pay
.
visibility
=
View
.
GONE
id_rl_wechat_pay.visibility = View.GONE
id_rl_zfb_pay.visibility = View.VISIBLE
id_img_ali?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong)
} else {
if (result?.pay_ali.equals("0")) {
id_rl_zfb_pay.visibility = View.GONE
} else {
id_rl_zfb_pay.visibility = View.VISIBLE
// pay_type = PayActivity.ALI_PAY
// id_img_wechat?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong_default)
// id_img_ali?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong)
}
if (result?.pay_wx.equals("0")) {
id_rl_wechat_pay.visibility = View.GONE
} else {
id_rl_wechat_pay.visibility = View.VISIBLE
pay_type = PayActivity.MINI_PROGRAM
id_img_wechat?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong)
id_img_ali?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong_default)
}
}*/
id_rl_wechat_pay
.
visibility
=
View
.
GONE
id_rl_zfb_pay
.
visibility
=
View
.
GONE
id_rl_google_pay
.
visibility
=
View
.
GONE
id_rl_paypal_pay
.
visibility
=
View
.
GONE
if
(
result
.
pay_ali
==
"1"
)
{
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
id_img_ali
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong
)
pay_type
=
ALI_PAY
}
else
{
selectPayType
(
1
)
if
(
result
?.
pay_ali
.
equals
(
"0"
))
{
}
id_rl_zfb_pay
.
visibility
=
View
.
GONE
if
(
result
.
pay_wx
==
"1"
)
{
}
else
{
id_rl_wechat_pay
.
visibility
=
View
.
VISIBLE
id_rl_zfb_pay
.
visibility
=
View
.
VISIBLE
pay_type
=
MINI_PROGRAM
// pay_type = PayActivity.ALI_PAY
selectPayType
(
2
)
// id_img_wechat?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong_default)
}
// id_img_ali?.setImageResource(com.zxhl.cms.R.drawable.icon_xuanzhong)
if
(
result
.
pay_paypal
==
"1"
)
{
}
id_rl_paypal_pay
.
visibility
=
View
.
VISIBLE
if
(
result
?.
pay_wx
.
equals
(
"0"
))
{
pay_type
=
PAY_PAL_PAY
id_rl_wechat_pay
.
visibility
=
View
.
GONE
selectPayType
(
4
)
}
else
{
}
id_rl_wechat_pay
.
visibility
=
View
.
VISIBLE
if
(
result
.
pay_google
==
"1"
)
{
pay_type
=
PayActivity
.
MINI_PROGRAM
id_rl_google_pay
.
visibility
=
View
.
VISIBLE
id_img_wechat
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong
)
pay_type
=
GOOGLE_PAY
id_img_ali
?.
setImageResource
(
com
.
zxhl
.
cms
.
R
.
drawable
.
icon_xuanzhong_default
)
selectPayType
(
3
)
}
}
}
}
private
fun
selectPayType
(
type
:
Int
)
{
id_img_ali
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_wechat
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_google
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
id_img_pay_pal
?.
setImageResource
(
R
.
drawable
.
icon_xuanzhong_default
)
when
(
type
)
{
1
->
{
id_img_ali
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
2
->
{
id_img_wechat
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
3
->
{
id_img_google
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
4
->
{
id_img_pay_pal
.
setImageResource
(
R
.
drawable
.
icon_xuanzhong
)
}
}
}
}
}
}
...
@@ -359,7 +430,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -359,7 +430,7 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
if
(
isPause
)
{
if
(
isPause
)
{
mHandler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
//
mHandler?.sendEmptyMessageDelayed(0, 2000)
}
}
}
}
...
@@ -374,4 +445,34 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
...
@@ -374,4 +445,34 @@ class OrderDetailActivity : BaseActivity(), OrderDetailContract.View, PayContrac
}
}
false
false
}
}
var
googlePay
:
GooglePayHelper
?
=
null
private
fun
googlePay
(
goodsId
:
String
)
{
if
(
goodsId
==
""
)
{
return
}
mLoading
?.
setLoading
(
getString
(
com
.
zxhl
.
cms
.
R
.
string
.
wait_ing2
))
mLoading
?.
show
()
googlePay
?.
googlePay
(
goodsId
,
"7"
,
object
:
GooglePayCallBack
{
override
fun
onPaySuccess
(
purchase
:
GooglePayResult
,
googleJson
:
String
)
{
outTradeNo
=
purchase
.
obfuscatedAccountid
mPayresenter
?.
verifyPay
(
googleJson
,
GOOGLE_PAY
)
//mLoading?.setResult(true, "Pay for success", 1000)
}
override
fun
onCancel
()
{
runOnUiThread
{
mLoading
?.
setResult
(
false
,
"pay cancel"
,
1000
)
}
}
override
fun
onError
(
error
:
String
)
{
Log
.
d
(
"wxw"
,
"PayError:$error"
)
runOnUiThread
{
mLoading
?.
setResult
(
false
,
"pay error"
,
1000
)
}
}
})
}
}
}
\ No newline at end of file
moduleMain/src/main/res/layout/activity_layout_order_detail.xml
View file @
4f723dc8
...
@@ -40,265 +40,327 @@
...
@@ -40,265 +40,327 @@
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
</RelativeLayout>
</RelativeLayout>
<androidx.core.widget.NestedScrollView
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@+id/id_rl_order_title"
>
android:layout_below=
"@+id/id_rl_order_title"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:paddingBottom=
"100dp"
>
<RelativeLayout
android:id=
"@+id/id_rl_no_address"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:orientation=
"vertical"
android:layout_marginTop=
"10dp"
android:paddingBottom=
"100dp"
>
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_ffffff_r5"
android:visibility=
"gone"
>
<
TextView
<
RelativeLayout
android:
layout_width=
"wrap_content
"
android:
id=
"@+id/id_rl_no_address
"
android:layout_
height=
"wrap_cont
ent"
android:layout_
width=
"match_par
ent"
android:layout_
centerVertical=
"true
"
android:layout_
height=
"50dp
"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_add"
android:layout_marginTop=
"10dp"
android:drawablePadding=
"5dp"
android:text=
"请填写收货人信息"
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:
src=
"@drawable/icon_jinru_rignt"
/>
android:
background=
"@drawable/shape_ffffff_r5"
</RelativeLayout
>
android:visibility=
"gone"
>
<RelativeLayout
<TextView
android:id=
"@+id/id_rl_hava_address"
android:layout_width=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"90dp"
android:layout_centerVertical=
"true"
android:layout_below=
"@+id/id_rl_order_title"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_add"
android:layout_marginTop=
"10dp"
android:drawablePadding=
"5dp"
android:layout_marginRight=
"15dp"
android:text=
"请填写收货人信息"
android:background=
"@drawable/shape_ffffff_r5"
android:textColor=
"@color/color_333333"
android:visibility=
"gone"
>
android:textSize=
"15sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_jinru_rignt"
/>
</RelativeLayout>
<TextView
<RelativeLayout
android:id=
"@+id/id_tv_user_name_phone"
android:id=
"@+id/id_rl_hava_address"
android:layout_width=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"90dp"
android:layout_below=
"@+id/id_rl_order_title"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"15dp"
android:layout_marginTop=
"10dp"
android:text=
""
android:layout_marginRight=
"15dp"
android:textColor=
"@color/color_333333"
android:background=
"@drawable/shape_ffffff_r5"
android:textSize=
"18sp"
/>
android:visibility=
"gone"
>
<TextView
<TextView
android:id=
"@+id/id_tv_user_address"
android:id=
"@+id/id_tv_user_name_phone"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"15dp"
android:text=
""
android:textColor=
"@color/color_333333"
android:textSize=
"18sp"
/>
<TextView
android:id=
"@+id/id_tv_user_address"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"70dp"
android:layout_marginBottom=
"15dp"
android:ellipsize=
"end"
android:lines=
"1"
android:text=
""
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_jinru_rignt"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"18dp"
android:layout_toRightOf=
"@+id/id_tv_user_name_phone"
android:src=
"@drawable/icon_moren"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"70dp"
android:layout_marginBottom=
"15dp"
android:ellipsize=
"end"
android:lines=
"1"
android:text=
""
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_jinru_rignt"
/>
android:background=
"@drawable/shape_ffffff_r5"
android:orientation=
"vertical"
android:padding=
"15dp"
>
<Image
View
<Text
View
android:layout_width=
"wrap_content
"
android:id=
"@+id/id_tv_goods_num
"
android:layout_height
=
"wrap_content"
android:layout_width
=
"wrap_content"
android:layout_marginLeft=
"10dp
"
android:layout_height=
"wrap_content
"
android:layout_marginTop=
"18
dp"
android:layout_marginBottom=
"10
dp"
android:layout_toRightOf=
"@+id/id_tv_user_name_phone
"
android:text=
"@string/goods_list
"
android:src=
"@drawable/icon_moren"
/>
android:textColor=
"@color/color_333333"
</RelativeLayout
>
android:textSize=
"15sp"
/
>
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:layout_width=
"match_parent"
android:id=
"@+id/id_rl_order_goods"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
android:layout_marginLeft=
"15dp"
android:layout_height=
"wrap_content"
/>
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_ffffff_r5"
android:orientation=
"vertical"
android:padding=
"15dp"
>
<TextView
<View
android:id=
"@+id/id_tv_goods_num"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"0.5dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"10dp"
android:background=
"#EDEDED"
/>
android:text=
"@string/goods_list"
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/id_rl_order_goods"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<View
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
>
<TextView
android:id=
"@+id/id_tv_price_trip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/express_fee"
android:textColor=
"@color/color_666666"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/id_tv_yunfei"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:text=
"0"
android:textColor=
"@color/color_333333"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/id_rl_dabaofei"
android:layout_width=
"match_parent"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
>
<TextView
android:id=
"@+id/id_tv_yunfei_price_trip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"打包费"
android:textColor=
"@color/color_666666"
android:textSize=
"14sp"
/>
<TextView
android:id=
"@+id/id_tv_dabaofei"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/color_333333"
/>
</RelativeLayout>
</LinearLayout>
<!--微信支付-->
<RelativeLayout
android:id=
"@+id/id_rl_wechat_pay"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:layout_height=
"50dp"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"10dp"
android:background=
"#EDEDED"
/>
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_ffffff_r5"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_weixin"
android:drawablePadding=
"5dp"
android:text=
"微信支付"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/id_img_wechat"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
<!--支付宝支付-->
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_zfb_pay"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
>
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:background=
"@color/white"
android:visibility=
"gone"
>
<TextView
<TextView
android:id=
"@+id/id_tv_price_trip"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/express_fee"
android:layout_centerVertical=
"true"
android:textColor=
"@color/color_666666"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/zhifub"
android:drawablePadding=
"5dp"
android:text=
"支付宝支付"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<
Text
View
<
Image
View
android:id=
"@+id/id_
tv_yunfe
i"
android:id=
"@+id/id_
img_al
i"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:text=
"0"
android:layout_centerVertical=
"true"
android:textColor=
"@color/color_333333"
/>
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
</RelativeLayout>
<!--Google-->
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_
dabaofei
"
android:id=
"@+id/id_rl_
google_pay
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"50dp"
android:layout_marginTop=
"10dp"
>
android:background=
"@color/white"
android:visibility=
"gone"
>
<TextView
<TextView
android:id=
"@+id/id_tv_yunfei_price_trip"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"打包费"
android:layout_centerVertical=
"true"
android:textColor=
"@color/color_666666"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_google"
android:drawablePadding=
"5dp"
android:gravity=
"center_vertical"
android:text=
"@string/pay_google"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<
Text
View
<
Image
View
android:id=
"@+id/id_
tv_dabaofei
"
android:id=
"@+id/id_
img_google
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:textColor=
"@color/color_333333"
/>
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
<!--PayPal-->
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_paypal_pay"
android:id=
"@+id/id_rl_wechat_pay"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_height=
"50dp"
android:background=
"@color/white"
android:layout_marginLeft=
"15dp"
android:visibility=
"gone"
>
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_ffffff_r5"
android:visibility=
"gone"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/icon_weixin"
android:drawableLeft=
"@drawable/zhifub"
android:drawablePadding=
"5dp"
android:drawablePadding=
"5dp"
android:text=
"微信支付"
android:text=
"@string/pay_paypal"
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/id_img_wechat"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/id_rl_zfb_pay"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"15dp"
android:background=
"@color/white"
android:visibility=
"gone"
>
<TextView
<ImageView
android:layout_width=
"wrap_content"
android:id=
"@+id/id_img_pay_pal"
android:layout_height=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"104dp"
android:layout_marginLeft=
"15dp"
android:layout_marginLeft=
"15dp"
android:drawableLeft=
"@drawable/zhifub"
android:layout_marginTop=
"10dp"
android:drawablePadding=
"5dp"
android:text=
"支付宝支付"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
<ImageView
android:id=
"@+id/id_img_ali"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:src=
"@drawable/icon_xuanzhong_default"
/>
android:background=
"@drawable/shape_ffffff_r5"
</RelativeLayout>
android:orientation=
"vertical"
<LinearLayout
android:padding=
"15dp"
>
android:layout_width=
"match_parent"
android:layout_height=
"104dp"
android:layout_marginLeft=
"15dp"
android:layout_marginTop=
"10dp"
android:layout_marginRight=
"15dp"
android:background=
"@drawable/shape_ffffff_r5"
android:orientation=
"vertical"
android:padding=
"15dp"
>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/note"
android:text=
"@string/note"
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
android:textSize=
"15sp"
/>
<EditText
<EditText
android:id=
"@+id/id_edit_beizhu"
android:id=
"@+id/id_edit_beizhu"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"6dp"
android:layout_marginTop=
"6dp"
android:background=
"@null"
android:background=
"@null"
android:hint=
"@string/input_your_needs"
android:hint=
"@string/input_your_needs"
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textColorHint=
"#999999"
android:textColorHint=
"#999999"
android:textSize=
"13sp"
/>
android:textSize=
"13sp"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.core.widget.NestedScrollView>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_rl_order_bottom"
android:id=
"@+id/id_rl_order_bottom"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -370,8 +432,8 @@
...
@@ -370,8 +432,8 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:text=
""
android:includeFontPadding=
"false"
android:includeFontPadding=
"false"
android:text=
""
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"15sp"
/>
android:textSize=
"15sp"
/>
...
...
moduleMain/src/main/res/layout/dialog_layout_box_result.xml
View file @
4f723dc8
...
@@ -99,6 +99,7 @@
...
@@ -99,6 +99,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginRight=
"20dp"
android:gravity=
"center"
android:text=
""
android:text=
""
android:textColor=
"@color/color_333333"
android:textColor=
"@color/color_333333"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
...
@@ -109,6 +110,7 @@
...
@@ -109,6 +110,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"20dp"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:layout_marginRight=
"20dp"
android:gravity=
"center"
android:text=
""
android:text=
""
android:textColor=
"@color/color_666666"
android:textColor=
"@color/color_666666"
android:textSize=
"14sp"
/>
android:textSize=
"14sp"
/>
...
@@ -119,6 +121,9 @@
...
@@ -119,6 +121,9 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginBottom=
"8dp"
android:layout_marginBottom=
"8dp"
android:gravity=
"center"
android:layout_marginLeft=
"20dp"
android:layout_marginRight=
"20dp"
android:text=
"@string/box_detail_open_box_result_re_pumping_desc"
android:text=
"@string/box_detail_open_box_result_re_pumping_desc"
android:textColor=
"@color/color_4C84FF"
android:textColor=
"@color/color_4C84FF"
android:textSize=
"14sp"
android:textSize=
"14sp"
...
...
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