Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
X
xxsq
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
王雪伟
xxsq
Commits
6b099451
Commit
6b099451
authored
Sep 01, 2022
by
maxiaoliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加自动选择运营商
parent
ecb74737
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
18 deletions
+104
-18
version.properties
app/version.properties
+2
-2
RechargeActivity.kt
...ain/java/com/zxbw/modulemain/activity/RechargeActivity.kt
+101
-16
activity_layout_recharge.xml
moduleMain/src/main/res/layout/activity_layout_recharge.xml
+1
-0
No files found.
app/version.properties
View file @
6b099451
PACKAGE_NAME
=
com.zxhl.shop
PACKAGE_NAME
=
com.zxhl.shop
VERSION_CODE
=
23
VERSION_CODE
=
24
VERSION_NAME
=
1.2.2
VERSION_NAME
=
1.2.3
\ No newline at end of file
\ No newline at end of file
moduleMain/src/main/java/com/zxbw/modulemain/activity/RechargeActivity.kt
View file @
6b099451
...
@@ -3,7 +3,9 @@ package com.zxbw.modulemain.activity
...
@@ -3,7 +3,9 @@ package com.zxbw.modulemain.activity
import
android.content.Intent
import
android.content.Intent
import
android.graphics.Paint
import
android.graphics.Paint
import
android.os.Handler
import
android.os.Handler
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextUtils
import
android.text.TextWatcher
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
...
@@ -108,7 +110,6 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -108,7 +110,6 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mOperatorAdapter
?.
notifyDataSetChanged
()
mOperatorAdapter
?.
notifyDataSetChanged
()
}
}
mPresenter
=
RechargePresenter
(
this
)
mPresenter
=
RechargePresenter
(
this
)
mAdapter
=
RechargeAdapter
(
this
,
this
)
mAdapter
=
RechargeAdapter
(
this
,
this
)
// id_rl_recharge?.layoutManager = GridLayoutManager(this, 3)
// id_rl_recharge?.layoutManager = GridLayoutManager(this, 3)
...
@@ -118,12 +119,95 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -118,12 +119,95 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mPresenter
?.
getFetchCard
()
mPresenter
?.
getFetchCard
()
// mPresenter?.getPayList("mobileFee")
// mPresenter?.getPayList("mobileFee")
id_edit_user_phone
?.
setText
(
user
.
nickname
.
toString
())
id_edit_user_phone
?.
setText
(
user
.
nickname
.
toString
())
id_edit_user_phone
?.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{
}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
if
(
s
!!
.
length
>=
11
){
getMobileop
(
s
.
toString
())
}
else
{
mobileOp
=
""
mOperatorAdapter
?.
setPosition
(-
1
)
}
}
override
fun
afterTextChanged
(
s
:
Editable
?)
{
}
})
getMobileop
(
"13126735008"
)
id_tv_select_coupons
?.
setOnClickListener
(
this
)
id_tv_select_coupons
?.
setOnClickListener
(
this
)
id_tv_chongzhi
?.
setOnClickListener
{
id_tv_chongzhi
?.
setOnClickListener
{
topay
()
topay
()
}
}
}
}
fun
getMobileop
(
mobile
:
String
)
{
if
(
TextUtils
.
isEmpty
(
mobile
)
||
mobile
.
trim
().
length
!=
11
)
{
return
}
if
(
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"134"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"135"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"136"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"137"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"138"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"139"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"147"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"150"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"151"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"152"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"157"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"158"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"159"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"178"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"182"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"183"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"184"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"187"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"188"
)
)
{
mobileOp
=
"SHKC_MC"
mOperatorAdapter
?.
setPosition
(
0
)
Log
.
e
(
"MXL"
,
"移动号"
)
}
else
if
(
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"130"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"131"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"132"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"145"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"155"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"156"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"175"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"176"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"185"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"186"
)
)
{
mOperatorAdapter
?.
setPosition
(
1
)
mobileOp
=
"SHKC_CU_MC"
Log
.
e
(
"MXL"
,
"联通号"
)
}
else
if
(
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"133"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"149"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"153"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"177"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"180"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"181"
)
||
mobile
.
trim
().
substring
(
0
,
3
).
equals
(
"189"
)
)
{
mobileOp
=
"SHKC_CT_MC"
mOperatorAdapter
?.
setPosition
(
2
)
Log
.
e
(
"MXL"
,
"电信号"
)
}
else
{
mobileOp
=
""
mOperatorAdapter
?.
setPosition
(-
1
)
Log
.
e
(
"MXL"
,
"未知"
)
}
}
fun
initPay
()
{
fun
initPay
()
{
mLoading
=
LoadingDialog
.
getLoadingDialog
(
mLoading
=
LoadingDialog
.
getLoadingDialog
(
...
@@ -179,9 +263,9 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -179,9 +263,9 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}
}
}
}
}
}
if
(
result
.
recharge_desc
.
isNullOrEmpty
()){
if
(
result
.
recharge_desc
.
isNullOrEmpty
())
{
id_tv_recharge_desc
.
visibility
=
View
.
GONE
id_tv_recharge_desc
.
visibility
=
View
.
GONE
}
else
{
}
else
{
id_tv_recharge_desc
.
text
=
result
.
recharge_desc
id_tv_recharge_desc
.
text
=
result
.
recharge_desc
id_tv_recharge_desc
.
visibility
=
View
.
VISIBLE
id_tv_recharge_desc
.
visibility
=
View
.
VISIBLE
}
}
...
@@ -230,9 +314,10 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -230,9 +314,10 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
isClickPayBtn
=
true
isClickPayBtn
=
true
mLoading
?.
setLoading
(
"请稍后..."
)
mLoading
?.
setLoading
(
"请稍后..."
)
mLoading
?.
show
()
mLoading
?.
show
()
Log
.
e
(
"MXL"
,
"s"
+
pay_type
)
Log
.
e
(
"MXL"
,
"s"
+
pay_type
)
if
(
pay_type
==
2
){
if
(
pay_type
==
2
)
{
mPresenter
?.
requestWechatPayOrder
(
"xxsqshop://recharge"
,
mPresenter
?.
requestWechatPayOrder
(
"xxsqshop://recharge"
,
goodsID
.
toString
(),
goodsID
.
toString
(),
pay_type
.
toString
(),
pay_type
.
toString
(),
phoneNumber
,
phoneNumber
,
...
@@ -240,8 +325,9 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -240,8 +325,9 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
false
,
false
,
""
,
""
,
couponsentity
?.
id
,
couponsentity
?.
id
,
mobileOp
)
mobileOp
}
else
{
)
}
else
{
mPresenter
?.
requestRightsAliPay
(
mPresenter
?.
requestRightsAliPay
(
"xxsqshop://recharge"
,
"xxsqshop://recharge"
,
goodsID
.
toString
(),
goodsID
.
toString
(),
...
@@ -270,7 +356,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -270,7 +356,7 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}
}
override
fun
requestOrderSuc
(
result
:
AliPayEntity
)
{
override
fun
requestOrderSuc
(
result
:
AliPayEntity
)
{
Log
.
e
(
"MXL"
,
"pay_type"
+
pay_type
)
Log
.
e
(
"MXL"
,
"pay_type"
+
pay_type
)
if
(
pay_type
==
PaymentConfig
.
MIN_PAY_PROGRAM
)
{
if
(
pay_type
==
PaymentConfig
.
MIN_PAY_PROGRAM
)
{
SettingPreference
.
setOutTradeNo
(
result
?.
outTradeNo
)
SettingPreference
.
setOutTradeNo
(
result
?.
outTradeNo
)
JumpUtils
.
h5Jump
(
"https://api.minpayment.com/pay.do?sendMsg="
+
result
.
wakeup
)
JumpUtils
.
h5Jump
(
"https://api.minpayment.com/pay.do?sendMsg="
+
result
.
wakeup
)
...
@@ -342,15 +428,14 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -342,15 +428,14 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
}
}
})
})
}
}
}
else
if
(
pay_type
==
PaymentConfig
.
WECHAT_PAY
)
{
}
else
if
(
pay_type
==
PaymentConfig
.
WECHAT_PAY
)
{
if
(
result
.
outTradeNo
.
isNullOrEmpty
())
{
if
(
result
.
outTradeNo
.
isNullOrEmpty
())
{
EventUtils
.
onEvent
(
"wechat_pay_error"
)
EventUtils
.
onEvent
(
"wechat_pay_error"
)
showResultLoading
(
false
)
showResultLoading
(
false
)
}
else
{
}
else
{
}
}
}
}
else
{
else
{
showToast
(
"暂不支持"
)
showToast
(
"暂不支持"
)
EventUtils
.
onEvent
(
"payment_error"
,
"$pay_type"
)
EventUtils
.
onEvent
(
"payment_error"
,
"$pay_type"
)
}
}
...
@@ -558,11 +643,11 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
...
@@ -558,11 +643,11 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
private
var
isClickPayBtn
=
false
private
var
isClickPayBtn
=
false
override
fun
onResume
()
{
override
fun
onResume
()
{
super
.
onResume
()
super
.
onResume
()
Log
.
e
(
"MXL"
,
"onResume"
+
isPause
+
isClickPayBtn
+
pay_type
)
Log
.
e
(
"MXL"
,
"onResume"
+
isPause
+
isClickPayBtn
+
pay_type
)
if
(
isPause
&&
isClickPayBtn
)
{
if
(
isPause
&&
isClickPayBtn
)
{
if
(
pay_type
==
PaymentConfig
.
MIN_PAY_PROGRAM
||
pay_type
==
PaymentConfig
.
H5_PAY
||
pay_type
==
PaymentConfig
.
ZFB_H5_PAY
||
pay_type
==
PaymentConfig
.
WX_H5_PAY
||
pay_type
==
PaymentConfig
.
HUI_FU_H5_PAY1
||
pay_type
==
PaymentConfig
.
HUI_FU_H5_PAY2
||
pay_type
==
PaymentConfig
.
WECHAT_PAY
)
{
if
(
pay_type
==
PaymentConfig
.
MIN_PAY_PROGRAM
||
pay_type
==
PaymentConfig
.
H5_PAY
||
pay_type
==
PaymentConfig
.
ZFB_H5_PAY
||
pay_type
==
PaymentConfig
.
WX_H5_PAY
||
pay_type
==
PaymentConfig
.
HUI_FU_H5_PAY1
||
pay_type
==
PaymentConfig
.
HUI_FU_H5_PAY2
||
pay_type
==
PaymentConfig
.
WECHAT_PAY
)
{
//如果是敏支付或者H5支付
//如果是敏支付或者H5支付
Log
.
e
(
"MXL"
,
"支付完调用"
)
Log
.
e
(
"MXL"
,
"支付完调用"
)
mPresenter
?.
verifyPay
(
SettingPreference
.
getOutTradeNo
(),
pay_type
!!
)
mPresenter
?.
verifyPay
(
SettingPreference
.
getOutTradeNo
(),
pay_type
!!
)
}
else
{
}
else
{
mHandler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
mHandler
?.
sendEmptyMessageDelayed
(
0
,
2000
)
...
...
moduleMain/src/main/res/layout/activity_layout_recharge.xml
View file @
6b099451
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
android:background=
"@drawable/shape_ffffff_r6"
android:background=
"@drawable/shape_ffffff_r6"
android:inputType=
"phone"
android:inputType=
"phone"
android:lines=
"1"
android:lines=
"1"
android:maxLength=
"11"
android:padding=
"10dp"
android:padding=
"10dp"
android:textColor=
"@color/color_999999"
android:textColor=
"@color/color_999999"
android:textCursorDrawable=
"@drawable/cursor_color"
android:textCursorDrawable=
"@drawable/cursor_color"
...
...
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