新增cash储值分期支付

This commit is contained in:
guozhen
2024-10-18 18:09:58 +08:00
committed by xuhuixiang
parent c43c500382
commit c5def56607
4 changed files with 57 additions and 20 deletions

View File

@@ -72,13 +72,19 @@ android {
signingConfig = signingConfigs.getByName("release")
isDebuggable = false;
// buildConfigField(
// "String",
// "HTTPS_BASE_URL",
// "\"https://api.letschat2023.com/\""
// )
buildConfigField(
"String",
"HTTPS_BASE_URL",
"\"https://api.letschat2023.com/\""
"APIKEY",
"\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\""
)
//正式服
manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式
manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f" //正式
// manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
}
@@ -92,13 +98,18 @@ android {
signingConfig = signingConfigs.getByName("release")
isDebuggable = true
// buildConfigField(
// "String",
// "HTTPS_BASE_URL",
// "\"https://api-test.letschat2023.com/\""
// )
buildConfigField(
"String",
"HTTPS_BASE_URL",
"\"https://api-test.letschat2023.com/\""
"APIKEY",
"\"AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k\""
)
//测试APPKEY
manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
manifestPlaceholders["IMAPPKEY"] = "4cb6b0998f9e7af9d7673963e429959a"
// manifestPlaceholders["IMAPPKEY"] = "c38c8bbebf7d12992d2a361bfceb6c6f"

View File

@@ -168,5 +168,6 @@ public class IMUIKitConfig {
/**
* GoogleMap apikey
*/
public static final String API_KEY = "AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k";
// public static final String API_KEY = "AIzaSyB7P1o1EIA02eWoNP_7QJ9XwWe3WkSZb9k";
//AIzaSyAAXviskUffLY3KfnrKVPlwcj5Ks5ces_8
}

View File

@@ -42,6 +42,7 @@ import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bumptech.glide.Glide;
import com.dskj.rbchat.BuildConfig;
import com.dskj.rbchat.IMUIKitConfig;
import com.dskj.rbchat.adapter.CommonAdapter;
import com.dskj.rbchat.adapter.ViewHolder;
@@ -118,7 +119,8 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
private IPageMapProvider pageMapProvider;
LatLng sydney;
LatLng locLatLng;
Marker marker ;
Marker marker;
public static void launch(Context context, int type, IMMessage message) {
Intent intent = new Intent(context, LocationPageActivity1.class);
intent.putExtra(LAUNCH_TYPE, type);
@@ -221,9 +223,9 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
holder.setText(R.id.location_title, s.getName());
holder.setText(R.id.location_desc, s.getVicinity());
String desc = s.getVicinity();
if(locLatLng!=null) {
float distance = gps2m(locLatLng.latitude,locLatLng.longitude,s.getGeometry().getLocation().getLat(),s.getGeometry().getLocation().getLng());
if (distance > 0&&distance<1000) {
if (locLatLng != null) {
float distance = gps2m(locLatLng.latitude, locLatLng.longitude, s.getGeometry().getLocation().getLat(), s.getGeometry().getLocation().getLng());
if (distance > 0 && distance < 1000) {
desc = getString(R.string.chat_message_location_distance, Math.ceil(distance), desc);
holder.setText(R.id.location_desc, desc);
@@ -245,15 +247,15 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
if (mMap != null) {
sydney = new LatLng(s.getGeometry().getLocation().getLat(), s.getGeometry().getLocation().getLng());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
if(marker!=null){
if (marker != null) {
marker.remove();
}
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),com.netease.yunxin.kit.locationkit.R.drawable.ic_location_marker).copy(Bitmap.Config.ARGB_8888,true);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), com.netease.yunxin.kit.locationkit.R.drawable.ic_location_marker).copy(Bitmap.Config.ARGB_8888, true);
//ic_location_marker
marker = mMap.addMarker(new MarkerOptions()
.title(s.getName() + "")
.icon(BitmapDescriptorFactory.fromResource(com.netease.yunxin.kit.locationkit.R.drawable.ic_location_marker))
.snippet(s.getVicinity()+"")
.snippet(s.getVicinity() + "")
.position(sydney));
}
@@ -265,6 +267,7 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
// 计算两点距离
private final double EARTH_RADIUS = 6378137.0;
private float gps2m(double lat_a, double lng_a, double lat_b, double lng_b) {
double radLat1 = (lat_a * Math.PI / 180.0);
double radLat2 = (lat_b * Math.PI / 180.0);
@@ -296,6 +299,16 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
mMap = googleMap;
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
buildGoogleApiClient();
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
mMap.setMyLocationEnabled(true);
@@ -309,7 +322,7 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
LocationAttachment attachment = (LocationAttachment) message.getAttachment();
sydney = new LatLng(attachment.getLatitude(), attachment.getLongitude());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 15));
if(marker!=null){
if (marker != null) {
marker.remove();
}
marker = mMap.addMarker(new MarkerOptions()
@@ -355,6 +368,16 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
boolean enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
if (enabled) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 2000L, 10f, new LocationListener() {
@Override
public void onLocationChanged(@NonNull Location location) {
@@ -363,7 +386,7 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
return;
}
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
if(latLng!=null) {
if (latLng != null) {
sydney = new LatLng(location.getLatitude(), location.getLongitude());
locLatLng = new LatLng(location.getLatitude(), location.getLongitude());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
@@ -382,7 +405,7 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
}
if(TextUtils.isEmpty(s)) {
Api.getInstance().nearbysearch(sydney.latitude + "," + sydney.longitude, "10000", "",
"true", IMUIKitConfig.API_KEY)
"true", BuildConfig.APIKEY)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObserverNew<>() {
@@ -399,7 +422,7 @@ public class LocationPageActivity1 extends BaseActivity implements OnMapReadyCal
});
}else{
Api.getInstance().nearbysearch(sydney.latitude + "," + sydney.longitude, "10000", "",
"true", IMUIKitConfig.API_KEY,s)
"true", BuildConfig.APIKEY,s)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new BaseObserverNew<>() {

View File

@@ -60,7 +60,7 @@ public class TopUpActivity extends BaseActivity {
private List<InstallmentBean> installmentBeans = new ArrayList<>();
CommonAdapter commonAdapter;
CommonAdapter installmentAdapter;
int defaultIndex = 0;
int defaultIndex = 0; //输入的金额
private boolean isFenqi = false;
private int installmentNum; //分期數
@@ -95,7 +95,9 @@ public class TopUpActivity extends BaseActivity {
} else {
viewBinding.tvPaytypeCard.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(R.mipmap.ic_single_selected), null);
viewBinding.tvPaytypeFenqi.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(R.mipmap.dialog_gou_ff), null);
installmentNum = 0;
if (installmentAdapter != null)
installmentAdapter.notifyDataSetChanged();
}
}