Commit 2a4f013b authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :登录后置
[实现方案] :
parent 47d5eb81
PACKAGE_NAME=com.zhangxin.magicbox
VERSION_CODE=16
VERSION_NAME=1.0.3.8
\ No newline at end of file
VERSION_CODE=17
VERSION_NAME=1.0.3.9
\ No newline at end of file
......@@ -148,10 +148,12 @@ public class NetConfig {
public static final String URL_VERSION = "app/v1/version";
public static final String URL_AUTH_GOOGLE_LOGIN = "app/v1/auth/googleLogin";//绑定谷歌登录
public static final String URL_AUTH_FACEBOOK_LOGIN = "app/v1/auth/facebookLogin";//绑定FaceBook登录
public static final String URL_AUTH_GOOGLE_BIND = "app/v1/auth/googleBind";//绑定谷歌登录
public static final String URL_AUTH_FACEBOOK_BIND = "app/v1/auth/facebookBind";//绑定FaceBook登录
///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";
}
......@@ -200,15 +202,15 @@ public class NetConfig {
}
public static class H5 {
public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/userAgree.html?version="+ Constant.Param.vn+"&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/userAgree.html?version=" + Constant.Param.vn + "&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/privacy.html?version="+ Constant.Param.vn+"&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_PRIVACY = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/privacy.html?version=" + Constant.Param.vn + "&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version="+ Constant.Param.vn+"&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_ABOUT_US = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/aboutMe.html?version=" + Constant.Param.vn + "&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_CUSTOMER_SERVICE = "https://1568685.s4.udesk.cn/im_client/?web_plugin_id=25351";
public static String WEB_URL_ZENGZHI_SERVICE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/xymh_zz_server.html";
public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/buyerKnow.html?version="+ Constant.Param.vn+"&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_BUYER_KNOW = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/buyerKnow.html?version=" + Constant.Param.vn + "&appName=MagicBox&company=北京志信博文科技发展有限公司";
public static String WEB_URL_RULE = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/hk/MagicBoxRules.html";
......@@ -253,8 +255,8 @@ public class NetConfig {
public static final String HOME_BOX_CARD_RE_PUMPING_FIVE = "app/v3/game/box/lotteryCardRePumpingFive";//五连抽重抽
public static final String HOME_BOX_CASH_LOG = "app/v2/game/box/cashLog";//魔币明细
public static final String HOME_BOX_ORDER_SHOP = "app/v1/game/box/orderShop";//商城 - 用户订单
public static final String HOME_BOX_INFO_BOXLIST= "app/v1/game/box/boxList/info";//个人中心 - 推荐
public static final String HOME_BOX_NOTICE= "app/v1/game/box/notice";//公告
public static final String HOME_BOX_INFO_BOXLIST = "app/v1/game/box/boxList/info";//个人中心 - 推荐
public static final String HOME_BOX_NOTICE = "app/v1/game/box/notice";//公告
}
......
......@@ -245,4 +245,18 @@ interface IHomeApi {
@Query("nickname") nickname: String?,
@Query("picture") picture: String?
): Observable<Response<WxBindEntity?>>
@POST(NetConfig.User.URL_AUTH_GOOGLE_BIND)
fun authGoogleBind(
@Query("userID") userID: String?,
@Query("nickname") nickname: String?,
@Query("picture") picture: String?
): Observable<Response<WxBindEntity?>>
@POST(NetConfig.User.URL_AUTH_FACEBOOK_BIND)
fun authFaceBookBind(
@Query("userID") userID: String?,
@Query("nickname") nickname: String?,
@Query("picture") picture: String?
): Observable<Response<WxBindEntity?>>
}
\ No newline at end of file
......@@ -11,7 +11,8 @@ class OrderEntity {
var totalPrice:String?=""
var disCount:String?=""
var text:String?=""
var text2:String?=""
var totalPrice2:String?=""
var payGoodsId2:String?=""
var allHas:Int?=0
}
\ No newline at end of file
......@@ -104,7 +104,7 @@ class FaceBookLoginUtil {
* faceBook 绑定后端服务器
* */
private fun bindFaceBookLogin(userId: String?, userName: String?, picture: String?) {
ApiClient.homeApi.authFaceBookLogin(userId, userName, picture)
ApiClient.homeApi.authFaceBookBind(userId, userName, picture)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<WxBindEntity>() {
override fun onSuccess(result: WxBindEntity?) {
......
......@@ -105,7 +105,7 @@ class GoogleLoginUtil {
* 绑定后端服务器
* */
private fun bindGoogle(userId: String?, userName: String?, picture: String?) {
ApiClient.homeApi.authGoogleLogin(userId, userName, picture)
ApiClient.homeApi.authGoogleBind(userId, userName, picture)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<WxBindEntity>() {
override fun onSuccess(result: WxBindEntity?) {
......
......@@ -60,7 +60,7 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
private var oneSellCoin: Double = 0.0
private var fiveSellCoin: Double = 0.0
private var boxid: String? = ""
private var wechatutil: WeChatUtils? = null
// private var wechatutil: WeChatUtils? = null
private var mSwitchMainObservable: Observable<Int>? = null
private var price: String? = ""
private var mPayPresenter: PayContract.Presenter? = null
......@@ -85,8 +85,8 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
initPayCoing()
boxid = intent?.data?.getQueryParameter("boxid") ?: ""
wechatutil = WeChatUtils(this, this)
wechatutil?.isWechatLogin(null)
// wechatutil = WeChatUtils(this, this)
// wechatutil?.isWechatLogin(null)
//返回
id_detail_img_back?.setOnClickListener {
this.finish()
......@@ -97,11 +97,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
}
//试玩
id_detail_shiwan_rl?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.TEST_LOTTERY, "")
// if (!Constant.Switch.isLogin){
// JumpUtils.ThirdPardLoginJump()
// return@setOnClickListener
// }
BoxResultDialog.showTestLotteryResult(
this,
boxid ?: "",
......@@ -112,10 +111,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
}
//五连抽
id_btn_five_lottery?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
// if (!Constant.Switch.isLogin){
// JumpUtils.ThirdPardLoginJump()
// return@setOnClickListener
// }
EventUtils.onEvent("five_lottery", "5连抽")
EventUtils.onEvent("five_lottery_boxid", "" + boxid)
// price = id_tv_five_price?.text.toString()
......@@ -137,10 +136,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
}
//单抽
id_btn_one_lottery?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
// if (!Constant.Switch.isLogin){
// JumpUtils.ThirdPardLoginJump()
// return@setOnClickListener
// }
EventUtils.onEvent("one_lottery", "单抽")
EventUtils.onEvent("one_lottery_boxid", "" + boxid)
clickType = Constant.Key.ONE_LOTTERY
......
......@@ -70,21 +70,7 @@ class ShopGoodsDetailActivity : BaseActivity(), WeChatLoginSuccessCallBall {
}
id_bug_goods_btn.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
gotoBuy()
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
gotoBuy()
}
})
}
......
......@@ -141,20 +141,21 @@ class AllFragment : BaseFragment, HomeContract.View,
}
R.id.id_tv_one_lottery -> {
Log.e("MXL", "点击抽奖")
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
oneLottery(data)
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
oneLottery(data)
// wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
// override fun onResult(result: IsWeChatLoginEntity?) {
// if (result?.status.equals("0")) {
// JumpUtils.ThirdPardLoginJump()
// } else {
// oneLottery(data)
// }
// }
//
// override fun onError(code: String?, errorMsg: String?) {
//
// }
//
// })
}
}
......
......@@ -65,20 +65,20 @@ class WareHouseFragment : BaseViewPagerFragment(), WeChatLoginSuccessCallBall {
override fun lazyLoad() {
super.lazyLoad()
if (isVisible && isInitial) {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
createFragments[viewPager?.currentItem ?: 0].userVisibleHint = true
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
// wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
// override fun onResult(result: IsWeChatLoginEntity?) {
// if(result?.status.equals("0")){
// JumpUtils.ThirdPardLoginJump()
// }else{
// createFragments[viewPager?.currentItem ?: 0].userVisibleHint = true
// }
// }
//
// override fun onError(code: String?, errorMsg: String?) {
//
// }
//
// })
}
......
......@@ -90,14 +90,7 @@ class SplashPresenter : SplashContract.Presenter {
val user = SettingPreference.getUserInfoData()
val token = SettingPreference.getUserToken()
if (user == null && TextUtils.isEmpty(token)) {
if (TextUtils.equals(Utils.getChannel(AppContext.get()), "toutiao_h5")) {
// deviceLogin()
getAds()
} else {
deviceLogin()
}
deviceLogin()
} else {
UserDataUtils.updateUserInfo(null)
getAds()
......
......@@ -68,18 +68,19 @@ object FreeGoodsDialog {
dialog_lottie_view?.setOnClickListener {
// JumpUtils.lotteryBoxJump("-2", Constant.Key.ONE_LOTTERY, "0")
mDialog?.dismiss()
if (Constant.Switch.isLogin) {
EventUtils.onEvent("free_box_for_new_users","新人免费盲盒弹窗点击成功")
BoxResultDialog.showOneLotteryResult(
context as Activity,
"-2",
0.0,
0.0,
0
)
} else {
JumpUtils.ThirdPardLoginJump()
}
EventUtils.onEvent("free_box_for_new_users","新人免费盲盒弹窗点击成功")
BoxResultDialog.showOneLotteryResult(
context as Activity,
"-2",
0.0,
0.0,
0
)
// if (Constant.Switch.isLogin) {
//
// } else {
// JumpUtils.ThirdPardLoginJump()
// }
}
mDialog?.setOnDismissListener {
......
......@@ -43,62 +43,19 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
id_rl_tuijian_box?.adapter = mAdapter
id_rl_address?.setOnClickListener {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
JumpUtils.ReceiveAddressReslutJump("0")
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
JumpUtils.ReceiveAddressReslutJump("0")
}
id_ll_my_coin?.setOnClickListener {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
JumpUtils.payJump("0", "0", "0")
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
JumpUtils.payJump("0", "0", "0")
}
id_rl_logistics?.setOnClickListener {
JumpUtils.LogisticsJump()
}
id_rl_jiyijan?.setOnClickListener {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
JumpUtils.webJump(
mActivity.getString(R.string.customer_service),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
)
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
JumpUtils.webJump(
mActivity.getString(R.string.customer_service),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
)
}
id_rl_lianxikefu?.setOnClickListener {
JumpUtils.webJump(
......@@ -131,41 +88,16 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
}
id_ll_my_magic_coin?.setOnClickListener {
//我的魔币
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
JumpUtils.MyMagicCoinJump()
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
JumpUtils.MyMagicCoinJump()
}
id_rl_my_order?.setOnClickListener {
//我的订单
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
} else {
JumpUtils.MyOrderJump()
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
JumpUtils.MyOrderJump()
}
id_login_btn.setOnClickListener {
JumpUtils.ThirdPardLoginJump()
}
isLogin()
}
override fun data() {
......@@ -190,6 +122,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
UserDataUtils.updateUserInfo(this)
}
isPause = false
if(Constant.Switch.isLogin){
id_login_btn.visibility = View.GONE
}else{
id_login_btn.visibility = View.VISIBLE
}
}
override fun lazyLoad() {
......@@ -204,8 +141,10 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
fun isLogin() {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if (result?.status.equals("1")) {
if(Constant.Switch.isLogin){
id_login_btn.visibility = View.GONE
}else{
id_login_btn.visibility = View.VISIBLE
}
}
......
......@@ -40,7 +40,6 @@
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_fragment_user_center_id"
android:layout_width="wrap_content"
......@@ -111,6 +110,22 @@
android:textColor="@color/color_333333"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/id_login_btn"
android:layout_width="90dp"
android:layout_height="40dp"
android:layout_alignTop="@+id/id_fragment_user_center_photo"
android:layout_alignParentEnd="true"
android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:background="@drawable/shape_pay_bg_4c84ff"
android:gravity="center"
android:text="Login"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment