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

[提交人]:王雪伟

[提交简述] :上传Google
[实现方案] :加入事件上报
parent ff8e7b2f
......@@ -12,6 +12,7 @@ import android.text.TextUtils;
import android.util.Base64;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
......@@ -73,6 +74,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
private Observable<String> mRestartLoginObservable;
private Observable<Integer> mSwitchMainObservable;
private String goodsId;
private TextView mallBottomBtn;
@Override
public int layoutID() {
......@@ -97,6 +99,7 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
false
);
navigationView = findViewById(R.id.id_activity_main_fragment_navigation);
mallBottomBtn = findViewById(R.id.id_view_navigation_bottom_shop);
// memberPresenter = new MemberPresenter(this);
initListener();
AdDataSupport.INSTANCE.init(this);
......@@ -137,7 +140,13 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
fragments.add(new HomeFragment());
fragments.add(new WareHouseFragment());
fragments.add(new UserCenterFragment());
if (Constant.Switch.isOpenShop) {
fragments.add(new ShopFragment());
mallBottomBtn.setVisibility(View.VISIBLE);
}else {
mallBottomBtn.setVisibility(View.GONE);
}
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
for (Fragment fragment : fragments) {
transaction.add(R.id.id_activity_main_fragment_layout, fragment);
......@@ -173,10 +182,10 @@ public class MainActivity extends BaseActivity implements NavigationBottomView.N
@Override
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);
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);
EventUtils.INSTANCE.onEvent("tab_imp", "home");
} else if (vId == R.id.id_view_navigation_bottom_shop) {
......
PACKAGE_NAME=com.zhangxin.magicbox
VERSION_CODE=6
VERSION_NAME=1.0.2
VERSION_CODE=7
VERSION_NAME=1.0.3
......@@ -135,6 +135,9 @@ public class Constant {
public static class Switch {
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";
......
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.PRODUCT;
......@@ -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_URL = "";
public static String BASE_NEW_URL = "";
......@@ -34,7 +36,7 @@ public class NetConfig {
sEnvironment = s;
switch (sEnvironment) {
case PRODUCT:
BASE_URL = "http://feedapi.zhangxinhulian.com/";
BASE_URL = "https://feedapihk.zhangxinhulian.com/";
BASE_WEB_URL = "http://feedapi.zhangxinhulian.com/";
BASE_NEW_URL = "http://feedapi.zhangxinhulian.com/";
BASE_FEED_URL = "http://feedapi.zhangxinhulian.com/";
......@@ -198,15 +200,17 @@ public class NetConfig {
}
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_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;
......
......@@ -11,4 +11,5 @@ class AppInEntity {
var feedback_open: String? = ""
var depots_text: 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,
override fun onPaySuccess(purchase: GooglePayResult, googleJson: String) {
mPresenter?.verifyPay(googleJson, GOOGLE_PAY)
//mLoading?.setResult(true, "Pay for success", 1000)
EventUtils.onEvent("GooglePaySuccess")
}
override fun onCancel() {
runOnUiThread {
mLoading?.setResult(false, "pay cancel", 1000)
}
EventUtils.onEvent("GooglePayCancel")
}
override fun onError(error: String) {
......@@ -577,6 +579,7 @@ class PayActivity : BaseActivity(), PayContract.View,
runOnUiThread {
mLoading?.setResult(false, "pay error", 1000)
}
EventUtils.onEvent("GooglePayError",error)
}
})
}
......
......@@ -12,6 +12,7 @@ import cn.sharesdk.google.GooglePlus
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference
......@@ -40,6 +41,7 @@ class WeChatUtils {
.subscribe(object : BaseObserver<IsWeChatLoginEntity>() {
override fun onSuccess(result: IsWeChatLoginEntity?) {
result?.let {
Constant.Switch.isLogin = result.status!="0"
callback?.onResult(it)
}
// isLogin = result?.status.equals("1")
......@@ -159,18 +161,22 @@ class WeChatUtils {
//授权回调监听,监听oncomplete,onerror,oncancel三种状态
plat.platformActionListener = object : PlatformActionListener {
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)
EventUtils.onEvent("FackBookloginSuccess")
}
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
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) {
//取消分享的回调
Log.e("MXL", "FaceBook:onCancel")
EventUtils.onEvent("FackBookloginCancel")
}
}
plat.showUser(null)
......@@ -183,6 +189,7 @@ class WeChatUtils {
override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token)
UserDataUtils.updateUserInfo(null)
Constant.Switch.isLogin = true
Log.e("MXL", "FaceBook登录成功")
// getShareCon tent(mContext)
// callBack.loginSuccess(lottery)
......@@ -212,6 +219,7 @@ class WeChatUtils {
val pic = obj.get("picture").toString().replace("\"", "")
Log.e("MXL", "image:" + pic)
bindGoogle(p0?.db?.userId, p0?.db?.userName, pic)
EventUtils.onEvent("GoogleLoginSuccess")
}
}
......@@ -219,12 +227,15 @@ class WeChatUtils {
override fun onError(arg0: Platform, arg1: Int, arg2: Throwable) {
//失败的回调,arg:平台对象,arg1:表示当前的动作(8:有用户信息登录, 1:无用户信息登录),arg2:异常信息
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) {
//取消分享的回调
Log.e("MXL", "onCancel")
EventUtils.onEvent("GoogleLoginCancel")
}
}
// plat.authorize()
......@@ -239,6 +250,7 @@ class WeChatUtils {
override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token)
UserDataUtils.updateUserInfo(null)
Constant.Switch.isLogin = true
Log.e("MXL", "谷歌登录成功")
// getShareCon tent(mContext)
// callBack.loginSuccess(lottery)
......
......@@ -6,15 +6,16 @@ import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Paint
import android.text.Html
import android.text.TextUtils
import android.util.Log
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.viewpager.widget.ViewPager
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.NetConfig
import com.zxhl.cms.common.base.BaseActivity
import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.*
......@@ -25,7 +26,6 @@ import com.zxhl.cms.pay.PayPresenter
import com.zxhl.cms.utils.*
import com.zxhl.cms.widget.LoadingDialog
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.TopPagerAdapter
import com.zxhl.main.page.contract.GoodsDetailContract
......@@ -38,7 +38,6 @@ import com.zxhl.novel.utils.server.PayResultEntity
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
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.layout_detail_content2.*
import kotlinx.android.synthetic.main.layout_detail_top2.*
......@@ -85,16 +84,21 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
boxid = intent?.data?.getQueryParameter("boxid") ?: ""
wechatutil = WeChatUtils(this, this)
wechatutil?.isWechatLogin(null)
//返回
id_detail_img_back?.setOnClickListener {
this.finish()
}
//规则
id_detail_rule?.setOnClickListener {
JumpUtils.webJump("Rule",NetConfig.H5.WEB_URL_RULE)
}
//试玩
id_detail_shiwan_rl?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.TEST_LOTTERY, "")
BoxResultDialog.showTestLotteryResult(
this,
......@@ -106,6 +110,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
}
//五连抽
id_btn_five_lottery?.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()
......@@ -119,48 +127,18 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
oneSellCoin,
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 {
needPrice = fiveSellCoin.toString()
if (ownCoin != null) {
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)
}
}
JumpUtils.payJump(boxid, needPrice, Constant.Key.FIVE_LOTTERY)
}
}
//单抽
id_btn_one_lottery?.setOnClickListener {
if (!Constant.Switch.isLogin){
JumpUtils.ThirdPardLoginJump()
return@setOnClickListener
}
EventUtils.onEvent("one_lottery", "单抽")
EventUtils.onEvent("one_lottery_boxid", "" + boxid)
clickType = Constant.Key.ONE_LOTTERY
......@@ -173,46 +151,9 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
oneSellCoin,
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 {
needPrice = oneSellCoin.toString()
if (ownCoin != null) {
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)
}
}
JumpUtils.payJump(boxid, needPrice, Constant.Key.ONE_LOTTERY)
}
}
//拥有的币数量
......@@ -267,6 +208,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
override fun onDismiss() {
mPresenter?.getPropsCardList(boxid)
}
override fun onLotterySuccess() {
mPresenter?.getBoxInfo(boxid)
}
})
floatAnim(id_detail_tv_xuan_fu, 2000)
......@@ -305,8 +250,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
fiveSellCoin = reslut?.fivePrice ?: 0.0
oneSellCoin = reslut?.onePrice ?: 0.0
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) {
mPagerAdapter = TopPagerAdapter(reslut?.goodsList!!)
id_detail_top_viewpager.adapter = mPagerAdapter
......@@ -319,6 +266,7 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
} else {
id_detail_tv_xuan_fu.visibility = View.GONE
}
BoxResultDialog.setDialogPrice(oneSellCoin,fiveSellCoin)
}
@SuppressLint("WrongConstant")
......
......@@ -73,6 +73,8 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
}
private var LoginNum:Int = 0;
override fun jumpMainPage() {
val user = SettingPreference.getUserInfoData()
val token = SettingPreference.getUserToken()
......@@ -88,8 +90,6 @@ class SplashActivity : BaseActivity(), SplashContract.View {
RounterBus.getRounter(RounterApi::class.java).getIntentActivityMain()
)
}
finish()
}
......
......@@ -3,17 +3,19 @@ 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.EventUtils
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 {
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))
......@@ -25,16 +27,16 @@ class ThirdpartyLoginActivity:BaseActivity(), WeChatLoginSuccessCallBall {
override fun init() {
wechatutil = WeChatUtils(this, this)
id_ll_google_login?.setOnClickListener(object :NoDoubleClickListener(){
id_ll_google_login?.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) {
EventUtils.onEvent("googleLoginClick")
//WeChatUtils.
wechatutil?.GoogleLogin()
}
})
id_ll_facebook_login?.setOnClickListener(object :NoDoubleClickListener(){
id_ll_facebook_login?.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) {
EventUtils.onEvent("facebookLoginClick")
wechatutil?.FackBooklogin()
}
......
......@@ -39,7 +39,7 @@ class TopPagerAdapter : PagerAdapter {
val view = LayoutInflater.from(AppContext.get()).inflate(R.layout.item_goods_top, null)
val bg = view.findViewById<ImageView>(R.id.id_img_main)
// 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)// 添加页卡
return view
}
......
......@@ -70,9 +70,18 @@ class AllFragment : BaseFragment, HomeContract.View,
}
//mPresenter?.getHomeBoxList("")
mPresenter?.getHomeBoxList(title, false)
BoxResultDialog.setDialogDismissCallback(object : BoxResultDialog.DialogDismissCallback {
override fun onDismiss() {
}
override fun onLotterySuccess() {
mPresenter?.clearPage()
mPresenter?.getHomeBoxList(title, true)
}
})
}
override fun lazyLoad() {
super.lazyLoad()
Log.d("lazyLoad", "isInitial:" + isInitial + " isVisible:" + isVisible)
......@@ -147,7 +156,7 @@ class AllFragment : BaseFragment, HomeContract.View,
mActivity,
data?.boxId ?: "",
data?.onePrice!!,
data?.fivePrice!!, 0
data.fivePrice, 0
)
}else{
val chajia = data?.onePrice?.minus(ownCoin!!)
......
......@@ -91,7 +91,7 @@ class RecycledFragment : BaseFragment(), WareHouseContract.View,
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(
// mActivity,
// sb.toString(),
......
......@@ -123,7 +123,8 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View,
"3",
recoverprice.toString(),
recoveType,
this
this,
null
)
// RecoverPopupWindow().init(
// mActivity,
......
......@@ -3,21 +3,17 @@ package com.zxhl.main.page.presenter
import android.app.Activity
import android.os.Build
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.TTAdSdk
import com.bytedance.sdk.openadsdk.TTSplashAd
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.net.ApiClient
import com.zxhl.cms.net.RxSchedulers
import com.zxhl.cms.net.SettingPreference
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.utils.*
import com.zxhl.cms.utils.UserDataUtils
import com.zxhl.cms.utils.Utils
import com.zxhl.main.page.contract.SplashContract
import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe
......@@ -33,7 +29,7 @@ class SplashPresenter : SplashContract.Presenter {
private val mView: SplashContract.View
private val mActivity:Activity
private val mActivity: Activity
constructor(mView: SplashContract.View, mActivity: Activity) {
this.mView = mView
......@@ -92,12 +88,12 @@ class SplashPresenter : SplashContract.Presenter {
override fun checkLogin() {
val user = SettingPreference.getUserInfoData()
val token =SettingPreference.getUserToken()
if (user == null&&TextUtils.isEmpty(token)) {
if(TextUtils.equals( Utils.getChannel(AppContext.get()), "toutiao_h5")){
val token = SettingPreference.getUserToken()
if (user == null && TextUtils.isEmpty(token)) {
if (TextUtils.equals(Utils.getChannel(AppContext.get()), "toutiao_h5")) {
// deviceLogin()
getAds()
}else{
} else {
deviceLogin()
}
......@@ -129,16 +125,13 @@ class SplashPresenter : SplashContract.Presenter {
}
private fun getAds() {
ApiClient.adApi.getAds("splash")
ApiClient.homeApi.getAppInfo()
.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 {
.subscribe(object : BaseObserver<AppInEntity>() {
override fun onSuccess(result: AppInEntity?) {
if (result != null) {
Constant.Switch.isOpenShop = result.shop_open == 1
Constant.Switch.recoverType = result.recover_type
mView.jumpMainPage()
}
}
......@@ -147,53 +140,72 @@ class SplashPresenter : SplashContract.Presenter {
mView.jumpMainPage()
}
})
}
private var mTTAdNative: TTAdNative? = null
private fun loadToutiao(data: NewsEntity, count: Int, slotNameL: String) {
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()
// 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()
// }
// })
}
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()
}
private var mTTAdNative: TTAdNative? = null
override fun onAdTimeOver() {
mView.jumpMainPage()
}
})
}
}, 5000)
}
// private fun loadToutiao(data: NewsEntity, count: Int, slotNameL: String) {
// 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() {
// mView.jumpMainPage()
// }
// })
// }
// }, 5000)
// }
}
\ No newline at end of file
......@@ -19,11 +19,10 @@ import com.zxhl.cms.net.model.box.*
import com.zxhl.cms.utils.EventUtils
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.UserDataUtils
import com.zxhl.cms.widget.LoadingDialog
import com.zxhl.main.R
import com.zxhl.main.page.`interface`.PopupWidowCloseCallBack
import com.zxhl.main.page.contract.LotteryContract
import com.zxhl.main.page.presenter.LotteryPresenter
import kotlinx.android.synthetic.main.activity_layout_lottery_reslut.*
/**
* @author (wangXuewei)
......@@ -42,8 +41,14 @@ object BoxResultDialog : LotteryContract.View {
this.dialogDismissCallback = callback
}
fun setDialogPrice(onePrice: Double, fivePrice: Double) {
this.onePrice = onePrice
this.fivePrice = fivePrice
}
interface DialogDismissCallback {
fun onDismiss()
fun onLotterySuccess()
}
fun showFiveLotteryResult(
......@@ -59,6 +64,7 @@ object BoxResultDialog : LotteryContract.View {
if (boxId == "" || fivePrice == 0.0) {
return
}
EventUtils.onEvent("FiveLotteryClick")
mRePumpingCardNum = cardNum
var ownCoin = SettingPreference.getUserCoinNum().toDouble()
if (ownCoin < fivePrice) {
......@@ -86,6 +92,7 @@ object BoxResultDialog : LotteryContract.View {
if (boxId == "" || onePrice == 0.0) {
return
}
EventUtils.onEvent("OneLotteryClick")
mRePumpingCardNum = cardNum
var ownCoin = SettingPreference.getUserCoinNum().toDouble()
//钱数不够 去充值
......@@ -146,11 +153,19 @@ object BoxResultDialog : LotteryContract.View {
var btnClose = mDialogView.findViewById<ImageView>(R.id.id_result_close)
var oneGoodsImg = mDialogView.findViewById<ImageView>(R.id.id_result_one_goods)
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 goodsImg3 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_3)
var goodsImg4 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_4)
var goodsImg5 = mDialogView.findViewById<ImageView>(R.id.id_result_list_goods_5)
var fiveGoodsName1 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_1)
var fiveGoodsName2 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_2)
var fiveGoodsName3 = mDialogView.findViewById<TextView>(R.id.id_result_list_goods_name_3)
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 fiveGoodsLine2 = mDialogView.findViewById<LinearLayout>(R.id.id_result_five_goods_line2)
var resultDesc1 = mDialogView.findViewById<TextView>(R.id.id_result_desc)
......@@ -160,18 +175,22 @@ object BoxResultDialog : LotteryContract.View {
var btnOk = mDialogView.findViewById<TextView>(R.id.id_result_ok)
var btnOneAgain = mDialogView.findViewById<TextView>(R.id.id_result_one_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) {
resultDescRePumping.visibility = View.VISIBLE
} else {
resultDescRePumping.visibility = View.GONE
}
var recovertList: MutableList<Double> = ArrayList()
var depotIds = StringBuilder()
for (dataBean in lotteryList) {
if (depotIds.length > 2) {
depotIds.append(",")
}
depotIds.append(dataBean.depotId)
recovertList.add(dataBean.recoverPriceStr?.toDoubleOrNull()!!)
}
var recoverprice = recovertList.sum()
//
if (desc1 == "") {
resultDesc1.visibility = View.GONE
......@@ -196,6 +215,7 @@ object BoxResultDialog : LotteryContract.View {
when (type) {
Constant.Key.TEST_LOTTERY -> {
//试用
resultRecover.visibility = View.GONE
oneGoodsImg.visibility = View.VISIBLE
oneGoodsName.visibility = View.VISIBLE
Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg)
......@@ -207,8 +227,11 @@ object BoxResultDialog : LotteryContract.View {
}
Constant.Key.ONE_LOTTERY -> {
//单抽
resultRecover.visibility = View.VISIBLE
oneGoodsImg.visibility = View.VISIBLE
oneGoodsName.visibility = View.VISIBLE
Glide.with(mActivity).load(lotteryList[0].mainImage).into(oneGoodsImg)
oneGoodsName.text = lotteryList[0].productName
btnOneAgain.visibility = View.VISIBLE
btnFiveAgain.visibility = View.VISIBLE
btnOneAgain.text =
......@@ -217,14 +240,21 @@ object BoxResultDialog : LotteryContract.View {
}
Constant.Key.FIVE_LOTTERY -> {
//五抽
resultRecover.visibility = View.VISIBLE
fiveGoodsLine1.visibility = View.VISIBLE
fiveGoodsLine2.visibility = View.VISIBLE
if (lotteryList.size >= 5) {
Glide.with(mActivity).load(lotteryList[0].mainImage).into(goodsImg1)
Glide.with(mActivity).load(lotteryList[1].mainImage).into(goodsImg2)
Glide.with(mActivity).load(lotteryList[2].mainImage).into(goodsImg3)
Glide.with(mActivity).load(lotteryList[3].mainImage).into(goodsImg4)
Glide.with(mActivity).load(lotteryList[4].mainImage).into(goodsImg5)
Glide.with(mActivity).load(lotteryList[0].mainImage).into(fiveGoodsImg1)
Glide.with(mActivity).load(lotteryList[1].mainImage).into(fiveGoodsImg2)
Glide.with(mActivity).load(lotteryList[2].mainImage).into(fiveGoodsImg3)
Glide.with(mActivity).load(lotteryList[3].mainImage).into(fiveGoodsImg4)
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
btnFiveAgain.visibility = View.VISIBLE
......@@ -242,6 +272,7 @@ object BoxResultDialog : LotteryContract.View {
//重抽
resultDescRePumping.setOnClickListener {
EventUtils.onEvent("RePumpingClick")
if (type == Constant.Key.ONE_LOTTERY) {
mRePumpingCardNum--
mPresenter.rePumpingOneLottery(boxId, depotIds.toString())
......@@ -258,6 +289,15 @@ object BoxResultDialog : LotteryContract.View {
btnFiveAgain.setOnClickListener {
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 = null
this.mActivity = null
......@@ -267,11 +307,14 @@ object BoxResultDialog : LotteryContract.View {
}
mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false)
EventUtils.onEvent("LotterySuccess", "lotteryType:$type")
dialogDismissCallback?.onLotterySuccess()
if (!mActivity.isFinishing) {
mDialog?.show()
return
}
}
override fun setOneLotterResult(result: OneLotteryEntity?) {
......
......@@ -7,6 +7,7 @@ import android.view.Gravity
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.bytedance.pangle.transform.ZeusTransformUtils.getResources
import com.zxhl.cms.AppContext
import com.zxhl.cms.common.Constant
import com.zxhl.cms.utils.NoDoubleClickListener
......@@ -28,10 +29,18 @@ object RecycleDialog : RecoverPopupContract.View {
private var recoverPrice: String = ""
private var recovetype: String = ""
private var listener: PopupWidowCloseCallBack? = null
private var listener2: PopupWidowCloseCallBack? = null
private var mPresenter: RecoverPopupPresenter? = null
//listener2 为了和使用listener的区分开 逻辑不一样
fun showRecycleDialog(
context: Activity?, ids: String, type: String?,
recoverprice: String, recove_type: String, listener: PopupWidowCloseCallBack
context: Activity?,
ids: String,
type: String?,
recoverprice: String,
recove_type: String,
listener: PopupWidowCloseCallBack?,
listener2: PopupWidowCloseCallBack?
) {
if (context == null) {
return
......@@ -41,7 +50,8 @@ object RecycleDialog : RecoverPopupContract.View {
this.type = type
this.recoverPrice = recoverprice
this.recovetype = recove_type
this.listener=listener
this.listener = listener
this.listener2 = listener2
mPresenter = RecoverPopupPresenter(this)
mDialog = Dialog(context, R.style.CenterCompatDialogTheme)
val mDialogView =
......@@ -52,7 +62,30 @@ object RecycleDialog : RecoverPopupContract.View {
0,
Gravity.CENTER
)
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 {
mDialog?.dismiss()
}
......@@ -61,9 +94,11 @@ object RecycleDialog : RecoverPopupContract.View {
if (type.equals(Constant.Key.ONE_LOTTERY)) {
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
} else if (type.equals(Constant.Key.FIVE_LOTTERY)) {
tv_recycle_price?.text = "${recoverPrice.toDoubleOrNull()?.times(
tv_recycle_price?.text = "${
recoverPrice.toDoubleOrNull()?.times(
5
)?.toString()}"
)?.toString()
}"
} else {
tv_recycle_price?.text = "${df.format(recoverPrice.toDoubleOrNull())}"
}
......@@ -87,9 +122,13 @@ object RecycleDialog : RecoverPopupContract.View {
override fun recoverSuccess() {
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))
if (listener2 != null) {
listener2?.onClosePopupWindow()
} else {
context?.finish()
}
} else {
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 @@
<LinearLayout
android:id="@+id/id_bottom_lottery_ll_view"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<TextView
<LinearLayout
android:id="@+id/id_btn_five_lottery"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/shape_detail_button_bg_9592ff_r25"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="5dp"
android:paddingBottom="5dp">
<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_btn_one_lottery"
android:id="@+id/id_tv_five_lottery_price"
android:layout_width="wrap_content"
android:layout_height="match_parent"
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>
</LinearLayout>
<LinearLayout
android:id="@+id/id_btn_one_lottery"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="@drawable/shape_detail_button_bg_83baff_r25"
android:gravity="center"
android:orientation="vertical">
<TextView
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>
<TextView
android:id="@+id/id_detail_tv_xuan_fu"
android:layout_width="wrap_content"
......@@ -101,6 +162,8 @@
android:layout_marginBottom="8dp"
android:background="@drawable/bj_bizhong_blue"
android:gravity="center"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingBottom="6dp"
android:text=""
android:textColor="@color/white"
......
......@@ -4,6 +4,13 @@
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:orientation="vertical">
<LinearLayout
android:id="@+id/id_result_dialog_view_ll"
android:layout_width="match_parent"
......@@ -28,8 +35,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingLeft="10dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColor="@color/color_333333"
android:textSize="14sp" />
......@@ -43,20 +50,58 @@
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:id="@+id/id_result_list_goods_view_1"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/id_result_list_goods_1"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/shape_ededed_r5_stroke" />
<TextView
android:id="@+id/id_result_list_goods_name_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_result_list_goods_view_2"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/id_result_list_goods_2"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/shape_ededed_r5_stroke" />
<TextView
android:id="@+id/id_result_list_goods_name_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
......@@ -69,27 +114,82 @@
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:id="@+id/id_result_list_goods_view_3"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/id_result_list_goods_3"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/shape_ededed_r5_stroke" />
<TextView
android:id="@+id/id_result_list_goods_name_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_result_list_goods_view_4"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/id_result_list_goods_4"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/shape_ededed_r5_stroke" />
<TextView
android:id="@+id/id_result_list_goods_name_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/id_result_list_goods_view_5"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/id_result_list_goods_5"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_margin="5dp"
android:background="@drawable/shape_ededed_r5_stroke" />
<TextView
android:id="@+id/id_result_list_goods_name_5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:ellipsize="end"
android:lines="2"
android:textColor="@color/color_333333"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
......@@ -98,6 +198,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:gravity="center"
android:text=""
......@@ -109,6 +210,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:gravity="center"
android:text=""
......@@ -119,11 +221,11 @@
android:id="@+id/id_result_desc3_re_pumping"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="8dp"
android:gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="@string/box_detail_open_box_result_re_pumping_desc"
android:textColor="@color/color_4C84FF"
android:textSize="14sp"
......@@ -182,7 +284,20 @@
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/id_result_recover"
android:layout_width="138dp"
android:layout_height="40dp"
android:layout_marginLeft="13dp"
android:layout_marginRight="13dp"
android:background="@drawable/shape_ffd666_ffaa00r25"
android:gravity="center"
android:visibility="gone"
android:text="Reclaim"
android:layout_marginBottom="30dp"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
<ImageView
......@@ -191,7 +306,22 @@
android:layout_height="wrap_content"
android:layout_alignTop="@+id/id_result_dialog_view_ll"
android:layout_alignRight="@+id/id_result_dialog_view_ll"
android:layout_margin="10dp"
android:layout_margin="15dp"
android:scaleX="1.5"
android:scaleY="1.5"
android:src="@drawable/icon_result_guanbi" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/id_result_dialog_view_ll"
android:layout_centerHorizontal="true"
android:text="Congratulations on getting products"
android:textColor="@color/white"
android:layout_marginBottom="10dp"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -46,6 +46,7 @@
android:textStyle="bold" />
<TextView
android:id="@+id/id_recycle_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
......
......@@ -43,7 +43,7 @@
android:includeFontPadding="false"
android:drawableLeft="@drawable/icon_jinbi"
android:drawablePadding="5dp"
android:text="10499"
android:text=""
android:textColor="@color/color_4C84FF"
android:textSize="22sp"
android:textStyle="bold" />
......@@ -55,7 +55,7 @@
android:layout_below="@id/id_img_shiwan2"
android:layout_alignParentRight="true"
android:layout_marginTop="3dp"
android:text="@string/box_detail_open_box_num"
android:text=""
android:textColor="@color/color_999999"
android:textSize="12sp" />
</LinearLayout>
......
......@@ -12,6 +12,7 @@ import com.bytedance.sdk.openadsdk.TTNativeExpressAd
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.NetConfig
import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.ApiClient
......@@ -42,11 +43,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
id_rl_tuijian_box?.adapter = mAdapter
id_rl_address?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
}else{
} else {
JumpUtils.ReceiveAddressReslutJump("0")
}
}
......@@ -60,11 +61,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
}
id_ll_my_coin?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
}else{
} else {
JumpUtils.payJump("0", "0", "0")
}
}
......@@ -80,11 +81,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
JumpUtils.LogisticsJump()
}
id_rl_jiyijan?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
}else{
} else {
JumpUtils.webJump(
mActivity.getString(R.string.customer_service),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
......@@ -123,14 +124,19 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
// id_fragment_user_user?.setOnClickListener {
// 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 {
//我的魔币
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
}else{
} else {
JumpUtils.MyMagicCoinJump()
}
}
......@@ -144,11 +150,11 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
}
id_rl_my_order?.setOnClickListener {
//我的订单
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
if (result?.status.equals("0")) {
JumpUtils.ThirdPardLoginJump()
}else{
} else {
JumpUtils.MyOrderJump()
}
}
......@@ -196,9 +202,9 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
}
fun isLogin() {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("1")){
if (result?.status.equals("1")) {
}
}
......@@ -347,7 +353,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSucces
}
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 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:includeFontPadding="false"
android:drawableLeft="@drawable/icon_mobi"
android:drawableLeft="@drawable/icon_jinbi"
android:text="29"
android:textColor="@color/color_4c84ff"
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