Commit a019cd85 by Wyh

6.17 提交

parent c674b533
...@@ -219,7 +219,7 @@ public class ArmsUtils { ...@@ -219,7 +219,7 @@ public class ArmsUtils {
mToast.cancel(); mToast.cancel();
mToast = null; mToast = null;
} }
mToast = Toast.makeText(context, string, Toast.LENGTH_SHORT); mToast = Toast.makeText(context.getApplicationContext(), string, Toast.LENGTH_SHORT);
mToast.setText(string); mToast.setText(string);
mToast.show(); mToast.show();
} }
......
...@@ -17,7 +17,7 @@ public class ToastUtils { ...@@ -17,7 +17,7 @@ public class ToastUtils {
public void run() { public void run() {
if (context != null) { if (context != null) {
if (mToast == null) { if (mToast == null) {
mToast = Toast.makeText(context, text, duration); mToast = Toast.makeText(context.getApplicationContext(), text, duration);
} else { } else {
mToast.setText(text); mToast.setText(text);
mToast.setDuration(duration); mToast.setDuration(duration);
......
...@@ -497,7 +497,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -497,7 +497,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
/** /**
* 打開錢箱 * 打開錢箱
*/ */
fun openCashBox(){ fun openCashBox() {
CC.obtainBuilder("Component.Print") CC.obtainBuilder("Component.Print")
.addParam(PrintConstans.PRINT_TYPE, 6) .addParam(PrintConstans.PRINT_TYPE, 6)
.addParam(PrintConstans.PRINT_LOADING, false) .addParam(PrintConstans.PRINT_LOADING, false)
...@@ -543,6 +543,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -543,6 +543,10 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
launch({ launch({
repository.getDeliveryInfo(GsaCloudApplication.getRestaurantId(context).toString(), GsaCloudApplication.getMemberId(context).toString()).apply { repository.getDeliveryInfo(GsaCloudApplication.getRestaurantId(context).toString(), GsaCloudApplication.getMemberId(context).toString()).apply {
deliveryBean = this deliveryBean = this
if (this.data.isEmpty()) {
ToastUtils.show(context, "沒有配置配送員信息")
return@apply
}
//顯示選擇派送員 //顯示選擇派送員
object : DialogUtils(context, R.layout.other_order_layout_assign_deliveryman) { object : DialogUtils(context, R.layout.other_order_layout_assign_deliveryman) {
override fun initLayout(hepler: ViewHepler?, dialog: Dialog?) { override fun initLayout(hepler: ViewHepler?, dialog: Dialog?) {
...@@ -592,7 +596,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -592,7 +596,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
.setGravity(Gravity.BOTTOM) .setGravity(Gravity.BOTTOM)
.show() .show()
} }
},{ }, {
}) })
} }
......
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