Commit 2373b285 by 郑鹏

修改

parent c1f80ddb
...@@ -5,8 +5,6 @@ apply plugin: 'kotlin-android' ...@@ -5,8 +5,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
kapt { kapt {
arguments { arguments {
arg("moduleName", project.getName()) arg("moduleName", project.getName())
...@@ -29,6 +27,8 @@ android { ...@@ -29,6 +27,8 @@ android {
javaCompileOptions.annotationProcessorOptions { javaCompileOptions.annotationProcessorOptions {
arguments = [moduleName: project.getName()] arguments = [moduleName: project.getName()]
} }
ndk { ndk {
abiFilters "armeabi-v7a", "armeabi", "x86" abiFilters "armeabi-v7a", "armeabi", "x86"
} }
...@@ -97,6 +97,11 @@ android { ...@@ -97,6 +97,11 @@ android {
signingConfig signingConfigs.jenkins signingConfig signingConfigs.jenkins
} }
release { release {
//在这里添加:
lintOptions {
checkReleaseBuilds false
abortOnError false
}
// buildConfigField 'String','NAME','value' // buildConfigField 'String','NAME','value'
zipAlignEnabled true zipAlignEnabled true
minifyEnabled false minifyEnabled false
...@@ -255,8 +260,6 @@ dependencies { ...@@ -255,8 +260,6 @@ dependencies {
api 'com.tencent.mid:mid:4.06-Release' api 'com.tencent.mid:mid:4.06-Release'
api 'com.github.liys666666:DoubleClick:V2.0.4' api 'com.github.liys666666:DoubleClick:V2.0.4'
api 'com.readystatesoftware.chuck:library:1.1.0' api 'com.readystatesoftware.chuck:library:1.1.0'
implementation 'com.jakewharton:butterknife:8.5.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.0'
api files('libs/core-3.3.3.jar') api files('libs/core-3.3.3.jar')
} }
......
...@@ -108,8 +108,7 @@ ...@@ -108,8 +108,7 @@
android:value="@string/google_maps_key" /> android:value="@string/google_maps_key" />
<meta-data <meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id" android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="@string/default_notification_channel_id" /> <!-- <meta-data android:name="TA_APPKEY" android:value="AIAF8SC17A3L"/> --> android:value="@string/default_notification_channel_id" />
<!-- <meta-data android:name="InstallChannel" android:value="play"/> -->
<activity <activity
android:name=".ui.home.map.GoogleMapsActivity" android:name=".ui.home.map.GoogleMapsActivity"
android:label="@string/title_activity_google_maps" android:label="@string/title_activity_google_maps"
......
...@@ -83,16 +83,16 @@ public class BaseApi { ...@@ -83,16 +83,16 @@ public class BaseApi {
OkHttpClient OkHttpClient
okHttpClient; okHttpClient;
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
okHttpClient = new OkHttpClient.Builder().readTimeout(18000, TimeUnit.MILLISECONDS) okHttpClient = new OkHttpClient.Builder().readTimeout(50000, TimeUnit.SECONDS)
.connectTimeout(18000, TimeUnit.MILLISECONDS) .connectTimeout(50000, TimeUnit.SECONDS)
.addInterceptor(httpLoggingInterceptor) .addInterceptor(httpLoggingInterceptor)
.addInterceptor(new TokenInterceptor()) .addInterceptor(new TokenInterceptor())
.addNetworkInterceptor(new StethoInterceptor()) .addNetworkInterceptor(new StethoInterceptor())
.addInterceptor(new ChuckInterceptor(DankalApplication.getContext())) .addInterceptor(new ChuckInterceptor(DankalApplication.getContext()))
.build(); .build();
} else { } else {
okHttpClient = new OkHttpClient.Builder().readTimeout(18000, TimeUnit.MILLISECONDS) okHttpClient = new OkHttpClient.Builder().readTimeout(50000, TimeUnit.SECONDS)
.connectTimeout(18000, TimeUnit.MILLISECONDS) .connectTimeout(50000, TimeUnit.SECONDS)
.addInterceptor(httpLoggingInterceptor) .addInterceptor(httpLoggingInterceptor)
.addInterceptor(new TokenInterceptor()) .addInterceptor(new TokenInterceptor())
.addNetworkInterceptor(new StethoInterceptor()) .addNetworkInterceptor(new StethoInterceptor())
......
...@@ -13,12 +13,12 @@ import cn.dankal.basiclib.util.WebViewUtil; ...@@ -13,12 +13,12 @@ import cn.dankal.basiclib.util.WebViewUtil;
import cn.dankal.client.R; import cn.dankal.client.R;
public abstract class BaseWebviewActivity extends BaseActivity { public abstract class BaseWebviewActivity extends BaseActivity {
@BindView(R.id.wb)
public WebView wb; public WebView wb;
public WebChromeClient webChromeClient; public WebChromeClient webChromeClient;
@Override @Override
public void initComponents() { public void initComponents() {
wb=findViewById(R.id.wb);
WebViewUtil.initWebViewSettings(wb, this); WebViewUtil.initWebViewSettings(wb, this);
webChromeClient = new WebChromeClient(); webChromeClient = new WebChromeClient();
initData(); initData();
...@@ -56,6 +56,7 @@ public abstract class BaseWebviewActivity extends BaseActivity { ...@@ -56,6 +56,7 @@ public abstract class BaseWebviewActivity extends BaseActivity {
public void initData() { public void initData() {
wb.setWebViewClient(new WebViewClient() { wb.setWebViewClient(new WebViewClient() {
@Override @Override
public void onPageStarted(WebView view, String url, Bitmap favicon) { public void onPageStarted(WebView view, String url, Bitmap favicon) {
......
...@@ -43,12 +43,12 @@ public class BigPhotoActivity extends BaseActivity { ...@@ -43,12 +43,12 @@ public class BigPhotoActivity extends BaseActivity {
public static final String PicIndex = "picindex"; public static final String PicIndex = "picindex";
public static boolean hasJump = false; public static boolean hasJump = false;
@BindView(R.id.progressBar)
ProgressBar progressBar; ProgressBar progressBar;
@BindView(R.id.vp)
ViewPager viewPager; ViewPager viewPager;
@BindView(R.id.tv_page_index)
TextView tvPageIndex; TextView tvPageIndex;
int picIndex; int picIndex;
...@@ -60,6 +60,7 @@ public class BigPhotoActivity extends BaseActivity { ...@@ -60,6 +60,7 @@ public class BigPhotoActivity extends BaseActivity {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
ButterKnife.bind(this); ButterKnife.bind(this);
TitleBarUtils.compat(this, getResources().getColor(R.color.color00)); TitleBarUtils.compat(this, getResources().getColor(R.color.color00));
hasJump = true; hasJump = true;
...@@ -89,6 +90,12 @@ public class BigPhotoActivity extends BaseActivity { ...@@ -89,6 +90,12 @@ public class BigPhotoActivity extends BaseActivity {
} }
} }
private void initView() {
progressBar = findViewById(R.id.progressBar);
viewPager = findViewById(R.id.vp);
tvPageIndex = findViewById(R.id.tv_page_index);
}
private ImageView loadImageVIew(String url) { private ImageView loadImageVIew(String url) {
if (!url.contains("http")) { if (!url.contains("http")) {
......
...@@ -229,8 +229,7 @@ public class TabSegment extends HorizontalScrollView { ...@@ -229,8 +229,7 @@ public class TabSegment extends HorizontalScrollView {
mHasIndicator = array.getBoolean(R.styleable.TabSegment_tab_has_indicator, true); mHasIndicator = array.getBoolean(R.styleable.TabSegment_tab_has_indicator, true);
mIndicatorHeight = array.getDimensionPixelSize(R.styleable.TabSegment_tab_indicator_height, mIndicatorHeight = array.getDimensionPixelSize(R.styleable.TabSegment_tab_indicator_height,
getResources().getDimensionPixelSize(R.dimen.tab_segment_indicator_height)); getResources().getDimensionPixelSize(R.dimen.tab_segment_indicator_height));
mTabTextSize = array.getDimensionPixelSize(R.styleable.TabSegment_android_textSize, mTabTextSize = getResources().getDimensionPixelSize(R.dimen.tab_segment_text_size);
getResources().getDimensionPixelSize(R.dimen.tab_segment_text_size));
mIndicatorTop = array.getBoolean(R.styleable.TabSegment_tab_indicator_top, false); mIndicatorTop = array.getBoolean(R.styleable.TabSegment_tab_indicator_top, false);
mDefaultTabIconPosition = array.getInt(R.styleable.TabSegment_tab_icon_position, ICON_POSITION_LEFT); mDefaultTabIconPosition = array.getInt(R.styleable.TabSegment_tab_icon_position, ICON_POSITION_LEFT);
mMode = array.getInt(R.styleable.TabSegment_tab_mode, MODE_FIXED); mMode = array.getInt(R.styleable.TabSegment_tab_mode, MODE_FIXED);
......
...@@ -137,7 +137,7 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH ...@@ -137,7 +137,7 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH
break; break;
case HomeEntity.MENU: case HomeEntity.MENU:
if (titles!=null && titles.size()>0){ if (titles != null && titles.size() > 0) {
tabLayout = helper.itemView.findViewById(R.id.sliding_tabs); tabLayout = helper.itemView.findViewById(R.id.sliding_tabs);
ViewPager viewPager = helper.itemView.findViewById(R.id.vp_pager); ViewPager viewPager = helper.itemView.findViewById(R.id.vp_pager);
viewPager.setAdapter(fragmentAdapter); viewPager.setAdapter(fragmentAdapter);
...@@ -156,13 +156,13 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH ...@@ -156,13 +156,13 @@ public class HomeAdapter extends BaseMultiItemQuickAdapter<HomeEntity, BaseViewH
public class BannerItemView implements VH<String> { public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg; ImageView mIvImg;
@Override @Override
public View createView(LayoutInflater inflater, ViewGroup container) { public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false); View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate); mIvImg = inflate.findViewById(R.id.iv_img);
return inflate; return inflate;
} }
......
...@@ -81,50 +81,42 @@ public class CarShopAdapter extends BaseQuickAdapter<ShopCarEntity.DataBean, Bas ...@@ -81,50 +81,42 @@ public class CarShopAdapter extends BaseQuickAdapter<ShopCarEntity.DataBean, Bas
}); });
carShopChildAdapter.setOnItemChildClickListener((adapter, view, position) -> { carShopChildAdapter.setOnItemChildClickListener((adapter, view, position) -> {
switch (view.getId()) { if (view.getId() == R.id.tv_right_delete) {
case R.id.tv_right_delete: CommonDialog.Builder builder = new CommonDialog.Builder(context);
builder.setTitle(context.getString(R.string.need_to_delete));
CommonDialog.Builder builder = new CommonDialog.Builder(context); builder.setNegativeButton(R.string.cancel, context.getResources().getColor(R.color.font_313131), type -> {
builder.setTitle(context.getString(R.string.need_to_delete)); if (commonDialog != null) {
builder.setNegativeButton(R.string.cancel, context.getResources().getColor(R.color.font_313131), type -> { commonDialog.dismiss();
if (commonDialog != null) {
commonDialog.dismiss();
}
});
builder.setPositiveButton(R.string.ok, context.getResources().getColor(R.color.font_313131), type -> {
if (commonDialog != null) {
commonDialog.dismiss();
}
operateCart(carShopChildAdapter, list.get(position).getUuid(), "2", position);
});
commonDialog = builder.create();
commonDialog.show();
break;
case R.id.cl_car_reduce:
int number = list.get(position).getNumber();
if (number > 1) {
carShopChildAdapter.updateNumber(position, --number);
carShopChildAdapter.notifyItemChanged(position);
operateCart(carShopChildAdapter, list.get(position).getUuid(), "1", position);
} else {
ToastUtils.showShort(R.string.no_more_reductions);
} }
break; });
case R.id.cl_car_add: builder.setPositiveButton(R.string.ok, context.getResources().getColor(R.color.font_313131), type -> {
int numberTow = list.get(position).getNumber(); if (commonDialog != null) {
carShopChildAdapter.updateNumber(position, ++numberTow); commonDialog.dismiss();
carShopChildAdapter.notifyItemChanged(position);
addCart(list.get(position));
break;
case R.id.cb_select_shop:
if (selectShowListen != null) {
selectShowListen.onShowListen();
} }
break; operateCart(carShopChildAdapter, list.get(position).getUuid(), "2", position);
});
commonDialog = builder.create();
commonDialog.show();
} else if (view.getId() == R.id.cl_car_reduce) {
int number = list.get(position).getNumber();
if (number > 1) {
carShopChildAdapter.updateNumber(position, --number);
carShopChildAdapter.notifyItemChanged(position);
operateCart(carShopChildAdapter, list.get(position).getUuid(), "1", position);
} else {
ToastUtils.showShort(R.string.no_more_reductions);
}
} else if (view.getId() == R.id.cl_car_add) {
int numberTow = list.get(position).getNumber();
carShopChildAdapter.updateNumber(position, ++numberTow);
carShopChildAdapter.notifyItemChanged(position);
addCart(list.get(position));
} else if (view.getId() == R.id.cb_select_shop) {
if (selectShowListen != null) {
selectShowListen.onShowListen();
}
} }
}); });
......
...@@ -13,11 +13,13 @@ import android.support.constraint.ConstraintLayout ...@@ -13,11 +13,13 @@ import android.support.constraint.ConstraintLayout
import android.support.v4.app.ActivityCompat import android.support.v4.app.ActivityCompat
import android.support.v4.app.Fragment import android.support.v4.app.Fragment
import android.support.v7.widget.LinearLayoutCompat import android.support.v7.widget.LinearLayoutCompat
import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.WindowManager import android.view.WindowManager
import cn.dankal.basiclib.DankalApplication import cn.dankal.basiclib.DankalApplication
import cn.dankal.basiclib.api.HomeServiceFactory import cn.dankal.basiclib.api.HomeServiceFactory
import cn.dankal.basiclib.api.RestaurantServiceFactory
import cn.dankal.basiclib.base.activity.BaseActivity import cn.dankal.basiclib.base.activity.BaseActivity
import cn.dankal.basiclib.base.fragmentactivity.FragmentAdapter import cn.dankal.basiclib.base.fragmentactivity.FragmentAdapter
import cn.dankal.basiclib.constant.Constant import cn.dankal.basiclib.constant.Constant
...@@ -48,8 +50,11 @@ import org.greenrobot.eventbus.EventBus ...@@ -48,8 +50,11 @@ import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
import cn.dankal.basiclib.protocol.MainProtocol import cn.dankal.basiclib.protocol.MainProtocol
import cn.dankal.client.ui.home.details.MerchantDetailsActivity
import cn.dankal.client.ui.personal.order.food.FoodOrderActivity import cn.dankal.client.ui.personal.order.food.FoodOrderActivity
import cn.dankal.entities.home.QRCodeEntity
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
@Route(path = MainProtocol.MAIN) @Route(path = MainProtocol.MAIN)
class HomeActivity : BaseActivity(), View.OnClickListener { class HomeActivity : BaseActivity(), View.OnClickListener {
...@@ -67,10 +72,9 @@ class HomeActivity : BaseActivity(), View.OnClickListener { ...@@ -67,10 +72,9 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
when (v?.id) { when (v?.id) {
R.id.iv_home_search -> startActivity(Intent(this, SearchShopActivity::class.java)) R.id.iv_home_search -> startActivity(Intent(this, SearchShopActivity::class.java))
R.id.iv_home_sweep -> { R.id.iv_home_sweep -> {
/* requestPermission(Permission.CAMERA) { requestPermission(Permission.CAMERA) {
startActivityForResult(Intent(this, CaptureActivity::class.java), ConstantsHomeType.SCAN) startActivityForResult(Intent(this, CaptureActivity::class.java), ConstantsHomeType.SCAN)
}*/ }
startActivity(Intent(this, FoodOrderActivity::class.java));
} }
R.id.iv_home_location -> { R.id.iv_home_location -> {
startActivity(Intent(this, GoogleMapsActivity::class.java)) startActivity(Intent(this, GoogleMapsActivity::class.java))
...@@ -178,6 +182,13 @@ class HomeActivity : BaseActivity(), View.OnClickListener { ...@@ -178,6 +182,13 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
//iv_home_search.setOnClickListener(this) //iv_home_search.setOnClickListener(this)
iv_home_sweep.setOnClickListener(this) iv_home_sweep.setOnClickListener(this)
//iv_home_location.setOnClickListener(this) //iv_home_location.setOnClickListener(this)
iv_home_sweep.setOnLongClickListener(object :View.OnLongClickListener{
override fun onLongClick(v: View?): Boolean {
//startActivity(Intent(this@HomeActivity,FoodOrderActivity::class.java))
startActivity(Intent(this@HomeActivity, SearchShopActivity::class.java))
return true
}
})
} }
//设置顶部数据 //设置顶部数据
...@@ -228,4 +239,48 @@ class HomeActivity : BaseActivity(), View.OnClickListener { ...@@ -228,4 +239,48 @@ class HomeActivity : BaseActivity(), View.OnClickListener {
it.notifyDataSetChanged() it.notifyDataSetChanged()
} }
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == ConstantsHomeType.SCAN && resultCode == RESULT_OK && data != null) {
var result = data.getStringExtra(com.yzq.zxinglibrary.common.Constant.CODED_CONTENT)
if (TextUtils.isEmpty(result)) {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
return
}
try {
var qrCodeEntity = Gson().fromJson<QRCodeEntity>(result, QRCodeEntity::class.java)
RestaurantServiceFactory.checkTableState(qrCodeEntity.tableUuid).subscribe(object : AbstractDialogSubscriber<String>(this) {
override fun onNext(s: String) {
when (s) {
"0" -> {
startActivity(Intent(this@HomeActivity, MerchantDetailsActivity::class.java)
.putExtra(MerchantDetailsActivity.HOTELUUID, qrCodeEntity.hotelUuid)
.putExtra(MerchantDetailsActivity.TABLE_UUID, qrCodeEntity.tableUuid)
.putExtra(MerchantDetailsActivity.TABLE_NUMBER, qrCodeEntity.tableNumber.toString()))
}
"1"//不存在
-> {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
"2"//被使用
-> {
showDialogStateTow(getString(R.string.the_table_number_is_in_use))
}
"3"//已隐藏
-> {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
}
}
})
} catch (e: java.lang.Exception) {
startActivity(Intent(this@HomeActivity, ScanResultActivity::class.java))
}
}
}
} }
\ No newline at end of file
...@@ -62,10 +62,8 @@ import io.reactivex.functions.Consumer; ...@@ -62,10 +62,8 @@ import io.reactivex.functions.Consumer;
public class MenuItemFragment extends BaseFragment { public class MenuItemFragment extends BaseFragment {
@BindView(R.id.rl_menu_type)
RecyclerView rlMenuType; RecyclerView rlMenuType;
@BindView(R.id.rv_bottom_child)
RecyclerView rlRoundList; RecyclerView rlRoundList;
private MenuItemAdapter menuItemAdapter; private MenuItemAdapter menuItemAdapter;
...@@ -96,6 +94,7 @@ public class MenuItemFragment extends BaseFragment { ...@@ -96,6 +94,7 @@ public class MenuItemFragment extends BaseFragment {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
rxPermissions = new RxPermissions(getActivity()); rxPermissions = new RxPermissions(getActivity());
...@@ -123,6 +122,13 @@ public class MenuItemFragment extends BaseFragment { ...@@ -123,6 +122,13 @@ public class MenuItemFragment extends BaseFragment {
requestAllList(); requestAllList();
} }
private void initView() {
rlMenuType = mContentView.findViewById(R.id.rl_menu_type);
rlRoundList = mContentView.findViewById(R.id.rv_bottom_child);
mContentView.findViewById(R.id.tv_home_more).setOnClickListener(this::onViewClicked);
mContentView.findViewById(R.id.tv_item_filter).setOnClickListener(this::onViewClicked);
}
//开始请求数据 //开始请求数据
private void requestAllList() { private void requestAllList() {
...@@ -237,15 +243,12 @@ public class MenuItemFragment extends BaseFragment { ...@@ -237,15 +243,12 @@ public class MenuItemFragment extends BaseFragment {
} }
@OnClick({R.id.tv_home_more, R.id.tv_item_filter})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_home_more: if (view.getId() == R.id.tv_home_more) {
startActivity(new Intent(getActivity(), RecommendMerchantActivity.class).putExtra(RecommendMerchantActivity.UUID, uuid)); startActivity(new Intent(getActivity(), RecommendMerchantActivity.class).putExtra(RecommendMerchantActivity.UUID, uuid));
break; } else if (view.getId() == R.id.tv_item_filter) {
case R.id.tv_item_filter: showTopDialog();
showTopDialog();
break;
} }
} }
......
...@@ -52,17 +52,16 @@ import cn.dankal.client.util.UIUtile; ...@@ -52,17 +52,16 @@ import cn.dankal.client.util.UIUtile;
* Created by zhengpeng on 2019/4/29. * Created by zhengpeng on 2019/4/29.
*/ */
public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMoreListener { public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMoreListener {
@BindView(R.id.fl_tag_one)
TagFlowLayout flTagOne; TagFlowLayout flTagOne;
@BindView(R.id.lv_history)
NestedListView lvListHistory; NestedListView lvListHistory;
@BindView(R.id.et_search)
EditText etSearch; EditText etSearch;
@BindView(R.id.nv_search)
NestedScrollView nvSearch; NestedScrollView nvSearch;
@BindView(R.id.rv_search_result)
RecyclerView rvSearchResult; RecyclerView rvSearchResult;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout; SmartRefreshLayout refreshLayout;
private List<HistoryEntity> historyEntities; private List<HistoryEntity> historyEntities;
...@@ -92,7 +91,7 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor ...@@ -92,7 +91,7 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.search)); addSingleTitleBar(getString(R.string.search));
etSearch.setOnEditorActionListener((arg0, arg1, arg2) -> { etSearch.setOnEditorActionListener((arg0, arg1, arg2) -> {
...@@ -167,6 +166,18 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor ...@@ -167,6 +166,18 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
requestHotListData(); requestHotListData();
} }
private void initView() {
flTagOne = findViewById(R.id.fl_tag_one);
lvListHistory = findViewById(R.id.lv_history);
etSearch = findViewById(R.id.et_search);
nvSearch = findViewById(R.id.nv_search);
rvSearchResult = findViewById(R.id.rv_search_result);
refreshLayout = findViewById(R.id.refreshLayout);
findViewById(R.id.tv_search).setOnClickListener(this::onViewClicked);
findViewById(R.id.tv_clean_history).setOnClickListener(this::onViewClicked);
}
/** /**
* 搜索 * 搜索
* *
...@@ -285,26 +296,22 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor ...@@ -285,26 +296,22 @@ public class SearchShopActivity extends BaseActivity implements OnRefreshLoadMor
} }
@OnClick({R.id.tv_search, R.id.tv_clean_history})
public void onViewClicked(View view) {
switch (view.getId()) {
case R.id.tv_search:
searchContent = etSearch.getText().toString();
stareSearchData(searchContent);
//开始搜索
searchContent(true, searchContent);
break; public void onViewClicked(View view) {
case R.id.tv_clean_history: if (view.getId() == R.id.tv_search) {
showDialog(null, getString(R.string.whether_to_clear_search_history), type -> { searchContent = etSearch.getText().toString();
LitePal.deleteAll(HistoryEntity.class); stareSearchData(searchContent);
listTow.clear(); //开始搜索
shopArrayAdapter.notifyDataSetChanged(); searchContent(true, searchContent);
if (commonDialog != null) { } else if (view.getId() == R.id.tv_clean_history) {
commonDialog.dismiss(); showDialog(null, getString(R.string.whether_to_clear_search_history), type -> {
} LitePal.deleteAll(HistoryEntity.class);
}, true, true); listTow.clear();
break; shopArrayAdapter.notifyDataSetChanged();
if (commonDialog != null) {
commonDialog.dismiss();
}
}, true, true);
} }
} }
......
...@@ -56,27 +56,27 @@ import io.reactivex.disposables.Disposable; ...@@ -56,27 +56,27 @@ import io.reactivex.disposables.Disposable;
*/ */
public class MerchantDetailsActivity extends BaseActivity { public class MerchantDetailsActivity extends BaseActivity {
@BindView(R.id.sliding_tabs)
SlidingTabLayout slidingTabs; SlidingTabLayout slidingTabs;
@BindView(R.id.vp_pager)
ViewPager vpPager; ViewPager vpPager;
@BindView(R.id.tv_restaurant_name)
TextView tvRestaurantName; TextView tvRestaurantName;
@BindView(R.id.tv_restaurant_stamp)
TextView tvRestaurantStamp; TextView tvRestaurantStamp;
@BindView(R.id.tv_restaurant_coupons)
TextView tvRestaurantCoupons; TextView tvRestaurantCoupons;
@BindView(R.id.marqueeView)
MarqueeView marqueeView; MarqueeView marqueeView;
@BindView(R.id.tv_tab_number)
TextView tvTabNumber;//桌号 TextView tvTabNumber;//桌号
@BindView(R.id.tv_stamp_tag)
TextView tvStampTag; TextView tvStampTag;
@BindView(R.id.tv_status_bar)
TextView tvStatusBar; TextView tvStatusBar;
@BindView(R.id.sv_store_star)
GradeStarView svStoreStar; GradeStarView svStoreStar;
@BindView(R.id.tv_grade)
TextView tvGrade; TextView tvGrade;
private int userStampNumber = 0;//用户在当前店铺拥有的邮票数 private int userStampNumber = 0;//用户在当前店铺拥有的邮票数
...@@ -120,24 +120,20 @@ public class MerchantDetailsActivity extends BaseActivity { ...@@ -120,24 +120,20 @@ public class MerchantDetailsActivity extends BaseActivity {
return R.layout.activity_merchant_details; return R.layout.activity_merchant_details;
} }
@OnClick({R.id.iv_merchant_return, R.id.iv_merchant_scan, R.id.tv_see_evaluation})
public void onClickView(View view) { public void onClickView(View view) {
if (ButtonUtil.isFastDoubleTowBiClick()) { if (ButtonUtil.isFastDoubleTowBiClick()) {
return; return;
} }
switch (view.getId()) { if (view.getId()==R.id.iv_merchant_return){
case R.id.iv_merchant_return: finish();
finish(); }else if (view.getId()==R.id.iv_merchant_scan){
break; requestPermission(Permission.CAMERA, () -> startActivityForResult(new Intent(MerchantDetailsActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN));
case R.id.iv_merchant_scan: }else if (view.getId()==R.id.tv_see_evaluation){
requestPermission(Permission.CAMERA, () -> startActivityForResult(new Intent(MerchantDetailsActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN)); Intent intent = new Intent(this, FoodAllEvaluateActivity.class);
break; intent.putExtra("hotel_uuid", storeUUId);
case R.id.tv_see_evaluation: intent.putExtra("level", mStarLevel);
Intent intent = new Intent(this, FoodAllEvaluateActivity.class); startActivity(intent);
intent.putExtra("hotel_uuid", storeUUId);
intent.putExtra("level", mStarLevel);
startActivity(intent);
break;
} }
} }
...@@ -195,9 +191,28 @@ public class MerchantDetailsActivity extends BaseActivity { ...@@ -195,9 +191,28 @@ public class MerchantDetailsActivity extends BaseActivity {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
initData(getIntent()); initData(getIntent());
} }
private void initView() {
slidingTabs = findViewById(R.id.sliding_tabs);
vpPager = findViewById(R.id.vp_pager);
tvRestaurantName = findViewById(R.id.tv_restaurant_name);
tvRestaurantStamp = findViewById(R.id.tv_restaurant_stamp);
tvRestaurantCoupons = findViewById(R.id.tv_restaurant_coupons);
marqueeView = findViewById(R.id.marqueeView);
tvTabNumber = findViewById(R.id.tv_tab_number);
tvStampTag = findViewById(R.id.tv_stamp_tag);
tvStatusBar = findViewById(R.id.tv_status_bar);
svStoreStar = findViewById(R.id.sv_store_star);
tvGrade = findViewById(R.id.tv_grade);
findViewById(R.id.iv_merchant_return).setOnClickListener(this::onClickView);
findViewById(R.id.iv_merchant_scan).setOnClickListener(this::onClickView);
findViewById(R.id.tv_see_evaluation).setOnClickListener(this::onClickView);
}
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
......
...@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable; ...@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable;
* Created by zhengpeng on 2019/6/24. * Created by zhengpeng on 2019/6/24.
*/ */
public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadMoreListener { public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadMoreListener {
@BindView(R.id.rv_details_title)
RecyclerView rvDetailsTitle; RecyclerView rvDetailsTitle;
@BindView(R.id.rv_details_content)
RecyclerView rvDetailsContent; RecyclerView rvDetailsContent;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout; SmartRefreshLayout refreshLayout;
Unbinder unbinder; Unbinder unbinder;
...@@ -69,6 +69,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM ...@@ -69,6 +69,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
//配置商品内容 //配置商品内容
listData = new ArrayList<>(); listData = new ArrayList<>();
linearLayoutManagerContent = new LinearLayoutManager(getActivity()); linearLayoutManagerContent = new LinearLayoutManager(getActivity());
...@@ -101,6 +102,13 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM ...@@ -101,6 +102,13 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
} }
} }
private void initView() {
rvDetailsTitle = mContentView.findViewById(R.id.rv_details_title);
rvDetailsContent = mContentView.findViewById(R.id.rv_details_content);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
}
private void requestMallType(String storeUUID) { private void requestMallType(String storeUUID) {
MallServiceFactory.getStoreDetail(storeUUID).subscribe(new AbstractDialogSubscriber<MerchantHomeEntity>(this) { MallServiceFactory.getStoreDetail(storeUUID).subscribe(new AbstractDialogSubscriber<MerchantHomeEntity>(this) {
@Override @Override
...@@ -158,7 +166,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM ...@@ -158,7 +166,7 @@ public class MerchantMallFragment extends BaseFragment implements OnRefreshLoadM
List<MerchantShopEntity.DataBean> dataBeans = entity.getData(); List<MerchantShopEntity.DataBean> dataBeans = entity.getData();
if (isRefreshing) { if (isRefreshing) {
if (adapterContent != null && rvDetailsContent!=null) { if (adapterContent != null && rvDetailsContent != null) {
listData.clear(); listData.clear();
if (dataBeans == null || dataBeans.size() == 0) { if (dataBeans == null || dataBeans.size() == 0) {
adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent); adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent);
......
...@@ -103,7 +103,7 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener { ...@@ -103,7 +103,7 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener {
private fun callPayment() { private fun callPayment() {
RestaurantServiceFactory.userPay(map).subscribe(object : AbstractDialogSubscriber<PayParameterEntity>(this) { RestaurantServiceFactory.userPay(map).subscribe(object : AbstractDialogSubscriber<PayParameterEntity>(this) {
override fun onNext(t: PayParameterEntity) { override fun onNext(t: PayParameterEntity) {
t.apply { /*t.apply {
orderId = order_uuid orderId = order_uuid
stampNumber = stamp_number stampNumber = stamp_number
val intent = Intent(this@OrderResultActivity, SelectPayFoodActivity::class.java) val intent = Intent(this@OrderResultActivity, SelectPayFoodActivity::class.java)
...@@ -112,7 +112,28 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener { ...@@ -112,7 +112,28 @@ class OrderResultActivity : BaseActivity(), View.OnClickListener {
bundle.putString("storeUUID", storeUUID) bundle.putString("storeUUID", storeUUID)
intent.putExtras(bundle) intent.putExtras(bundle)
startActivity(intent) startActivity(intent)
}*/
//测试代码
//删除本地购物车商品
val entities = LitePal.where("storeUUid=? ", storeUUID).find(FoodEntity::class.java)
entities?.let {
for (j in 0 until entities.size) {
val foodEntity = entities[j]
foodEntity.delete()
}
EventBus.getDefault().post(ShopCarRefreshEvent())
} }
ToastUtils.showShort(getString(R.string.successful_payment))
val intent = Intent(this@OrderResultActivity, ResultPageActivity::class.java)
var bundle = Bundle()
bundle.putString("order_id", orderId)
bundle.putSerializable("food_list", foodEntity)
bundle.putInt("stampNumber", stampNumber)
intent.putExtras(bundle)
startActivity(intent)
finish()
} }
}) })
} }
......
...@@ -8,6 +8,7 @@ import cn.dankal.entities.home.CommitHotelEntity ...@@ -8,6 +8,7 @@ import cn.dankal.entities.home.CommitHotelEntity
import cn.dankal.client.R import cn.dankal.client.R
import cn.dankal.client.adapter.home.OrderResultAdapter import cn.dankal.client.adapter.home.OrderResultAdapter
import cn.dankal.client.constants.ConstantsRestaurantType import cn.dankal.client.constants.ConstantsRestaurantType
import cn.dankal.client.ui.personal.order.food.FoodEvaluationActivity
import cn.dankal.client.ui.personal.order.food.OrderDetailsActivity import cn.dankal.client.ui.personal.order.food.OrderDetailsActivity
import cn.dankal.client.util.UIUtile import cn.dankal.client.util.UIUtile
import kotlinx.android.synthetic.main.activity_result_page.* import kotlinx.android.synthetic.main.activity_result_page.*
...@@ -32,6 +33,10 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener { ...@@ -32,6 +33,10 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener {
R.id.btn_order -> {//继续点餐 R.id.btn_order -> {//继续点餐
finish() finish()
} }
R.id.btn_evaluate->{
startActivity(Intent(this@ResultPageActivity, FoodEvaluationActivity::class.java).putExtra("order_id", orderId))
finish()
}
} }
} }
...@@ -68,5 +73,6 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener { ...@@ -68,5 +73,6 @@ class ResultPageActivity : BaseActivity(), View.OnClickListener {
btn_see_order.setOnClickListener(this) btn_see_order.setOnClickListener(this)
btn_order.setOnClickListener(this) btn_order.setOnClickListener(this)
btn_evaluate.setOnClickListener(this)
} }
} }
...@@ -52,6 +52,8 @@ class SelectPayFoodActivity : BaseActivity(), View.OnClickListener { ...@@ -52,6 +52,8 @@ class SelectPayFoodActivity : BaseActivity(), View.OnClickListener {
ll_w_pay.setOnClickListener(this) ll_w_pay.setOnClickListener(this)
ll_a_pay.setOnClickListener(this) ll_a_pay.setOnClickListener(this)
} }
private fun payShop(payEntity: PayParameterEntity) { private fun payShop(payEntity: PayParameterEntity) {
......
...@@ -15,13 +15,12 @@ import cn.dankal.client.R; ...@@ -15,13 +15,12 @@ import cn.dankal.client.R;
* Created by zhengpeng on 2019/6/5. * Created by zhengpeng on 2019/6/5.
*/ */
public class BannerItemView implements VH<String> { public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg; ImageView mIvImg;
@Override @Override
public View createView(LayoutInflater inflater, ViewGroup container) { public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false); View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate); mIvImg = inflate.findViewById(R.id.iv_img);
return inflate; return inflate;
} }
......
...@@ -324,32 +324,29 @@ public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallba ...@@ -324,32 +324,29 @@ public class GoogleMapsActivity extends BaseActivity implements OnMapReadyCallba
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation // TODO: add setContentView(...) invocation
ButterKnife.bind(this); findViewById(id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(id.iv_menu).setOnClickListener(this::onViewClicked);
} }
@OnClick({id.iv_location, id.iv_menu})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId() == R.id.iv_location) {
case id.iv_location://定位到自己旁边 if (mMap == null) {
if (mMap == null) { return;
return; }
} Location location = mMap.getMyLocation();
Location location = mMap.getMyLocation(); if (location == null)
if (location == null) location = locationTrackObj.getLocation();
location = locationTrackObj.getLocation(); try {
try { mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(),
LatLng(location.getLatitude(), location.getLongitude()), 16));
location.getLongitude()), 16));
//requestAllList();
//requestAllList(); } catch (Exception e) {
} catch (Exception e) { e.printStackTrace();
e.printStackTrace(); }
} } else if (view.getId() == R.id.iv_menu) {
break; startActivity(new Intent(GoogleMapsActivity.this, NearbyMerchantActivity.class));
case id.iv_menu:
startActivity(new Intent(GoogleMapsActivity.this, NearbyMerchantActivity.class));
break;
} }
} }
......
...@@ -244,32 +244,29 @@ public class GoogleMapsMallActivity extends BaseActivity implements OnMapReadyCa ...@@ -244,32 +244,29 @@ public class GoogleMapsMallActivity extends BaseActivity implements OnMapReadyCa
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation // TODO: add setContentView(...) invocation
ButterKnife.bind(this); findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
} }
@OnClick({R.id.iv_location, R.id.iv_menu})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId() == R.id.iv_location) {
case R.id.iv_location://定位到自己旁边 if (mMap == null) {
if (mMap == null) { return;
return; }
} Location location = mMap.getMyLocation();
Location location = mMap.getMyLocation(); if (location == null)
if (location == null) location = locationTrackObj.getLocation();
location = locationTrackObj.getLocation(); try {
try { mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(),
LatLng(location.getLatitude(), location.getLongitude()), 16));
location.getLongitude()), 12));
//requestAllList();
//requestAllList(); } catch (Exception e) {
} catch (Exception e) { e.printStackTrace();
e.printStackTrace(); }
} } else if (view.getId() == R.id.iv_menu) {
break; startActivity(new Intent(GoogleMapsMallActivity.this, NearbyMerchantActivity.class));
case R.id.iv_menu:
startActivity(new Intent(GoogleMapsMallActivity.this, NearbyMerchantActivity.class));
break;
} }
} }
......
...@@ -286,32 +286,30 @@ public class GoogleMapsMerchantActivity extends BaseActivity implements OnMapRea ...@@ -286,32 +286,30 @@ public class GoogleMapsMerchantActivity extends BaseActivity implements OnMapRea
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation // TODO: add setContentView(...) invocation
ButterKnife.bind(this); findViewById(R.id.iv_location).setOnClickListener(this::onViewClicked);
findViewById(R.id.iv_menu).setOnClickListener(this::onViewClicked);
} }
@OnClick({R.id.iv_location, R.id.iv_menu})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId() == R.id.iv_location) {
case R.id.iv_location://定位到自己旁边 if (mMap == null) {
if (mMap == null) { return;
return; }
} Location location = mMap.getMyLocation();
Location location = mMap.getMyLocation(); if (location == null)
if (location == null) location = locationTrackObj.getLocation();
location = locationTrackObj.getLocation(); try {
try { mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(),
LatLng(location.getLatitude(), location.getLongitude()), 16));
location.getLongitude()), 12));
//requestAllList();
//requestAllList(); } catch (Exception e) {
} catch (Exception e) { e.printStackTrace();
e.printStackTrace(); }
} } else if (view.getId() == R.id.iv_menu) {
break; startActivity(new Intent(GoogleMapsMerchantActivity.this, NearbyMerchantActivity.class));
case R.id.iv_menu:
startActivity(new Intent(GoogleMapsMerchantActivity.this, NearbyMerchantActivity.class));
break;
} }
} }
......
...@@ -27,7 +27,6 @@ public class MyQueueFragment extends BaseFragment { ...@@ -27,7 +27,6 @@ public class MyQueueFragment extends BaseFragment {
private static final String ARG_PARAM1 = "param1"; private static final String ARG_PARAM1 = "param1";
@BindView(R.id.rv_my_queue)
RecyclerView rvMyQueue; RecyclerView rvMyQueue;
Unbinder unbinder; Unbinder unbinder;
...@@ -55,6 +54,7 @@ public class MyQueueFragment extends BaseFragment { ...@@ -55,6 +54,7 @@ public class MyQueueFragment extends BaseFragment {
@Override @Override
protected void initComponents() { protected void initComponents() {
rvMyQueue = mContentView.findViewById(R.id.rv_my_queue);
if (getArguments() != null) { if (getArguments() != null) {
mParam1 = getArguments().getInt(ARG_PARAM1); mParam1 = getArguments().getInt(ARG_PARAM1);
} }
...@@ -87,7 +87,7 @@ public class MyQueueFragment extends BaseFragment { ...@@ -87,7 +87,7 @@ public class MyQueueFragment extends BaseFragment {
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
addNetworkRequest(d); addNetworkRequest(d);
} }
}); });
} }
......
...@@ -19,7 +19,7 @@ class FoodOrderActivity : BaseActivity() { ...@@ -19,7 +19,7 @@ class FoodOrderActivity : BaseActivity() {
addSingleTitleBar(getString(R.string.food_order)) addSingleTitleBar(getString(R.string.food_order))
var dataList = ArrayList<Fragment>() var dataList = ArrayList<Fragment>()
dataList.add(FoodOrderFragment.newInstance("0"))//1-已支付 / 待上餐/ 待发货); dataList.add(FoodOrderFragment.newInstance("1"))//1-已支付 / 待上餐/ 待发货);
dataList.add(FoodOrderFragment.newInstance("4"))//4-已完成 dataList.add(FoodOrderFragment.newInstance("4"))//4-已完成
dataList.add(FoodOrderFragment.newInstance("11"))//8-已取消(退款成功) dataList.add(FoodOrderFragment.newInstance("11"))//8-已取消(退款成功)
dataList.add(FoodOrderFragment.newInstance("2"))//2-售后订单 dataList.add(FoodOrderFragment.newInstance("2"))//2-售后订单
......
...@@ -37,7 +37,7 @@ class OrderDetailsActivity : BaseActivity(), View.OnClickListener, CallListDialo ...@@ -37,7 +37,7 @@ class OrderDetailsActivity : BaseActivity(), View.OnClickListener, CallListDialo
} else { } else {
var map = HashMap<String, Any?>() var map = HashMap<String, Any?>()
map["order_uuid"] = orderUUid map["order_uuid"] = orderUUid
map["reason"] = reasonUUID map["reason"] = reason
UserServiceFactory.submitAfterSale(map).subscribe(object : AbstractDialogSubscriber<ResponseBody>(this) { UserServiceFactory.submitAfterSale(map).subscribe(object : AbstractDialogSubscriber<ResponseBody>(this) {
override fun onNext(t: ResponseBody) { override fun onNext(t: ResponseBody) {
startActivity(Intent(this@OrderDetailsActivity, AppealResultActivity::class.java)) startActivity(Intent(this@OrderDetailsActivity, AppealResultActivity::class.java))
......
...@@ -27,11 +27,11 @@ import io.reactivex.schedulers.Schedulers; ...@@ -27,11 +27,11 @@ import io.reactivex.schedulers.Schedulers;
public class ExpressActivity extends BaseActivity { public class ExpressActivity extends BaseActivity {
@BindView(R.id.tv_order_code)
TextView tvOrderCode; TextView tvOrderCode;
@BindView(R.id.tv_function)
TextView tvFunction; TextView tvFunction;
@BindView(R.id.rv_logistics_list)
RecyclerView rvLogisticsList; RecyclerView rvLogisticsList;
private String TAG = "ExpressActivity"; private String TAG = "ExpressActivity";
...@@ -46,6 +46,7 @@ public class ExpressActivity extends BaseActivity { ...@@ -46,6 +46,7 @@ public class ExpressActivity extends BaseActivity {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.logistics_details)); addSingleTitleBar(getString(R.string.logistics_details));
//请求物流key //请求物流key
...@@ -53,6 +54,13 @@ public class ExpressActivity extends BaseActivity { ...@@ -53,6 +54,13 @@ public class ExpressActivity extends BaseActivity {
//sendByOKHttp(); //sendByOKHttp();
} }
private void initView() {
tvOrderCode = findViewById(R.id.tv_order_code);
tvFunction = findViewById(R.id.tv_function);
rvLogisticsList = findViewById(R.id.rv_logistics_list);
}
private void requestLogistic() { private void requestLogistic() {
AddressServiceFactory.logisticsToken().subscribe(new AbstractDialogSubscriber<LogisticsEntity>(this) { AddressServiceFactory.logisticsToken().subscribe(new AbstractDialogSubscriber<LogisticsEntity>(this) {
@Override @Override
......
...@@ -46,22 +46,22 @@ import io.reactivex.schedulers.Schedulers; ...@@ -46,22 +46,22 @@ import io.reactivex.schedulers.Schedulers;
* Created by zhengpeng on 2019/5/7. * Created by zhengpeng on 2019/5/7.
*/ */
public class AddAddressActivity extends BaseActivity { public class AddAddressActivity extends BaseActivity {
public static final String UUID = "uuid";
@BindView(R.id.ll_picker)
LinearLayout llPicker; LinearLayout llPicker;
@BindView(R.id.iv_add_address_state)
ImageView ivAddAddressState; ImageView ivAddAddressState;
public static final String UUID = "uuid";
@BindView(R.id.et_address_name)
EditText etAddressName; EditText etAddressName;
@BindView(R.id.et_address_phone)
EditText etAddressPhone; EditText etAddressPhone;
@BindView(R.id.et_address_area)
AutoCompleteTextView etAddressArea; AutoCompleteTextView etAddressArea;
@BindView(R.id.et_address_area_detail)
EditText etAddressAreaDetail; EditText etAddressAreaDetail;
@BindView(R.id.btn_address_save)
Button btnAddressSave; Button btnAddressSave;
private String uuid = ""; private String uuid = "";
...@@ -85,7 +85,7 @@ public class AddAddressActivity extends BaseActivity { ...@@ -85,7 +85,7 @@ public class AddAddressActivity extends BaseActivity {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
if (getIntent() != null) { if (getIntent() != null) {
uuid = getIntent().getStringExtra(UUID); uuid = getIntent().getStringExtra(UUID);
} }
...@@ -128,7 +128,6 @@ public class AddAddressActivity extends BaseActivity { ...@@ -128,7 +128,6 @@ public class AddAddressActivity extends BaseActivity {
etAddressArea.setDropDownBackgroundResource(R.color.white); etAddressArea.setDropDownBackgroundResource(R.color.white);
setONEditorEvent(etAddressName); setONEditorEvent(etAddressName);
setONEditorEvent(etAddressPhone); setONEditorEvent(etAddressPhone);
setONEditorEvent(etAddressAreaDetail); setONEditorEvent(etAddressAreaDetail);
...@@ -143,6 +142,19 @@ public class AddAddressActivity extends BaseActivity { ...@@ -143,6 +142,19 @@ public class AddAddressActivity extends BaseActivity {
}); });
} }
private void initView() {
llPicker = findViewById(R.id.ll_picker);
ivAddAddressState = findViewById(R.id.iv_add_address_state);
etAddressName = findViewById(R.id.et_address_name);
etAddressPhone = findViewById(R.id.et_address_phone);
etAddressArea = findViewById(R.id.et_address_area);
etAddressAreaDetail = findViewById(R.id.et_address_area_detail);
btnAddressSave = findViewById(R.id.btn_address_save);
findViewById(R.id.iv_add_address_state).setOnClickListener(this::onViewClicked);
findViewById(R.id.btn_address_save).setOnClickListener(this::onViewClicked);
}
private void setONEditorEvent(EditText editText) { private void setONEditorEvent(EditText editText) {
editText.setOnEditorActionListener((v, actionId, event) -> { editText.setOnEditorActionListener((v, actionId, event) -> {
if (actionId == EditorInfo.IME_ACTION_SEND if (actionId == EditorInfo.IME_ACTION_SEND
...@@ -222,74 +234,69 @@ public class AddAddressActivity extends BaseActivity { ...@@ -222,74 +234,69 @@ public class AddAddressActivity extends BaseActivity {
ButterKnife.bind(this); ButterKnife.bind(this);
} }
@OnClick({R.id.iv_add_address_state, R.id.btn_address_save})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId()==R.id.iv_add_address_state){
case R.id.iv_add_address_state: if (isDefault) {
if (isDefault) { isDefault = false;
isDefault = false; ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_close);
ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_close); } else {
} else { isDefault = true;
isDefault = true; ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_open);
ivAddAddressState.setImageResource(R.mipmap.ic_mall_details_coupon_open); }
} }else if (view.getId()==R.id.btn_address_save){
break; String name = etAddressName.getText().toString();
case R.id.btn_address_save: if (TextUtils.isEmpty(name)) {
ToastUtils.showShort(getString(R.string.please_fill_in_your_name));
String name = etAddressName.getText().toString(); return;
if (TextUtils.isEmpty(name)) { }
ToastUtils.showShort(getString(R.string.please_fill_in_your_name));
return; String phone = etAddressPhone.getText().toString();
} if (TextUtils.isEmpty(phone)) {
ToastUtils.showShort(getString(R.string.Please_enter_your_cell_phone_number));
String phone = etAddressPhone.getText().toString(); return;
if (TextUtils.isEmpty(phone)) { }
ToastUtils.showShort(getString(R.string.Please_enter_your_cell_phone_number));
return; String area = etAddressArea.getText().toString();
} if (getString(R.string.choose_your_location).equals(area)) {
ToastUtils.showShort(R.string.please_choose_your_location);
String area = etAddressArea.getText().toString(); return;
if (getString(R.string.choose_your_location).equals(area)) { }
ToastUtils.showShort(R.string.please_choose_your_location);
return; String areaDetail = etAddressAreaDetail.getText().toString();
}
Map<String, Object> map = new HashMap<>();
String areaDetail = etAddressAreaDetail.getText().toString(); map.put("name", name);
map.put("phone", phone);
Map<String, Object> map = new HashMap<>(); map.put("address", area);
map.put("name", name); map.put("detail", areaDetail);
map.put("phone", phone);
map.put("address", area); if (isDefault) {
map.put("detail", areaDetail); map.put("is_default", 1);
} else {
if (isDefault) { map.put("is_default", 0);
map.put("is_default", 1); }
} else {
map.put("is_default", 0); if (TextUtils.isEmpty(uuid)) {//添加
} AddressServiceFactory.addAddress(map).subscribe(new AbstractDialogSubscriber<AddressEntity>(this) {
@Override
if (TextUtils.isEmpty(uuid)) {//添加 public void onNext(AddressEntity addressEntity) {
AddressServiceFactory.addAddress(map).subscribe(new AbstractDialogSubscriber<AddressEntity>(this) { ToastUtils.showShort(R.string.add_success);
@Override EventBus.getDefault().post(new UpdateAddressEvent());
public void onNext(AddressEntity addressEntity) { finish();
ToastUtils.showShort(R.string.add_success); }
EventBus.getDefault().post(new UpdateAddressEvent()); });
finish(); } else {//修改
} map.put("uuid", uuid);
}); AddressServiceFactory.updateAddress(map).subscribe(new AbstractDialogSubscriber<AddressEntity>(this) {
} else {//修改 @Override
map.put("uuid", uuid); public void onNext(AddressEntity addressEntity) {
AddressServiceFactory.updateAddress(map).subscribe(new AbstractDialogSubscriber<AddressEntity>(this) { ToastUtils.showShort(R.string.successful_revision);
@Override EventBus.getDefault().post(new UpdateAddressEvent());
public void onNext(AddressEntity addressEntity) { finish();
ToastUtils.showShort(R.string.successful_revision); }
EventBus.getDefault().post(new UpdateAddressEvent()); });
finish(); }
} }
});
}
break;
}
} }
} }
...@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable; ...@@ -40,11 +40,11 @@ import io.reactivex.disposables.Disposable;
public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLoadMoreListener { public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLoadMoreListener {
@BindView(R.id.rv_details_title)
RecyclerView rvDetailsTitle; RecyclerView rvDetailsTitle;
@BindView(R.id.rv_details_content)
RecyclerView rvDetailsContent; RecyclerView rvDetailsContent;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout; SmartRefreshLayout refreshLayout;
Unbinder unbinder; Unbinder unbinder;
...@@ -70,6 +70,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo ...@@ -70,6 +70,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
//配置商品内容 //配置商品内容
listData = new ArrayList<>(); listData = new ArrayList<>();
linearLayoutManagerContent = new LinearLayoutManager(getActivity()); linearLayoutManagerContent = new LinearLayoutManager(getActivity());
...@@ -123,6 +124,12 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo ...@@ -123,6 +124,12 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
} }
} }
private void initView() {
rvDetailsTitle = mContentView.findViewById(R.id.rv_details_title);
rvDetailsContent = mContentView.findViewById(R.id.rv_details_content);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
}
private void requestContentData(String goods_type_uuid, boolean isRefreshing) { private void requestContentData(String goods_type_uuid, boolean isRefreshing) {
if (isRefreshing) { if (isRefreshing) {
page = 1; page = 1;
...@@ -140,7 +147,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo ...@@ -140,7 +147,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
@Override @Override
public void onSubscribe(Disposable d) { public void onSubscribe(Disposable d) {
addNetworkRequest(d); addNetworkRequest(d);
} }
@Override @Override
...@@ -149,7 +156,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo ...@@ -149,7 +156,7 @@ public class DetailsMerchantFragment extends BaseFragment implements OnRefreshLo
List<MerchantShopEntity.DataBean> dataBeans = entity.getData(); List<MerchantShopEntity.DataBean> dataBeans = entity.getData();
if (isRefreshing) { if (isRefreshing) {
if (adapterContent != null && rvDetailsContent!=null) { if (adapterContent != null && rvDetailsContent != null) {
listData.clear(); listData.clear();
if (dataBeans == null || dataBeans.size() == 0) { if (dataBeans == null || dataBeans.size() == 0) {
adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent); adapterContent.setEmptyView(R.layout.adapter_layout_merchant_empty, rvDetailsContent);
......
...@@ -28,9 +28,9 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity; ...@@ -28,9 +28,9 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
public class QueueActivity extends BaseActivity implements TableListDialog.OnCenterItemClickListener { public class QueueActivity extends BaseActivity implements TableListDialog.OnCenterItemClickListener {
@BindView(R.id.rv_queue_state)
RecyclerView rvQueueState; RecyclerView rvQueueState;
@BindView(R.id.tv_tip)
TextView tvTip; TextView tvTip;
private List<QueueEntity.DataBean> list; private List<QueueEntity.DataBean> list;
private QueueAdapter adapter; private QueueAdapter adapter;
...@@ -45,6 +45,7 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen ...@@ -45,6 +45,7 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.queue_number)); addSingleTitleBar(getString(R.string.queue_number));
Intent intent = getIntent(); Intent intent = getIntent();
...@@ -82,14 +83,19 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen ...@@ -82,14 +83,19 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
}); });
} }
private void initView() {
rvQueueState = findViewById(R.id.rv_queue_state);
tvTip = findViewById(R.id.tv_tip);
findViewById(R.id.bt_take_number).setOnClickListener(this::onViewClicked);
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
ButterKnife.bind(this); ButterKnife.bind(this);
} }
@OnClick(R.id.bt_take_number) public void onViewClicked(View view) {
public void onViewClicked() {
if (listDialog != null) { if (listDialog != null) {
listDialog.show(); listDialog.show();
} }
...@@ -97,25 +103,21 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen ...@@ -97,25 +103,21 @@ public class QueueActivity extends BaseActivity implements TableListDialog.OnCen
@Override @Override
public void OnCenterItemClick(TableListDialog dialog, View view, String tableUUID) { public void OnCenterItemClick(TableListDialog dialog, View view, String tableUUID) {
switch (view.getId()) { if (view.getId()==R.id.btn_commit){
case R.id.btn_commit://提交排队 RestaurantServiceFactory.submitHotelQueue(hotelUUID, tableUUID).subscribe(new AbstractDialogSubscriber<CommitQueueEntity>(this) {
RestaurantServiceFactory.submitHotelQueue(hotelUUID, tableUUID).subscribe(new AbstractDialogSubscriber<CommitQueueEntity>(this) { @Override
@Override public void onNext(CommitQueueEntity commitQueueEntity) {
public void onNext(CommitQueueEntity commitQueueEntity) { ToastUtils.showShort(getString(R.string.successful_submission));
ToastUtils.showShort(getString(R.string.successful_submission)); Intent intent = new Intent(QueueActivity.this, QueueResultActivity.class);
Intent intent = new Intent(QueueActivity.this, QueueResultActivity.class); Bundle bundle = new Bundle();
Bundle bundle = new Bundle(); bundle.putSerializable("CommitQueueEntity", commitQueueEntity);
bundle.putSerializable("CommitQueueEntity", commitQueueEntity); bundle.putInt("type", 1);
bundle.putInt("type", 1); bundle.putString(MerchantDetailsActivity.HOTELUUID, tableUUID);
bundle.putString(MerchantDetailsActivity.HOTELUUID, tableUUID); intent.putExtras(bundle);
intent.putExtras(bundle); startActivity(intent);
startActivity(intent); finish();
finish(); }
} });
});
break;
default:
break;
} }
} }
} }
...@@ -38,29 +38,29 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity; ...@@ -38,29 +38,29 @@ import cn.dankal.client.ui.home.details.MerchantDetailsActivity;
import okhttp3.ResponseBody; import okhttp3.ResponseBody;
public class QueueResultActivity extends BaseActivity { public class QueueResultActivity extends BaseActivity {
@BindView(R.id.tv_queue_number)
TextView tvQueueNumber; TextView tvQueueNumber;
@BindView(R.id.tv_count)
TextView tvCount; TextView tvCount;
@BindView(R.id.tv_count_time)
TextView tvCountTime; TextView tvCountTime;
@BindView(R.id.tv_state)
TextView tvState;//排队状态 TextView tvState;//排队状态
@BindView(R.id.iv_start_image)
ImageView ivStartImage; ImageView ivStartImage;
@BindView(R.id.ll_background)
LinearLayoutCompat llBackground; LinearLayoutCompat llBackground;
@BindView(R.id.btn_cancel)
Button btnCancel; Button btnCancel;
@BindView(R.id.btn_order)
Button btnOrder; Button btnOrder;
@BindView(R.id.tv_table_shop)
TextView tvTableShop; TextView tvTableShop;
@BindView(R.id.tv_tip_order)
TextView tvTipOrder; TextView tvTipOrder;
@BindView(R.id.tv_you_queue)
TextView tvYouQueue; TextView tvYouQueue;
@BindView(R.id.ll_layout)
LinearLayout llLayout; LinearLayout llLayout;
/* @BindView(R.id.ll_background) /* @BindView(R.id.ll_background)
LinearLayoutCompat llBackGround;*/ LinearLayoutCompat llBackGround;*/
...@@ -79,6 +79,7 @@ public class QueueResultActivity extends BaseActivity { ...@@ -79,6 +79,7 @@ public class QueueResultActivity extends BaseActivity {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
addSingleTitleBar(getString(R.string.queuing_results)); addSingleTitleBar(getString(R.string.queuing_results));
Intent intent = getIntent(); Intent intent = getIntent();
Bundle bundle = intent.getExtras(); Bundle bundle = intent.getExtras();
...@@ -95,7 +96,7 @@ public class QueueResultActivity extends BaseActivity { ...@@ -95,7 +96,7 @@ public class QueueResultActivity extends BaseActivity {
tvTableShop.setText(commitQueueEntity.getTable_specs()); tvTableShop.setText(commitQueueEntity.getTable_specs());
tvTipOrder.setText(getString(R.string.hear_the_call) + commitQueueEntity.getOver_number() + getString(R.string.If_the_table_has_not_succeeded)); tvTipOrder.setText(getString(R.string.hear_the_call) + commitQueueEntity.getOver_number() + getString(R.string.If_the_table_has_not_succeeded));
if (type!=2){ if (type != 2) {
switch (tablesNumber) { switch (tablesNumber) {
case 0: case 0:
showQueueTip(); showQueueTip();
...@@ -127,16 +128,33 @@ public class QueueResultActivity extends BaseActivity { ...@@ -127,16 +128,33 @@ public class QueueResultActivity extends BaseActivity {
tvYouQueue.setText(getString(R.string.please_queue_again)); tvYouQueue.setText(getString(R.string.please_queue_again));
llLayout.setVisibility(View.GONE); llLayout.setVisibility(View.GONE);
ivStartImage.setImageResource(R.mipmap.ic_home_queuing); ivStartImage.setImageResource(R.mipmap.ic_home_queuing);
if (DankalApplication.isDarkMode()){ if (DankalApplication.isDarkMode()) {
LinearLayoutCompat linearLayoutCompat=findViewById(R.id.ll_top_layout); LinearLayoutCompat linearLayoutCompat = findViewById(R.id.ll_top_layout);
linearLayoutCompat.setBackground(getResources().getDrawable(R.mipmap.ic_line_background_pass)); linearLayoutCompat.setBackground(getResources().getDrawable(R.mipmap.ic_line_background_pass));
}else { } else {
llBackground.setBackground(getResources().getDrawable(R.mipmap.pic_home_queuing_bg_3)); llBackground.setBackground(getResources().getDrawable(R.mipmap.pic_home_queuing_bg_3));
} }
break; break;
} }
} }
private void initView() {
tvQueueNumber = findViewById(R.id.tv_queue_number);
tvCount = findViewById(R.id.tv_count);
tvCountTime = findViewById(R.id.tv_count_time);
tvState = findViewById(R.id.tv_state);
ivStartImage = findViewById(R.id.iv_start_image);
llBackground = findViewById(R.id.ll_background);
btnCancel = findViewById(R.id.btn_cancel);
btnOrder = findViewById(R.id.btn_order);
tvTableShop = findViewById(R.id.tv_table_shop);
tvTipOrder = findViewById(R.id.tv_tip_order);
tvYouQueue = findViewById(R.id.tv_you_queue);
llLayout = findViewById(R.id.ll_layout);
findViewById(R.id.btn_cancel).setOnClickListener(this::onViewClicked);
findViewById(R.id.btn_order).setOnClickListener(this::onViewClicked);
}
//显示排队提醒弹出窗口 //显示排队提醒弹出窗口
private void showQueueTip() { private void showQueueTip() {
showDialogStateTow(getString(R.string.queuing_reminders), getString(R.string.we_are_waiting_for_you)); showDialogStateTow(getString(R.string.queuing_reminders), getString(R.string.we_are_waiting_for_you));
...@@ -148,41 +166,38 @@ public class QueueResultActivity extends BaseActivity { ...@@ -148,41 +166,38 @@ public class QueueResultActivity extends BaseActivity {
ButterKnife.bind(this); ButterKnife.bind(this);
} }
@OnClick({R.id.btn_cancel, R.id.btn_order})
public void onViewClicked(View view) { public void onViewClicked(View view) {
switch (view.getId()) { if (view.getId()==R.id.btn_cancel){
case R.id.btn_cancel: if (type == 1) {//取消排队
if (type == 1) {//取消排队 showDialog("", getString(R.string.whether_to_cancel_the_queue), type -> {
showDialog("", getString(R.string.whether_to_cancel_the_queue), type -> {
if (commitQueueEntity != null) {
RestaurantServiceFactory.cancelQueue(commitQueueEntity.getUuid()).subscribe(new AbstractDialogSubscriber<ResponseBody>(this) {
@Override
public void onNext(ResponseBody responseBody) {
ToastUtils.showShort(getString(R.string.cancellation_successful));
finish();
}
});
}
}, true, true);
} else {//返回首页
startActivity(new Intent(QueueResultActivity.this, HomeActivity.class));
}
break;
case R.id.btn_order:
if (type == 2) {//重新排队
Intent intent = new Intent(QueueResultActivity.this, QueueActivity.class);
if (commitQueueEntity != null) { if (commitQueueEntity != null) {
intent.putExtra(ConstantsRestaurantType.UUID, commitQueueEntity.getHotel_uuid()); RestaurantServiceFactory.cancelQueue(commitQueueEntity.getUuid()).subscribe(new AbstractDialogSubscriber<ResponseBody>(this) {
} @Override
startActivity(intent); public void onNext(ResponseBody responseBody) {
} else {//我要点餐 ToastUtils.showShort(getString(R.string.cancellation_successful));
if (tablesNumber == 0) {//去扫码 finish();
startActivityForResult(new Intent(QueueResultActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN); }
} else {//提示,前方桌数等待为0时候才可以点餐 });
showDialog(getString(R.string.waiting_before_ordering));
} }
}, true, true);
} else {//返回首页
startActivity(new Intent(QueueResultActivity.this, HomeActivity.class));
}
}else if (view.getId()==R.id.btn_order){
if (type == 2) {//重新排队
Intent intent = new Intent(QueueResultActivity.this, QueueActivity.class);
if (commitQueueEntity != null) {
intent.putExtra(ConstantsRestaurantType.UUID, commitQueueEntity.getHotel_uuid());
} }
break; startActivity(intent);
} else {//我要点餐
if (tablesNumber == 0) {//去扫码
startActivityForResult(new Intent(QueueResultActivity.this, CaptureActivity.class), ConstantsHomeType.SCAN);
} else {//提示,前方桌数等待为0时候才可以点餐
showDialog(getString(R.string.waiting_before_ordering));
}
}
} }
} }
......
...@@ -37,17 +37,14 @@ import cn.dankal.client.R; ...@@ -37,17 +37,14 @@ import cn.dankal.client.R;
public class ShopFragment extends BaseFragment { public class ShopFragment extends BaseFragment {
@BindView(R.id.sliding_tabs)
SlidingTabLayout slidingTabs; SlidingTabLayout slidingTabs;
@BindView(R.id.vp_shop_pager)
ViewPager vpShopPager; ViewPager vpShopPager;
Unbinder unbinder; Unbinder unbinder;
@BindView(R.id.tv_state_bar)
TextView tvStateBar; TextView tvStateBar;
SmartRefreshLayout refreshLayout;
private List<Fragment> dataList; private List<Fragment> dataList;
private List<String> titles; private List<String> titles;
@BindView(R.id.refreshLayout)
SmartRefreshLayout refreshLayout;
private FragmentAdapter adapter; private FragmentAdapter adapter;
...@@ -58,6 +55,7 @@ public class ShopFragment extends BaseFragment { ...@@ -58,6 +55,7 @@ public class ShopFragment extends BaseFragment {
@Override @Override
protected void initComponents() { protected void initComponents() {
initView();
dataList = new ArrayList<>(); dataList = new ArrayList<>();
titles = new ArrayList<>(); titles = new ArrayList<>();
adapter = new FragmentAdapter(getFragmentManager(), dataList, titles); adapter = new FragmentAdapter(getFragmentManager(), dataList, titles);
...@@ -78,6 +76,16 @@ public class ShopFragment extends BaseFragment { ...@@ -78,6 +76,16 @@ public class ShopFragment extends BaseFragment {
refreshLayout.autoRefresh(); refreshLayout.autoRefresh();
} }
private void initView() {
slidingTabs = mContentView.findViewById(R.id.sliding_tabs);
vpShopPager = mContentView.findViewById(R.id.vp_shop_pager);
tvStateBar = mContentView.findViewById(R.id.tv_state_bar);
refreshLayout = mContentView.findViewById(R.id.refreshLayout);
mContentView.findViewById(R.id.iv_mall_search).setOnClickListener(this::onViewClicked);
}
private void requestData() { private void requestData() {
MallServiceFactory.getHomeTopList(1, 20).subscribe(new AbstractDialogSubscriber<MallTopDataEntity>(this) { MallServiceFactory.getHomeTopList(1, 20).subscribe(new AbstractDialogSubscriber<MallTopDataEntity>(this) {
@Override @Override
...@@ -127,8 +135,7 @@ public class ShopFragment extends BaseFragment { ...@@ -127,8 +135,7 @@ public class ShopFragment extends BaseFragment {
return new ShopFragment(); return new ShopFragment();
} }
@OnClick(R.id.iv_mall_search) public void onViewClicked(View view) {
public void onViewClicked() {
startActivity(new Intent(getActivity(), MallSearchActivity.class)); startActivity(new Intent(getActivity(), MallSearchActivity.class));
} }
......
...@@ -41,7 +41,6 @@ import io.reactivex.disposables.Disposable; ...@@ -41,7 +41,6 @@ import io.reactivex.disposables.Disposable;
public class ShopItemFragment extends BaseFragment { public class ShopItemFragment extends BaseFragment {
@BindView(R.id.rv_shop_recycler_view)
RecyclerView rvShopRecyclerView; RecyclerView rvShopRecyclerView;
private ShopAdapter shopAdapter; private ShopAdapter shopAdapter;
private DkBannerTow<String> mDkBanner; private DkBannerTow<String> mDkBanner;
...@@ -59,7 +58,7 @@ public class ShopItemFragment extends BaseFragment { ...@@ -59,7 +58,7 @@ public class ShopItemFragment extends BaseFragment {
@Override @Override
protected void initComponents() { protected void initComponents() {
rvShopRecyclerView = mContentView.findViewById(R.id.rv_shop_recycler_view);
homeTypeUUid = getArguments().getString("type"); homeTypeUUid = getArguments().getString("type");
bannerListBeans = (List<MallTopDataEntity.BannerListBean>) getArguments().getSerializable("banner"); bannerListBeans = (List<MallTopDataEntity.BannerListBean>) getArguments().getSerializable("banner");
...@@ -190,13 +189,13 @@ public class ShopItemFragment extends BaseFragment { ...@@ -190,13 +189,13 @@ public class ShopItemFragment extends BaseFragment {
public class BannerItemView implements VH<String> { public class BannerItemView implements VH<String> {
@BindView(R.id.iv_img)
ImageView mIvImg; ImageView mIvImg;
@Override @Override
public View createView(LayoutInflater inflater, ViewGroup container) { public View createView(LayoutInflater inflater, ViewGroup container) {
View inflate = inflater.inflate(R.layout.banner_item, container, false); View inflate = inflater.inflate(R.layout.banner_item, container, false);
ButterKnife.bind(this, inflate); mIvImg = inflate.findViewById(R.id.iv_img);
return inflate; return inflate;
} }
......
...@@ -284,7 +284,7 @@ ...@@ -284,7 +284,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_9" android:layout_marginLeft="@dimen/dp_9"
android:layout_marginRight="@dimen/dp_9" android:layout_marginRight="@dimen/dp_9"
android:background="@color/white" android:background="@color/color_232323"
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="@dimen/dp_18" android:paddingLeft="@dimen/dp_18"
android:paddingTop="@dimen/dp_15" android:paddingTop="@dimen/dp_15"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_191919"
tools:context="cn.dankal.client.ui.home.details.ResultPageActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/color_232323"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_24"
android:src="@mipmap/ic_successful" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_19"
android:text="@string/successful_payment"
android:textColor="@color/color_a6a6a6"
android:textSize="@dimen/sp_18" />
<TextView
android:id="@+id/tv_get_stamp_tip"
android:layout_width="@dimen/dp_235"
android:layout_height="wrap_content"
android:gravity="center"
android:text="获得邮票数:0枚,集齐一定数量即可 抵扣商品哦!"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_15"
android:visibility="gone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:layout_marginBottom="@dimen/dp_57"
android:text="@string/we_will_serve_you_as_soon_as_possible"
android:textColor="@color/color_a6a6a6" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:background="@color/color_232323"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_13"
android:layout_marginBottom="@dimen/dp_21"
android:text="@string/currently_ordered"
android:textColor="@color/color_a6a6a6" />
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginRight="@dimen/dp_18"
android:background="@color/color_3d3d3d" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rv_order_result"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_18"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_18"
android:layout_marginBottom="@dimen/dp_20"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/total_price"
android:textColor="@color/color_a6a6a6"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tv_shop_total_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:textColor="@color/color_d3d3d3"
android:textSize="@dimen/sp_16" />
</LinearLayout>
</LinearLayout>
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_36"
android:layout_marginBottom="@dimen/dp_50">
<Button
android:id="@+id/btn_see_order"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_30"
android:background="@drawable/bg_button_red_night"
android:text="@string/view_orders"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btn_evaluate"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_evaluate"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:background="@drawable/bg_button_red_night"
android:text="@string/evaluate"
android:textColor="@color/btn_bg"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_see_order"
app:layout_constraintRight_toLeftOf="@id/btn_order"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_order"
style="@style/ButtonText"
android:layout_width="@dimen/dp_90"
android:layout_height="@dimen/dp_34"
android:layout_marginRight="@dimen/dp_30"
android:text="@string/continue_ordering"
android:textColor="@color/color_171717"
android:textSize="@dimen/sp_14"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/btn_evaluate"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15" android:layout_marginLeft="@dimen/dp_15"
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_1" android:layout_height="@dimen/dp_1"
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="@dimen/dp_12"
android:background="@color/line_one" android:background="@color/color_3d3d3d"
app:layout_constraintTop_toBottomOf="@id/tv_dialog_title" /> app:layout_constraintTop_toBottomOf="@id/tv_dialog_title" />
<android.support.v7.widget.LinearLayoutCompat <android.support.v7.widget.LinearLayoutCompat
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
android:layout_marginRight="@dimen/dp_21" android:layout_marginRight="@dimen/dp_21"
android:background="@drawable/bg_dialog_btn_one_night" android:background="@drawable/bg_dialog_btn_one_night"
android:text="@string/commit" android:text="@string/commit"
android:textColor="@color/white" /> android:textColor="@color/color_171717" />
</android.support.v7.widget.LinearLayoutCompat> </android.support.v7.widget.LinearLayoutCompat>
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
android:layout_height="@dimen/dp_50" android:layout_height="@dimen/dp_50"
android:background="@color/btn_bg" android:background="@color/btn_bg"
android:text="@string/reserved_queue" android:text="@string/reserved_queue"
android:textColor="@color/white" android:textColor="@color/color_171717"
android:textSize="@dimen/sp_20" android:textSize="@dimen/sp_20"
android:visibility="gone" /> android:visibility="gone" />
......
...@@ -528,8 +528,6 @@ ...@@ -528,8 +528,6 @@
<string name="srl_footer_failed">Load failed</string> <string name="srl_footer_failed">Load failed</string>
<string name="srl_footer_nothing">No more data</string> <string name="srl_footer_nothing">No more data</string>
<string name="srl_content_empty">SmartRefreshLayout The content view was not found,Did you forget to add it to the XML layout file?</string>
<string name="srl_component_falsify" formatted="false">%s False area\nRepresents the height of the drag at runtime【%.1fdp】 \nIt doesn't show anything</string>
<string name="picture_camera_roll">CameraRoll</string> <string name="picture_camera_roll">CameraRoll</string>
<string name="picture_cancel">Cancel</string> <string name="picture_cancel">Cancel</string>
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
</style>
<style name="MainTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
<item name="android:windowTranslucentStatus">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
<style name="ButtonText">
<item name="android:shadowColor">#a1ff6b5c</item>
<item name="android:shadowDx">0</item>
<item name="android:shadowDy">1</item>
<item name="android:background">@drawable/bg_button_select_language</item>
</style>
<style name="translucent">
<item name="android:windowBackground">@color/translucent_background</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style>
</resources>
\ No newline at end of file
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<declare-styleable name="TabSegment"> <declare-styleable name="TabSegment">
<attr name="tab_indicator_height" format="dimension" /> <attr name="tab_indicator_height" format="dimension" />
<attr name="tab_has_indicator" format="boolean" /> <attr name="tab_has_indicator" format="boolean" />
<attr name="android:textSize" /> <!--<attr name="android:textSize" />-->
<attr name="tab_indicator_top" format="boolean" /> <attr name="tab_indicator_top" format="boolean" />
<attr name="tab_mode" format="enum"> <attr name="tab_mode" format="enum">
<enum name="scrollable" value="0" /> <enum name="scrollable" value="0" />
......
...@@ -289,11 +289,24 @@ ...@@ -289,11 +289,24 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. --> &lt;!&ndash; Customize your theme here. &ndash;&gt;
<item name="colorPrimary">@color/bar_grey</item> <item name="colorPrimary">@color/bar_grey</item>
<item name="colorPrimaryDark">@color/bar_grey</item> <item name="colorPrimaryDark">@color/bar_grey</item>
<item name="colorAccent">@color/bar_grey</item> <item name="colorAccent">@color/bar_grey</item>
</style>-->
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
</style> </style>
<style name="picture_alert_dialog" parent="android:Theme.Dialog"> <style name="picture_alert_dialog" parent="android:Theme.Dialog">
...@@ -379,4 +392,21 @@ ...@@ -379,4 +392,21 @@
<!--相册文件夹列表选中图标--> <!--相册文件夹列表选中图标-->
<item name="picture.folder_checked_dot">@drawable/orange_oval</item> <item name="picture.folder_checked_dot">@drawable/orange_oval</item>
</style> </style>
<style name="MainTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
<item name="android:actionMenuTextColor">@color/colorAccent</item>
<item name="android:textAllCaps">false</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowBackground">@color/colorFF</item>
<item name="android:windowTranslucentStatus">false</item>
</style>
</resources> </resources>
...@@ -8,7 +8,6 @@ buildscript { ...@@ -8,7 +8,6 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath deps.butterknife.butterknife_gradle_plugin
classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment