Commit 22b04806 authored by maxiaoliang's avatar maxiaoliang

11

parent e8e55e30
......@@ -72,18 +72,19 @@ android {
Facebook {
id 8
sortId 8
appKey "1412473428822331"
appKey "305929098113554"
appSecret "a42f4f3f867dc947b9ed6020c2e93558"
callbackUri "https://www.baidu.com"
officialVersion "default"
faceBookLoginProtocolScheme "fb1412473428822331"
faceBookLoginProtocolScheme "fb662970168312513"
shareByAppClient true
enable true
}
GooglePlus {
id 21
sortId 21
appId "236300675100-am5pm8km7md1memjevq8rl9pg5c4s4b8.apps.googleusercontent.com"
appId "535211515800-9b6op28etopmltck4s09420h8shbr1cf.apps.googleusercontent.com"
callbackUri "http://localhost"
officialVersion "default"
shareByAppClient true
......
......@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import com.mob.MobSDK;
import com.umeng.socialize.UMShareAPI;
import com.zhangxin.magicbox.R;
import com.umeng.analytics.MobclickAgent;
......@@ -45,11 +44,6 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cn.sharesdk.facebook.Facebook;
import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.PlatformActionListener;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.google.GooglePlus;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
......@@ -377,24 +371,5 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
// super.onSaveInstanceState(outState);
}
private void facelogin() {
MobSDK.submitPolicyGrantResult(true,null);
Platform plat = ShareSDK.getPlatform(Facebook.NAME);
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.setPlatformActionListener(new PlatformActionListener() {
public void onError(Platform arg0, int arg1, Throwable arg2) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
}
public void onComplete(Platform arg0, int arg1, HashMap arg2) {
//分享成功的回调
}
public void onCancel(Platform arg0, int arg1) {
//取消分享的回调
}
});
//ShareSDK.setActivity(this);//抖音登录适配安卓9.0
plat.authorize();
}
}
......@@ -165,6 +165,9 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://submit")
fun getIntentActivitySubmit(): Intent
@RounterUri(Constant.scheme + "://thirdparty")
fun getIntentActivityThirdPartLogin(): Intent
@RounterUri(Constant.scheme + "://video_result")
fun getIntentActivityVideoResult(@RounterParam("url") str: String): Intent
......
......@@ -204,6 +204,15 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void ThirdPardLoginJump() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityThirdPartLogin();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void videoResultJump(String url) {
try {
......
......@@ -196,36 +196,53 @@ class WeChatUtils {
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.platformActionListener = object : PlatformActionListener {
override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) {
Log.e("MXL", "FaceBook:onComplete")
}
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
Log.e("MXL", "FaceBook:onError" + arg2.printStackTrace())
}
override fun onCancel(arg0: Platform, arg1: Int) {
//取消分享的回调
Log.e("MXL", "FaceBook:onCancel")
}
}
plat.authorize()
// plat.authorize()
if (plat.isAuthValid()) {
plat.removeAccount(true)
return
}
plat.showUser(null)
}
fun GoogleLogin(){
fun GoogleLogin() {
MobSDK.submitPolicyGrantResult(true, null)
val plat = ShareSDK.getPlatform(GooglePlus.NAME)
ShareSDK.setActivity(mContext as Activity)
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.platformActionListener = object : PlatformActionListener {
override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) {
Log.e("MXL", "onComplete")
Log.e("MXL", "Data:" + p0?.db?.exportData())
}
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
Log.e("MXL", "onError" + arg2.printStackTrace())
}
override fun onCancel(arg0: Platform, arg1: Int) {
//取消分享的回调
Log.e("MXL", "onCancel")
}
}
plat.authorize()
// plat.authorize()
plat.showUser(null)
}
}
\ No newline at end of file
......@@ -175,6 +175,15 @@
android:scheme="magicbox" />
</intent-filter>
</activity>
<activity android:name=".page.activity.ThirdpartyLoginActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="thirdparty"
android:scheme="magicbox" />
</intent-filter>
</activity>
<activity
android:name="com.zxhl.main.page.activity.SplashActivity"
android:screenOrientation="portrait"
......
......@@ -125,7 +125,8 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
} else {
wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
JumpUtils.ThirdPardLoginJump()
// wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
}
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY)
} else {
......@@ -170,7 +171,8 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
} else {
Log.e("MXL", "未登录")
// onWxLogin()
wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
JumpUtils.ThirdPardLoginJump()
// wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
}
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY)
} else {
......
......@@ -124,7 +124,8 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
fiveSellCoin
)
} else {
wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
JumpUtils.ThirdPardLoginJump()
// wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
}
} else {
needPrice = fiveSellCoin.toString()
......@@ -173,7 +174,8 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
} else {
Log.e("MXL", "未登录")
// onWxLogin()
wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
JumpUtils.ThirdPardLoginJump()
// wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
}
} else {
needPrice = oneSellCoin.toString()
......
package com.zxhl.main.page.activity
import android.view.View
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.NoDoubleClickListener
import com.zxhl.cms.utils.WeChatLoginSuccessCallBall
import com.zxhl.cms.utils.WeChatUtils
import com.zxhl.main.R
import kotlinx.android.synthetic.main.activity_layout_third_party_login.*
class ThirdpartyLoginActivity:BaseActivity(), WeChatLoginSuccessCallBall {
private var wechatutil: WeChatUtils? = null
override fun onClick(v: View?) {
}
override fun before() {
super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
}
override fun layoutID(): Int {
return R.layout.activity_layout_third_party_login
}
override fun init() {
wechatutil = WeChatUtils(this, this)
id_ll_google_login?.setOnClickListener(object :NoDoubleClickListener(){
override fun onNoDoubleClick(v: View?) {
//WeChatUtils.
wechatutil?.GoogleLogin()
}
})
id_ll_facebook_login?.setOnClickListener(object :NoDoubleClickListener(){
override fun onNoDoubleClick(v: View?) {
wechatutil?.FackBooklogin()
}
})
}
override fun loginSuccess(lottery: String?) {
}
}
\ No newline at end of file
......@@ -152,7 +152,8 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View,
)
startActivity(intent)
} else {
wechatutil!!.wechatLogin(mActivity, Constant.Key.FIVE_LOTTERY)
JumpUtils.ThirdPardLoginJump()
// wechatutil!!.wechatLogin(mActivity, Constant.Key.FIVE_LOTTERY)
}
}
......
......@@ -7,11 +7,15 @@ import android.view.Gravity
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.utils.NoDoubleClickListener
import com.zxhl.cms.utils.Utils
import com.zxhl.main.R
import com.zxhl.main.page.*
import com.zxhl.main.page.`interface`.PopupWidowCloseCallBack
import java.text.DecimalFormat
object RecycleDialog : RecoverPopupContract.View {
......@@ -52,17 +56,22 @@ object RecycleDialog : RecoverPopupContract.View {
mDialogView?.findViewById<ImageView>(R.id.id_img_dialog_close).setOnClickListener {
mDialog?.dismiss()
}
val df = DecimalFormat("#.00")
if (type.equals(Constant.Key.ONE_LOTTERY)) {
tv_recycle_price?.text = recoverPrice
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
} else if (type.equals(Constant.Key.FIVE_LOTTERY)) {
tv_recycle_price?.text = recoverPrice.toDoubleOrNull()?.times(5)?.toInt().toString()
tv_recycle_price?.text = "${recoverPrice.toDoubleOrNull()?.times(
5
)?.toString()}"
} else {
tv_recycle_price?.text = recoverPrice.toDoubleOrNull()?.toInt().toString()
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
}
mDialogView.findViewById<TextView>(R.id.id_tv_sure_recycle).setOnClickListener(object :NoDoubleClickListener(){
mDialogView.findViewById<TextView>(R.id.id_tv_sure_recycle).setOnClickListener(object :
NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) {
if (!TextUtils.isEmpty(ids)) {
mPresenter?.recoverGoods(ids,recovetype)
mPresenter?.recoverGoods(ids, recovetype)
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="1dp"
android:color="#ffd3d3d3" />
<solid android:color="#ffffffff" />
<corners android:radius="5dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bj_login">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:src="@drawable/bj_login"
android:visibility="gone"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Welcome to Magic Box"
android:textColor="@color/color_333333"
android:textSize="22sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/id_ll_google_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="55dp"
android:layout_marginTop="40dp"
android:layout_marginRight="55dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_ffffff_r5_d3d3d3"
android:gravity="center_horizontal"
android:paddingTop="12.5dp"
android:paddingBottom="12.5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_google" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Continue with Google"
android:textColor="@color/color_333333"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_ll_facebook_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="55dp"
android:layout_marginRight="55dp"
android:background="@drawable/shape_ffffff_r5_d3d3d3"
android:gravity="center_horizontal"
android:paddingTop="12.5dp"
android:paddingBottom="12.5dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_facebook" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:text="Continue with Facebook"
android:textColor="@color/color_333333"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......@@ -5,7 +5,7 @@
android:gravity="center">
<LinearLayout
android:layout_width="300dp"
android:layout_width="340dp"
android:layout_height="wrap_content"
android:background="@drawable/shape_ffffff_r15"
android:orientation="vertical">
......@@ -18,40 +18,40 @@
android:padding="10dp"
android:src="@drawable/dialog_icon_guanbi" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:gravity="center_horizontal"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/recycle_desc"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_recycle_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:drawableLeft="@drawable/icon_mobi"
android:drawablePadding="5dp"
android:text="0"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/recycle_desc"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold"
android:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/id_tv_recycle_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableLeft="@drawable/icon_mobi"
android:drawablePadding="5dp"
android:layout_margin="5dp"
android:text="0"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:text="@string/recycle_desc2"
android:textColor="@color/color_333333"
android:textSize="18sp"
......
......@@ -79,7 +79,7 @@
android:drawableLeft="@drawable/icon_jinbi"
android:drawablePadding="5dp"
android:includeFontPadding="false"
android:textColor="#FF2E31"
android:textColor="@color/color_4c84ff"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
......@@ -28,8 +28,8 @@ class RecomendAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecomendAdapter.V
var bean = mList[position]
holder.id_img_goods?.setLoadImageUrl(bean.mainImage, false)
holder.id_tv_goods_name?.text = bean.boxName
holder.id_tv_pay_price?.text = "¥${bean.onePriceStr}"
holder.id_tv_goods_nums?.text="已开${bean.totalSalesVolume}次"
holder.id_tv_pay_price?.text = "$${bean.onePriceStr}"
holder.id_tv_goods_nums?.text=AppContext.get().getString(R.string.box_detail_open_box_num,"${bean.totalSalesVolume}")
holder.id_ll_item?.setOnClickListener(object :NoDoubleClickListener(){
override fun onNoDoubleClick(v: View?) {
JumpUtils.goodsDetailJump(bean?.boxId)
......
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