Commit c4b96a04 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :加入loading
[实现方案] :
parent a2b2d52c
PACKAGE_NAME=com.zhangxin.magicbox
VERSION_CODE=11
VERSION_NAME=1.0.3.3
\ No newline at end of file
VERSION_CODE=12
VERSION_NAME=1.0.3.4
\ No newline at end of file
......@@ -232,7 +232,7 @@ public class NetConfig {
public static final String HOME_BOX_LOTTERY_TEST = "app/v1/game/box/lotteryTest";//盲盒抽取 - 试玩(单抽)
public static final String HOME_BOX_ORDER = "app/v1/game/box/order";//用户订单
public static final String HOME_BOX_RECOVER = "app/v2/game/box/recover";//回收物品
public static final String HOME_BOX_SHIPPING = "app/v3/game/box/getShipping";//用户仓库 - 获取运费
public static final String HOME_BOX_SHIPPING = "app/v5/game/box/getShipping";//用户仓库 - 获取运费
public static final String HOME_BOX_SHOP_COST = "app/v4/game/box/getShipping";//用户仓库 - 商城购买获取费用
public static final String HOME_BOX_CREATE_SHAOPPING_ORDER = "app/v1/game/box/createShippingOrder";//创建发货订单
public static final String HOME_BOX_SHOP_BUY_ONLY = "app/v1/game/box/shopBuyOnly";//创建购买商城物品订单
......
......@@ -144,7 +144,7 @@
<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_phone_number">Please fill in your phone number</string>
<string name="Please_fill_in_your_first_name">Please fill in your first name/last name/…</string>
<string name="Please_fill_in_your_first_name">Please fill in your name</string>
<string name="Add">Add</string>
</resources>
......@@ -116,16 +116,24 @@ class EditAddressActivity : BaseActivity(), EditAddressContract.View {
//
// }
id_tv_save_address?.setOnClickListener {
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_select_city.text.toString()
) || TextUtils.isEmpty(id_select_country.text.toString()) || TextUtils.isEmpty(
id_edit_province.text.toString()
if (TextUtils.isEmpty(id_edit_name.text.toString())) {
Utils.showToast(
AppContext.get(),
getString(R.string.Please_fill_in_your_first_name)
)
) {
// Utils.showToast(AppContext.get(), "请完整填写信息")
return@setOnClickListener
} else if (TextUtils.isEmpty(id_edit_phone.text.toString())) {
Utils.showToast(
AppContext.get(),
getString(R.string.Please_fill_in_your_phone_number)
)
} else if (TextUtils.isEmpty(id_edit_address1.text.toString())) {
Utils.showToast(AppContext.get(), getString(R.string.Please_fill_in_your_address1))
} else if (TextUtils.isEmpty(id_select_country.text.toString())) {
Utils.showToast(AppContext.get(), getString(R.string.Please_select))
} else if (TextUtils.isEmpty(id_select_city.text.toString())) {
Utils.showToast(AppContext.get(), getString(R.string.PleaseFillInYourCity))
} else if (TextUtils.isEmpty(id_edit_province.text.toString())) {
Utils.showToast(AppContext.get(), getString(R.string.PleaseFillInYourProvince))
} else {
// if (id_edit_phone.text.toString()?.length != 11) {
//// Utils.showToast(AppContext.get(), "请检查手机号码")
......
......@@ -438,10 +438,10 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
private fun showResultLoading(isPaySuc: Boolean) {
if (isPaySuc) {
EventUtils.onEvent("pay_suc")
mLoading?.setResult(true, "支付成功", 1000)
mLoading?.setResult(true, "Pay for success", 1000)
} else {
EventUtils.onEvent("pay_fail")
mLoading?.setResult(false, "支付失败", 1000)
mLoading?.setResult(false, "Pay for failure", 1000)
}
}
......@@ -455,7 +455,7 @@ class NewBoxGoodsDetailActivity : BaseActivity(), GoodsDetailContract.View,
}
override fun requestOrderSuc() {
mLoading?.setLoading("正在支付")
mLoading?.setLoading("Is pay")
}
override fun verifyOrderSuc(orsder: String) {
......
......@@ -50,14 +50,16 @@ class SplashActivity : BaseActivity(), SplashContract.View {
mPresenter = SplashPresenter(this@SplashActivity, this@SplashActivity)
initListener()
} else {
CenterDialog.showPrivacyProtocol(this, object : View.OnClickListener {
override fun onClick(p0: View?) {
SettingPreference.setFirstApp()
mPresenter = SplashPresenter(this@SplashActivity, this@SplashActivity)
initListener()
}
})
// CenterDialog.showPrivacyProtocol(this, object : View.OnClickListener {
// override fun onClick(p0: View?) {
// SettingPreference.setFirstApp()
// mPresenter = SplashPresenter(this@SplashActivity, this@SplashActivity)
// initListener()
// }
// })
SettingPreference.setFirstApp()
mPresenter = SplashPresenter(this@SplashActivity, this@SplashActivity)
initListener()
}
} else {
......
......@@ -23,10 +23,13 @@ class OrderAdapter : BaseRecyclerAdapter<GoodList, OrderAdapter.ViewHolder> {
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
var bean = mList[position]
holder?.item_order_img?.setLoadImageUrl(bean.mainImage, false)
holder?.item_order_name?.text = bean.productName
holder?.item_order_num?.text = "x ${bean.amount}"
holder?.id_tv_sale_price?.text="$ ${bean.salePriceStr}"
if(bean!=null){
holder?.item_order_img?.setLoadImageUrl(bean.mainImage?:"", false)
holder?.item_order_name?.text = bean.productName?:""
holder?.item_order_num?.text = "x ${bean.amount}"
holder?.id_tv_sale_price?.text="$ ${bean.salePriceStr}"
}
}
......
......@@ -19,6 +19,7 @@ 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
......@@ -30,6 +31,7 @@ import com.zxhl.main.page.presenter.LotteryPresenter
* @detail :
*/
object BoxResultDialog : LotteryContract.View {
private var mLotteryLoading: LoadingDialog? = null
private var mPresenter: LotteryPresenter = LotteryPresenter(this);
private var mActivity: Activity? = null
private var boxId: String = ""
......@@ -37,6 +39,7 @@ object BoxResultDialog : LotteryContract.View {
private var fivePrice: Double = 0.0
private var mRePumpingCardNum = 0//重抽卡数量
private var dialogDismissCallback: DialogDismissCallback? = null
fun setDialogDismissCallback(callback: DialogDismissCallback?) {
this.dialogDismissCallback = callback
}
......@@ -76,6 +79,7 @@ object BoxResultDialog : LotteryContract.View {
JumpUtils.payJump(boxId, (fivePrice - ownCoin).toString(), Constant.Key.FIVE_LOTTERY)
return
}
showLoading(mActivity)
this.mActivity = mActivity
this.boxId = boxId
this.onePrice = onePrice
......@@ -105,6 +109,7 @@ object BoxResultDialog : LotteryContract.View {
JumpUtils.payJump(boxId, (onePrice - ownCoin).toString(), Constant.Key.FIVE_LOTTERY)
return
}
showLoading(mActivity)
this.mActivity = mActivity
this.boxId = boxId
this.onePrice = onePrice
......@@ -121,6 +126,7 @@ object BoxResultDialog : LotteryContract.View {
if (boxId == "" || fivePrice == 0.0) {
return
}
showLoading(mActivity)
mRePumpingCardNum = cardNum
this.mActivity = mActivity
this.boxId = boxId
......@@ -139,6 +145,7 @@ object BoxResultDialog : LotteryContract.View {
desc1: String,
desc2: String
) {
dismissLoading()
if (mDialog == null) {
mDialog = Dialog(mActivity, R.style.CenterCompatDialogTheme)
}
......@@ -190,7 +197,7 @@ object BoxResultDialog : LotteryContract.View {
depotIds.append(dataBean.depotId)
recovertList.add(dataBean.recoverPriceStr?.toDoubleOrNull()!!)
}
var recoverprice = recovertList.sum()
var recoverprice = recovertList.sum()
//
if (desc1 == "") {
resultDesc1.visibility = View.GONE
......@@ -292,11 +299,18 @@ object BoxResultDialog : LotteryContract.View {
//回收
resultRecover.setOnClickListener {
EventUtils.onEvent("RecoverClick")
RecycleDialog.showRecycleDialog(mActivity,depotIds.toString(),"3",recoverprice.toString(), Constant.Switch.recoverType,null,object :PopupWidowCloseCallBack{
override fun onClosePopupWindow() {
mDialog?.dismiss()
}
})
RecycleDialog.showRecycleDialog(
mActivity,
depotIds.toString(),
"3",
recoverprice.toString(),
Constant.Switch.recoverType,
null,
object : PopupWidowCloseCallBack {
override fun onClosePopupWindow() {
mDialog?.dismiss()
}
})
}
mDialog?.setOnDismissListener {
mDialog = null
......@@ -393,5 +407,24 @@ object BoxResultDialog : LotteryContract.View {
}
private fun showLoading(content: Activity) {
if (mLotteryLoading == null) {
mLotteryLoading = LoadingDialog.getLoadingDialog(
content,
content.getString(R.string.wait_ing),
false,
false
)
}
mLotteryLoading?.setLoading(content.getString(R.string.wait_ing))
mLotteryLoading?.show()
}
private fun dismissLoading() {
if (mLotteryLoading != null) {
mLotteryLoading?.dismiss()
}
}
}
\ 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