Commit 5f1d9219 by Wyh

1、預發佈環境 2、地址列表頁面 3、凍鏈下載文檔顯示加載框

Signed-off-by: Wyh <1239658231>
parent 52ac7855
...@@ -15,6 +15,13 @@ public class FunctionManagerConstants { ...@@ -15,6 +15,13 @@ public class FunctionManagerConstants {
public static final String CLOSING_BTN_KEY = "takeaway/orderDetails/btn/closing"; public static final String CLOSING_BTN_KEY = "takeaway/orderDetails/btn/closing";
public static final String TRANSPORTATION_BTN_KEY = "takeaway/orderDetails/btn/transportation"; public static final String TRANSPORTATION_BTN_KEY = "takeaway/orderDetails/btn/transportation";
public static final String ADDITIONALSERVICECHARGE_BTN_KEY = "takeaway/orderDetails/btn/additionalServiceCharge"; public static final String ADDITIONALSERVICECHARGE_BTN_KEY = "takeaway/orderDetails/btn/additionalServiceCharge";
//新訂單
public static final String TAKEAWAY_NEW_ORDER = "takeaway/btn/newOrder";
//歷史訂單
public static final String TAKEAWAY_HISTORY_ORDER = "takeaway/btn/historyOrder";
//開錢箱
public static final String TAKEAWAY_OPEN_CASH_BOX = "takeaway/btn/openCashBox";
/** 外送/自取- 訂單詳情管理 */ /** 外送/自取- 訂單詳情管理 */
public static final FModule[] orderDetails = { public static final FModule[] orderDetails = {
...@@ -28,6 +35,11 @@ public class FunctionManagerConstants { ...@@ -28,6 +35,11 @@ public class FunctionManagerConstants {
new FModule(TRANSPORTATION_BTN_KEY, 0, 0), new FModule(TRANSPORTATION_BTN_KEY, 0, 0),
new FModule(ADDITIONALSERVICECHARGE_BTN_KEY, 0, 0) new FModule(ADDITIONALSERVICECHARGE_BTN_KEY, 0, 0)
}; };
/** 外送/自取- 首頁按鈕管理 */
public static final FModule[] takeawayMain = {
new FModule(TAKEAWAY_NEW_ORDER, 0, 0)
};
} }
......
...@@ -37,6 +37,7 @@ public class HttpsConstans { ...@@ -37,6 +37,7 @@ public class HttpsConstans {
private static String HTTP_ADDRESS_URL_FORMAL = "https://m.ricepon.com:8444";//正式服務器 private static String HTTP_ADDRESS_URL_FORMAL = "https://m.ricepon.com:8444";//正式服務器
private static String HTTP_ADDRESS_URL_SZ = "http://gingersoft.tpddns.cn:58201";//深圳測試 private static String HTTP_ADDRESS_URL_SZ = "http://gingersoft.tpddns.cn:58201";//深圳測試
private static String HTTP_ADDRESS_URL_HK = "http://a.ricepon.com:58201";//香港測試 private static String HTTP_ADDRESS_URL_HK = "http://a.ricepon.com:58201";//香港測試
private static String HTTP_ADDRESS_URL_PRE = "http://prf-m.ricepon.com/";//預發佈
public static String CLOUD_GSA_API_PATH = "/ricepon-cloud-gsa/api/";//路徑 public static String CLOUD_GSA_API_PATH = "/ricepon-cloud-gsa/api/";//路徑
...@@ -146,6 +147,18 @@ public class HttpsConstans { ...@@ -146,6 +147,18 @@ public class HttpsConstans {
ROOT_SERVER = HTTP_ADDRESS_URL_HK; ROOT_SERVER = HTTP_ADDRESS_URL_HK;
break; break;
case 2: case 2:
//預發佈
RICEPON_MEMBER_61177 = HTTP_ADDRESS_URL_PRE + API_RICEPON_MEMBER;
_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE;
ROOT_SERVER_ADDRESS_FORMAL = HTTP_ADDRESS_URL_PRE + CLOUD_GSA_API_PATH;
ROOT_URL = HTTP_ADDRESS_URL_PRE;
REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + REPORT_PATH;
WECHAR_REPORT_SERVER_ADDRESS = HTTP_ADDRESS_URL_PRE + WECHAR_REPORT_PATH;
SYSTEM_URL = HTTP_ADDRESS_URL_PRE + SYSTEM_PATH;
ROOT_SERVER = HTTP_ADDRESS_URL_PRE;
break;
case 3:
RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER; RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER;
_SERVER_ADDRESS = ROOT_SERVER_ZHI_WANG_HK + WECHAR_REPORT_PATH; _SERVER_ADDRESS = ROOT_SERVER_ZHI_WANG_HK + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
...@@ -155,7 +168,7 @@ public class HttpsConstans { ...@@ -155,7 +168,7 @@ public class HttpsConstans {
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
SYSTEM_URL = ROOT_SERVER_ZHI_WANG_HK + SYSTEM_PATH; SYSTEM_URL = ROOT_SERVER_ZHI_WANG_HK + SYSTEM_PATH;
break; break;
case 3: case 4:
RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER; RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER;
_SERVER_ADDRESS = ROOT_SERVER_YOU_CHANG_HK + WECHAR_REPORT_PATH; _SERVER_ADDRESS = ROOT_SERVER_YOU_CHANG_HK + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
...@@ -165,7 +178,7 @@ public class HttpsConstans { ...@@ -165,7 +178,7 @@ public class HttpsConstans {
WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS WECHAR_REPORT_SERVER_ADDRESS = WECHAR_REPORT_TEST_ADDRESS + WECHAR_REPORT_PATH;//正式:WECHAR_REPORT_FORMAL_ADDRESS 測試:WECHAR_REPORT_TEST_ADDRESS
SYSTEM_URL = ROOT_SERVER_YOU_CHANG_HK + SYSTEM_PATH; SYSTEM_URL = ROOT_SERVER_YOU_CHANG_HK + SYSTEM_PATH;
break; break;
case 4: case 5:
RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER; RICEPON_MEMBER_61177 = WECHAR_REPORT_TEST_ADDRESS + API_RICEPON_MEMBER;
_SERVER_ADDRESS = ROOT_SERVER_SHI_SHU_HK + WECHAR_REPORT_PATH; _SERVER_ADDRESS = ROOT_SERVER_SHI_SHU_HK + WECHAR_REPORT_PATH;
ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS; ROOT_SETTLEMENT_REPORT_SERVER_ADDRESS_FORMAL = REPORT_TEST_ADDRESS;
......
...@@ -73,4 +73,13 @@ public class FunctionManager { ...@@ -73,4 +73,13 @@ public class FunctionManager {
return functions; return functions;
} }
public static Function getFunctionByKey(List<Function> functions, String key) {
for (Function function : functions) {
if (function.getResUrl().equals(key)) {
return function;
}
}
return null;
}
} }
...@@ -277,7 +277,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -277,7 +277,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
public void download(int orderId, String url) { public void download(int orderId, String url) {
try { try {
updatePrintPdfStatus(orderId); updatePrintPdfStatus(orderId);
Disposable subscribe = Observable.create((ObservableOnSubscribe<File>) emitter -> { Disposable download_success = Observable.create((ObservableOnSubscribe<File>) emitter -> {
OkHttpClient client = new OkHttpClient.Builder().build(); OkHttpClient client = new OkHttpClient.Builder().build();
Request request = new Request.Builder() Request request = new Request.Builder()
.url(url) .url(url)
...@@ -307,9 +307,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -307,9 +307,7 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
fos.write(buf, 0, len); fos.write(buf, 0, len);
sum += len; sum += len;
int progress = (int) (sum * 1.0f / total * 100); int progress = (int) (sum * 1.0f / total * 100);
mRootView.showLoading("下載打印文檔中" + progress + "%"); mRootView.showLoading("下載打印文檔中" + progress + "%");
LogUtil.e(TAG, "download progress : " + progress); LogUtil.e(TAG, "download progress : " + progress);
} }
emitter.onNext(file); emitter.onNext(file);
...@@ -336,37 +334,18 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -336,37 +334,18 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
}); });
}).subscribeOn(Schedulers.io()) }).subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading("獲取打印文件")) .doOnSubscribe(disposable -> {
mRootView.showLoading("下載打印文檔中,請稍候...");
})
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading()) .doAfterTerminate(() -> {
.observeOn(AndroidSchedulers.mainThread()) })
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(file -> mRootView.printLogisticsList(file)); .subscribe(file -> mRootView.printLogisticsList(file));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
// mModel.download(url)
// .subscribeOn(Schedulers.io())
// .doOnSubscribe(disposable -> mRootView.showLoading("請稍候..."))
// .subscribeOn(AndroidSchedulers.mainThread())
// .observeOn(AndroidSchedulers.mainThread())
// .doAfterTerminate(() -> mRootView.hideLoading())
// .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
// .subscribe(new ErrorHandleSubscriber<ResponseBody>(mErrorHandler) {
//
// @Override
// public void onNext(@NonNull ResponseBody info) {
//
//
// mRootView.printLogisticsList();
// }
//
// @Override
// public void onError(Throwable t) {
// super.onError(t);
// mRootView.killMyself();
// }
// });
} }
public void cancelOrder(int orderId) { public void cancelOrder(int orderId) {
...@@ -467,7 +446,6 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo ...@@ -467,7 +446,6 @@ public class OrderDetailsPresenter extends BasePresenter<OrderDetailsContract.Mo
}) })
.subscribeOn(AndroidSchedulers.mainThread()) .subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView)) .compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<PublicBean>(mErrorHandler) { .subscribe(new ErrorHandleSubscriber<PublicBean>(mErrorHandler) {
......
...@@ -5,6 +5,7 @@ import android.content.Context; ...@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.print.PrintManager; import android.print.PrintManager;
import android.util.Log;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.widget.TextView; import android.widget.TextView;
...@@ -173,15 +174,17 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im ...@@ -173,15 +174,17 @@ public class OrderDetailsActivity extends BaseActivity<OrderDetailsPresenter> im
Observable.just(1) Observable.just(1)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(integer -> { .subscribe(integer -> {
if (message != null) if (message != null) {
LoadingDialog.showDialogForLoading(mContext, message, true); LoadingDialog.showDialogForLoading(mContext, message, true);
else } else {
LoadingDialog.showDialogForLoading(mContext); LoadingDialog.showDialogForLoading(mContext);
}
}); });
} }
@Override @Override
public void hideLoading() { public void hideLoading() {
Log.e("eee", "hideLoading");
LoadingDialog.cancelDialogForLoading(); LoadingDialog.cancelDialogForLoading();
} }
......
...@@ -71,4 +71,7 @@ dependencies { ...@@ -71,4 +71,7 @@ dependencies {
if (project.ext.runAsApp) { if (project.ext.runAsApp) {
addComponent 'print-module' addComponent 'print-module'
} }
implementation 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
} }
...@@ -14,31 +14,34 @@ ...@@ -14,31 +14,34 @@
android:screenOrientation="portrait"> android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="action.gingersoft.DELIVERY_ORDER" /> <action android:name="action.gingersoft.DELIVERY_ORDER" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.activity.HistoryOrderActivity" android:name=".ui.activity.HistoryOrderActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.DeliverySettingActivity" android:name=".ui.activity.DeliverySettingActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.OrderDetailsActivity" android:name=".ui.activity.OrderDetailsActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.PayActivity" android:name=".ui.activity.PayActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activity.LogActivity" android:name=".ui.activity.LogActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity <activity
android:name=".mvp.ui.activity.SendOrderActivity" android:name=".mvp.ui.activity.SendOrderActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<meta-data <meta-data
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration" android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value="ConfigModule" /> android:value="ConfigModule" />
<activity
android:name=".mvp.ui.activity.AddressListActivity"
android:screenOrientation="portrait" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
android:networkSecurityConfig="@xml/network_android" android:networkSecurityConfig="@xml/network_android"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".mvp.ui.activity.AddressListActivity" />
<activity android:name=".ui.activity.LogActivity" /> <activity android:name=".ui.activity.LogActivity" />
<activity android:name=".ui.activity.OrderDetailsActivity" /> <activity android:name=".ui.activity.OrderDetailsActivity" />
<activity <activity
......
package com.gingersoft.gsa.delivery_pick_mode.di.component;
import dagger.BindsInstance;
import dagger.Component;
import com.jess.arms.di.component.AppComponent;
import com.gingersoft.gsa.delivery_pick_mode.di.module.AddressListModule;
import com.gingersoft.gsa.delivery_pick_mode.mvp.contract.AddressListContract;
import com.jess.arms.di.scope.ActivityScope;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity.AddressListActivity;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@ActivityScope
@Component(modules = AddressListModule.class, dependencies = AppComponent.class)
public interface AddressListComponent {
void inject(AddressListActivity activity);
@Component.Builder
interface Builder {
@BindsInstance
AddressListComponent.Builder view(AddressListContract.View view);
AddressListComponent.Builder appComponent(AppComponent appComponent);
AddressListComponent build();
}
}
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode.di.module;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import com.gingersoft.gsa.delivery_pick_mode.mvp.contract.AddressListContract;
import com.gingersoft.gsa.delivery_pick_mode.mvp.model.AddressListModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@Module
public abstract class AddressListModule {
@Binds
abstract AddressListContract.Model bindAddressListModel(AddressListModel model);
}
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode.mvp.contract;
import com.jess.arms.mvp.IView;
import com.jess.arms.mvp.IModel;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public interface AddressListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
}
}
package com.gingersoft.gsa.delivery_pick_mode.mvp.model;
import android.app.Application;
import com.google.gson.Gson;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.jess.arms.di.scope.ActivityScope;
import javax.inject.Inject;
import com.gingersoft.gsa.delivery_pick_mode.mvp.contract.AddressListContract;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@ActivityScope
public class AddressListModel extends BaseModel implements AddressListContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public AddressListModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
}
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode.mvp.model; package com.gingersoft.gsa.delivery_pick_mode.mvp.model;
public class MemberAddressInfoBean { import java.io.Serializable;
import java.util.List;
import lombok.Data;
@Data
public class MemberAddressInfoBean implements Serializable {
private static final long serialVersionUID = -1960605902000912387L;
/** /**
* success : true * success : true
* sysTime : 1602675733309 * sysTime : 1602834085480
* data : {"id":57172,"receiver":"王","sex":1,"phone":"18384840551","addressDetail":"455","currentAddress":"美丽华商场","isDefault":1} * data : [{"id":57038,"receiver":"KN95","sex":1,"phone":"18384840551","addressDetail":"暂时难以","currentAddress":"香港長沙灣青山道479A號","isDefault":0},{"id":57172,"receiver":"王","sex":1,"phone":"18384840551","addressDetail":"455","currentAddress":"美丽华商场","isDefault":1}]
*/ */
private boolean success; private boolean success;
private long sysTime; private long sysTime;
private List<DataBean> data;
private String errorMsg; private String errorMsg;
private DataBean data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) { @Data
this.data = data; public static class DataBean implements Serializable {
} private static final long serialVersionUID = 8381984480124252239L;
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public static class DataBean {
/** /**
* id : 57172 * id : 57038
* receiver : * receiver : KN95
* sex : 1 * sex : 1
* phone : 18384840551 * phone : 18384840551
* addressDetail : 455 * addressDetail : 暂时难以
* currentAddress : 美丽华商场 * currentAddress : 香港長沙灣青山道479A號
* isDefault : 1 * isDefault : 0
*/ */
private int id; private int id;
private String receiver; private String receiver;
private int sex; private int sex;
...@@ -61,61 +37,6 @@ public class MemberAddressInfoBean { ...@@ -61,61 +37,6 @@ public class MemberAddressInfoBean {
private String addressDetail; private String addressDetail;
private String currentAddress; private String currentAddress;
private int isDefault; private int isDefault;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public int getSex() {
return sex;
}
public void setSex(int sex) {
this.sex = sex;
}
public String getPhone() {
return phone;
} }
public void setPhone(String phone) {
this.phone = phone;
}
public String getAddressDetail() {
return addressDetail;
}
public void setAddressDetail(String addressDetail) {
this.addressDetail = addressDetail;
}
public String getCurrentAddress() {
return currentAddress;
}
public void setCurrentAddress(String currentAddress) {
this.currentAddress = currentAddress;
}
public int getIsDefault() {
return isDefault;
}
public void setIsDefault(int isDefault) {
this.isDefault = isDefault;
}
}
} }
package com.gingersoft.gsa.delivery_pick_mode.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.delivery_pick_mode.mvp.contract.AddressListContract;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import javax.inject.Inject;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
@ActivityScope
public class AddressListPresenter extends BasePresenter<AddressListContract.Model, AddressListContract.View> {
@Inject
RxErrorHandler mErrorHandler;
@Inject
Application mApplication;
@Inject
ImageLoader mImageLoader;
@Inject
AppManager mAppManager;
@Inject
public AddressListPresenter(AddressListContract.Model model, AddressListContract.View rootView) {
super(model, rootView);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
}
}
...@@ -20,9 +20,7 @@ import org.json.JSONException; ...@@ -20,9 +20,7 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.inject.Inject; import javax.inject.Inject;
...@@ -58,6 +56,8 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -58,6 +56,8 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
@Inject @Inject
AppManager mAppManager; AppManager mAppManager;
public List<OrderDetails.DataBean.PRODUCTNAMEBean> productnameBeans = new ArrayList<>(); public List<OrderDetails.DataBean.PRODUCTNAMEBean> productnameBeans = new ArrayList<>();
public List<MemberAddressInfoBean.DataBean> addressData;
public String addressId;
@Inject @Inject
public SendOrderPresenter(SendOrderContract.Model model, SendOrderContract.View rootView) { public SendOrderPresenter(SendOrderContract.Model model, SendOrderContract.View rootView) {
...@@ -73,36 +73,6 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -73,36 +73,6 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
this.mApplication = null; this.mApplication = null;
} }
public void getConfirmTakeawayOrderData() {
Map<String, Object> map = new HashMap<>(6);
map.put("memberId", 515);
map.put("shopId", 26);
map.put("price", 0);
map.put("pageIndex", 1);
map.put("isdefault", 1);
map.put("pageSize", 15);
mModel.getConfirmTakeawayOrderData(map)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> {
})
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> {
})
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<String>(mErrorHandler) {
@Override
public void onNext(String s) {
// https://hktest.ricepon.com:64377/member-web/api/member/getAddressAndResSetting?&pageSize=15&shopId=26&isdefault=1&pageIndex=1&price=0&memberId=515
}
@Override
public void onError(Throwable t) {
super.onError(t);
}
});
}
public void getMemberAddressInfo(String phone) { public void getMemberAddressInfo(String phone) {
mModel.getMemberAddressInfo(phone) mModel.getMemberAddressInfo(phone)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
...@@ -116,7 +86,8 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -116,7 +86,8 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
public void onNext(@NonNull MemberAddressInfoBean info) { public void onNext(@NonNull MemberAddressInfoBean info) {
if (info != null) { if (info != null) {
if (info.isSuccess() && info.getData() != null) { if (info.isSuccess() && info.getData() != null) {
mRootView.loadMemberInfo(info.getData()); mRootView.loadMemberInfo(info.getData().get(0));
addressData = info.getData();
} else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrorMsg())) { } else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrorMsg())) {
mRootView.showMessage(info.getErrorMsg()); mRootView.showMessage(info.getErrorMsg());
} else { } else {
...@@ -146,7 +117,7 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -146,7 +117,7 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
public void onNext(@NonNull RiceponAddOrderBean info) { public void onNext(@NonNull RiceponAddOrderBean info) {
if (info.getCode().equals("1")) { if (info.getCode().equals("1")) {
mRootView.killMyself(); mRootView.killMyself();
} else if(TextUtil.isNotEmptyOrNullOrUndefined(info.getErrorMsg())){ } else if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrorMsg())) {
mRootView.showMessage(info.getErrorMsg()); mRootView.showMessage(info.getErrorMsg());
} }
} }
...@@ -178,8 +149,10 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -178,8 +149,10 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
//实际总价 //实际总价
json.put("totalPrice", MyOrderManage.getInstance().getTotalAmount()); json.put("totalPrice", MyOrderManage.getInstance().getTotalAmount());
json.put("waimaiSendTime", waimaiSendTime);//送单时间 json.put("waimaiSendTime", waimaiSendTime);//送单时间
JSONArray foodArray = new JSONArray(); json.put("addressId", addressId);
json.put("sendTime", waimaiSendTime);
JSONArray foodArray = new JSONArray();
for (OrderDetails.DataBean.PRODUCTNAMEBean productnameBean : productnameBeans) { for (OrderDetails.DataBean.PRODUCTNAMEBean productnameBean : productnameBeans) {
JSONObject food = getFoodJson(productnameBean); JSONObject food = getFoodJson(productnameBean);
if (productnameBean.getChild() != null) { if (productnameBean.getChild() != null) {
...@@ -220,6 +193,7 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S ...@@ -220,6 +193,7 @@ public class SendOrderPresenter extends BasePresenter<SendOrderContract.Model, S
} }
return object; return object;
} }
private JSONObject getFoodJson(OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX childBean) { private JSONObject getFoodJson(OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX childBean) {
JSONObject object = new JSONObject(); JSONObject object = new JSONObject();
try { try {
......
package com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.gingersoft.gsa.delivery_pick_mode.R;
import com.gingersoft.gsa.delivery_pick_mode.R2;
import com.gingersoft.gsa.delivery_pick_mode.di.component.DaggerAddressListComponent;
import com.gingersoft.gsa.delivery_pick_mode.mvp.contract.AddressListContract;
import com.gingersoft.gsa.delivery_pick_mode.mvp.model.MemberAddressInfoBean;
import com.gingersoft.gsa.delivery_pick_mode.mvp.presenter.AddressListPresenter;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.adapter.AddressAdapter;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.widget.QMUITopBar;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import static com.jess.arms.utils.Preconditions.checkNotNull;
/**
* ================================================
* Description:
* <p>
* Created by MVPArmsTemplate on 10/16/2020 15:53
* <a href="mailto:jess.yan.effort@gmail.com">Contact me</a>
* <a href="https://github.com/JessYanCoding">Follow me</a>
* <a href="https://github.com/JessYanCoding/MVPArms">Star me</a>
* <a href="https://github.com/JessYanCoding/MVPArms/wiki">See me</a>
* <a href="https://github.com/JessYanCoding/MVPArmsTemplate">模版请保持更新</a>
* ================================================
*/
public class AddressListActivity extends BaseActivity<AddressListPresenter> implements AddressListContract.View {
@BindView(R2.id.rv_address_list)
RecyclerView rvAddressList;
public static final String RESULT_DATA_NAME = "addressDetail";
public static final String RESULT_CODE = "resultCode";
public static final String REQUEST_ADDRESS_LIST_NAME = "addressList";
@BindView(R2.id.address_list_top_bar)
QMUITopBar addressListTopBar;
@Override
public void setupActivityComponent(@NonNull AppComponent appComponent) {
DaggerAddressListComponent //如找不到该类,请编译一下项目
.builder()
.appComponent(appComponent)
.view(this)
.build()
.inject(this);
}
@Override
public int initView(@Nullable Bundle savedInstanceState) {
return R.layout.activity_address_list;
}
@Override
public void initData(@Nullable Bundle savedInstanceState) {
List<MemberAddressInfoBean.DataBean> dataBeanList = (List<MemberAddressInfoBean.DataBean>) getIntent().getSerializableExtra(REQUEST_ADDRESS_LIST_NAME);
int resultCode = getIntent().getIntExtra(RESULT_CODE, 0);
AddressAdapter addressAdapter = new AddressAdapter(dataBeanList);
addressAdapter.setOnItemChildClickListener((adapter, view, position) -> {
Intent intent = new Intent();
intent.putExtra(RESULT_DATA_NAME, dataBeanList.get(position));
setResult(resultCode, intent);
finish();
});
rvAddressList.setAdapter(addressAdapter);
rvAddressList.setLayoutManager(new LinearLayoutManager(mContext));
}
@Override
public void initIntent() {
}
@Override
public void initTopBar() {
addressListTopBar.setTitle("地址列表");
addressListTopBar.setBackgroundColor(ContextCompat.getColor(this, R.color.theme_color));
addressListTopBar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener(v -> killMyself());
}
@Override
public void initLanguage() {
}
@Override
public void initLayoutParams() {
}
@Override
public void initLayoutVisible() {
}
@Override
public void showLoading(String message) {
if (message != null) {
LoadingDialog.showDialogForLoading(this, message, true);
} else {
LoadingDialog.showDialogForLoading(this);
}
}
@Override
public void hideLoading() {
LoadingDialog.cancelDialogForLoading();
}
@Override
public void showMessage(@NonNull String message) {
ArmsUtils.makeText(this, message);
}
@Override
public void launchActivity(@NonNull Intent intent) {
checkNotNull(intent);
ArmsUtils.startActivity(intent);
}
@Override
public void killMyself() {
finish();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO: add setContentView(...) invocation
ButterKnife.bind(this);
}
}
...@@ -41,6 +41,7 @@ import com.qmuiteam.qmui.widget.QMUITopBar; ...@@ -41,6 +41,7 @@ import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.popup.QMUIPopup; import com.qmuiteam.qmui.widget.popup.QMUIPopup;
import com.qmuiteam.qmui.widget.popup.QMUIPopups; import com.qmuiteam.qmui.widget.popup.QMUIPopups;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
...@@ -110,6 +111,9 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen ...@@ -110,6 +111,9 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
@BindView(R2.id.group_time) @BindView(R2.id.group_time)
Group timeGroup; Group timeGroup;
private final int SELECT_ADDRESS_REQUEST_CODE = 1001;
private final int SELECT_ADDRESS_RESULT_CODE = 1002;
@Override @Override
public void setupActivityComponent(@NonNull AppComponent appComponent) { public void setupActivityComponent(@NonNull AppComponent appComponent) {
DaggerSendOrderComponent //如找不到该类,请编译一下项目 DaggerSendOrderComponent //如找不到该类,请编译一下项目
...@@ -276,7 +280,7 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen ...@@ -276,7 +280,7 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
private List<String> deliveryTimes = Arrays.asList("現在送出", "其他時間"); private List<String> deliveryTimes = Arrays.asList("現在送出", "其他時間");
private String sendTime; private String sendTime;
@OnClick({R2.id.tv_continue_add_food, R2.id.iv_send_order_search, R2.id.tv_delivery_time_hour, R2.id.tv_delivery_time_min, R2.id.tv_delivery_time_type, R2.id.iv_select_delivery_time, R2.id.tv_confirm_order}) @OnClick({R2.id.iv_select_member_arrow, R2.id.iv_select_address_arrow, R2.id.tv_continue_add_food, R2.id.iv_send_order_search, R2.id.tv_delivery_time_hour, R2.id.tv_delivery_time_min, R2.id.tv_delivery_time_type, R2.id.iv_select_delivery_time, R2.id.tv_confirm_order})
@Override @Override
public void onClick(View v) { public void onClick(View v) {
int viewId = v.getId(); int viewId = v.getId();
...@@ -303,8 +307,8 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen ...@@ -303,8 +307,8 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
TimePickerUtils.showTimePicker(mContext, startTime, (date, v1) -> { TimePickerUtils.showTimePicker(mContext, startTime, (date, v1) -> {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(date); calendar.setTime(date);
tvDeliveryTimeHour.setText(calendar.get(Calendar.HOUR)); tvDeliveryTimeHour.setText(calendar.get(Calendar.HOUR_OF_DAY) + "");
tvDeliveryTimeMin.setText(calendar.get(Calendar.MINUTE)); tvDeliveryTimeMin.setText(calendar.get(Calendar.MINUTE) + "");
sendTime = TimeUtils.getStringByFormat(date, TimeUtils.DEFAULT_DATE_FORMAT_YMDHM); sendTime = TimeUtils.getStringByFormat(date, TimeUtils.DEFAULT_DATE_FORMAT_YMDHM);
}); });
} else if (viewId == R.id.iv_send_order_search) { } else if (viewId == R.id.iv_send_order_search) {
...@@ -316,6 +320,14 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen ...@@ -316,6 +320,14 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
} }
} else if (viewId == R.id.tv_continue_add_food) { } else if (viewId == R.id.tv_continue_add_food) {
killMyself(); killMyself();
} else if (viewId == R.id.iv_select_member_arrow || viewId == R.id.iv_select_address_arrow) {
if (mPresenter.addressData == null) {
} else {
Intent intent = new Intent(mContext, AddressListActivity.class);
intent.putExtra(AddressListActivity.REQUEST_ADDRESS_LIST_NAME, (Serializable) mPresenter.addressData);
intent.putExtra(AddressListActivity.RESULT_CODE, SELECT_ADDRESS_RESULT_CODE);
startActivityForResult(intent, SELECT_ADDRESS_REQUEST_CODE);
}
} }
} }
...@@ -354,8 +366,26 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen ...@@ -354,8 +366,26 @@ public class SendOrderActivity extends BaseActivity<SendOrderPresenter> implemen
@Override @Override
public void loadMemberInfo(MemberAddressInfoBean.DataBean data) { public void loadMemberInfo(MemberAddressInfoBean.DataBean data) {
if (data != null) {
mPresenter.addressId = data.getId() + "";
edSendOrderName.setText(data.getReceiver()); edSendOrderName.setText(data.getReceiver());
edSendOrderPhone.setText(data.getPhone().toString()); edSendOrderPhone.setText(data.getPhone().toString());
edSendOrderAddress.setText(data.getCurrentAddress() + data.getAddressDetail()); edSendOrderAddress.setText(data.getCurrentAddress());
} else {
showMessage("會員地址查詢失敗");
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == SELECT_ADDRESS_REQUEST_CODE && resultCode == SELECT_ADDRESS_RESULT_CODE) {
if (data != null) {
MemberAddressInfoBean.DataBean dataBean = (MemberAddressInfoBean.DataBean) data.getSerializableExtra(AddressListActivity.RESULT_DATA_NAME);
if (dataBean != null) {
loadMemberInfo(dataBean);
}
}
}
} }
} }
package com.gingersoft.gsa.delivery_pick_mode.mvp.ui.adapter;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.delivery_pick_mode.R;
import com.gingersoft.gsa.delivery_pick_mode.mvp.model.MemberAddressInfoBean;
import org.jetbrains.annotations.NotNull;
import java.util.List;
public class AddressAdapter extends BaseQuickAdapter<MemberAddressInfoBean.DataBean, BaseViewHolder> {
public AddressAdapter(List<MemberAddressInfoBean.DataBean> dataBeanList) {
super(R.layout.layout_shipping_address, dataBeanList);
}
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, MemberAddressInfoBean.DataBean dataBean) {
String title = dataBean.getReceiver();
if (dataBean.getSex() == 1) {
title += " 先生";
} else {
title += " 女士";
}
title += " " + dataBean.getPhone();
baseViewHolder.setText(R.id.tv_shipping_receiver, title);
baseViewHolder.setText(R.id.tv_shipping_address, dataBean.getCurrentAddress());
}
}
...@@ -28,6 +28,9 @@ import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils ...@@ -28,6 +28,9 @@ import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.base.widget.DialogUtils import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.constans.AppConstans import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.ExpandConstant import com.gingersoft.gsa.cloud.constans.ExpandConstant
import com.gingersoft.gsa.cloud.constans.FunctionManagerConstants
import com.gingersoft.gsa.cloud.database.bean.Function
import com.gingersoft.gsa.cloud.function.FunctionManager
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService import com.gingersoft.gsa.cloud.service.GetInfoUpdateService
import com.gingersoft.gsa.cloud.service.PostCallBack import com.gingersoft.gsa.cloud.service.PostCallBack
import com.gingersoft.gsa.cloud.ui.utils.AppDialog import com.gingersoft.gsa.cloud.ui.utils.AppDialog
...@@ -47,7 +50,7 @@ import com.qmuiteam.qmui.widget.popup.QMUIPopups ...@@ -47,7 +50,7 @@ import com.qmuiteam.qmui.widget.popup.QMUIPopups
import kotlinx.android.synthetic.main.activity_other_order.* import kotlinx.android.synthetic.main.activity_other_order.*
class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListener{
private val pageViewModel by lazy { ViewModelProvider(this, InjectorUtil.getWeatherModelFactory())[PageViewModel::class.java] } private val pageViewModel by lazy { ViewModelProvider(this, InjectorUtil.getWeatherModelFactory())[PageViewModel::class.java] }
private val instance by lazy { this } private val instance by lazy { this }
...@@ -74,7 +77,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -74,7 +77,9 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
private var titles: ArrayList<TextView> = ArrayList() private var titles: ArrayList<TextView> = ArrayList()
private var layoutHeight: Float = 0F private var layoutHeight: Float = 0F
private var btnHeight: Float = 0F private var btnHeight: Float = 0F
private val functionByResModule by lazy {
FunctionManager.getDefault().getFunctionByResModule(this, FunctionManagerConstants.takeaway::class.java, FunctionManagerConstants.takeaway.takeawayMain, "btn")
}
lateinit var mReceiver: ClearHeartBroadcastReceiver lateinit var mReceiver: ClearHeartBroadcastReceiver
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
...@@ -84,7 +89,6 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -84,7 +89,6 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
mReceiver = ClearHeartBroadcastReceiver() mReceiver = ClearHeartBroadcastReceiver()
registerReceiver(mReceiver, mFilter) registerReceiver(mReceiver, mFilter)
val binding: ActivityOtherOrderBinding = DataBindingUtil.setContentView(this, R.layout.activity_other_order) val binding: ActivityOtherOrderBinding = DataBindingUtil.setContentView(this, R.layout.activity_other_order)
initOutTime() initOutTime()
initWebsocket() initWebsocket()
initAppTop() initAppTop()
...@@ -446,6 +450,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -446,6 +450,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
private var isOpen: Boolean = true private var isOpen: Boolean = true
private val btnOpenBg by lazy { ContextCompat.getDrawable(this, R.drawable.shape_white_bottom_border)!! } private val btnOpenBg by lazy { ContextCompat.getDrawable(this, R.drawable.shape_white_bottom_border)!! }
private val btnCloseBg by lazy { ContextCompat.getDrawable(this, R.drawable.shape_dialog_bg)!! } private val btnCloseBg by lazy { ContextCompat.getDrawable(this, R.drawable.shape_dialog_bg)!! }
/** /**
* 顯示或收起餐廳營業信息 * 顯示或收起餐廳營業信息
*/ */
...@@ -498,6 +503,11 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -498,6 +503,11 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
* 初始化標題欄 * 初始化標題欄
*/ */
private fun initAppTop() { private fun initAppTop() {
val newOrderFunction = FunctionManager.getFunctionByKey(functionByResModule, FunctionManagerConstants.takeaway.TAKEAWAY_NEW_ORDER)
val historyOrderFunction = FunctionManager.getFunctionByKey(functionByResModule, FunctionManagerConstants.takeaway.TAKEAWAY_HISTORY_ORDER)
val openCashBoxFunction = FunctionManager.getFunctionByKey(functionByResModule, FunctionManagerConstants.takeaway.TAKEAWAY_OPEN_CASH_BOX)
qm_other_order_bar.setTitle(GsaCloudApplication.getRestaurantName()) qm_other_order_bar.setTitle(GsaCloudApplication.getRestaurantName())
qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() } qm_other_order_bar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
qm_other_order_bar.addRightImageButton(R.drawable.icon_topbar_overflow, R.id.topbar_right_change_button).setOnClickListener { qm_other_order_bar.addRightImageButton(R.drawable.icon_topbar_overflow, R.id.topbar_right_change_button).setOnClickListener {
...@@ -515,12 +525,8 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -515,12 +525,8 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
.offsetYIfTop(0) .offsetYIfTop(0)
.animStyle(QMUIPopup.ANIM_AUTO) .animStyle(QMUIPopup.ANIM_AUTO)
.show(it) .show(it)
val deliverySetting = view.findViewById<QMUIAlphaTextView>(R.id.tv_delivery_setting)
view.findViewById<QMUIAlphaTextView>(R.id.tv_delivery_setting).setOnClickListener { deliverySetting.setOnClickListener(this)
//備送設置
startActivity(Intent(this, DeliverySettingActivity::class.java))
pop!!.dismiss()
}
view.findViewById<QMUIAlphaTextView>(R.id.tv_history_order).setOnClickListener { view.findViewById<QMUIAlphaTextView>(R.id.tv_history_order).setOnClickListener {
//歷史訂單 //歷史訂單
startActivity(Intent(this, HistoryOrderActivity::class.java)) startActivity(Intent(this, HistoryOrderActivity::class.java))
...@@ -571,4 +577,16 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() { ...@@ -571,4 +577,16 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>() {
} }
} }
} }
override fun onClick(v: View?) {
v?.let {
when(v.id){
R.id.tv_delivery_setting ->{
//備送設置
startActivity(Intent(this, DeliverySettingActivity::class.java))
pop!!.dismiss()
}
}
}
}
} }
\ No newline at end of file
...@@ -64,7 +64,7 @@ class PayActivity : BaseActivity<IPresenter>() { ...@@ -64,7 +64,7 @@ class PayActivity : BaseActivity<IPresenter>() {
//獲取支付方式 //獲取支付方式
// other_pay_view.loadInfo(this, PayTypeInfo.getPayMethodByPayType(it), MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount), foodCount) // other_pay_view.loadInfo(this, PayTypeInfo.getPayMethodByPayType(it), MoneyUtil.sub(orderDetails.TOTAL_AMOUNT!!.toDouble(), orderDetails.discount_amount), foodCount)
if (it == null) { if (it == null) {
ToastUtils.show(this@PayActivity, "沒有配置支付方式") ToastUtils.show(this@PayActivity, "查詢支付方式失敗")
} else { } else {
other_pay_view.notifyBillMethodAdapter(it) other_pay_view.notifyBillMethodAdapter(it)
} }
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 获得焦点时的背景图片 -->
<item android:drawable="@color/color_f0" android:state_focused="true" />
<!-- 触摸模式下时的背景图片 -->
<item android:drawable="@color/color_f0" android:state_pressed="true"/>
<!-- 已选择模式时的背景图片 -->
<item android:drawable="@color/color_f0" android:state_selected="true"/>
<!-- 默认背景 -->
<!-- --><item android:drawable="@color/white"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/address_list_top_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
app:qmui_topbar_title_color="@color/theme_white_color" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_address_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_10">
<TextView
android:id="@+id/tv_shipping_receiver"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_4c"
android:textSize="@dimen/dp_16" />
<TextView
android:id="@+id/tv_shipping_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text=""
android:textColor="@color/color_86"
android:textSize="@dimen/dp_12" />
</LinearLayout>
<include layout="@layout/include_horizontal_color_eee_dividing_line" />
</LinearLayout>
\ No newline at end of file
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/customer_phone" android:text="@string/customer_phone"
app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name" app:layout_constraintBottom_toBottomOf="@id/ed_send_order_phone"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@id/ed_send_order_name" /> app:layout_constraintTop_toTopOf="@id/ed_send_order_phone" />
<EditText <EditText
android:id="@+id/ed_send_order_phone" android:id="@+id/ed_send_order_phone"
...@@ -100,9 +100,9 @@ ...@@ -100,9 +100,9 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/customer_name" android:text="@string/customer_name"
app:layout_constraintBottom_toBottomOf="@id/ed_send_order_phone" app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name"
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@id/ed_send_order_phone" /> app:layout_constraintTop_toTopOf="@id/ed_send_order_name" />
<EditText <EditText
android:id="@+id/ed_send_order_name" android:id="@+id/ed_send_order_name"
...@@ -121,7 +121,8 @@ ...@@ -121,7 +121,8 @@
<ImageView <ImageView
android:id="@+id/iv_select_member_arrow" android:id="@+id/iv_select_member_arrow"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_30"
android:padding="@dimen/dp_8"
android:layout_height="0dp" android:layout_height="0dp"
android:src="@drawable/ic_black_next_arrow" android:src="@drawable/ic_black_next_arrow"
app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name" app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name"
...@@ -172,8 +173,9 @@ ...@@ -172,8 +173,9 @@
<ImageView <ImageView
android:id="@+id/iv_select_address_arrow" android:id="@+id/iv_select_address_arrow"
android:layout_width="wrap_content" android:layout_width="@dimen/dp_30"
android:layout_height="0dp" android:layout_height="0dp"
android:padding="@dimen/dp_8"
android:src="@drawable/ic_black_next_arrow" android:src="@drawable/ic_black_next_arrow"
app:layout_constraintBottom_toBottomOf="@id/ed_send_order_address" app:layout_constraintBottom_toBottomOf="@id/ed_send_order_address"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
......
...@@ -29,6 +29,15 @@ ...@@ -29,6 +29,15 @@
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_16" />
<RadioButton <RadioButton
android:id="@+id/rb_server_pre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="預發佈環境"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_16" />
<RadioButton
android:id="@+id/rb_youchang" android:id="@+id/rb_youchang"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
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