Commit e275670d by 刘鹏

feat: 添加提现账号功能删除银行卡的方式

parent a3c6a9df
ext {
dev_mode = false //组件发布的时候需要设置为false
ydl2PublishVersion = "0.2.0.7"
dev_mode = true //组件发布的时候需要设置为false
ydl2PublishVersion = "0.2.0.7-SNAPSHOT"
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
......
......@@ -35,7 +35,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
......
......@@ -157,10 +157,10 @@
android:name=".mine.EditAccountActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<!--添加提现账号-->
<activity
android:name=".mine.AddAccountActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
android:screenOrientation="portrait" />
<activity
android:name=".mine.RechargeResultActivity"
android:screenOrientation="portrait"
......
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import android.view.View
import com.ydl.ydlcommon.adapter.FragmentWithTabPagerAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.view.widgets.TopTabSelectLayout
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.fragment.AddAliAccountFragment
import com.yidianling.user.mine.fragment.AddBankAccountFragment
import com.yidianling.user.databinding.UserMineActivityAddAccountBinding
import com.yidianling.user.mine.bean.AddAccountCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.user_mine_activity_add_account.*
/**
* 添加提现帐号
*/
class AddAccountActivity : BaseActivity() {
* @author liupeng
* 添加提现账号
* */
class AddAccountActivity : AppCompatActivity() {
private lateinit var binding: UserMineActivityAddAccountBinding
companion object {
fun startForResult(activity: Activity, request: Int) {
......@@ -26,47 +34,51 @@ class AddAccountActivity : BaseActivity() {
}
}
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, true)
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_add_account
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.user_mine_activity_add_account)
btn_ensure.setOnClickListener {
saveAccount()
}
}
override fun initDataAndEvent() {
var titles = mutableListOf<String>()
titles.add("支付宝")
titles.add("银行卡")
var fragments = mutableListOf<Fragment>()
fragments.add(AddAliAccountFragment())
fragments.add(AddBankAccountFragment())
var adapter = FragmentWithTabPagerAdapter(supportFragmentManager, titles, fragments)
top_layout.setButtonTitle("支付宝", "银行卡")
top_layout.setSelectIndex(0)
top_layout.setLineViewVisible(View.GONE)
top_layout.setOnSelectTabClickListener(object : TopTabSelectLayout.OnSelectTabClickListener {
override fun selectTabClickListener(index: Int) {
viewpager.currentItem = index
}
override fun onReturnClickListener() {
}
})
viewpager.currentItem = 0
viewpager.adapter = adapter
viewpager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) {
top_layout.setSelectIndex(position)
}
override fun onPageScrollStateChanged(state: Int) {
/**
* 保存支付宝帐号
*/
@SuppressLint("CheckResult")
private fun saveAccount() {
var account = et_account.text.trim().toString()
if (TextUtils.isEmpty(account)) {
ToastUtil.toastShort("支付宝帐号不能为空")
return
}
var name = et_name.text.trim().toString()
if (TextUtils.isEmpty(name)) {
ToastUtil.toastShort("姓名不能为空")
return
}
}
})
var param = AddAccountCmd(name, account, "1")
AppDataManager.getHttp().addAccount(param)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it == null) {
ToastUtil.toastShort("返回数据错误")
} else {
ToastUtil.toastShort("添加帐号成功")
var intent = Intent()
TransferCacheUtils.putTransferData(
ChooseAccountActivity.ADD_ACCOUNT_REQUEST_CODE,
it
)
setResult(Activity.RESULT_OK, intent)
finish()
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
ToastUtil.toastShort(msg)
}
})
}
}
}
\ No newline at end of file
package com.yidianling.user.mine.fragment
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.text.TextUtils
import com.yidianling.user.mine.ChooseAccountActivity
import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.bean.AddAccountCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.user_mine_fragment_add_ali_account.*
/**
* 添加支付宝帐号
*/
class AddAliAccountFragment : BaseFragment() {
override fun layoutResId(): Int {
return R.layout.user_mine_fragment_add_ali_account
}
override fun initDataAndEvent() {
btn_ensure.setOnClickListener {
saveAccount()
}
}
/**
* 保存支付宝帐号
*/
@SuppressLint("CheckResult")
private fun saveAccount() {
var account = et_account.text.trim().toString()
if (TextUtils.isEmpty(account)) {
ToastUtil.toastShort("支付宝帐号不能为空")
return
}
var name = et_name.text.trim().toString()
if (TextUtils.isEmpty(name)) {
ToastUtil.toastShort("姓名不能为空")
return
}
var param = AddAccountCmd(name, account, "1")
// showProgressDialog("")
AppDataManager.getHttp().addAccount(param)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
// dismissProgressDialog()
if (it == null) {
ToastUtil.toastShort("返回数据错误")
} else {
ToastUtil.toastShort("添加帐号成功")
var intent = Intent()
TransferCacheUtils.putTransferData(ChooseAccountActivity.ADD_ACCOUNT_REQUEST_CODE, it)
activity!!.setResult(Activity.RESULT_OK, intent)
activity!!.finish()
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
// dismissProgressDialog()
ToastUtil.toastShort(msg)
}
})
}
override fun initDataAndEventLazy() {
}
}
package com.yidianling.user.mine.fragment
import com.ydl.ydlcommon.base.BaseFragment
import com.yidianling.user.R
/**
* 添加银行卡(后续会增加添加银行卡功能,做成独立页面)
*/
class AddBankAccountFragment : BaseFragment() {
override fun layoutResId(): Int {
return R.layout.user_mine_fragment_add_bank_account
}
override fun initDataAndEvent() {
}
override fun initDataAndEventLazy() {
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.yidianling.user.mine.AddAccountActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_common_back"
android:background="@color/platform_white"
app:pa_title_text="添加提现帐号" />
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<View
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5" />
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_common_back"
android:background="@color/platform_white"
app:pa_title_text="添加提现帐号" />
<com.ydl.ydlcommon.view.widgets.TopTabSelectLayout
android:id="@+id/top_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5" />
<androidx.viewpager.widget.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View style="@style/platform_viewline" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="支付宝帐号"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:inputType="textEmailAddress"
android:hint="请输入您的支付宝帐号"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View
style="@style/platform_viewline"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="姓名"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:hint="请输入您的姓名"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View style="@style/platform_viewline" />
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="28dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="@color/platform_main_theme"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
</LinearLayout>
</layout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.yidianling.user.mine.fragment.AddAliAccountFragment">
<View style="@style/platform_viewline" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="支付宝帐号"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:inputType="textEmailAddress"
android:hint="请输入您的支付宝帐号"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View
style="@style/platform_viewline"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="姓名"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:hint="请输入您的姓名"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View style="@style/platform_viewline" />
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="28dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="@color/platform_main_theme"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.yidianling.user.mine.fragment.AddBankAccountFragment">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:src="@drawable/user_mine_img_yhk" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="26dp"
android:text="近期会持续开通提现到银行卡,敬请期待......"
android:textColor="@color/platform_color_999999"
android:textSize="15sp" />
</LinearLayout>
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