Commit 88cc501b authored by 杨秀秀's avatar 杨秀秀

基础搭建

功能开发
1:1.2.0 提交版本
parent a72f1f5b
This diff is collapsed.
...@@ -4,11 +4,11 @@ plugins { ...@@ -4,11 +4,11 @@ plugins {
id 'kotlin-kapt' 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_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\"" def URL_RELEASE_H5="\"https://www.hbhapp.cn\""
...@@ -17,7 +17,7 @@ android { ...@@ -17,7 +17,7 @@ android {
signingConfigs { signingConfigs {
reseale { reseale {
storeFile file('D:\\androidProJect\\HBHFurniture\\app\\merchant_hbh.jks') storeFile file('D:\\work\\key\\merchant_hbh.jks')
storePassword 'xxmerchant741' storePassword 'xxmerchant741'
keyPassword 'xxmerchant741' keyPassword 'xxmerchant741'
keyAlias 'zoe' keyAlias 'zoe'
...@@ -37,8 +37,8 @@ android { ...@@ -37,8 +37,8 @@ android {
applicationId "com.xx.merchanthbh" applicationId "com.xx.merchanthbh"
minSdk 23 minSdk 23
targetSdk 31 targetSdk 31
versionCode 2 versionCode 3
versionName "1.1.0" versionName "1.2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.reseale signingConfig signingConfigs.reseale
...@@ -47,7 +47,6 @@ android { ...@@ -47,7 +47,6 @@ android {
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false
debuggable false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.reseale signingConfig signingConfigs.reseale
buildConfigField "String", "URL", URL_RELEASE buildConfigField "String", "URL", URL_RELEASE
...@@ -57,7 +56,8 @@ android { ...@@ -57,7 +56,8 @@ android {
minifyEnabled false minifyEnabled false
debuggable true debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "URL", URL_RELEASE signingConfig signingConfigs.reseale
buildConfigField "String", "URL", URL_DEBUG
buildConfigField "String", "URL_H5", URL_DEBUG_H5 buildConfigField "String", "URL_H5", URL_DEBUG_H5
} }
} }
...@@ -100,7 +100,7 @@ dependencies { ...@@ -100,7 +100,7 @@ dependencies {
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1' implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation project(path: ':dsbridge') implementation project(path: ':dsbridge')
implementation files('libs/qmf-ppplugin-android-3.1.6.aar') implementation files('libs/qmf-ppplugin-android-3.1.7-ali.aar')
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:2.2.2' androidTestImplementation 'androidx.test.espresso:espresso-core:2.2.2'
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" /> <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" /> <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!--支付--> <!--支付-->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/> <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
...@@ -275,14 +276,19 @@ ...@@ -275,14 +276,19 @@
/> />
<activity android:name=".wxapi.WXEntryActivity"
<activity
android:name=".wxapi.WXPayEntryActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask" android:launchMode="singleTop">
android:taskAffinity="com.xx.merchanthbh"
android:screenOrientation="portrait">
</activity> <intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="wx0f25d8c6bc282a16"/>
</intent-filter>
</activity>
</application> </application>
<queries> <queries>
<package android:name="com.tencent.mm" /> <package android:name="com.tencent.mm" />
...@@ -291,5 +297,4 @@ ...@@ -291,5 +297,4 @@
</queries> </queries>
</manifest> </manifest>
\ No newline at end of file
package com.xx.merchanthbh.ui.electric package com.xx.merchanthbh.ui.electric
import android.Manifest
import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.text.Editable import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher import android.text.TextWatcher
import android.view.View import android.view.View
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
...@@ -12,7 +16,10 @@ import com.xx.merchanthbh.R ...@@ -12,7 +16,10 @@ import com.xx.merchanthbh.R
import com.xx.merchanthbh.data.http.requst.ElectricPayRequest import com.xx.merchanthbh.data.http.requst.ElectricPayRequest
import com.xx.merchanthbh.data.staticdata.StaticData import com.xx.merchanthbh.data.staticdata.StaticData
import com.xx.merchanthbh.databinding.ActivityElectricPayBinding import com.xx.merchanthbh.databinding.ActivityElectricPayBinding
import io.reactivex.rxjava3.core.Observer
import io.reactivex.rxjava3.disposables.Disposable
import me.goldze.mvvmhabit.base.BaseActivity import me.goldze.mvvmhabit.base.BaseActivity
import me.goldze.mvvmhabit.utils.ToastUtils
class ElectricPayActivity : BaseActivity<ActivityElectricPayBinding, ElectricPayViewModel>() { class ElectricPayActivity : BaseActivity<ActivityElectricPayBinding, ElectricPayViewModel>() {
...@@ -113,5 +120,37 @@ class ElectricPayActivity : BaseActivity<ActivityElectricPayBinding, ElectricPay ...@@ -113,5 +120,37 @@ class ElectricPayActivity : BaseActivity<ActivityElectricPayBinding, ElectricPay
).into(binding.imageStore) ).into(binding.imageStore)
} }
} }
viewModel.call.observe(this) { call ->
if (!TextUtils.isEmpty(call)) {
rp.request(Manifest.permission.CALL_PHONE, Manifest.permission.READ_EXTERNAL_STORAGE).subscribe(object: Observer<Boolean>{
override fun onSubscribe(d: Disposable) {
}
override fun onError(e: Throwable) {
ToastUtils.showShort("请开启拨打电话权限,否则无法正常使用完整功能")
}
override fun onComplete() {
}
override fun onNext(t: Boolean) {
if (t) {
val intent = Intent(Intent.ACTION_CALL)
val data = Uri.parse("tel:13011367877")
intent.data = data
startActivity(intent)
} else {
ToastUtils.showShort("请开启拨打电话权限,否则无法正常使用完整功能")
}
}
})
}
}
} }
} }
\ No newline at end of file
...@@ -4,8 +4,10 @@ import static android.provider.ContactsContract.Directory.PACKAGE_NAME; ...@@ -4,8 +4,10 @@ import static android.provider.ContactsContract.Directory.PACKAGE_NAME;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo; import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.net.Uri;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
...@@ -52,6 +54,9 @@ public class ElectricPayViewModel extends BaseViewModel<ElectricPayRequest> { ...@@ -52,6 +54,9 @@ public class ElectricPayViewModel extends BaseViewModel<ElectricPayRequest> {
// 创建商户logo的实体对象 // 创建商户logo的实体对象
private MutableLiveData<String> storeImageUrl = new MutableLiveData<>(""); private MutableLiveData<String> storeImageUrl = new MutableLiveData<>("");
public MutableLiveData<String> call = new MutableLiveData<>("");
//商户信息 //商户信息
public MerchantBean userMerchant = LocalData.getMerchant(); public MerchantBean userMerchant = LocalData.getMerchant();
...@@ -265,6 +270,24 @@ public class ElectricPayViewModel extends BaseViewModel<ElectricPayRequest> { ...@@ -265,6 +270,24 @@ public class ElectricPayViewModel extends BaseViewModel<ElectricPayRequest> {
} }
public void callPhone(View view)
{
showCommTextDialog(new RefuseDialogBean("客服电话:13011367877", "呼叫", "取消", ""), new CommTextDialog.onAcceptCallBack() {
@Override
public void acceptBack() {
call.postValue("1231");
}
@Override
public void refuseBack() {
dismissDialog();
}
});
}
public View.OnClickListener goBillList = new View.OnClickListener() { public View.OnClickListener goBillList = new View.OnClickListener() {
@Override @Override
......
...@@ -4,11 +4,8 @@ import android.content.Intent; ...@@ -4,11 +4,8 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.util.Log; import android.util.Log;
import android.widget.Button;
import android.widget.Toast;
import com.chinaums.pppay.unify.UnifyPayPlugin; import com.chinaums.pppay.unify.UnifyPayPlugin;
import com.google.gson.JsonObject;
import com.tencent.mm.opensdk.constants.ConstantsAPI; import com.tencent.mm.opensdk.constants.ConstantsAPI;
import com.tencent.mm.opensdk.modelbase.BaseReq; import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp; import com.tencent.mm.opensdk.modelbase.BaseResp;
...@@ -22,8 +19,8 @@ import com.xx.merchanthbh.ui.bill.BillListActivity; ...@@ -22,8 +19,8 @@ import com.xx.merchanthbh.ui.bill.BillListActivity;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHandler { public class WXPayEntryActivity extends AppCompatActivity implements IWXAPIEventHandler {
private static final String TAG = "debug"; private static final String TAG = "WXEntryActivity";
private IWXAPI api; private IWXAPI api;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -31,7 +28,6 @@ public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHan ...@@ -31,7 +28,6 @@ public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHan
Log.d(TAG,"WXEntryActivity --- onCreate"); Log.d(TAG,"WXEntryActivity --- onCreate");
setContentView(R.layout.activity_wxpay_entry); setContentView(R.layout.activity_wxpay_entry);
api = WXAPIFactory.createWXAPI(this,UnifyPayPlugin.getInstance(this).getAppId()); api = WXAPIFactory.createWXAPI(this,UnifyPayPlugin.getInstance(this).getAppId());
api.handleIntent(getIntent(), this); api.handleIntent(getIntent(), this);
} }
...@@ -50,31 +46,22 @@ public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHan ...@@ -50,31 +46,22 @@ public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHan
@Override @Override
public void onResp(BaseResp baseResp) { public void onResp(BaseResp baseResp) {
Log.d(TAG,"WXEntryActivity --- onResp"); Log.d(TAG,"WXEntryActivity --- onReq"+baseResp.getType());
if (baseResp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) { if (baseResp.getType() == ConstantsAPI.COMMAND_PAY_BY_WX) {
WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) baseResp;
String extraData =launchMiniProResp.extMsg; //对应小程序组件 <button open-type="launchApp"> 中的 app-parameter 属性
Log.d(TAG,"onResp --- " + extraData);
// UnifyPayPlugin.getInstance(this).getWXListener().onResponse(this, baseResp);
/* Toast.makeText(this,msg,Toast.LENGTH_LONG).show();*/ if (baseResp.errCode==0)
UnifyPayPlugin.getInstance(this).getWXListener().onResponse(this, baseResp);
try {
JSONObject object=new JSONObject(extraData);
if (object.getInt("errCode")==0)
{ {
startActivity(new Intent(this, BillListActivity.class)); startActivity(new Intent(this, BillListActivity.class));
finish(); finish();
}else { }else {
finish(); finish();
} }
} catch (JSONException e) {
throw new RuntimeException(e);
}
}else { }else {
Log.d(TAG,"WXEntryActivity --- onReq"+baseResp.getType());
finish(); finish();
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="17dp"> android:padding="17dp">
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="96dp" android:layout_height="96dp"
android:background="@mipmap/home_img_bg" android:background="@mipmap/home_img_bg"
...@@ -67,6 +67,9 @@ ...@@ -67,6 +67,9 @@
android:id="@+id/image_store" android:id="@+id/image_store"
android:layout_width="48dp" android:layout_width="48dp"
android:layout_height="48dp" android:layout_height="48dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:src="@drawable/bg_white_radius_12" android:src="@drawable/bg_white_radius_12"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="17dp" android:layout_marginLeft="17dp"
...@@ -76,11 +79,27 @@ ...@@ -76,11 +79,27 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="17dp" android:layout_marginLeft="17dp"
app:layout_constraintLeft_toRightOf="@+id/image_store"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:text="@{viewModel.companyName}" android:text="@{viewModel.companyName}"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18dp" /> android:textSize="18dp" />
</LinearLayout>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginLeft="17dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_margin="17dp"
android:onClick="@{viewModel.callPhone}"
android:src="@mipmap/kefu"
android:textColor="@color/white"
android:textSize="18dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -229,15 +229,15 @@ ...@@ -229,15 +229,15 @@
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<!--电费余额模块--> <!--电费余额模块-->
<androidx.constraintlayout.widget.ConstraintLayout <!-- <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="100dp" android:layout_width="100dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_columnSpan="1" android:layout_columnSpan="1"
android:layout_columnWeight="1" android:layout_columnWeight="1"
tools:ignore="MissingConstraints"> tools:ignore="MissingConstraints">
<!--今日下单用户--> &lt;!&ndash;今日下单用户&ndash;&gt;
<!--今日下单用户--> &lt;!&ndash;今日下单用户&ndash;&gt;
<TextView <TextView
android:id="@+id/tv_home_tf" android:id="@+id/tv_home_tf"
style="@style/CommText" style="@style/CommText"
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
android:textSize="14sp" android:textSize="14sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent" /> app:layout_constraintLeft_toLeftOf="parent" />
<!--今日下单用户数--> &lt;!&ndash;今日下单用户数&ndash;&gt;
<TextView <TextView
android:id="@+id/tv_home_tfn" android:id="@+id/tv_home_tfn"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -270,7 +270,7 @@ ...@@ -270,7 +270,7 @@
app:layout_constraintLeft_toRightOf="@+id/tv_home_tfn" /> app:layout_constraintLeft_toRightOf="@+id/tv_home_tfn" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>-->
</GridLayout> </GridLayout>
</LinearLayout> </LinearLayout>
......
...@@ -121,12 +121,5 @@ public class WorkFragment extends BaseFragment<FragmentWorkBinding, WorkViewMode ...@@ -121,12 +121,5 @@ public class WorkFragment extends BaseFragment<FragmentWorkBinding, WorkViewMode
} }
}); });
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
if (!Environment.isExternalStorageManager()) {
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
intent.setData(Uri.parse("package:" + getContext().getPackageName()));
startActivityForResult(intent, 1024);
}
}
} }
} }
...@@ -402,7 +402,7 @@ public class WorkViewModel extends BaseViewModel<WorkRequest> { ...@@ -402,7 +402,7 @@ public class WorkViewModel extends BaseViewModel<WorkRequest> {
/*商品审核值赋值*/ /*商品审核值赋值*/
if (StaticData.productManagementId == 1) if (StaticData.productManagementId == 1)
{ {
if (t2.get().equals("0")) if (type==0 && t2.get().equals("0"))
{ {
ToastUtils.showShort("暂无内容"); ToastUtils.showShort("暂无内容");
}else { }else {
......
...@@ -61,7 +61,7 @@ public abstract class BaseActivity<V extends ViewDataBinding, VM extends BaseVie ...@@ -61,7 +61,7 @@ public abstract class BaseActivity<V extends ViewDataBinding, VM extends BaseVie
private MaterialDialog dialog; private MaterialDialog dialog;
private NUllDialog nullDialog; private NUllDialog nullDialog;
RxPermissions rp; public RxPermissions rp;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
......
...@@ -6,11 +6,11 @@ plugins { ...@@ -6,11 +6,11 @@ plugins {
android { android {
namespace 'com.xx.xxviewlibrary' namespace 'com.xx.xxviewlibrary'
compileSdk 33 compileSdk 30
defaultConfig { defaultConfig {
minSdk 23 minSdk 23
targetSdk 33 targetSdk 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro" consumerProguardFiles "consumer-rules.pro"
......
...@@ -84,6 +84,8 @@ fun checkVersionUpdata(self: String, line: String): Boolean { ...@@ -84,6 +84,8 @@ fun checkVersionUpdata(self: String, line: String): Boolean {
if (lines.get(i).toInt() > selfs.get(i).toInt()) { if (lines.get(i).toInt() > selfs.get(i).toInt()) {
return true return true
}else if (lines.get(i).toInt() < selfs.get(i).toInt()){
return false
} }
} }
......
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