Commit 4b8304df authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :上传Google
[实现方案] :加入事件上报
parent ff8e7b2f
...@@ -12,6 +12,7 @@ import android.text.TextUtils; ...@@ -12,6 +12,7 @@ import android.text.TextUtils;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -73,6 +74,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -73,6 +74,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
private Observable<String> mRestartLoginObservable; private Observable<String> mRestartLoginObservable;
private Observable<Integer> mSwitchMainObservable; private Observable<Integer> mSwitchMainObservable;
private String goodsId; private String goodsId;
private TextView mallBottomBtn;
@Override @Override
public int layoutID() { public int layoutID() {
...@@ -97,6 +99,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -97,6 +99,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
false false
); );
navigationView = findViewById(R.id.id_activity_main_fragment_navigation); navigationView = findViewById(R.id.id_activity_main_fragment_navigation);
mallBottomBtn = findViewById(R.id.id_view_navigation_bottom_shop);
// memberPresenter = new MemberPresenter(this); // memberPresenter = new MemberPresenter(this);
initListener(); initListener();
AdDataSupport.INSTANCE.init(this); AdDataSupport.INSTANCE.init(this);
...@@ -137,7 +140,13 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -137,7 +140,13 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
fragments.add(new HomeFragment()); fragments.add(new HomeFragment());
fragments.add(new WareHouseFragment()); fragments.add(new WareHouseFragment());
fragments.add(new UserCenterFragment()); fragments.add(new UserCenterFragment());
fragments.add(new ShopFragment());
if (Constant.Switch.isOpenShop) {
fragments.add(new ShopFragment());
mallBottomBtn.setVisibility(View.VISIBLE);
}else {
mallBottomBtn.setVisibility(View.GONE);
}
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
for (Fragment fragment : fragments) { for (Fragment fragment : fragments) {
transaction.add(R.id.id_activity_main_fragment_layout, fragment); transaction.add(R.id.id_activity_main_fragment_layout, fragment);
...@@ -173,10 +182,10 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N ...@@ -173,10 +182,10 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
@Override @Override
public void onNavigationClick(int vId) { public void onNavigationClick(int vId) {
if (vId == com.zxhl.main.R.id.id_view_navigation_bottom_user) { if (vId == R.id.id_view_navigation_bottom_user) {
switchFragment(2); switchFragment(2);
EventUtils.INSTANCE.onEvent("tab_imp", "user"); EventUtils.INSTANCE.onEvent("tab_imp", "user");
} else if (vId == com.zxhl.main.R.id.id_view_navigation_bottom_box) { } else if (vId == R.id.id_view_navigation_bottom_box) {
switchFragment(0); switchFragment(0);
EventUtils.INSTANCE.onEvent("tab_imp", "home"); EventUtils.INSTANCE.onEvent("tab_imp", "home");
} else if (vId == R.id.id_view_navigation_bottom_shop) { } else if (vId == R.id.id_view_navigation_bottom_shop) {
......
PACKAGE_NAME=com.zhangxin.magicbox PACKAGE_NAME=com.zhangxin.magicbox
VERSION_CODE=6 VERSION_CODE=7
VERSION_NAME=1.0.2 VERSION_NAME=1.0.3
...@@ -135,6 +135,9 @@ public class Constant { ...@@ -135,6 +135,9 @@ public class Constant {
public static class Switch { public static class Switch {
public static boolean isShowUpdateDialoging = false; public static boolean isShowUpdateDialoging = false;
public static boolean isOpenShop = false;
public static boolean isLogin = false;
public static String recoverType = "1";
} }
public static final String UPDATE_TAB_INFO = "update_tab_info"; public static final String UPDATE_TAB_INFO = "update_tab_info";
......
package com.zxhl.cms.common; package com.zxhl.cms.common;
import com.zxhl.cms.utils.PhoneUtils;
import static com.zxhl.cms.common.NetConfig.Environment.DEV; import static com.zxhl.cms.common.NetConfig.Environment.DEV;
import static com.zxhl.cms.common.NetConfig.Environment.PRODUCT; import static com.zxhl.cms.common.NetConfig.Environment.PRODUCT;
...@@ -21,7 +23,7 @@ public class NetConfig { ...@@ -21,7 +23,7 @@ public class NetConfig {
} }
// 根据调试选项更新环境 // 根据调试选项更新环境
public static Environment sEnvironment = DEV;// 当前环境 public static Environment sEnvironment = PRODUCT;// 当前环境
public static String BASE_WEB_URL = ""; public static String BASE_WEB_URL = "";
public static String BASE_URL = ""; public static String BASE_URL = "";
public static String BASE_NEW_URL = ""; public static String BASE_NEW_URL = "";
...@@ -34,7 +36,7 @@ public class NetConfig { ...@@ -34,7 +36,7 @@ public class NetConfig {
sEnvironment = s; sEnvironment = s;
switch (sEnvironment) { switch (sEnvironment) {
case PRODUCT: case PRODUCT:
BASE_URL = "http://feedapi.zhangxinhulian.com/"; BASE_URL = "https://feedapihk.zhangxinhulian.com/";
BASE_WEB_URL = "http://feedapi.zhangxinhulian.com/"; BASE_WEB_URL = "http://feedapi.zhangxinhulian.com/";
BASE_NEW_URL = "http://feedapi.zhangxinhulian.com/"; BASE_NEW_URL = "http://feedapi.zhangxinhulian.com/";
BASE_FEED_URL = "http://feedapi.zhangxinhulian.com/"; BASE_FEED_URL = "http://feedapi.zhangxinhulian.com/";
...@@ -198,15 +200,17 @@ public class NetConfig { ...@@ -198,15 +200,17 @@ public class NetConfig {
} }
public static class H5 { public static class H5 {
public static String WEB_URL_USER = "https://newspool.zhangxinhulian.com/sspapiNovel/su/custom/xingyunmohe/userAgree.html?version=1.1.3&appName=幸运魔盒&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=1.1.3&appName=幸运魔盒&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=1.1.3&appName=幸运魔盒&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_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_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=1.1.3&appName=幸运魔盒&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";
public static String WEB_URL_INVITE; public static String WEB_URL_INVITE;
......
...@@ -11,4 +11,5 @@ class AppInEntity { ...@@ -11,4 +11,5 @@ class AppInEntity {
var feedback_open: String? = "" var feedback_open: String? = ""
var depots_text: String? = "" var depots_text: String? = ""
var recover_type: String = "" var recover_type: String = ""
var shop_open: Int = 0//0 关闭, 1 打开
} }
\ No newline at end of file
...@@ -564,12 +564,14 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -564,12 +564,14 @@ class PayActivity : BaseActivity(), PayContract.View,
override fun onPaySuccess(purchase: GooglePayResult, googleJson: String) { override fun onPaySuccess(purchase: GooglePayResult, googleJson: String) {
mPresenter?.verifyPay(googleJson, GOOGLE_PAY) mPresenter?.verifyPay(googleJson, GOOGLE_PAY)
//mLoading?.setResult(true, "Pay for success", 1000) //mLoading?.setResult(true, "Pay for success", 1000)
EventUtils.onEvent("GooglePaySuccess")
} }
override fun onCancel() { override fun onCancel() {
runOnUiThread { runOnUiThread {
mLoading?.setResult(false, "pay cancel", 1000) mLoading?.setResult(false, "pay cancel", 1000)
} }
EventUtils.onEvent("GooglePayCancel")
} }
override fun onError(error: String) { override fun onError(error: String) {
...@@ -577,6 +579,7 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -577,6 +579,7 @@ class PayActivity : BaseActivity(), PayContract.View,
runOnUiThread { runOnUiThread {
mLoading?.setResult(false, "pay error", 1000) mLoading?.setResult(false, "pay error", 1000)
} }
EventUtils.onEvent("GooglePayError",error)
} }
}) })
} }
......
...@@ -12,6 +12,7 @@ import cn.sharesdk.google.GooglePlus ...@@ -12,6 +12,7 @@ import cn.sharesdk.google.GooglePlus
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonObject import com.google.gson.JsonObject
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.net.ApiClient import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
...@@ -40,6 +41,7 @@ class WeChatUtils { ...@@ -40,6 +41,7 @@ class WeChatUtils {
.subscribe(object : BaseObserver<IsWeChatLoginEntity>() { .subscribe(object : BaseObserver<IsWeChatLoginEntity>() {
override fun onSuccess(result: IsWeChatLoginEntity?) { override fun onSuccess(result: IsWeChatLoginEntity?) {
result?.let { result?.let {
Constant.Switch.isLogin = result.status!="0"
callback?.onResult(it) callback?.onResult(it)
} }
// isLogin = result?.status.equals("1") // isLogin = result?.status.equals("1")
...@@ -159,18 +161,22 @@ class WeChatUtils { ...@@ -159,18 +161,22 @@ class WeChatUtils {
//授权回调监听,监听oncomplete,onerror,oncancel三种状态 //授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.platformActionListener = object : PlatformActionListener { plat.platformActionListener = object : PlatformActionListener {
override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) { override fun onComplete(p0: Platform?, p1: Int, p2: HashMap<String, Any>?) {
Log.e("MXL", "Data:" + p0?.db?.exportData()+"Image:"+p0?.db?.userIcon) Log.e("MXL", "Data:" + p0?.db?.exportData() + "Image:" + p0?.db?.userIcon)
bindFaceBookLogin(p0?.db?.userId, p0?.db?.userName, p0?.db?.userIcon) bindFaceBookLogin(p0?.db?.userId, p0?.db?.userName, p0?.db?.userIcon)
EventUtils.onEvent("FackBookloginSuccess")
} }
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) { override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息 //失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
Log.e("MXL", "FaceBook:onError" + arg2.printStackTrace()) Log.e("MXL", "FaceBook:onError" + arg2.printStackTrace())
EventUtils.onEvent("FackBookloginError", "arg1" + arg1 + " arg2" + arg2.message+" arg2:"+arg2.printStackTrace())
} }
override fun onCancel(arg0: Platform, arg1: Int) { override fun onCancel(arg0: Platform, arg1: Int) {
//取消分享的回调 //取消分享的回调
Log.e("MXL", "FaceBook:onCancel") Log.e("MXL", "FaceBook:onCancel")
EventUtils.onEvent("FackBookloginCancel")
} }
} }
plat.showUser(null) plat.showUser(null)
...@@ -183,6 +189,7 @@ class WeChatUtils { ...@@ -183,6 +189,7 @@ class WeChatUtils {
override fun onSuccess(result: WxBindEntity?) { override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token) SettingPreference.saveToken(result?.token)
UserDataUtils.updateUserInfo(null) UserDataUtils.updateUserInfo(null)
Constant.Switch.isLogin = true
Log.e("MXL", "FaceBook登录成功") Log.e("MXL", "FaceBook登录成功")
// getShareCon tent(mContext) // getShareCon tent(mContext)
// callBack.loginSuccess(lottery) // callBack.loginSuccess(lottery)
...@@ -212,6 +219,7 @@ class WeChatUtils { ...@@ -212,6 +219,7 @@ class WeChatUtils {
val pic = obj.get("picture").toString().replace("\"", "") val pic = obj.get("picture").toString().replace("\"", "")
Log.e("MXL", "image:" + pic) Log.e("MXL", "image:" + pic)
bindGoogle(p0?.db?.userId, p0?.db?.userName, pic) bindGoogle(p0?.db?.userId, p0?.db?.userName, pic)
EventUtils.onEvent("GoogleLoginSuccess")
} }
} }
...@@ -219,12 +227,15 @@ class WeChatUtils { ...@@ -219,12 +227,15 @@ class WeChatUtils {
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) { override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息 //失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
Log.e("MXL", "onError" + arg2.printStackTrace()) Log.e("MXL", "onError" + arg2.printStackTrace())
Log.e("MXL", "onError" + arg2.message)
EventUtils.onEvent("GoogleLoginError", "arg1" + arg1 + " arg2" + arg2.message+" arg2:"+arg2.printStackTrace())
} }
override fun onCancel(arg0: Platform, arg1: Int) { override fun onCancel(arg0: Platform, arg1: Int) {
//取消分享的回调 //取消分享的回调
Log.e("MXL", "onCancel") Log.e("MXL", "onCancel")
EventUtils.onEvent("GoogleLoginCancel")
} }
} }
// plat.authorize() // plat.authorize()
...@@ -239,6 +250,7 @@ class WeChatUtils { ...@@ -239,6 +250,7 @@ class WeChatUtils {
override fun onSuccess(result: WxBindEntity?) { override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token) SettingPreference.saveToken(result?.token)
UserDataUtils.updateUserInfo(null) UserDataUtils.updateUserInfo(null)
Constant.Switch.isLogin = true
Log.e("MXL", "谷歌登录成功") Log.e("MXL", "谷歌登录成功")
// getShareCon tent(mContext) // getShareCon tent(mContext)
// callBack.loginSuccess(lottery) // callBack.loginSuccess(lottery)
......
...@@ -6,15 +6,16 @@ import android.animation.ObjectAnimator ...@@ -6,15 +6,16 @@ import android.animation.ObjectAnimator
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Intent import android.content.Intent
import android.graphics.Paint
import android.text.Html import android.text.Html
import android.text.TextUtils import android.text.TextUtils
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
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseActivity import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.* import com.zxhl.cms.net.model.box.*
...@@ -25,7 +26,6 @@ import com.zxhl.cms.pay.PayPresenter ...@@ -25,7 +26,6 @@ import com.zxhl.cms.pay.PayPresenter
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.*
import com.zxhl.cms.widget.LoadingDialog import com.zxhl.cms.widget.LoadingDialog
import com.zxhl.main.R import com.zxhl.main.R
import com.zxhl.main.page.adapter.BoxAdapter
import com.zxhl.main.page.adapter.GoodsPoolAdapter import com.zxhl.main.page.adapter.GoodsPoolAdapter
import com.zxhl.main.page.adapter.TopPagerAdapter import com.zxhl.main.page.adapter.TopPagerAdapter
import com.zxhl.main.page.contract.GoodsDetailContract import com.zxhl.main.page.contract.GoodsDetailContract
...@@ -38,7 +38,6 @@ import com.zxhl.novel.utils.server.PayResultEntity ...@@ -38,7 +38,6 @@ import com.zxhl.novel.utils.server.PayResultEntity
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.activity_layout_goods_detail.*
import kotlinx.android.synthetic.main.activity_layout_new_box_goods_detail.* import kotlinx.android.synthetic.main.activity_layout_new_box_goods_detail.*
import kotlinx.android.synthetic.main.layout_detail_content2.* import kotlinx.android.synthetic.main.layout_detail_content2.*
import kotlinx.android.synthetic.main.layout_detail_top2.* import kotlinx.android.synthetic.main.layout_detail_top2.*
...@@ -85,16 +84,21 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -85,16 +84,21 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
boxid = intent?.data?.getQueryParameter("boxid") ?: "" boxid = intent?.data?.getQueryParameter("boxid") ?: ""
wechatutil = WeChatUtils(this, this) wechatutil = WeChatUtils(this, this)
wechatutil?.isWechatLogin(null)
//返回 //返回
id_detail_img_back?.setOnClickListener { id_detail_img_back?.setOnClickListener {
this.finish() this.finish()
} }
//规则 //规则
id_detail_rule?.setOnClickListener { id_detail_rule?.setOnClickListener {
JumpUtils.webJump("Rule",NetConfig.H5.WEB_URL_RULE)
} }
//试玩 //试玩
id_detail_shiwan_rl?.setOnClickListener { id_detail_shiwan_rl?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.TEST_LOTTERY, "") // JumpUtils.lotteryBoxJump(boxid, Constant.Key.TEST_LOTTERY, "")
BoxResultDialog.showTestLotteryResult( BoxResultDialog.showTestLotteryResult(
this, this,
...@@ -106,6 +110,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -106,6 +110,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
} }
//五连抽 //五连抽
id_btn_five_lottery?.setOnClickListener { id_btn_five_lottery?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
EventUtils.onEvent("five_lottery", "5连抽") EventUtils.onEvent("five_lottery", "5连抽")
EventUtils.onEvent("five_lottery_boxid", "" + boxid) EventUtils.onEvent("five_lottery_boxid", "" + boxid)
// price = id_tv_five_price?.text.toString() // price = id_tv_five_price?.text.toString()
...@@ -119,48 +127,18 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -119,48 +127,18 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
oneSellCoin, oneSellCoin,
fiveSellCoin fiveSellCoin
) )
// if (wechatutil!!.isWechatLogin() == true) {
//// JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
// BoxResultDialog.showFiveLotteryResult(
// this,
// boxid ?: "",
// oneSellCoin,
// fiveSellCoin
// )
// } else {
// JumpUtils.ThirdPardLoginJump()
// // wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
// }
} else { } else {
needPrice = fiveSellCoin.toString() needPrice = fiveSellCoin.toString()
if (ownCoin != null) { JumpUtils.payJump(boxid, needPrice, Constant.Key.FIVE_LOTTERY)
val chajia = needPrice?.toDoubleOrNull()?.minus(ownCoin!!)
if (TextUtils.equals("flow_tag_xymh_z", SettingPreference.getFlowTag())) {
mLoading?.setLoading("loading")
mLoading?.show()
if (pay_type == 1) {
mPayPresenter?.requestAliPay(
this,
chajia.toString(),
pay_type.toString(),
"6"
)
} else {
mPayPresenter?.requestMiniProgrom(
chajia.toString(),
pay_type.toString(),
"6"
)
}
} else {
JumpUtils.payJump(boxid, chajia.toString(), Constant.Key.FIVE_LOTTERY)
}
}
} }
} }
//单抽 //单抽
id_btn_one_lottery?.setOnClickListener { id_btn_one_lottery?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
EventUtils.onEvent("one_lottery", "单抽") EventUtils.onEvent("one_lottery", "单抽")
EventUtils.onEvent("one_lottery_boxid", "" + boxid) EventUtils.onEvent("one_lottery_boxid", "" + boxid)
clickType = Constant.Key.ONE_LOTTERY clickType = Constant.Key.ONE_LOTTERY
...@@ -173,46 +151,9 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -173,46 +151,9 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
oneSellCoin, oneSellCoin,
fiveSellCoin, rePumpingCardNum fiveSellCoin, rePumpingCardNum
) )
// if (wechatutil!!.isWechatLogin() == true) {
//// JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price)
// BoxResultDialog.showOneLotteryResult(
// this,
// boxid ?: "",
// oneSellCoin,
// fiveSellCoin, rePumpingCardNum
// )
// } else {
// Log.e("MXL", "未登录")
//// onWxLogin()
// JumpUtils.ThirdPardLoginJump()
// // wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
// }
} else { } else {
needPrice = oneSellCoin.toString() needPrice = oneSellCoin.toString()
if (ownCoin != null) { JumpUtils.payJump(boxid, needPrice, Constant.Key.ONE_LOTTERY)
val chajia = needPrice?.toDoubleOrNull()?.minus(ownCoin!!)
if (TextUtils.equals("flow_tag_xymh_z", SettingPreference.getFlowTag())) {
mLoading?.setLoading("loading")
mLoading?.show()
if (pay_type == 1) {
mPayPresenter?.requestAliPay(
this,
chajia.toString(),
pay_type.toString(),
"6"
)
} else {
mPayPresenter?.requestMiniProgrom(
chajia.toString(),
pay_type.toString(),
"6"
)
}
} else {
JumpUtils.payJump(boxid, chajia.toString(), Constant.Key.ONE_LOTTERY)
}
}
} }
} }
//拥有的币数量 //拥有的币数量
...@@ -267,6 +208,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -267,6 +208,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
override fun onDismiss() { override fun onDismiss() {
mPresenter?.getPropsCardList(boxid) mPresenter?.getPropsCardList(boxid)
} }
override fun onLotterySuccess() {
mPresenter?.getBoxInfo(boxid)
}
}) })
floatAnim(id_detail_tv_xuan_fu, 2000) floatAnim(id_detail_tv_xuan_fu, 2000)
...@@ -305,8 +250,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -305,8 +250,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
fiveSellCoin = reslut?.fivePrice ?: 0.0 fiveSellCoin = reslut?.fivePrice ?: 0.0
oneSellCoin = reslut?.onePrice ?: 0.0 oneSellCoin = reslut?.onePrice ?: 0.0
Log.e("MXL", "拥有的钱" + ownCoin + "5连价格" + fiveSellCoin + "单次价格" + oneSellCoin) Log.e("MXL", "拥有的钱" + ownCoin + "5连价格" + fiveSellCoin + "单次价格" + oneSellCoin)
id_tv_one_lottery_price?.text = "${reslut.onePriceStr}"
id_tv_five_lottery_price?.text = "${reslut.fivePrice}"
id_tv_five_lottery_price2?.text = "${reslut.onePrice?.times(5)}"
id_tv_five_lottery_price2.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG) //中划线
if (reslut?.goodsList != null) { if (reslut?.goodsList != null) {
mPagerAdapter = TopPagerAdapter(reslut?.goodsList!!) mPagerAdapter = TopPagerAdapter(reslut?.goodsList!!)
id_detail_top_viewpager.adapter = mPagerAdapter id_detail_top_viewpager.adapter = mPagerAdapter
...@@ -319,6 +266,7 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -319,6 +266,7 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
} else { } else {
id_detail_tv_xuan_fu.visibility = View.GONE id_detail_tv_xuan_fu.visibility = View.GONE
} }
BoxResultDialog.setDialogPrice(oneSellCoin,fiveSellCoin)
} }
@SuppressLint("WrongConstant") @SuppressLint("WrongConstant")
......
...@@ -73,6 +73,8 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -73,6 +73,8 @@ class SplashActivity : BaseActivity(), SplashContract.View {
} }
} }
private var LoginNum:Int = 0;
override fun jumpMainPage() { override fun jumpMainPage() {
val user = SettingPreference.getUserInfoData() val user = SettingPreference.getUserInfoData()
val token = SettingPreference.getUserToken() val token = SettingPreference.getUserToken()
...@@ -88,8 +90,6 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -88,8 +90,6 @@ class SplashActivity : BaseActivity(), SplashContract.View {
RounterBus.getRounter(RounterApi::class.java).getIntentActivityMain() RounterBus.getRounter(RounterApi::class.java).getIntentActivityMain()
) )
} }
finish() finish()
} }
......
...@@ -3,17 +3,19 @@ package com.zxhl.main.page.activity ...@@ -3,17 +3,19 @@ package com.zxhl.main.page.activity
import android.view.View import android.view.View
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.base.BaseActivity import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.NoDoubleClickListener import com.zxhl.cms.utils.NoDoubleClickListener
import com.zxhl.cms.utils.WeChatLoginSuccessCallBall import com.zxhl.cms.utils.WeChatLoginSuccessCallBall
import com.zxhl.cms.utils.WeChatUtils import com.zxhl.cms.utils.WeChatUtils
import com.zxhl.main.R import com.zxhl.main.R
import kotlinx.android.synthetic.main.activity_layout_third_party_login.* import kotlinx.android.synthetic.main.activity_layout_third_party_login.*
class ThirdpartyLoginActivity:BaseActivity(), WeChatLoginSuccessCallBall { class ThirdpartyLoginActivity : BaseActivity(), WeChatLoginSuccessCallBall {
private var wechatutil: WeChatUtils? = null private var wechatutil: WeChatUtils? = null
override fun onClick(v: View?) { override fun onClick(v: View?) {
} }
override fun before() { override fun before() {
super.before() super.before()
setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent)) setStatusBarBackground(AppContext.get().resources.getColor(R.color.transparent))
...@@ -25,16 +27,16 @@ class ThirdpartyLoginActivity:BaseActivity(), WeChatLoginSuccessCallBall { ...@@ -25,16 +27,16 @@ class ThirdpartyLoginActivity:BaseActivity(), WeChatLoginSuccessCallBall {
override fun init() { override fun init() {
wechatutil = WeChatUtils(this, this) wechatutil = WeChatUtils(this, this)
id_ll_google_login?.setOnClickListener(object :NoDoubleClickListener(){ id_ll_google_login?.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) { override fun onNoDoubleClick(v: View?) {
EventUtils.onEvent("googleLoginClick")
//WeChatUtils. //WeChatUtils.
wechatutil?.GoogleLogin() wechatutil?.GoogleLogin()
} }
}) })
id_ll_facebook_login?.setOnClickListener(object :NoDoubleClickListener(){ id_ll_facebook_login?.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) { override fun onNoDoubleClick(v: View?) {
EventUtils.onEvent("facebookLoginClick")
wechatutil?.FackBooklogin() wechatutil?.FackBooklogin()
} }
......
...@@ -39,7 +39,7 @@ class TopPagerAdapter : PagerAdapter { ...@@ -39,7 +39,7 @@ class TopPagerAdapter : PagerAdapter {
val view = LayoutInflater.from(AppContext.get()).inflate(R.layout.item_goods_top, null) val view = LayoutInflater.from(AppContext.get()).inflate(R.layout.item_goods_top, null)
val bg = view.findViewById<ImageView>(R.id.id_img_main) val bg = view.findViewById<ImageView>(R.id.id_img_main)
// val lottie = view.findViewById<LottieAnimationView>(R.id.id_lottie_daoguang) // val lottie = view.findViewById<LottieAnimationView>(R.id.id_lottie_daoguang)
Glide.with(AppContext.get()).load(data?.mainImage).into(bg) Glide.with(AppContext.get()).load(data?.mainImage).placeholder(R.drawable.shape_gray).into(bg)
container.addView(view)// 添加页卡 container.addView(view)// 添加页卡
return view return view
} }
......
...@@ -70,7 +70,16 @@ class AllFragment : BaseFragment, HomeContract.View, ...@@ -70,7 +70,16 @@ class AllFragment : BaseFragment, HomeContract.View,
} }
//mPresenter?.getHomeBoxList("") //mPresenter?.getHomeBoxList("")
mPresenter?.getHomeBoxList(title, false) mPresenter?.getHomeBoxList(title, false)
BoxResultDialog.setDialogDismissCallback(object : BoxResultDialog.DialogDismissCallback {
override fun onDismiss() {
}
override fun onLotterySuccess() {
mPresenter?.clearPage()
mPresenter?.getHomeBoxList(title, true)
}
})
} }
override fun lazyLoad() { override fun lazyLoad() {
...@@ -147,7 +156,7 @@ class AllFragment : BaseFragment, HomeContract.View, ...@@ -147,7 +156,7 @@ class AllFragment : BaseFragment, HomeContract.View,
mActivity, mActivity,
data?.boxId ?: "", data?.boxId ?: "",
data?.onePrice!!, data?.onePrice!!,
data?.fivePrice!!, 0 data.fivePrice, 0
) )
}else{ }else{
val chajia = data?.onePrice?.minus(ownCoin!!) val chajia = data?.onePrice?.minus(ownCoin!!)
......
...@@ -91,7 +91,7 @@ class RecycledFragment : BaseFragment(), WareHouseContract.View, ...@@ -91,7 +91,7 @@ class RecycledFragment : BaseFragment(), WareHouseContract.View,
recoverprice = recovertList.sum() recoverprice = recovertList.sum()
} }
RecycleDialog.showRecycleDialog(mActivity,sb.toString(),"3", recoverprice.toString(), recoveType,this) RecycleDialog.showRecycleDialog(mActivity,sb.toString(),"3", recoverprice.toString(), recoveType,this, null)
// RecoverPopupWindow().init( // RecoverPopupWindow().init(
// mActivity, // mActivity,
// sb.toString(), // sb.toString(),
......
...@@ -123,7 +123,8 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View, ...@@ -123,7 +123,8 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View,
"3", "3",
recoverprice.toString(), recoverprice.toString(),
recoveType, recoveType,
this this,
null
) )
// RecoverPopupWindow().init( // RecoverPopupWindow().init(
// mActivity, // mActivity,
......
...@@ -3,21 +3,17 @@ package com.zxhl.main.page.presenter ...@@ -3,21 +3,17 @@ package com.zxhl.main.page.presenter
import android.app.Activity import android.app.Activity
import android.os.Build import android.os.Build
import android.text.TextUtils import android.text.TextUtils
import android.view.View
import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdNative import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.bytedance.sdk.openadsdk.TTSplashAd
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.ad.upload.Utils.AdUpload
import com.zxhl.cms.ad.upload.model.NewsEntity
import com.zxhl.cms.common.Constant import com.zxhl.cms.common.Constant
import com.zxhl.cms.net.ApiClient import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.callback.BaseObserver import com.zxhl.cms.net.callback.BaseObserver
import com.zxhl.cms.net.model.box.AppInEntity
import com.zxhl.cms.net.model.uc.UserInfo import com.zxhl.cms.net.model.uc.UserInfo
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.UserDataUtils
import com.zxhl.cms.utils.Utils
import com.zxhl.main.page.contract.SplashContract import com.zxhl.main.page.contract.SplashContract
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe import io.reactivex.ObservableOnSubscribe
...@@ -33,7 +29,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -33,7 +29,7 @@ class SplashPresenter : SplashContract.Presenter {
private val mView: SplashContract.View private val mView: SplashContract.View
private val mActivity:Activity private val mActivity: Activity
constructor(mView: SplashContract.View, mActivity: Activity) { constructor(mView: SplashContract.View, mActivity: Activity) {
this.mView = mView this.mView = mView
...@@ -45,7 +41,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -45,7 +41,7 @@ class SplashPresenter : SplashContract.Presenter {
companion object { companion object {
val PERMISSIONS = arrayOf( val PERMISSIONS = arrayOf(
// Constant.Permission.PERMISSION_READ_STORAGE, // Constant.Permission.PERMISSION_READ_STORAGE,
Constant.Permission.PERMISSION_PHONE Constant.Permission.PERMISSION_PHONE
// Constant.Permission.PERMISSION_COARSE_LOCATION, // Constant.Permission.PERMISSION_COARSE_LOCATION,
// Constant.Permission.PERMISSION_FINE_LOCATION // Constant.Permission.PERMISSION_FINE_LOCATION
// , Constant.Permission.PERMISSION_CAMERA // , Constant.Permission.PERMISSION_CAMERA
...@@ -92,12 +88,12 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -92,12 +88,12 @@ class SplashPresenter : SplashContract.Presenter {
override fun checkLogin() { override fun checkLogin() {
val user = SettingPreference.getUserInfoData() val user = SettingPreference.getUserInfoData()
val token =SettingPreference.getUserToken() val token = SettingPreference.getUserToken()
if (user == null&&TextUtils.isEmpty(token)) { if (user == null && TextUtils.isEmpty(token)) {
if(TextUtils.equals( Utils.getChannel(AppContext.get()), "toutiao_h5")){ if (TextUtils.equals(Utils.getChannel(AppContext.get()), "toutiao_h5")) {
// deviceLogin() // deviceLogin()
getAds() getAds()
}else{ } else {
deviceLogin() deviceLogin()
} }
...@@ -129,16 +125,13 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -129,16 +125,13 @@ class SplashPresenter : SplashContract.Presenter {
} }
private fun getAds() { private fun getAds() {
ApiClient.adApi.getAds("splash") ApiClient.homeApi.getAppInfo()
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<NewsEntity>>() { .subscribe(object : BaseObserver<AppInEntity>() {
override fun onSuccess(result: List<NewsEntity>) { override fun onSuccess(result: AppInEntity?) {
if (result != null && result?.size > 0) { if (result != null) {
val data = result[0] Constant.Switch.isOpenShop = result.shop_open == 1
if (TextUtils.equals(data.adPlatform, "chuanshanjia")) { Constant.Switch.recoverType = result.recover_type
loadToutiao(data, 0, "splash")
}
} else {
mView.jumpMainPage() mView.jumpMainPage()
} }
} }
...@@ -147,53 +140,72 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -147,53 +140,72 @@ class SplashPresenter : SplashContract.Presenter {
mView.jumpMainPage() mView.jumpMainPage()
} }
}) })
// ApiClient.adApi.getAds("splash")
// .compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<List<NewsEntity>>() {
// override fun onSuccess(result: List<NewsEntity>) {
// if (result != null && result?.size > 0) {
// val data = result[0]
// if (TextUtils.equals(data.adPlatform, "chuanshanjia")) {
// loadToutiao(data, 0, "splash")
// }
// } else {
// mView.jumpMainPage()
// }
// }
//
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// mView.jumpMainPage()
// }
// })
} }
private var mTTAdNative: TTAdNative? = null
private fun loadToutiao(data: NewsEntity, count: Int, slotNameL: String) { private var mTTAdNative: TTAdNative? = null
mTTAdNative = TTAdSdk.getAdManager().createAdNative(mActivity)//baseContext建议为activity
val adSlot = AdSlot.Builder()
.setCodeId(data?.codeId)
.setSupportDeepLink(true)
.setImageAcceptedSize(
PhoneUtils.getScreenWidth(AppContext.get()),
PhoneUtils.getScreenHeight(AppContext.get())
)
.build()
mTTAdNative?.loadSplashAd(adSlot, object : TTAdNative.SplashAdListener {
override fun onError(i: Int, s: String) {
mView.jumpMainPage()
}
override fun onTimeout() {
mView.jumpMainPage()
}
override fun onSplashAdLoad(ad: TTSplashAd) {
val view = ad.splashView
mView?.setToutiaoView(view)
ad.setSplashInteractionListener(object : TTSplashAd.AdInteractionListener {
override fun onAdClicked(view: View, i: Int) {
EventUtils.onEvent("splash_click")
AdUpload.onAdClick(data)
}
override fun onAdShow(view: View, i: Int) {
EventUtils.onEvent("splash_show")
AdUpload.onAdImpression(data)
}
override fun onAdSkip() {
mView.jumpMainPage()
}
override fun onAdTimeOver() { // private fun loadToutiao(data: NewsEntity, count: Int, slotNameL: String) {
mView.jumpMainPage() // mTTAdNative = TTAdSdk.getAdManager().createAdNative(mActivity)//baseContext建议为activity
} // val adSlot = AdSlot.Builder()
}) // .setCodeId(data?.codeId)
} // .setSupportDeepLink(true)
}, 5000) // .setImageAcceptedSize(
} // PhoneUtils.getScreenWidth(AppContext.get()),
// PhoneUtils.getScreenHeight(AppContext.get())
// )
// .build()
// mTTAdNative?.loadSplashAd(adSlot, object : TTAdNative.SplashAdListener {
// override fun onError(i: Int, s: String) {
// mView.jumpMainPage()
// }
//
// override fun onTimeout() {
// mView.jumpMainPage()
// }
//
// override fun onSplashAdLoad(ad: TTSplashAd) {
// val view = ad.splashView
// mView?.setToutiaoView(view)
// ad.setSplashInteractionListener(object : TTSplashAd.AdInteractionListener {
// override fun onAdClicked(view: View, i: Int) {
// EventUtils.onEvent("splash_click")
// AdUpload.onAdClick(data)
// }
//
// override fun onAdShow(view: View, i: Int) {
// EventUtils.onEvent("splash_show")
// AdUpload.onAdImpression(data)
// }
//
// override fun onAdSkip() {
// mView.jumpMainPage()
// }
//
// override fun onAdTimeOver() {
// mView.jumpMainPage()
// }
// })
// }
// }, 5000)
// }
} }
\ No newline at end of file
...@@ -19,11 +19,10 @@ import com.zxhl.cms.net.model.box.* ...@@ -19,11 +19,10 @@ import com.zxhl.cms.net.model.box.*
import com.zxhl.cms.utils.EventUtils import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.JumpUtils import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.UserDataUtils import com.zxhl.cms.utils.UserDataUtils
import com.zxhl.cms.widget.LoadingDialog
import com.zxhl.main.R import com.zxhl.main.R
import com.zxhl.main.page.`interface`.PopupWidowCloseCallBack
import com.zxhl.main.page.contract.LotteryContract import com.zxhl.main.page.contract.LotteryContract
import com.zxhl.main.page.presenter.LotteryPresenter import com.zxhl.main.page.presenter.LotteryPresenter
import kotlinx.android.synthetic.main.activity_layout_lottery_reslut.*
/** /**
* @author (wangXuewei) * @author (wangXuewei)
...@@ -42,8 +41,14 @@ object BoxResultDialog : LotteryContract.View { ...@@ -42,8 +41,14 @@ object BoxResultDialog : LotteryContract.View {
this.dialogDismissCallback = callback this.dialogDismissCallback = callback
} }
fun setDialogPrice(onePrice: Double, fivePrice: Double) {
this.onePrice = onePrice
this.fivePrice = fivePrice
}
interface DialogDismissCallback { interface DialogDismissCallback {
fun onDismiss() fun onDismiss()
fun onLotterySuccess()
} }
fun showFiveLotteryResult( fun showFiveLotteryResult(
...@@ -59,6 +64,7 @@ object BoxResultDialog : LotteryContract.View { ...@@ -59,6 +64,7 @@ object BoxResultDialog : LotteryContract.View {
if (boxId == "" || fivePrice == 0.0) { if (boxId == "" || fivePrice == 0.0) {
return return
} }
EventUtils.onEvent("FiveLotteryClick")
mRePumpingCardNum = cardNum mRePumpingCardNum = cardNum
var ownCoin = SettingPreference.getUserCoinNum().toDouble() var ownCoin = SettingPreference.getUserCoinNum().toDouble()
if (ownCoin < fivePrice) { if (ownCoin < fivePrice) {
...@@ -86,6 +92,7 @@ object BoxResultDialog : LotteryContract.View { ...@@ -86,6 +92,7 @@ object BoxResultDialog : LotteryContract.View {
if (boxId == "" || onePrice == 0.0) { if (boxId == "" || onePrice == 0.0) {
return return
} }
EventUtils.onEvent("OneLotteryClick")
mRePumpingCardNum = cardNum mRePumpingCardNum = cardNum
var ownCoin = SettingPreference.getUserCoinNum().toDouble() var ownCoin = SettingPreference.getUserCoinNum().toDouble()
//钱数不够 去充值 //钱数不够 去充值
...@@ -146,11 +153,19 @@ object BoxResultDialog : LotteryContract.View { ...@@ -146,11 +153,19 @@ object BoxResultDialog : LotteryContract.View {
var btnClose = mDialogView.findViewById<ImageView>(R.id.id_result_close) var btnClose = mDialogView.findViewById<ImageView>(R.id.id_result_close)
var oneGoodsImg = mDialogView.findViewById<ImageView>(R.id.id_result_one_goods) var oneGoodsImg = mDialogView.findViewById<ImageView>(R.id.id_result_one_goods)
var oneGoodsName = mDialogView.findViewById<TextView>(R.id.id_result_test_goods_name) var oneGoodsName = mDialogView.findViewById<TextView>(R.id.id_result_test_goods_name)
var goodsImg1 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_1)
var goodsImg2 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_2) var fiveGoodsName1 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_1)
var goodsImg3 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_3) var fiveGoodsName2 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_2)
var goodsImg4 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_4) var fiveGoodsName3 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_3)
var goodsImg5 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_5) var fiveGoodsName4 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_4)
var fiveGoodsName5 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_5)
var fiveGoodsImg1 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_1)
var fiveGoodsImg2 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_2)
var fiveGoodsImg3 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_3)
var fiveGoodsImg4 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_4)
var fiveGoodsImg5 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_5)
var fiveGoodsLine1 = mDialogView.findViewById<LinearLayout>(R.id.id_result_five_goods_line1) var fiveGoodsLine1 = mDialogView.findViewById<LinearLayout>(R.id.id_result_five_goods_line1)
var fiveGoodsLine2 = mDialogView.findViewById<LinearLayout>(R.id.id_result_five_goods_line2) var fiveGoodsLine2 = mDialogView.findViewById<LinearLayout>(R.id.id_result_five_goods_line2)
var resultDesc1 = mDialogView.findViewById<TextView>(R.id.id_result_desc) var resultDesc1 = mDialogView.findViewById<TextView>(R.id.id_result_desc)
...@@ -160,18 +175,22 @@ object BoxResultDialog : LotteryContract.View { ...@@ -160,18 +175,22 @@ object BoxResultDialog : LotteryContract.View {
var btnOk = mDialogView.findViewById<TextView>(R.id.id_result_ok) var btnOk = mDialogView.findViewById<TextView>(R.id.id_result_ok)
var btnOneAgain = mDialogView.findViewById<TextView>(R.id.id_result_one_again) var btnOneAgain = mDialogView.findViewById<TextView>(R.id.id_result_one_again)
var btnFiveAgain = mDialogView.findViewById<TextView>(R.id.id_result_five_again) var btnFiveAgain = mDialogView.findViewById<TextView>(R.id.id_result_five_again)
var resultRecover = mDialogView.findViewById<TextView>(R.id.id_result_recover)
if (mRePumpingCardNum > 0 && type != Constant.Key.TEST_LOTTERY) { if (mRePumpingCardNum > 0 && type != Constant.Key.TEST_LOTTERY) {
resultDescRePumping.visibility = View.VISIBLE resultDescRePumping.visibility = View.VISIBLE
} else { } else {
resultDescRePumping.visibility = View.GONE resultDescRePumping.visibility = View.GONE
} }
var recovertList: MutableList<Double> = ArrayList()
var depotIds = StringBuilder() var depotIds = StringBuilder()
for (dataBean in lotteryList) { for (dataBean in lotteryList) {
if (depotIds.length > 2) { if (depotIds.length > 2) {
depotIds.append(",") depotIds.append(",")
} }
depotIds.append(dataBean.depotId) depotIds.append(dataBean.depotId)
recovertList.add(dataBean.recoverPriceStr?.toDoubleOrNull()!!)
} }
var recoverprice = recovertList.sum()
// //
if (desc1 == "") { if (desc1 == "") {
resultDesc1.visibility = View.GONE resultDesc1.visibility = View.GONE
...@@ -196,6 +215,7 @@ object BoxResultDialog : LotteryContract.View { ...@@ -196,6 +215,7 @@ object BoxResultDialog : LotteryContract.View {
when (type) { when (type) {
Constant.Key.TEST_LOTTERY -> { Constant.Key.TEST_LOTTERY -> {
//试用 //试用
resultRecover.visibility = View.GONE
oneGoodsImg.visibility = View.VISIBLE oneGoodsImg.visibility = View.VISIBLE
oneGoodsName.visibility = View.VISIBLE oneGoodsName.visibility = View.VISIBLE
Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg) Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg)
...@@ -207,8 +227,11 @@ object BoxResultDialog : LotteryContract.View { ...@@ -207,8 +227,11 @@ object BoxResultDialog : LotteryContract.View {
} }
Constant.Key.ONE_LOTTERY -> { Constant.Key.ONE_LOTTERY -> {
//单抽 //单抽
resultRecover.visibility = View.VISIBLE
oneGoodsImg.visibility = View.VISIBLE oneGoodsImg.visibility = View.VISIBLE
oneGoodsName.visibility = View.VISIBLE
Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg) Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg)
oneGoodsName.text = lotteryList[0].productName
btnOneAgain.visibility = View.VISIBLE btnOneAgain.visibility = View.VISIBLE
btnFiveAgain.visibility = View.VISIBLE btnFiveAgain.visibility = View.VISIBLE
btnOneAgain.text = btnOneAgain.text =
...@@ -217,14 +240,21 @@ object BoxResultDialog : LotteryContract.View { ...@@ -217,14 +240,21 @@ object BoxResultDialog : LotteryContract.View {
} }
Constant.Key.FIVE_LOTTERY -> { Constant.Key.FIVE_LOTTERY -> {
//五抽 //五抽
resultRecover.visibility = View.VISIBLE
fiveGoodsLine1.visibility = View.VISIBLE fiveGoodsLine1.visibility = View.VISIBLE
fiveGoodsLine2.visibility = View.VISIBLE fiveGoodsLine2.visibility = View.VISIBLE
if (lotteryList.size >= 5) { if (lotteryList.size >= 5) {
Glide.with(mActivity).load(lotteryList[0].mainImage).into(goodsImg1) Glide.with(mActivity).load(lotteryList[0].mainImage).into(fiveGoodsImg1)
Glide.with(mActivity).load(lotteryList[1].mainImage).into(goodsImg2) Glide.with(mActivity).load(lotteryList[1].mainImage).into(fiveGoodsImg2)
Glide.with(mActivity).load(lotteryList[2].mainImage).into(goodsImg3) Glide.with(mActivity).load(lotteryList[2].mainImage).into(fiveGoodsImg3)
Glide.with(mActivity).load(lotteryList[3].mainImage).into(goodsImg4) Glide.with(mActivity).load(lotteryList[3].mainImage).into(fiveGoodsImg4)
Glide.with(mActivity).load(lotteryList[4].mainImage).into(goodsImg5) Glide.with(mActivity).load(lotteryList[4].mainImage).into(fiveGoodsImg5)
fiveGoodsName1.text = lotteryList[0].productName
fiveGoodsName2.text = lotteryList[1].productName
fiveGoodsName3.text = lotteryList[2].productName
fiveGoodsName4.text = lotteryList[3].productName
fiveGoodsName5.text = lotteryList[4].productName
} }
btnOneAgain.visibility = View.VISIBLE btnOneAgain.visibility = View.VISIBLE
btnFiveAgain.visibility = View.VISIBLE btnFiveAgain.visibility = View.VISIBLE
...@@ -242,6 +272,7 @@ object BoxResultDialog : LotteryContract.View { ...@@ -242,6 +272,7 @@ object BoxResultDialog : LotteryContract.View {
//重抽 //重抽
resultDescRePumping.setOnClickListener { resultDescRePumping.setOnClickListener {
EventUtils.onEvent("RePumpingClick")
if (type == Constant.Key.ONE_LOTTERY) { if (type == Constant.Key.ONE_LOTTERY) {
mRePumpingCardNum-- mRePumpingCardNum--
mPresenter.rePumpingOneLottery(boxId, depotIds.toString()) mPresenter.rePumpingOneLottery(boxId, depotIds.toString())
...@@ -258,6 +289,15 @@ object BoxResultDialog : LotteryContract.View { ...@@ -258,6 +289,15 @@ object BoxResultDialog : LotteryContract.View {
btnFiveAgain.setOnClickListener { btnFiveAgain.setOnClickListener {
showFiveLotteryResult(mActivity, boxId, onePrice, fivePrice, mRePumpingCardNum) showFiveLotteryResult(mActivity, boxId, onePrice, fivePrice, mRePumpingCardNum)
} }
//回收
resultRecover.setOnClickListener {
EventUtils.onEvent("RecoverClick")
RecycleDialog.showRecycleDialog(mActivity,depotIds.toString(),"3",recoverprice.toString(), Constant.Switch.recoverType,null,object :PopupWidowCloseCallBack{
override fun onClosePopupWindow() {
mDialog?.dismiss()
}
})
}
mDialog?.setOnDismissListener { mDialog?.setOnDismissListener {
mDialog = null mDialog = null
this.mActivity = null this.mActivity = null
...@@ -267,11 +307,14 @@ object BoxResultDialog : LotteryContract.View { ...@@ -267,11 +307,14 @@ object BoxResultDialog : LotteryContract.View {
} }
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
EventUtils.onEvent("LotterySuccess", "lotteryType:$type")
dialogDismissCallback?.onLotterySuccess()
if (!mActivity.isFinishing) { if (!mActivity.isFinishing) {
mDialog?.show() mDialog?.show()
return return
} }
} }
override fun setOneLotterResult(result: OneLotteryEntity?) { override fun setOneLotterResult(result: OneLotteryEntity?) {
......
...@@ -7,6 +7,7 @@ import android.view.Gravity ...@@ -7,6 +7,7 @@ import android.view.Gravity
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.bytedance.pangle.transform.ZeusTransformUtils.getResources
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant import com.zxhl.cms.common.Constant
import com.zxhl.cms.utils.NoDoubleClickListener import com.zxhl.cms.utils.NoDoubleClickListener
...@@ -28,10 +29,18 @@ object RecycleDialog : RecoverPopupContract.View { ...@@ -28,10 +29,18 @@ object RecycleDialog : RecoverPopupContract.View {
private var recoverPrice: String = "" private var recoverPrice: String = ""
private var recovetype: String = "" private var recovetype: String = ""
private var listener: PopupWidowCloseCallBack? = null private var listener: PopupWidowCloseCallBack? = null
private var listener2: PopupWidowCloseCallBack? = null
private var mPresenter: RecoverPopupPresenter? = null private var mPresenter: RecoverPopupPresenter? = null
//listener2 为了和使用listener的区分开 逻辑不一样
fun showRecycleDialog( fun showRecycleDialog(
context: Activity?, ids: String, type: String?, context: Activity?,
recoverprice: String, recove_type: String, listener: PopupWidowCloseCallBack ids: String,
type: String?,
recoverprice: String,
recove_type: String,
listener: PopupWidowCloseCallBack?,
listener2: PopupWidowCloseCallBack?
) { ) {
if (context == null) { if (context == null) {
return return
...@@ -41,7 +50,8 @@ object RecycleDialog : RecoverPopupContract.View { ...@@ -41,7 +50,8 @@ object RecycleDialog : RecoverPopupContract.View {
this.type = type this.type = type
this.recoverPrice = recoverprice this.recoverPrice = recoverprice
this.recovetype = recove_type this.recovetype = recove_type
this.listener=listener this.listener = listener
this.listener2 = listener2
mPresenter = RecoverPopupPresenter(this) mPresenter = RecoverPopupPresenter(this)
mDialog = Dialog(context, R.style.CenterCompatDialogTheme) mDialog = Dialog(context, R.style.CenterCompatDialogTheme)
val mDialogView = val mDialogView =
...@@ -52,7 +62,30 @@ object RecycleDialog : RecoverPopupContract.View { ...@@ -52,7 +62,30 @@ object RecycleDialog : RecoverPopupContract.View {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
tv_recycle_price = mDialogView?.findViewById<TextView>(R.id.id_tv_recycle_price) tv_recycle_price = mDialogView?.findViewById<TextView>(R.id.id_tv_recycle_price)
var id_recycle_desc = mDialogView?.findViewById<TextView>(R.id.id_recycle_desc)
if (recove_type == "1") {
var icon = AppContext.get().resources.getDrawable(R.drawable.icon_mobi, null)
tv_recycle_price?.setCompoundDrawablesRelativeWithIntrinsicBounds(
icon,
null,
null,
null
)
id_recycle_desc.visibility = View.VISIBLE
} else {
var icon = AppContext.get().resources.getDrawable(R.drawable.icon_jinbi, null)
tv_recycle_price?.setCompoundDrawablesRelativeWithIntrinsicBounds(
icon,
null,
null,
null
)
id_recycle_desc.visibility = View.GONE
}
mDialogView?.findViewById<ImageView>(R.id.id_img_dialog_close).setOnClickListener { mDialogView?.findViewById<ImageView>(R.id.id_img_dialog_close).setOnClickListener {
mDialog?.dismiss() mDialog?.dismiss()
} }
...@@ -61,9 +94,11 @@ object RecycleDialog : RecoverPopupContract.View { ...@@ -61,9 +94,11 @@ object RecycleDialog : RecoverPopupContract.View {
if (type.equals(Constant.Key.ONE_LOTTERY)) { if (type.equals(Constant.Key.ONE_LOTTERY)) {
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}" tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
} else if (type.equals(Constant.Key.FIVE_LOTTERY)) { } else if (type.equals(Constant.Key.FIVE_LOTTERY)) {
tv_recycle_price?.text = "${recoverPrice.toDoubleOrNull()?.times( tv_recycle_price?.text = "${
5 recoverPrice.toDoubleOrNull()?.times(
)?.toString()}" 5
)?.toString()
}"
} else { } else {
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}" tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
} }
...@@ -86,10 +121,14 @@ object RecycleDialog : RecoverPopupContract.View { ...@@ -86,10 +121,14 @@ object RecycleDialog : RecoverPopupContract.View {
} }
override fun recoverSuccess() { override fun recoverSuccess() {
mDialog?.dismiss() mDialog?.dismiss()
if (type == Constant.Key.ONE_LOTTERY || type == Constant.Key.FIVE_LOTTERY|| type == Constant.Key.RE_PUMPING_ONE_LOTTERY || type == Constant.Key.RE_PUMPING_FIVE_LOTTERY) { if (type == Constant.Key.ONE_LOTTERY || type == Constant.Key.FIVE_LOTTERY || type == Constant.Key.RE_PUMPING_ONE_LOTTERY || type == Constant.Key.RE_PUMPING_FIVE_LOTTERY) {
Utils.showToast(context, context?.getString(R.string.recycle_suc)) Utils.showToast(context, context?.getString(R.string.recycle_suc))
context?.finish() if (listener2 != null) {
listener2?.onClosePopupWindow()
} else {
context?.finish()
}
} else { } else {
listener?.onClosePopupWindow() listener?.onClosePopupWindow()
} }
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#FFD666"
android:startColor="#FFAA00"
android:type="linear"
android:useLevel="true" />
<corners android:radius="25dp" />
<item android:name="android:shadowColor">#b33f75e8</item>
<item android:name="android:shadowDx">0</item>
<item android:name="android:shadowDy">1</item>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#ffeeeeee"
android:startColor="#ff666666"
android:type="linear"
android:useLevel="true" />
<item android:name="android:shadowColor">#b33f75e8</item>
<item android:name="android:shadowDx">0</item>
<item android:name="android:shadowDy">1</item>
</shape>
\ No newline at end of file
...@@ -58,40 +58,101 @@ ...@@ -58,40 +58,101 @@
<LinearLayout <LinearLayout
android:id="@+id/id_bottom_lottery_ll_view" android:id="@+id/id_bottom_lottery_ll_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="60dp" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@color/white" android:background="@color/white"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="20dp"> android:paddingRight="20dp">
<TextView <LinearLayout
android:id="@+id/id_btn_five_lottery" android:id="@+id/id_btn_five_lottery"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/shape_detail_button_bg_9592ff_r25" android:background="@drawable/shape_detail_button_bg_9592ff_r25"
android:gravity="center" android:gravity="center_horizontal"
android:text="@string/box_detail_open_box_five_lottery_btn" android:orientation="vertical"
android:textColor="@color/white" android:paddingTop="5dp"
android:textSize="18sp" android:paddingBottom="5dp">
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/box_detail_open_box_five_lottery_btn"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp">
<TextView
android:id="@+id/id_tv_five_lottery_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
android:drawableLeft="@drawable/icon_jinbi"
android:drawablePadding="5dp"
android:includeFontPadding="false"
android:text=""
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_five_lottery_price2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text=""
android:textColor="#C4C5FF"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<TextView </LinearLayout>
<LinearLayout
android:id="@+id/id_btn_one_lottery" android:id="@+id/id_btn_one_lottery"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:layout_weight="1" android:layout_weight="1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="@drawable/shape_detail_button_bg_83baff_r25" android:background="@drawable/shape_detail_button_bg_83baff_r25"
android:gravity="center" android:gravity="center"
android:text="@string/box_detail_open_box_one_lottery_btn" android:orientation="vertical">
android:textColor="@color/white"
android:textSize="18sp" <TextView
android:textStyle="bold" /> android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/box_detail_open_box_one_lottery_btn"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_tv_one_lottery_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:drawableLeft="@drawable/icon_jinbi"
android:drawablePadding="5dp"
android:includeFontPadding="false"
android:text=""
android:textColor="@color/white"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/id_detail_tv_xuan_fu" android:id="@+id/id_detail_tv_xuan_fu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -101,6 +162,8 @@ ...@@ -101,6 +162,8 @@
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:background="@drawable/bj_bizhong_blue" android:background="@drawable/bj_bizhong_blue"
android:gravity="center" android:gravity="center"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:text="" android:text=""
android:textColor="@color/white" android:textColor="@color/white"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Welcome to Magic Box" android:text="Welcome to Magic Box"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/id_recycle_desc"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:includeFontPadding="false" android:includeFontPadding="false"
android:drawableLeft="@drawable/icon_jinbi" android:drawableLeft="@drawable/icon_jinbi"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:text="10499" android:text=""
android:textColor="@color/color_4C84FF" android:textColor="@color/color_4C84FF"
android:textSize="22sp" android:textSize="22sp"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
android:layout_below="@id/id_img_shiwan2" android:layout_below="@id/id_img_shiwan2"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_marginTop="3dp" android:layout_marginTop="3dp"
android:text="@string/box_detail_open_box_num" android:text=""
android:textColor="@color/color_999999" android:textColor="@color/color_999999"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
......
...@@ -12,6 +12,7 @@ import com.bytedance.sdk.openadsdk.TTNativeExpressAd ...@@ -12,6 +12,7 @@ import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.zxhl.cms.AppContext import com.zxhl.cms.AppContext
import com.zxhl.cms.ad.upload.Utils.AdUpload import com.zxhl.cms.ad.upload.Utils.AdUpload
import com.zxhl.cms.ad.upload.model.NewsEntity import com.zxhl.cms.ad.upload.model.NewsEntity
import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.NetConfig import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.ApiClient import com.zxhl.cms.net.ApiClient
...@@ -42,11 +43,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -42,11 +43,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
id_rl_tuijian_box?.adapter = mAdapter id_rl_tuijian_box?.adapter = mAdapter
id_rl_address?.setOnClickListener { id_rl_address?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){ if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump() JumpUtils.ThirdPardLoginJump()
}else{ } else {
JumpUtils.ReceiveAddressReslutJump("0") JumpUtils.ReceiveAddressReslutJump("0")
} }
} }
...@@ -60,11 +61,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -60,11 +61,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
} }
id_ll_my_coin?.setOnClickListener { id_ll_my_coin?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){ if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump() JumpUtils.ThirdPardLoginJump()
}else{ } else {
JumpUtils.payJump("0", "0", "0") JumpUtils.payJump("0", "0", "0")
} }
} }
...@@ -80,11 +81,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -80,11 +81,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
JumpUtils.LogisticsJump() JumpUtils.LogisticsJump()
} }
id_rl_jiyijan?.setOnClickListener { id_rl_jiyijan?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){ if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump() JumpUtils.ThirdPardLoginJump()
}else{ } else {
JumpUtils.webJump( JumpUtils.webJump(
mActivity.getString(R.string.customer_service), mActivity.getString(R.string.customer_service),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
...@@ -123,14 +124,19 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -123,14 +124,19 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
// id_fragment_user_user?.setOnClickListener { // id_fragment_user_user?.setOnClickListener {
// JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER) // JumpUtils.webJump("用户协议", NetConfig.H5.WEB_URL_USER)
// } // }
if (Constant.Switch.isOpenShop) {
id_ll_my_magic_coin.visibility = View.VISIBLE
} else {
id_ll_my_magic_coin.visibility = View.GONE
}
id_ll_my_magic_coin?.setOnClickListener { id_ll_my_magic_coin?.setOnClickListener {
//我的魔币 //我的魔币
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){ if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump() JumpUtils.ThirdPardLoginJump()
}else{ } else {
JumpUtils.MyMagicCoinJump() JumpUtils.MyMagicCoinJump()
} }
} }
...@@ -144,11 +150,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -144,11 +150,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
} }
id_rl_my_order?.setOnClickListener { id_rl_my_order?.setOnClickListener {
//我的订单 //我的订单
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){ if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump() JumpUtils.ThirdPardLoginJump()
}else{ } else {
JumpUtils.MyOrderJump() JumpUtils.MyOrderJump()
} }
} }
...@@ -196,18 +202,18 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -196,18 +202,18 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
} }
fun isLogin() { fun isLogin() {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{ wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) { override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("1")){ if (result?.status.equals("1")) {
} }
} }
override fun onError(code: String?, errorMsg: String?) { override fun onError(code: String?, errorMsg: String?) {
} }
}) })
} }
private fun updateView() { private fun updateView() {
...@@ -347,7 +353,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces ...@@ -347,7 +353,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
// Log.e("wxw","code "+code+" msg"+errorMsg)
// Log.e("wxw","e "+e?.message)
} }
}) })
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:includeFontPadding="false" android:includeFontPadding="false"
android:drawableLeft="@drawable/icon_mobi" android:drawableLeft="@drawable/icon_jinbi"
android:text="29" android:text="29"
android:textColor="@color/color_4c84ff" android:textColor="@color/color_4c84ff"
android:layout_centerVertical="true" android:layout_centerVertical="true"
......
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