Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
108e882d
Commit
108e882d
authored
Jun 23, 2021
by
shiyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 微信授权页面搭建
parent
fa70e6cf
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
491 additions
and
355 deletions
+491
-355
AndroidManifest.xml
CommonLib/Common/src/main/AndroidManifest.xml
+1
-58
MerchantCenterActivity.kt
...nghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
+9
-0
ShareDialog.kt
.../yidian/shenghuoquan/newscontent/ui/dialog/ShareDialog.kt
+144
-144
ShareImageDialog.kt
...an/shenghuoquan/newscontent/ui/dialog/ShareImageDialog.kt
+122
-122
MyWalletActivity.kt
...an/shenghuoquan/newscontent/wallet/ui/MyWalletActivity.kt
+3
-1
VerifyIdentityActivity.kt
...nghuoquan/newscontent/wallet/ui/VerifyIdentityActivity.kt
+2
-1
WeChatAuthActivity.kt
.../shenghuoquan/newscontent/wallet/ui/WeChatAuthActivity.kt
+52
-1
MerchantAssetView.kt
...dian/shenghuoquan/newscontent/widget/MerchantAssetView.kt
+43
-25
icon_wechat_auth.webp
...ontent/src/main/res/drawable-xxhdpi/icon_wechat_auth.webp
+0
-0
activity_wechat_auth.xml
.../newscontent/src/main/res/layout/activity_wechat_auth.xml
+50
-3
view_merchant_asset.xml
...s/newscontent/src/main/res/layout/view_merchant_asset.xml
+1
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+52
-0
WXEntryActivity.kt
.../com/shenghuoquan/business/debug/wxapi/WXEntryActivity.kt
+6
-0
WXEntryActivity.kt
...n/java/com/shenghuoquan/business/wxapi/WXEntryActivity.kt
+6
-0
No files found.
CommonLib/Common/src/main/AndroidManifest.xml
View file @
108e882d
...
@@ -3,63 +3,6 @@
...
@@ -3,63 +3,6 @@
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.yidian.common"
>
package=
"com.yidian.common"
>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<application>
<!-- 以下为友盟分享基本配置信息 start-->
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${file_provider}"
android:exported=
"false"
android:grantUriPermissions=
"true"
tools:replace=
"android:authorities"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/file_paths"
tools:replace=
"android:resource"
/>
</provider>
<!--微信分享/登录-->
<activity
android:name=
".wxapi.WXEntryActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:exported=
"true"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.tencent.tauth.AuthActivity"
android:launchMode=
"singleTask"
android:noHistory=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"tencent101923771"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.tencent.connect.common.AssistActivity"
android:configChanges=
"orientation|keyboardHidden"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.umeng.socialize.media.WBShareCallBackActivity"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.sina.weibo.sdk.web.WeiboSdkWebActivity"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:windowSoftInputMode=
"adjustResize"
/>
<!-- 以上为友盟分享基本配置信息 end-->
</application>
</manifest>
</manifest>
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
View file @
108e882d
...
@@ -28,6 +28,7 @@ import com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
...
@@ -28,6 +28,7 @@ import com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.MerchantCenterBottomHintDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.MerchantCenterBottomHintDialog
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView
import
com.yidian.shenghuoquan.newscontent.widget.MerchantAssetView
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
import
com.yidian.xarc.xevent.XBaseEvent
import
com.yidian.xarc.xevent.XBaseEvent
import
com.yidian.xarc.xevent.XEventManager
import
com.yidian.xarc.xevent.XEventManager
...
@@ -99,6 +100,14 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
...
@@ -99,6 +100,14 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
private
fun
initListener
()
{
private
fun
initListener
()
{
viewBind
.
lvLifeAccountLabel
.
setOnLifeAccountLabelCallback
(
this
)
viewBind
.
lvLifeAccountLabel
.
setOnLifeAccountLabelCallback
(
this
)
// 点击钱包余额进入我的钱包
viewBind
.
avMerchantAsset
.
setOnClickWalletCallback
(
object
:
MerchantAssetView
.
OnClickWalletCallback
{
override
fun
toMyWallet
(
balance
:
String
)
{
val
map
=
HashMap
<
String
,
String
?>()
map
[
"balance"
]
=
balance
XPageManager
.
push
(
XRouterPathConstants
.
MY_WALLET
,
map
)
}
})
}
}
private
fun
initData
()
{
private
fun
initData
()
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/dialog/ShareDialog.kt
View file @
108e882d
...
@@ -26,7 +26,7 @@ import com.yidian.shenghuoquan.newscontent.R
...
@@ -26,7 +26,7 @@ import com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.adapter.ShareAdapter
import
com.yidian.shenghuoquan.newscontent.adapter.ShareAdapter
import
com.yidian.shenghuoquan.newscontent.bean.SharePlatformBean
import
com.yidian.shenghuoquan.newscontent.bean.SharePlatformBean
class
ShareDialog
(
private
val
activity
:
Activity
,
themeResId
:
Int
):
Dialog
(
activity
,
themeResId
)
{
class
ShareDialog
(
private
val
activity
:
Activity
,
themeResId
:
Int
)
:
Dialog
(
activity
,
themeResId
)
{
private
lateinit
var
rvSharePlatform
:
YdRecyclerView
private
lateinit
var
rvSharePlatform
:
YdRecyclerView
private
lateinit
var
tvCancel
:
YdTextView
private
lateinit
var
tvCancel
:
YdTextView
private
lateinit
var
shareAdapter
:
ShareAdapter
private
lateinit
var
shareAdapter
:
ShareAdapter
...
@@ -47,7 +47,7 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
...
@@ -47,7 +47,7 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
setDialog
()
setDialog
()
}
}
private
fun
setDialog
()
{
private
fun
setDialog
()
{
this
.
setCanceledOnTouchOutside
(
true
)
this
.
setCanceledOnTouchOutside
(
true
)
this
.
setContentView
(
R
.
layout
.
share_dialog
)
this
.
setContentView
(
R
.
layout
.
share_dialog
)
this
.
setOwnerActivity
(
activity
)
this
.
setOwnerActivity
(
activity
)
...
@@ -59,15 +59,15 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
...
@@ -59,15 +59,15 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
setClickListener
()
setClickListener
()
}
}
fun
setData
(
contentLink
:
String
,
title
:
String
,
description
:
String
,
imageUrl
:
String
?)
{
fun
setData
(
contentLink
:
String
,
title
:
String
,
description
:
String
,
imageUrl
:
String
?)
{
this
.
contentLink
=
contentLink
this
.
contentLink
=
contentLink
this
.
title
=
title
this
.
title
=
title
this
.
imageUrl
=
imageUrl
this
.
imageUrl
=
imageUrl
this
.
description
=
description
this
.
description
=
description
}
}
private
fun
setClickListener
()
{
private
fun
setClickListener
()
{
tvCancel
.
setOnClickListener
{
tvCancel
.
setOnClickListener
{
dismiss
()
dismiss
()
}
}
...
@@ -81,7 +81,7 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
...
@@ -81,7 +81,7 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
})
})
}
}
private
fun
initPlatform
()
{
private
fun
initPlatform
()
{
wechat
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wx
,
"微信好友"
,
ShareAdapter
.
normalType
)
wechat
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wx
,
"微信好友"
,
ShareAdapter
.
normalType
)
wechatMoments
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_pyq
,
"微信朋友圈"
,
ShareAdapter
.
normalType
)
wechatMoments
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_pyq
,
"微信朋友圈"
,
ShareAdapter
.
normalType
)
sinaWeibo
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wb
,
"微博"
,
ShareAdapter
.
normalType
)
sinaWeibo
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wb
,
"微博"
,
ShareAdapter
.
normalType
)
...
@@ -99,51 +99,51 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
...
@@ -99,51 +99,51 @@ class ShareDialog(private val activity: Activity, themeResId: Int): Dialog(activ
shareAdapter
.
update
(
dataList
)
shareAdapter
.
update
(
dataList
)
}
}
private
fun
copyLink
(
text
:
String
)
{
private
fun
copyLink
(
text
:
String
)
{
val
cmb
=
activity
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
?
val
cmb
=
activity
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
?
cmb
?.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
text
))
cmb
?.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
text
))
Toast
.
makeText
(
activity
,
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
activity
,
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
()
dismiss
()
dismiss
()
}
}
private
fun
oneKeyShare
(
position
:
Int
)
{
private
fun
oneKeyShare
(
position
:
Int
)
{
val
shareAction
=
ShareAction
(
activity
)
val
shareAction
=
ShareAction
(
activity
)
when
(
position
)
{
when
(
position
)
{
0
->
{
0
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
1
->
{
1
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN_CIRCLE
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN_CIRCLE
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
2
->
{
2
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
sinaBlogPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
sinaBlogPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
SINA
shareAction
.
platform
=
SHARE_MEDIA
.
SINA
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微博】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微博】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
3
->
{
3
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
mobileQQPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
mobileQQPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
QQ
shareAction
.
platform
=
SHARE_MEDIA
.
QQ
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【QQ】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【QQ】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
}
}
val
web
=
UMWeb
(
contentLink
)
val
web
=
UMWeb
(
contentLink
)
web
.
title
=
title
web
.
title
=
title
if
(
imageUrl
!=
null
)
{
if
(
imageUrl
!=
null
)
{
imageUrl
=
imageBaseUrl
+
imageUrl
+
imageParams
imageUrl
=
imageBaseUrl
+
imageUrl
+
imageParams
web
.
setThumb
(
UMImage
(
activity
,
imageUrl
))
web
.
setThumb
(
UMImage
(
activity
,
imageUrl
))
}
else
{
}
else
{
web
.
setThumb
(
UMImage
(
activity
,
R
.
mipmap
.
ydlogo
))
web
.
setThumb
(
UMImage
(
activity
,
R
.
mipmap
.
ydlogo
))
}
}
web
.
description
=
description
web
.
description
=
description
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/dialog/ShareImageDialog.kt
View file @
108e882d
...
@@ -25,7 +25,7 @@ import com.yidian.shenghuoquan.newscontent.R
...
@@ -25,7 +25,7 @@ import com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.adapter.ShareAdapter
import
com.yidian.shenghuoquan.newscontent.adapter.ShareAdapter
import
com.yidian.shenghuoquan.newscontent.bean.SharePlatformBean
import
com.yidian.shenghuoquan.newscontent.bean.SharePlatformBean
class
ShareImageDialog
(
private
val
activity
:
Activity
,
themeResId
:
Int
):
Dialog
(
activity
,
themeResId
)
{
class
ShareImageDialog
(
private
val
activity
:
Activity
,
themeResId
:
Int
)
:
Dialog
(
activity
,
themeResId
)
{
private
lateinit
var
rvSharePlatform
:
YdRecyclerView
private
lateinit
var
rvSharePlatform
:
YdRecyclerView
private
lateinit
var
tvCancel
:
YdTextView
private
lateinit
var
tvCancel
:
YdTextView
private
lateinit
var
shareAdapter
:
ShareAdapter
private
lateinit
var
shareAdapter
:
ShareAdapter
...
@@ -40,7 +40,7 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
...
@@ -40,7 +40,7 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
setDialog
()
setDialog
()
}
}
private
fun
setDialog
()
{
private
fun
setDialog
()
{
this
.
setCanceledOnTouchOutside
(
true
)
this
.
setCanceledOnTouchOutside
(
true
)
this
.
setContentView
(
R
.
layout
.
share_dialog
)
this
.
setContentView
(
R
.
layout
.
share_dialog
)
this
.
setOwnerActivity
(
activity
)
this
.
setOwnerActivity
(
activity
)
...
@@ -52,12 +52,12 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
...
@@ -52,12 +52,12 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
setClickListener
()
setClickListener
()
}
}
fun
setData
(
imageUrl
:
String
)
{
fun
setData
(
imageUrl
:
String
)
{
this
.
imageUrl
=
imageUrl
this
.
imageUrl
=
imageUrl
}
}
private
fun
setClickListener
()
{
private
fun
setClickListener
()
{
tvCancel
.
setOnClickListener
{
tvCancel
.
setOnClickListener
{
dismiss
()
dismiss
()
}
}
...
@@ -71,7 +71,7 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
...
@@ -71,7 +71,7 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
})
})
}
}
private
fun
initPlatform
()
{
private
fun
initPlatform
()
{
wechat
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wx
,
"微信好友"
,
ShareAdapter
.
normalType
)
wechat
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_wx
,
"微信好友"
,
ShareAdapter
.
normalType
)
wechatMoments
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_pyq
,
"微信朋友圈"
,
ShareAdapter
.
normalType
)
wechatMoments
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_pyq
,
"微信朋友圈"
,
ShareAdapter
.
normalType
)
qq
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_qq
,
"手机QQ"
,
ShareAdapter
.
normalType
)
qq
=
SharePlatformBean
(
R
.
mipmap
.
icon_share_qq
,
"手机QQ"
,
ShareAdapter
.
normalType
)
...
@@ -87,34 +87,34 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
...
@@ -87,34 +87,34 @@ class ShareImageDialog(private val activity: Activity, themeResId: Int): Dialog(
shareAdapter
.
update
(
dataList
)
shareAdapter
.
update
(
dataList
)
}
}
private
fun
copyLink
(
text
:
String
)
{
private
fun
copyLink
(
text
:
String
)
{
val
cmb
=
activity
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
?
val
cmb
=
activity
.
getSystemService
(
Context
.
CLIPBOARD_SERVICE
)
as
ClipboardManager
?
cmb
?.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
text
))
cmb
?.
setPrimaryClip
(
ClipData
.
newPlainText
(
null
,
text
))
Toast
.
makeText
(
activity
,
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
activity
,
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
()
dismiss
()
dismiss
()
}
}
private
fun
oneKeyShare
(
position
:
Int
,
imageUrl
:
String
)
{
private
fun
oneKeyShare
(
position
:
Int
,
imageUrl
:
String
)
{
val
shareAction
=
ShareAction
(
activity
)
val
shareAction
=
ShareAction
(
activity
)
when
(
position
)
{
when
(
position
)
{
0
->
{
0
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
1
->
{
1
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN_CIRCLE
shareAction
.
platform
=
SHARE_MEDIA
.
WEIXIN_CIRCLE
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
2
->
{
2
->
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
mobileQQPkgName
))
{
if
(
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
mobileQQPkgName
))
{
shareAction
.
platform
=
SHARE_MEDIA
.
QQ
shareAction
.
platform
=
SHARE_MEDIA
.
QQ
}
else
{
}
else
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【QQ】"
,
Toast
.
LENGTH_SHORT
).
show
()
Toast
.
makeText
(
YdBaseApplication
.
context
,
"分享失败,未安装【QQ】"
,
Toast
.
LENGTH_SHORT
).
show
()
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/wallet/ui/MyWalletActivity.kt
View file @
108e882d
...
@@ -38,7 +38,9 @@ class MyWalletActivity : BaseActivity<ActivityMyWalletBinding>() {
...
@@ -38,7 +38,9 @@ class MyWalletActivity : BaseActivity<ActivityMyWalletBinding>() {
}
}
// todo 提现(仅管理员可以发起提现)
// todo 提现(仅管理员可以发起提现)
viewBind
.
tvWithdraw
.
clickAntiShake
{
viewBind
.
tvWithdraw
.
clickAntiShake
{
XPageManager
.
push
(
XRouterPathConstants
.
VERIFY_IDENTITY
,
null
)
// XPageManager.push(XRouterPathConstants.VERIFY_IDENTITY, null)
// todo 测试代码
XPageManager
.
push
(
XRouterPathConstants
.
WECHAT_AUTH
,
null
)
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/wallet/ui/VerifyIdentityActivity.kt
View file @
108e882d
...
@@ -11,6 +11,7 @@ import com.yidian.common.extensions.initTitleBar
...
@@ -11,6 +11,7 @@ import com.yidian.common.extensions.initTitleBar
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityVerifyIdentifyBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityVerifyIdentifyBinding
import
com.yidian.shenghuoquan.newscontent.utils.CountDownTimerUtils
import
com.yidian.shenghuoquan.newscontent.utils.CountDownTimerUtils
import
com.yidian.shenghuoquan.newscontent.utils.TextWatcherAdapter
import
com.yidian.shenghuoquan.newscontent.utils.TextWatcherAdapter
import
com.yidian.xpage.XPageManager
/**
/**
* 钱包主人验证身份
* 钱包主人验证身份
...
@@ -34,7 +35,6 @@ class VerifyIdentityActivity : BaseActivity<ActivityVerifyIdentifyBinding>() {
...
@@ -34,7 +35,6 @@ class VerifyIdentityActivity : BaseActivity<ActivityVerifyIdentifyBinding>() {
requestSmsCode
()
requestSmsCode
()
}
}
@SuppressLint
(
"SetTextI18n"
)
private
fun
initView
()
{
private
fun
initView
()
{
initTitleBar
(
viewBind
.
include
.
toolbar
,
viewBind
.
include
.
tvTitle
,
""
)
initTitleBar
(
viewBind
.
include
.
toolbar
,
viewBind
.
include
.
tvTitle
,
""
)
// 默认显示空,等发送成功后再提示接收的手机号
// 默认显示空,等发送成功后再提示接收的手机号
...
@@ -77,6 +77,7 @@ class VerifyIdentityActivity : BaseActivity<ActivityVerifyIdentifyBinding>() {
...
@@ -77,6 +77,7 @@ class VerifyIdentityActivity : BaseActivity<ActivityVerifyIdentifyBinding>() {
*/
*/
private
fun
checkSmsCode
()
{
private
fun
checkSmsCode
()
{
// todo 校验成功后,进入微信授权
// todo 校验成功后,进入微信授权
XPageManager
.
push
(
XRouterPathConstants
.
WECHAT_AUTH
,
null
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/wallet/ui/WeChatAuthActivity.kt
View file @
108e882d
package
com.yidian.shenghuoquan.newscontent.wallet.ui
package
com.yidian.shenghuoquan.newscontent.wallet.ui
import
android.os.Bundle
import
android.widget.Toast
import
com.umeng.socialize.bean.SHARE_MEDIA
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.extensions.clickAntiShake
import
com.yidian.common.extensions.initTitleBar
import
com.yidian.common.utils.AuthUtils
import
com.yidian.common.utils.CheckApkExistUtil
import
com.yidian.news.util.LogUtils
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityWechatAuthBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityWechatAuthBinding
import
com.yidian.utils.ToastUtil
import
com.yidian.xpage.XPageManager
/**
/**
* 微信授权
* 微信授权
*/
*/
class
WeChatAuthActivity
:
BaseActivity
<
ActivityWechatAuthBinding
>()
{
class
WeChatAuthActivity
:
BaseActivity
<
ActivityWechatAuthBinding
>()
{
override
fun
createViewBinding
():
ActivityWechatAuthBinding
{
override
fun
createViewBinding
():
ActivityWechatAuthBinding
{
return
ActivityWechatAuthBinding
.
inflate
(
layoutInflater
)
return
ActivityWechatAuthBinding
.
inflate
(
layoutInflater
)
...
@@ -16,4 +27,44 @@ class WeChatAuthActivity: BaseActivity<ActivityWechatAuthBinding>() {
...
@@ -16,4 +27,44 @@ class WeChatAuthActivity: BaseActivity<ActivityWechatAuthBinding>() {
override
fun
getXPageName
():
String
{
override
fun
getXPageName
():
String
{
return
XRouterPathConstants
.
WECHAT_AUTH
return
XRouterPathConstants
.
WECHAT_AUTH
}
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
initView
()
initClick
()
}
private
fun
initView
()
{
initTitleBar
(
viewBind
.
include
.
toolbar
,
viewBind
.
include
.
tvTitle
,
""
)
}
private
fun
initClick
()
{
// 重新获取验证码
viewBind
.
tvToAuth
.
clickAntiShake
{
requestWeChatAuth
()
}
}
private
fun
requestWeChatAuth
()
{
if
(!
CheckApkExistUtil
.
checkApkExist
(
YdBaseApplication
.
context
,
CheckApkExistUtil
.
weChatPkgName
))
{
Toast
.
makeText
(
YdBaseApplication
.
context
,
"授权失败,未安装【微信】"
,
Toast
.
LENGTH_SHORT
).
show
()
return
}
val
authMap
=
AuthUtils
.
toAuthorize
(
this
,
SHARE_MEDIA
.
WEIXIN
)
val
accessToken
=
authMap
[
"accessToken"
]
LogUtils
.
e
(
"auth"
,
"微信授权结果$accessToken"
)
ToastUtil
.
showToast
(
this
,
"微信授权结果$accessToken"
)
if
(
accessToken
.
isNullOrBlank
())
{
ToastUtil
.
showToast
(
this
,
"微信授权失败"
)
}
else
{
toWithdraw
(
accessToken
)
}
}
private
fun
toWithdraw
(
accessToken
:
String
)
{
val
hashMap
=
HashMap
<
String
,
String
?>()
hashMap
[
"accessToken"
]
=
accessToken
XPageManager
.
push
(
XRouterPathConstants
.
WITHDRAW
,
hashMap
)
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/MerchantAssetView.kt
View file @
108e882d
...
@@ -4,8 +4,10 @@ import android.content.Context
...
@@ -4,8 +4,10 @@ import android.content.Context
import
android.util.AttributeSet
import
android.util.AttributeSet
import
android.view.View
import
android.view.View
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.constraintlayout.widget.ConstraintLayout
import
com.yidian.common.XRouterPathConstants
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ViewMerchantAssetBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ViewMerchantAssetBinding
import
com.yidian.xpage.XPageManager
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -18,6 +20,8 @@ class MerchantAssetView @JvmOverloads constructor(
...
@@ -18,6 +20,8 @@ class MerchantAssetView @JvmOverloads constructor(
defStyle
:
Int
=
0
defStyle
:
Int
=
0
)
:
ConstraintLayout
(
context
,
attrs
,
defStyle
),
View
.
OnClickListener
{
)
:
ConstraintLayout
(
context
,
attrs
,
defStyle
),
View
.
OnClickListener
{
private
var
callback
:
OnClickWalletCallback
?
=
null
private
val
viewBinding
=
ViewMerchantAssetBinding
.
bind
(
private
val
viewBinding
=
ViewMerchantAssetBinding
.
bind
(
View
.
inflate
(
View
.
inflate
(
getContext
(),
getContext
(),
...
@@ -28,6 +32,7 @@ class MerchantAssetView @JvmOverloads constructor(
...
@@ -28,6 +32,7 @@ class MerchantAssetView @JvmOverloads constructor(
init
{
init
{
viewBinding
.
tvWalletBalance
.
setOnClickListener
(
this
)
viewBinding
.
tvWalletBalance
.
setOnClickListener
(
this
)
viewBinding
.
tvToWalletBalance
.
setOnClickListener
(
this
)
}
}
/**
/**
...
@@ -41,9 +46,22 @@ class MerchantAssetView @JvmOverloads constructor(
...
@@ -41,9 +46,22 @@ class MerchantAssetView @JvmOverloads constructor(
}
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
tv_wallet_balance
)
{
when
(
v
?.
id
)
{
// TODO: 6/8/21 跳转钱包
R
.
id
.
tv_wallet_balance
,
R
.
id
.
tv_to_wallet_balance
->
{
// 进入钱包
callback
?.
toMyWallet
(
viewBinding
.
tvWalletBalance
.
text
.
toString
())
XPageManager
.
push
(
XRouterPathConstants
.
MY_WALLET
,
null
)
}
}
}
}
fun
setOnClickWalletCallback
(
callback
:
OnClickWalletCallback
)
{
this
.
callback
=
callback
}
interface
OnClickWalletCallback
{
fun
toMyWallet
(
balance
:
String
)
}
}
}
}
Components/newscontent/src/main/res/drawable-xxhdpi/icon_wechat_auth.webp
0 → 100644
View file @
108e882d
File added
Components/newscontent/src/main/res/layout/activity_wechat_auth.xml
View file @
108e882d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
>
</androidx.constraintlayout.widget.ConstraintLayout>
<include
\ No newline at end of file
android:id=
"@+id/include"
layout=
"@layout/layout_common_toolbar"
/>
<ImageView
android:layout_width=
"@dimen/dp100"
android:layout_height=
"@dimen/dp100"
android:layout_gravity=
"center"
android:layout_marginTop=
"@dimen/dp70"
android:src=
"@drawable/icon_wechat_auth"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"@dimen/dp40"
android:text=
"微信授权"
android:textColor=
"@color/color_333333"
android:textSize=
"24sp"
android:textStyle=
"bold"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"@dimen/dp5"
android:text=
"授权成功后即可提现至微信钱包"
android:textColor=
"@color/color_666666"
android:textSize=
"@dimen/sp16"
/>
<TextView
android:id=
"@+id/tv_to_auth"
android:layout_width=
"@dimen/dp160"
android:layout_height=
"44dp"
android:layout_gravity=
"center"
android:layout_marginTop=
"40dp"
android:background=
"@drawable/account_btn_gradient_bg"
android:gravity=
"center"
android:text=
"去授权"
android:textColor=
"@color/white"
android:textSize=
"18sp"
/>
</LinearLayout>
\ No newline at end of file
Components/newscontent/src/main/res/layout/view_merchant_asset.xml
View file @
108e882d
...
@@ -64,6 +64,7 @@
...
@@ -64,6 +64,7 @@
app:layout_constraintTop_toBottomOf=
"@id/tv_monthly_income"
/>
app:layout_constraintTop_toBottomOf=
"@id/tv_monthly_income"
/>
<TextView
<TextView
android:id=
"@+id/tv_to_wallet_balance"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginTop=
"2dp"
...
...
app/src/main/AndroidManifest.xml
View file @
108e882d
...
@@ -40,6 +40,58 @@
...
@@ -40,6 +40,58 @@
tools:targetApi=
"n"
>
tools:targetApi=
"n"
>
<!-- 以下为友盟分享基本配置信息 start-->
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"${file_provider}"
android:exported=
"false"
android:grantUriPermissions=
"true"
tools:replace=
"android:authorities"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/file_paths"
tools:replace=
"android:resource"
/>
</provider>
<!--微信分享/登录-->
<activity
android:name=
".wxapi.WXEntryActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:exported=
"true"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.tencent.tauth.AuthActivity"
android:launchMode=
"singleTask"
android:noHistory=
"true"
>
<intent-filter>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.DEFAULT"
/>
<category
android:name=
"android.intent.category.BROWSABLE"
/>
<data
android:scheme=
"tencent101923771"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.tencent.connect.common.AssistActivity"
android:configChanges=
"orientation|keyboardHidden"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.umeng.socialize.media.WBShareCallBackActivity"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
/>
<activity
android:name=
"com.sina.weibo.sdk.web.WeiboSdkWebActivity"
android:configChanges=
"keyboardHidden|orientation"
android:exported=
"false"
android:windowSoftInputMode=
"adjustResize"
/>
<!-- 以上为友盟分享基本配置信息 end-->
<uses-library
<uses-library
android:name=
"org.apache.http.legacy"
android:name=
"org.apache.http.legacy"
...
...
app/src/main/java/com/shenghuoquan/business/debug/wxapi/WXEntryActivity.kt
0 → 100644
View file @
108e882d
package
com.shenghuoquan.business.debug.wxapi
import
com.umeng.socialize.weixin.view.WXCallbackActivity
class
WXEntryActivity
:
WXCallbackActivity
()
{
}
app/src/main/java/com/shenghuoquan/business/wxapi/WXEntryActivity.kt
0 → 100644
View file @
108e882d
package
com.shenghuoquan.business.wxapi
import
com.umeng.socialize.weixin.view.WXCallbackActivity
class
WXEntryActivity
:
WXCallbackActivity
()
{
}
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