Commit eb006dac authored by 杨秀秀's avatar 杨秀秀

基础搭建

功能开发
1:添加map总览页面 7.25
parent 35e66d5a
This diff is collapsed.
......@@ -4,11 +4,11 @@ plugins {
id 'kotlin-kapt'
}
def URL_DEBUG="\"http://49.232.201.130:8004/\""
def URL_DEBUG="\"http://103.131.168.155:7005/api/\""
def URL_RELEASE="\"https://www.hbhapp.cn/api/\""
def URL_DEBUG_H5="\"http://49.232.201.130:7005\""
def URL_DEBUG_H5="\"http://103.131.168.155:7005\""
def URL_RELEASE_H5="\"https://www.hbhapp.cn\""
......@@ -51,6 +51,7 @@ android {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
buildConfigField "String", "URL", URL_DEBUG
buildConfigField "String", "URL_H5", URL_DEBUG_H5
}
......
......@@ -253,6 +253,9 @@
<activity
android:name=".ui.phone.PhoneActivity"
android:exported="true"/>
<!-- 地图总览页-->
<activity android:name=".ui.map.MapOverviewActivity"
android:exported="true"/>
<!-- 适配标准 -->
<meta-data
......
......@@ -23,6 +23,7 @@ import com.xx.hbhconsumer.ui.hbh.HbhActivity;
import com.xx.hbhconsumer.ui.hotsales.HotSalesActivity;
import com.xx.hbhconsumer.ui.lowprice.LowPriceActivity;
import com.xx.hbhconsumer.ui.map.MapActivity;
import com.xx.hbhconsumer.ui.map.MapOverviewActivity;
import com.xx.hbhconsumer.ui.messagecenter.MessageCenterActivity;
import com.xx.hbhconsumer.ui.newproducts.NewProductsActivity;
import com.xx.hbhconsumer.ui.news.NewsDetailActivity;
......@@ -302,7 +303,7 @@ public class HomeViewModel extends BaseViewModel<HomeRequest> {
//跳转com.xx
public BindingCommand goCreditsExchange = new BindingCommand(() -> startActivity(CreditsExchangeActivity.class));
public BindingCommand goMap = new BindingCommand(() -> startActivity(MapActivity.class));
public BindingCommand goMap = new BindingCommand(() -> startActivity(MapOverviewActivity.class));
//跳转订单管理
public BindingCommand goRecruit = new BindingCommand(() -> startActivity(RecruitActivity.class));
......
......@@ -123,7 +123,7 @@ public class MapActivity extends BaseActivity<ActivityMapBinding, MapViewModel>
@Override
public void initData() {
super.initData();
viewModel.maptyep=getIntent().getStringExtra("mapId");
viewModel.checkMapFlag.observe(this, checkMapFlag -> {
if (checkMapFlag) {
binding.rlCheckYear.setVisibility(View.VISIBLE);
......@@ -190,8 +190,12 @@ public class MapActivity extends BaseActivity<ActivityMapBinding, MapViewModel>
}
super.onBackPressed();
}
@Override
public void initParam() {
super.initParam();
}
/**
* 通过关键字查询模型
......
package com.xx.hbhconsumer.ui.map
import android.os.Bundle
import com.xx.hbhconsumer.BR
import com.xx.hbhconsumer.R
import com.xx.hbhconsumer.databinding.ActivityMapOverviewBinding
import me.goldze.mvvmhabit.base.BaseActivity
class MapOverviewActivity() : BaseActivity<ActivityMapOverviewBinding, MapOverviewViewModel>() {
override fun initContentView(savedInstanceState: Bundle?): Int {
return R.layout.activity_map_overview
}
override fun initVariableId(): Int {
return BR.mapViewModel
}
}
\ No newline at end of file
package com.xx.hbhconsumer.ui.map;
import android.app.Application;
import android.os.Bundle;
import android.view.View;
import androidx.annotation.NonNull;
import com.xx.hbhconsumer.R;
import com.xx.hbhconsumer.data.http.requst.MapRequest;
import me.goldze.mvvmhabit.base.BaseViewModel;
public class MapOverviewViewModel extends BaseViewModel<MapRequest> {
public MapOverviewViewModel(@NonNull Application application) {
super(application);
}
public MapOverviewViewModel(@NonNull Application application, MapRequest model) {
super(application, model);
}
public void mapOnClick(View view)
{
Bundle bundle=new Bundle();
if (view.getId()==R.id.map_big_build)
{
bundle.putString("mapId","4");
}else if (view.getId()==R.id.map_buy)
{ bundle.putString("mapId","2");
}else if (view.getId()==R.id.map_famous)
{ bundle.putString("mapId","3");
}else if (view.getId()==R.id.map_hardwork)
{ bundle.putString("mapId","1");
}else if (view.getId()==R.id.map_new_build)
{ bundle.putString("mapId","5");
}
startActivity(MapActivity.class,bundle);
}
}
......@@ -30,6 +30,8 @@ public class MapViewModel extends BaseViewModel<MapRequest> {
public MutableLiveData<String> region = new MutableLiveData<>("");
public MutableLiveData<List<DictValueBean>> mapList = new MutableLiveData<>(new ArrayList<>());
public String maptyep="";
public MapViewModel(@NonNull Application application) {
super(application);
......@@ -69,18 +71,26 @@ public class MapViewModel extends BaseViewModel<MapRequest> {
List<DictValueBean> newList = new ArrayList<>();
for (DictValueBean dictValueBean : recruitBeans) {
if (LocalData.getAffiliatedCompany().equals("2") && dictValueBean.getDictLabel().equals("滨海宏达公司")) {
if (dictValueBean.getDictValue().equals(maptyep))
{
dictValueBean.setChecked(true);
checkMap(dictValueBean);
}
newList.add(dictValueBean);
} else if (!dictValueBean.getDictLabel().equals("滨海宏达公司")) {
if (!StringUtils.isEmpty(dictValueBean.getRemark())) {
if (dictValueBean.getDictValue().equals(maptyep))
{
dictValueBean.setChecked(true);
checkMap(dictValueBean);
}
newList.add(dictValueBean);
}
}
}
if (newList.isEmpty()) {
ToastUtils.showShort("暂无地图数据");
} else {
newList.get(0).setChecked(true);
checkMap(newList.get(0));
}
mapList.postValue(newList);
}
......
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:binding="http://schemas.android.com/tools">
<data>
<variable
name="mapViewModel"
type="com.xx.hbhconsumer.ui.map.MapOverviewViewModel" />
</data>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.xx.xxviewlibrary.witget.XxBar
android:layout_width="match_parent"
android:id="@+id/bar"
bar_title="布局图"
on_click="@{mapViewModel.clickFinish}"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:background="@mipmap/map_all"
android:layout_height="match_parent">
<Button
android:id="@+id/map_big_build"
android:layout_width="118dp"
android:layout_height="152dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="80dp"
android:background="#00000000"
android:onClick="@{mapViewModel.mapOnClick}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/map_new_build"
android:layout_width="120dp"
android:layout_height="174dp"
android:layout_marginTop="204dp"
android:background="#00000000"
android:onClick="@{mapViewModel.mapOnClick}"
android:layout_marginEnd="68dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/map_famous"
android:layout_width="147dp"
android:layout_height="253dp"
android:layout_marginTop="152dp"
android:background="#00000000"
android:onClick="@{mapViewModel.mapOnClick}"
app:layout_constraintEnd_toStartOf="@+id/map_big_build"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/map_hardwork"
android:layout_width="98dp"
android:layout_height="253dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="36dp"
android:background="#00000000"
android:onClick="@{mapViewModel.mapOnClick}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/map_new_build" />
<Button
android:id="@+id/map_buy"
android:layout_width="132dp"
android:layout_height="253dp"
android:layout_marginStart="68dp"
android:layout_marginBottom="28dp"
android:background="#00000000"
android:onClick="@{mapViewModel.mapOnClick}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</layout>
\ No newline at end of file
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