Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lify
RvApp
Commits
c59fc4ce
Commit
c59fc4ce
authored
Jul 12, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改出游人选择的问题
parent
609af8d7
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
459 additions
and
225 deletions
+459
-225
StringUtils.java
...ils/src/main/java/com/rv/component/utils/StringUtils.java
+21
-0
TravelerListAdapter.java
.../main/java/com/rv/rvmine/adapter/TravelerListAdapter.java
+52
-26
AddTraveler.java
...le_mine/src/main/java/com/rv/rvmine/bean/AddTraveler.java
+68
-0
TravelerListBean.java
...ne/src/main/java/com/rv/rvmine/bean/TravelerListBean.java
+12
-2
AddAVisitorActivity.java
...main/java/com/rv/rvmine/traveler/AddAVisitorActivity.java
+11
-74
ChooseAVisitorActivity.java
...n/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
+155
-47
activity_choose_avisitor.xml
module_mine/src/main/res/layout/activity_choose_avisitor.xml
+38
-2
rv_item_traveler_list.xml
module_mine/src/main/res/layout/rv_item_traveler_list.xml
+82
-67
TravelerConfirmOrderActivity.java
...va/com/rv/tourism/other/TravelerConfirmOrderActivity.java
+20
-7
No files found.
component_utils/src/main/java/com/rv/component/utils/StringUtils.java
0 → 100644
View file @
c59fc4ce
package
com
.
rv
.
component
.
utils
;
import
android.text.TextUtils
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.PatternSyntaxException
;
public
class
StringUtils
{
public
static
boolean
isChinaPhone
(
String
str
)
throws
PatternSyntaxException
{
if
(
TextUtils
.
isEmpty
(
str
))
{
return
false
;
}
String
regExp
=
"^1(3[0-9]|4[57]|5[0-35-9]|8[0-9]|70)\\d{8}$"
;
Pattern
p
=
Pattern
.
compile
(
regExp
);
Matcher
m
=
p
.
matcher
(
str
);
return
m
.
matches
();
}
}
module_mine/src/main/java/com/rv/rvmine/adapter/TravelerListAdapter.java
View file @
c59fc4ce
...
@@ -3,6 +3,7 @@ package com.rv.rvmine.adapter;
...
@@ -3,6 +3,7 @@ package com.rv.rvmine.adapter;
import
android.view.View
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
import
android.widget.Toast
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
...
@@ -17,27 +18,23 @@ import java.util.List;
...
@@ -17,27 +18,23 @@ import java.util.List;
*/
*/
public
class
TravelerListAdapter
extends
BaseQuickAdapter
<
TravelerListBean
.
DataBean
,
BaseViewHolder
>
{
public
class
TravelerListAdapter
extends
BaseQuickAdapter
<
TravelerListBean
.
DataBean
,
BaseViewHolder
>
{
// private TravelerListBean.DataBean hasSelectBean = null;
private
int
openType
;
private
int
openType
;
private
SelectListener
mListener
=
null
;
public
TravelerListAdapter
(
int
openType
)
{
public
TravelerListAdapter
(
int
openType
,
SelectListener
listener
)
{
super
(
R
.
layout
.
rv_item_traveler_list
);
super
(
R
.
layout
.
rv_item_traveler_list
);
this
.
openType
=
openType
;
this
.
openType
=
openType
;
this
.
mListener
=
listener
;
}
}
@Override
@Override
protected
void
convert
(
final
BaseViewHolder
helper
,
final
TravelerListBean
.
DataBean
item
)
{
protected
void
convert
(
final
BaseViewHolder
helper
,
final
TravelerListBean
.
DataBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getName
());
helper
.
setText
(
R
.
id
.
tv_name
,
item
.
getName
());
helper
.
setText
(
R
.
id
.
tv_phone
,
item
.
getPhone
());
helper
.
setText
(
R
.
id
.
tv_phone
,
item
.
getPhone
());
helper
.
setText
(
R
.
id
.
tv_travel_type
,
item
.
getIsChild
()
==
0
?
"(成人)"
:
"(儿童)"
);
helper
.
setText
(
R
.
id
.
tv_id_card
,
item
.
getIdCard
());
helper
.
setText
(
R
.
id
.
tv_id_card
,
item
.
getIdCard
());
// if (hasSelectBean == null || hasSelectBean != item) {
// helper.setChecked(R.id.cb_draveler, false);
// } else {
// helper.setChecked(R.id.cb_draveler, true);
// }
helper
.
addOnClickListener
(
R
.
id
.
tv_edit
);
helper
.
addOnClickListener
(
R
.
id
.
tv_edit
);
if
(
openType
==
0
)
{
if
(
openType
==
0
)
{
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
).
setVisibility
(
View
.
GONE
);
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
).
setVisibility
(
View
.
GONE
);
}
else
{
}
else
{
...
@@ -46,23 +43,43 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
...
@@ -46,23 +43,43 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
}
else
{
}
else
{
helper
.
setChecked
(
R
.
id
.
cb_draveler
,
false
);
helper
.
setChecked
(
R
.
id
.
cb_draveler
,
false
);
}
}
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
).
setEnabled
(
false
);
// helper.setOnCheckedChangeListener(R.id.cb_draveler, new CompoundButton.OnCheckedChangeListener() {
helper
.
setOnCheckedChangeListener
(
R
.
id
.
cb_draveler
,
new
CompoundButton
.
OnCheckedChangeListener
()
{
// @Override
@Override
// public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
//
boolean
status
=
item
.
getStatus
();
boolean
result
=
false
;
if
(
mListener
!=
null
)
{
result
=
mListener
.
select
(
item
,
status
?
0
:
1
);
}
if
(
result
)
{
// 动作成功
status
=
!
status
;
item
.
setStatus
(
status
);
}
else
{
mListener
.
showError
();
}
((
CheckBox
)
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
)).
setChecked
(
status
);
}
});
helper
.
itemView
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
// ((CheckBox)helper.itemView.findViewById(R.id.cb_draveler)).setChecked(item.getStatus());
// boolean status = item.getStatus();
// boolean status = item.getStatus();
// boolean result = false;
// if (mListener != null) {
// result = mListener.select(item, status ? 0 : 1);
// }
// if (result) { // 动作成功
// status = !status;
// status = !status;
// ((CheckBox) helper.itemView.findViewById(R.id.cb_draveler)).setChecked(status);
// item.setStatus(status);
// item.setStatus(status);
// if (status) {
// hasSelectBean = item;
// } else {
// } else {
//
hasSelectBean = null
;
//
mListener.showError()
;
// }
// }
//// notifyDataSetChanged(
);
((
CheckBox
)
helper
.
itemView
.
findViewById
(
R
.
id
.
cb_draveler
)).
setChecked
(!
item
.
getStatus
()
);
//
}
}
//
});
});
}
}
}
}
...
@@ -70,10 +87,6 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
...
@@ -70,10 +87,6 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
return
mData
.
indexOf
(
item
);
return
mData
.
indexOf
(
item
);
}
}
// public TravelerListBean.DataBean getHasSelectBean() {
// return hasSelectBean;
// }
/**
/**
* 获取选中的出游人数据
* 获取选中的出游人数据
*
*
...
@@ -89,4 +102,17 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
...
@@ -89,4 +102,17 @@ public class TravelerListAdapter extends BaseQuickAdapter<TravelerListBean.DataB
return
list
;
return
list
;
}
}
public
interface
SelectListener
{
/*****
*
* @param bean
* @param action 0 取消选中;1 选中
* @return
*/
boolean
select
(
TravelerListBean
.
DataBean
bean
,
int
action
);
void
showError
();
}
}
}
module_mine/src/main/java/com/rv/rvmine/bean/AddTraveler.java
0 → 100644
View file @
c59fc4ce
package
com
.
rv
.
rvmine
.
bean
;
public
class
AddTraveler
{
private
Integer
id
;
private
String
name
;
private
Integer
sex
;
//1男 0女
private
String
phone
;
private
String
idCard
;
private
Integer
isChild
;
public
AddTraveler
(
Integer
id
,
String
name
,
Integer
sex
,
String
phone
,
String
idCard
,
Integer
isChild
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
sex
=
sex
;
this
.
phone
=
phone
;
this
.
idCard
=
idCard
;
this
.
isChild
=
isChild
;
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getIdCard
()
{
return
idCard
;
}
public
void
setIdCard
(
String
idCard
)
{
this
.
idCard
=
idCard
;
}
public
Integer
getIsChild
()
{
return
isChild
;
}
public
void
setIsChild
(
Integer
isChild
)
{
this
.
isChild
=
isChild
;
}
}
module_mine/src/main/java/com/rv/rvmine/bean/TravelerListBean.java
View file @
c59fc4ce
package
com
.
rv
.
rvmine
.
bean
;
package
com
.
rv
.
rvmine
.
bean
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -9,7 +10,7 @@ import java.util.List;
...
@@ -9,7 +10,7 @@ import java.util.List;
* Desc:出游人列表
* Desc:出游人列表
*/
*/
public
class
TravelerListBean
extends
BaseBean
implements
Serializable
{
public
class
TravelerListBean
extends
BaseBean
implements
Serializable
{
private
List
<
DataBean
>
data
;
private
List
<
DataBean
>
data
;
private
int
code
;
private
int
code
;
...
@@ -30,7 +31,7 @@ public class TravelerListBean extends BaseBean implements Serializable{
...
@@ -30,7 +31,7 @@ public class TravelerListBean extends BaseBean implements Serializable{
this
.
code
=
code
;
this
.
code
=
code
;
}
}
public
static
class
DataBean
implements
Serializable
{
public
static
class
DataBean
implements
Serializable
,
Comparable
<
DataBean
>
{
private
Integer
id
;
//": 5,
private
Integer
id
;
//": 5,
private
String
userid
;
//": 14,
private
String
userid
;
//": 14,
...
@@ -43,6 +44,7 @@ public class TravelerListBean extends BaseBean implements Serializable{
...
@@ -43,6 +44,7 @@ public class TravelerListBean extends BaseBean implements Serializable{
private
String
isdel
;
//": 0,
private
String
isdel
;
//": 0,
private
Integer
isChild
;
//": 1
private
Integer
isChild
;
//": 1
private
boolean
status
=
false
;
// 默认不选中
private
boolean
status
=
false
;
// 默认不选中
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -130,5 +132,13 @@ public class TravelerListBean extends BaseBean implements Serializable{
...
@@ -130,5 +132,13 @@ public class TravelerListBean extends BaseBean implements Serializable{
public
void
setStatus
(
boolean
status
)
{
public
void
setStatus
(
boolean
status
)
{
this
.
status
=
status
;
this
.
status
=
status
;
}
}
@Override
public
int
compareTo
(
DataBean
o
)
{
if
(!
TextUtil
.
isEmpty
(
this
.
idCard
)
&&
this
.
idCard
.
equals
(
o
.
idCard
))
{
return
0
;
}
return
-
1
;
}
}
}
}
}
module_mine/src/main/java/com/rv/rvmine/traveler/AddAVisitorActivity.java
View file @
c59fc4ce
...
@@ -13,15 +13,18 @@ import com.frame.rv.config.RvFrameConfig;
...
@@ -13,15 +13,18 @@ import com.frame.rv.config.RvFrameConfig;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.StringUtils
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.rvmine.R
;
import
com.rv.rvmine.R
;
import
com.rv.rvmine.R2
;
import
com.rv.rvmine.R2
;
import
com.rv.rvmine.bean.AddTraveler
;
import
com.rv.rvmine.bean.TravelerListBean
;
import
com.rv.rvmine.bean.TravelerListBean
;
import
com.yuyife.okgo.OkGoUtil
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.regex.PatternSyntaxException
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
...
@@ -31,7 +34,6 @@ import butterknife.OnClick;
...
@@ -31,7 +34,6 @@ import butterknife.OnClick;
*/
*/
public
class
AddAVisitorActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
public
class
AddAVisitorActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
@BindView
(
R2
.
id
.
cb_adult
)
@BindView
(
R2
.
id
.
cb_adult
)
CheckBox
cbAdult
;
CheckBox
cbAdult
;
@BindView
(
R2
.
id
.
cb_child
)
@BindView
(
R2
.
id
.
cb_child
)
...
@@ -75,7 +77,6 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -75,7 +77,6 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
cbAdult
.
setChecked
(
false
);
cbAdult
.
setChecked
(
false
);
cbChild
.
setChecked
(
true
);
cbChild
.
setChecked
(
true
);
}
}
if
(
0
==
dataBean
.
getSex
())
{
if
(
0
==
dataBean
.
getSex
())
{
cbMan
.
setChecked
(
false
);
cbMan
.
setChecked
(
false
);
cbGirl
.
setChecked
(
true
);
cbGirl
.
setChecked
(
true
);
...
@@ -103,15 +104,16 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -103,15 +104,16 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
}
}
String
idCard
=
null
,
phone
=
null
;
String
idCard
=
null
,
phone
=
null
;
idCard
=
etIdCard
.
getText
().
toString
().
trim
();
idCard
=
etIdCard
.
getText
().
toString
().
trim
();
if
(
TextUtil
.
isEmpty
(
idCard
))
{
if
(
TextUtil
.
isEmpty
(
idCard
)
||
idCard
.
length
()
!=
18
)
{
showToast
(
"
身份证号不能为空
!"
);
showToast
(
"
请输入正确的身份证号码
!"
);
return
;
return
;
}
}
if
(
identityType
==
0
)
{
if
(
identityType
==
0
)
{
phone
=
etPhone
.
getText
().
toString
().
trim
();
phone
=
etPhone
.
getText
().
toString
().
trim
();
if
(
TextUtil
.
isEmpty
(
phone
))
{
showToast
(
"手机号码不能为空!"
);
if
(!
StringUtils
.
isChinaPhone
(
phone
))
{
showToast
(
"请输入正确的手机号码!"
);
return
;
return
;
}
}
}
}
...
@@ -120,8 +122,10 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -120,8 +122,10 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
});
});
}
}
@Override
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
TravelerListBean
.
DataBean
addBean
=
new
TravelerListBean
.
DataBean
();
setResult
(
RESULT_OK
);
setResult
(
RESULT_OK
);
finish
();
finish
();
}
}
...
@@ -162,7 +166,7 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -162,7 +166,7 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
*/
*/
private
void
addAVisitor
(
String
name
,
String
idCard
,
String
phone
)
{
private
void
addAVisitor
(
String
name
,
String
idCard
,
String
phone
)
{
mPresenter
.
postBodyData
(
RvFrameConfig
.
VEHICLE_TOURUSER
,
0
,
ApiConfig
.
HTTP_URL_ADDANDUPDATE
,
BaseBean
.
class
,
new
a
ddTraveler
(
avisitorId
==
0
?
null
:
avisitorId
,
name
,
sexType
,
phone
,
idCard
,
identityType
),
getHeadMap
(),
true
);
mPresenter
.
postBodyData
(
RvFrameConfig
.
VEHICLE_TOURUSER
,
0
,
ApiConfig
.
HTTP_URL_ADDANDUPDATE
,
BaseBean
.
class
,
new
A
ddTraveler
(
avisitorId
==
0
?
null
:
avisitorId
,
name
,
sexType
,
phone
,
idCard
,
identityType
),
getHeadMap
(),
true
);
}
}
@Override
@Override
...
@@ -179,71 +183,4 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
...
@@ -179,71 +183,4 @@ public class AddAVisitorActivity extends BaseStatusActivity<CommonPresenter> {
return
headMap
;
return
headMap
;
}
}
private
class
addTraveler
{
private
Integer
id
;
private
String
name
;
private
Integer
sex
;
//1男 0女
private
String
phone
;
private
String
idCard
;
private
Integer
isChild
;
public
addTraveler
(
Integer
id
,
String
name
,
Integer
sex
,
String
phone
,
String
idCard
,
Integer
isChild
)
{
this
.
id
=
id
;
this
.
name
=
name
;
this
.
sex
=
sex
;
this
.
phone
=
phone
;
this
.
idCard
=
idCard
;
this
.
isChild
=
isChild
;
}
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
Integer
getSex
()
{
return
sex
;
}
public
void
setSex
(
Integer
sex
)
{
this
.
sex
=
sex
;
}
public
String
getPhone
()
{
return
phone
;
}
public
void
setPhone
(
String
phone
)
{
this
.
phone
=
phone
;
}
public
String
getIdCard
()
{
return
idCard
;
}
public
void
setIdCard
(
String
idCard
)
{
this
.
idCard
=
idCard
;
}
public
Integer
getIsChild
()
{
return
isChild
;
}
public
void
setIsChild
(
Integer
isChild
)
{
this
.
isChild
=
isChild
;
}
}
}
}
module_mine/src/main/java/com/rv/rvmine/traveler/ChooseAVisitorActivity.java
View file @
c59fc4ce
...
@@ -6,16 +6,23 @@ import android.os.Bundle;
...
@@ -6,16 +6,23 @@ import android.os.Bundle;
import
android.os.Parcelable
;
import
android.os.Parcelable
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
android.widget.Toast
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.member.ConsumeRecordActivity
;
import
com.rv.member.MemberCenterActivity
;
import
com.rv.member.PurchaseRecordActivity
;
import
com.rv.rvmine.R2
;
import
com.rv.rvmine.R2
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
...
@@ -32,8 +39,10 @@ import java.util.ArrayList;
...
@@ -32,8 +39,10 @@ import java.util.ArrayList;
import
java.util.LinkedHashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
/**
/**
* 选择出游人
* 选择出游人
...
@@ -43,19 +52,26 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -43,19 +52,26 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
@BindView
(
R2
.
id
.
recyclerView
)
@BindView
(
R2
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
RecyclerView
recyclerView
;
@BindView
(
R2
.
id
.
tv_select_result
)
TextView
tvSelelctResult
;
@BindView
(
R2
.
id
.
btn_confirm
)
Button
btnConfim
;
private
TravelerListAdapter
mAdapter
;
private
TravelerListAdapter
mAdapter
;
private
final
int
TYPE_REQUEST_ADD
=
105
;
private
final
int
TYPE_REQUEST_ADD
=
105
;
private
final
int
TYPE_REQUEST_EDIT
=
2
;
private
final
int
TYPE_REQUEST_EDIT
=
2
;
private
int
mPage
;
private
int
mPage
;
private
int
countPage
;
private
int
countPage
;
private
int
visitorType
;
private
int
openType
;
private
int
openType
;
private
DeletePopupWindow
deletePopupWindow
;
private
DeletePopupWindow
deletePopupWindow
;
private
List
<
TravelerListBean
.
DataBean
>
visitors
=
new
ArrayList
<>();
private
List
<
TravelerListBean
.
DataBean
>
visitors
=
new
ArrayList
<>();
private
TravelerListBean
.
DataBean
deletBean
=
null
;
private
TravelerListBean
.
DataBean
deletBean
=
null
;
private
List
<
TravelerListBean
.
DataBean
>
adults
=
null
;
private
List
<
TravelerListBean
.
DataBean
>
childs
=
null
;
private
String
hasChoIdCards
;
// 传过来的已经选择的身份证
private
String
hasChoIdCards
;
// 传过来的已经选择的身份证
private
int
adultNumber
;
//成人数量
private
int
childBumber
;
// 小孩数量
@Override
@Override
protected
int
setLayout
()
{
protected
int
setLayout
()
{
...
@@ -64,9 +80,22 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -64,9 +80,22 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
@Override
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
visitorType
=
intent
.
getIntExtra
(
"visitorType"
,
-
1
);
openType
=
intent
.
getIntExtra
(
"openType"
,
0
);
openType
=
intent
.
getIntExtra
(
"openType"
,
0
);
if
(
openType
!=
0
)
{
adultNumber
=
intent
.
getIntExtra
(
"adult_number"
,
0
);
childBumber
=
intent
.
getIntExtra
(
"child_number"
,
0
);
if
(
adultNumber
!=
0
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"请选择"
).
append
(
adultNumber
).
append
(
"位成人"
);
if
(
childBumber
>
0
)
{
builder
.
append
(
","
).
append
(
childBumber
).
append
(
"位儿童"
);
}
tvSelelctResult
.
setVisibility
(
View
.
VISIBLE
);
tvSelelctResult
.
setText
(
builder
.
toString
());
}
btnConfim
.
setVisibility
(
View
.
VISIBLE
);
}
hasChoIdCards
=
intent
.
getStringExtra
(
"hasChoice"
);
hasChoIdCards
=
intent
.
getStringExtra
(
"hasChoice"
);
if
(
openType
==
0
)
{
if
(
openType
==
0
)
{
titleView
.
setTitle
(
"出游人"
);
titleView
.
setTitle
(
"出游人"
);
...
@@ -81,31 +110,9 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -81,31 +110,9 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
}
}
});
});
mAdapter
=
new
TravelerListAdapter
(
openType
,
selectListener
);
mAdapter
=
new
TravelerListAdapter
(
openType
);
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
recyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
mActivity
));
recyclerView
.
setAdapter
(
mAdapter
);
recyclerView
.
setAdapter
(
mAdapter
);
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
if
(
openType
!=
-
0
)
{
TravelerListBean
.
DataBean
item
=
mAdapter
.
getItem
(
position
);
if
(
item
.
getStatus
())
{
Toast
.
makeText
(
getApplicationContext
(),
"不可重复添加"
,
Toast
.
LENGTH_SHORT
).
show
();
return
;
}
Intent
intent1
=
getIntent
();
intent1
.
putExtra
(
"name"
,
item
.
getName
());
intent1
.
putExtra
(
"phone"
,
item
.
getPhone
());
intent1
.
putExtra
(
"idcard"
,
item
.
getIdCard
());
intent1
.
putExtra
(
"id"
,
item
.
getId
());
setResult
(
RESULT_OK
,
intent1
);
finish
();
}
}
});
mAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
mAdapter
.
setOnItemChildClickListener
(
new
BaseQuickAdapter
.
OnItemChildClickListener
()
{
@Override
@Override
...
@@ -118,20 +125,20 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -118,20 +125,20 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
mAdapter
.
setOnItemLongClickListener
(
new
BaseQuickAdapter
.
OnItemLongClickListener
()
{
mAdapter
.
setOnItemLongClickListener
(
new
BaseQuickAdapter
.
OnItemLongClickListener
()
{
@Override
@Override
public
boolean
onItemLongClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
public
boolean
onItemLongClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
TravelerListBean
.
DataBean
item
=
mAdapter
.
getItem
(
position
);
deletBean
=
visitors
.
get
(
position
);
showDeletePopupWindow
(
item
,
view
);
showDeletePopupWindow
(
view
);
return
true
;
return
true
;
}
}
});
});
}
}
private
void
showDeletePopupWindow
(
final
TravelerListBean
.
DataBean
item
,
View
view
)
{
private
void
showDeletePopupWindow
(
View
view
)
{
if
(
deletePopupWindow
==
null
)
{
if
(
deletePopupWindow
==
null
)
{
deletePopupWindow
=
new
DeletePopupWindow
(
this
,
new
View
.
OnClickListener
()
{
deletePopupWindow
=
new
DeletePopupWindow
(
this
,
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
view
)
{
public
void
onClick
(
View
view
)
{
deleteDriver
(
item
);
deleteDriver
();
deletePopupWindow
.
dismiss
();
deletePopupWindow
.
dismiss
();
}
}
});
});
...
@@ -142,6 +149,46 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -142,6 +149,46 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
}
}
@OnClick
({
R2
.
id
.
btn_confirm
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
btn_confirm
)
{
if
(
mAdapter
!=
null
)
{
int
remainAdult
=
adultNumber
-
adults
.
size
();
int
remainChild
=
childBumber
-
childs
.
size
();
if
(
remainAdult
!=
0
||
remainChild
!=
0
)
{
showToast
(
"你还有"
+
(
remainAdult
+
remainChild
)
+
"位出游人还未选择"
);
return
;
}
ArrayList
<
String
>
names
=
new
ArrayList
<>();
ArrayList
<
String
>
phones
=
new
ArrayList
<>();
ArrayList
<
String
>
idcards
=
new
ArrayList
<>();
ArrayList
<
String
>
ids
=
new
ArrayList
<>();
for
(
TravelerListBean
.
DataBean
bean
:
adults
)
{
names
.
add
(
bean
.
getName
());
phones
.
add
(
bean
.
getPhone
());
idcards
.
add
(
bean
.
getIdCard
());
ids
.
add
(
bean
.
getId
()
+
""
);
}
for
(
TravelerListBean
.
DataBean
bean
:
childs
)
{
names
.
add
(
bean
.
getName
());
phones
.
add
(
bean
.
getPhone
());
idcards
.
add
(
bean
.
getIdCard
());
ids
.
add
(
bean
.
getId
()
+
""
);
}
Intent
intent1
=
getIntent
();
intent1
.
putStringArrayListExtra
(
"name"
,
names
);
intent1
.
putStringArrayListExtra
(
"phone"
,
phones
);
intent1
.
putStringArrayListExtra
(
"idcard"
,
idcards
);
intent1
.
putStringArrayListExtra
(
"id"
,
ids
);
setResult
(
RESULT_OK
,
intent1
);
finish
();
}
}
}
// @Override
// @Override
// public void finish() {
// public void finish() {
// if (openType != 0) {
// if (openType != 0) {
...
@@ -177,18 +224,20 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -177,18 +224,20 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
if
(
bean
!=
null
)
{
if
(
bean
!=
null
)
{
if
(
bean
.
isRel
())
{
if
(
bean
.
isRel
())
{
if
(
deletBean
!=
null
)
{
if
(
deletBean
!=
null
)
{
if
(
visitors
.
remove
(
deletBean
))
{
int
index
=
visitors
.
indexOf
(
deletBean
);
if
(
index
!=
-
1
)
{
visitors
.
remove
(
index
);
mAdapter
.
notifyDataSetChanged
();
mAdapter
.
notifyDataSetChanged
();
}
}
adults
.
remove
(
deletBean
);
childs
.
remove
(
deletBean
);
deletBean
=
null
;
deletBean
=
null
;
}
}
}
}
}
}
}
}
}
}
@Override
@Override
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
...
@@ -214,18 +263,26 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -214,18 +263,26 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
return
;
return
;
}
}
visitors
.
clear
();
visitors
.
clear
();
if
(
visitorType
==
-
1
)
{
// if (adults != null) adults.clear();
visitors
.
addAll
(
bean
.
getData
());
// if (childs != null) childs.clear();
}
else
{
for
(
TravelerListBean
.
DataBean
b
:
bean
.
getData
())
{
for
(
TravelerListBean
.
DataBean
b
:
bean
.
getData
())
{
if
(
visitorType
==
b
.
getIsChild
().
intValue
())
{
if
(!
TextUtils
.
isEmpty
(
hasChoIdCards
)
&&
hasChoIdCards
.
contains
(
b
.
getIdCard
()))
{
if
(
hasChoIdCards
.
contains
(
b
.
getIdCard
()))
{
b
.
setStatus
(
true
);
b
.
setStatus
(
true
);
if
(
b
.
getIsChild
()
==
0
)
{
if
(
adults
==
null
&&
adultNumber
>
0
)
{
adults
=
new
ArrayList
<>(
adultNumber
);
}
}
visitors
.
add
(
b
);
adults
.
add
(
b
);
}
else
{
if
(
childs
==
null
&&
childBumber
>
0
)
{
childs
=
new
ArrayList
<>(
childBumber
);
}
childs
.
add
(
b
);
}
}
}
}
visitors
.
add
(
b
);
}
}
if
(
visitors
.
isEmpty
())
{
if
(
visitors
.
isEmpty
())
{
mAdapter
.
setEmptyView
(
getEmptyView
(
recyclerView
,
-
1
,
"您还没有出游人信息哦"
));
mAdapter
.
setEmptyView
(
getEmptyView
(
recyclerView
,
-
1
,
"您还没有出游人信息哦"
));
}
else
{
}
else
{
...
@@ -233,12 +290,63 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
...
@@ -233,12 +290,63 @@ public class ChooseAVisitorActivity extends BaseStatusActivity<CommonPresenter>
}
}
}
}
private
void
deleteDriver
(
TravelerListBean
.
DataBean
item
)
{
private
void
deleteDriver
()
{
deletBean
=
item
;
if
(
deletBean
!=
null
)
{
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
if
(
OkGoUtil
.
getToken
()
!=
null
)
if
(
OkGoUtil
.
getToken
()
!=
null
)
headMap
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
headMap
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
postBodyData
(
1
,
ApiConfig
.
HTTP_URL_DELETEDRIVER
,
DeleteVistorBean
.
class
,
new
DeleteInfo
(
deletBean
.
getId
()),
headMap
,
true
);
mPresenter
.
postBodyData
(
1
,
ApiConfig
.
HTTP_URL_DELETEDRIVER
,
DeleteVistorBean
.
class
,
new
DeleteInfo
(
deletBean
.
getId
()),
headMap
,
true
);
}
}
}
private
TravelerListAdapter
.
SelectListener
selectListener
=
new
TravelerListAdapter
.
SelectListener
()
{
@Override
public
boolean
select
(
TravelerListBean
.
DataBean
bean
,
int
action
)
{
if
(
bean
!=
null
)
{
if
(
bean
.
getIsChild
()
==
0
)
{
// 成人
if
(
adults
==
null
&&
adultNumber
>
0
)
{
adults
=
new
ArrayList
<>(
adultNumber
);
}
if
(
action
==
0
)
{
// 取消选中
return
adults
.
remove
(
bean
);
}
else
{
// 选中
if
(
adults
.
contains
(
bean
))
{
return
false
;
}
if
(
adults
.
size
()
>=
adultNumber
)
{
return
false
;
}
return
adults
.
add
(
bean
);
}
}
else
{
// 儿童
if
(
childs
==
null
&&
childBumber
>
0
)
{
childs
=
new
ArrayList
<>(
childBumber
);
}
if
(
action
==
0
)
{
return
childs
.
remove
(
bean
);
}
else
{
if
(
childs
.
contains
(
bean
))
{
return
false
;
}
if
(
childs
.
size
()
>=
childBumber
)
{
return
false
;
}
return
childs
.
add
(
bean
);
}
}
}
return
false
;
}
@Override
public
void
showError
()
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
append
(
"只可选择"
).
append
(
adultNumber
).
append
(
"未成人"
);
if
(
childBumber
>
0
)
{
builder
.
append
(
","
).
append
(
childBumber
).
append
(
"位儿童"
);
}
showToast
(
builder
.
toString
());
}
};
}
}
module_mine/src/main/res/layout/activity_choose_avisitor.xml
View file @
c59fc4ce
...
@@ -2,6 +2,42 @@
...
@@ -2,6 +2,42 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
<include
layout=
"@layout/common_rv"
/>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_select_result"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_40"
android:layout_alignParentTop=
"true"
android:background=
"#fff7d8"
android:gravity=
"left|center_vertical"
android:paddingLeft=
"@dimen/size_20"
android:textColor=
"#EEA254"
android:visibility=
"gone"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<include
layout=
"@layout/common_rv"
/>
</LinearLayout>
<Button
android:id=
"@+id/btn_confirm"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_alignParentBottom=
"true"
android:layout_gravity=
"bottom"
android:layout_margin=
"@dimen/dp_10"
android:background=
"@drawable/shape_rv_bg_yellow"
android:gravity=
"center"
android:text=
"确定"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_16"
android:visibility=
"gone"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
module_mine/src/main/res/layout/rv_item_traveler_list.xml
View file @
c59fc4ce
...
@@ -2,53 +2,67 @@
...
@@ -2,53 +2,67 @@
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/colorWrite"
android:background=
"@color/colorWrite"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingLeft=
"@dimen/size_15"
android:paddingLeft=
"@dimen/size_15"
android:paddingTop=
"@dimen/size_15"
android:paddingTop=
"@dimen/size_15"
android:paddingRight=
"@dimen/size_15"
android:paddingRight=
"@dimen/size_15"
android:layout_height=
"wrap_content"
tools:ignore=
"MissingDefaultResource"
>
tools:ignore=
"MissingDefaultResource"
>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_item_draveler"
android:id=
"@+id/ll_item_draveler"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/size_15"
android:layout_marginBottom=
"@dimen/size_15"
android:layout_height=
"wrap_content"
>
android:orientation=
"horizontal"
>
<CheckBox
<CheckBox
android:checked=
"false"
android:focusable=
"false"
android:focusableInTouchMode=
"false"
android:id=
"@+id/cb_draveler"
android:id=
"@+id/cb_draveler"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
/>
android:layout_gravity=
"center_vertical"
/>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_marginLeft=
"@dimen/size_15"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:orientation=
"vertical"
android:orientation=
"vertical"
>
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
android:id=
"@+id/tv_name"
android:id=
"@+id/tv_name"
android:textSize=
"@dimen/text_14"
android:textColor=
"@color/colorMain"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"李伟"
android:text=
"李伟"
/>
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_14"
/>
<TextView
<TextView
android:id=
"@+id/tv_phone"
android:id=
"@+id/tv_phone"
android:textSize=
"@dimen/text_14"
android:textColor=
"@color/textGray"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_8"
android:layout_marginLeft=
"@dimen/size_8"
android:text=
"15946512558"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
<TextView
android:id=
"@+id/tv_travel_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"15946512558"
/>
android:layout_marginLeft=
"@dimen/size_3"
android:text=
"(成人)"
android:textColor=
"@color/textLightGrey"
android:textSize=
"@dimen/text_14"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
@@ -56,55 +70,56 @@
...
@@ -56,55 +70,56 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_3"
android:layout_marginTop=
"@dimen/size_3"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<TextView
<TextView
android:textSize=
"@dimen/text_14"
android:textColor=
"@color/colorMain"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
" 身份证号"
/>
android:text=
" 身份证号"
android:textColor=
"@color/colorMain"
android:textSize=
"@dimen/text_14"
/>
<TextView
<TextView
android:id=
"@+id/tv_id_card"
android:id=
"@+id/tv_id_card"
android:textSize=
"@dimen/text_14"
android:textColor=
"@color/textGray"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:maxLines=
"1"
android:layout_marginLeft=
"@dimen/size_8"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"54112019880210"
/>
android:layout_marginLeft=
"@dimen/size_8"
android:maxLines=
"1"
android:text=
"54112019880210"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<TextView
<TextView
android:visibility=
"gone"
android:id=
"@+id/tv_default"
android:id=
"@+id/tv_default"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_rv_bg_yellow"
android:padding=
"@dimen/size_5"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:layout_marginRight=
"@dimen/size_8"
android:layout_marginRight=
"@dimen/size_8"
android:background=
"@drawable/shape_rv_bg_yellow"
android:padding=
"@dimen/size_5"
android:text=
"默认"
android:textColor=
"@color/gray_FBB336"
android:textColor=
"@color/gray_FBB336"
android:
text=
"默认"
/>
android:
visibility=
"gone"
/>
<View
<View
android:layout_marginRight=
"@dimen/size_5"
android:layout_gravity=
"center_vertical"
android:layout_width=
"@dimen/size_half"
android:layout_width=
"@dimen/size_half"
android:layout_height=
"@dimen/size_25"
android:layout_height=
"@dimen/size_25"
android:background=
"@color/colorGray"
android:layout_gravity=
"center_vertical"
/>
android:layout_marginRight=
"@dimen/size_5"
android:background=
"@color/colorGray"
/>
<TextView
<TextView
android:layout_below=
"@id/tv_edit"
android:id=
"@+id/tv_edit"
android:textSize=
"@dimen/text_14"
android:textColor=
"@color/textGray"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/tv_edit"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:id=
"@+id/tv_edit"
android:text=
"@string/rv_edit"
android:text=
"@string/rv_edit"
/>
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
</LinearLayout>
</LinearLayout>
<include
layout=
"@layout/common_line"
/>
<include
layout=
"@layout/common_line"
/>
</LinearLayout>
</LinearLayout>
module_tourism/src/main/java/com/rv/tourism/other/TravelerConfirmOrderActivity.java
View file @
c59fc4ce
...
@@ -176,13 +176,14 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
...
@@ -176,13 +176,14 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
tourist
=
(
BeanVisitorInformation
)
adapter
.
getItem
(
position
);
tourist
=
(
BeanVisitorInformation
)
adapter
.
getItem
(
position
);
StringBuffer
buffer
=
new
StringBuffer
();
StringBuffer
buffer
=
new
StringBuffer
();
for
(
BeanVisitorInformation
information
:
mVisitorInformationAdapter
.
getData
())
{
for
(
BeanVisitorInformation
information
:
mVisitorInformationAdapter
.
getData
())
{
if
(
information
!=
null
&&
information
.
getIsChild
()
==
tourist
.
getIsChild
()
)
{
if
(
information
!=
null
)
{
buffer
.
append
(
information
.
getIdCard
())
buffer
.
append
(
information
.
getIdCard
())
.
append
(
";"
);
.
append
(
";"
);
}
}
}
}
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_CHOOSEAVISITOR
)
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_CHOOSEAVISITOR
)
.
withInt
(
"visitorType"
,
Integer
.
valueOf
(
tourist
.
getIsChild
()))
.
withInt
(
"adult_number"
,
Integer
.
valueOf
(
dataBean
.
getAdultNum
()))
.
withInt
(
"child_number"
,
Integer
.
valueOf
(
dataBean
.
getChildNum
()))
.
withInt
(
"openType"
,
1
)
.
withInt
(
"openType"
,
1
)
.
withString
(
"hasChoice"
,
buffer
.
toString
())
.
withString
(
"hasChoice"
,
buffer
.
toString
())
.
navigation
(
mActivity
,
104
);
.
navigation
(
mActivity
,
104
);
...
@@ -431,11 +432,23 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
...
@@ -431,11 +432,23 @@ public class TravelerConfirmOrderActivity extends BaseStatusActivity<TourismPres
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
protected
void
onActivityResult
(
int
requestCode
,
int
resultCode
,
@Nullable
Intent
data
)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
);
if
(
104
==
requestCode
&&
resultCode
==
RESULT_OK
)
{
if
(
104
==
requestCode
&&
resultCode
==
RESULT_OK
)
{
tourist
.
setName
(
data
.
getStringExtra
(
"name"
));
if
(
selectData
!=
null
)
{
tourist
.
setPhone
(
data
.
getStringExtra
(
"phone"
));
ArrayList
<
String
>
names
=
data
.
getStringArrayListExtra
(
"name"
);
tourist
.
setIdCard
(
data
.
getStringExtra
(
"idcard"
));
ArrayList
<
String
>
phones
=
data
.
getStringArrayListExtra
(
"phone"
);
tourist
.
setId
(
String
.
valueOf
(
data
.
getIntExtra
(
"id"
,
0
)));
ArrayList
<
String
>
idcards
=
data
.
getStringArrayListExtra
(
"idcard"
);
mVisitorInformationAdapter
.
notifyItemChanged
(
mPosition
);
ArrayList
<
String
>
ids
=
data
.
getStringArrayListExtra
(
"id"
);
if
(
selectData
.
size
()
!=
names
.
size
()
||
selectData
.
size
()
!=
phones
.
size
()
||
selectData
.
size
()
!=
idcards
.
size
()
||
selectData
.
size
()
!=
ids
.
size
())
{
return
;
}
for
(
int
i
=
0
;
i
<
selectData
.
size
();
i
++)
{
BeanVisitorInformation
information
=
selectData
.
get
(
i
);
information
.
setName
(
names
.
get
(
i
));
information
.
setPhone
(
phones
.
get
(
i
));
information
.
setIdCard
(
idcards
.
get
(
i
));
information
.
setId
(
ids
.
get
(
i
));
}
}
mVisitorInformationAdapter
.
notifyDataSetChanged
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment