Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TangKuPos
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
王海
TangKuPos
Commits
1d056176
Commit
1d056176
authored
Jan 30, 2018
by
姜敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改线的粗细
parent
1fd95c8e
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
37 deletions
+104
-37
app/src/main/java/com/xingdata/zzdpos/ui/manage/user/fragment/UserInfoEditFragment.java
.../zzdpos/ui/manage/user/fragment/UserInfoEditFragment.java
+11
-12
app/src/main/java/com/xingdata/zzdpos/ui/marketing/recharge/fragment/RechargeRuleEditFragment.java
...marketing/recharge/fragment/RechargeRuleEditFragment.java
+66
-8
app/src/main/java/com/xingdata/zzdpos/ui/marketing/recharge/fragment/RechargeRuleListFragment.java
...marketing/recharge/fragment/RechargeRuleListFragment.java
+2
-0
app/src/main/res/layout/fragment_recharge_rule_edit.xml
app/src/main/res/layout/fragment_recharge_rule_edit.xml
+24
-0
app/src/main/res/layout/fragment_user_info.xml
app/src/main/res/layout/fragment_user_info.xml
+0
-17
app/src/main/res/layout/title_pop.xml
app/src/main/res/layout/title_pop.xml
+1
-0
No files found.
app/src/main/java/com/xingdata/zzdpos/ui/manage/user/fragment/UserInfoEditFragment.java
View file @
1d056176
...
...
@@ -68,35 +68,34 @@ public class UserInfoEditFragment extends BaseFragment<UserPresenter, FragmentUs
break
;
case
R
.
id
.
onSure
:
if
(
oper
==
null
)
{
oper
=
new
Oper
();
}
Oper
mOper
=
new
Oper
();
if
(
mViewBinding
.
userName
.
getText
().
length
()
==
0
)
{
ToastUtils
.
showShort
(
"
会
员名称不能为空"
);
ToastUtils
.
showShort
(
"
店
员名称不能为空"
);
return
;
}
if
(
mViewBinding
.
userPhone
.
getText
().
length
()
==
0
)
{
ToastUtils
.
showShort
(
"
会
员帐号不能为空"
);
ToastUtils
.
showShort
(
"
店
员帐号不能为空"
);
return
;
}
if
(
mViewBinding
.
userPhone
.
getText
().
length
()
!=
11
)
{
ToastUtils
.
showShort
(
"
会
员帐号长度必须11位"
);
ToastUtils
.
showShort
(
"
店
员帐号长度必须11位"
);
return
;
}
if
(
mViewBinding
.
userLevel
.
getText
().
length
()
==
0
)
{
ToastUtils
.
showShort
(
"
会
员等级不能为空"
);
ToastUtils
.
showShort
(
"
店
员等级不能为空"
);
return
;
}
o
per
.
setOperLevel
(
Byte
.
valueOf
(
mPresenter
.
operLevel
.
get
(
mViewBinding
.
userLevel
.
getText
().
toString
())));
o
per
.
setOperMobile
(
Long
.
parseLong
(
mViewBinding
.
userPhone
.
getText
().
toString
()));
o
per
.
setOperName
(
mViewBinding
.
userName
.
getText
().
toString
());
mO
per
.
setOperLevel
(
Byte
.
valueOf
(
mPresenter
.
operLevel
.
get
(
mViewBinding
.
userLevel
.
getText
().
toString
())));
mO
per
.
setOperMobile
(
Long
.
parseLong
(
mViewBinding
.
userPhone
.
getText
().
toString
()));
mO
per
.
setOperName
(
mViewBinding
.
userName
.
getText
().
toString
());
if
(
oper
.
getOperId
()
==
null
)
{
mPresenter
.
addUser
(
o
per
);
mPresenter
.
addUser
(
mO
per
);
}
else
{
mPresenter
.
updateUser
(
oper
);
mOper
.
setOperId
(
oper
.
getOperId
());
mPresenter
.
updateUser
(
mOper
);
}
break
;
}
...
...
app/src/main/java/com/xingdata/zzdpos/ui/marketing/recharge/fragment/RechargeRuleEditFragment.java
View file @
1d056176
...
...
@@ -5,31 +5,39 @@ package com.xingdata.zzdpos.ui.marketing.recharge.fragment;
*/
import
android.app.DatePickerDialog
;
import
android.graphics.Color
;
import
android.view.View
;
import
android.widget.DatePicker
;
import
android.widget.RadioButton
;
import
android.widget.TextView
;
import
com.bigkoo.pickerview.OptionsPickerView
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.xingdata.zzdpos.R
;
import
com.xingdata.zzdpos.base.BaseFragment
;
import
com.xingdata.zzdpos.databinding.FragmentRechargeRuleEditBinding
;
import
com.xingdata.zzdpos.databinding.FragmentVipLevelEditBinding
;
import
com.xingdata.zzdpos.model.Level
;
import
com.xingdata.zzdpos.model.Ms
;
import
com.xingdata.zzdpos.model.Mscard
;
import
com.xingdata.zzdpos.ui.marketing.recharge.RechargeRulePresenter
;
import
com.xingdata.zzdpos.util.ConvertUtil
;
import
com.xingdata.zzdpos.util.StringUtil
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
/**
* 会员等级编辑界面
*/
public
class
RechargeRuleEditFragment
extends
BaseFragment
<
RechargeRulePresenter
,
FragmentRechargeRuleEditBinding
>
{
private
Mscard
mMscard
;
private
List
<
Mscard
>
mscards
;
private
ArrayList
<
String
>
mScards
;
@Override
public
int
getLayoutId
()
{
...
...
@@ -39,7 +47,7 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
@Override
public
void
initView
()
{
mViewBinding
.
infoTitle
.
popMenu
.
setVisibility
(
View
.
GONE
);
iniMscard
();
if
(
mMscard
!=
null
)
{
mViewBinding
.
infoTitle
.
tvTitle
.
setText
(
"修改充值优惠"
);
mViewBinding
.
ruleNameLayout
.
setVisibility
(
View
.
GONE
);
...
...
@@ -48,6 +56,7 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
mViewBinding
.
sendAmt
.
setText
(
ConvertUtil
.
fenToYuanNoZero
(
mMscard
.
getCruleSendAmt
()));
mViewBinding
.
ruleBeginTime
.
setText
(
StringUtil
.
format
(
new
Date
(
mMscard
.
getDateBegin
())));
mViewBinding
.
ruleEndTime
.
setText
(
StringUtil
.
format
(
new
Date
(
mMscard
.
getDateEnd
())));
mViewBinding
.
rechargNo
.
setText
(
mMscard
.
getCruleGradeNo
().
toString
());
RadioButton
radioButton
=
mViewBinding
.
ruleState
.
findViewWithTag
(
mMscard
.
getCruleStatus
().
toString
());
if
(
radioButton
!=
null
)
{
radioButton
.
setChecked
(
true
);
...
...
@@ -55,7 +64,8 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
}
else
{
mViewBinding
.
ruleNameLayout
.
setVisibility
(
View
.
GONE
);
mViewBinding
.
infoTitle
.
tvTitle
.
setText
(
"新增充值优惠"
);
((
RadioButton
)
mViewBinding
.
ruleState
.
getChildAt
(
0
)).
setChecked
(
true
);
((
RadioButton
)
mViewBinding
.
ruleState
.
getChildAt
(
1
)).
setChecked
(
true
);
mViewBinding
.
rechargNo
.
setText
(
mScards
.
get
(
0
));
}
mViewBinding
.
setOnClickListener
(
view
->
{
...
...
@@ -66,13 +76,15 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
mscard
.
setId
(
mMscard
.
getId
());
mscard
.
setCruleGradeNo
(
mMscard
.
getCruleGradeNo
());
mscard
.
setIssuerMapId
(
mMscard
.
getIssuerMapId
());
}
else
{
mscard
.
setCruleGradeNo
(
Byte
.
parseByte
(
mViewBinding
.
rechargNo
.
getText
().
toString
()));
}
if
(
mViewBinding
.
rechargAmt
.
getText
().
length
()
==
0
)
{
ToastUtils
.
showShort
(
"充值金额不能为空"
);
return
;
}
if
(
Long
.
parseLong
(
mViewBinding
.
rechargAmt
.
getText
().
toString
())
<=
0
)
{
if
(
Long
.
parseLong
(
mViewBinding
.
rechargAmt
.
getText
().
toString
())
<=
0
)
{
ToastUtils
.
showShort
(
"充值金额必须大于0"
);
return
;
}
...
...
@@ -80,20 +92,20 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
ToastUtils
.
showShort
(
"赠送金额不能为空"
);
return
;
}
if
(
Long
.
parseLong
(
mViewBinding
.
sendAmt
.
getText
().
toString
())
<=
0
)
{
if
(
Long
.
parseLong
(
mViewBinding
.
sendAmt
.
getText
().
toString
())
<=
0
)
{
ToastUtils
.
showShort
(
"赠送金额必须大于0"
);
return
;
}
if
(
Long
.
parseLong
(
mViewBinding
.
sendAmt
.
getText
().
toString
())
>
Long
.
parseLong
(
mViewBinding
.
rechargAmt
.
getText
().
toString
()))
{
if
(
Long
.
parseLong
(
mViewBinding
.
sendAmt
.
getText
().
toString
())
>
Long
.
parseLong
(
mViewBinding
.
rechargAmt
.
getText
().
toString
()))
{
ToastUtils
.
showShort
(
"充值金额必须大于或者等于赠送金额"
);
return
;
}
if
(
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleBeginTime
.
getText
().
toString
())
>=
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleEndTime
.
getText
().
toString
()))
{
if
(
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleBeginTime
.
getText
().
toString
())
>=
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleEndTime
.
getText
().
toString
()))
{
ToastUtils
.
showShort
(
"开始时间不能大于或者等于结束日期"
);
return
;
}
mscard
.
setCruleChargeAmt
(
ConvertUtil
.
yuanToFen
(
mViewBinding
.
rechargAmt
.
getText
().
toString
()));
mscard
.
setCruleSendAmt
(
ConvertUtil
.
yuanToFen
(
mViewBinding
.
sendAmt
.
getText
().
toString
()));
mscard
.
setCruleChargeAmt
(
ConvertUtil
.
yuanToFen
(
mViewBinding
.
rechargAmt
.
getText
().
toString
()));
mscard
.
setCruleSendAmt
(
ConvertUtil
.
yuanToFen
(
mViewBinding
.
sendAmt
.
getText
().
toString
()));
mscard
.
setCruleStatus
(
Byte
.
parseByte
(
mViewBinding
.
ruleState
.
findViewById
(
mViewBinding
.
ruleState
.
getCheckedRadioButtonId
()).
getTag
().
toString
()));
mscard
.
setDateBegin
(
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleBeginTime
.
getText
().
toString
()));
mscard
.
setDateEnd
(
StringUtil
.
getTimeMillis
(
mViewBinding
.
ruleEndTime
.
getText
().
toString
()));
...
...
@@ -106,12 +118,30 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
case
R
.
id
.
rule_end_time
:
showDialogPick
(
mViewBinding
.
ruleEndTime
);
break
;
case
R
.
id
.
recharg_No
:
ShowRechargeNo
();
break
;
}
});
mViewBinding
.
infoTitle
.
ivBack
.
setOnClickListener
(
view
->
{
pop
();
});
}
private
void
iniMscard
()
{
mScards
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<
10
;
i
++)
{
mScards
.
add
(
String
.
valueOf
(
i
));
}
for
(
Mscard
mscard
:
mscards
)
{
if
(
mScards
.
contains
(
mscard
.
getCruleGradeNo
().
toString
()))
{
mScards
.
remove
(
mscard
.
getCruleGradeNo
().
toString
());
}
}
}
@Override
...
...
@@ -119,7 +149,9 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
return
false
;
}
//将两个选择时间的dialog放在该函数中
private
void
showDialogPick
(
final
View
btn
)
{
//获取Calendar对象,用于获取当前时间
final
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -141,7 +173,33 @@ public class RechargeRuleEditFragment extends BaseFragment<RechargeRulePresenter
datePickerDialog
.
show
();
}
/**
* 弹出选择会员P
*
* @param mScards
*/
private
void
ShowRechargeNo
()
{
// 弹出选择器
OptionsPickerView
pvOptions
=
new
OptionsPickerView
.
Builder
(
getActivity
(),
new
OptionsPickerView
.
OnOptionsSelectListener
()
{
@Override
public
void
onOptionsSelect
(
int
options1
,
int
options2
,
int
options3
,
View
v
)
{
mViewBinding
.
rechargNo
.
setText
(
mScards
.
get
(
options1
));
}
}).
setTitleText
(
"请选择"
)
.
setDividerColor
(
Color
.
BLACK
)
.
setTextColorCenter
(
Color
.
BLACK
)
//设置选中项文字颜色
.
setContentTextSize
(
20
)
.
build
();
pvOptions
.
setPicker
(
mScards
);
pvOptions
.
show
();
}
public
void
setmMscard
(
Mscard
mMscard
)
{
this
.
mMscard
=
mMscard
;
}
public
void
setMscards
(
List
<
Mscard
>
mscards
)
{
this
.
mscards
=
mscards
;
}
}
app/src/main/java/com/xingdata/zzdpos/ui/marketing/recharge/fragment/RechargeRuleListFragment.java
View file @
1d056176
...
...
@@ -50,6 +50,7 @@ public class RechargeRuleListFragment extends BaseFragment<RechargeRulePresenter
mViewBinding
.
titleLayout
.
tvTitle
.
setText
(
"充值优惠"
);
adapter
.
setOnItemClickListener
((
mAdapter
,
view
,
position
)
->
{
mPresenter
.
rechargeRuleEditFragment
.
setmMscard
(
adapter
.
getData
().
get
(
position
));
mPresenter
.
rechargeRuleEditFragment
.
setMscards
(
adapter
.
getData
());
start
(
mPresenter
.
rechargeRuleEditFragment
);
});
adapter
.
setOnLoadMoreListener
(
this
::
onLoadMore
,
mViewBinding
.
levelRecyclerView
);
...
...
@@ -60,6 +61,7 @@ public class RechargeRuleListFragment extends BaseFragment<RechargeRulePresenter
switch
(
view
.
getId
())
{
case
R
.
id
.
addRule
:
mPresenter
.
rechargeRuleEditFragment
.
setmMscard
(
null
);
mPresenter
.
rechargeRuleEditFragment
.
setMscards
(
adapter
.
getData
());
start
(
mPresenter
.
rechargeRuleEditFragment
);
break
;
}
...
...
app/src/main/res/layout/fragment_recharge_rule_edit.xml
View file @
1d056176
...
...
@@ -70,6 +70,30 @@
android:enabled=
"false"
/>
</LinearLayout>
<include
layout=
"@layout/line_layout_margin"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/default_blacktext_margin_smallstyle"
android:layout_width=
"90dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/all_margin_left"
android:text=
"充值档位"
/>
<TextView
android:id=
"@+id/recharg_No"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginRight=
"@dimen/all_margin_left"
android:background=
"@mipmap/ic_expand_left"
android:gravity=
"center"
android:onClick=
"@{onClickListener}"
/>
</LinearLayout>
<include
layout=
"@layout/line_layout_margin"
/>
<LinearLayout
...
...
app/src/main/res/layout/fragment_user_info.xml
View file @
1d056176
...
...
@@ -103,23 +103,6 @@
</LinearLayout>
<include
layout=
"@layout/line_layout"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"@dimen/all_margin_left"
android:orientation=
"horizontal"
>
<Button
android:id=
"@+id/onSure"
style=
"@style/button_positive_noradius"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:onClick=
"@{onClickListener}"
android:text=
"确认"
/>
</RelativeLayout>
</LinearLayout>
</layout>
\ No newline at end of file
app/src/main/res/layout/title_pop.xml
View file @
1d056176
...
...
@@ -10,6 +10,7 @@
<ImageButton
android:id=
"@+id/iv_back"
android:layout_marginLeft=
"@dimen/all_margin_left"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:background=
"@mipmap/go_back"
...
...
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