Commit 1905e41d by Wyh

9.03 1、PRJ多語言打印 2、打印機增加多語言配置 3、追加服務費邏輯修改

Signed-off-by: Wyh <1239658231>
parent 106f3d8b
......@@ -45,7 +45,7 @@ android {
/**
* 版本号
*/
schemaVersion 14
schemaVersion 15
/**
* greendao输出dao的数据库操作实体类文件夹(相对路径 包名+自定义路径名称,包将创建于包名的直接路径下)
*/
......
......@@ -65,6 +65,7 @@ public class PrinterDeviceBean implements Serializable {
private int numberIsFlip;//數量大於1顔色是否翻轉 0預設 1是 2否
private int languageType;
@Generated(hash = 626885316)
public PrinterDeviceBean() {
......@@ -76,9 +77,9 @@ public class PrinterDeviceBean implements Serializable {
this.paperSpecification = paperSpecification;
}
@Generated(hash = 1569426879)
@Generated(hash = 790857534)
public PrinterDeviceBean(Long id, Long dbid, String name, Integer restaurantId, String ip, Long uid, Integer port, Integer type, Long printerModelId, String paperSpecification, int lineFontStop, String printerName, String model, String noteContent, Long printerDeviceDefaultId, int printerDeviceType, Long flyPrinterDeviceId, Long flyPrinterDeviceId2, int foodComplexion, int modifierComplexion, int foodIsBold, String foodFont, int foodIsItalic, int modifierIsBold, String modifierFont,
int modifierIsItalic, int numberIsFlip) {
int modifierIsItalic, int numberIsFlip, int languageType) {
this.id = id;
this.dbid = dbid;
this.name = name;
......@@ -106,6 +107,7 @@ public class PrinterDeviceBean implements Serializable {
this.modifierFont = modifierFont;
this.modifierIsItalic = modifierIsItalic;
this.numberIsFlip = numberIsFlip;
this.languageType = languageType;
}
public Long getId() {
......@@ -330,4 +332,12 @@ public class PrinterDeviceBean implements Serializable {
public void setModifierComplexion(int modifierComplexion) {
this.modifierComplexion = modifierComplexion;
}
public int getLanguageType() {
return languageType;
}
public void setLanguageType(int languageType) {
this.languageType = languageType;
}
}
......@@ -14,10 +14,10 @@ import org.greenrobot.greendao.identityscope.IdentityScopeType;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* Master of DAO (schema version 14): knows all DAOs.
* Master of DAO (schema version 15): knows all DAOs.
*/
public class DaoMaster extends AbstractDaoMaster {
public static final int SCHEMA_VERSION = 14;
public static final int SCHEMA_VERSION = 15;
/** Creates underlying database table using DAOs. */
public static void createAllTables(Database db, boolean ifNotExists) {
......
......@@ -51,6 +51,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
public final static Property ModifierFont = new Property(24, String.class, "modifierFont", false, "MODIFIER_FONT");
public final static Property ModifierIsItalic = new Property(25, int.class, "modifierIsItalic", false, "MODIFIER_IS_ITALIC");
public final static Property NumberIsFlip = new Property(26, int.class, "numberIsFlip", false, "NUMBER_IS_FLIP");
public final static Property LanguageType = new Property(27, int.class, "languageType", false, "LANGUAGE_TYPE");
}
......@@ -92,7 +93,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
"\"MODIFIER_IS_BOLD\" INTEGER NOT NULL ," + // 23: modifierIsBold
"\"MODIFIER_FONT\" TEXT," + // 24: modifierFont
"\"MODIFIER_IS_ITALIC\" INTEGER NOT NULL ," + // 25: modifierIsItalic
"\"NUMBER_IS_FLIP\" INTEGER NOT NULL );"); // 26: numberIsFlip
"\"NUMBER_IS_FLIP\" INTEGER NOT NULL ," + // 26: numberIsFlip
"\"LANGUAGE_TYPE\" INTEGER NOT NULL );"); // 27: languageType
}
/** Drops the underlying database table. */
......@@ -203,6 +205,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
}
stmt.bindLong(26, entity.getModifierIsItalic());
stmt.bindLong(27, entity.getNumberIsFlip());
stmt.bindLong(28, entity.getLanguageType());
}
@Override
......@@ -307,6 +310,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
}
stmt.bindLong(26, entity.getModifierIsItalic());
stmt.bindLong(27, entity.getNumberIsFlip());
stmt.bindLong(28, entity.getLanguageType());
}
@Override
......@@ -343,7 +347,8 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
cursor.getInt(offset + 23), // modifierIsBold
cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24), // modifierFont
cursor.getInt(offset + 25), // modifierIsItalic
cursor.getInt(offset + 26) // numberIsFlip
cursor.getInt(offset + 26), // numberIsFlip
cursor.getInt(offset + 27) // languageType
);
return entity;
}
......@@ -377,6 +382,7 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
entity.setModifierFont(cursor.isNull(offset + 24) ? null : cursor.getString(offset + 24));
entity.setModifierIsItalic(cursor.getInt(offset + 25));
entity.setNumberIsFlip(cursor.getInt(offset + 26));
entity.setLanguageType(cursor.getInt(offset + 27));
}
@Override
......
......@@ -63,7 +63,7 @@ class BtnBuilder(var functions: List<Function>) {
}
fun getAdditionalServiceChargeBtn(): BtnBean? {
return getBtn(FunctionManagerConstans.takeaway.TRANSPORTATION_BTN_KEY, AdditionalServiceChargeBtn, "追加服務費", R.color.other_order_details_cancel_logistics_btn_color, R.drawable.ic_logistics)
return getBtn(FunctionManagerConstans.takeaway.TRANSPORTATION_BTN_KEY, AdditionalServiceChargeBtn, "追加貼士", R.color.other_order_details_cancel_logistics_btn_color, R.drawable.ic_logistics)
}
private fun getBtn(key: String, btnCode: Int, btnContent: String, btnColor: Int, btnImg: Int): BtnBean? {
......
......@@ -10,6 +10,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
......@@ -19,13 +20,14 @@ import com.jess.arms.utils.DeviceUtils;
public class AddKeyBoard extends FrameLayout {
private String[] keyString = new String[]{"+10", "+20", "+50", "+100", "7", "8", "9", "X", "4", "5", "6", "1", "2", "3", "確定", "0", "00", "000"};
private String[] keyString = new String[]{"+10", "+20", "+50", "+100", "7", "8", "9", "X", "4", "5", "6", "0", "1", "2", "3", "確定"};
private float screenWidth;
private int btnHeight;
private String amount = "";
private String decimal = "";
private int maxValue = 100;
private onKeyResultListener onKeyResultListener;
......@@ -43,7 +45,7 @@ public class AddKeyBoard extends FrameLayout {
}
private void init() {
screenWidth = DeviceUtils.getScreenWidth(getContext());
btnHeight = (int) (DeviceUtils.getScreenWidth(getContext()) / 6);
RecyclerView recyclerView = new RecyclerView(getContext());
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(4, StaggeredGridLayoutManager.VERTICAL));
recyclerView.setAdapter(new KeyBoardAdapter());
......@@ -78,6 +80,10 @@ public class AddKeyBoard extends FrameLayout {
oldAmount = Long.parseLong(amount);
amount = (oldAmount + Integer.valueOf(keyString[position].substring(1))) + "";
}
if (Integer.parseInt(amount) > maxValue) {
amount = maxValue + "";
ToastUtils.show(getContext(), "追加金額不能超過:" + maxValue);
}
}
} else if (keyString[position].equals("X")) {
if (decimal.length() > 0) {
......@@ -103,6 +109,15 @@ public class AddKeyBoard extends FrameLayout {
}
} else {
amount += keyString[position];
try {
if (Integer.parseInt(amount) > maxValue) {
amount = maxValue + "";
ToastUtils.show(getContext(), "追加金額不能超過:" + maxValue);
}
} catch (NumberFormatException e) {
e.printStackTrace();
amount = maxValue + "";
}
}
}
}
......@@ -118,10 +133,16 @@ public class AddKeyBoard extends FrameLayout {
}
});
lp.width = (int) (screenWidth / 4);
lp.height = lp.width / 2;
if (keyString[position].equals("X") || keyString[position].equals("確定")) {
lp.height = lp.height * 2;
lp.height = btnHeight;
if (keyString[position].equals("確定")) {
holder.tvKey.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.theme_color));
holder.tvKey.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
} else if (keyString[position].equals("X")) {
holder.tvKey.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.red_500));
holder.tvKey.setTextColor(ContextCompat.getColor(getContext(), R.color.white));
} else {
holder.tvKey.setTextColor(ContextCompat.getColor(getContext(), R.color.theme_333_color));
holder.tvKey.setBackgroundColor(ContextCompat.getColor(getContext(), R.color.white));
}
holder.layout.setLayoutParams(lp);
holder.tvKey.setText(keyString[position]);
......@@ -145,6 +166,14 @@ public class AddKeyBoard extends FrameLayout {
}
}
public void setMaxValue(int maxValue) {
if (maxValue < 0) {
this.maxValue = 0;
} else {
this.maxValue = maxValue;
}
}
public interface onKeyResultListener {
void onResult(boolean isComplete, String value);
}
......
......@@ -13,7 +13,7 @@ android {
defaultConfig {
if (project.ext.runAsApp) {
applicationId "com.gingersoft.gsa.other_order_mode"
applicationId "com.gingersoft.gsa.delivery_pick_mode"
}
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.gsa.other_order_mode">
package="com.gingersoft.gsa.delivery_pick_mode">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.gsa.other_order_mode">
package="com.gingersoft.gsa.delivery_pick_mode">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
......@@ -13,10 +13,10 @@
android:networkSecurityConfig="@xml/network_android"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ui.activity.LogActivity"/>
<activity android:name=".ui.activity.OrderDetailsActivity" />
<activity android:name="com.gingersoft.gsa.delivery_pick_mode.ui.activity.LogActivity"/>
<activity android:name="com.gingersoft.gsa.delivery_pick_mode.ui.activity.OrderDetailsActivity" />
<activity
android:name=".ui.activity.DeliveryOrderMainActivity"
android:name="com.gingersoft.gsa.delivery_pick_mode.ui.activity.DeliveryOrderMainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -32,7 +32,7 @@
android:name="com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity android:name=".ui.activity.HistoryOrderActivity" />
<activity android:name="com.gingersoft.gsa.delivery_pick_mode.ui.activity.HistoryOrderActivity" />
</application>
</manifest>
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode;
package com.gingersoft.gsa.delivery_pick_mode;
import com.billy.cc.core.component.CC;
import com.jess.arms.base.BaseApplication;
......
package com.gingersoft.gsa.other_order_mode;
package com.gingersoft.gsa.delivery_pick_mode;
import android.content.Intent;
import android.util.Log;
......@@ -8,7 +8,7 @@ import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil;
import com.billy.cc.core.component.IComponent;
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService;
import com.gingersoft.gsa.other_order_mode.ui.activity.DeliveryOrderMainActivity;
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.DeliveryOrderMainActivity;
public class OtherOrderComponent implements IComponent {
......
package com.gingersoft.gsa.other_order_mode.data
package com.gingersoft.gsa.delivery_pick_mode.data
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.data.network.DeliveryNetwork
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.data.network.DeliveryNetwork
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.FormBody
......
package com.gingersoft.gsa.other_order_mode.data
package com.gingersoft.gsa.delivery_pick_mode.data
import com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import com.gingersoft.gsa.delivery_pick_mode.data.network.CoolWeatherNetwork
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.FormBody
......
package com.gingersoft.gsa.other_order_mode.data
package com.gingersoft.gsa.delivery_pick_mode.data
import com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.other_order_mode.data.model.bean.ThirdItem
import com.gingersoft.gsa.other_order_mode.data.model.bean.UpdateOrderStatusBean
import com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ThirdItem
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.UpdateOrderStatusBean
import com.gingersoft.gsa.delivery_pick_mode.data.network.CoolWeatherNetwork
import com.google.gson.Gson
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class AddServiceChargeBean(
val errCode: String,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class BalanceBean(
val balance: Double,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
class BillBean(var name: String = "", var amount: Double = 0.0, var isRed: Int = 0)
//isRed0默認顏色黑色,1為紅色
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
class CancelLogisticsBean(val code: String, val success: Boolean, val errCode: String, val errMsg: String, val sysTime: Long, val data: Data) {
data class Data(val result: Result) {
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class CancelReason(
val `data`: List<DataX>,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class DeliveryAddSuccessConfig(
val data: Data,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class DeliveryBean(val data: MutableList<Data>,
val success: Boolean,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
import androidx.databinding.ObservableArrayList
import java.io.Serializable
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class EstimatedBean(
val `data`: Data?,
val success: Boolean,
val sysTime: Long
)
\ No newline at end of file
){
data class Data(
val estimated_time: Int
)
}
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
import androidx.lifecycle.LiveData
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
class HistoryOrderBean {
/**
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class MessageBean(val code: String, val errorMsg: String, val success: Boolean = false, val sysTime: Long = 0, val data: Any? = null)
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class OrderClosingBean(
var addPoints: Double = 0.toDouble(),
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class OrderGoupNumBean(
val `data`: Data,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean;
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean;
import com.gingersoft.gsa.cloud.base.common.bean.PayMethod;
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class ServiceChargeRecordBean(
val `data`: MutableList<DataX>,
......@@ -12,7 +12,7 @@ data class ServiceChargeRecordBean(
val id: Int,
val logisticsOrderId: Int,
val orderId: Int,
val paymentValue: Double,
val paymentValue: Int,
val restaurantId: Int,
val status: Int,
val type: Int,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
class ThirdItem : ArrayList<ThirdItem.ThirdItemItem>() {
data class ThirdItemItem(val descr: String = "",
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class ThirdSend(
val `data`: Data,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class TransportAmountBean(
val `data`: List<DataX>,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
data class TransportationBean(
val `data`: DataX?,
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
package com.gingersoft.gsa.delivery_pick_mode.data.model.bean
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
......
package com.gingersoft.gsa.other_order_mode.data.network
package com.gingersoft.gsa.delivery_pick_mode.data.network
import com.gingersoft.gsa.other_order_mode.data.network.api.AppService
import com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import com.gingersoft.gsa.delivery_pick_mode.data.network.api.AppService
import com.gingersoft.gsa.delivery_pick_mode.data.network.api.WeatherService
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.Callback
......
package com.gingersoft.gsa.other_order_mode.data.network
package com.gingersoft.gsa.delivery_pick_mode.data.network
import com.gingersoft.gsa.other_order_mode.data.network.api.DeliveryService
import com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import com.gingersoft.gsa.delivery_pick_mode.data.network.api.DeliveryService
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.Callback
......
package com.gingersoft.gsa.other_order_mode.data.network
package com.gingersoft.gsa.delivery_pick_mode.data.network
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.encryption.Aes
......
package com.gingersoft.gsa.other_order_mode.data.network.api
package com.gingersoft.gsa.delivery_pick_mode.data.network.api
import okhttp3.RequestBody
import retrofit2.Call
......
package com.gingersoft.gsa.other_order_mode.data.network.api
package com.gingersoft.gsa.delivery_pick_mode.data.network.api
import com.gingersoft.gsa.other_order_mode.data.model.bean.MessageBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryAddSuccessConfig
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.MessageBean
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryAddSuccessConfig
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.Body
......
package com.gingersoft.gsa.other_order_mode.data.network.api
package com.gingersoft.gsa.delivery_pick_mode.data.network.api
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.other_order_mode.data.model.bean.*
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.*
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.Body
......
package com.gingersoft.gsa.other_order_mode.model.factory
package com.gingersoft.gsa.delivery_pick_mode.model.factory
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.delivery_pick_mode.data.DeliveryRepository
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.DeliveryViewModel
class DeliveryFactory(private val repository: DeliveryRepository) : ViewModelProvider.NewInstanceFactory() {
......
package com.gingersoft.gsa.other_order_mode.model.factory
package com.gingersoft.gsa.delivery_pick_mode.model.factory
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.other_order_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.other_order_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.delivery_pick_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.HistoryOrderViewModel
class HistoryOrderModelFactory(private val repository: HistoryOrderRepository) : ViewModelProvider.NewInstanceFactory() {
......
package com.gingersoft.gsa.other_order_mode.model.factory
package com.gingersoft.gsa.delivery_pick_mode.model.factory
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.data.WeatherRepository
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
class WeatherModelFactory(private val repository: WeatherRepository) : ViewModelProvider.NewInstanceFactory() {
......
package com.gingersoft.gsa.other_order_mode.model.viewModel
package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import android.content.Context
import androidx.lifecycle.ViewModel
......
package com.gingersoft.gsa.other_order_mode.model.viewModel
package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import androidx.lifecycle.MutableLiveData
import com.gingersoft.gsa.other_order_mode.data.model.bean.MessageBean
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryAddSuccessConfig
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.MessageBean
import com.gingersoft.gsa.delivery_pick_mode.data.DeliveryRepository
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryAddSuccessConfig
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewModel() {
......
package com.gingersoft.gsa.other_order_mode.model.viewModel
package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import android.content.Context
import android.util.Log
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
......@@ -13,9 +12,8 @@ import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.constans.PrintConstans
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.other_order_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.other_order_mode.data.model.bean.HistoryOrderBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import com.gingersoft.gsa.delivery_pick_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.HistoryOrderBean
import kotlinx.coroutines.launch
class HistoryOrderViewModel(private val historyOrderRepository: HistoryOrderRepository) : ViewModel() {
......
package com.gingersoft.gsa.other_order_mode.model.viewModel
package com.gingersoft.gsa.delivery_pick_mode.model.viewModel
import android.app.Dialog
import android.content.Context
......@@ -26,11 +26,11 @@ import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.PrintConstans
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import com.gingersoft.gsa.other_order_mode.data.model.bean.*
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.WeatherRepository
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.*
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryAdapter
import com.gingersoft.gsa.delivery_pick_mode.util.OtherOrderUtils
import com.jess.arms.utils.ArmsUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
......
package com.gingersoft.gsa.other_order_mode.ui.activity
package com.gingersoft.gsa.delivery_pick_mode.ui.activity
import android.animation.ArgbEvaluator
import android.animation.ValueAnimator
......@@ -27,13 +27,13 @@ import com.gingersoft.gsa.cloud.constans.HttpsConstans
import com.gingersoft.gsa.cloud.database.utils.ExpandInfoDaoUtils
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService
import com.gingersoft.gsa.cloud.service.PostCallBack
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.network.ServiceCreator
import com.gingersoft.gsa.other_order_mode.databinding.ActivityOtherOrderBinding
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.SectionsPagerAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.network.ServiceCreator
import com.gingersoft.gsa.delivery_pick_mode.databinding.ActivityOtherOrderBinding
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.SectionsPagerAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
import com.qmuiteam.qmui.alpha.QMUIAlphaTextView
import com.qmuiteam.qmui.util.QMUIDisplayHelper
......
package com.gingersoft.gsa.other_order_mode.ui.activity
package com.gingersoft.gsa.delivery_pick_mode.ui.activity
import android.os.Bundle
import androidx.core.content.ContextCompat
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment
import com.gingersoft.gsa.other_order_mode.ui.fragment.UpdateDeliveryFragment
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.DeliveryFragment
import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.UpdateDeliveryFragment
import kotlinx.android.synthetic.main.activity_delivery.*
class DeliverySettingActivity : BaseActivity() {
......
package com.gingersoft.gsa.other_order_mode.ui.activity
package com.gingersoft.gsa.delivery_pick_mode.ui.activity
import android.os.Bundle
import android.view.View
......@@ -6,11 +6,11 @@ import androidx.lifecycle.ViewModelProvider
import com.gingersoft.gsa.cloud.base.utils.time.TimePickerUtils
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.ui.fragment.HistoryFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.HistoryFragment
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.google.android.material.tabs.TabLayout
import kotlinx.android.synthetic.main.activity_history_order.*
import java.text.ParseException
......
package com.gingersoft.gsa.other_order_mode.ui.activity;
package com.gingersoft.gsa.delivery_pick_mode.ui.activity;
import android.os.Bundle;
import android.widget.TextView;
......@@ -6,7 +6,7 @@ import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService;
import com.gingersoft.gsa.other_order_mode.R;
import com.gingersoft.gsa.delivery_pick_mode.R;
public class LogActivity extends AppCompatActivity {
......
package com.gingersoft.gsa.other_order_mode.ui.activity
package com.gingersoft.gsa.delivery_pick_mode.ui.activity
import android.app.Dialog
import android.content.Intent
......@@ -7,6 +7,7 @@ import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Observer
......@@ -26,23 +27,23 @@ import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.ui.utils.AppDialog
import com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import com.gingersoft.gsa.cloud.ui.view.AddKeyBoard
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.ServiceChargeRecordBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.TransportationBean
import com.gingersoft.gsa.other_order_mode.databinding.ActivityOrderDetailsBinding
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel.Companion.DeliveryPrint
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel.Companion.OrderDelivery
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel.Companion.PrintCode
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel.Companion.Transportation
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.OrderDetailsAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.ThirdExpensesAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.showSelectDialog
import com.gingersoft.gsa.other_order_mode.util.showWaringDialog
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecordBean
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.TransportationBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.ActivityOrderDetailsBinding
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.DeliveryPrint
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.OrderDelivery
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.PrintCode
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel.Companion.Transportation
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.OrderDetailsAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.ThirdExpensesAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.util.showSelectDialog
import com.gingersoft.gsa.delivery_pick_mode.util.showWaringDialog
import com.qmuiteam.qmui.widget.QMUITopBar
import kotlinx.android.synthetic.main.activity_order_details.*
......@@ -61,8 +62,9 @@ class OrderDetailsActivity : BaseActivity() {
var restaurantId: Int = -1
lateinit var rvThirdExpenses: RecyclerView
lateinit var thirdExpensesLayout: LinearLayout
var tipsCost = 0
lateinit var btnBuilder: BtnBuilder
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
......@@ -162,7 +164,7 @@ class OrderDetailsActivity : BaseActivity() {
btnList.add(it)
}
if (isTimeOut) {
//已超時,添加追加服務費的按鈕
//已超時,添加追加貼士的按鈕
btnBuilder.getAdditionalServiceChargeBtn()?.let {
btnList.add(it)
}
......@@ -356,7 +358,7 @@ class OrderDetailsActivity : BaseActivity() {
}
}
BtnBuilder.AdditionalServiceChargeBtn -> {
//追加服務費
//追加貼士
showAddServiceChangeDialog()
}
else -> {
......@@ -391,8 +393,11 @@ class OrderDetailsActivity : BaseActivity() {
// }
serviceChargeRecordBeans.observe(this@OrderDetailsActivity, Observer {
if (it != null && it.data.isNotEmpty()) {
for (value in it.data) {
tipsCost += value.paymentValue
}
thirdExpensesLayout.visibility = View.VISIBLE
it.data.add(0, ServiceChargeRecordBean.DataX(0, 0, 0, 0, 0, 0, 0.0, 0, 0, 0, 0, 0, "", ""))
it.data.add(0, ServiceChargeRecordBean.DataX(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", ""))
rvThirdExpenses.adapter = ThirdExpensesAdapter(it.data)
rvThirdExpenses.layoutManager = LinearLayoutManager(this@OrderDetailsActivity)
}
......@@ -403,11 +408,18 @@ class OrderDetailsActivity : BaseActivity() {
object : DialogUtils(this@OrderDetailsActivity, R.layout.layout_add_service_charge) {
override fun initLayout(hepler: ViewHepler, dialog: Dialog) {
hepler.setOnClickListenter(R.id.tv_cancel) { dialog.dismiss() }
if (tipsCost != 0) {
hepler.setText(R.id.tv_add_service_charge_title, "追加貼士(已追加$tipsCost)")
hepler.getView<TextView>(R.id.ed_service_charge).hint = "不能超過(${100 - tipsCost})"
}
hepler.getView<AddKeyBoard>(R.id.keyboard_addservice_charge).setMaxValue(100 - tipsCost)
hepler.getView<AddKeyBoard>(R.id.keyboard_addservice_charge).setOnKeyResultListener { isComplete, value ->
hepler.setText(R.id.ed_service_charge, value)
if (isComplete && value.isNotEmpty()) {
if (value.toDouble() < 10) {
if (tipsCost == 0 && value.toDouble() < 10) {
ToastUtils.show(this@OrderDetailsActivity, "最低金額$10")
} else if (tipsCost + value.toInt() > 100) {
ToastUtils.show(this@OrderDetailsActivity, "金額不能超過$100元")
} else {
//添加服務費
dialog.dismiss()
......
package com.gingersoft.gsa.other_order_mode.ui.activity
package com.gingersoft.gsa.delivery_pick_mode.ui.activity
import android.app.Dialog
import android.os.Bundle
......@@ -10,14 +10,14 @@ import com.gingersoft.gsa.cloud.base.common.bean.PayMethod
import com.gingersoft.gsa.cloud.base.utils.MoneyUtil
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.print.bean.OrderDetails.DataBean
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.PayTypeInfo
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.PayBillAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.BillBean
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.PayTypeInfo
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.PayBillAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseActivity
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import kotlinx.android.synthetic.main.activity_pay.*
class PayActivity : BaseActivity() {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.delivery_pick_mode.R
class DeliveryAdapter(data: MutableList<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.other_order_delivery_item, data) {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.view.LayoutInflater
import android.view.View
......@@ -7,10 +7,10 @@ import android.widget.ImageView
import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.databinding.ItemDeliveryLayoutBinding
import com.gingersoft.gsa.other_order_mode.ui.fragment.UpdateDeliveryFragment
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.databinding.ItemDeliveryLayoutBinding
import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.UpdateDeliveryFragment
class DeliveryListAdapter(data: MutableList<DeliveryConfig.Data.DeliveryInfo>) : BaseQuickAdapter<DeliveryConfig.Data.DeliveryInfo, DeliveryListAdapter.ViewHolder>(R.layout.item_delivery_layout, data) {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.content.Context
import android.view.LayoutInflater
......@@ -6,13 +6,12 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.FoodDetailsTranBean
import com.gingersoft.gsa.other_order_mode.databinding.LayoutDialogFoodItemBinding
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.FoodDetailsTranBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.LayoutDialogFoodItemBinding
import com.qmuiteam.qmui.util.QMUIDisplayHelper.dp2px
class FoodListAdapter(private val context: Context, private val productnameBeans: List<OrderDetails.DataBean.PRODUCTNAMEBean>) : RecyclerView.Adapter<FoodListAdapter.ViewHolder>() {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.content.Context
import android.graphics.drawable.GradientDrawable
......@@ -8,10 +8,9 @@ import android.view.ViewGroup
import android.widget.ImageView
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.HistoryOrderBean.DataBean
import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import com.gingersoft.gsa.other_order_mode.databinding.LayoutHistoryOrderItemBinding
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.HistoryOrderBean.DataBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.LayoutHistoryOrderItemBinding
import com.scwang.smartrefresh.layout.util.SmartUtil
class HistoryOrderAdapter(var stauts: String?, private val context: Context, var data: List<DataBean>?) : RecyclerView.Adapter<HistoryOrderAdapter.ViewHolder>() {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.view.View
import android.view.ViewGroup
......@@ -7,7 +7,7 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.delivery_pick_mode.R
class OrderBtnAdapter(var list: MutableList<BtnBuilder.BtnBean>) : RecyclerView.Adapter<OrderBtnAdapter.ViewHolder>() {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.delivery_pick_mode.R
class OrderDetailsAdapter(list: MutableList<BtnBuilder.BtnBean>) : BaseQuickAdapter<BtnBuilder.BtnBean, BaseViewHolder>(R.layout.item_btn, list) {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.animation.AnimatorSet
import android.animation.ObjectAnimator.ofFloat
......@@ -13,9 +13,9 @@ import androidx.core.content.ContextCompat
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.Adapter
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList
import com.gingersoft.gsa.other_order_mode.databinding.LayoutDeliveryOrderItemBinding
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.OrderList
import com.gingersoft.gsa.delivery_pick_mode.databinding.LayoutDeliveryOrderItemBinding
import com.scwang.smartrefresh.layout.util.SmartUtil.dp2px
class OtherOrdersAdapter(var context: Context, var outTime: Int) : Adapter<OtherOrdersAdapter.ViewHolder>() {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.BillBean
class PayBillAdapter(layoutId:Int, billBeans: MutableList<BillBean>) : BaseQuickAdapter<BillBean, BaseViewHolder>(layoutId, billBeans) {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import com.gingersoft.gsa.other_order_mode.ui.fragment.PlaceholderFragment
import com.gingersoft.gsa.delivery_pick_mode.ui.fragment.PlaceholderFragment
/**
* A [FragmentPagerAdapter] that returns a fragment corresponding to
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.delivery_pick_mode.R
class TextAdapter(list: MutableList<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview, list) {
override fun convert(holder: BaseViewHolder, item: String) {
......
package com.gingersoft.gsa.other_order_mode.ui.adapter
package com.gingersoft.gsa.delivery_pick_mode.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.ServiceChargeRecordBean
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.ServiceChargeRecordBean
class ThirdExpensesAdapter(data: MutableList<ServiceChargeRecordBean.DataX>?) : BaseQuickAdapter<ServiceChargeRecordBean.DataX, BaseViewHolder>(R.layout.item_third_expenses, data) {
......
package com.gingersoft.gsa.other_order_mode.ui.base
package com.gingersoft.gsa.delivery_pick_mode.ui.base
import androidx.appcompat.app.AppCompatActivity
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
......
package com.gingersoft.gsa.other_order_mode.ui.base
package com.gingersoft.gsa.delivery_pick_mode.ui.base
import androidx.fragment.app.Fragment
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import android.os.Bundle
import android.view.LayoutInflater
......@@ -10,13 +10,13 @@ import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.ui.utils.AppDialog
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.other_order_mode.ui.activity.DeliverySettingActivity
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryListAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.setState
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.DeliverySettingActivity
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.DeliveryListAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseFragment
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.util.setState
import kotlinx.android.synthetic.main.fragment_delivery_list.*
class DeliveryFragment : BaseFragment() {
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import android.os.Bundle
import androidx.lifecycle.Observer
......@@ -6,13 +6,13 @@ import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.other_order_mode.ui.adapter.HistoryOrderAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.OtherOrderUtils
import com.gingersoft.gsa.other_order_mode.util.setState
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.HistoryOrderViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.HistoryOrderAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseFragment
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.util.OtherOrderUtils
import com.gingersoft.gsa.delivery_pick_mode.util.setState
import kotlinx.android.synthetic.main.fragment_other_order.*
class HistoryFragment : BaseFragment(R.layout.fragment_other_order) {
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import androidx.lifecycle.ViewModel
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import android.content.Intent
import android.os.Bundle
......@@ -9,13 +9,13 @@ import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.other_order_mode.ui.activity.OrderDetailsActivity
import com.gingersoft.gsa.other_order_mode.ui.adapter.OtherOrdersAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.other_order_mode.util.setState
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.OrderDetailsActivity
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.OtherOrdersAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseFragment
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.util.setState
import kotlinx.android.synthetic.main.fragment_other_order.*
/**
......
package com.gingersoft.gsa.other_order_mode.ui.fragment
package com.gingersoft.gsa.delivery_pick_mode.ui.fragment
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.lifecycle.ViewModelProvider
......@@ -9,13 +8,13 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.other_order_mode.ui.activity.DeliverySettingActivity
import com.gingersoft.gsa.other_order_mode.ui.adapter.TextAdapter
import com.gingersoft.gsa.other_order_mode.ui.base.BaseFragment
import com.gingersoft.gsa.other_order_mode.util.InjectorUtil
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.delivery_pick_mode.model.viewModel.DeliveryViewModel
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.DeliverySettingActivity
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.TextAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.base.BaseFragment
import com.gingersoft.gsa.delivery_pick_mode.util.InjectorUtil
import com.jess.arms.utils.ArmsUtils
import com.qmuiteam.qmui.util.QMUIDisplayHelper
import com.qmuiteam.qmui.widget.popup.QMUIPopup
......
package com.gingersoft.gsa.other_order_mode.util
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository
import com.gingersoft.gsa.other_order_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.other_order_mode.data.WeatherRepository
import com.gingersoft.gsa.other_order_mode.data.network.CoolWeatherNetwork
import com.gingersoft.gsa.other_order_mode.data.network.DeliveryNetwork
import com.gingersoft.gsa.other_order_mode.model.factory.DeliveryFactory
import com.gingersoft.gsa.other_order_mode.model.factory.HistoryOrderModelFactory
import com.gingersoft.gsa.other_order_mode.model.factory.WeatherModelFactory
package com.gingersoft.gsa.delivery_pick_mode.util
import com.gingersoft.gsa.delivery_pick_mode.data.DeliveryRepository
import com.gingersoft.gsa.delivery_pick_mode.data.HistoryOrderRepository
import com.gingersoft.gsa.delivery_pick_mode.data.WeatherRepository
import com.gingersoft.gsa.delivery_pick_mode.data.network.CoolWeatherNetwork
import com.gingersoft.gsa.delivery_pick_mode.data.network.DeliveryNetwork
import com.gingersoft.gsa.delivery_pick_mode.model.factory.DeliveryFactory
import com.gingersoft.gsa.delivery_pick_mode.model.factory.HistoryOrderModelFactory
import com.gingersoft.gsa.delivery_pick_mode.model.factory.WeatherModelFactory
object InjectorUtil {
......
package com.gingersoft.gsa.other_order_mode.util
package com.gingersoft.gsa.delivery_pick_mode.util
import android.app.Dialog
import android.content.Context
......@@ -6,7 +6,6 @@ import android.media.AudioAttributes
import android.media.AudioManager
import android.media.SoundPool
import android.os.Build
import android.util.Log
import android.view.View
import android.widget.ImageView
import android.widget.TextView
......@@ -18,11 +17,11 @@ import com.gingersoft.gsa.cloud.base.utils.MoneyUtil
import com.gingersoft.gsa.cloud.base.utils.other.TextUtil
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.other_order_mode.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.BillBean
import com.gingersoft.gsa.other_order_mode.databinding.LayoutOrderInfoDialogNewBinding
import com.gingersoft.gsa.other_order_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.other_order_mode.ui.adapter.PayBillAdapter
import com.gingersoft.gsa.delivery_pick_mode.R
import com.gingersoft.gsa.delivery_pick_mode.data.model.bean.BillBean
import com.gingersoft.gsa.delivery_pick_mode.databinding.LayoutOrderInfoDialogNewBinding
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.FoodListAdapter
import com.gingersoft.gsa.delivery_pick_mode.ui.adapter.PayBillAdapter
import com.jess.arms.utils.ArmsUtils
import java.lang.Double.parseDouble
......
package com.gingersoft.gsa.other_order_mode.util
package com.gingersoft.gsa.delivery_pick_mode.util
import io.reactivex.Observable
import io.reactivex.Observer
......
package com.gingersoft.gsa.other_order_mode.util
package com.gingersoft.gsa.delivery_pick_mode.util
import android.app.Activity
import android.app.Dialog
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
data class Data(
val estimated_time: Int
)
\ No newline at end of file
......@@ -16,7 +16,7 @@
<fragment
android:id="@+id/deliverylist_fragment"
android:name="com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment"
android:name="com.gingersoft.gsa.delivery_pick_mode.ui.fragment.DeliveryFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/top_bar_delivery" />
......
......@@ -5,11 +5,11 @@
<data>
<import type="com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel" />
<import type="com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel" />
<variable
name="data"
type="com.gingersoft.gsa.other_order_mode.model.viewModel.PageViewModel" />
type="com.gingersoft.gsa.delivery_pick_mode.model.viewModel.PageViewModel" />
</data>
<androidx.coordinatorlayout.widget.CoordinatorLayout
......
......@@ -11,10 +11,11 @@
android:orientation="horizontal">
<TextView
android:id="@+id/tv_add_service_charge_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="追加服務費"
android:text="追加貼士"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_16" />
......@@ -42,7 +43,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="追加金額數"
android:text="金額:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_16" />
......
......@@ -11,7 +11,7 @@
<variable
name="data"
type="com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean" />
type="com.gingersoft.gsa.delivery_pick_mode.data.model.bean.OrderList.DataBeanX.DataBean" />
<variable
name="delivery_state"
......@@ -318,7 +318,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="追加服務費:"
android:text="貼士:"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/sp_10" />
......
......@@ -8,7 +8,7 @@
<variable
name="data"
type="com.gingersoft.gsa.other_order_mode.data.model.bean.FoodDetailsTranBean" />
type="com.gingersoft.gsa.delivery_pick_mode.data.model.bean.FoodDetailsTranBean" />
<variable
name="price"
......
......@@ -8,7 +8,7 @@
<variable
name="data"
type="com.gingersoft.gsa.other_order_mode.data.model.bean.HistoryOrderBean.DataBean" />
type="com.gingersoft.gsa.delivery_pick_mode.data.model.bean.HistoryOrderBean.DataBean" />
<variable
name="orderingMethod"
......
......@@ -11,7 +11,7 @@
<variable
name="data"
type="com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean" />
type="com.gingersoft.gsa.delivery_pick_mode.data.model.bean.OrderList.DataBeanX.DataBean" />
<variable
name="delivery_state"
......
......@@ -25,8 +25,6 @@ public interface PrinterAddContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void addPrinterSuccess(PrinterDeviceBean printerDeviceBean);
void updatePrinterSuccess(PrinterDeviceBean printerDeviceBean);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
......
......@@ -66,6 +66,8 @@ public class PrjBean {
private String orderDetailsTime;
private int orderDetailsId;
private String productName;
private String productName2;
private String productName3;
private int parentId;
private int type;
private int printerType;
......@@ -172,6 +174,22 @@ public class PrjBean {
this.productName = productName;
}
public String getProductName2() {
return productName2;
}
public void setProductName2(String productName2) {
this.productName2 = productName2;
}
public String getProductName3() {
return productName3;
}
public void setProductName3(String productName3) {
this.productName3 = productName3;
}
public int getParentId() {
return parentId;
}
......
......@@ -3,7 +3,6 @@ package com.joe.print.mvp.presenter;
import android.app.Application;
import com.gingersoft.gsa.cloud.base.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.base.utils.JsonUtils;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
......@@ -11,11 +10,6 @@ import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import com.joe.print.mvp.contract.PrinterAddContract;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.inject.Inject;
......@@ -24,7 +18,6 @@ import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.RequestBody;
......@@ -127,7 +120,6 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
public void onNext(BaseResult baseResult) {
if (baseResult.isSuccess()) {
mRootView.showMessage("保存成功");
mRootView.updatePrinterSuccess(printerDeviceBean);
mRootView.killMyself();
}
}
......@@ -150,7 +142,8 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
.add("modifierFont", printerDeviceBean.getModifierFont() + "")
.add("modifierIsItalic", printerDeviceBean.getModifierIsItalic() + "")
.add("numberIsFlip", printerDeviceBean.getNumberIsFlip() + "")
.add("printerDeviceType", printerDeviceBean.getPrinterDeviceType() + "");
.add("printerDeviceType", printerDeviceBean.getPrinterDeviceType() + "")
.add("languageType", printerDeviceBean.getLanguageType() + "");
if (printerDeviceBean.getFlyPrinterDeviceId() != null) {
builder.add("flyPrinterDeviceId", printerDeviceBean.getFlyPrinterDeviceId() + "");
}
......
......@@ -117,7 +117,7 @@ public class PrintPrjKitchen extends PrinterRoot {
TextView tvTableNumber2 = view.findViewById(R.id.tv_kitchen_print_table_number2);
LinearLayout layoutOpenTableTime = view.findViewById(R.id.layout_opening_table_time);
KitChenPrjPrintFoodAdapter foodAdapter = new KitChenPrjPrintFoodAdapter(data);
KitChenPrjPrintFoodAdapter foodAdapter = new KitChenPrjPrintFoodAdapter(data, printerDeviceBean);
rvFood.setLayoutManager(new LinearLayoutManager(context));
rvFood.setAdapter(foodAdapter);
//廚房位置
......
......@@ -28,6 +28,7 @@ import com.gingersoft.gsa.cloud.base.widget.DialogUtils;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.database.bean.PrintModelBean;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.gingersoft.gsa.cloud.ui.view.WheelView;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
......@@ -36,13 +37,9 @@ import com.joe.print.R2;
import com.joe.print.di.component.DaggerPrinterAddComponent;
import com.joe.print.mvp.contract.PrinterAddContract;
import com.joe.print.mvp.presenter.PrinterAddPresenter;
import com.joe.print.mvp.print.PrinterRoot;
import com.joe.print.mvp.ui.adapter.SelectPrintAdapter;
import com.gingersoft.gsa.cloud.ui.view.WheelView;
import com.qmuiteam.qmui.widget.QMUITopBar;
import org.w3c.dom.Text;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......@@ -102,6 +99,8 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
// Switch mSwitchColorFlip;//是否翻轉
@BindView(R2.id.tv_print_flip)
TextView tvFlip;
@BindView(R2.id.tv_food_language)
TextView tvLanguage;
@BindView(R2.id.layout_ip)
LinearLayout layoutIp;
@BindView(R2.id.layout_port)
......@@ -128,11 +127,11 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
private int foodIsItalic = 0;//食品是否斜體
private int modifierIsItalic = 0;//細項是否斜體
private int flipPosition = 0;//數量大於1是否翻轉
private int languagePosition = 0;
public static List<String> printTypes = Arrays.asList("網路打印", "本機打印", "USB打印");
private List<String> fontSize = Arrays.asList("預設", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30");
private List<String> booleanSelect = Arrays.asList("預設", "是", "否");
private List<String> languageSelect = Arrays.asList("語言一", "語言二", "語言三");
@Override
public void setupActivityComponent(@NonNull AppComponent appComponent) {
......@@ -210,6 +209,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
foodIsItalic = printerDeviceBean.getFoodIsItalic();
modifierIsItalic = printerDeviceBean.getModifierIsItalic();
flipPosition = printerDeviceBean.getNumberIsFlip();
languagePosition = printerDeviceBean.getLanguageType();
} else {
mTvFoodNameSize.setText("1");
mTvdetailsFontSize.setText("1");
......@@ -234,6 +234,10 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
tvFoodItalic.setText(booleanSelect.get(foodIsItalic));
tvModifierItalic.setText(booleanSelect.get(modifierIsItalic));
tvFlip.setText(booleanSelect.get(flipPosition));
if (languagePosition > 0) {
languagePosition = languagePosition - 1;
}
tvLanguage.setText(languageSelect.get(languagePosition));
//添加監聽
for (int i = 0; i < ipEdits.length; i++) {
MyTextWatcher myTextWatchers = new MyTextWatcher(ipEdits[i]);
......@@ -356,7 +360,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
printIpLine.setVisibility(isVisible);
}
@OnClick({R2.id.layout_flip, R2.id.layout_modifier_italic, R2.id.layout_food_italic, R2.id.layout_print_modifier_isbold, R2.id.layout_print_food_isbold, R2.id.layout_print_type, R2.id.printer_add, R2.id.layout_select_fail_one, R2.id.layout_select_fail_two, R2.id.layout_print_device, R2.id.layout_print_device_food_font_size, R2.id.layout_print_device_food_item_font_size})
@OnClick({R2.id.layout_print_device_food_language, R2.id.layout_flip, R2.id.layout_modifier_italic, R2.id.layout_food_italic, R2.id.layout_print_modifier_isbold, R2.id.layout_print_food_isbold, R2.id.layout_print_type, R2.id.printer_add, R2.id.layout_select_fail_one, R2.id.layout_select_fail_two, R2.id.layout_print_device, R2.id.layout_print_device_food_font_size, R2.id.layout_print_device_food_item_font_size})
@Override
public void onClick(View v) {
int id = v.getId();
......@@ -389,7 +393,21 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
showSelectFoodIsBold("是否斜體", tvModifierItalic);
} else if (id == R.id.layout_flip) {
showSelectFoodIsBold("是否翻轉", tvFlip);
} else if (id == R.id.layout_print_device_food_language) {
//prj語言
showSelectLanguage();
}
}
private void showSelectLanguage() {
List<String> types = new ArrayList<>();
types.add("語言一");
types.add("語言二");
types.add("語言三");
DialogUtils.showSelectPopop(this, types, "食品語言", languagePosition, i -> {
languagePosition = i;
tvLanguage.setText(languageSelect.get(languagePosition));
});
}
private void showSelectFoodIsBold(String title, TextView textView) {
......@@ -444,6 +462,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
hepler.getView(R.id.btn_confirm).setOnClickListener(v -> {
modelPosition = wheelView.getSeletedIndex();
mTvModel.setText(wheelView.getSeletedItem());
mTvModel.setTextColor(getResources().getColor(R.color.color_3c));
dialog.dismiss();
});
......@@ -532,7 +551,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
} else {
printerDeviceBean.setPort(Integer.parseInt(port));
}
} else{
} else {
printerDeviceBean.setIp("");
printerDeviceBean.setPort(0);
}
......@@ -570,7 +589,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
printerDeviceBean.setFoodIsItalic(foodIsItalic);
printerDeviceBean.setModifierIsItalic(modifierIsItalic);
printerDeviceBean.setNumberIsFlip(flipPosition);
printerDeviceBean.setLanguageType(languagePosition + 1);
printerDeviceBean.setPrinterDeviceType(printType);
//添加打印機
if (v.getId() == R.id.printer_add) {
......@@ -620,13 +639,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
finish();
}
@Override
public void updatePrinterSuccess(PrinterDeviceBean item) {
//修改打印機成功,如果這個打印機是用戶設置的默認打印機,則需要更新信息
}
class MyTextWatcher implements TextWatcher {
public EditText mEditText;
......
......@@ -7,7 +7,7 @@ import androidx.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.base.common.bean.OrderDetail;
import com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean;
import com.joe.print.mvp.model.bean.PrjBean;
import java.math.BigDecimal;
......@@ -19,9 +19,10 @@ import java.util.List;
public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBean.Bean, BaseViewHolder> {
private int indentation = 0;
public KitChenPrjPrintFoodAdapter(@Nullable List<PrjBean.DataBean.Bean> data) {
private PrinterDeviceBean printerDeviceBean;
public KitChenPrjPrintFoodAdapter(@Nullable List<PrjBean.DataBean.Bean> data, PrinterDeviceBean printerDeviceBean) {
super(R.layout.print_kitchen_item_food, data);
this.printerDeviceBean = printerDeviceBean;
}
@Override
......@@ -42,7 +43,15 @@ public class KitChenPrjPrintFoodAdapter extends BaseQuickAdapter<PrjBean.DataBea
paddingLeft = 0;
}
textView.setPadding(paddingLeft, textView.getPaddingTop(), textView.getPaddingRight(), textView.getPaddingBottom());
if(printerDeviceBean.getLanguageType() == 0 || printerDeviceBean.getLanguageType() == 1){
helper.setText(R.id.tv_food_name, item.getProductName());
} else if(printerDeviceBean.getLanguageType() == 2){
helper.setText(R.id.tv_food_name, item.getProductName2());
} else if(printerDeviceBean.getLanguageType() == 3){
helper.setText(R.id.tv_food_name, item.getProductName3());
} else {
helper.setText(R.id.tv_food_name, item.getProductName());
}
helper.setText(R.id.tv_food_number, String.valueOf(item.getNumber()));
}
}
......@@ -401,6 +401,49 @@
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout>
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
<!-- 語言選擇-->
<RelativeLayout
android:id="@+id/layout_print_device_food_language"
style="@style/print_add_printer_input_style"
android:layout_width="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_food_language_text"
style="@style/print_add_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="廚房單語言" />
<ImageView
android:id="@+id/iv_food_language_arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_black_next_arrow" />
<TextView
android:id="@+id/tv_food_language"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_7"
android:layout_toLeftOf="@id/iv_food_language_arrow"
android:layout_toRightOf="@id/tv_food_language_text"
android:gravity="right"
android:text="請選擇"
android:textColor="@color/normal_color"
android:textSize="@dimen/dp_16"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</RelativeLayout>
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
......
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