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
51fadd9c
Commit
51fadd9c
authored
Jan 08, 2018
by
姜敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加颜色
parent
e2b78a68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
186 additions
and
244 deletions
+186
-244
app/src/main/java/com/xingdata/zzdpos/ui/marketing/ms/fragment/EditorFragment.java
...gdata/zzdpos/ui/marketing/ms/fragment/EditorFragment.java
+0
-1
app/src/main/java/com/xingdata/zzdpos/ui/marketing/ms/view/GroupCateView.java
...m/xingdata/zzdpos/ui/marketing/ms/view/GroupCateView.java
+186
-186
app/src/main/res/layout/view_group_cate.xml
app/src/main/res/layout/view_group_cate.xml
+0
-57
No files found.
app/src/main/java/com/xingdata/zzdpos/ui/marketing/ms/fragment/EditorFragment.java
View file @
51fadd9c
...
@@ -23,7 +23,6 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
...
@@ -23,7 +23,6 @@ import com.xingdata.zzdpos.ui.marketing.ms.model.Group;
import
com.xingdata.zzdpos.ui.marketing.ms.model.User
;
import
com.xingdata.zzdpos.ui.marketing.ms.model.User
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.BaseGroupView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.BaseGroupView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.GroupAllView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.GroupCateView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.GroupSkuView
;
import
com.xingdata.zzdpos.ui.marketing.ms.view.GroupSkuView
;
import
com.xingdata.zzdpos.util.ConvertUtil
;
import
com.xingdata.zzdpos.util.ConvertUtil
;
...
...
app/src/main/java/com/xingdata/zzdpos/ui/marketing/ms/view/GroupCateView.java
View file @
51fadd9c
package
com
.
xingdata
.
zzdpos
.
ui
.
marketing
.
ms
.
view
;
//
package com.xingdata.zzdpos.ui.marketing.ms.view;
//
import
android.view.View
;
//
import android.view.View;
import
android.widget.AdapterView
;
//
import android.widget.AdapterView;
//
import
com.xingdata.zzdpos.C
;
//
import com.xingdata.zzdpos.C;
import
com.xingdata.zzdpos.R
;
//
import com.xingdata.zzdpos.R;
import
com.xingdata.zzdpos.api.ApiFactory
;
//
import com.xingdata.zzdpos.api.ApiFactory;
import
com.xingdata.zzdpos.databinding.ViewGroupCateBinding
;
//
import com.xingdata.zzdpos.databinding.ViewGroupCateBinding;
import
com.xingdata.zzdpos.model.Category
;
//
import com.xingdata.zzdpos.model.Category;
import
com.xingdata.zzdpos.model.Ms
;
//
import com.xingdata.zzdpos.model.Ms;
//
import
java.util.ArrayList
;
//
import java.util.ArrayList;
import
java.util.List
;
//
import java.util.List;
//
/**
/
//
**
* 指定品类页面
//
* 指定品类页面
*/
//
*/
public
class
GroupCateView
extends
BaseGroupView
<
ViewGroupCateBinding
>
{
//
public class GroupCateView extends BaseGroupView<ViewGroupCateBinding> {
//
private
int
mClaPosition
=
0
,
mGrpPosition
=
0
,
mCatePosition
=
0
;
//
private int mClaPosition = 0, mGrpPosition = 0, mCatePosition = 0;
private
List
<
Category
>
mClas
,
mGrps
,
mCates
;
//
private List<Category> mClas, mGrps, mCates;
private
AdapterView
.
OnItemSelectedListener
mOnItemSelectedListener
;
//
private AdapterView.OnItemSelectedListener mOnItemSelectedListener;
//
private
long
cateId
;
//
private long cateId;
//
public
GroupCateView
()
{
//
public GroupCateView() {
mOnItemSelectedListener
=
new
AdapterView
.
OnItemSelectedListener
()
{
//
mOnItemSelectedListener = new AdapterView.OnItemSelectedListener() {
@Override
//
@Override
public
void
onItemSelected
(
AdapterView
<?>
adapterView
,
View
view
,
int
i
,
long
l
)
{
//
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
switch
(
adapterView
.
getId
())
{
//
switch (adapterView.getId()) {
case
R
.
id
.
ns_type_1
:
//
case R.id.ns_type_1:
mClaPosition
=
i
;
//
mClaPosition = i;
mGrpPosition
=
0
;
//
mGrpPosition = 0;
mCatePosition
=
0
;
//
mCatePosition = 0;
//
mViewBinding
.
nsType3
.
setVisibility
(
View
.
GONE
);
//
mViewBinding.nsType3.setVisibility(View.GONE);
//
loadGrp
(
mClas
.
get
(
i
));
//
loadGrp(mClas.get(i));
cateId
=
mClas
.
get
(
i
).
getSpuCateId
();
//
cateId = mClas.get(i).getSpuCateId();
break
;
//
break;
case
R
.
id
.
ns_type_2
:
//
case R.id.ns_type_2:
mGrpPosition
=
i
;
//
mGrpPosition = i;
mCatePosition
=
0
;
//
mCatePosition = 0;
//
if
(
mGrps
.
get
(
i
).
getSpuCateId
()
>
0
)
{
//
if (mGrps.get(i).getSpuCateId() > 0) {
loadCate
(
mGrps
.
get
(
i
));
//
loadCate(mGrps.get(i));
cateId
=
mGrps
.
get
(
i
).
getSpuCateId
();
//
cateId = mGrps.get(i).getSpuCateId();
mViewBinding
.
nsType3
.
setVisibility
(
View
.
VISIBLE
);
//
mViewBinding.nsType3.setVisibility(View.VISIBLE);
}
else
{
//
} else {
cateId
=
mClas
.
get
(
mClaPosition
).
getSpuCateId
();
//
cateId = mClas.get(mClaPosition).getSpuCateId();
mViewBinding
.
nsType3
.
setVisibility
(
View
.
GONE
);
//
mViewBinding.nsType3.setVisibility(View.GONE);
}
//
}
//
break
;
//
break;
case
R
.
id
.
ns_type_3
:
//
case R.id.ns_type_3:
mCatePosition
=
i
;
//
mCatePosition = i;
//
if
(
mCates
.
get
(
i
).
getSpuCateId
()
<
0
)
{
//
if (mCates.get(i).getSpuCateId() < 0) {
cateId
=
mGrps
.
get
(
mGrpPosition
).
getSpuCateId
();
//
cateId = mGrps.get(mGrpPosition).getSpuCateId();
}
else
{
//
} else {
cateId
=
mCates
.
get
(
i
).
getSpuCateId
();
//
cateId = mCates.get(i).getSpuCateId();
}
//
}
break
;
//
break;
}
//
}
}
//
}
//
@Override
//
@Override
public
void
onNothingSelected
(
AdapterView
<?>
adapterView
)
{
//
public void onNothingSelected(AdapterView<?> adapterView) {
}
//
}
};
//
};
}
//
}
//
@Override
//
@Override
public
int
getLayoutId
()
{
//
public int getLayoutId() {
return
R
.
layout
.
view_group_cate
;
//
return R.layout.view_group_cate;
}
//
}
//
//
@Override
//
@Override
public
void
initView
()
{
//
public void initView() {
super
.
initView
();
//
super.initView();
loadCla
();
//
loadCla();
//
mViewBinding
.
nsType1
.
setOnItemSelectedListener
(
mOnItemSelectedListener
);
//
mViewBinding.nsType1.setOnItemSelectedListener(mOnItemSelectedListener);
mViewBinding
.
nsType2
.
setOnItemSelectedListener
(
mOnItemSelectedListener
);
//
mViewBinding.nsType2.setOnItemSelectedListener(mOnItemSelectedListener);
mViewBinding
.
nsType3
.
setOnItemSelectedListener
(
mOnItemSelectedListener
);
//
mViewBinding.nsType3.setOnItemSelectedListener(mOnItemSelectedListener);
}
//
}
//
@Override
//
@Override
protected
void
setViewByMs
()
{
//
protected void setViewByMs() {
}
//
}
//
@Override
//
@Override
public
boolean
processMs
(
Ms
ms
)
{
//
public boolean processMs(Ms ms) {
ms
.
setMsTouchTag2
((
byte
)
C
.
MS_GROUP
.
CATE
);
//
ms.setMsTouchTag2((byte) C.MS_GROUP.CATE);
ms
.
setSpuCateId
((
int
)
cateId
);
//
ms.setSpuCateId((int) cateId);
return
true
;
//
return true;
}
//
}
//
//
/**
//
/**
* 加载大类
//
* 加载大类
*/
//
*/
private
void
loadCla
()
{
//
private void loadCla() {
ApiFactory
.
Shop
.
queryAll
().
subscribe
(
//
ApiFactory.Shop.queryAll().subscribe(
categories
->
{
//
categories -> {
mClas
=
categories
;
//
mClas = categories;
List
<
String
>
strClas
=
new
ArrayList
<>();
//
List<String> strClas = new ArrayList<>();
for
(
int
i
=
0
;
i
<
categories
.
size
();
i
++)
{
//
for (int i = 0; i < categories.size(); i++) {
if
(
mMs
!=
null
&&
mMs
.
getSpuCateId
()
!=
null
&&
mMs
.
getSpuCateId
()
/
10000
==
categories
.
get
(
i
).
getSpuCateId
()
/
10000
)
//
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 10000 == categories.get(i).getSpuCateId() / 10000)
mClaPosition
=
i
;
//
mClaPosition = i;
strClas
.
add
(
categories
.
get
(
i
).
getSpuClaName
());
//
strClas.add(categories.get(i).getSpuClaName());
}
//
}
mViewBinding
.
nsType1
.
attachDataSource
(
strClas
);
//
mViewBinding.nsType1.attachDataSource(strClas);
mViewBinding
.
nsType1
.
setSelectedIndex
(
mClaPosition
);
//
mViewBinding.nsType1.setSelectedIndex(mClaPosition);
//
cateId
=
mClas
.
get
(
0
).
getSpuCateId
();
//
cateId = mClas.get(0).getSpuCateId();
//
loadGrp
(
mClas
.
get
(
mClaPosition
));
//
loadGrp(mClas.get(mClaPosition));
},
//
},
throwable
->
{
//
throwable -> {
});
//
});
}
//
}
//
/**
//
/**
* 设置大类信息,加载中类
//
* 设置大类信息,加载中类
*
//
*
* @param cateCla 大类信息
//
* @param cateCla 大类信息
*/
//
*/
private
void
loadGrp
(
Category
cateCla
)
{
//
private void loadGrp(Category cateCla) {
ApiFactory
.
Shop
.
queryAll
(
cateCla
).
subscribe
(
//
ApiFactory.Shop.queryAll(cateCla).subscribe(
categories
->
{
//
categories -> {
Category
category
=
new
Category
();
//
Category category = new Category();
category
.
setSpuGrpName
(
"全部"
);
//
category.setSpuGrpName("全部");
category
.
setSpuCateId
(
cateCla
.
getSpuCateId
());
//
category.setSpuCateId(cateCla.getSpuCateId());
categories
.
add
(
0
,
category
);
//
categories.add(0, category);
//
mGrps
=
categories
;
//
mGrps = categories;
List
<
String
>
strGrps
=
new
ArrayList
<>();
//
List<String> strGrps = new ArrayList<>();
for
(
int
j
=
0
;
j
<
categories
.
size
();
j
++)
{
//
for (int j = 0; j < categories.size(); j++) {
if
(
mMs
!=
null
&&
mMs
.
getSpuCateId
()
!=
null
&&
mMs
.
getSpuCateId
()
/
100
==
categories
.
get
(
j
).
getSpuCateId
()
/
100
)
//
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId() / 100 == categories.get(j).getSpuCateId() / 100)
mGrpPosition
=
j
;
//
mGrpPosition = j;
strGrps
.
add
(
categories
.
get
(
j
).
getSpuGrpName
());
//
strGrps.add(categories.get(j).getSpuGrpName());
}
//
}
mViewBinding
.
nsType2
.
attachDataSource
(
strGrps
);
//
mViewBinding.nsType2.attachDataSource(strGrps);
mViewBinding
.
nsType2
.
setSelectedIndex
(
mGrpPosition
);
//
mViewBinding.nsType2.setSelectedIndex(mGrpPosition);
//
if
(
mGrpPosition
!=
0
)
{
//
if (mGrpPosition != 0) {
loadCate
(
mGrps
.
get
(
mGrpPosition
));
//
loadCate(mGrps.get(mGrpPosition));
mViewBinding
.
nsType3
.
setVisibility
(
View
.
VISIBLE
);
//
mViewBinding.nsType3.setVisibility(View.VISIBLE);
}
//
}
},
//
},
throwable
->
{
//
throwable -> {
});
//
});
//
}
//
}
//
/**
//
/**
* 设置中类信息,加载小类
//
* 设置中类信息,加载小类
*
//
*
* @param cateGrp 中类信息
//
* @param cateGrp 中类信息
*/
//
*/
private
void
loadCate
(
Category
cateGrp
)
{
//
private void loadCate(Category cateGrp) {
ApiFactory
.
Shop
.
queryAll
(
cateGrp
).
subscribe
(
//
ApiFactory.Shop.queryAll(cateGrp).subscribe(
categories
->
{
//
categories -> {
Category
category
=
new
Category
();
//
Category category = new Category();
category
.
setSpuCateName
(
"全部"
);
//
category.setSpuCateName("全部");
category
.
setSpuCateId
(
cateGrp
.
getSpuCateId
());
//
category.setSpuCateId(cateGrp.getSpuCateId());
categories
.
add
(
0
,
category
);
//
categories.add(0, category);
//
mCates
=
categories
;
//
mCates = categories;
List
<
String
>
strCates
=
new
ArrayList
<>();
//
List<String> strCates = new ArrayList<>();
for
(
int
j
=
0
;
j
<
categories
.
size
();
j
++)
{
//
for (int j = 0; j < categories.size(); j++) {
if
(
mMs
!=
null
&&
mMs
.
getSpuCateId
()
!=
null
&&
mMs
.
getSpuCateId
().
longValue
()
==
categories
.
get
(
j
).
getSpuCateId
())
//
if (mMs != null && mMs.getSpuCateId() != null && mMs.getSpuCateId().longValue() == categories.get(j).getSpuCateId())
mCatePosition
=
j
;
//
mCatePosition = j;
strCates
.
add
(
categories
.
get
(
j
).
getSpuCateName
());
//
strCates.add(categories.get(j).getSpuCateName());
}
//
}
mViewBinding
.
nsType3
.
attachDataSource
(
strCates
);
//
mViewBinding.nsType3.attachDataSource(strCates);
mViewBinding
.
nsType3
.
setSelectedIndex
(
mCatePosition
);
//
mViewBinding.nsType3.setSelectedIndex(mCatePosition);
},
//
},
throwable
->
{
//
throwable -> {
});
//
});
}
//
}
//
}
//
}
app/src/main/res/layout/view_group_cate.xml
deleted
100644 → 0
View file @
e2b78a68
<?xml version="1.0" encoding="utf-8"?>
<layout>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/transparent"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/editor_item_height"
android:gravity=
"center"
android:text=
"@string/ms_editor_buy"
android:textColor=
"@color/black"
android:textSize=
"@dimen/big_text_size"
/>
<org.angmarch.views.NiceSpinner
android:id=
"@+id/ns_type_1"
style=
"@style/editor_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/all_spacing"
android:minWidth=
"@dimen/et_min_width_short"
app:backgroundSelector=
"@drawable/selector_white_background_stroke_2"
/>
<org.angmarch.views.NiceSpinner
android:id=
"@+id/ns_type_2"
style=
"@style/editor_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/all_spacing"
android:minWidth=
"@dimen/et_min_width_short"
app:backgroundSelector=
"@drawable/selector_white_background_stroke_2"
/>
<org.angmarch.views.NiceSpinner
android:id=
"@+id/ns_type_3"
style=
"@style/editor_edit"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/all_spacing"
android:minWidth=
"@dimen/et_min_width_short"
android:visibility=
"gone"
app:backgroundSelector=
"@drawable/selector_white_background_stroke_2"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"@dimen/all_spacing"
android:gravity=
"center"
android:text=
"@string/ms_editor_group_skugrp_hint"
android:textColor=
"@color/black"
android:textSize=
"@dimen/big_text_size"
/>
</LinearLayout>
</layout>
\ No newline at end of file
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