Commit 3b991549 authored by maxiaoliang's avatar maxiaoliang

修改111

parent 581ac570
...@@ -10,8 +10,10 @@ class AddressEntity :Serializable{ ...@@ -10,8 +10,10 @@ class AddressEntity :Serializable{
var mobile: String? = "" var mobile: String? = ""
var region: String? = "" var region: String? = ""
var address: String? = "" var address: String? = ""
var address2: String? = ""
var province: String? = "" var province: String? = ""
var city: String? = "" var city: String? = ""
var country: String? = ""
var area: String? = "" var area: String? = ""
var defaultAddress: String? = "" var defaultAddress: String? = ""
......
...@@ -242,7 +242,7 @@ class PayActivity : BaseActivity(), PayContract.View, ...@@ -242,7 +242,7 @@ class PayActivity : BaseActivity(), PayContract.View,
} }
EventUtils.onEvent("member_page_show") EventUtils.onEvent("member_page_show")
// startActivity(Intent(this,GooglePayActivity::class.java)) startActivity(Intent(this,GooglePayActivity::class.java))
initPaypal() initPaypal()
// payPalPay() // payPalPay()
} }
......
...@@ -135,8 +135,12 @@ interface RounterApi { ...@@ -135,8 +135,12 @@ interface RounterApi {
@RounterParam("id") id: String, @RounterParam("id") id: String,
@RounterParam("username") username: String, @RounterParam("username") username: String,
@RounterParam("mobile") mobile: String, @RounterParam("mobile") mobile: String,
@RounterParam("region") region: String, // @RounterParam("region") region: String,
@RounterParam("address") address: String, @RounterParam("address") address: String,
@RounterParam("address2") address2: String,
@RounterParam("province") province: String,
@RounterParam("city") city: String,
@RounterParam("country") country: String,
@RounterParam("defaultAddress") defaultAddress: String @RounterParam("defaultAddress") defaultAddress: String
): Intent ): Intent
......
...@@ -73,7 +73,7 @@ public class JumpUtils { ...@@ -73,7 +73,7 @@ public class JumpUtils {
public static void lotteryBoxJump(String boxid, String type, String price) { public static void lotteryBoxJump(String boxid, String type, String price) {
try { try {
if (boxid!=null){ if (boxid != null) {
return; return;
} }
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityLotteryBoxJump(boxid, type, price, ""); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityLotteryBoxJump(boxid, type, price, "");
...@@ -86,7 +86,7 @@ public class JumpUtils { ...@@ -86,7 +86,7 @@ public class JumpUtils {
public static void lotteryBoxJump(String boxid, String type, String price, String depotIds) { public static void lotteryBoxJump(String boxid, String type, String price, String depotIds) {
try { try {
if (boxid!=null){ if (boxid != null) {
return; return;
} }
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityLotteryBoxJump(boxid, type, price, depotIds); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityLotteryBoxJump(boxid, type, price, depotIds);
...@@ -117,9 +117,9 @@ public class JumpUtils { ...@@ -117,9 +117,9 @@ public class JumpUtils {
} }
} }
public static void EditAddressReslutJump(String id, String username, String mobile, String region, String address, String defaultAddress) { public static void EditAddressReslutJump(String id, String username, String mobile, String address, String address2, String country, String city, String province, String defaultAddress) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityEditAddressJump(id, username, mobile, region, address, defaultAddress); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityEditAddressJump(id, username, mobile, address, address2, province, city, country, defaultAddress);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppContext.get().startActivity(intent); AppContext.get().startActivity(intent);
} catch (Exception e) { } catch (Exception e) {
...@@ -186,6 +186,7 @@ public class JumpUtils { ...@@ -186,6 +186,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!"); Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
} }
} }
public static void WareHouseJump() { public static void WareHouseJump() {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityWareHouse(); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityWareHouse();
...@@ -195,6 +196,7 @@ public class JumpUtils { ...@@ -195,6 +196,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!"); Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
} }
} }
public static void SubmitJump() { public static void SubmitJump() {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivitySubmit(); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivitySubmit();
...@@ -204,6 +206,7 @@ public class JumpUtils { ...@@ -204,6 +206,7 @@ public class JumpUtils {
Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!"); Utils.showToast(AppContext.get(), "该版本暂不支持,请更新版本!");
} }
} }
public static void ThirdPardLoginJump() { public static void ThirdPardLoginJump() {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityThirdPartLogin(); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityThirdPartLogin();
......
...@@ -23,6 +23,7 @@ import com.zxhl.cms.net.SettingPreference ...@@ -23,6 +23,7 @@ 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.other.IsWeChatLoginEntity import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.net.model.other.WxBindEntity import com.zxhl.cms.net.model.other.WxBindEntity
import com.zxhl.cms.widget.IsLoginCallBack
import java.util.* import java.util.*
...@@ -39,21 +40,24 @@ class WeChatUtils { ...@@ -39,21 +40,24 @@ class WeChatUtils {
} }
fun isWechatLogin(): Boolean? { fun isWechatLogin( callback: IsLoginCallBack<IsWeChatLoginEntity>?){
ApiClient.homeApi.isWxLogin().compose(RxSchedulers.observableIO2Main()) ApiClient.homeApi.isWxLogin().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<IsWeChatLoginEntity>() { .subscribe(object : BaseObserver<IsWeChatLoginEntity>() {
override fun onSuccess(result: IsWeChatLoginEntity?) { override fun onSuccess(result: IsWeChatLoginEntity?) {
result?.let {
isLogin = result?.status.equals("1") callback?.onResult(it)
}
// isLogin = result?.status.equals("1")
//
// Log.e("MXL","isLogin"+isLogin+"status:"+result?.status)
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
callback?.onError(code,errorMsg)
} }
}) })
return true
} }
...@@ -253,6 +257,7 @@ class WeChatUtils { ...@@ -253,6 +257,7 @@ class WeChatUtils {
.subscribe(object : BaseObserver<WxBindEntity>() { .subscribe(object : BaseObserver<WxBindEntity>() {
override fun onSuccess(result: WxBindEntity?) { override fun onSuccess(result: WxBindEntity?) {
SettingPreference.saveToken(result?.token) SettingPreference.saveToken(result?.token)
UserDataUtils.updateUserInfo(null)
Log.e("MXL", "谷歌登录成功") Log.e("MXL", "谷歌登录成功")
// getShareCon tent(mContext) // getShareCon tent(mContext)
// callBack.loginSuccess(lottery) // callBack.loginSuccess(lottery)
......
package com.zxhl.cms.widget
interface IsLoginCallBack<T> {
fun onResult(result: T?)
fun onError(code: String?, errorMsg: String?)
}
\ No newline at end of file
...@@ -125,6 +125,7 @@ ...@@ -125,6 +125,7 @@
<string name="Province">Province</string> <string name="Province">Province</string>
<string name="SetAsTheDefaultAddress">Set as the default address</string> <string name="SetAsTheDefaultAddress">Set as the default address</string>
<string name="PleaseFillInYourProvince">Please fill in your province</string> <string name="PleaseFillInYourProvince">Please fill in your province</string>
<string name="PleaseFillInYourCity">Please fill in your city</string>
<string name="Please_select">Please select</string> <string name="Please_select">Please select</string>
<string name="Please_fill_in_your_address2">Please fill in your address2</string> <string name="Please_fill_in_your_address2">Please fill in your address2</string>
<string name="Please_fill_in_your_address1">Please fill in your address1</string> <string name="Please_fill_in_your_address1">Please fill in your address1</string>
......
...@@ -60,8 +60,12 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View { ...@@ -60,8 +60,12 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
var username = intent?.data?.getQueryParameter("username") ?: "" var username = intent?.data?.getQueryParameter("username") ?: ""
var mobile = intent?.data?.getQueryParameter("mobile") ?: "" var mobile = intent?.data?.getQueryParameter("mobile") ?: ""
var region = intent?.data?.getQueryParameter("region") ?: "" // var region = intent?.data?.getQueryParameter("region") ?: ""
var address = intent?.data?.getQueryParameter("address") ?: "" var address = intent?.data?.getQueryParameter("address") ?: ""
var address2 = intent?.data?.getQueryParameter("address2") ?: ""
var province = intent?.data?.getQueryParameter("province") ?: ""
var city = intent?.data?.getQueryParameter("city") ?: ""
var country = intent?.data?.getQueryParameter("country") ?: ""
var id = intent?.data?.getQueryParameter("id") ?: "" var id = intent?.data?.getQueryParameter("id") ?: ""
// id_edit_phone.setFilters(arrayOf<InputFilter>(SpaceFilter())) // id_edit_phone.setFilters(arrayOf<InputFilter>(SpaceFilter()))
defaultAddress = intent?.data?.getQueryParameter("defaultAddress") ?: "" defaultAddress = intent?.data?.getQueryParameter("defaultAddress") ?: ""
...@@ -85,12 +89,12 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View { ...@@ -85,12 +89,12 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
id_country_select_spinner.performClick() id_country_select_spinner.performClick()
} }
//城市选择 // //城市选择
id_select_city?.setOnClickListener { // id_select_city?.setOnClickListener {
// hideKeyBoard() //// hideKeyBoard()
isInitSelect = false // isInitSelect = false
id_city_select_spinner.performClick() // id_city_select_spinner.performClick()
} // }
// id_select_country?.text = addressList[0].country // id_select_country?.text = addressList[0].country
// id_select_city?.text = addressList[0].cityLis?.get(0) // id_select_city?.text = addressList[0].cityLis?.get(0)
...@@ -99,6 +103,10 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View { ...@@ -99,6 +103,10 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
id_edit_phone?.setText(mobile) id_edit_phone?.setText(mobile)
id_edit_address1?.setText(address) id_edit_address1?.setText(address)
id_edit_address2?.setText(address2)
id_edit_province?.setText(province)
id_select_city?.setText(city)
id_select_country?.setText(country)
id_img_back?.setOnClickListener { id_img_back?.setOnClickListener {
finish() finish()
} }
...@@ -109,24 +117,32 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View { ...@@ -109,24 +117,32 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
// } // }
id_tv_save_address?.setOnClickListener { id_tv_save_address?.setOnClickListener {
if (TextUtils.isEmpty(id_edit_name.text.toString()) || TextUtils.isEmpty(id_edit_phone.text.toString()) || TextUtils.isEmpty( if (TextUtils.isEmpty(id_edit_name.text.toString()) || TextUtils.isEmpty(id_edit_phone.text.toString()) || TextUtils.isEmpty(
id_edit_address1.text.toString()
) || TextUtils.isEmpty(id_edit_address2.text.toString()) || TextUtils.isEmpty(
id_select_city.text.toString() id_select_city.text.toString()
) || TextUtils.isEmpty(id_select_country.text.toString()) ) || TextUtils.isEmpty(id_select_country.text.toString()) || TextUtils.isEmpty(
id_edit_province.text.toString()
)
) { ) {
// Utils.showToast(AppContext.get(), "请完整填写信息") // Utils.showToast(AppContext.get(), "请完整填写信息")
return@setOnClickListener return@setOnClickListener
} else { } else {
if (id_edit_phone.text.toString()?.length != 11) { // if (id_edit_phone.text.toString()?.length != 11) {
// Utils.showToast(AppContext.get(), "请检查手机号码") //// Utils.showToast(AppContext.get(), "请检查手机号码")
return@setOnClickListener // return@setOnClickListener
} // }
enity = AddressEntity() enity = AddressEntity()
if (!TextUtils.isEmpty(id)) { if (!TextUtils.isEmpty(id)) {
enity?.id = id enity?.id = id
} }
enity?.username = id_edit_name.text.toString().trim() enity?.username = id_edit_name.text.toString().trim()
enity?.mobile = id_edit_phone.text.toString().trim() enity?.mobile = id_edit_phone.text.toString().trim()
enity?.region = id_select_city.text.toString().trim() // enity?.region = id_select_city.text.toString().trim()
enity?.address = id_select_city.text.toString().trim() enity?.address = id_edit_address1.text.toString().trim()
enity?.address2 = id_edit_address2.text.toString().trim()
enity?.province = id_edit_province.text.toString().trim()
enity?.city = id_select_city.text.toString().trim()
enity?.country = id_select_country.text.toString().trim()
enity?.defaultAddress = "1" enity?.defaultAddress = "1"
mPresenter?.editAddress(enity) mPresenter?.editAddress(enity)
} }
...@@ -320,8 +336,8 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View { ...@@ -320,8 +336,8 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
position: Int, position: Int,
id: Long id: Long
) { ) {
if (!isInitSelect){ if (!isInitSelect) {
id_select_city?.text = cityList[position] // id_select_city?.text = cityList[position]
} }
} }
......
...@@ -121,13 +121,13 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -121,13 +121,13 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
price = id_tv_five_price?.text.toString() price = id_tv_five_price?.text.toString()
clickType = Constant.Key.FIVE_LOTTERY clickType = Constant.Key.FIVE_LOTTERY
if (ownCoin?.compareTo(fiveSellCoin!!)!! >= 0) { if (ownCoin?.compareTo(fiveSellCoin!!)!! >= 0) {
if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price) JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
} else { // if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.ThirdPardLoginJump() // JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
// wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY) // } else {
} // JumpUtils.ThirdPardLoginJump()
// // wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY)
// }
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY) // JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY)
} else { } else {
needPrice = id_tv_five_price.text.toString() needPrice = id_tv_five_price.text.toString()
...@@ -165,15 +165,16 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -165,15 +165,16 @@ class GoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
price = id_tv_oneprice?.text.toString() price = id_tv_oneprice?.text.toString()
Log.e("MXL", "sss" + ownCoin?.compareTo(oneSellCoin!!)) Log.e("MXL", "sss" + ownCoin?.compareTo(oneSellCoin!!))
if (ownCoin?.compareTo(oneSellCoin!!)!! >= 0) { if (ownCoin?.compareTo(oneSellCoin!!)!! >= 0) {
if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price) JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price)
} else { // if (wechatutil!!.isWechatLogin() == true) {
Log.e("MXL", "未登录") //
// onWxLogin() // JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price)
JumpUtils.ThirdPardLoginJump() // } else {
// wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY) // Log.e("MXL", "未登录")
} //// onWxLogin()
// JumpUtils.ThirdPardLoginJump()
// // wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY)
// }
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY) // JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY)
} else { } else {
needPrice = id_tv_oneprice.text.toString() needPrice = id_tv_oneprice.text.toString()
......
...@@ -114,19 +114,24 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -114,19 +114,24 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
clickType = Constant.Key.FIVE_LOTTERY clickType = Constant.Key.FIVE_LOTTERY
//拥有的币足够 //拥有的币足够
if (ownCoin?.compareTo(fiveSellCoin!!)!! >= 0) { if (ownCoin?.compareTo(fiveSellCoin!!)!! >= 0) {
if (wechatutil!!.isWechatLogin() == true) {
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
BoxResultDialog.showFiveLotteryResult( BoxResultDialog.showFiveLotteryResult(
this, this,
boxid ?: "", boxid ?: "",
oneSellCoin, oneSellCoin,
fiveSellCoin fiveSellCoin
) )
} else { // if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.ThirdPardLoginJump() //// JumpUtils.lotteryBoxJump(boxid, Constant.Key.FIVE_LOTTERY, price)
// wechatutil!!.wechatLogin(this, Constant.Key.FIVE_LOTTERY) // 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) { if (ownCoin != null) {
...@@ -163,20 +168,26 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View, ...@@ -163,20 +168,26 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
price = oneSellCoin.toString() price = oneSellCoin.toString()
Log.e("MXL", "sss" + ownCoin?.compareTo(oneSellCoin!!)) Log.e("MXL", "sss" + ownCoin?.compareTo(oneSellCoin!!))
if (ownCoin?.compareTo(oneSellCoin!!)!! >= 0) { if (ownCoin?.compareTo(oneSellCoin!!)!! >= 0) {
if (wechatutil!!.isWechatLogin() == true) {
// JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price)
BoxResultDialog.showOneLotteryResult( BoxResultDialog.showOneLotteryResult(
this, this,
boxid ?: "", boxid ?: "",
oneSellCoin, oneSellCoin,
fiveSellCoin, rePumpingCardNum fiveSellCoin, rePumpingCardNum
) )
} else { // if (wechatutil!!.isWechatLogin() == true) {
Log.e("MXL", "未登录") //// JumpUtils.lotteryBoxJump(boxid, Constant.Key.ONE_LOTTERY, price)
// onWxLogin() // BoxResultDialog.showOneLotteryResult(
JumpUtils.ThirdPardLoginJump() // this,
// wechatutil!!.wechatLogin(this, Constant.Key.ONE_LOTTERY) // 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) { if (ownCoin != null) {
......
...@@ -56,7 +56,7 @@ class ReceiveAddressActivity : BaseActivity(), ReceiveAddressContract.View, ...@@ -56,7 +56,7 @@ class ReceiveAddressActivity : BaseActivity(), ReceiveAddressContract.View,
finish() finish()
} }
id_tv_add_address?.setOnClickListener { id_tv_add_address?.setOnClickListener {
JumpUtils.EditAddressReslutJump("", "", "", "", "", "0") JumpUtils.EditAddressReslutJump("", "", "", "", "", "","","","0")
} }
mPresenter = ReceiveAddressPresenter(this) mPresenter = ReceiveAddressPresenter(this)
mPresenter?.getAddress(isDefault) mPresenter?.getAddress(isDefault)
......
...@@ -12,8 +12,13 @@ import com.google.gson.Gson ...@@ -12,8 +12,13 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
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.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.net.model.shop.ShopListEntity import com.zxhl.cms.net.model.shop.ShopListEntity
import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.NoDoubleClickListener import com.zxhl.cms.utils.NoDoubleClickListener
import com.zxhl.cms.utils.WeChatLoginSuccessCallBall
import com.zxhl.cms.utils.WeChatUtils
import com.zxhl.cms.widget.IsLoginCallBack
import com.zxhl.main.R import com.zxhl.main.R
import kotlinx.android.synthetic.main.activity_layout_shop_goods_detail.* import kotlinx.android.synthetic.main.activity_layout_shop_goods_detail.*
...@@ -21,8 +26,9 @@ import kotlinx.android.synthetic.main.activity_layout_shop_goods_detail.* ...@@ -21,8 +26,9 @@ import kotlinx.android.synthetic.main.activity_layout_shop_goods_detail.*
* @author (wangXuewei) * @author (wangXuewei)
* @detail :商店详情 * @detail :商店详情
*/ */
class ShopGoodsDetailActivity : BaseActivity() { class ShopGoodsDetailActivity : BaseActivity(), WeChatLoginSuccessCallBall {
private var goodsDetail: ShopListEntity? = null; private var goodsDetail: ShopListEntity? = null;
private var wechatutil: WeChatUtils? = null
var mChoosList: MutableList<String> = ArrayList() var mChoosList: MutableList<String> = ArrayList()
override fun onClick(v: View?) { override fun onClick(v: View?) {
...@@ -37,7 +43,7 @@ class ShopGoodsDetailActivity : BaseActivity() { ...@@ -37,7 +43,7 @@ class ShopGoodsDetailActivity : BaseActivity() {
} }
override fun init() { override fun init() {
goodsDetail = intent.getSerializableExtra("goods") as ShopListEntity? goodsDetail = intent.getSerializableExtra("goods") as ShopListEntity?
wechatutil=WeChatUtils(this,this)
id_shop_detail_goods_img.setLoadImageUrl(goodsDetail?.mainImage, false) id_shop_detail_goods_img.setLoadImageUrl(goodsDetail?.mainImage, false)
id_shop_detail_goods_price.text = goodsDetail?.salePriceStr id_shop_detail_goods_price.text = goodsDetail?.salePriceStr
id_shop_detail_goods_oldPrice.text = "$${goodsDetail?.originalPrice}" id_shop_detail_goods_oldPrice.text = "$${goodsDetail?.originalPrice}"
...@@ -64,8 +70,22 @@ class ShopGoodsDetailActivity : BaseActivity() { ...@@ -64,8 +70,22 @@ class ShopGoodsDetailActivity : BaseActivity() {
} }
id_bug_goods_btn.setOnClickListener(object : NoDoubleClickListener() { id_bug_goods_btn.setOnClickListener(object : NoDoubleClickListener() {
override fun onNoDoubleClick(v: View?) { override fun onNoDoubleClick(v: View?) {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
gotoBuy() gotoBuy()
} }
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
}) })
} }
...@@ -80,4 +100,8 @@ class ShopGoodsDetailActivity : BaseActivity() { ...@@ -80,4 +100,8 @@ class ShopGoodsDetailActivity : BaseActivity() {
) )
startActivity(intent) startActivity(intent)
} }
override fun loginSuccess(lottery: String?) {
}
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import android.view.LayoutInflater ...@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
...@@ -33,7 +34,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol ...@@ -33,7 +34,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol
override fun onBindViewHolder(holder: ViewHolder, position: Int) { override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position] var bean = mList[position]
holder.item_user_address_name?.text = bean.username + bean.mobile holder.item_user_address_name?.text = bean.username + bean.mobile
holder.item_user_address?.text = bean.region + bean.address holder.item_user_address?.text = "${bean.country},${bean.province},${bean.city},${bean.address},${bean.address2}"
if (bean.defaultAddress.equals("1")) { if (bean.defaultAddress.equals("1")) {
holder.item_img_address_moren?.visibility = View.VISIBLE holder.item_img_address_moren?.visibility = View.VISIBLE
} else { } else {
...@@ -44,8 +45,11 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol ...@@ -44,8 +45,11 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol
bean.id, bean.id,
bean.username, bean.username,
bean.mobile, bean.mobile,
bean.region,
bean.address, bean.address,
bean.address2,
bean.country,
bean.city,
bean.province,
bean.defaultAddress bean.defaultAddress
) )
...@@ -72,7 +76,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol ...@@ -72,7 +76,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol
var item_user_address: TextView? var item_user_address: TextView?
var item_img_edit: ImageView? var item_img_edit: ImageView?
var item_img_del: ImageView? var item_img_del: ImageView?
var item_rl: RelativeLayout? var item_rl: LinearLayout?
constructor( constructor(
itemView: View itemView: View
...@@ -82,7 +86,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol ...@@ -82,7 +86,7 @@ class AddressAdapter : BaseRecyclerAdapter<AddressEntity, AddressAdapter.ViewHol
item_img_del = itemView.findViewById<ImageView>(R.id.id_img_del) item_img_del = itemView.findViewById<ImageView>(R.id.id_img_del)
item_user_address_name = itemView.findViewById<TextView>(R.id.id_tv_user_address_name) item_user_address_name = itemView.findViewById<TextView>(R.id.id_tv_user_address_name)
item_user_address = itemView.findViewById<TextView>(R.id.id_tv_user_address) item_user_address = itemView.findViewById<TextView>(R.id.id_tv_user_address)
item_rl = itemView.findViewById<RelativeLayout>(R.id.id_rl_item) item_rl = itemView.findViewById<LinearLayout>(R.id.id_rl_item)
} }
......
...@@ -11,9 +11,9 @@ import com.zxhl.cms.common.Constant ...@@ -11,9 +11,9 @@ import com.zxhl.cms.common.Constant
import com.zxhl.cms.common.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.SettingPreference import com.zxhl.cms.net.SettingPreference
import com.zxhl.cms.net.model.box.HomeBoxListEntity import com.zxhl.cms.net.model.box.HomeBoxListEntity
import com.zxhl.cms.utils.JumpUtils import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener import com.zxhl.cms.utils.*
import com.zxhl.cms.utils.Utils import com.zxhl.cms.widget.IsLoginCallBack
import com.zxhl.main.R import com.zxhl.main.R
import com.zxhl.main.page.adapter.BoxAdapter import com.zxhl.main.page.adapter.BoxAdapter
import com.zxhl.main.page.contract.HomeContract import com.zxhl.main.page.contract.HomeContract
...@@ -25,10 +25,11 @@ import kotlinx.android.synthetic.main.layout_top_box.* ...@@ -25,10 +25,11 @@ import kotlinx.android.synthetic.main.layout_top_box.*
import kotlinx.android.synthetic.main.layout_top_head.* import kotlinx.android.synthetic.main.layout_top_head.*
class AllFragment : BaseFragment, HomeContract.View, class AllFragment : BaseFragment, HomeContract.View,
OnRecycleItemClickListener<HomeBoxListEntity> { OnRecycleItemClickListener<HomeBoxListEntity>, WeChatLoginSuccessCallBall {
private var mPresenter: HomePresenter? = null private var mPresenter: HomePresenter? = null
private var mAdapter: BoxAdapter? = null private var mAdapter: BoxAdapter? = null
private var ownCoin: Double? = 0.0 private var ownCoin: Double? = 0.0
private var wechatutil: WeChatUtils? = null
private val title: String private val title: String
constructor(title: String) : super() { constructor(title: String) : super() {
...@@ -44,6 +45,7 @@ class AllFragment : BaseFragment, HomeContract.View, ...@@ -44,6 +45,7 @@ class AllFragment : BaseFragment, HomeContract.View,
override fun init(view: View?) { override fun init(view: View?) {
// showNewPeople() // showNewPeople()
wechatutil= WeChatUtils(mActivity,this)
mPresenter = HomePresenter(this) mPresenter = HomePresenter(this)
mAdapter = BoxAdapter(mActivity, this) mAdapter = BoxAdapter(mActivity, this)
//拥有的币数量 //拥有的币数量
...@@ -118,10 +120,24 @@ class AllFragment : BaseFragment, HomeContract.View, ...@@ -118,10 +120,24 @@ class AllFragment : BaseFragment, HomeContract.View,
} }
R.id.id_tv_one_lottery->{ R.id.id_tv_one_lottery->{
Log.e("MXL","点击抽奖") Log.e("MXL","点击抽奖")
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
oneLottery(data) oneLottery(data)
} }
} }
override fun onError(code: String?, errorMsg: String?) {
}
})
}
}
} }
fun oneLottery(data: HomeBoxListEntity?){ fun oneLottery(data: HomeBoxListEntity?){
...@@ -138,4 +154,8 @@ class AllFragment : BaseFragment, HomeContract.View, ...@@ -138,4 +154,8 @@ class AllFragment : BaseFragment, HomeContract.View,
JumpUtils.payJump(data?.boxId, chajia.toString(), Constant.Key.ONE_LOTTERY) JumpUtils.payJump(data?.boxId, chajia.toString(), Constant.Key.ONE_LOTTERY)
} }
} }
override fun loginSuccess(lottery: String?) {
}
} }
\ No newline at end of file
...@@ -144,17 +144,18 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View, ...@@ -144,17 +144,18 @@ class TobePickUpFragment : BaseFragment(), WareHouseContract.View,
if (mChoosList.isEmpty()) { if (mChoosList.isEmpty()) {
Utils.showToast(mActivity, "请选择要发货的物品") Utils.showToast(mActivity, "请选择要发货的物品")
} else { } else {
if (wechatutil!!.isWechatLogin() == true) {
val intent = Intent(mActivity, OrderDetailActivity::class.java) val intent = Intent(mActivity, OrderDetailActivity::class.java)
intent.putStringArrayListExtra( intent.putStringArrayListExtra(
"stringList", "stringList",
mChoosList as java.util.ArrayList<String>? mChoosList as java.util.ArrayList<String>?
) )
startActivity(intent) startActivity(intent)
} else { // if (wechatutil!!.isWechatLogin() == true) {
JumpUtils.ThirdPardLoginJump() //
// wechatutil!!.wechatLogin(mActivity, Constant.Key.FIVE_LOTTERY) // } else {
} // JumpUtils.ThirdPardLoginJump()
// // wechatutil!!.wechatLogin(mActivity, Constant.Key.FIVE_LOTTERY)
// }
} }
// JumpUtils.OrderDetailJump() // JumpUtils.OrderDetailJump()
......
...@@ -4,8 +4,12 @@ import android.view.View ...@@ -4,8 +4,12 @@ import android.view.View
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.base.BaseFragment import com.zxhl.cms.common.base.BaseFragment
import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.utils.JumpUtils import com.zxhl.cms.utils.JumpUtils
import com.zxhl.cms.utils.RxBus import com.zxhl.cms.utils.RxBus
import com.zxhl.cms.utils.WeChatLoginSuccessCallBall
import com.zxhl.cms.utils.WeChatUtils
import com.zxhl.cms.widget.IsLoginCallBack
import com.zxhl.main.R import com.zxhl.main.R
import com.zxhl.main.page.view.BaseViewPagerFragment import com.zxhl.main.page.view.BaseViewPagerFragment
import io.reactivex.Observable import io.reactivex.Observable
...@@ -13,8 +17,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers ...@@ -13,8 +17,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.fragment_warehouse.* import kotlinx.android.synthetic.main.fragment_warehouse.*
class WareHouseFragment : BaseViewPagerFragment() { class WareHouseFragment : BaseViewPagerFragment(), WeChatLoginSuccessCallBall {
private var mSwitchFragmentObservable: Observable<Int>? = null private var mSwitchFragmentObservable: Observable<Int>? = null
private var wechatutil: WeChatUtils? = null
override val createTitles = ArrayList<String>().apply { override val createTitles = ArrayList<String>().apply {
add(AppContext.get().getString(R.string.to_be_recycled)) add(AppContext.get().getString(R.string.to_be_recycled))
// add("待收货") // add("待收货")
...@@ -44,6 +49,7 @@ class WareHouseFragment : BaseViewPagerFragment() { ...@@ -44,6 +49,7 @@ class WareHouseFragment : BaseViewPagerFragment() {
// mPresenter?.clearPage() // mPresenter?.clearPage()
// mPresenter?.getHomeBoxList("") // mPresenter?.getHomeBoxList("")
viewPager?.currentItem = 1 viewPager?.currentItem = 1
wechatutil= WeChatUtils(mActivity,this)
mSwitchFragmentObservable = mSwitchFragmentObservable =
RxBus.get().register(Constant.swith_fragment, Int::class.java) RxBus.get().register(Constant.swith_fragment, Int::class.java)
mSwitchFragmentObservable?.observeOn(AndroidSchedulers.mainThread()) mSwitchFragmentObservable?.observeOn(AndroidSchedulers.mainThread())
...@@ -59,10 +65,25 @@ class WareHouseFragment : BaseViewPagerFragment() { ...@@ -59,10 +65,25 @@ class WareHouseFragment : BaseViewPagerFragment() {
override fun lazyLoad() { override fun lazyLoad() {
super.lazyLoad() super.lazyLoad()
if (isVisible && isInitial) { if (isVisible && isInitial) {
wechatutil?.isWechatLogin(object : IsLoginCallBack<IsWeChatLoginEntity> {
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
createFragments[viewPager?.currentItem ?: 0].userVisibleHint = true createFragments[viewPager?.currentItem ?: 0].userVisibleHint = true
} }
} }
override fun onError(code: String?, errorMsg: String?) {
}
})
}
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
if (mSwitchFragmentObservable != null) { if (mSwitchFragmentObservable != null) {
...@@ -75,4 +96,8 @@ class WareHouseFragment : BaseViewPagerFragment() { ...@@ -75,4 +96,8 @@ class WareHouseFragment : BaseViewPagerFragment() {
fun newInstance() = WareHouseFragment() fun newInstance() = WareHouseFragment()
} }
override fun loginSuccess(lottery: String?) {
}
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="#F8F8F8" android:background="@color/white"
android:fitsSystemWindows="true"> android:fitsSystemWindows="true">
<RelativeLayout <RelativeLayout
...@@ -221,21 +221,27 @@ ...@@ -221,21 +221,27 @@
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <EditText
android:id="@+id/id_select_city" android:id="@+id/id_select_city"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:layout_weight="1"
android:hint="@string/Please_select" android:background="@null"
android:cursorVisible="true"
android:ellipsize="end"
android:hint="@string/PleaseFillInYourCity"
android:singleLine="true"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textColorHint="#B0B0B0" android:textColorHint="#B0B0B0"
android:textCursorDrawable="@null"
android:textSize="13sp" /> android:textSize="13sp" />
<androidx.appcompat.widget.AppCompatSpinner <androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/id_city_select_spinner" android:id="@+id/id_city_select_spinner"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:spinnerMode="dialog" /> android:spinnerMode="dialog"
android:visibility="gone"/>
</LinearLayout> </LinearLayout>
<!--填写省市--> <!--填写省市-->
<LinearLayout <LinearLayout
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="收货地址" android:text="@string/delivery_address"
android:textColor="@color/color_333333" android:textColor="@color/color_333333"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_ff2e31_r25" android:background="@drawable/shape_ff2e31_r25"
android:gravity="center" android:gravity="center"
android:text="新增收货地址" android:text="@string/Add"
android:textColor="#FFFFFF" android:textColor="#FFFFFF"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" /> android:textStyle="bold" />
......
...@@ -24,9 +24,8 @@ ...@@ -24,9 +24,8 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerInParent="true"
android:layout_marginTop="196dp" android:src="@drawable/font_4" />
android:src="@drawable/font" />
<FrameLayout <FrameLayout
android:id="@+id/id_activity_splash_ad_layout" android:id="@+id/id_activity_splash_ad_layout"
...@@ -37,13 +36,14 @@ ...@@ -37,13 +36,14 @@
<RelativeLayout <RelativeLayout
android:id="@+id/id_rl_splash_bottom" android:id="@+id/id_rl_splash_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="130dp" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"> android:layout_alignParentBottom="true"
android:visibility="gone">
<ImageView <ImageView
android:id="@+id/id_img_logo" android:id="@+id/id_img_logo"
android:layout_width="70dp" android:layout_width="wrap_content"
android:layout_height="70dp" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="45dp" android:layout_marginBottom="45dp"
...@@ -61,5 +61,11 @@ ...@@ -61,5 +61,11 @@
android:textSize="18sp" /> android:textSize="18sp" />
</RelativeLayout> </RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:adjustViewBounds="true"
android:src="@drawable/photo" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_rl_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="90dp" android:layout_height="wrap_content"
android:layout_margin="15dp" android:layout_margin="15dp"
android:background="@drawable/shape_ffffff_r5" android:background="@drawable/shape_ffffff_r5"
android:id="@+id/id_rl_item"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView <TextView
android:id="@+id/id_tv_user_address_name" android:id="@+id/id_tv_user_address_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="小明 10090080000" android:text="小明 10090080000"
...@@ -22,38 +31,38 @@ ...@@ -22,38 +31,38 @@
android:id="@+id/id_img_address_moren" android:id="@+id/id_img_address_moren"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_toRightOf="@+id/id_tv_user_address_name"
android:src="@drawable/icon_moren" android:src="@drawable/icon_moren"
android:visibility="gone"/> android:visibility="visible" />
<TextView <TextView
android:id="@+id/id_tv_user_address" android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_weight="1" />
android:layout_marginLeft="15dp"
android:layout_marginRight="50dp"
android:layout_marginBottom="15dp"
android:ellipsize="end"
android:lines="1"
android:text="北京市-东城区东直门街道东直门大…"
android:textColor="@color/color_333333"
android:textSize="15sp" />
<ImageView <ImageView
android:id="@+id/id_img_del" android:id="@+id/id_img_del"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/icon_shanchu"
android:layout_toLeftOf="@+id/id_img_bianji"
android:paddingRight="15dp" android:paddingRight="15dp"
android:layout_centerVertical="true"/> android:src="@drawable/icon_shanchu" />
<ImageView <ImageView
android:id="@+id/id_img_bianji" android:id="@+id/id_img_bianji"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:paddingRight="15dp"
android:src="@drawable/icon_bianji" /> android:src="@drawable/icon_bianji" />
</RelativeLayout> </LinearLayout>
<TextView
android:id="@+id/id_tv_user_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="15dp"
android:text="北京市-东城区东直门街道东直门大…"
android:textColor="@color/color_333333"
android:textSize="15sp" />
</LinearLayout>
...@@ -20,7 +20,9 @@ import com.zxhl.cms.net.SettingPreference ...@@ -20,7 +20,9 @@ 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.box.AppInEntity
import com.zxhl.cms.net.model.box.HomeBoxListEntity import com.zxhl.cms.net.model.box.HomeBoxListEntity
import com.zxhl.cms.net.model.other.IsWeChatLoginEntity
import com.zxhl.cms.utils.* import com.zxhl.cms.utils.*
import com.zxhl.cms.widget.IsLoginCallBack
import com.zxhl.uc.R import com.zxhl.uc.R
import kotlinx.android.synthetic.main.fragment_user_center.* import kotlinx.android.synthetic.main.fragment_user_center.*
import kotlinx.android.synthetic.main.layout_recommend.* import kotlinx.android.synthetic.main.layout_recommend.*
...@@ -28,29 +30,80 @@ import kotlinx.android.synthetic.main.layout_recommend.* ...@@ -28,29 +30,80 @@ import kotlinx.android.synthetic.main.layout_recommend.*
/** /**
* Created by gaoleichao on 2019/3/12 * Created by gaoleichao on 2019/3/12
*/ */
class UserCenterFragment : BaseFragment(), AdCallback<String> { class UserCenterFragment : BaseFragment(), AdCallback<String>, WeChatLoginSuccessCallBall {
override fun layoutID(): Int = R.layout.fragment_layout_new_usercenter override fun layoutID(): Int = R.layout.fragment_layout_new_usercenter
private var mAdapter: RecomendAdapter? = null private var mAdapter: RecomendAdapter? = null
private var wechatutil: WeChatUtils? = null
override fun init(view: View?) { override fun init(view: View?) {
mAdapter = RecomendAdapter(mActivity) mAdapter = RecomendAdapter(mActivity)
wechatutil = WeChatUtils(mActivity, this)
id_rl_tuijian_box?.layoutManager = GridLayoutManager(mActivity, 2) id_rl_tuijian_box?.layoutManager = GridLayoutManager(mActivity, 2)
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>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
JumpUtils.ReceiveAddressReslutJump("0") JumpUtils.ReceiveAddressReslutJump("0")
} }
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
id_ll_my_coin?.setOnClickListener { id_ll_my_coin?.setOnClickListener {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
JumpUtils.payJump("0", "0", "0") JumpUtils.payJump("0", "0", "0")
} }
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
id_rl_logistics?.setOnClickListener { id_rl_logistics?.setOnClickListener {
JumpUtils.LogisticsJump() JumpUtils.LogisticsJump()
} }
id_rl_jiyijan?.setOnClickListener { id_rl_jiyijan?.setOnClickListener {
JumpUtils.webJump(mActivity.getString(R.string.customer_service), NetConfig.H5.WEB_URL_CUSTOMER_SERVICE) wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
JumpUtils.webJump(
mActivity.getString(R.string.customer_service),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
)
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
} }
id_rl_lianxikefu?.setOnClickListener { id_rl_lianxikefu?.setOnClickListener {
JumpUtils.webJump(mActivity.getString(R.string.customerservice), NetConfig.H5.WEB_URL_CUSTOMER_SERVICE) JumpUtils.webJump(
mActivity.getString(R.string.customerservice),
NetConfig.H5.WEB_URL_CUSTOMER_SERVICE
)
} }
id_rl_about_us?.setOnClickListener { id_rl_about_us?.setOnClickListener {
JumpUtils.webJump(mActivity.getString(R.string.about_us), NetConfig.H5.WEB_URL_ABOUT_US) JumpUtils.webJump(mActivity.getString(R.string.about_us), NetConfig.H5.WEB_URL_ABOUT_US)
...@@ -72,12 +125,40 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -72,12 +125,40 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
// } // }
id_ll_my_magic_coin?.setOnClickListener { id_ll_my_magic_coin?.setOnClickListener {
//我的魔币 //我的魔币
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
JumpUtils.MyMagicCoinJump() JumpUtils.MyMagicCoinJump()
} }
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
id_rl_my_order?.setOnClickListener { id_rl_my_order?.setOnClickListener {
//我的订单 //我的订单
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("0")){
JumpUtils.ThirdPardLoginJump()
}else{
JumpUtils.MyOrderJump() JumpUtils.MyOrderJump()
} }
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
} }
...@@ -114,6 +195,21 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -114,6 +195,21 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
} }
} }
fun isLogin() {
wechatutil?.isWechatLogin(object :IsLoginCallBack<IsWeChatLoginEntity>{
override fun onResult(result: IsWeChatLoginEntity?) {
if(result?.status.equals("1")){
}
}
override fun onError(code: String?, errorMsg: String?) {
}
})
}
private fun updateView() { private fun updateView() {
val user = SettingPreference.getUserInfoData() val user = SettingPreference.getUserInfoData()
if (user == null) { if (user == null) {
...@@ -255,4 +351,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> { ...@@ -255,4 +351,8 @@ class UserCenterFragment : BaseFragment(), AdCallback<String> {
} }
}) })
} }
override fun loginSuccess(lottery: String?) {
}
} }
\ No newline at end of file
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