Commit 5064a31b by Wyh

外送添加payType類型

Signed-off-by: Wyh <1239658231>
parent 1d75bbad
......@@ -183,8 +183,8 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
network.getCancelReason(brandId, restaurantId, type)
}
suspend fun getPayMethod(brandId: Int, restaurantId: Int) = withContext(Dispatchers.IO) {
network.getPayMethod(brandId, restaurantId)
suspend fun getPayMethod(brandId: Int, restaurantId: Int, payType: Int) = withContext(Dispatchers.IO) {
network.getPayMethod(brandId, restaurantId, payType)
}
suspend fun addPrj(orderId: String, restaurantId: String, orderDetailsIds: String) = withContext(Dispatchers.IO) {
......
......@@ -83,7 +83,7 @@ class CoolWeatherNetwork {
suspend fun getCancelReason(brandId: Int, restaurantId: Int, type: Int) = cloudService.getCancelReason(brandId, restaurantId, type).await()
//獲取商家配置的支付方式
suspend fun getPayMethod(brandId: Int, restaurantId: Int) = cloudService.getPayMethod(brandId, restaurantId).await()
suspend fun getPayMethod(brandId: Int, restaurantId: Int, payType :Int) = cloudService.getPayMethod(brandId, restaurantId, payType).await()
suspend fun addPrj(requestBody: RequestBody) = cloudService.addPrj(requestBody).await()
......
......@@ -63,7 +63,7 @@ interface WeatherService {
fun getCancelReason(@Query("brandId") brandId: Int, @Query("restaurantId") restaurantId: Int, @Query("type") type: Int): Call<CancelReason>
@GET("restaurant/pay/get")
fun getPayMethod(@Query("brandId") brandId: Int, @Query("restaurantId") restaurantId: Int): Call<PayTypeInfo>
fun getPayMethod(@Query("brandId") brandId: Int, @Query("restaurantId") restaurantId: Int, @Query("payType") payType :Int): Call<PayTypeInfo>
@POST("printerRecording/add")
fun addPrj(@Body requestBody: RequestBody): Call<String>
......
......@@ -23,6 +23,7 @@ import com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans
import com.gingersoft.gsa.cloud.constans.PrintConstans
import com.gingersoft.gsa.cloud.print.bean.OrderDetails
import com.gingersoft.gsa.cloud.service.GetInfoUpdateService
......@@ -858,7 +859,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
*/
fun getPayMethod(brandId: Int, restaurantId: Int) {
launch({
repository.getPayMethod(brandId, restaurantId).apply {
repository.getPayMethod(brandId, restaurantId, FoodSummaryConstans.TAKEAWAY_TYPE).apply {
if (isSuccess && data != null && data.size > 0) {
payTypeBean.postValue(this.data)
} else {
......
......@@ -29,6 +29,7 @@ import com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
import com.gingersoft.gsa.cloud.base.widget.DialogUtils
import com.gingersoft.gsa.cloud.constans.AppConstans
import com.gingersoft.gsa.cloud.constans.ExpandConstant
import com.gingersoft.gsa.cloud.constans.FoodSummaryConstans.TAKEAWAY_TYPE
import com.gingersoft.gsa.cloud.constans.FunctionManagerConstants
import com.gingersoft.gsa.cloud.database.bean.Function
import com.gingersoft.gsa.cloud.function.FunctionManager
......@@ -594,7 +595,7 @@ class DeliveryOrderMainActivity : BaseActivity<IPresenter>(), View.OnClickListen
}
R.id.tv_new_order -> {
//新訂單
MyOrderManage.getInstance().orderType = MyOrderManage.order_type_1
MyOrderManage.getInstance().orderType = TAKEAWAY_TYPE
CC.obtainBuilder("Component.Table")
.setActionName("showMealStandActivity")
.build()
......
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