1
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
package="com.sl.house_property">
|
||||
|
||||
<!-- Required 一些系统要求的权限,如访问网络等 -->
|
||||
<!-- <uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" /-->>
|
||||
<!-- <uses-permission android:name="android.permission.READ_CALENDAR" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALENDAR" /-->>
|
||||
<uses-permission android:name="com.nifengkeji.xyq.permission.JPUSH_MESSAGE" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_LOGS"
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_LOGS"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
|
||||
@@ -18,13 +19,13 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
|
||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_PROFILE" />
|
||||
<!-- <uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||
<uses-permission android:name="android.permission.WRITE_CONTACTS" />-->
|
||||
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
|
||||
<!-- 这个权限用于进行网络定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
@@ -40,12 +41,12 @@
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
|
||||
<!-- 读写sdcard,storage等等 -->
|
||||
<!-- // <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
<!-- // <uses-permission android:name="android.permission.RECORD_AUDIO" />-->
|
||||
<uses-permission android:name="com.harvic.contentProviderBlog.read" />
|
||||
<uses-permission android:name="com.harvic.contentProviderBlog.write" />
|
||||
<!-- shareSdK权限 -->
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<!-- <uses-permission android:name="android.permission.GET_ACCOUNTS" />-->
|
||||
<!-- <uses-permission android:name="android.permission.GET_ACCOUNTS" />-->
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
@@ -71,12 +72,12 @@
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:theme="@style/AppTheme">
|
||||
<!-- <queries>-->
|
||||
<!-- <package android:name="com.tencent.mm" />-->
|
||||
<!-- </queries>-->
|
||||
android:theme="@style/AppTheme"
|
||||
android:usesCleartextTraffic="true">
|
||||
<!-- <queries>-->
|
||||
<!-- <package android:name="com.tencent.mm" />-->
|
||||
<!-- </queries>-->
|
||||
<provider
|
||||
android:name="com.sl.house_property.ImagePickerProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
@@ -95,6 +96,7 @@
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
|
||||
<activity
|
||||
android:name="com.sl.house_property.MainActivity"
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
|
||||
@@ -104,11 +106,10 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.sl.house_property.AliPayTestActivity">
|
||||
<activity android:name="com.sl.house_property.AliPayTestActivity">
|
||||
<!--<intent-filter>-->
|
||||
<!--<action android:name="android.intent.action.MAIN" />-->
|
||||
<!--<category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!--<action android:name="android.intent.action.MAIN" />-->
|
||||
<!--<category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!--</intent-filter>-->
|
||||
</activity>
|
||||
<activity
|
||||
@@ -121,180 +122,145 @@
|
||||
android:theme="@style/TAppTheme" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.LogoActivity"
|
||||
|
||||
|
||||
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
|
||||
<activity
|
||||
android:name="utils.SelectPicDanimicActivity"
|
||||
android:theme="@style/myDialogThememakephoto"
|
||||
|
||||
|
||||
android:windowBackground="@color/transparent" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.NewsDetailActivity"
|
||||
|
||||
|
||||
android:theme="@style/MyThemeactonbar" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.RegisterAgreementActivity"
|
||||
|
||||
|
||||
android:theme="@style/MyThemeactonbar" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.ScrollingActivity"
|
||||
|
||||
|
||||
android:label="@string/title_activity_scrolling"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyUserMessage"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
|
||||
android:theme="@style/MyThemeactonbar" />
|
||||
android:theme="@style/MyThemeactonbar"
|
||||
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyWalletActivity"
|
||||
|
||||
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity android:name="com.sl.house_property.user.MyMarketShopActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyMarketShopActivity" />
|
||||
|
||||
<activity android:name="com.sl.house_property.user.MyBillHistory"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f3.MyFeeBillHistory"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyServiceHistory"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyGuaranteeHistory"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyAuthorizedFamilyHistory"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyPropertyActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyKeyManagement"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyChargeActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyPayActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyshopEditAcitivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyshopModifyAcitivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyBillDetailActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f3.HousekeepingActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.CommodityActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.QRcodeActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.EntranceguardActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.CarGarageActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.EntranceguardControl1Activity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.EntranceguardControl2Activity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.NewsActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.NewlistActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f2.FeeActivity"/>
|
||||
<activity android:name="com.sl.house_property.f2.ElectricChargeActivity" android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f2.PropertyFeeActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f2.ParkingFeeActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f2.GasFeeActivity"
|
||||
/>
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyBillHistory"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.f3.MyFeeBillHistory"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.user.MyServiceHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyGuaranteeHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyAuthorizedFamilyHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyPropertyActivity" />
|
||||
<activity android:name="com.sl.house_property.user.MyKeyManagement" />
|
||||
<activity android:name="com.sl.house_property.user.MyChargeActivity" />
|
||||
<activity android:name="com.sl.house_property.user.MyPayActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyshopEditAcitivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyshopModifyAcitivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.user.MyBillDetailActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.f3.HousekeepingActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.CommodityActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.QRcodeActivity" />
|
||||
<activity android:name="com.sl.house_property.EntranceguardActivity" />
|
||||
<activity android:name="com.sl.house_property.CarGarageActivity" />
|
||||
<activity android:name="com.sl.house_property.EntranceguardControl1Activity" />
|
||||
<activity android:name="com.sl.house_property.EntranceguardControl2Activity" />
|
||||
<activity android:name="com.sl.house_property.NewsActivity" />
|
||||
<activity android:name="com.sl.house_property.NewlistActivity" />
|
||||
<activity android:name="com.sl.house_property.f2.FeeActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.f2.ElectricChargeActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.f2.PropertyFeeActivity" />
|
||||
<activity android:name="com.sl.house_property.f2.ParkingFeeActivity" />
|
||||
<activity android:name="com.sl.house_property.f2.GasFeeActivity" />
|
||||
|
||||
<activity android:name="com.sl.house_property.f1.AddcararageIttemActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f1.AddAcarActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity
|
||||
android:name="com.sl.house_property.f1.AddcararageIttemActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.f1.AddAcarActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.f1.CarragelistActivity"
|
||||
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f1.UserdlistActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f1.UserdlistActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.user.MyServiceDetailActivity"
|
||||
|
||||
|
||||
android:label="@string/title_activity_my_service_detail" />
|
||||
<activity android:name="com.sl.house_property.user.AddAnewGranteeActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.AddAnewFamilyNumberPermissionActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.SettingActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.AboutusActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.AdeviseActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity
|
||||
android:name="com.sl.house_property.LoginActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.RegisterActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.ForgetPwdActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.ModifyPswdActivity"
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f1.MyCaragradetailActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.user.MyGranteeDetailActivity"
|
||||
/>
|
||||
<activity android:name="com.sl.house_property.f1.MyCarUsedHistoryDetailActivity"
|
||||
/>
|
||||
android:name="com.sl.house_property.user.AddAnewGranteeActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.user.AddAnewFamilyNumberPermissionActivity" />
|
||||
<activity android:name="com.sl.house_property.SettingActivity" />
|
||||
<activity android:name="com.sl.house_property.AboutusActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.AdeviseActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.LoginActivity" />
|
||||
<activity android:name="com.sl.house_property.RegisterActivity" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.ForgetPwdActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name="com.sl.house_property.ModifyPswdActivity"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity android:name="com.sl.house_property.f1.MyCaragradetailActivity" />
|
||||
<activity android:name="com.sl.house_property.user.MyGranteeDetailActivity" />
|
||||
<activity android:name="com.sl.house_property.f1.MyCarUsedHistoryDetailActivity" />
|
||||
|
||||
|
||||
<activity
|
||||
android:name="imageselector.ImageSelectorActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||
/>
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name="imageselector.PreviewActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||
/>
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name="imageselector.ClipImageActivity"
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
|
||||
/>
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
<activity
|
||||
android:name="imageselector.FullScreenPreviewActivity"
|
||||
android:theme="@style/PictureTheme.Main"
|
||||
/>
|
||||
android:theme="@style/PictureTheme.Main" />
|
||||
<activity
|
||||
android:name="imageselector.FullScreenOnlinePreviewActivity"
|
||||
android:theme="@style/PictureTheme.Main"
|
||||
/>
|
||||
android:theme="@style/PictureTheme.Main" />
|
||||
|
||||
<activity
|
||||
android:name="com.alipay.sdk.app.H5PayActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:screenOrientation="behind">
|
||||
</activity>
|
||||
android:screenOrientation="behind"></activity>
|
||||
<activity
|
||||
android:name="com.alipay.sdk.auth.AuthActivity"
|
||||
android:configChanges="orientation|keyboardHidden|navigation"
|
||||
android:exported="false"
|
||||
android:screenOrientation="behind">
|
||||
</activity>
|
||||
android:screenOrientation="behind"></activity>
|
||||
<activity android:name=".discovery.ImageViewerAndDeleteActivity" />
|
||||
<activity android:name=".discovery.AddDiscoveryActivity" />
|
||||
<activity android:name=".discovery.AddDiscoveryActivity" />
|
||||
<activity android:name=".cart.AddressListActivity" />
|
||||
<activity android:name=".cart.AddAddressActivity" />
|
||||
<activity android:name=".order.OrderActivity" />
|
||||
@@ -303,8 +269,19 @@
|
||||
<activity android:name=".order.PayActivity" />
|
||||
<activity android:name=".discovery.HistoryRecordActivity" />
|
||||
<activity android:name=".discovery.ShareCodeActivity" />
|
||||
<activity android:name=".discovery.PropertyActivity" android:theme="@style/TAppTheme" />
|
||||
<activity
|
||||
android:name=".discovery.PropertyActivity"
|
||||
android:theme="@style/TAppTheme" />
|
||||
<activity android:name=".CodeActivity" />
|
||||
|
||||
<activity
|
||||
android:name=".wxapi.WXPayEntryActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:exported="true"
|
||||
android:label="@string/app_name"
|
||||
android:launchMode="singleTop"
|
||||
android:theme="@style/wxPayTheme"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -33,8 +33,8 @@ public class AddGoodsDialog extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mListener != null) {
|
||||
mListener.onConfirm(etInfo.getText().toString().trim() + ":" + etPrice.getText().toString().trim() + ":" +
|
||||
etNum.getText().toString().trim(),etInfo.getText().toString().trim());
|
||||
mListener.onConfirm(etInfo.getText().toString().trim() + ":" + etNum.getText().toString().trim() + ":" +
|
||||
etPrice.getText().toString().trim() ,etInfo.getText().toString().trim());
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ public class OrderActivity extends BaseActivity<ActivityOrderBinding> {
|
||||
b.btnCancel.setVisibility(View.VISIBLE);
|
||||
b.btnCancel.setText("取消订单");
|
||||
b.tvInfo.setVisibility(View.VISIBLE);
|
||||
|
||||
} else if (orderType == 2) {
|
||||
//待发货
|
||||
b.btnFk.setVisibility(View.VISIBLE);
|
||||
@@ -204,7 +205,9 @@ public class OrderActivity extends BaseActivity<ActivityOrderBinding> {
|
||||
public void onClick(View v) {
|
||||
if (b.btnFk.getText().equals("付款")) {
|
||||
//付款
|
||||
|
||||
Intent intent = new Intent(context, PayActivity.class);
|
||||
intent.putExtra("payment_amount", orderListBean.getOrder_money());
|
||||
startActivityForResult(intent, 18);
|
||||
} else if (b.btnFk.getText().equals("取消订单")) {
|
||||
new XPopup.Builder(context).asConfirm("", "确定要取消订单吗?", new OnConfirmListener() {
|
||||
@Override
|
||||
@@ -383,6 +386,9 @@ public class OrderActivity extends BaseActivity<ActivityOrderBinding> {
|
||||
if (requestCode == 15 && resultCode == 200) {
|
||||
page = 1;
|
||||
getList();
|
||||
} else if (requestCode == 18 && resultCode == 200) {
|
||||
page = 1;
|
||||
getList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.sl.house_property.order;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
@@ -195,7 +196,9 @@ public class OrderDetailActivity extends BaseActivity<ActivityOrderDetailBinding
|
||||
public void onClick(View v) {
|
||||
if (mDataBinding.btnFk.getText().equals("付款")) {
|
||||
//付款
|
||||
|
||||
Intent intent = new Intent(context, PayActivity.class);
|
||||
intent.putExtra("payment_amount", orderListBean.getOrder_money());
|
||||
startActivityForResult(intent, 18);
|
||||
} else if (mDataBinding.btnFk.getText().equals("取消订单")) {
|
||||
new XPopup.Builder(context).asConfirm("", "确定要取消订单吗?", new OnConfirmListener() {
|
||||
@Override
|
||||
@@ -229,6 +232,14 @@ public class OrderDetailActivity extends BaseActivity<ActivityOrderDetailBinding
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == 18 && resultCode == 200) {
|
||||
getData();
|
||||
}
|
||||
}
|
||||
|
||||
private void orderAction(int action, String order_id, String info) {
|
||||
progressDialog.setMessage("提交中");
|
||||
progressDialog.show();
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
package com.sl.house_property.order;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.view.View;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.gyf.immersionbar.ImmersionBar;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.ActivityPayBinding;
|
||||
import com.tencent.mm.opensdk.modelpay.PayReq;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -25,15 +32,23 @@ import utils.Md5;
|
||||
|
||||
public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
private Context context;
|
||||
private String goods_id;
|
||||
private String product_code;
|
||||
private String goods_num;
|
||||
private String sale_price;
|
||||
private String consignee_id;
|
||||
private String total_amount;
|
||||
private String payment_amount;
|
||||
private String goods_user_id;
|
||||
private String order_number;
|
||||
private BroadcastReceiver receiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent1) {
|
||||
if (type == 1) {
|
||||
Intent intent = new Intent(context, OrderActivity.class);
|
||||
intent.putExtra("type", 1);
|
||||
intent.putExtra("orderType", 2);
|
||||
startActivityForResult(intent, 0);
|
||||
} else {
|
||||
PayActivity.this.setResult(200);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
private int type;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
@@ -43,6 +58,7 @@ public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
context = this;
|
||||
progressDialog = new ProgressDialog(this);
|
||||
ImmersionBar.with(this)
|
||||
@@ -58,15 +74,9 @@ public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
});
|
||||
Intent intent = getIntent();
|
||||
mDataBinding.tvTitle.setText("支付");
|
||||
goods_id = intent.getStringExtra("goods_id");
|
||||
product_code = intent.getStringExtra("product_code");
|
||||
goods_num = intent.getStringExtra("goods_num");
|
||||
sale_price = intent.getStringExtra("sale_price");
|
||||
consignee_id = intent.getStringExtra("consignee_id");
|
||||
total_amount = intent.getStringExtra("total_amount");
|
||||
type = intent.getIntExtra("type", 0);
|
||||
payment_amount = intent.getStringExtra("payment_amount");
|
||||
goods_user_id = intent.getStringExtra("goods_user_id");
|
||||
order_number = intent.getStringExtra("order_number");
|
||||
|
||||
String wallet = intent.getStringExtra("wallet");
|
||||
mDataBinding.tv.setText("钱包支付(余额 ¥" + wallet + ")");
|
||||
mDataBinding.tvAmount.setText(payment_amount);
|
||||
@@ -114,7 +124,7 @@ public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
return;
|
||||
}
|
||||
if (mDataBinding.wxpaly.isChecked()) {
|
||||
setToast("微信支付" + payment_amount + "元");
|
||||
wxPay();
|
||||
return;
|
||||
}
|
||||
if (mDataBinding.qianbao2.isChecked()) {
|
||||
@@ -122,6 +132,50 @@ public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
}
|
||||
}
|
||||
});
|
||||
IntentFilter intentFilter = new IntentFilter();
|
||||
intentFilter.addAction("PaySuccess");
|
||||
registerReceiver(receiver, intentFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
unregisterReceiver(receiver);
|
||||
}
|
||||
|
||||
private void wxPay() {
|
||||
RegisterUser user =
|
||||
Config.getInstance(context).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "System");
|
||||
map.put("class", "OrderPrePayId");
|
||||
map.put("amount", payment_amount);
|
||||
map.put("sign", Md5.md5("System" + "OrderPrePayId" + Md5.secret));
|
||||
loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
if (resultcode.status == 0) {
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
WxPayEntity wxPayEntity = new Gson().fromJson(new Gson().toJson(adta), WxPayEntity.class);
|
||||
|
||||
IWXAPI wxapi = WXAPIFactory.createWXAPI(PayActivity.this, wxPayEntity.getAppid());
|
||||
PayReq payReq = new PayReq();
|
||||
payReq.appId = wxPayEntity.getAppid();
|
||||
payReq.partnerId = wxPayEntity.getPartnerid();
|
||||
payReq.prepayId = wxPayEntity.getPrepayid();
|
||||
payReq.packageValue = "Sign=WXPay";
|
||||
payReq.nonceStr = wxPayEntity.getNoncestr();
|
||||
payReq.timeStamp = wxPayEntity.getTimestamp();
|
||||
payReq.sign = wxPayEntity.getPaySign();
|
||||
wxapi.sendReq(payReq);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loader loader = new Loader();
|
||||
@@ -139,7 +193,7 @@ public class PayActivity extends BaseActivity<ActivityPayBinding> {
|
||||
}
|
||||
map.put("app", "Order");
|
||||
map.put("class", "PayBalance");
|
||||
map.put("order_number", order_number);
|
||||
map.put("order_number", payment_amount);
|
||||
map.put("sign", Md5.md5("Order" + "PayBalance" + Md5.secret));
|
||||
loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
|
||||
@@ -285,6 +285,7 @@ public class SettleActivity extends BaseActivity<ActivitySettleBinding> {
|
||||
|
||||
Intent intent = new Intent(context, PayActivity.class);
|
||||
intent.putExtra("goods_id", goods_id);
|
||||
intent.putExtra("type", 1);
|
||||
intent.putExtra("product_code", product_code);
|
||||
intent.putExtra("goods_num", goods_num);
|
||||
intent.putExtra("sale_price", sale_price);
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.sl.house_property.order;
|
||||
|
||||
import android.support.annotation.Keep;
|
||||
|
||||
@Keep
|
||||
public class WxPayEntity {
|
||||
|
||||
private String appid;
|
||||
private String partnerid;
|
||||
private String timestamp;
|
||||
private String noncestr;
|
||||
private String prepayid;
|
||||
private String paySign;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxPayEntity{" +
|
||||
"appid='" + appid + '\'' +
|
||||
", partnerid='" + partnerid + '\'' +
|
||||
", timestamp='" + timestamp + '\'' +
|
||||
", noncestr='" + noncestr + '\'' +
|
||||
", prepayid='" + prepayid + '\'' +
|
||||
", paySign='" + paySign + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public String getAppid() {
|
||||
return appid;
|
||||
}
|
||||
|
||||
public void setAppid(String appid) {
|
||||
this.appid = appid;
|
||||
}
|
||||
|
||||
public String getPartnerid() {
|
||||
return partnerid;
|
||||
}
|
||||
|
||||
public void setPartnerid(String partnerid) {
|
||||
this.partnerid = partnerid;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getNoncestr() {
|
||||
return noncestr;
|
||||
}
|
||||
|
||||
public void setNoncestr(String noncestr) {
|
||||
this.noncestr = noncestr;
|
||||
}
|
||||
|
||||
public String getPrepayid() {
|
||||
return prepayid;
|
||||
}
|
||||
|
||||
public void setPrepayid(String prepayid) {
|
||||
this.prepayid = prepayid;
|
||||
}
|
||||
|
||||
public String getPaySign() {
|
||||
return paySign;
|
||||
}
|
||||
|
||||
public void setPaySign(String paySign) {
|
||||
this.paySign = paySign;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.sl.house_property.wxapi;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
|
||||
|
||||
public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
|
||||
@Override
|
||||
public void onReq(BaseReq baseReq) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResp(BaseResp baseResp) {
|
||||
if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
|
||||
if (baseResp.errCode == 0) {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("PaySuccess");
|
||||
this.sendBroadcast(intent);
|
||||
// val intent = Intent()
|
||||
// intent.action = "PaySuccess"
|
||||
// intent.putExtra("payCode", p0.errCode)
|
||||
// this.sendBroadcast(intent)
|
||||
// finish()
|
||||
}
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="xx"
|
||||
android:text="订单"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
@@ -130,5 +130,10 @@
|
||||
<item name="android:windowExitAnimation">@anim/dialog_dismiss</item>
|
||||
|
||||
</style>
|
||||
|
||||
<!--解决微信支付回调部分机型黑屏闪烁的问题-->
|
||||
<style name="wxPayTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user