Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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
android
android_vedio
Commits
06a65178
Commit
06a65178
authored
Oct 13, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
01027762
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
29 deletions
+52
-29
UserBean.java
...c/main/java/com/duben/miniplaylet/mvp/model/UserBean.java
+10
-0
DrawCashPresenter.kt
...com/duben/miniplaylet/mvp/presenters/DrawCashPresenter.kt
+6
-11
LoanService.java
.../src/main/java/com/duben/miniplaylet/net/LoanService.java
+8
-0
MainActivity.kt
...n/java/com/duben/miniplaylet/ui/activitys/MainActivity.kt
+14
-1
DrawCashFragment.kt
...om/duben/miniplaylet/ui/fragment/draw/DrawCashFragment.kt
+12
-15
ShareSDK.xml
video/tmpmob/ShareSDK/assets/ShareSDK.xml
+2
-2
No files found.
video/app/src/main/java/com/duben/miniplaylet/mvp/model/UserBean.java
View file @
06a65178
...
...
@@ -43,6 +43,16 @@ public class UserBean implements Serializable {
private
int
rewardFirst
;
//是否弹出过领取奖励的框,0 没有, 1弹过了
private
int
rewardCoin
;
//领取奖励的金币
private
boolean
alipaySet
;
//支付宝授权状态
private
boolean
wechatSet
;
//授权状态
public
boolean
isWechatSet
()
{
return
wechatSet
;
}
public
void
setWechatSet
(
boolean
wechatSet
)
{
this
.
wechatSet
=
wechatSet
;
}
public
String
getToken
()
{
return
token
;
...
...
video/app/src/main/java/com/duben/miniplaylet/mvp/presenters/DrawCashPresenter.kt
View file @
06a65178
...
...
@@ -12,16 +12,13 @@ import java.util.HashMap
class
DrawCashPresenter
:
BasePresenter
<
DrawCashView
>()
{
/**
* 微信登录
*/
fun
wxLogin
(
wxInfo
:
String
)
{
fun
reportWeixinMsg
(
openid
:
String
)
{
view
.
showLoading
(
"加载中..."
)
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"
wxInfo"
]
=
wxInfo
vo
[
"
openid"
]
=
openid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
wechatlogin
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserBean
>>()
{
.
call
(
loanService
.
reportWeixinMsg
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
...
...
@@ -33,15 +30,13 @@ class DrawCashPresenter : BasePresenter<DrawCashView>() {
view
.
showToast
(
e
.
message
)
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
UserBean
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
if
(
data
!=
null
)
{
UserManager
.
getInstance
().
saveUserInfo
(
data
)
200
->
{
view
.
showToast
(
"微信授权成功"
)
}
else
->
view
.
showToast
(
message
)
...
...
video/app/src/main/java/com/duben/miniplaylet/net/LoanService.java
View file @
06a65178
...
...
@@ -80,6 +80,14 @@ public interface LoanService {
@POST
(
"api/user/wechatlogin"
)
Observable
<
BaseResponse
<
UserBean
>>
wechatlogin
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 微信授权
*
* @return
*/
@POST
(
"api/user/reportWeixinMsg"
)
Observable
<
BaseResponse
<
Object
>>
reportWeixinMsg
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 提交设备信息
*
...
...
video/app/src/main/java/com/duben/miniplaylet/ui/activitys/MainActivity.kt
View file @
06a65178
package
com.duben.miniplaylet.ui.activitys
import
android.content.Context
import
android.content.Intent
import
android.media.AudioManager
import
android.os.Bundle
import
android.view.KeyEvent
...
...
@@ -13,7 +14,10 @@ import com.duben.miniplaylet.R
import
com.duben.miniplaylet.common.AppConfig
import
com.duben.miniplaylet.common.Constant
import
com.duben.miniplaylet.ui.activitys.base.BaseActivity
import
com.duben.miniplaylet.ui.fragment.*
import
com.duben.miniplaylet.ui.fragment.MainFragment
import
com.duben.miniplaylet.ui.fragment.MusicFragment
import
com.duben.miniplaylet.ui.fragment.MyFragment
import
com.duben.miniplaylet.ui.fragment.RedpkgFragment
import
com.duben.miniplaylet.utils.UIUtils
import
com.duben.miniplaylet.video.csj.DPHolderManager
import
kotlinx.android.synthetic.main.activity_main.*
...
...
@@ -37,6 +41,15 @@ class MainActivity : BaseActivity(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
if
(
intent
?.
action
==
Intent
.
ACTION_MAIN
&&
intent
?.
categories
?.
contains
(
Intent
.
CATEGORY_LAUNCHER
)
==
true
)
{
// 应用是通过点击桌面图标进入的
println
(
"mcg -->>>>> 应用是通过点击桌面图标进入的"
)
}
else
{
// 应用是从后台进入前台的
// 应用是通过点击桌面图标进入的
println
(
"mcg -->>>>> 应用是通过点击桌面图标进入的"
)
}
DPHolderManager
.
initDpSdk
(
MintsApplication
.
getContext
())
audioManager
=
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
...
...
video/app/src/main/java/com/duben/miniplaylet/ui/fragment/draw/DrawCashFragment.kt
View file @
06a65178
...
...
@@ -70,6 +70,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
private
var
currentDrawInfo
:
DrawInfoBean
.
DrawInfoItemBean
?
=
null
var
payChannel
=
ALIPAY
var
alipayStatus
=
false
var
weixinStatus
=
false
private
var
currentPosition
=
0
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_draw
...
...
@@ -116,6 +117,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
override
fun
getRedpkgSuc
(
data
:
DrawInfoBean
)
{
this
.
redPkgBean
=
data
this
.
alipayStatus
=
data
.
userMsg
.
isAlipaySet
this
.
weixinStatus
=
data
.
userMsg
.
isWechatSet
tv_title
.
text
=
"红包余额(元)"
tv_cash
.
text
=
SpanUtils
()
...
...
@@ -162,6 +164,12 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
currentDrawInfo
=
redPkgBean
?.
list
?.
get
(
position
)
}
if
(
currentDrawInfo
?.
cash
!!
<
0.3
)
{
rb_wechat
.
visibility
=
View
.
GONE
}
else
{
rb_wechat
.
visibility
=
View
.
VISIBLE
}
/**
* 21 任务弹框,
* 11 直接在当前页面观看视频,-- 立即赚钱
...
...
@@ -202,9 +210,8 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
1
->
{
//1、支付渠道
if
(
TextUtils
.
equals
(
payChannel
,
WEIXIN_PAY
))
{
// 微信授权
if
(
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
wxOpenid
)
)
{
if
(
!
weixinStatus
)
{
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
)
{
showToast
(
"请先安装微信"
)
...
...
@@ -217,7 +224,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
loginApi
.
login
(
requireActivity
())
return
}
}
else
if
(
TextUtils
.
equals
(
payChannel
,
ALIPAY
))
{
}
else
if
(
TextUtils
.
equals
(
payChannel
,
ALIPAY
))
{
// 2、授权支付宝
if
(!
alipayStatus
)
{
// 去授权
...
...
@@ -384,20 +391,10 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
override
fun
onLogin
(
platform
:
String
?,
res
:
HashMap
<
String
,
Any
>):
Boolean
{
try
{
wxInfo
=
WXInfo
()
wxInfo
?.
let
{
it
.
unionid
=
res
[
"unionid"
].
toString
()
+
""
it
.
openid
=
res
[
"openid"
].
toString
()
+
""
it
.
province
=
res
[
"province"
].
toString
()
+
""
it
.
city
=
res
[
"city"
].
toString
()
+
""
it
.
country
=
res
[
"country"
].
toString
()
+
""
it
.
headimgurl
=
res
[
"headimgurl"
].
toString
()
+
""
it
.
nickname
=
res
[
"nickname"
].
toString
()
+
""
it
.
sex
=
(
res
[
"sex"
].
toString
()
+
""
).
toInt
()
}
var
tempOpid
=
res
[
"openid"
].
toString
()
+
""
if
(
isAdded
)
{
drawCashPresenter
.
wxLogin
(
JsonUtil
.
toJson
(
wxInfo
)
)
drawCashPresenter
.
reportWeixinMsg
(
tempOpid
)
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
video/tmpmob/ShareSDK/assets/ShareSDK.xml
View file @
06a65178
...
...
@@ -16,8 +16,8 @@
<Tumblr
Enable=
"false"
/>
<Email
Enable=
"false"
/>
<ShortMessage
Enable=
"false"
/>
<Wechat
AppId=
"wx
7e946f66585ca00a"
AppSecret=
"6fe41783e736bea36504b271cea484f1
"
userName=
"gh_afb25ac019c9"
path=
"pages/index/index.html?id=1"
WithShareTicket=
"true"
MiniprogramType=
"0"
/>
<WechatMoments
AppId=
"wx
7e946f66585ca00a"
AppSecret=
"6fe41783e736bea36504b271cea484f1
"
/>
<Wechat
AppId=
"wx
8d69898f9fb291e6"
AppSecret=
"ad6245d18872ed53a33c0f71418f6cde
"
userName=
"gh_afb25ac019c9"
path=
"pages/index/index.html?id=1"
WithShareTicket=
"true"
MiniprogramType=
"0"
/>
<WechatMoments
AppId=
"wx
8d69898f9fb291e6"
AppSecret=
"ad6245d18872ed53a33c0f71418f6cde
"
/>
<QQ
Enable=
"false"
/>
<Instapaper
Enable=
"false"
/>
<Pocket
Enable=
"false"
/>
...
...
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