Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
01f2540c
Commit
01f2540c
authored
Jan 11, 2020
by
王宇航
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首頁佈局
parent
e46d5faa
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
190 additions
and
108 deletions
+190
-108
arms/src/main/java/com/jess/arms/base/BaseActivity.java
+3
-0
arms/src/main/java/com/jess/arms/base/BaseFragment.java
+3
-0
main/src/main/AndroidManifest.xml
+1
-2
main/src/main/debug/AndroidManifest.xml
+4
-1
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/contract/HomeContract.java
+2
-0
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/HomeModel.java
+7
-0
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/HomeTurnoverBean.java
+4
-4
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/HomeService.java
+6
-0
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/HomePresenter.java
+29
-4
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/MainActivity.java
+3
-2
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/HomeFunctionAdapter.java
+3
-2
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/HomeFragment.java
+28
-28
main/src/main/res/layout/main_fragment_home.xml
+18
-8
main/src/main/res/values/strings.xml
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimeUtils.java
+9
-0
public-ui/src/main/res/values/styles.xml
+51
-48
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
+17
-7
user-login/src/main/res/layout/user_login_activity_login.xml
+1
-1
No files found.
arms/src/main/java/com/jess/arms/base/BaseActivity.java
View file @
01f2540c
...
...
@@ -53,6 +53,7 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi
private
final
BehaviorSubject
<
ActivityEvent
>
mLifecycleSubject
=
BehaviorSubject
.
create
();
private
Cache
<
String
,
Object
>
mCache
;
private
Unbinder
mUnbinder
;
protected
Context
mContext
;
@Inject
@Nullable
protected
P
mPresenter
;
//如果当前页面逻辑简单, Presenter 可以为 null
...
...
@@ -75,12 +76,14 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi
@Override
public
View
onCreateView
(
String
name
,
Context
context
,
AttributeSet
attrs
)
{
View
view
=
convertAutoView
(
name
,
context
,
attrs
);
return
view
==
null
?
super
.
onCreateView
(
name
,
context
,
attrs
)
:
view
;
}
@Override
protected
void
onCreate
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
mContext
=
this
;
//DecorView的背景对我来说无用,但是会产生一次Overdraw,这里去掉(过度绘制优化)
getWindow
().
setBackgroundDrawable
(
null
);
try
{
...
...
arms/src/main/java/com/jess/arms/base/BaseFragment.java
View file @
01f2540c
...
...
@@ -15,6 +15,7 @@
*/
package
com
.
jess
.
arms
.
base
;
import
android.content.Context
;
import
android.os.Bundle
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -50,6 +51,7 @@ public abstract class BaseFragment<P extends IPresenter> extends Fragment implem
protected
final
String
TAG
=
this
.
getClass
().
getSimpleName
();
private
final
BehaviorSubject
<
FragmentEvent
>
mLifecycleSubject
=
BehaviorSubject
.
create
();
private
Cache
<
String
,
Object
>
mCache
;
protected
Context
mContext
;
@Inject
@Nullable
protected
P
mPresenter
;
//如果当前页面逻辑简单, Presenter 可以为 null
...
...
@@ -74,6 +76,7 @@ public abstract class BaseFragment<P extends IPresenter> extends Fragment implem
@Nullable
@Override
public
View
onCreateView
(
@NonNull
LayoutInflater
inflater
,
@Nullable
ViewGroup
container
,
@Nullable
Bundle
savedInstanceState
)
{
mContext
=
getActivity
();
return
initView
(
inflater
,
container
,
savedInstanceState
);
}
...
...
main/src/main/AndroidManifest.xml
View file @
01f2540c
...
...
@@ -3,7 +3,6 @@
package=
"com.gingersoft.gsa.cloud.main"
>
<application>
<activity
android:name=
".mvp.ui.activity.MainActivity"
>
</activity>
<activity
android:name=
".mvp.ui.activity.MainActivity"
/>
</application>
</manifest>
main/src/main/debug/AndroidManifest.xml
View file @
01f2540c
...
...
@@ -17,10 +17,13 @@
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".mvp.ui.activity.MainActivity"
>
<activity
android:name=
".mvp.ui.activity.MainActivity"
android:theme=
"@style/MainTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/contract/HomeContract.java
View file @
01f2540c
...
...
@@ -31,5 +31,7 @@ public interface HomeContract {
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
Observable
<
HomeTurnoverBean
>
getRestaurantReport
(
RequestBody
requestBody
);
Observable
<
String
>
getRestaurantFunList
(
String
restaurantId
);
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/HomeModel.java
View file @
01f2540c
...
...
@@ -56,4 +56,10 @@ public class HomeModel extends BaseModel implements HomeContract.Model {
return
mRepositoryManager
.
obtainRetrofitService
(
HomeService
.
class
)
.
getRestaurantReport
(
requestBody
);
}
@Override
public
Observable
<
String
>
getRestaurantFunList
(
String
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
HomeService
.
class
)
.
getRestaurantFunList
(
restaurantId
);
}
}
\ No newline at end of file
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/bean/HomeTurnoverBean.java
View file @
01f2540c
...
...
@@ -59,14 +59,14 @@ public class HomeTurnoverBean {
* billNum_table : 30.00
* servicecharge : 72.00
*/
private
String
Business_amount
;
private
String
Business_amount
;
//營業總金額
private
String
Bill_decimal
;
private
String
discount
;
private
String
TipsAmount
;
private
String
CreditCardAmount
;
private
String
people
;
private
String
sales
;
private
String
number_bill
;
private
String
people
;
//消費人數
private
String
sales
;
//項目總金額
private
String
number_bill
;
//賬單數量
private
String
billNum_skyOder
;
private
String
billPrice_table
;
private
String
billPrice_skyOder
;
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/HomeService.java
View file @
01f2540c
...
...
@@ -6,7 +6,10 @@ import io.reactivex.Observable;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
import
retrofit2.http.QueryName
;
/**
* Created by Wyh on 2020/1/10.
...
...
@@ -16,4 +19,7 @@ public interface HomeService {
@POST
(
"wx/doBusiness"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
HomeTurnoverBean
>
getRestaurantReport
(
@Body
RequestBody
requestBody
);
@GET
(
"user/resource/list"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
String
>
getRestaurantFunList
(
@Query
(
"restaurantId"
)
String
restaurantId
);
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/presenter/HomePresenter.java
View file @
01f2540c
...
...
@@ -4,6 +4,7 @@ import android.app.Application;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.HomeTurnoverBean
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.FragmentScope
;
...
...
@@ -64,11 +65,11 @@ public class HomePresenter extends BasePresenter<HomeContract.Model, HomeContrac
this
.
mApplication
=
null
;
}
public
void
getRestaurantReport
(
String
restaurantId
){
public
void
getRestaurantReport
(
String
restaurantId
)
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
restaurantId
)
.
add
(
"startTime"
,
"2020-01-09"
)
.
add
(
"endTime"
,
"2020-01-10"
)
.
add
(
"startTime"
,
TimeUtils
.
getYesterdayTime
(
TimeUtils
.
DATE_FORMAT_DATE
)
)
.
add
(
"endTime"
,
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DATE_FORMAT_DATE
)
)
.
build
();
mModel
.
getRestaurantReport
(
requestBody
)
...
...
@@ -81,10 +82,34 @@ public class HomePresenter extends BasePresenter<HomeContract.Model, HomeContrac
.
subscribe
(
new
ErrorHandleSubscriber
<
HomeTurnoverBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
HomeTurnoverBean
info
)
{
mRootView
.
loadBusinessInfo
(
info
.
getData
());
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
mRootView
.
loadBusinessInfo
(
info
.
getData
());
}
}
else
{
mRootView
.
showMessage
(
"營業報表獲取失敗"
);
}
}
});
}
/**
* 獲取餐廳功能列表
*/
public
void
getRestaurantFunList
(
String
restaurantId
)
{
mModel
.
getRestaurantFunList
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
""
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
String
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
String
info
)
{
Log
.
e
(
"aaa"
,
"功能列表"
+
info
);
}
});
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/MainActivity.java
View file @
01f2540c
...
...
@@ -7,6 +7,7 @@ import android.widget.BaseAdapter;
import
com.gingersoft.gsa.cloud.base.qmui.arch.QMUIFragmentPagerAdapter
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R2
;
import
com.gingersoft.gsa.cloud.main.di.component.DaggerMainComponent
;
import
com.gingersoft.gsa.cloud.main.mvp.contract.MainContract
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.MainPresenter
;
...
...
@@ -49,9 +50,9 @@ public class MainActivity extends BaseFragmentActivity<MainPresenter> implements
// QMUITopBar mTopBar;
// @BindView(R2.id.gv_function)
// GridView gv_function;
@BindView
(
R
.
id
.
main_pager
)
@BindView
(
R
2
.
id
.
main_pager
)
QMUIViewPager
mViewPager
;
@BindView
(
R
.
id
.
main_tabs
)
@BindView
(
R
2
.
id
.
main_tabs
)
QMUITabSegment
mTabSegment
;
@Override
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/HomeFunctionAdapter.java
View file @
01f2540c
...
...
@@ -6,6 +6,7 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R2
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionHeader
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionItem
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.view.HomeFunctionHead
;
...
...
@@ -50,9 +51,9 @@ public class HomeFunctionAdapter extends QMUIDefaultStickySectionAdapter<Section
}
class
ViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
@BindView
(
R
.
id
.
iv_main_home_item_function_icon
)
@BindView
(
R
2
.
id
.
iv_main_home_item_function_icon
)
ImageView
ivFun
;
//功能圖標
@BindView
(
R
.
id
.
tv_main_home_item_function_name
)
@BindView
(
R
2
.
id
.
tv_main_home_item_function_name
)
TextView
tvFun
;
//功能名
public
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/HomeFragment.java
View file @
01f2540c
...
...
@@ -2,32 +2,31 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.fragment;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.
text.format.DateUtils
;
import
android.
util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R2
;
import
com.gingersoft.gsa.cloud.main.di.component.DaggerHomeComponent
;
import
com.gingersoft.gsa.cloud.main.mvp.contract.HomeContract
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.HomeTurnoverBean
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionHeader
;
import
com.gingersoft.gsa.cloud.main.mvp.model.bean.SectionItem
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.HomePresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.HomeFunctionAdapter
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.gingersoft.gsa.cloud.main.mvp.contract.HomeContract
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.HomePresenter
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.qmuiteam.qmui.widget.QMUITopBarLayout
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
;
import
org.w3c.dom.Text
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Map
;
...
...
@@ -36,7 +35,6 @@ import androidx.annotation.Nullable;
import
androidx.recyclerview.widget.GridLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
retrofit2.http.Body
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
...
...
@@ -56,21 +54,21 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/
public
class
HomeFragment
extends
BaseFragment
<
HomePresenter
>
implements
HomeContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R
.
id
.
main_home_bar
)
@BindView
(
R
2
.
id
.
main_home_bar
)
QMUITopBarLayout
mTopBar
;
@BindView
(
R
.
id
.
tv_main_home_today_turnover
)
@BindView
(
R
2
.
id
.
tv_main_home_today_turnover
)
TextView
tvTurnover
;
@BindView
(
R
.
id
.
tv_main_home_cutoff_text
)
@BindView
(
R
2
.
id
.
tv_main_home_cutoff_time
)
TextView
tvCutoff
;
@BindView
(
R
.
id
.
tv_main_home_total_amount_project
)
@BindView
(
R
2
.
id
.
tv_main_home_total_amount_project
)
TextView
tvProjectTotalAmount
;
@BindView
(
R
.
id
.
tv_main_home_consumers_number
)
@BindView
(
R
2
.
id
.
tv_main_home_consumers_number
)
TextView
tvConsumersNum
;
@BindView
(
R
.
id
.
tv_main_home_bill_number
)
@BindView
(
R
2
.
id
.
tv_main_home_bill_number
)
TextView
tvBillNum
;
@BindView
(
R
.
id
.
section_layout
)
@BindView
(
R
2
.
id
.
section_layout
)
QMUIStickySectionLayout
mSectionLayout
;
private
RecyclerView
.
LayoutManager
mLayoutManager
;
...
...
@@ -99,14 +97,16 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
mPresenter
.
getRestaurantReport
(
"26"
);
// mPresenter.getRestaurantFunList("26");
initTopBar
();
initStickyLayout
();
tvCutoff
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
new
SimpleDateFormat
(
"MM.dd HH:mm"
)));
}
private
void
initTopBar
()
{
mTopBar
.
addLeftImageButton
(
R
.
drawable
.
ic_main_home_refresh
,
R
.
id
.
main_home_refresh
);
mTopBar
.
setTitle
(
"店鋪名稱"
);
mTopBar
.
addRightImageButton
(
R
.
drawable
.
selector_msg
,
R
.
id
.
main_home_msg
).
setOnClickListener
(
this
);
//
mTopBar.addRightImageButton(R.drawable.selector_msg, R.id.main_home_msg).setOnClickListener(this);
}
/**
...
...
@@ -144,7 +144,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
private
QMUISection
<
SectionHeader
,
SectionItem
>
createSection
(
String
headerText
)
{
SectionHeader
header
=
new
SectionHeader
(
headerText
);
ArrayList
<
SectionItem
>
contents
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
5
;
i
++)
{
for
(
int
i
=
0
;
i
<
1
;
i
++)
{
contents
.
add
(
new
SectionItem
(
R
.
drawable
.
ic_dining_table
,
"item "
+
i
));
}
QMUISection
<
SectionHeader
,
SectionItem
>
section
=
new
QMUISection
<>(
header
,
contents
,
false
);
...
...
@@ -199,21 +199,21 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements HomeCon
@Override
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
()){
case
R
.
id
.
main_home_refresh
:
//刷新
break
;
case
R
.
id
.
main_home_msg
:
//消息
break
;
if
(
v
.
getId
()
==
R
.
id
.
main_home_refresh
)
{
//刷新
}
else
if
(
v
.
getId
()
==
R
.
id
.
main_home_msg
)
{
//消息
}
}
@Override
public
void
loadBusinessInfo
(
Map
<
String
,
HomeTurnoverBean
.
DataBean
>
data
)
{
// tvTurnover.setText(data.get("2020-01-09").getSales());//TimeUtils.getCurrentTimeInString(TimeUtils.DATE_FORMAT_DATE)
HomeTurnoverBean
.
DataBean
bean
=
data
.
get
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DATE_FORMAT_DATE
));
//TimeUtils.getCurrentTimeInString(TimeUtils.DATE_FORMAT_DATE)
if
(
bean
!=
null
)
{
tvTurnover
.
setText
(
bean
.
getBusiness_amount
());
tvProjectTotalAmount
.
setText
(
bean
.
getSales
());
tvConsumersNum
.
setText
(
bean
.
getPeople
());
tvBillNum
.
setText
(
bean
.
getNumber_bill
());
}
}
}
main/src/main/res/layout/main_fragment_home.xml
View file @
01f2540c
...
...
@@ -39,7 +39,7 @@
android:id=
"@+id/tv_main_home_today_turnover"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
96,999,9
"
android:text=
"
0
"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_20"
app:layout_constraintBottom_toBottomOf=
"@id/tv_main_home_cutoff_text"
...
...
@@ -53,10 +53,20 @@
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"@string/cutoff"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_1
6
"
android:textSize=
"@dimen/sp_1
2
"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_main_home_today_turnover_text"
/>
<TextView
android:id=
"@+id/tv_main_home_cutoff_time"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_12"
app:layout_constraintLeft_toRightOf=
"@id/tv_main_home_cutoff_text"
app:layout_constraintBottom_toBottomOf=
"@id/tv_main_home_cutoff_text"
app:layout_constraintTop_toTopOf=
"@id/tv_main_home_cutoff_text"
/>
<View
android:id=
"@+id/line_main_home_turnover"
android:layout_width=
"match_parent"
...
...
@@ -112,9 +122,9 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"
98,568,
0"
android:text=
"0"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_1
6
"
android:textSize=
"@dimen/sp_1
4
"
app:layout_constraintLeft_toLeftOf=
"@id/tv_main_home_total_amount_project_text"
app:layout_constraintRight_toRightOf=
"@id/tv_main_home_total_amount_project_text"
app:layout_constraintTop_toBottomOf=
"@id/tv_main_home_total_amount_project_text"
/>
...
...
@@ -124,9 +134,9 @@
android:id=
"@+id/tv_main_home_consumers_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
2812
"
android:text=
"
0
"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_1
6
"
android:textSize=
"@dimen/sp_1
4
"
app:layout_constraintLeft_toLeftOf=
"@id/tv_main_home_consumers_number_text"
app:layout_constraintRight_toRightOf=
"@id/tv_main_home_consumers_number_text"
app:layout_constraintTop_toBottomOf=
"@id/tv_main_home_consumers_number_text"
...
...
@@ -136,9 +146,9 @@
android:id=
"@+id/tv_main_home_bill_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
198
"
android:text=
"
0
"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_1
6
"
android:textSize=
"@dimen/sp_1
4
"
app:layout_constraintLeft_toLeftOf=
"@id/tv_main_home_bill_number_text"
app:layout_constraintRight_toRightOf=
"@id/tv_main_home_bill_number_text"
app:layout_constraintTop_toBottomOf=
"@id/tv_main_home_bill_number_text"
...
...
main/src/main/res/values/strings.xml
View file @
01f2540c
...
...
@@ -5,7 +5,7 @@
<string
name=
"report"
>
报表
</string>
<string
name=
"my"
>
我的
</string>
<string
name=
"turnover_today"
>
今日營業額($)
</string>
<string
name=
"cutoff"
>
截止
%1$s
</string>
<string
name=
"cutoff"
>
截止
</string>
<string
name=
"total_amount_of_project"
>
項目總金額
</string>
<string
name=
"number_of_consumers"
>
消費人數
</string>
<string
name=
"bill_number"
>
賬單數
</string>
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimeUtils.java
View file @
01f2540c
...
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.base.utils.time;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
/**
...
...
@@ -18,6 +19,14 @@ public class TimeUtils {
throw
new
AssertionError
();
}
public
static
String
getYesterdayTime
(
SimpleDateFormat
simpleDateFormat
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
add
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
//往上推一天
return
simpleDateFormat
.
format
(
calendar
.
getTime
());
}
/**
* long time to string
*
...
...
public-ui/src/main/res/values/styles.xml
View file @
01f2540c
<resources>
<style
name=
"AppTheme"
parent=
"QMUI.Compat.NoActionBar"
>
<!-- 配置Android提供的theme -->
<!-- <item name="android:textAppearanceListItemSmall">@style/QDTextAppearanceListItemSmall</item>-->
<!-- <item name="android:textAppearanceListItem">@style/QDtextAppearanceListItem</item>-->
<!-- <item name="android:listPreferredItemHeight">?attr/qmui_list_item_height_higher</item>-->
<!-- <item name="android:listPreferredItemHeightSmall">?attr/qmui_list_item_height</item>-->
<!-- 配置qmui提供的theme -->
<item
name=
"qmui_config_color_blue"
>
@color/theme_color
</item>
<item
name=
"qmui_config_color_gray_6"
>
@color/normal_color
</item>
<!-- <item name="qmui_round_btn_bg_color">@color/ui_s_btn_blue_bg</item>-->
<!-- <item name="qmui_round_btn_border_color">@color/ui_s_btn_blue_border</item>-->
<!-- <item name="qmui_round_btn_text_color">@color/ui_s_btn_blue_text</item>-->
<!-- <item name="qmui_content_spacing_horizontal">20dp</item>-->
<!-- <item name="qmui_content_padding_horizontal">@dimen/qmui_content_spacing_horizontal</item>-->
<!--***************************** qmui topbar ***************************** -->
<item
name=
"qmui_topbar_height"
>
@dimen/head_height
</item>
<!-- skin support-->
<item
name=
"qmui_skin_support_topbar_separator_color"
>
?attr/qmui_skin_support_color_separator
</item>
<item
name=
"qmui_skin_support_topbar_bg"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_topbar_title_color"
>
@color/normal_color
</item>
<item
name=
"qmui_skin_support_topbar_subtitle_color"
>
?attr/qmui_config_color_gray_3
</item>
<item
name=
"qmui_skin_support_topbar_text_btn_color_state_list"
>
@color/qmui_config_color_gray_1
</item>
<item
name=
"qmui_skin_support_topbar_image_tint_color"
>
@color/qmui_config_color_gray_1
</item>
<!-- skin support-->
<!--*************************** qmui tabSegment *************************** -->
<!-- skin support-->
<item
name=
"qmui_skin_support_tab_bg"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_separator_color"
>
?attr/qmui_skin_support_color_separator
</item>
<item
name=
"qmui_skin_support_tab_normal_color"
>
@color/normal_color
</item>
<item
name=
"qmui_skin_support_tab_selected_color"
>
@color/theme_color
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_text_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_bg_color"
>
?attr/qmui_config_color_red
</item>
<!-- skin support-->
<style
name=
"AppTheme"
parent=
"PublicTheme"
>
<item
name=
"QMUITopBarStyle"
>
@style/QDTopBar
</item>
<item
name=
"QMUITabSegmentStyle"
>
@style/QMUITabSegmentStyle
</item>
</style>
<!-- 配置app自己的theme -->
<style
name=
"PublicTheme"
parent=
"QMUI.Compat.NoActionBar"
>
<!-- 必須配置app自己的theme -->
<item
name=
"app_primary_color"
>
?attr/qmui_config_color_blue
</item>
<item
name=
"app_content_bg_color"
>
@color/qmui_config_color_white
</item>
...
...
@@ -47,18 +14,30 @@
<item
name=
"colorPrimary"
>
@color/colorPrimary
</item>
<item
name=
"colorPrimaryDark"
>
@color/colorPrimaryDark
</item>
<item
name=
"colorAccent"
>
@color/colorAccent
</item>
<!--<item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.Self</item>-->
<item
name=
"android:windowAnimationStyle"
>
@style/ui_activityAnimation
</item>
<!-- 设置activity切换动画 -->
<!--<item name="android:windowIsTranslucent">true</item><!– 防止Acitivity跳转黑屏 将背景设置成透明–>-->
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<!-- 防止Acitivity跳转黑屏 将背景设置成透明-->
</style>
<!--首頁主題 標題欄文字顏色和其他的不一樣-->
<style
name=
"MainTheme"
parent=
"PublicTheme"
>
<item
name=
"QMUITabSegmentStyle"
>
@style/QMUITabSegmentStyle
</item>
<!--qmui_topbar-->
<item
name=
"qmui_topbar_title_color"
>
@color/normal_color
</item>
<item
name=
"qmui_topbar_subtitle_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_topbar_text_btn_color_state_list"
>
@color/ui_s_topbar_btn_color
</item>
<item
name=
"qmui_topbar_height"
>
@dimen/head_height
</item>
<item
name=
"qmui_topbar_image_btn_height"
>
@dimen/head_height
</item>
<item
name=
"qmui_topbar_image_btn_width"
>
@dimen/head_height
</item>
</style>
<style
name=
"AppTheme.Base"
parent=
"QMUI.Compat.NoActionBar"
>
<item
name=
"colorPrimary"
>
@color/theme_color
</item>
<item
name=
"colorPrimaryDark"
>
@color/theme_color
</item>
<item
name=
"colorAccent"
>
@color/theme_color
</item>
<!-- <item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.Self</item>-->
<item
name=
"android:windowAnimationStyle"
>
@style/ui_activityAnimation
</item>
<!-- 设置activity切换动画 -->
<!-- <item name="android:alertDialogTheme">@style/Theme.AppCompat.Light.Dialog.Alert.Self</item>-->
<item
name=
"android:windowAnimationStyle"
>
@style/ui_activityAnimation
</item>
<!-- 设置activity切换动画 -->
</style>
...
...
@@ -91,13 +70,13 @@
<style
name=
"QDtextAppearanceListItem"
>
<item
name=
"android:textColor"
>
?attr/qmui_config_color_black
</item>
<item
name=
"android:textSize"
>
18sp
</item>
<!-- <item name="android:background">?attr/qmui_s_list_item_bg_with_border_bottom_inset_left</item>-->
<!-- <item name="android:background">?attr/qmui_s_list_item_bg_with_border_bottom_inset_left</item>-->
</style>
<style
name=
"QDTextAppearanceListItemSmall"
>
<item
name=
"android:textColor"
>
?attr/qmui_config_color_gray_4
</item>
<item
name=
"android:textSize"
>
16sp
</item>
<!-- <item name="android:background">?attr/qmui_s_list_item_bg_with_border_bottom_inset_left</item>-->
<!-- <item name="android:background">?attr/qmui_s_list_item_bg_with_border_bottom_inset_left</item>-->
</style>
<style
name=
"QDCommonTitle"
>
...
...
@@ -118,13 +97,37 @@
<item
name=
"android:textSize"
>
15sp
</item>
</style>
<style
name=
"MainQDTopBar"
parent=
"QMUI.TopBar"
>
<!-- <item name="qmui_topbar_bg_color">?attr/app_primary_color</item>-->
<item
name=
"qmui_topbar_title_color"
>
@color/normal_color
</item>
<item
name=
"qmui_topbar_subtitle_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_topbar_text_btn_color_state_list"
>
@color/ui_s_topbar_btn_color
</item>
<item
name=
"qmui_topbar_height"
>
@dimen/head_height
</item>
<item
name=
"qmui_topbar_image_btn_height"
>
30dp
</item>
<item
name=
"qmui_topbar_image_btn_width"
>
30dp
</item>
</style>
<style
name=
"QDTopBar"
parent=
"QMUI.TopBar"
>
<!-- <item name="qmui_topbar_bg_color">?attr/app_primary_color</item>-->
<!-- <item name="qmui_topbar_bg_color">?attr/app_primary_color</item>-->
<item
name=
"qmui_topbar_title_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_topbar_subtitle_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_topbar_text_btn_color_state_list"
>
@color/ui_s_topbar_btn_color
</item>
<item
name=
"qmui_topbar_height"
>
48dp
</item>
<item
name=
"qmui_topbar_image_btn_height"
>
48dp
</item>
<item
name=
"qmui_topbar_height"
>
@dimen/head_height
</item>
<item
name=
"qmui_topbar_image_btn_height"
>
@dimen/head_height
</item>
<item
name=
"qmui_topbar_image_btn_width"
>
@dimen/head_height
</item>
</style>
<style
name=
"QMUITabSegmentStyle"
parent=
"QMUI.TabSegment"
>
<item
name=
"qmui_skin_support_tab_bg"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_separator_color"
>
?attr/qmui_skin_support_color_separator
</item>
<item
name=
"qmui_skin_support_tab_normal_color"
>
@color/normal_color
</item>
<item
name=
"qmui_skin_support_tab_selected_color"
>
@color/theme_color
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_text_color"
>
@color/qmui_config_color_white
</item>
<item
name=
"qmui_skin_support_tab_sign_count_view_bg_color"
>
?attr/qmui_config_color_red
</item>
</style>
<style
name=
"QDRoundButtonStyle"
parent=
"@style/Button.Compat"
>
...
...
@@ -132,7 +135,7 @@
<item
name=
"android:layout_width"
>
wrap_content
</item>
<item
name=
"android:paddingLeft"
>
?attr/qmui_content_spacing_horizontal
</item>
<item
name=
"android:paddingRight"
>
?attr/qmui_content_spacing_horizontal
</item>
<!-- <item name="qmui_borderColor">?attr/qmui_round_btn_border_color</item>-->
<!-- <item name="qmui_borderColor">?attr/qmui_round_btn_border_color</item>-->
<item
name=
"qmui_backgroundColor"
>
@color/ui_s_app_color_blue_3
</item>
<item
name=
"android:textColor"
>
@color/ui_s_app_color_blue_2
</item>
<item
name=
"android:textSize"
>
14sp
</item>
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
View file @
01f2540c
...
...
@@ -76,6 +76,10 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
findViewById
(
R
.
id
.
tv_gsa_user_login
).
setOnClickListener
(
this
);
edAccount
=
findViewById
(
R
.
id
.
ed_login_user_account
);
edPwd
=
findViewById
(
R
.
id
.
ed_login_user_pwd
);
if
(
GsaCloudApplication
.
getLoginToken
(
mContext
).
length
()
>
0
){
finish
();
jumpActivity
();
}
}
@Override
...
...
@@ -142,10 +146,19 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
ToastUtils
.
show
(
LoginActivity
.
this
,
"登錄成功"
);
CC
.
obtainBuilder
(
"Component.Download"
)
.
setActionName
(
"showDownloadActivity"
)
.
build
()
.
call
();
jumpActivity
();
}
private
void
jumpActivity
()
{
CC
.
obtainBuilder
(
"Component.Download"
)
.
setActionName
(
"showDownloadActivity"
)
.
build
()
.
call
();
// CC.obtainBuilder("Component.Main")
// .setActionName("showMainActivity")
// .build()
// .call();
}
@Override
...
...
@@ -161,7 +174,6 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
//登陸
if
(
edAccount
.
getText
()
!=
null
&&
edPwd
.
getText
()
!=
null
)
{
mPresenter
.
login
(
edAccount
.
getText
().
toString
(),
edPwd
.
getText
().
toString
());
// login();
}
break
;
}
...
...
@@ -186,13 +198,11 @@ public class LoginActivity extends BaseActivity<LoginPresenter> implements Login
okHttpClient
.
newCall
(
request
).
enqueue
(
new
Callback
()
{
@Override
public
void
onFailure
(
Call
call
,
IOException
e
)
{
Log
.
e
(
"aaa"
,
"onFailure: "
+
e
.
getMessage
());
}
@Override
public
void
onResponse
(
Call
call
,
Response
response
)
throws
IOException
{
String
json
=
response
.
body
().
string
();
Log
.
e
(
"aaa"
,
"登錄"
+
json
);
LoginBean
loginBean
=
GsonUtils
.
GsonToBean
(
json
,
LoginBean
.
class
);
...
...
user-login/src/main/res/layout/user_login_activity_login.xml
View file @
01f2540c
...
...
@@ -101,7 +101,7 @@
android:layout_marginLeft=
"10dp"
android:layout_marginTop=
"20dp"
android:layout_marginRight=
"10dp"
android:background=
"
#AE2E45
"
android:background=
"
@color/theme_color
"
android:gravity=
"center"
android:padding=
"10dp"
android:text=
"登錄"
...
...
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