Commit adc02ae5 by Wyh Committed by 宁斌

6.03 替換了修改訂單狀態接口

parent e4785a18
...@@ -5,6 +5,9 @@ import android.content.Context; ...@@ -5,6 +5,9 @@ import android.content.Context;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.os.Build; import android.os.Build;
import android.os.RemoteException; import android.os.RemoteException;
import androidx.annotation.NonNull;
import com.billy.cc.core.component.CC; import com.billy.cc.core.component.CC;
import com.elvishew.xlog.LogConfiguration; import com.elvishew.xlog.LogConfiguration;
import com.elvishew.xlog.LogLevel; import com.elvishew.xlog.LogLevel;
...@@ -18,32 +21,26 @@ import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy; ...@@ -18,32 +21,26 @@ import com.elvishew.xlog.printer.file.clean.FileLastModifiedCleanStrategy;
import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator; import com.elvishew.xlog.printer.file.naming.DateFileNameGenerator;
import com.gingersoft.gsa.cloud.base.BuildConfig; import com.gingersoft.gsa.cloud.base.BuildConfig;
import com.gingersoft.gsa.cloud.base.R; import com.gingersoft.gsa.cloud.base.R;
import com.gingersoft.gsa.cloud.function.FunctionStyleUtils;
import com.gingersoft.gsa.cloud.base.utils.AidlUtil; import com.gingersoft.gsa.cloud.base.utils.AidlUtil;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.constans.UserConstans;
import com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler; import com.gingersoft.gsa.cloud.base.utils.crash.AppCrashHandler;
import com.gingersoft.gsa.cloud.base.utils.file.FileUtils; import com.gingersoft.gsa.cloud.base.utils.file.FileUtils;
import com.gingersoft.gsa.cloud.base.utils.log.LogUtil; import com.gingersoft.gsa.cloud.base.utils.log.LogUtil;
import com.gingersoft.gsa.cloud.base.utils.other.SPUtils; import com.gingersoft.gsa.cloud.base.utils.other.SPUtils;
import com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy; import com.gingersoft.gsa.cloud.base.utils.xlog.MyBackupStrategy;
import com.gingersoft.gsa.cloud.constans.HttpsConstans;
import com.gingersoft.gsa.cloud.constans.PrintConstans;
import com.gingersoft.gsa.cloud.constans.UserConstans;
import com.gingersoft.gsa.cloud.database.DaoManager; import com.gingersoft.gsa.cloud.database.DaoManager;
import com.gingersoft.gsa.cloud.function.FunctionStyleUtils;
import com.hyweb.n5.lib.exception.NoInitPrinterException; import com.hyweb.n5.lib.exception.NoInitPrinterException;
import com.hyweb.n5.lib.util.PrinterUtil; import com.hyweb.n5.lib.util.PrinterUtil;
import com.jess.arms.base.BaseApplication; import com.jess.arms.base.BaseApplication;
import com.qmuiteam.qmui.arch.QMUISwipeBackActivityManager;
import com.scwang.smartrefresh.layout.SmartRefreshLayout; import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator;
import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator;
import com.scwang.smartrefresh.layout.api.RefreshFooter;
import com.scwang.smartrefresh.layout.api.RefreshHeader;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter; import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.scwang.smartrefresh.layout.header.ClassicsHeader; import com.scwang.smartrefresh.layout.header.ClassicsHeader;
import java.util.Locale; import java.util.Locale;
import com.qmuiteam.qmui.skin.manager.QDSkinManager;
import androidx.annotation.NonNull;
import me.jessyan.autosize.AutoSize; import me.jessyan.autosize.AutoSize;
import me.jessyan.autosize.AutoSizeConfig; import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.onAdaptListener; import me.jessyan.autosize.onAdaptListener;
...@@ -105,7 +102,7 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -105,7 +102,7 @@ public class GsaCloudApplication extends BaseApplication {
//初始化側滑回退 //初始化側滑回退
// QMUISwipeBackActivityManager.init(this); // QMUISwipeBackActivityManager.init(this);
//初始化主題管理器 //初始化主題管理器
QDSkinManager.install(this); // QDSkinManager.install(this);
//初始化上下拉刷新 //初始化上下拉刷新
initRefresh(); initRefresh();
//初始化今日頭條適配方案 //初始化今日頭條適配方案
...@@ -314,11 +311,11 @@ public class GsaCloudApplication extends BaseApplication { ...@@ -314,11 +311,11 @@ public class GsaCloudApplication extends BaseApplication {
@Override @Override
public void onConfigurationChanged(@NonNull Configuration newConfig) { public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig);
if((newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES){ // if((newConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES){
QDSkinManager.changeSkin(mAppContext,QDSkinManager.SKIN_DARK); // QDSkinManager.changeSkin(mAppContext,QDSkinManager.SKIN_DARK);
}else if(QDSkinManager.getCurrentSkin(mAppContext) == QDSkinManager.SKIN_DARK){ // }else if(QDSkinManager.getCurrentSkin(mAppContext) == QDSkinManager.SKIN_DARK){
QDSkinManager.changeSkin(mAppContext,QDSkinManager.SKIN_BLUE); // QDSkinManager.changeSkin(mAppContext,QDSkinManager.SKIN_BLUE);
} // }
} }
@Override @Override
......
...@@ -96,7 +96,6 @@ public class HttpsConstans { ...@@ -96,7 +96,6 @@ public class HttpsConstans {
public static void init(Context context,boolean isSwitchServer) { public static void init(Context context,boolean isSwitchServer) {
isFormal = (int) SPUtils.get(context, "isFormal", 2); isFormal = (int) SPUtils.get(context, "isFormal", 2);
Log.e("eee", "是否正式" + isFormal);
if (!BuildConfig.DEBUG && !isSwitchServer) { if (!BuildConfig.DEBUG && !isSwitchServer) {
isFormal = 1; isFormal = 1;
} }
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/qmui_config_color_white"/>
<item android:drawable="@mipmap/ic_launcher_round" android:gravity="center"/>
</layer-list>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M6.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
...@@ -4,6 +4,7 @@ import android.animation.AnimatorSet; ...@@ -4,6 +4,7 @@ import android.animation.AnimatorSet;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log;
import android.view.View; import android.view.View;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
...@@ -11,6 +12,7 @@ import android.view.animation.DecelerateInterpolator; ...@@ -11,6 +12,7 @@ import android.view.animation.DecelerateInterpolator;
import android.view.animation.ScaleAnimation; import android.view.animation.ScaleAnimation;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout;
...@@ -102,11 +104,9 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -102,11 +104,9 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
//自動登陸 //自動登陸
String pwd = Aes.aesDecrypt((String) SPUtils.get(mContext, UserConstans.LOGIN_PASSWORD, "")); String pwd = Aes.aesDecrypt((String) SPUtils.get(mContext, UserConstans.LOGIN_PASSWORD, ""));
mPresenter.login(SPUtils.get(mContext, UserConstans.LOGIN_USERNAME, "") + "", pwd); mPresenter.login(SPUtils.get(mContext, UserConstans.LOGIN_USERNAME, "") + "", pwd);
// jumpMainActivity();
} else { } else {
killMyself(); killMyself();
startActivity(new Intent(mContext, LoginActivity.class)); startActivity(new Intent(mContext, LoginActivity.class));
// jumpMainActivity();
} }
} }
} }
...@@ -131,7 +131,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -131,7 +131,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
if (++position == guideBeanList.size() && mTvExperience.getVisibility() != View.VISIBLE) { if (++position == guideBeanList.size() && mTvExperience.getVisibility() != View.VISIBLE) {
//當前選中最後一個page,顯示進入按鈕 //當前選中最後一個page,顯示進入按鈕
mTvExperience.setVisibility(View.VISIBLE); mTvExperience.setVisibility(View.VISIBLE);
mTvExperience.startAnimation(animation); // mTvExperience.startAnimation(animation);
} }
} }
}); });
...@@ -140,23 +140,6 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -140,23 +140,6 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
magicIndicator.attachToViewPager(mVpGuide); magicIndicator.attachToViewPager(mVpGuide);
} }
private void jumpDownloadActivity() {
CC.obtainBuilder("Component.Download")
.setActionName("showDownloadActivity")
.addParam("fromPage",1)
.build()
.call();
killMyself();
}
private void jumpMainActivity() {
CC.obtainBuilder("Component.Main")
.setActionName("showMainActivity")
.build()
.call();
killMyself();
}
private void updateUI(int position) { private void updateUI(int position) {
mTvGuideTitle.setText(guideBeanList.get(position).getTitle()); mTvGuideTitle.setText(guideBeanList.get(position).getTitle());
mTvGuideDetails.setText(guideBeanList.get(position).getDetails()); mTvGuideDetails.setText(guideBeanList.get(position).getDetails());
...@@ -306,7 +289,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem ...@@ -306,7 +289,7 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
.show(); .show();
} }
@OnClick({R2.id.iv_guide_close,R2.id.tv_experience}) @OnClick({R2.id.iv_guide_close, R2.id.tv_experience})
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (v.getId() == R.id.iv_guide_close || v.getId() == R.id.tv_experience) { if (v.getId() == R.id.iv_guide_close || v.getId() == R.id.tv_experience) {
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
...@@ -4,104 +4,48 @@ ...@@ -4,104 +4,48 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:id="@+id/content_view"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:background="@color/white"-->
<!-- android:visibility="visible">-->
<!-- <ImageView-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:src="@mipmap/img_start" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_welcome_title"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="多功能管理,讓管理更輕鬆"-->
<!-- android:textColor="@color/theme_color"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- app:layout_constraintBottom_toTopOf="@id/iv_welcome_center"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintVertical_chainStyle="packed" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_center"-->
<!-- android:layout_width="@dimen/dp_203"-->
<!-- android:layout_height="@dimen/dp_256"-->
<!-- android:layout_marginTop="@dimen/dp_36"-->
<!-- android:src="@mipmap/png_welcome_center"-->
<!-- app:layout_constraintBottom_toTopOf="@id/iv_welcome_logo"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/tv_welcome_title"-->
<!-- app:layout_constraintVertical_bias="0.6" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_logo"-->
<!-- android:layout_width="@dimen/dp_56"-->
<!-- android:layout_height="@dimen/dp_56"-->
<!-- android:layout_marginTop="@dimen/dp_16"-->
<!-- android:src="@mipmap/ic_launcher"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/iv_welcome_center" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_bottom"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@mipmap/png_welcome_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<RelativeLayout <RelativeLayout
android:id="@+id/content_view" android:id="@+id/content_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_welcome_title" <TextView
android:layout_width="wrap_content" android:id="@+id/tv_welcome_title"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="多功能管理,讓管理更輕鬆" android:layout_height="wrap_content"
android:textColor="@color/theme_color" android:layout_centerHorizontal="true"
android:textSize="@dimen/sp_22" android:layout_marginTop="@dimen/dp_80"
android:textStyle="bold" android:text="多功能管理,讓管理更輕鬆"
android:layout_centerHorizontal="true" android:textColor="@color/theme_color"
android:layout_marginTop="@dimen/dp_80"/> android:textSize="@dimen/sp_22"
android:textStyle="bold" />
<ImageView <ImageView
android:id="@+id/iv_welcome_center" android:id="@+id/iv_welcome_center"
android:layout_width="@dimen/dp_203" android:layout_width="@dimen/dp_203"
android:layout_height="@dimen/dp_256" android:layout_height="@dimen/dp_256"
android:layout_marginTop="@dimen/dp_60" android:layout_below="@+id/tv_welcome_title"
android:src="@mipmap/png_welcome_center"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_below="@+id/tv_welcome_title" /> android:layout_marginTop="@dimen/dp_60"
android:src="@mipmap/png_welcome_center" />
<ImageView <ImageView
android:id="@+id/iv_welcome_logo" android:id="@+id/iv_welcome_logo"
android:layout_width="@dimen/dp_56" android:layout_width="@dimen/dp_56"
android:layout_height="@dimen/dp_56" android:layout_height="@dimen/dp_56"
android:layout_marginTop="@dimen/dp_16" android:layout_below="@+id/iv_welcome_center"
android:src="@mipmap/ic_launcher"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_below="@+id/iv_welcome_center" /> android:layout_marginTop="@dimen/dp_16"
android:src="@mipmap/ic_launcher" />
<ImageView <ImageView
android:id="@+id/iv_welcome_bottom" android:id="@+id/iv_welcome_bottom"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@mipmap/png_welcome_bottom"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/> android:layout_centerHorizontal="true"
android:src="@mipmap/png_welcome_bottom" />
</RelativeLayout> </RelativeLayout>
...@@ -112,6 +56,30 @@ ...@@ -112,6 +56,30 @@
android:background="@mipmap/pic_guide_bg" android:background="@mipmap/pic_guide_bg"
android:visibility="gone"> android:visibility="gone">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2_guide"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
android:id="@+id/guide_magic_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_5"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/dp_10"
app:circle_rect_corner="@dimen/dp_3"
app:circle_rect_itemHeight="@dimen/dp_5"
app:circle_rect_itemWidth="@dimen/dp_14"
app:circle_rect_radius="@dimen/dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_goneMarginBottom="@dimen/dp_15"
app:normal_color="@color/white"
app:selected_color="@color/white"
app:spacing="@dimen/dp_5"
app:style="circle_rect" />
<ImageView <ImageView
android:id="@+id/iv_guide_close" android:id="@+id/iv_guide_close"
android:layout_width="@dimen/dp_42" android:layout_width="@dimen/dp_42"
...@@ -153,10 +121,10 @@ ...@@ -153,10 +121,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_15" android:layout_marginBottom="@dimen/dp_15"
android:background="@drawable/shape_experience_bg" android:background="@drawable/shape_experience_bg"
android:paddingBottom="@dimen/dp_10"
android:paddingLeft="@dimen/dp_28" android:paddingLeft="@dimen/dp_28"
android:paddingRight="@dimen/dp_28"
android:paddingTop="@dimen/dp_10" android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_28"
android:paddingBottom="@dimen/dp_10"
android:text="立即體驗" android:text="立即體驗"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
...@@ -165,30 +133,6 @@ ...@@ -165,30 +133,6 @@
app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" /> app:layout_constraintRight_toRightOf="parent" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp2_guide"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
android:id="@+id/guide_magic_indicator"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_5"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/dp_10"
app:circle_rect_corner="@dimen/dp_3"
app:circle_rect_itemHeight="@dimen/dp_5"
app:circle_rect_itemWidth="@dimen/dp_14"
app:circle_rect_radius="@dimen/dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_goneMarginBottom="@dimen/dp_15"
app:normal_color="@color/white"
app:selected_color="@color/white"
app:spacing="@dimen/dp_5"
app:style="circle_rect" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<foreground android:drawable="@mipmap/ic_launcher"/>
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<!--<background android:drawable="@drawable/ic_launcher"/>-->
<foreground android:drawable="@mipmap/ic_launcher"/>
</adaptive-icon>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M6.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M6.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
package com.gingersoft.gsa.other_order_mode.data package com.gingersoft.gsa.other_order_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.other_order_mode.data.network.DeliveryNetwork
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import okhttp3.FormBody import okhttp3.FormBody
import okhttp3.MediaType
import okhttp3.RequestBody
class DeliveryRepository private constructor(private val network: DeliveryNetwork) { class DeliveryRepository private constructor(private val network: DeliveryNetwork) {
...@@ -14,18 +18,30 @@ class DeliveryRepository private constructor(private val network: DeliveryNetwor ...@@ -14,18 +18,30 @@ class DeliveryRepository private constructor(private val network: DeliveryNetwor
network.queryDeliveryList(requestBody) network.queryDeliveryList(requestBody)
} }
suspend fun addDeliveryConfig(distributionFeeMin: String, distributionFeeMax: String, suspend fun addDeliveryConfig(data: DeliveryConfig.Data.DeliveryInfo) = withContext(Dispatchers.IO) {
distributionFee: String, deliveryCost: String, val requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(data)!!)
distributionType: String, type: String, network.addDeliveryList(requestBody)
desc: String, restaurantId: String, }
createBy: String, lackPrice: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("restaurantId", restaurantId)
suspend fun updateDelivery(distributionFeeMin: String, distributionFeeMax: String,
distributionFee: String, deliveryCost: String,
distributionType: String, type: String,
desc: String, id: String,
createBy: String, deletes: Int, lackPrice: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("id", id)//id
.add("distributionFeeMin", distributionFeeMin)//運費下限
.add("distributionFeeMax", distributionFeeMax)//運費上限
.add("distributionFee", distributionFee)//配送费
.add("deliveryCost", deliveryCost)//起送费
.add("distributionType", distributionType)//配送類型 SHORT_RANGE (短途送) STANDARD (中途送) LONG_DISTANCE(長途送)
.add("type", type)//是否本店配送,0,是,1,第三方
.add("desc", desc)//描述
.add("updateBy", createBy)//用戶id
.add("lackPrice", lackPrice)//差價
.add("deletes", deletes.toString())
.build() .build()
network.queryDeliveryList(requestBody) network.updateDelivery(requestBody)
} }
......
...@@ -59,18 +59,38 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw ...@@ -59,18 +59,38 @@ class WeatherRepository private constructor(private val network: CoolWeatherNetw
} }
suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int) = withContext(Dispatchers.IO) { // suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int) = withContext(Dispatchers.IO) {
// val requestBody = FormBody.Builder()
// .add("orderId", orderId)
// .add("selfOrderId", selfOrderId)
// .add("status", status.toString())
// .add("mobile", mobile)
// .add("sender", sender)
// .add("isPush", isPush.toString())//1送貨 2確認訂單 結賬傳0
// .add("orderType", orderType.toString())
// .build()
// val data = network.updateOrderStatus(requestBody)
// data
// }
suspend fun gsUpdateOrderStatus(orderId: String, status: Int, orderType: Int, type: Int, sendDate: String?,
sender: String, sendmobile: String, reasonId: String, reasonDesc: String,
confirmationType: Int, orderFrom: Int) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder() val requestBody = FormBody.Builder()
.add("orderId", orderId) .add("orderId", orderId)//訂單id
.add("selfOrderId", selfOrderId) .add("status", status.toString())//订单状态#0:未支付;1:待確認(已支付, 待餐廳確認);2:制作中(餐厅确认);3:派送中;4:确认收货(完成);5:是否评论;6:取消;
.add("status", status.toString()) .add("orderType", orderType.toString())//訂單類型#1:餐廳訂單;2:線上外賣訂單3:扫码点餐;4固定二维码订单;5:预点餐;6:積分訂單;7:自取订单'
.add("mobile", mobile) .add("type", type.toString())//通知類型:1.未定,2:外賣
.add("sender", sender) .add("sendDate", sendDate)//餐厅送达描述
.add("isPush", isPush.toString())//1送貨 2確認訂單 結賬傳0 .add("sender", sender)//送餐員名字
.add("orderType", orderType.toString()) .add("sendmobile", sendmobile)//送餐員電話
.add("reasonId", reasonId)//原因id
.add("reasonDesc", reasonDesc)//原因描敘
.add("confirmationType", confirmationType.toString())//接單類型,1 手動接單 2,自動接單
.add("orderFrom", orderFrom.toString())//订单来源#1:ios;2:安卓;3:gspos;4:web;5:第三方POS A;6:第三方POS B;
.build() .build()
val data = network.updateOrderStatus(requestBody) network.gsUpdateOrderStatus(requestBody)
data
} }
suspend fun thirdDelivery(orderId: String, thirdItem: ThirdItem) = withContext(Dispatchers.IO) { suspend fun thirdDelivery(orderId: String, thirdItem: ThirdItem) = withContext(Dispatchers.IO) {
......
package com.gingersoft.gsa.other_order_mode.data.model.bean
data class DeliveryAddSuccessConfig(
val data: Data,
val success: Boolean,
val sysTime: Long) {
data class Data(
val addressDetail: String,
val deliveryCost: Double,
val desc: String,
val distributionFee: Double,
val distributionFeeMax: Double,
val distributionFeeMin: Double,
val distributionType: String,//區分當前是什麼類型的配送方式
val id: Int,
val mapX: String,
val mapY: String,
val restaurantId: Int,
val restaurantName: String,
val restaurantPhone: String,
val lackPrice: Double,
val type: Int,//為1時是第三方配送
val createBy: Int
)
}
\ No newline at end of file
...@@ -23,7 +23,8 @@ data class DeliveryConfig( ...@@ -23,7 +23,8 @@ data class DeliveryConfig(
val restaurantName: String, val restaurantName: String,
val restaurantPhone: String, val restaurantPhone: String,
val lackPrice:Double, val lackPrice:Double,
val type: Int//為1時是第三方配送 val type: Int,//為1時是第三方配送
val createBy:Int
) : Serializable ) : Serializable
} }
......
package com.gingersoft.gsa.other_order_mode.data.model.bean package com.gingersoft.gsa.other_order_mode.data.model.bean
class MessageBean { data class MessageBean(val code: String, val errorMsg: String, val success: Boolean = false, val sysTime: Long = 0, val data: DataBean? = null) {
class DataBean(var msg: String? = null, var num: Int = 0)
/** /**
* success : true * msg : 數據更新成功!
* sysTime : 1585723657344 * num : 1
* data : {"msg":"數據更新成功!","num":1} *
* {"code":"1","errorMsg":"成功","data":null}
*/ */
private var success: Boolean = false
private var sysTime: Long = 0
private var data: DataBean? = null
fun isSuccess(): Boolean {
return success
}
fun setSuccess(success: Boolean) {
this.success = success
}
fun getSysTime(): Long {
return sysTime
}
fun setSysTime(sysTime: Long) {
this.sysTime = sysTime
}
fun getData(): DataBean? {
return data
}
fun setData(data: DataBean) {
this.data = data
}
class DataBean {
/**
* msg : 數據更新成功!
* num : 1
*/
var msg: String? = null
var num: Int = 0
}
} }
\ No newline at end of file
package com.gingersoft.gsa.other_order_mode.data.network package com.gingersoft.gsa.other_order_mode.data.network
import android.util.Log
import com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService import com.gingersoft.gsa.other_order_mode.data.network.api.WeatherService
import okhttp3.RequestBody import okhttp3.RequestBody
import retrofit2.Call import retrofit2.Call
...@@ -34,6 +35,9 @@ class CoolWeatherNetwork { ...@@ -34,6 +35,9 @@ class CoolWeatherNetwork {
//修改訂單狀態 //修改訂單狀態
suspend fun updateOrderStatus(requestBody: RequestBody) = orderService.updateOrderStatus(requestBody).await() suspend fun updateOrderStatus(requestBody: RequestBody) = orderService.updateOrderStatus(requestBody).await()
//gspost修改訂單狀態
suspend fun gsUpdateOrderStatus(requestBody: RequestBody) = service.gsUpdateOrderStatus(requestBody).await()
//第三方配送接口 //第三方配送接口
suspend fun thirdDelivery(requestBody: RequestBody) = gsposService.thirdDelivery(requestBody).await() suspend fun thirdDelivery(requestBody: RequestBody) = gsposService.thirdDelivery(requestBody).await()
......
...@@ -24,6 +24,9 @@ class DeliveryNetwork { ...@@ -24,6 +24,9 @@ class DeliveryNetwork {
//獲取物流配置 //獲取物流配置
suspend fun addDeliveryList(requestBody: RequestBody) = gsposService.addDeliveryList(requestBody).await() suspend fun addDeliveryList(requestBody: RequestBody) = gsposService.addDeliveryList(requestBody).await()
//獲取物流配置
suspend fun updateDelivery(requestBody: RequestBody) = gsposService.updateDelivery(requestBody).await()
private suspend fun <T> Call<T>.await(): T { private suspend fun <T> Call<T>.await(): T {
......
...@@ -19,16 +19,11 @@ object ServiceCreator { ...@@ -19,16 +19,11 @@ object ServiceCreator {
private var BASE_URL2 = "$ROOT_URL/member-web/api/" private var BASE_URL2 = "$ROOT_URL/member-web/api/"
private var BASE_URL3 = "$ROOT_URL/member-web/ricepon-gsa/api/" private var BASE_URL3 = "$ROOT_URL/member-web/ricepon-gsa/api/"
private val builder = Retrofit.Builder() private val builder = Retrofit.Builder()
.baseUrl(BASE_URL) .baseUrl(BASE_URL)
.client(httpClient.build()) .client(httpClient.build())
.addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(ScalarsConverterFactory.create())
.addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
.apply {
Log.e("eee", "服務器地址$ROOT_URL")
}
private val builder2 = Retrofit.Builder() private val builder2 = Retrofit.Builder()
.baseUrl(BASE_URL2) .baseUrl(BASE_URL2)
......
package com.gingersoft.gsa.other_order_mode.data.network.api package com.gingersoft.gsa.other_order_mode.data.network.api
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.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.data.model.bean.MessageBean
import okhttp3.RequestBody import okhttp3.RequestBody
import retrofit2.Call import retrofit2.Call
import retrofit2.http.Body import retrofit2.http.Body
...@@ -12,6 +14,9 @@ interface DeliveryService { ...@@ -12,6 +14,9 @@ interface DeliveryService {
fun queryDeliveryList(@Body requestBody: RequestBody): Call<DeliveryConfig> fun queryDeliveryList(@Body requestBody: RequestBody): Call<DeliveryConfig>
@POST("gsa/addDeliveryConfig") @POST("gsa/addDeliveryConfig")
fun addDeliveryList(@Body requestBody: RequestBody): Call<String> fun addDeliveryList(@Body requestBody: RequestBody): Call<DeliveryAddSuccessConfig>
@POST("gsa/updateDeliveryConfig")
fun updateDelivery(@Body requestBody: RequestBody): Call<MessageBean>
} }
\ No newline at end of file
...@@ -27,6 +27,9 @@ interface WeatherService { ...@@ -27,6 +27,9 @@ interface WeatherService {
@POST("wechat/updateOrderStatus") @POST("wechat/updateOrderStatus")
fun updateOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean> fun updateOrderStatus(@Body requestBody: RequestBody): Call<UpdateOrderBean>
@POST("order/updateOrderStatus")
fun gsUpdateOrderStatus(@Body requestBody: RequestBody): Call<MessageBean>
@POST("gsa/shipAnyOrdersNew") @POST("gsa/shipAnyOrdersNew")
fun thirdDelivery(@Body requestBody: RequestBody): Call<ThirdSend> fun thirdDelivery(@Body requestBody: RequestBody): Call<ThirdSend>
......
package com.gingersoft.gsa.other_order_mode.model.viewModel package com.gingersoft.gsa.other_order_mode.model.viewModel
import android.util.Log
import com.gingersoft.gsa.other_order_mode.data.DeliveryRepository 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.other_order_mode.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.data.model.bean.MessageBean
class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewModel() { class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewModel() {
...@@ -15,7 +18,35 @@ class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewMo ...@@ -15,7 +18,35 @@ class DeliveryViewModel(private val repository: DeliveryRepository) : BaseViewMo
}) })
} }
fun addDeliveryConfig(distributionFeeMin: String, distributionFeeMax: String,
distributionFee: String, deliveryCost: String,
distributionType: String, type: Int,
desc: String, restaurantId: Int,
createBy: Int, lackPrice: String, listenter: (DeliveryAddSuccessConfig?) -> Unit) {
launch({
repository.addDeliveryConfig(DeliveryConfig.Data.DeliveryInfo("", deliveryCost.toDouble(), desc,
distributionFee.toDouble(), distributionFeeMax.toDouble(), distributionFeeMin.toDouble(), distributionType,
0, "", "", restaurantId, "", "", lackPrice.toDouble(),
type, createBy)).apply {
listenter.invoke(this)
}
}, {
listenter.invoke(null)
})
}
fun updateDeliveryConfig(distributionFeeMin: String, distributionFeeMax: String,
distributionFee: String, deliveryCost: String,
distributionType: String, type: Int,
desc: String, id: Int,
createBy: Int, lackPrice: String, deletes: Int, listenter: (MessageBean?) -> Unit) {
launch({
repository.updateDelivery(distributionFeeMin, distributionFeeMax, distributionFee, deliveryCost,
distributionType, type.toString(), desc, id.toString(), createBy.toString(), deletes, lackPrice).apply {
listenter.invoke(this)
}
}, {
listenter.invoke(null)
})
}
} }
...@@ -214,7 +214,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -214,7 +214,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
*/ */
suspend fun updateRestOpenStatus(state: Int, context: Context) { suspend fun updateRestOpenStatus(state: Int, context: Context) {
repository.updateRestOpenStatus(state, GsaCloudApplication.getRestaurantId(context).toString()).apply { repository.updateRestOpenStatus(state, GsaCloudApplication.getRestaurantId(context).toString()).apply {
if (isSuccess()) { if (success) {
restaurantState.value = state restaurantState.value = state
} }
} }
...@@ -254,7 +254,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -254,7 +254,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
withContext(Dispatchers.IO) { withContext(Dispatchers.IO) {
val orderDetail = withContext(Dispatchers.Default) { repository.getOrderInfo(orderId) } val orderDetail = withContext(Dispatchers.Default) { repository.getOrderInfo(orderId) }
if (orderDetail.data != null && orderDetail.data!!.isNotEmpty()) { if (orderDetail.data != null && orderDetail.data!!.isNotEmpty()) {
if(curStat != 0) { if (curStat != 0) {
val data = orderDetail.data!![0] val data = orderDetail.data!![0]
val type: Int val type: Int
val estimatedTime: String val estimatedTime: String
...@@ -332,7 +332,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -332,7 +332,6 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} else { } else {
//第三方的單,執行重印功能 //第三方的單,執行重印功能
printOrder(orderDetails, data, context, listener) printOrder(orderDetails, data, context, listener)
} }
} else if (status == 4) { } else if (status == 4) {
//結賬,彈窗確認是否結賬 //結賬,彈窗確認是否結賬
...@@ -342,8 +341,11 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -342,8 +341,11 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener { hepler.getView<TextView>(R.id.tv_dialog_confirm).setOnClickListener {
dialog.dismiss() dialog.dismiss()
launch({ launch({
updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply { // updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply {
listener.invoke(success) // listener.invoke(success)
// }
repository.gsUpdateOrderStatus(data.Id.toString(), status, data.order_type, 1, "", "", "", "0", "", 1, 0).apply {
listener.invoke(code == "1")
} }
}, { }, {
...@@ -389,13 +391,16 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -389,13 +391,16 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 修改訂單狀態並打印 * 修改訂單狀態並打印
*/ */
private suspend fun updateOrderAndPrint(data: OrderList.DataBeanX.DataBean, status: Int, isPush: Int, orderDetails: OrderDetails, context: Context, listener: (Boolean) -> Unit) { private suspend fun updateOrderAndPrint(data: OrderList.DataBeanX.DataBean, status: Int, isPush: Int, orderDetails: OrderDetails, context: Context, listener: (Boolean) -> Unit) {
updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply { // updateOrderStatus(data.Id.toString(), "", status, "", "", isPush, data.order_type).apply {
//
// }
repository.gsUpdateOrderStatus(data.Id.toString(), status, data.order_type, 1, "", "", "", "0", "", 1, 0).apply {
if (status == 0 || status == 1 || status == 2) { if (status == 0 || status == 1 || status == 2) {
//確認送單 //確認送單
if (this.success) { if (this.code == "1") {
//打印 // 打印
//初始化用於打印的view // 初始化用於打印的view
//送單成功後,再調用接口獲取取餐碼 // 送單成功後,再調用接口獲取取餐碼
showLoading(context) showLoading(context)
getOrderInfo(data.Id.toString()) { getOrderInfo(data.Id.toString()) {
if (it != null) { if (it != null) {
...@@ -464,9 +469,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -464,9 +469,9 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
} }
} }
suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int): UpdateOrderBean { // suspend fun updateOrderStatus(orderId: String, selfOrderId: String?, status: Int, mobile: String?, sender: String?, isPush: Int, orderType: Int): UpdateOrderBean {
return repository.updateOrderStatus(orderId, selfOrderId, status, mobile, sender, isPush, orderType) // return repository.updateOrderStatus(orderId, selfOrderId, status, mobile, sender, isPush, orderType)
} // }
/** /**
* 選擇派送員 * 選擇派送員
...@@ -498,11 +503,21 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() { ...@@ -498,11 +503,21 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
confirmBtn.setOnClickListener { confirmBtn.setOnClickListener {
if (selectIndex != -1) { if (selectIndex != -1) {
launch({ launch({
updateOrderStatus(data.Id.toString(), "", status, deliveryBean!!.data[deliveryAdapter.selectIndex].mobile, deliveryBean!!.data[deliveryAdapter.selectIndex].userName, isPush, data.order_type).apply { // updateOrderStatus(data.Id.toString(), "", status, deliveryBean!!.data[deliveryAdapter.selectIndex].mobile, deliveryBean!!.data[deliveryAdapter.selectIndex].userName, isPush, data.order_type).apply {
if (this.success) { // if (this.success) {
// dialog?.dismiss()
// //回調
// listener.invoke(success)//刷新頁面
// ToastUtils.show(context, "訂單開始派送")
// } else {
// ToastUtils.show(context, "訂單派送失敗")
// }
// }
repository.gsUpdateOrderStatus(data.Id.toString(), status, data.order_type, 1, "", deliveryBean!!.data[deliveryAdapter.selectIndex].userName, deliveryBean!!.data[deliveryAdapter.selectIndex].mobile, "0", "", 1, 0).apply {
if (code == "1") {
dialog?.dismiss() dialog?.dismiss()
//回調 //回調
listener.invoke(success)//刷新頁面 listener.invoke(code == "1")//刷新頁面
ToastUtils.show(context, "訂單開始派送") ToastUtils.show(context, "訂單開始派送")
} else { } else {
ToastUtils.show(context, "訂單派送失敗") ToastUtils.show(context, "訂單派送失敗")
......
...@@ -4,21 +4,24 @@ import android.os.Bundle ...@@ -4,21 +4,24 @@ import android.os.Bundle
import com.gingersoft.gsa.other_order_mode.R 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.data.model.bean.DeliveryConfig
import com.gingersoft.gsa.other_order_mode.ui.base.BaseActivity 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.other_order_mode.ui.fragment.UpdateDeliveryFragment
import kotlinx.android.synthetic.main.activity_delivery.* import kotlinx.android.synthetic.main.activity_delivery.*
class DeliverySettingActivity : BaseActivity() { class DeliverySettingActivity : BaseActivity() {
lateinit var deliverylist_fragment: DeliveryFragment
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_delivery) setContentView(R.layout.activity_delivery)
deliverylist_fragment = supportFragmentManager.findFragmentById(R.id.deliverylist_fragment) as DeliveryFragment
top_bar_delivery.setTitle("備送設置") top_bar_delivery.setTitle("備送設置")
top_bar_delivery.setBackgroundColor(resources.getColor(R.color.theme_color)) top_bar_delivery.setBackgroundColor(resources.getColor(R.color.theme_color))
top_bar_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() } top_bar_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { finish() }
top_bar_delivery.addRightImageButton(R.drawable.ic_add, R.id.topbar_right_change_button).setOnClickListener { v -> top_bar_delivery.addRightImageButton(R.drawable.ic_add, R.id.topbar_right_change_button).setOnClickListener { v ->
supportFragmentManager.beginTransaction().replace(R.id.fl_delivery, UpdateDeliveryFragment.newInstance(null)).addToBackStack(null).commit() supportFragmentManager.beginTransaction().add(R.id.fl_delivery, UpdateDeliveryFragment.newInstance(null)).addToBackStack(null).commit()
} }
} }
...@@ -26,5 +29,9 @@ class DeliverySettingActivity : BaseActivity() { ...@@ -26,5 +29,9 @@ class DeliverySettingActivity : BaseActivity() {
supportFragmentManager.beginTransaction().replace(R.id.fl_delivery, UpdateDeliveryFragment.newInstance(info)).addToBackStack(null).commit() supportFragmentManager.beginTransaction().replace(R.id.fl_delivery, UpdateDeliveryFragment.newInstance(info)).addToBackStack(null).commit()
} }
fun queryList() {
deliverylist_fragment.queryList()
}
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ import android.media.SoundPool ...@@ -13,6 +13,7 @@ import android.media.SoundPool
import android.os.Build import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.os.IBinder import android.os.IBinder
import android.util.Log
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
...@@ -256,6 +257,7 @@ class OtherOrderActivity : BaseActivity() { ...@@ -256,6 +257,7 @@ class OtherOrderActivity : BaseActivity() {
bind.setOnPostCallBack(object : GetInfoUpdateService.PostCallBack { bind.setOnPostCallBack(object : GetInfoUpdateService.PostCallBack {
override fun callBack(type: Int) { override fun callBack(type: Int) {
//-1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知" //-1斷開連接,\n-2:消息傳輸錯誤,\n0:連接消息,\n1:登錄通知,\n2:登出通知,\n3:外賣送單通知,\n4:自取送單通知,\n5:歷史訂單通知,\n6:修改訂單狀態通知,\n7:支付成功通知"
Log.e("eee", "消息:$type")
if (type == 3 || type == 4 || type == 5 if (type == 3 || type == 4 || type == 5
|| type == 6 || type == 7) { || type == 6 || type == 7) {
//播放提示音 //播放提示音
......
...@@ -4,6 +4,7 @@ import android.content.Context ...@@ -4,6 +4,7 @@ import android.content.Context
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import androidx.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
...@@ -38,7 +39,7 @@ class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.D ...@@ -38,7 +39,7 @@ class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.D
deliveryDifference = it.lackPrice.toString() deliveryDifference = it.lackPrice.toString()
} }
} }
helper.getView<TextView>(R.id.iv_delete).setOnClickListener { helper.getView<ImageView>(R.id.iv_delete).setOnClickListener {
onItemChildClickListener?.onItemChildClick(this, it, helper.adapterPosition) onItemChildClickListener?.onItemChildClick(this, it, helper.adapterPosition)
} }
helper.itemView.setOnClickListener { helper.itemView.setOnClickListener {
...@@ -47,7 +48,6 @@ class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.D ...@@ -47,7 +48,6 @@ class DeliveryListAdapter(val context: Context, data: List<DeliveryConfig.Data.D
} }
} }
class ViewHolder(itemView: View) : BaseViewHolder(itemView) { class ViewHolder(itemView: View) : BaseViewHolder(itemView) {
var binding: ItemDeliveryLayoutBinding = DataBindingUtil.bind(itemView)!! var binding: ItemDeliveryLayoutBinding = DataBindingUtil.bind(itemView)!!
} }
......
...@@ -7,14 +7,10 @@ import com.gingersoft.gsa.other_order_mode.R ...@@ -7,14 +7,10 @@ import com.gingersoft.gsa.other_order_mode.R
class TextAdapter(list: List<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview, list) { class TextAdapter(list: List<String>) : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_textview, list) {
override fun convert(helper: BaseViewHolder?, item: String?) { override fun convert(helper: BaseViewHolder?, item: String?) {
helper?.setText(R.id.tv_item, item) helper?.setText(R.id.tv_item, item)
helper?.itemView!!.setOnClickListener { helper?.itemView!!.setOnClickListener {
if (onItemClickListener != null) { if (onItemClickListener != null) {
onItemClickListener.onItemClick(this, it, helper.adapterPosition) onItemClickListener.onItemClick(this, it, helper.adapterPosition)
} }
} }
} }
} }
\ No newline at end of file
...@@ -9,14 +9,17 @@ import androidx.fragment.app.Fragment ...@@ -9,14 +9,17 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.gingersoft.gsa.cloud.base.application.GsaCloudApplication 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.R
import com.gingersoft.gsa.other_order_mode.model.viewModel.DeliveryViewModel 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.activity.DeliverySettingActivity
import com.gingersoft.gsa.other_order_mode.ui.adapter.DeliveryListAdapter 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.InjectorUtil
import kotlinx.android.synthetic.main.fragment_delivery_list.* import kotlinx.android.synthetic.main.fragment_delivery_list.*
import kotlin.math.max
class DeliveryFragment : Fragment() { class DeliveryFragment : BaseFragment() {
companion object { companion object {
fun newInstance() = DeliveryFragment() fun newInstance() = DeliveryFragment()
...@@ -35,31 +38,47 @@ class DeliveryFragment : Fragment() { ...@@ -35,31 +38,47 @@ class DeliveryFragment : Fragment() {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java] viewModel = ViewModelProvider(activity?.viewModelStore!!, InjectorUtil.getDeliveryFactory())[DeliveryViewModel::class.java]
viewModel.queryDeliveryList(GsaCloudApplication.getRestaurantId(activity!!).toString()) { queryList()
}
fun queryList() {
viewModel.queryDeliveryList(GsaCloudApplication.getRestaurantId(activity!!).toString()) { it ->
if (it?.data?.list != null && it.data.list.isNotEmpty()) { if (it?.data?.list != null && it.data.list.isNotEmpty()) {
if (deliveryListAdapter == null) { if (deliveryListAdapter == null) {
deliveryListAdapter = DeliveryListAdapter(context!!, it.data.list) deliveryListAdapter = DeliveryListAdapter(context!!, it.data.list)
deliveryListAdapter!!.setOnItemChildClickListener { adapter, view, position ->
when (view.id) {
R.id.iv_delete -> {
}//刪除
else -> {
(activity as DeliverySettingActivity).editDelivery(it.data.list[position])
}//查看詳情---編輯
}
}
rv_delivery.adapter = deliveryListAdapter rv_delivery.adapter = deliveryListAdapter
rv_delivery.layoutManager = LinearLayoutManager(context!!) rv_delivery.layoutManager = LinearLayoutManager(context!!)
} else { } else {
deliveryListAdapter!!.setNewData(it.data.list) deliveryListAdapter!!.setNewData(it.data.list)
} }
rv_delivery.visibility = View.VISIBLE deliveryListAdapter!!.setOnItemChildClickListener { adapter, view, position ->
when (view.id) {
R.id.iv_delete -> {
AppDialog.showWaringDialog(context, "是否確認刪除") { view, dialog ->
showLoading()
it.data.list[position].apply {
viewModel.updateDeliveryConfig(distributionFeeMin.toString(), distributionFeeMax.toString(), distributionFee.toString(), deliveryCost.toString(), distributionType, type, desc, id, GsaCloudApplication.getMemberId(context), lackPrice.toString(), 1) {
dialog.dismiss()
cancelDialogForLoading()
queryList()
}
}
}
}//刪除
else -> {
(activity as DeliverySettingActivity).editDelivery(it.data.list[position])
}//查看詳情---編輯
}
}
rv_delivery?.let {
it.visibility = View.VISIBLE
}
} else { } else {
rv_delivery.visibility = View.GONE rv_delivery?.let {
it.visibility = View.GONE
}
} }
} }
// rv_delivery
} }
} }
...@@ -42,8 +42,8 @@ class PlaceholderFragment : BaseFragment() { ...@@ -42,8 +42,8 @@ class PlaceholderFragment : BaseFragment() {
// 觸發刷新,判斷是否更新 // 觸發刷新,判斷是否更新
// 並且type一致 // 並且type一致
//如果當前fragment的狀態中包含需要刷新的狀態,獲取數據 //如果當前fragment的狀態中包含需要刷新的狀態,獲取數據
Log.e("eee", "$it,當前fragment的" + PageViewModel.fragmentStatus[arguments?.getInt(INDEX)!!]) Log.e("eee", "是否顯示:$isHidden + $it,當前fragment的" + PageViewModel.fragmentStatus[arguments?.getInt(INDEX)!!])
if (PageViewModel.fragmentStatus[arguments?.getInt(INDEX)!!].contains(it.toString())) { if (PageViewModel.fragmentStatus[arguments?.getInt(INDEX)!!].contains(it.toString()) || !isHidden) {
page = 1 page = 1
getOrderList(this, false) getOrderList(this, false)
} }
......
...@@ -8,10 +8,14 @@ import androidx.fragment.app.Fragment ...@@ -8,10 +8,14 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView 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.R
import com.gingersoft.gsa.other_order_mode.data.model.bean.DeliveryConfig 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.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.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.other_order_mode.util.InjectorUtil
import com.jess.arms.utils.ArmsUtils import com.jess.arms.utils.ArmsUtils
import com.qmuiteam.qmui.util.QMUIDisplayHelper import com.qmuiteam.qmui.util.QMUIDisplayHelper
...@@ -21,7 +25,7 @@ import com.zhy.autolayout.utils.ScreenUtils ...@@ -21,7 +25,7 @@ import com.zhy.autolayout.utils.ScreenUtils
import kotlinx.android.synthetic.main.update_delivery_fragment.* import kotlinx.android.synthetic.main.update_delivery_fragment.*
import org.w3c.dom.Text import org.w3c.dom.Text
class UpdateDeliveryFragment : Fragment() { class UpdateDeliveryFragment : BaseFragment() {
companion object { companion object {
private const val info = "info" private const val info = "info"
...@@ -47,7 +51,10 @@ class UpdateDeliveryFragment : Fragment() { ...@@ -47,7 +51,10 @@ class UpdateDeliveryFragment : Fragment() {
var pop: QMUIPopup? = null var pop: QMUIPopup? = null
var deliveryType = arrayListOf("短途送", "中途送", "長途送") var deliveryType = arrayListOf("短途送", "中途送", "長途送")
var deliveryMethod = arrayListOf("本店備送", "第三方") var deliveryMethod = arrayListOf("本店備送", "第三方")
var deliveryTypeTag = arrayListOf("SHORT_RANGE", "STANDARD", "LONG_DISTANCE")
var selectDeliveryType = deliveryTypeTag[0]//用戶當前選中的配送類型
var selectDeliveryMethodPosition = 0
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState) super.onActivityCreated(savedInstanceState)
...@@ -58,28 +65,33 @@ class UpdateDeliveryFragment : Fragment() { ...@@ -58,28 +65,33 @@ class UpdateDeliveryFragment : Fragment() {
top_bar_update_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { activity?.let { it.onBackPressed() } } top_bar_update_delivery.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener { activity?.let { it.onBackPressed() } }
deliveryConfig = arguments?.getSerializable(info) as DeliveryConfig.Data.DeliveryInfo? deliveryConfig = arguments?.getSerializable(info) as DeliveryConfig.Data.DeliveryInfo?
//初始化默認備送類型
tv_delivery_type.text = deliveryType[0]
tv_delivery_method.text = deliveryMethod[selectDeliveryMethodPosition]
//如果數據不為空,那麼就是編輯,初始化數據
deliveryConfig?.let { deliveryConfig?.let {
//如果不為空,初始化數據
et_min_delivery_fee.setText(it.distributionFeeMin.toString()) et_min_delivery_fee.setText(it.distributionFeeMin.toString())
et_max_delivery_fee.setText(it.distributionFeeMax.toString()) et_max_delivery_fee.setText(it.distributionFeeMax.toString())
ed_delivery_fee.setText(it.distributionFee.toString()) ed_delivery_fee.setText(it.distributionFee.toString())
ed_start_delivery_fee.setText(it.distributionFee.toString()) ed_start_delivery_fee.setText(it.deliveryCost.toString())
ed_difference_fee.setText(it.lackPrice.toString()) ed_difference_fee.setText(it.lackPrice.toString())
ed_desc.setText(it.desc) ed_desc.setText(it.desc)
//備送類型 //備送類型
tv_delivery_type.text = when (it.distributionType) { if (deliveryTypeTag.indexOf(it.distributionType) != -1) {
"LONG_DISTANCE" -> "長途送" tv_delivery_type.text = deliveryType[deliveryTypeTag.indexOf(it.distributionType)]
"SHORT_RANGE" -> "短途送"
"STANDARD" -> "中途送"
else -> ""
} }
selectDeliveryType = it.distributionType
//備送方式 //備送方式
tv_delivery_method.text = when (it.type) { tv_delivery_method.text = when (it.type) {
0 -> "本店備送" 0 -> "本店備送"
1 -> "第三方" 1 -> "第三方"
else -> "" else -> ""
} }
selectDeliveryMethodPosition = it.type
} }
layout_delivery_type.setOnClickListener { layout_delivery_type.setOnClickListener {
//修改備送類型 //修改備送類型
showPopup(it, deliveryType) showPopup(it, deliveryType)
...@@ -92,7 +104,54 @@ class UpdateDeliveryFragment : Fragment() { ...@@ -92,7 +104,54 @@ class UpdateDeliveryFragment : Fragment() {
btn_save_delivery.setOnClickListener { btn_save_delivery.setOnClickListener {
//保存 //保存
if (et_min_delivery_fee.text.isEmpty()) {
ToastUtils.show(context, "請輸入最小運費值")
return@setOnClickListener
}
if (et_max_delivery_fee.text.isEmpty()) {
ToastUtils.show(context, "請輸入最大運費值")
return@setOnClickListener
}
if (ed_delivery_fee.text.isEmpty()) {
ToastUtils.show(context, "請輸入配送費")
return@setOnClickListener
}
if (ed_start_delivery_fee.text.isEmpty()) {
ToastUtils.show(context, "請輸入起送費")
return@setOnClickListener
}
showLoading()
if (deliveryConfig == null) {
//新增
viewModel.addDeliveryConfig(et_min_delivery_fee.text.toString(), et_max_delivery_fee.text.toString(), ed_delivery_fee.text.toString(), ed_start_delivery_fee.text.toString(), selectDeliveryType, selectDeliveryMethodPosition,
ed_desc.text.toString(), GsaCloudApplication.getRestaurantId(context), GsaCloudApplication.getMemberId(context), ed_difference_fee.text.toString()) { it ->
cancelDialogForLoading()
if (it != null && it.success) {
ToastUtils.show(context, "保存成功")
(activity as DeliverySettingActivity).let {
it.queryList()
it.onBackPressed()
}
} else {
ToastUtils.show(context, "保存失敗")
}
}
} else {
//編輯
viewModel.updateDeliveryConfig(et_min_delivery_fee.text.toString(), et_max_delivery_fee.text.toString(), ed_delivery_fee.text.toString(), ed_start_delivery_fee.text.toString(), selectDeliveryType, selectDeliveryMethodPosition,
ed_desc.text.toString(), deliveryConfig!!.id, GsaCloudApplication.getMemberId(context), ed_difference_fee.text.toString(), 0) { it ->
cancelDialogForLoading()
if (it != null && it.success) {
ToastUtils.show(context, "修改成功")
(activity as DeliverySettingActivity).let {
it.queryList()
it.onBackPressed()
}
} else {
ToastUtils.show(context, "修改失敗")
}
}
}
} }
} }
...@@ -105,20 +164,6 @@ class UpdateDeliveryFragment : Fragment() { ...@@ -105,20 +164,6 @@ class UpdateDeliveryFragment : Fragment() {
adapter = TextAdapter(list) adapter = TextAdapter(list)
listView.layoutParams.width = (ArmsUtils.getScreenWidth(context) * 0.7).toInt() listView.layoutParams.width = (ArmsUtils.getScreenWidth(context) * 0.7).toInt()
adapter!!.setOnItemChildClickListener { adapter, view, position ->
when (it.id) {
R.id.layout_delivery_type -> {
//修改備送類型
tv_delivery_type.text = list[position]
}
R.id.layout_delivery_method -> {
//修改備送方式
tv_delivery_method.text = list[position]
}
}
}
listView.adapter = adapter listView.adapter = adapter
pop = QMUIPopups.popup(context) pop = QMUIPopups.popup(context)
...@@ -135,6 +180,23 @@ class UpdateDeliveryFragment : Fragment() { ...@@ -135,6 +180,23 @@ class UpdateDeliveryFragment : Fragment() {
adapter!!.setNewData(list) adapter!!.setNewData(list)
pop!!.show(it) pop!!.show(it)
} }
adapter?.setOnItemClickListener { adapter, view, position ->
when (it.id) {
R.id.layout_delivery_type -> {
//修改備送類型
tv_delivery_type.text = list[position]
selectDeliveryType = deliveryTypeTag[position]
}
R.id.layout_delivery_method -> {
//修改備送方式
tv_delivery_method.text = list[position]
selectDeliveryMethodPosition = position
}
}
pop!!.dismiss()
}
} }
} }
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="@dimen/dp_1"
android:color="@color/black" />
</shape>
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
app:qmui_topbar_title_color="@color/theme_white_color" /> app:qmui_topbar_title_color="@color/theme_white_color" />
<fragment <fragment
android:id="@+id/deliverylist_fragment"
android:name="com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment" android:name="com.gingersoft.gsa.other_order_mode.ui.fragment.DeliveryFragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
android:text="@string/delivery_difference" android:text="@string/delivery_difference"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
android:visibility="gone"
app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text" app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_method_text" /> app:layout_constraintTop_toBottomOf="@id/tv_delivery_method_text" />
...@@ -147,15 +148,20 @@ ...@@ -147,15 +148,20 @@
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="left" android:gravity="left"
android:text="@{delivery_difference}" android:text="@{delivery_difference}"
android:visibility="gone"
app:layout_constraintLeft_toRightOf="@id/bar_delivery" app:layout_constraintLeft_toRightOf="@id/bar_delivery"
app:layout_constraintRight_toLeftOf="@id/iv_edit" app:layout_constraintRight_toLeftOf="@id/iv_edit"
app:layout_constraintTop_toTopOf="@id/tv_difference_text" /> app:layout_constraintTop_toTopOf="@id/tv_difference_text" />
<TextView <ImageView
android:id="@+id/iv_edit" android:id="@+id/iv_edit"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:src="@drawable/ic_edit"
android:text="編輯" android:text="編輯"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12" android:textSize="@dimen/dp_12"
...@@ -163,11 +169,15 @@ ...@@ -163,11 +169,15 @@
app:layout_constraintRight_toLeftOf="@id/iv_delete" app:layout_constraintRight_toLeftOf="@id/iv_delete"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <ImageView
android:id="@+id/iv_delete" android:id="@+id/iv_delete"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:gravity="center"
android:paddingLeft="@dimen/dp_5"
android:paddingRight="@dimen/dp_5"
android:src="@drawable/ic_delete_bill_method"
android:text="刪除" android:text="刪除"
android:textColor="@color/theme_333_color" android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_12" android:textSize="@dimen/dp_12"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_item" android:id="@+id/tv_item"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_20" android:layout_marginLeft="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_20" android:layout_marginRight="@dimen/dp_20"
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/color_f6" android:background="@color/color_f6"
android:clickable="true"
android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
tools:context=".ui.fragment.UpdateDeliveryFragment"> tools:context=".ui.fragment.UpdateDeliveryFragment">
...@@ -26,8 +28,9 @@ ...@@ -26,8 +28,9 @@
<TextView <TextView
style="@style/otherOrderInfoDialogTextStyle" style="@style/otherOrderInfoDialogTextStyle"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:text="運費範圍:" /> android:text="運費範圍:" />
<EditText <EditText
...@@ -35,13 +38,19 @@ ...@@ -35,13 +38,19 @@
style="@style/otherOrderInfoDialogTextStyle" style="@style/otherOrderInfoDialogTextStyle"
android:layout_width="@dimen/dp_50" android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@color/trans" android:background="@drawable/shape_black_border"
android:inputType="number" /> android:gravity="right|center_vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:inputType="numberDecimal"
android:maxLines="1" />
<TextView <TextView
style="@style/otherOrderInfoDialogTextStyle" style="@style/otherOrderInfoDialogTextStyle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:text="——" /> android:text="——" />
<EditText <EditText
...@@ -49,8 +58,13 @@ ...@@ -49,8 +58,13 @@
style="@style/otherOrderInfoDialogTextStyle" style="@style/otherOrderInfoDialogTextStyle"
android:layout_width="@dimen/dp_50" android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@color/trans" android:layout_marginRight="@dimen/dp_20"
android:inputType="number" /> android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:background="@drawable/shape_black_border"
android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:maxLines="1" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -59,6 +73,7 @@ ...@@ -59,6 +73,7 @@
android:layout_marginTop="@dimen/dp_2" android:layout_marginTop="@dimen/dp_2"
android:background="@color/white" android:background="@color/white"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/dp_10"> android:paddingLeft="@dimen/dp_10">
...@@ -74,8 +89,10 @@ ...@@ -74,8 +89,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@color/trans" android:background="@color/trans"
android:inputType="number" /> android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:maxLines="1"
android:paddingRight="@dimen/dp_20" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -100,7 +117,10 @@ ...@@ -100,7 +117,10 @@
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:layout_weight="0.7" android:layout_weight="0.7"
android:background="@color/trans" android:background="@color/trans"
android:inputType="number" /> android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:maxLines="1"
android:paddingRight="@dimen/dp_20" />
</LinearLayout> </LinearLayout>
...@@ -131,7 +151,6 @@ ...@@ -131,7 +151,6 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:src="@drawable/ic_black_next_arrow" /> android:src="@drawable/ic_black_next_arrow" />
</LinearLayout> </LinearLayout>
...@@ -163,7 +182,6 @@ ...@@ -163,7 +182,6 @@
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:src="@drawable/ic_black_next_arrow" /> android:src="@drawable/ic_black_next_arrow" />
</LinearLayout> </LinearLayout>
...@@ -188,7 +206,11 @@ ...@@ -188,7 +206,11 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@color/trans" android:background="@color/trans"
android:inputType="number" /> android:gravity="right|center_vertical"
android:inputType="numberDecimal"
android:maxLines="1"
android:paddingRight="@dimen/dp_20"
android:text="0" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -211,10 +233,10 @@ ...@@ -211,10 +233,10 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@color/trans" android:background="@color/trans"
android:inputType="number" /> android:gravity="right|center_vertical"
android:paddingRight="@dimen/dp_20" />
</LinearLayout> </LinearLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton <com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id="@+id/btn_save_delivery" android:id="@+id/btn_save_delivery"
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -92,4 +92,7 @@ ...@@ -92,4 +92,7 @@
<item name="android:textSize">@dimen/dp_14</item> <item name="android:textSize">@dimen/dp_14</item>
</style> </style>
<style name="otherOrder_delivery_setting_layout_style">
<item name="android:paddingRight">@dimen/dp_20</item>
</style>
</resources> </resources>
...@@ -207,12 +207,12 @@ public class PrintOtherOrder extends PrinterRoot { ...@@ -207,12 +207,12 @@ public class PrintOtherOrder extends PrinterRoot {
if (data.getDELIVERY_CHARGE() != 0) { if (data.getDELIVERY_CHARGE() != 0) {
billData.add(getBillBean("送貨費:", amountUnit + data.getDELIVERY_CHARGE())); billData.add(getBillBean("送貨費:", amountUnit + data.getDELIVERY_CHARGE()));
} }
if (data.getDiscount_amount() != 0) { // if (data.getDiscount_amount() != 0) {
billData.add(getBillBean("折扣:", "-" + amountUnit + data.getDiscount_amount())); // billData.add(getBillBean("折扣:", "-" + amountUnit + data.getDiscount_amount()));
} // }
if (data.getCouponList() != null && data.getCouponList().size() > 0) { if (data.getCouponList() != null && data.getCouponList().size() > 0) {
for (OrderDetails.DataBean.CouponBean coupon : data.getCouponList()) { for (OrderDetails.DataBean.CouponBean coupon : data.getCouponList()) {
billData.add(getBillBean(coupon.getCouponName(), "-$" + coupon.getDiscount_amount())); billData.add(getBillBean(coupon.getCouponName() + ":", "-$" + coupon.getDiscount_amount()));
} }
} }
billData.add(getBillBean("總金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount()))); billData.add(getBillBean("總金額:", amountUnit + MoneyUtil.sub(Double.parseDouble(data.getTOTAL_AMOUNT()), data.getDiscount_amount())));
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<style name="AppTheme.Launcher"> <style name="AppTheme.Launcher">
<item name="android:windowFullscreen">true</item> <item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@drawable/launcher_bg</item> <!-- <item name="android:windowBackground">@drawable/launcher_bg</item>-->
</style> </style>
<!-- blue skin --> <!-- blue skin -->
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M6.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
android:id="@+id/iv_icon" android:id="@+id/iv_icon"
android:layout_width="@dimen/dp_25" android:layout_width="@dimen/dp_25"
android:layout_height="@dimen/dp_25" android:layout_height="@dimen/dp_25"
android:layout_marginTop="@dimen/dp_5" android:layout_marginTop="@dimen/dp_5" />
android:src="@mipmap/ic_launcher_round" />
<TextView <TextView
android:id="@+id/tv_name" android:id="@+id/tv_name"
......
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