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
0d38de7d
Commit
0d38de7d
authored
Jan 22, 2018
by
陈前
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
60a332fd
4a724a45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
11 deletions
+58
-11
app/src/main/java/com/xingdata/zzdpos/ui/vip/VipActivity.java
...src/main/java/com/xingdata/zzdpos/ui/vip/VipActivity.java
+4
-0
app/src/main/java/com/xingdata/zzdpos/ui/vip/VipPresenter.java
...rc/main/java/com/xingdata/zzdpos/ui/vip/VipPresenter.java
+1
-0
app/src/main/java/com/xingdata/zzdpos/ui/vip/fragment/VipListFragment.java
.../com/xingdata/zzdpos/ui/vip/fragment/VipListFragment.java
+53
-11
No files found.
app/src/main/java/com/xingdata/zzdpos/ui/vip/VipActivity.java
View file @
0d38de7d
...
...
@@ -5,6 +5,7 @@ import android.view.MotionEvent;
import
android.view.View
;
import
android.widget.EditText
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.xingdata.zzdpos.R
;
import
com.xingdata.zzdpos.base.BaseActivity
;
import
com.xingdata.zzdpos.databinding.ActivityVipBinding
;
...
...
@@ -39,6 +40,7 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding>
mBundle
=
getIntent
().
getExtras
();
mPresenter
.
vipListFragment
.
setVipState
(
mBundle
.
getInt
(
"vipState"
));
loadRootFragment
(
R
.
id
.
vip_frame
,
mPresenter
.
vipListFragment
,
true
,
false
);
}
@Override
...
...
@@ -106,6 +108,8 @@ public class VipActivity extends BaseActivity<VipPresenter, ActivityVipBinding>
}).
show
(
this
);
}
@Override
public
void
getVipLevelSus
(
Pager
<
Level
>
levelPager
)
{
mPresenter
.
vipListFragment
.
getVipLevelSus
(
levelPager
);
...
...
app/src/main/java/com/xingdata/zzdpos/ui/vip/VipPresenter.java
View file @
0d38de7d
...
...
@@ -75,6 +75,7 @@ public class VipPresenter extends VipContract.Presenter {
}
@Override
public
void
addVip
(
Vip
vip
)
{
if
(
vip
.
getVipId
()
==
null
)
{
...
...
app/src/main/java/com/xingdata/zzdpos/ui/vip/fragment/VipListFragment.java
View file @
0d38de7d
...
...
@@ -13,6 +13,8 @@ import android.widget.EditText;
import
android.widget.LinearLayout
;
import
android.widget.RadioButton
;
import
com.blankj.utilcode.constant.PermissionConstants
;
import
com.blankj.utilcode.util.PermissionUtils
;
import
com.blankj.utilcode.util.ToastUtils
;
import
com.xingdata.zzdpos.R
;
import
com.xingdata.zzdpos.base.BaseActivity
;
...
...
@@ -22,6 +24,7 @@ import com.xingdata.zzdpos.model.Level;
import
com.xingdata.zzdpos.model.Pager
;
import
com.xingdata.zzdpos.model.Sta
;
import
com.xingdata.zzdpos.model.Vip
;
import
com.xingdata.zzdpos.ui.scan.ScanFragment
;
import
com.xingdata.zzdpos.ui.vip.VipPresenter
;
import
com.xingdata.zzdpos.ui.vip.adapter.VipListAdapter
;
import
com.xingdata.zzdpos.util.ConvertUtil
;
...
...
@@ -39,6 +42,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
private
int
pageNumber
=
0
;
private
String
strVipLevle
;
private
int
vipState
=
0
;
//0 会员 1 充值
private
ScanFragment
scanFragment
=
new
ScanFragment
();
@Override
public
int
getLayoutId
()
{
...
...
@@ -65,23 +69,61 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
mViewBinding
.
titleSearch
.
onBack
.
setOnClickListener
(
view
->
{
getActivity
().
finish
();
});
scanFragment
.
setOnScanCompletedListener
(
new
ScanFragment
.
OnScanCompletedListener
()
{
@Override
public
void
OnScanCompleted
(
String
barcode
)
{
ToastUtils
.
showShort
(
barcode
);
scanFragment
.
pop
();
}
});
// mViewBinding.onScan.setOnClickListener(view -> PermissionUtils.permission
// (PermissionConstants.CAMERA)
// .callback(new PermissionUtils.FullCallback() {
// @Override
// public void onGranted(List<String> permissionsGranted) {
//
// }
//
// @Override
// public void onDenied(List<String> permissionsDeniedForever, List<String>
// permissionsDenied) {
// }
// })
// .request());
mViewBinding
.
setOnClickListener
(
view
->
{
switch
(
view
.
getId
())
{
case
R
.
id
.
addVip
:
if
(
levels
==
null
||
levels
.
size
()==
0
)
{
if
(
levels
==
null
||
levels
.
size
()
==
0
)
{
ToastUtils
.
showShort
(
"缺少会员等级"
);
return
;
}
toStartVipInfo
(
null
);
// mPresenter.getVipLevel(0, 200);
break
;
case
R
.
id
.
onScan
:
ToastUtils
.
showShort
(
"aaaaaaaaaaaa"
);
PermissionUtils
.
permission
(
PermissionConstants
.
CAMERA
).
callback
(
new
PermissionUtils
.
FullCallback
()
{
@Override
public
void
onGranted
(
List
<
String
>
permissionsGranted
)
{
if
(!
scanFragment
.
isAdded
())
start
(
scanFragment
);
}
@Override
public
void
onDenied
(
List
<
String
>
permissionsDeniedForever
,
List
<
String
>
permissionsDenied
)
{
}
}).
request
();
break
;
}
});
mViewBinding
.
titleSearch
.
serchEditText
.
setOnClickListener
(
view
->
{
mPresenter
.
vipSearchFragment
.
setLevel
(
levels
);
if
(
vipState
==
0
)
{
if
(
vipState
==
0
)
{
mPresenter
.
vipSearchFragment
.
setBaseFragment
(
mPresenter
.
vipInfoFragment
);
}
else
{
}
else
{
mPresenter
.
vipSearchFragment
.
setBaseFragment
(
mPresenter
.
vipRechargeFragment
);
}
start
(
mPresenter
.
vipSearchFragment
);
...
...
@@ -100,7 +142,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
RadioButton
radioButton
=
((
RadioButton
)
mViewBinding
.
vipLevelR
.
findViewById
(
buttonID
));
if
(
radioButton
.
isChecked
())
{
strVipLevle
=
radioButton
.
getTag
()
==
null
?
null
:
radioButton
.
getTag
().
toString
();
strVipLevle
=
radioButton
.
getTag
()
==
null
?
null
:
radioButton
.
getTag
().
toString
();
radioButton
.
getPaint
().
setFakeBoldText
(
true
);
radioButton
.
setTextSize
(
17
);
vipListAdapter
.
setEnableLoadMore
(
true
);
...
...
@@ -122,7 +164,7 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
radioButton
.
setBackgroundResource
(
R
.
drawable
.
checkbox_viplevel_bg
);
radioButton
.
setTextColor
(
R
.
color
.
black_baozheng
);
radioButton
.
setLayoutParams
(
layoutParams
);
radioButton
.
setPadding
(
0
,
40
,
0
,
40
);
radioButton
.
setPadding
(
0
,
40
,
0
,
40
);
return
radioButton
;
}
...
...
@@ -184,11 +226,11 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
public
void
toStartVipInfo
(
Vip
vip
)
{
mPresenter
.
vipRechargeFragment
.
setVip
(
vip
);
if
(
vip
!=
null
)
{
if
(
vipState
==
0
)
{
if
(
vipState
==
0
)
{
mPresenter
.
vipInfoFragment
.
setVip
(
vip
);
mPresenter
.
vipInfoFragment
.
setLevel
(
levels
);
((
BaseActivity
)
getActivity
()).
start
(
mPresenter
.
vipInfoFragment
);
}
else
{
}
else
{
((
BaseActivity
)
getActivity
()).
start
(
mPresenter
.
vipRechargeFragment
);
}
...
...
@@ -206,10 +248,10 @@ public class VipListFragment extends BaseFragment<VipPresenter, FragmentVipListB
* @param sta
*/
public
void
getVipNumberSus
(
Sta
sta
)
{
if
(
vipState
!=
0
)
{
mViewBinding
.
vipCount
.
setText
(
sta
.
getCardCount
()+
""
);
mViewBinding
.
vipCountAddToday
.
setText
(
"¥"
+
ConvertUtil
.
fenToYuan2
(
sta
.
getCardAmt
()));
}
else
{
if
(
vipState
!=
0
)
{
mViewBinding
.
vipCount
.
setText
(
sta
.
getCardCount
()
+
""
);
mViewBinding
.
vipCountAddToday
.
setText
(
"¥"
+
ConvertUtil
.
fenToYuan2
(
sta
.
getCardAmt
()));
}
else
{
mViewBinding
.
vipCount
.
setText
(
sta
.
getVipCount
()
+
""
);
mViewBinding
.
vipCountAddToday
.
setText
(
sta
.
getVipAddCount
()
+
""
);
}
...
...
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