Commit 2588c6c2 by Wyh

1、保留供應鏈代碼

parent 2e0ed8c7
/build
\ No newline at end of file
ext.mainApp = true //设置为true,表示此module为主app module,一直以application方式编译
apply from: rootProject.file("cc-settings.gradle")
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'com.didi.dokit'
android {
signingConfigs {
GSAndroidNew {
keyAlias 'keycypos'
keyPassword 'qingkeke'
storeFile file('cyposandroid.keyset')
storePassword 'qingkeke'
}
}
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
applicationId 'com.gingersoft.gsa.cloud'
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
multiDexEnabled true
}
resourcePrefix "user_login"
bundle {
density {
// Different APKs are generated for devices with different screen densities; true by default.
enableSplit true
}
abi {
// Different APKs are generated for devices with different CPU architectures; true by default.
enableSplit true
}
language {
// This is disabled so that the App Bundle does NOT split the APK for each language.
// We're gonna use the same APK for all languages.
enableSplit true
}
}
buildTypes {
debug {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
minifyEnabled false
proguardFiles 'proguard.cfg'
signingConfig signingConfigs.GSAndroidNew
}
release {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["releaseLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["releaseUseCanary"]
minifyEnabled false
zipAlignEnabled false
proguardFiles 'proguard.cfg'
signingConfig signingConfigs.GSAndroidNew
}
}
lintOptions {
abortOnError false
}
dataBinding {
enabled = true
}
//修改生成的apk名字
applicationVariants.all { variant ->
variant.outputs.all {
def fileName
def date = new Date()
def formattedDate = date.format('yyyy-MM-dd')
if (variant.buildType.name == 'release') {
fileName = "正式版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
} else if (variant.buildType.name == 'debug') {
fileName = "测试版_GSA-Cloud_${variant.mergedFlavor.versionName}_${formattedDate}.apk"
}
outputFileName = fileName
}
}
dexOptions {
// incremental true
javaMaxHeapSize "4g"
}
}
//dokit 扩展
dokitExt {
//通用设置
comm {
//地图经纬度开关
gpsSwitch true
//网络开关
networkSwitch true
//大图开关
bigImgSwitch true
//webView js 抓包
webViewSwitch true
}
slowMethod {
//调用栈模式配置
stackMethod {
//默认值为 5ms 小于该值的函数在调用栈中不显示
thresholdTime 5
//调用栈函数入口
enterMethods = ["com.didichuxing.doraemondemo.MainDebugActivity.test1"]
//黑名单 粒度最小到类 暂不支持到方法
methodBlacklist = ["com.facebook.drawee.backends.pipeline.Fresco"]
}
//普通模式配置
normalMethod {
//默认值为 500ms 小于该值的函数在运行时不会在控制台中被打印
thresholdTime 100
//需要针对函数插装的包名
packageNames = ["com.didichuxing.doraemondemo"]
//不需要针对函数插装的包名和类名
methodBlacklist = ["com.didichuxing.doraemondemo.dokit"]
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
addComponent 'component-main'
addComponent 'component-download'
addComponent 'component-table'
addComponent 'component-print'
addComponent 'component-delivery-pick'
addComponent 'component-manager'
addComponent 'component-coldchain'
addComponent 'component-supply-chain'
addComponent 'component-webview'
addComponent 'component-scan'
addComponent 'component-pay'
implementation rootProject.ext.dependencies["viewpager2"]
annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
implementation rootProject.ext.dependencies["autosize"]
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.gsa_cloud2">
<!-- <application-->
<!-- android:allowBackup="true"-->
<!-- android:icon="@mipmap/ic_launcher"-->
<!-- android:label="@string/app_name"-->
<!-- android:roundIcon="@mipmap/ic_launcher_round"-->
<!-- android:supportsRtl="true"-->
<!-- android:theme="@style/AppTheme">-->
<!-- <activity android:name=".MainActivity">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<!-- </application>-->
</manifest>
\ 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:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
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="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<LinerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</LinerLayout>
\ 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
<?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"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">GSA-Cloud2</string>
</resources>
\ No newline at end of file
<resources>
<!-- &lt;!&ndash; Base application theme. &ndash;&gt;-->
<!-- <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">-->
<!-- &lt;!&ndash; Customize your theme here. &ndash;&gt;-->
<!-- <item name="colorPrimary">@color/colorPrimary</item>-->
<!-- <item name="colorPrimaryDark">@color/colorPrimaryDark</item>-->
<!-- <item name="colorAccent">@color/colorAccent</item>-->
<!-- </style>-->
</resources>
\ No newline at end of file
...@@ -8,7 +8,6 @@ project.apply plugin: 'cc-register' ...@@ -8,7 +8,6 @@ project.apply plugin: 'cc-register'
project.dependencies.add('api', project(':cc')) //用最新版 project.dependencies.add('api', project(':cc')) //用最新版
//project.dependencies.add('api', "com.billy.android:cc:2.1.6") //用最新版 //project.dependencies.add('api', "com.billy.android:cc:2.1.6") //用最新版
dependencies { dependencies {
switch (project.name){ switch (project.name){
case 'library-base': case 'library-base':
......
apply from: rootProject.file("cc-settings.gradle")
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// 避免 lint 检测出错时停止构建
lintOptions {
abortOnError false
}
defaultConfig {
if (project.ext.runAsApp) {
applicationId "com.gingersoft.coldchain_module"
}
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dataBinding {
enabled = true
}
// viewBinding {
// enabled = true
// }
resourcePrefix "coldChain"
buildTypes {
debug {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
minifyEnabled false
proguardFiles 'proguard.cfg'
}
release {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["releaseLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["releaseUseCanary"]
minifyEnabled false
zipAlignEnabled false
proguardFiles 'proguard.cfg'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
kapt rootProject.ext.dependencies["dagger2-compiler"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapter"]
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.coldchain_module">
<application>
<activity
android:name=".mvp.ui.activity.OrderDetailsActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".mvp.ui.activity.SupplementOrderActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".mvp.ui.activity.ColdChainMainActivity"
android:screenOrientation="portrait"/>
<!-- arms配置 -->
<meta-data
android:name="com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
</application>
</manifest>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.coldchain_module">
<!-- 8.0必要权限 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- 8.0必要权限 -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<application
android:name="com.gingersoft.gsa.cloud.app.GsaCloudApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_android">
<activity android:name=".mvp.ui.activity.OrderDetailsActivity" />
<activity android:name=".mvp.ui.activity.SupplementOrderActivity" />
<activity android:name=".mvp.ui.activity.ColdChainMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.gingersoft.coldchain_module;
import com.billy.cc.core.component.CC;
import com.jess.arms.base.BaseApplication;
/**
* Created by Wyh on 2020/1/7.
*/
public class MyApp extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
CC.enableVerboseLog(true);
CC.enableDebug(true);
CC.enableRemoteCC(true);
}
}
<resources>
<string name="app_name">凍鏈</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="user_register_AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
\ No newline at end of file
package com.gingersoft.coldchain_module;
import com.billy.cc.core.component.CC;
import com.billy.cc.core.component.CCResult;
import com.billy.cc.core.component.CCUtil;
import com.billy.cc.core.component.IComponent;
import com.gingersoft.coldchain_module.mvp.ui.activity.ColdChainMainActivity;
import com.gingersoft.gsa.cloud.component.ComponentName;
public class ComponentColdChain implements IComponent {
@Override
public String getName() {
//组件的名称,调用此组件的方式:
// CC.obtainBuilder("ComponentA")...build().callAsync()
return ComponentName.COMPONENT_COLDCHAIN;
}
/**
* 组件被调用时的入口
* 要确保每个逻辑分支都会调用到CC.sendCCResult,
* 包括try-catch,if-else,switch-case-default,startActivity
*
* @param cc 组件调用对象,可从此对象中获取相关信息
* @return true:将异步调用CC.sendCCResult(...),用于异步实现相关功能,例如:文件加载、网络请求等
* false:会同步调用CC.sendCCResult(...),即在onCall方法return之前调用,否则将被视为不合法的实现
*/
@Override
public boolean onCall(CC cc) {
String actionName = cc.getActionName();
switch (actionName) {
case "Component.ColdChain":
openActivity(cc);
break;
default:
//这个逻辑分支上没有调用CC.sendCCResult(...),是一种错误的示例
//并且方法的返回值为false,代表不会异步调用CC.sendCCResult(...)
//在LocalCCInterceptor中将会返回错误码为-10的CCResult
break;
}
return false;
}
private void getInfo(CC cc) {
String userName = "billy";
CC.sendCCResult(cc.getCallId(), CCResult.success("userName", userName));
}
private void openActivity(CC cc) {
CCUtil.navigateTo(cc, ColdChainMainActivity.class);
CC.sendCCResult(cc.getCallId(), CCResult.success());
}
}
package com.gingersoft.coldchain_module.di.component;
import com.gingersoft.coldchain_module.di.module.ColdChainMainModule;
import com.gingersoft.coldchain_module.mvp.ui.activity.ColdChainMainActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Component;
@ActivityScope
@Component(modules = ColdChainMainModule.class, dependencies = AppComponent.class)
public interface ColdChainMainComponent {
void inject(ColdChainMainActivity activity);
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.component;
import com.gingersoft.coldchain_module.di.module.OrderDetailsModule;
import com.gingersoft.coldchain_module.mvp.ui.activity.OrderDetailsActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Component;
@ActivityScope
@Component(modules = OrderDetailsModule.class, dependencies = AppComponent.class)
public interface OrderDetailsComponent {
void inject(OrderDetailsActivity activity);
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.component;
import com.gingersoft.coldchain_module.di.module.OrderListModule;
import com.gingersoft.coldchain_module.mvp.ui.fragment.OrderListFragment;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Component;
@FragmentScope
@Component(modules = OrderListModule.class, dependencies = AppComponent.class)
public interface OrderListComponent {
void inject(OrderListFragment fragment);
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.component;
import com.gingersoft.coldchain_module.di.module.SupplementOrderModule;
import com.gingersoft.coldchain_module.mvp.ui.activity.SupplementOrderActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Component;
@ActivityScope
@Component(modules = SupplementOrderModule.class, dependencies = AppComponent.class)
public interface SupplementOrderComponent {
void inject(SupplementOrderActivity activity);
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.module;
import com.gingersoft.coldchain_module.mvp.contract.ColdChainMainContract;
import com.gingersoft.coldchain_module.mvp.model.ColdChainMainModel;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Module;
import dagger.Provides;
@Module
public class ColdChainMainModule {
private ColdChainMainContract.View view;
/**
* 构建MainModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
*
* @param view
*/
public ColdChainMainModule(ColdChainMainContract.View view) {
this.view = view;
}
@ActivityScope
@Provides
ColdChainMainContract.View provideMainView() {
return this.view;
}
@ActivityScope
@Provides
ColdChainMainContract.Model provideMainModel(ColdChainMainModel model) {
return model;
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.module;
import com.gingersoft.coldchain_module.mvp.contract.OrderDetailsContract;
import com.gingersoft.coldchain_module.mvp.model.OrderDetailsModel;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Module;
import dagger.Provides;
@Module
public class OrderDetailsModule {
private OrderDetailsContract.View view;
/**
* 构建OrderDetailsModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
*
* @param view
*/
public OrderDetailsModule(OrderDetailsContract.View view) {
this.view = view;
}
@ActivityScope
@Provides
OrderDetailsContract.View provideOrderDetailsView() {
return this.view;
}
@ActivityScope
@Provides
OrderDetailsContract.Model provideOrderDetailsModel(OrderDetailsModel model) {
return model;
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.module;
import com.gingersoft.coldchain_module.mvp.contract.OrderListContract;
import com.gingersoft.coldchain_module.mvp.model.OrderListModel;
import com.jess.arms.di.scope.FragmentScope;
import dagger.Module;
import dagger.Provides;
@Module
public class OrderListModule {
private OrderListContract.View view;
/**
* 构建OrderListModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
*
* @param view
*/
public OrderListModule(OrderListContract.View view) {
this.view = view;
}
@FragmentScope
@Provides
OrderListContract.View provideOrderListView() {
return this.view;
}
@FragmentScope
@Provides
OrderListContract.Model provideOrderListModel(OrderListModel model) {
return model;
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.di.module;
import com.gingersoft.coldchain_module.mvp.contract.SupplementOrderContract;
import com.gingersoft.coldchain_module.mvp.model.SupplementOrderModel;
import com.jess.arms.di.scope.ActivityScope;
import dagger.Module;
import dagger.Provides;
@Module
public class SupplementOrderModule {
private SupplementOrderContract.View view;
/**
* 构建SupplementOrderModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
*
* @param view
*/
public SupplementOrderModule(SupplementOrderContract.View view) {
this.view = view;
}
@ActivityScope
@Provides
SupplementOrderContract.View provideSupplementOrderView() {
return this.view;
}
@ActivityScope
@Provides
SupplementOrderContract.Model provideSupplementOrderModel(SupplementOrderModel model) {
return model;
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.constans;
public class ColdChainConstants {
public static final int orderType = 8;
//訂單狀態:已確認
public static final int ORDER_CONFIRMED = 2;
//本地定義常量
//物流已取消
public static final int LOGISTICS_CANCELLED = -2;
//訂單已取消
public static final int ORDER_CANCELLED = -3;
//訂單已讀
public static final int ORDER_READ = -4;
}
package com.gingersoft.coldchain_module.mvp.contract;
import com.gingersoft.coldchain_module.mvp.model.bean.BalanceBean;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.coldchain_module.mvp.model.bean.PickUpBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateRestaurantStateBean;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public interface ColdChainMainContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadNumber(SupplementInfoBean bean);
void loadBalance(double price, double bond,boolean isBlink);
void setRestaurantState(int state);
void refreshOrderState(long id);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存getOrderList(@Body RequestBody requestBody);
interface Model extends IModel {
Observable<OrderList> getOrderList(RequestBody requestBody);
Observable<SupplementInfoBean> getNumByOrderType(RequestBody requestBody);
Observable<PickUpBean> pickUp(RequestBody requestBody);
Observable<BalanceBean> getBalance(String brandId);
Observable<UpdateRestaurantStateBean> updateRestOpenStatus(RequestBody requestBody);
Observable<Object> updateExpandInfo(RequestBody requestBody);
Observable<OrderDetails> findOrderDetails(RequestBody requestBody);
Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody);
Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody);
Observable<BaseResult> addPrj(RequestBody requestBody);
Observable<BaseResult> getNotPrintedOrderList();
Observable<BaseResult> updatePrintOrderStatus(RequestBody requestBody);
}
}
package com.gingersoft.coldchain_module.mvp.contract;
import com.gingersoft.coldchain_module.mvp.model.bean.CancelLogisticsBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ReadBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.io.File;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public interface OrderDetailsContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadOrderDetails(OrderDetails.DataBean bean);
void printLogisticsList(File file);
void updateOrderState(int state);
void setPrintPdfState();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<OrderDetails> findOrderDetails(RequestBody requestBody);
Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody);
Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody);
Observable<CancelLogisticsBean> cancelLogistics(RequestBody requestBody);
Observable<ReadBean> setIsRead(RequestBody requestBody);
Observable<BaseResult> addPrj(RequestBody requestBody);
Observable<BaseResult> updatePrintPdfStatus(RequestBody requestBody);
Observable<BaseResult> updatePrintOrderStatus(RequestBody requestBody);
}
}
package com.gingersoft.coldchain_module.mvp.contract;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import java.util.List;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public interface OrderListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadOrderList(List<OrderList.DataBeanX.DataBean> data);
void notifyByPosition(int position, OrderList.DataBeanX.DataBean dataBean);
void removeItem(int position);
void loadOrderTotalNum(OrderList.DataBeanX.DataBean bean);
// void getOrderDetails(OrderDetails.DataBean dataBean);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<OrderList> getOrderList(RequestBody requestBody);
Observable<OrderDetails> findOrderDetails(RequestBody requestBody);
Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody);
Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody);
Observable<BaseResult> addPrj(RequestBody requestBody);
}
}
package com.gingersoft.coldchain_module.mvp.contract;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementResultBean;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;
import io.reactivex.Observable;
import okhttp3.RequestBody;
public interface SupplementOrderContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface View extends IView {
void loadNumber(SupplementInfoBean bean);
void submissionComplete();
void submissionFail();
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface Model extends IModel {
Observable<SupplementInfoBean> getNumByOrderType(RequestBody requestBody);
Observable<SupplementResultBean> submitOrder(RequestBody requestBody);
}
}
package com.gingersoft.coldchain_module.mvp.model;
import android.app.Application;
import com.gingersoft.coldchain_module.mvp.contract.ColdChainMainContract;
import com.gingersoft.coldchain_module.mvp.model.bean.BalanceBean;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.coldchain_module.mvp.model.bean.PickUpBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateRestaurantStateBean;
import com.gingersoft.coldchain_module.mvp.model.service.ColdChainService;
import com.gingersoft.coldchain_module.mvp.model.service.OrderDetailService;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
@ActivityScope
public class ColdChainMainModel extends BaseModel implements ColdChainMainContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public ColdChainMainModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
@Override
public Observable<OrderList> getOrderList(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).getOrderList(requestBody);
}
@Override
public Observable<SupplementInfoBean> getNumByOrderType(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).getNumByOrderType(requestBody);
}
@Override
public Observable<PickUpBean> pickUp(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).pickUp(requestBody);
}
@Override
public Observable<BalanceBean> getBalance(String brandId) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).getBalance(brandId);
}
@Override
public Observable<UpdateRestaurantStateBean> updateRestOpenStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).updateRestOpenStatus(requestBody);
}
@Override
public Observable<Object> updateExpandInfo(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).updateExpandInfo(requestBody);
}
@Override
public Observable<OrderDetails> findOrderDetails(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).findOrderDetails(requestBody);
}
@Override
public Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).thirdDelivery(requestBody);
}
@Override
public Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).gsUpdateOrderStatus(requestBody);
}
@Override
public Observable<BaseResult> addPrj(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).addPrj(requestBody);
}
@Override
public Observable<BaseResult> getNotPrintedOrderList() {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).getNotPrintedOrderList(RestaurantInfoManager.newInstance().getRestaurantId());
}
@Override
public Observable<BaseResult> updatePrintOrderStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).updatePrintOrderStatus(requestBody);
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.model;
import android.app.Application;
import com.gingersoft.coldchain_module.mvp.contract.OrderDetailsContract;
import com.gingersoft.coldchain_module.mvp.model.bean.CancelLogisticsBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ReadBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.coldchain_module.mvp.model.service.OrderDetailService;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
@ActivityScope
public class OrderDetailsModel extends BaseModel implements OrderDetailsContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public OrderDetailsModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
@Override
public Observable<OrderDetails> findOrderDetails(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).findOrderDetails(requestBody);
}
@Override
public Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).thirdDelivery(requestBody);
}
@Override
public Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).gsUpdateOrderStatus(requestBody);
}
@Override
public Observable<CancelLogisticsBean> cancelLogistics(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).cancelLogistics(requestBody);
}
@Override
public Observable<ReadBean> setIsRead(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).setIsRead(requestBody);
}
@Override
public Observable<BaseResult> addPrj(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).addPrj(requestBody);
}
@Override
public Observable<BaseResult> updatePrintPdfStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).updatePrintPdfStatus(requestBody);
}
@Override
public Observable<BaseResult> updatePrintOrderStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).updatePrintOrderStatus(requestBody);
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.model;
import android.app.Application;
import com.gingersoft.coldchain_module.mvp.contract.OrderListContract;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.coldchain_module.mvp.model.service.ColdChainService;
import com.gingersoft.coldchain_module.mvp.model.service.OrderDetailService;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import com.google.gson.Gson;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
@FragmentScope
public class OrderListModel extends BaseModel implements OrderListContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public OrderListModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
@Override
public Observable<OrderDetails> findOrderDetails(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).findOrderDetails(requestBody);
}
@Override
public Observable<OrderList> getOrderList(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).getOrderList(requestBody);
}
@Override
public Observable<ShipAnyOrdersNewBean> thirdDelivery(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).thirdDelivery(requestBody);
}
@Override
public Observable<UpdateOrderStatusBean> updateOrderStatus(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).gsUpdateOrderStatus(requestBody);
}
@Override
public Observable<BaseResult> addPrj(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(OrderDetailService.class).addPrj(requestBody);
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.model;
import android.app.Application;
import com.gingersoft.coldchain_module.mvp.contract.SupplementOrderContract;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementResultBean;
import com.gingersoft.coldchain_module.mvp.model.service.ColdChainService;
import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import javax.inject.Inject;
import io.reactivex.Observable;
import okhttp3.RequestBody;
@ActivityScope
public class SupplementOrderModel extends BaseModel implements SupplementOrderContract.Model {
@Inject
Gson mGson;
@Inject
Application mApplication;
@Inject
public SupplementOrderModel(IRepositoryManager repositoryManager) {
super(repositoryManager);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mGson = null;
this.mApplication = null;
}
@Override
public Observable<SupplementInfoBean> getNumByOrderType(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).getNumByOrderType(requestBody);
}
@Override
public Observable<SupplementResultBean> submitOrder(RequestBody requestBody) {
return mRepositoryManager.obtainRetrofitService(ColdChainService.class).submitOrder(requestBody);
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.model.bean;
public class BalanceBean {
/**
* success : true
* sysTime : 1599634994603
* data : {"id":72,"brandId":171,"balance":8685.14,"bond":500,"threshold":1000,"telephone":"110","updateTime":1599551167012,"createTime":1598426640164,"updateUid":390,"createUid":341,"deletes":0}
*/
private boolean success;
private long sysTime;
private DataBean data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
/**
* id : 72
* brandId : 171
* balance : 8685.14
* bond : 500.0
* threshold : 1000.0
* telephone : 110
* updateTime : 1599551167012
* createTime : 1598426640164
* updateUid : 390
* createUid : 341
* deletes : 0
*/
private int id;
private int brandId;
private double balance;
private double bond;
private double threshold;
private String telephone;
private long updateTime;
private long createTime;
private int updateUid;
private int createUid;
private int deletes;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getBrandId() {
return brandId;
}
public void setBrandId(int brandId) {
this.brandId = brandId;
}
public double getBalance() {
return balance;
}
public void setBalance(double balance) {
this.balance = balance;
}
public double getBond() {
return bond;
}
public void setBond(double bond) {
this.bond = bond;
}
public double getThreshold() {
return threshold;
}
public void setThreshold(double threshold) {
this.threshold = threshold;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(long updateTime) {
this.updateTime = updateTime;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public int getUpdateUid() {
return updateUid;
}
public void setUpdateUid(int updateUid) {
this.updateUid = updateUid;
}
public int getCreateUid() {
return createUid;
}
public void setCreateUid(int createUid) {
this.createUid = createUid;
}
public int getDeletes() {
return deletes;
}
public void setDeletes(int deletes) {
this.deletes = deletes;
}
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
public class CancelLogisticsBean {
private boolean success;
private String errCode;
private String errMsg;
private long sysTime;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
public class FoodDetailsTranBean {
private String odsId;
private String PRICE;
private String num;
private String pid;
private String PRODUCT_NAME;
public FoodDetailsTranBean(String odsId, String PRICE, String num, String pid, String PRODUCT_NAME) {
this.odsId = odsId;
this.PRICE = PRICE;
this.num = num;
this.pid = pid;
this.PRODUCT_NAME = PRODUCT_NAME;
}
public static FoodDetailsTranBean getByPRODUCTNAMEBean(OrderDetails.DataBean.PRODUCTNAMEBean bean) {
return new FoodDetailsTranBean(bean.getOdsId(), bean.getPRICE(), bean.getNum(), bean.getPid(), bean.getPRODUCT_NAME());
}
public static FoodDetailsTranBean getByChildBeanX(OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX bean) {
return new FoodDetailsTranBean(bean.getOdsId(), bean.getPRICE(), bean.getNum(), bean.getPid(), bean.getPRODUCT_NAME());
}
public static FoodDetailsTranBean getByChildBean(OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX.ChildBean bean) {
return new FoodDetailsTranBean(bean.getOdsId(), bean.getPRICE(), bean.getNum(), bean.getPid(), bean.getPRODUCT_NAME());
}
public String getOdsId() {
return odsId;
}
public void setOdsId(String odsId) {
this.odsId = odsId;
}
public String getPRICE() {
return PRICE;
}
public void setPRICE(String PRICE) {
this.PRICE = PRICE;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getPRODUCT_NAME() {
return PRODUCT_NAME;
}
public void setPRODUCT_NAME(String PRODUCT_NAME) {
this.PRODUCT_NAME = PRODUCT_NAME;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
public class PickUpBean {
private boolean success;
private String errCode;
private String errorMsg;
private long sysTime;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
public class ReadBean {
private boolean success;
private long sysTime;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
public class ShipAnyOrdersNewBean {
/**
* success : true
* sysTime : 1598498310257
* data : {"uid":"db0a39a9-9a0b-4c60-8a0c-6135b0a46aa7","ctime":1598469507642,"lUpd":1598469507642,"mchUid":"325764d7-b2e2-4d8b-9a68-7f4473719f9c","mchShipanyCommn":0,"curStat":"Pickup Request Sent","createTime":1598498310200,"restaurantId":153,"orderId":11121726,"isDelete":0,"updateTime":1598498310200,"delivery_man_name":"","delivery_man_phone_num":"","takeFoodCode":"0964","lab_url":""}
*/
private boolean success;
private long sysTime;
private DataBean data;
/**
* errCode : -1
* errMsg : 賬戶餘額不足
*/
private String errCode;
private String errMsg;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrMsg() {
return errMsg;
}
public void setErrMsg(String errMsg) {
this.errMsg = errMsg;
}
public static class DataBean {
/**
* uid : db0a39a9-9a0b-4c60-8a0c-6135b0a46aa7
* ctime : 1598469507642
* lUpd : 1598469507642
* mchUid : 325764d7-b2e2-4d8b-9a68-7f4473719f9c
* mchShipanyCommn : 0.0
* curStat : Pickup Request Sent
* createTime : 1598498310200
* restaurantId : 153
* orderId : 11121726
* isDelete : 0
* updateTime : 1598498310200
* delivery_man_name :
* delivery_man_phone_num :
* takeFoodCode : 0964
* lab_url :
*/
private String uid;
private long ctime;
private long lUpd;
private String mchUid;
private double mchShipanyCommn;
private String curStat;
private long createTime;
private int restaurantId;
private int orderId;
private int isDelete;
private long updateTime;
private String delivery_man_name;
private String delivery_man_phone_num;
private String takeFoodCode;
private String lab_url;//打印文檔下載鏈接
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public long getCtime() {
return ctime;
}
public void setCtime(long ctime) {
this.ctime = ctime;
}
public long getLUpd() {
return lUpd;
}
public void setLUpd(long lUpd) {
this.lUpd = lUpd;
}
public String getMchUid() {
return mchUid;
}
public void setMchUid(String mchUid) {
this.mchUid = mchUid;
}
public double getMchShipanyCommn() {
return mchShipanyCommn;
}
public void setMchShipanyCommn(double mchShipanyCommn) {
this.mchShipanyCommn = mchShipanyCommn;
}
public String getCurStat() {
return curStat;
}
public void setCurStat(String curStat) {
this.curStat = curStat;
}
public long getCreateTime() {
return createTime;
}
public void setCreateTime(long createTime) {
this.createTime = createTime;
}
public int getRestaurantId() {
return restaurantId;
}
public void setRestaurantId(int restaurantId) {
this.restaurantId = restaurantId;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public int getIsDelete() {
return isDelete;
}
public void setIsDelete(int isDelete) {
this.isDelete = isDelete;
}
public long getUpdateTime() {
return updateTime;
}
public void setUpdateTime(long updateTime) {
this.updateTime = updateTime;
}
public String getDelivery_man_name() {
return delivery_man_name;
}
public void setDelivery_man_name(String delivery_man_name) {
this.delivery_man_name = delivery_man_name;
}
public String getDelivery_man_phone_num() {
return delivery_man_phone_num;
}
public void setDelivery_man_phone_num(String delivery_man_phone_num) {
this.delivery_man_phone_num = delivery_man_phone_num;
}
public String getTakeFoodCode() {
return takeFoodCode;
}
public void setTakeFoodCode(String takeFoodCode) {
this.takeFoodCode = takeFoodCode;
}
public String getLab_url() {
return lab_url;
}
public void setLab_url(String lab_url) {
this.lab_url = lab_url;
}
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
/**
* Created by Administrator on 2019/3/26 0026.
*/
public class SumbitTakeawayResult {
/**
* orderNo : 2192531346128147
* code : 1
* orderId : 9512
* errorMsg : 成功
*/
private String orderNo;
private String code;
private int orderId;
private String errorMsg;
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public int getOrderId() {
return orderId;
}
public void setOrderId(int orderId) {
this.orderId = orderId;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
import java.util.List;
public class SupplementInfoBean {
/**
* success : true
* sysTime : 1598436389621
* data : {"replenishmentPhone":"13825748822","replenishmentPerson":"德華","pickUpPrompt":"補單提示","replenishmentAddress":"222222","orderVOS":[{"orderType":7,"orderNum":35}],"coldChainPickUpNum":15}
*/
private boolean success;
private long sysTime;
private DataBean data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
/**
* replenishmentPhone : 13825748822
* replenishmentPerson : 德華
* pickUpPrompt : 補單提示
* replenishmentAddress : 222222
* orderVOS : [{"orderType":7,"orderNum":35}]
* coldChainPickUpNum : 15
*/
private String replenishmentPhone;
private String replenishmentPerson;
private String pickUpPrompt;
private String replenishmentAddress;
private int coldChainPickUpNum;
private List<OrderVOSBean> orderVOS;
public String getReplenishmentPhone() {
return replenishmentPhone;
}
public void setReplenishmentPhone(String replenishmentPhone) {
this.replenishmentPhone = replenishmentPhone;
}
public String getReplenishmentPerson() {
return replenishmentPerson;
}
public void setReplenishmentPerson(String replenishmentPerson) {
this.replenishmentPerson = replenishmentPerson;
}
public String getPickUpPrompt() {
return pickUpPrompt;
}
public void setPickUpPrompt(String pickUpPrompt) {
this.pickUpPrompt = pickUpPrompt;
}
public String getReplenishmentAddress() {
return replenishmentAddress;
}
public void setReplenishmentAddress(String replenishmentAddress) {
this.replenishmentAddress = replenishmentAddress;
}
public int getColdChainPickUpNum() {
return coldChainPickUpNum;
}
public void setColdChainPickUpNum(int coldChainPickUpNum) {
this.coldChainPickUpNum = coldChainPickUpNum;
}
public List<OrderVOSBean> getOrderVOS() {
return orderVOS;
}
public void setOrderVOS(List<OrderVOSBean> orderVOS) {
this.orderVOS = orderVOS;
}
public static class OrderVOSBean {
/**
* orderType : 7
* orderNum : 35
*/
private int orderType;
private int orderNum;
public int getOrderType() {
return orderType;
}
public void setOrderType(int orderType) {
this.orderType = orderType;
}
public int getOrderNum() {
return orderNum;
}
public void setOrderNum(int orderNum) {
this.orderNum = orderNum;
}
}
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
/**
* 補單結果
*/
public class SupplementResultBean {
private String code;
private String errorMsg;
private String orderNo;
private long orderId;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
public long getOrderId() {
return orderId;
}
public void setOrderId(long orderId) {
this.orderId = orderId;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean
class ThirdItem : ArrayList<ThirdItem.ThirdItemItem>() {
data class ThirdItemItem(val descr: String = "",
val dim: Dim = Dim(),
val name: String,
val ori: String = "",
val qty: Int,
val sku: String = "",
val stg: String = "Normal",
val typ: String = "",
val unt_price: UntPrice,
val wt: Wt = Wt()) {
constructor(product_name: String, hkd: UntPrice)
: this("", Dim(), product_name, "", 1, "", "", "", hkd, Wt())
constructor(product_name: String, hkd: UntPrice, qty: Int)
: this("", Dim(), product_name, "", qty, "", "", "", hkd, Wt())
data class Dim(
val hgt: Int = 1,
val len: Int = 1,
val unt: String = "cm", //尺寸單位
val wid: Int = 1
)
data class UntPrice(
val ccy: String = "HKD",//金額單位
val `val`: Double
)
data class Wt(
val unt: String = "kg", //重量單位
val `val`: Int = 1
)
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.model.bean;
public class UpdateOrderStatusBean {
private String code;
private String errorMsg;
private String data;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getErrorMsg() {
return errorMsg;
}
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
package com.gingersoft.coldchain_module.mvp.model.bean;
public class UpdateRestaurantStateBean {
/**
* success : true
* sysTime : 1599899899775
* data : {"msg":"數據更新成功!","num":1}
*/
private boolean success;
private long sysTime;
private DataBean data;
public boolean isSuccess() {
return success;
}
public void setSuccess(boolean success) {
this.success = success;
}
public long getSysTime() {
return sysTime;
}
public void setSysTime(long sysTime) {
this.sysTime = sysTime;
}
public DataBean getData() {
return data;
}
public void setData(DataBean data) {
this.data = data;
}
public static class DataBean {
/**
* msg : 數據更新成功!
* num : 1
*/
private String msg;
private int num;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getNum() {
return num;
}
public void setNum(int num) {
this.num = num;
}
}
}
package com.gingersoft.coldchain_module.mvp.model.service;
import com.gingersoft.coldchain_module.mvp.model.bean.BalanceBean;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.coldchain_module.mvp.model.bean.PickUpBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementResultBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateRestaurantStateBean;
import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface ColdChainService {
@Headers({"Domain-Name: ricepon_wechat"})
@POST("wechat/findOrderList" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<OrderList> getOrderList(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_order"})
@POST("orderStatus/getNumByOrderType" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<SupplementInfoBean> getNumByOrderType(@Body RequestBody requestBody);
@Headers({"Domain-Name: update_version"})
@POST("order/addOrder2" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<SupplementResultBean> submitOrder(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_gsa"})
@POST("coldChain/pickUpShipany" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<PickUpBean> pickUp(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_wechat"})
@POST("wechat/findHistoryOrderList" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<String> getHistoryOrderList(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_activities"})
@GET("balance/get" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BalanceBean> getBalance(@Query("brandId") String brandId);
@Headers({"Domain-Name: member-web"})
@POST("wx/updateRestOpenStatus" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<UpdateRestaurantStateBean> updateRestOpenStatus(@Body RequestBody requestBody);
@Headers({"Domain-Name: system_url"})
@POST("admin/restaurantExt/update" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<Object> updateExpandInfo(@Body RequestBody requestBody);
}
package com.gingersoft.coldchain_module.mvp.model.service;
import com.gingersoft.coldchain_module.mvp.model.bean.CancelLogisticsBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ReadBean;
import com.gingersoft.coldchain_module.mvp.model.bean.ShipAnyOrdersNewBean;
import com.gingersoft.coldchain_module.mvp.model.bean.UpdateOrderStatusBean;
import com.gingersoft.gsa.cloud.common.bean.BaseResult;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import io.reactivex.Observable;
import me.jessyan.retrofiturlmanager.RetrofitUrlManager;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
public interface OrderDetailService {
@Headers({"Domain-Name: ricepon_wechat"})
@POST("wechat/findOrderDetails" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<OrderDetails> findOrderDetails(@Body RequestBody requestBody);
@Headers({"Domain-Name: member-web"})
@POST("order/updateOrderInfoIsRead" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<ReadBean> setIsRead(@Body RequestBody requestBody);
@Headers({"Domain-Name: member_web_ricepon_gsa"})
@POST("gsa/shipAnyOrdersNew" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<ShipAnyOrdersNewBean> thirdDelivery(@Body RequestBody requestBody);
// @Headers({"Domain-Name: member-web"})
// @POST("order/updateOrderStatus" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
// Observable<UpdateOrderStatusBean> cancelOrder(@Body RequestBody requestBody);
@Headers({"Domain-Name: member-web"})
@POST("order/updateOrderStatus" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<UpdateOrderStatusBean> gsUpdateOrderStatus(@Body RequestBody requestBody);
@Headers({"Domain-Name: member_web_ricepon_gsa"})
@POST("gsa/cancelOrder" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<CancelLogisticsBean> cancelLogistics(@Body RequestBody requestBody);
@POST("printerRecording/add" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> addPrj(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_gsa"})
@POST("shipanyTransportOrderInfo/update" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> updatePrintPdfStatus(@Body RequestBody requestBody);
@Headers({"Domain-Name: ricepon_order"})
@GET("orderInfo/getOrderInfoById" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> getNotPrintedOrderList(@Query("restaurantId") int restaurantId);
@Headers({"Domain-Name: ricepon_order"})
@POST("orderInfo/updateOrderInfoExt" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
Observable<BaseResult> updatePrintOrderStatus(@Body RequestBody requestBody);
}
package com.gingersoft.coldchain_module.mvp.presenter;
import android.app.Application;
import com.gingersoft.coldchain_module.mvp.constans.ColdChainConstants;
import com.gingersoft.coldchain_module.mvp.contract.SupplementOrderContract;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementResultBean;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.core.user.UserContext;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.integration.AppManager;
import com.jess.arms.mvp.BasePresenter;
import com.jess.arms.utils.RxLifecycleUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.schedulers.Schedulers;
import me.jessyan.rxerrorhandler.core.RxErrorHandler;
import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber;
import okhttp3.FormBody;
import okhttp3.RequestBody;
@ActivityScope
public class SupplementOrderPresenter extends BasePresenter<SupplementOrderContract.Model, SupplementOrderContract.View> {
@Inject
RxErrorHandler mErrorHandler;
@Inject
Application mApplication;
@Inject
ImageLoader mImageLoader;
@Inject
AppManager mAppManager;
@Inject
public SupplementOrderPresenter(SupplementOrderContract.Model model, SupplementOrderContract.View rootView) {
super(model, rootView);
}
@Override
public void onDestroy() {
super.onDestroy();
this.mErrorHandler = null;
this.mAppManager = null;
this.mImageLoader = null;
this.mApplication = null;
}
public void getNumByOrderType(int restaurantId) {
//startTime endTime
RequestBody requestBody = new FormBody.Builder()
.add("orderTypes", ColdChainConstants.orderType + "")
.add("restaurantId", restaurantId + "")
.build();
mModel.getNumByOrderType(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading(""))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<SupplementInfoBean>(mErrorHandler) {
@Override
public void onNext(@NonNull SupplementInfoBean info) {
if (info != null && info.isSuccess()) {
mRootView.loadNumber(info);
}
}
});
}
public void submitOrder(int nowIndex, int allNum, String name, String phone, String address) {
RequestBody requestBody = new FormBody.Builder()
.add("order", getOrderJson(name, phone, address))
.add("apiversion", "1")
.build();
mModel.submitOrder(requestBody)
.subscribeOn(Schedulers.io())
.doOnSubscribe(disposable -> mRootView.showLoading("剩餘" + nowIndex + "/" + allNum + "條訂單,,,"))
.subscribeOn(AndroidSchedulers.mainThread())
.observeOn(AndroidSchedulers.mainThread())
.doAfterTerminate(() -> mRootView.hideLoading())
.compose(RxLifecycleUtils.bindToLifecycle(mRootView))
.subscribe(new ErrorHandleSubscriber<SupplementResultBean>(mErrorHandler) {
@Override
public void onNext(@NonNull SupplementResultBean info) {
if (info != null) {
if (TextUtil.isNotEmptyOrNullOrUndefined(info.getErrorMsg())) {
mRootView.showMessage(info.getErrorMsg());
} else {
mRootView.showMessage("補單失敗");
}
if (info.getCode().equals("1")) {
mRootView.submissionComplete();
} else {
mRootView.killMyself();
}
} else {
mRootView.submissionFail();
}
}
@Override
public void onError(Throwable t) {
super.onError(t);
mRootView.submissionFail();
}
});
}
/**
* 订单提交
*/
private String getOrderJson(String name, String phone, String address) {
JSONObject json;
json = new JSONObject();
try {
json.put("shopId", RestaurantInfoManager.newInstance().getRestaurantId());
json.put("phone", phone);
json.put("replenishmentType", "1");
json.put("transportationType", "3");
json.put("memberId", UserContext.newInstance().getMemberId());
// json.put("addressId", );
json.put("addressDetail", address);
// json.put("sendTime", );
json.put("orderRemark", "");
json.put("payType", 1);
json.put("originalAmount", 0);//原价
json.put("orderType", 8);
json.put("totalPrice", 0);//实际总价
// json.put("waimaiSendTime", waimaiSendTime);//送单时间
JSONArray array = new JSONArray();
JSONObject object = new JSONObject();
object.put("posFid", -222);
object.put("productId", -223);
object.put("productName", "補單食品");
object.put("number", 1);
object.put("price", 0);
object.put("lunchboxPrice", 0);
array.put(object);
json.put("foods", array);
} catch (JSONException e) {
e.printStackTrace();
}
return json.toString();
}
}
package com.gingersoft.coldchain_module.mvp.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import com.gingersoft.coldchain_module.R;
import com.gingersoft.coldchain_module.R2;
import com.gingersoft.coldchain_module.di.component.DaggerSupplementOrderComponent;
import com.gingersoft.coldchain_module.di.module.SupplementOrderModule;
import com.gingersoft.coldchain_module.mvp.constans.ColdChainConstants;
import com.gingersoft.coldchain_module.mvp.contract.SupplementOrderContract;
import com.gingersoft.coldchain_module.mvp.model.bean.SupplementInfoBean;
import com.gingersoft.coldchain_module.mvp.presenter.SupplementOrderPresenter;
import com.gingersoft.gsa.cloud.common.core.restaurant.RestaurantInfoManager;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.qmuiteam.qmui.widget.QMUITopBar;
import butterknife.BindView;
import static com.jess.arms.utils.Preconditions.checkNotNull;
/**
* 補單
*/
public class SupplementOrderActivity extends BaseActivity<SupplementOrderPresenter> implements SupplementOrderContract.View {
@BindView(R2.id.cold_chain_supplement_order_top_bar)
QMUITopBar topBar;
@BindView(R2.id.tv_supplement_order_name)
TextView mTvName;
@BindView(R2.id.tv_supplement_order_address)
TextView mTvAddress;
@BindView(R2.id.tv_supplement_order_phone)
TextView mTvPhone;
@BindView(R2.id.ed_supplement_order_number)
EditText mEdSupplementNum;
@BindView(R2.id.tv_supplement_tip)
TextView mTvTip;
private int restaurantId;
private int supplementNum;
private int allSupplementNum;
private int pickUpNum;
private String name;
private String phone;
private String address;
@Override
public void setupActivityComponent(@NonNull AppComponent appComponent) {
DaggerSupplementOrderComponent //如找不到该类,请编译一下项目
.builder()
.appComponent(appComponent)
.supplementOrderModule(new SupplementOrderModule(this))
.build()
.inject(this);
}
@Override
public int initView(@Nullable Bundle savedInstanceState) {
return R.layout.activity_supplement_order; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
public void initData(@Nullable Bundle savedInstanceState) {
restaurantId = RestaurantInfoManager.newInstance().getRestaurantId();
mPresenter.getNumByOrderType(restaurantId);
findViewById(R.id.btn_confirm_supplement_order).setOnClickListener(v -> {
supplementNum = 0;
//補單
if (mEdSupplementNum != null && TextUtil.isNotEmptyOrNullOrUndefined(mEdSupplementNum.getText().toString())
&& Integer.parseInt(mEdSupplementNum.getText().toString()) > 0) {
supplementNum = Integer.parseInt(mEdSupplementNum.getText().toString());
allSupplementNum = supplementNum;
if (supplementNum > pickUpNum) {
showMessage("補單數量不能超過" + pickUpNum + "單");
return;
}
if (TextUtil.isEmptyOrNullOrUndefined(name)) {
showMessage("未獲取到收貨人姓名");
return;
}
if (TextUtil.isEmptyOrNullOrUndefined(phone)) {
showMessage("未獲取到收貨人手機號");
return;
}
if (TextUtil.isEmptyOrNullOrUndefined(address)) {
showMessage("未獲取到收貨地址");
return;
}
mPresenter.submitOrder(supplementNum, allSupplementNum, name, phone, address);
} else {
showMessage("補單數量必須大於0");
}
});
}
@Override
public void initIntent() {
}
@Override
public void initTopBar() {
topBar.setTitle("補單");
topBar.addLeftImageButton(R.drawable.icon_return, R.id.iv_left_back).setOnClickListener(v -> killMyself());
topBar.setBackgroundColor(ContextCompat.getColor(mContext, R.color.theme_color));
}
@Override
public void initLanguage() {
}
@Override
public void initLayoutParams() {
}
@Override
public void initLayoutVisible() {
}
@Override
public void showLoading(String message) {
if (message != null)
LoadingDialog.showDialogForLoading(this, message, true);
else
LoadingDialog.showDialogForLoading(this);
}
@Override
public void hideLoading() {
LoadingDialog.cancelDialogForLoading();
}
@Override
public void showMessage(@NonNull String message) {
ArmsUtils.makeText(this, message);
}
@Override
public void launchActivity(@NonNull Intent intent) {
checkNotNull(intent);
ArmsUtils.startActivity(intent);
}
@Override
public void killMyself() {
finish();
}
@Override
public void loadNumber(SupplementInfoBean bean) {
if (bean != null && bean.getData() != null) {
SupplementInfoBean.DataBean dataBean = bean.getData();
mTvAddress.setText(dataBean.getReplenishmentAddress());
mTvTip.setText(dataBean.getPickUpPrompt());
mTvName.setText(dataBean.getReplenishmentPerson());
mTvPhone.setText(dataBean.getReplenishmentPhone());
name = dataBean.getReplenishmentPerson();
phone = dataBean.getReplenishmentPhone();
address = dataBean.getReplenishmentAddress();
if (dataBean.getOrderVOS() != null) {
int orderNum = 0;
for (SupplementInfoBean.DataBean.OrderVOSBean orderVOSBean : dataBean.getOrderVOS()) {
if (orderVOSBean.getOrderType() == ColdChainConstants.orderType) {
orderNum = orderVOSBean.getOrderNum();
}
}
pickUpNum = dataBean.getColdChainPickUpNum() - orderNum;
if (orderNum > dataBean.getColdChainPickUpNum()) {
showMessage("訂單數已滿足,不需要補單");
killMyself();
} else {
if (pickUpNum > 0) {
mEdSupplementNum.setText(pickUpNum + "");
} else {
showMessage("訂單數已滿足,不需要補單");
killMyself();
}
}
}
}
}
@Override
public void submissionComplete() {
supplementNum--;
if (supplementNum > 0) {
mPresenter.submitOrder(supplementNum, allSupplementNum, name, phone, address);
} else {
// showMessage("補單完成");
killMyself();
}
}
@Override
public void submissionFail() {
showMessage("補單失敗");
killMyself();
}
}
package com.gingersoft.coldchain_module.mvp.ui.adapter;
import android.content.Context;
import android.graphics.pdf.PdfDocument;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.ParcelFileDescriptor;
import android.print.PageRange;
import android.print.PrintAttributes;
import android.print.PrintDocumentAdapter;
import android.print.PrintDocumentInfo;
import android.print.pdf.PrintedPdfDocument;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 创建打印适配器
*/
public class MyPrintDocumentAdapter extends PrintDocumentAdapter {
private Context mContext;
private String mFilePath;
private PrintedPdfDocument mPdfDocument;
public PdfDocument myPdfDocument;
private InputStream input;
private onPrintStatusChangeListener onPrintStatusChangeListener;
public MyPrintDocumentAdapter(Context context, File file, onPrintStatusChangeListener onPrintStatusChangeListener) {
this.mContext = context;
this.mFilePath = file.getPath();
this.onPrintStatusChangeListener = onPrintStatusChangeListener;
}
//当打印进程开始,该方法就将被调用,
@Override
public void onStart() {
super.onStart();
}
//当用户改变了打印输出时,比方说页面尺寸,或者页面的方向时,
// 该函数将被调用。以此会给我们的应用重新计划打印页面的布局,
// 另外该方法必须返回打印文档包含多少页面。
@Override
public void onLayout(PrintAttributes printAttributes,
PrintAttributes printAttributes1,
CancellationSignal cancellationSignal,
LayoutResultCallback layoutResultCallback,
Bundle bundle) {
// //使用请求的页属性创建新的pdfdocument
// mPdfDocument=new PrintedPdfDocument(mContext,printAttributes1);
// 响应取消请求
if (cancellationSignal.isCanceled()) {
layoutResultCallback.onLayoutCancelled();
return;
}
// 将打印信息返回到打印框架
PrintDocumentInfo info = new PrintDocumentInfo
.Builder("name")
.setContentType(PrintDocumentInfo.CONTENT_TYPE_DOCUMENT)
.build();
layoutResultCallback.onLayoutFinished(info, true);
}
//此函数被调用后,会将打印页面渲染成一个待打印的文件,该函数
// 可以在onLayout被调用后调用一次或多次
@Override
public void onWrite(PageRange[] pageRanges,
ParcelFileDescriptor parcelFileDescriptor,
CancellationSignal cancellationSignal,
WriteResultCallback writeResultCallback) {
InputStream input = null;
OutputStream output = null;
try {
input = new FileInputStream(mFilePath);
output = new FileOutputStream(parcelFileDescriptor.getFileDescriptor());
byte[] buf = new byte[1024];
int bytesRead;
while ((bytesRead = input.read(buf)) > 0) {
output.write(buf, 0, bytesRead);
}
writeResultCallback.onWriteFinished(new PageRange[]{PageRange.ALL_PAGES});
} catch (FileNotFoundException e) {
if (onPrintStatusChangeListener != null) {
onPrintStatusChangeListener.onStatusChange(-1, "未找到待打印文件");
}
// Toast.makeText(mContext, "未找到待打印文件", Toast.LENGTH_SHORT).show();
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (output != null) {
try {
output.close();
} catch (IOException e) {
e.printStackTrace();
}
try {
input.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
// Toast.makeText(mContext, "待打印状态", Toast.LENGTH_SHORT).show();
}
//一旦打印进程结束后,该函数将会被调用。如果我们的应用有任何
// 一次性销毁任务要执行,让这些任务在该方法内执行。这个回调方法不是必须实现的。
@Override
public void onFinish() {
// Toast.makeText(mContext, "已发送打印", Toast.LENGTH_SHORT).show();
if (onPrintStatusChangeListener != null) {
onPrintStatusChangeListener.onStatusChange(0, "打印文件已發送");
}
super.onFinish();
}
public interface onPrintStatusChangeListener {
void onStatusChange(int code, String msg);
}
}
package com.gingersoft.coldchain_module.mvp.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gingersoft.coldchain_module.R
import com.gingersoft.gsa.cloud.ui.utils.BtnBuilder
class OrderDetailsBtnAdapter(list: MutableList<BtnBuilder.BtnBean>) : BaseQuickAdapter<BtnBuilder.BtnBean, BaseViewHolder>(R.layout.item_btn, list) {
override fun convert(holder: BaseViewHolder, item: BtnBuilder.BtnBean) {
holder.setText(R.id.tv_btn_content, item.btnContent)
holder.setBackgroundResource(R.id.layout_btn_item, item.btnColor)
holder.setImageResource(R.id.iv_btn_mark, item.btnImg)
}
}
\ No newline at end of file
package com.gingersoft.coldchain_module.mvp.ui.adapter;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.coldchain_module.R;
import com.gingersoft.coldchain_module.mvp.model.bean.FoodDetailsTranBean;
import com.gingersoft.gsa.cloud.common.core.delivery.OrderDetails;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import static com.bin.david.form.utils.DensityUtils.dp2px;
public class OrderDetailsFoodAdapter extends BaseQuickAdapter<OrderDetails.DataBean.PRODUCTNAMEBean, BaseViewHolder> {
public OrderDetailsFoodAdapter(@Nullable List<OrderDetails.DataBean.PRODUCTNAMEBean> data) {
super(R.layout.cold_chain_food_item, data);
}
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, OrderDetails.DataBean.PRODUCTNAMEBean bean) {
baseViewHolder.setText(R.id.tv_food_name, bean.getPRODUCT_NAME());
baseViewHolder.setText(R.id.tv_food_number, getContext().getString(R.string.count) + bean.getNum());
baseViewHolder.setText(R.id.tv_food_price, getContext().getString(R.string.amount_unit) + bean.getPRICE());
List<OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX> childBeanXList = bean.getChild();
if (childBeanXList != null) {
for (OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX childBeanX : childBeanXList) {
View foodChild = getChild(FoodDetailsTranBean.getByChildBeanX(childBeanX), 10);
LinearLayout content = foodChild.findViewById(R.id.layout_food_content);
List<OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX.ChildBean> childBeans = childBeanX.getChild();
if (childBeans != null) {
for (OrderDetails.DataBean.PRODUCTNAMEBean.ChildBeanX.ChildBean childBean : childBeanX.getChild()) {
content.addView(getChild(FoodDetailsTranBean.getByChildBean(childBean), 20));
}
}
((LinearLayout)baseViewHolder.getView(R.id.layout_food_content)).addView(foodChild);
}
}
}
private View getChild(FoodDetailsTranBean child, int leftMargin) {
View foodChildChild = LayoutInflater.from(getContext()).inflate(R.layout.cold_chain_food_item, null, false);
((TextView)foodChildChild.findViewById(R.id.tv_food_name)).setText(child.getPRODUCT_NAME());
((TextView)foodChildChild.findViewById(R.id.tv_food_number)).setText(getContext().getString(R.string.count) + child.getNum());
((TextView)foodChildChild.findViewById(R.id.tv_food_price)).setText(getContext().getString(R.string.amount_unit) + child.getPRICE());
ImageView childNext = foodChildChild.findViewById(R.id.iv_food_item_next);
childNext.setVisibility(View.VISIBLE);
childNext.setPadding(dp2px(getContext(), leftMargin), 0, 0, 0);
return foodChildChild;
}
}
package com.gingersoft.coldchain_module.mvp.ui.adapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.drawable.GradientDrawable;
import android.view.View;
import androidx.core.content.ContextCompat;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.gingersoft.coldchain_module.R;
import com.gingersoft.coldchain_module.mvp.model.bean.OrderList;
import com.gingersoft.gsa.cloud.common.utils.other.TextUtil;
import com.gingersoft.gsa.cloud.common.utils.time.TimeUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import static com.bin.david.form.utils.DensityUtils.dp2px;
/**
* @author admin
*/
public class OrderListAdapter extends BaseQuickAdapter<OrderList.DataBeanX.DataBean, BaseViewHolder> {
public OrderListAdapter(@Nullable List<OrderList.DataBeanX.DataBean> data) {
super(R.layout.cold_chain_order_item, data);
}
@Override
protected void convert(@NotNull BaseViewHolder baseViewHolder, OrderList.DataBeanX.DataBean dataBean) {
if (dataBean.getIsPrintPdf() == 0) {
baseViewHolder.setText(R.id.tv_logistics_order_print_state, "未打印物流單");
baseViewHolder.setGone(R.id.tv_logistics_order_print_state, false);
} else {
baseViewHolder.setGone(R.id.tv_logistics_order_print_state, true);
}
baseViewHolder.setText(R.id.tv_pay_method, dataBean.getOrderPayType() == 1 ? "貨到付款" : "在線支付");
baseViewHolder.setText(R.id.tv_order_time, TimeUtils.parseTimeRepeat(dataBean.getCREATE_TIME(), TimeUtils.DEFAULT_DATE_FORMAT));
if (TextUtil.isEmptyOrNullOrUndefined(dataBean.getRECEIVER())) {
baseViewHolder.setText(R.id.tv_order_user_name, "(" + dataBean.getPHONE() + ")");
} else {
baseViewHolder.setText(R.id.tv_order_user_name, dataBean.getRECEIVER() + "(" + dataBean.getPHONE() + ")");
}
baseViewHolder.setText(R.id.tv_order_print_state, dataBean.getPrintStrByStatus());
baseViewHolder.setTextColor(R.id.tv_order_print_state, ContextCompat.getColor(getContext(), dataBean.getColorByStatus()));
baseViewHolder.setText(R.id.tv_address, "地址:" + dataBean.getADDRESS_DETAIL());
baseViewHolder.setText(R.id.tv_delivery_state, getStatus(dataBean.getCurStat()));
baseViewHolder.setText(R.id.tv_order_amount, "$" + dataBean.getPAY_AMOUNT());
baseViewHolder.setText(R.id.tv_order_code, String.format(getContext().getString(R.string.str_order_code), dataBean.getTakeFoodCode()));
if (dataBean.getIsRead() == 0) {
baseViewHolder.setVisible(R.id.fl_border, true);
alphaAnimator(baseViewHolder.getView(R.id.fl_border));
} else {
baseViewHolder.setGone(R.id.fl_border, true);
baseViewHolder.getView(R.id.fl_border).clearAnimation();
}
String orderStatus = "";
GradientDrawable statusBg = new GradientDrawable();
statusBg.setCornerRadius(dp2px(getContext(), 5f));
if (dataBean.getSTATUS() == 0 || dataBean.getSTATUS() == 1) {
orderStatus = "待確認";
statusBg.setColor(ContextCompat.getColor(getContext(), R.color.order_state0_color));
} else if (dataBean.getSTATUS() == 2) {
orderStatus = "待提交";
statusBg.setColor(ContextCompat.getColor(getContext(), R.color.order_state1_color));
} else if (dataBean.getSTATUS() == 3) {
orderStatus = "派送中";
statusBg.setColor(ContextCompat.getColor(getContext(), R.color.order_state2_color));
}
baseViewHolder.setText(R.id.tv_order_state, orderStatus);
baseViewHolder.getView(R.id.tv_order_state).setBackground(statusBg);
}
private String getStatus(int curStat) {
switch (curStat) {
case 1:
return "已通知物流";
case 2:
return "配送員已接單";
case 3:
return "配送員到店附近";
case 4:
return "配送員已到店";
case 5:
return "配送中";
case 6:
return "到達目的地附近";
case 7:
return "訂單已完成";
case 8:
case 9:
return "物流已取消";
case 10:
return "已指派另一位配送員";
default:
return "";
}
}
private void alphaAnimator(View view) {
AnimatorSet animatorSet = new AnimatorSet();
ObjectAnimator ofFloat = ObjectAnimator.ofFloat(view, "alpha", 0f, 1f);
ofFloat.setDuration(200);
ofFloat.setRepeatCount(-1);
ofFloat.setRepeatMode(ValueAnimator.REVERSE);
ObjectAnimator ofFloat1 = ObjectAnimator.ofFloat(view, "alpha", 1f, 0f);
ofFloat1.setDuration(200);
ofFloat1.setRepeatCount(-1);
ofFloat1.setRepeatMode(ValueAnimator.REVERSE);
animatorSet.play(ofFloat).with(ofFloat1);
animatorSet.setDuration(400);
animatorSet.start();
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f0"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_f0"
android:orientation="vertical"
app:elevation="@dimen/dp_0">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/cold_chain_history_order_top_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
app:qmui_topbar_title_color="@color/theme_white_color" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="@dimen/dp_10"
android:visibility="gone">
<EditText
android:id="@+id/ed_order_num_search"
android:layout_width="0dp"
android:layout_height="@dimen/dp_38"
android:layout_marginRight="@dimen/dp_10"
android:background="@drawable/shape_white_search_bg"
android:hint="請輸入手機號或訂單號"
android:inputType="number"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_50"
android:textColor="@color/theme_333_color"
android:textColorHint="@color/color_ccc"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_search_order"
android:layout_width="@dimen/dp_50"
android:layout_height="0dp"
android:padding="@dimen/dp_10"
android:src="@drawable/ic_search"
app:layout_constraintBottom_toBottomOf="@id/ed_order_num_search"
app:layout_constraintRight_toRightOf="@id/ed_order_num_search"
app:layout_constraintTop_toTopOf="@id/ed_order_num_search" />
<TextView
android:id="@+id/tv_start_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
app:layout_constraintLeft_toLeftOf="@id/ed_order_num_search"
app:layout_constraintTop_toBottomOf="@id/ed_order_num_search" />
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id="@+id/iv_start_time_triangle"
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_2"
app:layout_constraintBottom_toBottomOf="@id/tv_start_time"
app:layout_constraintLeft_toRightOf="@id/tv_start_time"
app:layout_constraintTop_toTopOf="@id/tv_start_time"
app:trv_direction="bottom" />
<TextView
android:id="@+id/tv_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="至"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/iv_start_time_triangle"
app:layout_constraintLeft_toRightOf="@id/iv_start_time_triangle"
app:layout_constraintTop_toTopOf="@id/iv_start_time_triangle" />
<TextView
android:id="@+id/tv_end_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_to"
app:layout_constraintLeft_toRightOf="@id/tv_to"
app:layout_constraintTop_toTopOf="@id/tv_to" />
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id="@+id/iv_end_time_triangle"
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_5"
android:layout_marginLeft="@dimen/dp_2"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_end_time"
app:layout_constraintLeft_toRightOf="@id/tv_end_time"
app:layout_constraintTop_toTopOf="@id/tv_end_time"
app:trv_direction="bottom" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.google.android.material.tabs.TabLayout
android:id="@+id/history_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:tabPaddingEnd="-1dp"
app:tabPaddingStart="-1dp"
app:tabSelectedTextColor="@color/theme_color"
app:tabTextColor="@color/color_ccc">
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem_completed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已完成" />
<com.google.android.material.tabs.TabItem
android:id="@+id/tabItem_cancelled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已取消" />
</com.google.android.material.tabs.TabLayout>
</com.google.android.material.appbar.AppBarLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/cold_chain_history_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/content_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<com.qmuiteam.qmui.widget.QMUITopBar
android:id="@+id/cold_chain_supplement_order_top_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/head_height"
app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
app:qmui_topbar_title_color="@color/theme_white_color" />
<TextView
android:id="@+id/tv_supplement_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@color/black"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_8"
android:text="補單的運費由餐廳承擔,以每單計算"
android:textColor="@color/white"
android:textSize="@dimen/dp_12" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f0"
android:orientation="vertical"
android:padding="@dimen/dp_10">
<com.lihang.ShadowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:hl_cornerRadius="@dimen/dp_8"
app:hl_shadowLimit="@dimen/dp_3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_8"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="聯繫人:"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
<TextView
android:id="@+id/tv_supplement_order_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:text="張先生"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="聯繫人電話:"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
<TextView
android:id="@+id/tv_supplement_order_address"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_weight="1"
android:gravity="right"
android:text="張先生"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="地址:"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
<TextView
android:id="@+id/tv_supplement_order_phone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_weight="1"
android:gravity="right"
android:text="香港"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
</LinearLayout>
</LinearLayout>
</com.lihang.ShadowLayout>
<com.lihang.ShadowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:background="@color/white"
app:hl_cornerRadius="@dimen/dp_8"
app:hl_shadowLimit="@dimen/dp_3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_8"
android:orientation="vertical">
<TextView
style="@style/order_details_title_Style"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_8"
android:text="商品詳情" />
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_weight="1"
android:text="食品"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_weight="1"
android:gravity="center"
android:text="X1"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:layout_weight="1"
android:gravity="right"
android:text="$0.0"
android:textColor="@color/black"
android:textSize="@dimen/dp_16" />
</LinearLayout>
</LinearLayout>
</com.lihang.ShadowLayout>
<com.lihang.ShadowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5"
android:background="@color/white"
app:hl_cornerRadius="@dimen/dp_8"
app:hl_shadowLimit="@dimen/dp_3">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/dp_8"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="需要補單數量" />
<EditText
android:id="@+id/ed_supplement_order_number"
android:layout_width="@dimen/dp_50"
android:gravity="center"
android:maxLines="1"
android:maxLength="3"
android:layout_height="wrap_content"
android:inputType="number" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="單" />
</LinearLayout>
</com.lihang.ShadowLayout>
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<Button
android:id="@+id/btn_confirm_supplement_order"
android:layout_width="match_parent"
style="@style/app_btn_style"
android:text="確定" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingTop="@dimen/dp_12">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_food_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintHorizontal_weight="0.5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_food_number"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/iv_food_item_next"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:src="@drawable/item_next"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_food_name"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_food_name" />
<TextView
android:id="@+id/tv_food_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_15"
tools:text="食品名"
app:layout_constraintLeft_toRightOf="@id/iv_food_item_next"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_food_number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="@color/color_3c"
tools:text="食品數量"
android:textSize="@dimen/dp_15"
app:layout_constraintHorizontal_weight="0.2"
app:layout_constraintLeft_toRightOf="@id/layout_food_name"
app:layout_constraintRight_toLeftOf="@id/tv_food_price"
app:layout_constraintTop_toTopOf="@id/layout_food_name" />
<TextView
android:id="@+id/tv_food_price"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="right"
tools:text="食品價格"
android:textColor="@color/color_3c"
android:textSize="@dimen/dp_15"
app:layout_constraintHorizontal_weight="0.3"
app:layout_constraintLeft_toRightOf="@id/tv_food_number"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/layout_food_name" />
<LinearLayout
android:id="@+id/layout_food_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@id/layout_food_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layout_history_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_20"
android:background="@color/white"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_10">
<ImageView
android:layout_width="@dimen/dp_20"
android:layout_height="@dimen/dp_20"
android:visibility="gone"
android:src="@drawable/ic_history_order" />
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id="@+id/tv_list_popup"
android:layout_width="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_height="wrap_content"
android:text="歷史訂單"
android:textColor="@color/theme_333_color"
android:textSize="@dimen/dp_14" />
</LinearLayout>
<include layout="@layout/include_horizontal_color_ccc_dividing_line" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?attr/selectableItemBackground"
app:cardCornerRadius="@dimen/dp_8"
app:cardElevation="@dimen/dp_2"
app:cardPreventCornerOverlap="true"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_14"
android:paddingBottom="@dimen/dp_6">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp_5"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:id="@+id/tv_pay_method"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_payments_btn"
android:gravity="left"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_6"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_6"
android:textColor="@color/white"
android:textSize="@dimen/dp_14"
android:textStyle="bold"
tools:text="支付方式" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_order_user_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="用戶名+手機號(1234567862)安居房三級分類誰的簡歷福克斯就"
tools:textColor="@color/theme_333_color" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_order_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
tools:text="訂單碼:1002"
tools:textColor="@color/theme_333_color" />
<View
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_address"
style="@style/order_item_info_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/color_3c"
tools:text="用戶收貨地址"
tools:textColor="#868686" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical">
<TextView
android:id="@+id/tv_order_time"
style="@style/order_item_twelve_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="@string/Key_add_10"
android:textSize="@dimen/dp_10"
tools:text="2019-07-06 15:30:00"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_logistics_order_print_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:gravity="right"
android:textColor="@color/color_3c"
tools:text="物流單已打印" />
<TextView
android:id="@+id/tv_order_print_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:gravity="right"
android:textColor="@color/color_3c"
android:textStyle="bold"
tools:text="訂單已打印" />
<TextView
android:id="@+id/tv_delivery_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_2"
android:gravity="right"
android:textColor="@color/color_3c"
tools:text="已通知物流"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:gravity="center"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_8"
android:textColor="@color/white"
android:textSize="@dimen/dp_12"
tools:text="訂單狀態"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:gravity="center_horizontal"
android:maxWidth="@dimen/dp_100"
android:textColor="@color/red_600"
android:textSize="@dimen/sp_16"
tools:text="$14141144"
tools:textColor="@color/theme_333_color" />
</LinearLayout>
</LinearLayout>
<FrameLayout
android:id="@+id/fl_border"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_order_border"
android:visibility="gone" />
</androidx.cardview.widget.CardView>
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_3">
<com.lihang.ShadowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hl_cornerRadius="@dimen/dp_8"
app:hl_shadowLimit="@dimen/dp_3">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_14"
android:paddingBottom="@dimen/dp_6">
<TextView
android:id="@+id/tv_pay_method"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:background="@drawable/shape_payments_btn"
android:gravity="left"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_6"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_6"
android:textColor="@color/white"
android:textSize="@dimen/dp_14"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="支付方式" />
<TextView
android:id="@+id/tv_order_time"
style="@style/order_item_twelve_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_5"
android:layout_marginRight="@dimen/dp_10"
android:layout_weight="1"
android:gravity="right"
android:text="@string/Key_add_10"
android:textSize="@dimen/dp_10"
app:layout_constraintLeft_toRightOf="@id/tv_pay_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="2019-07-06 15:30:00"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_user_name"
android:layout_width="0dp"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@id/tv_order_state"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_state"
app:layout_constraintTop_toBottomOf="@id/tv_pay_method"
app:layout_constraintTop_toTopOf="@id/tv_order_state"
tools:text="用戶名+手機號(1234567862)安居房三級分類誰的簡歷福克斯就"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/theme_text_color"
android:textSize="@dimen/sp_14"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_state"
app:layout_constraintTop_toBottomOf="@id/tv_order_user_name"
tools:text="用戶名+手機號(1234567862)"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_address"
style="@style/order_item_info_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_10"
android:textColor="@color/color_3c"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/tv_order_amount"
app:layout_constraintTop_toBottomOf="@id/tv_order_code"
app:layout_constraintVertical_bias="1"
tools:text="用戶收貨地址"
tools:textColor="#868686" />
<TextView
android:id="@+id/tv_logistics_order_print_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:gravity="right"
android:text="物流單已打印"
android:textColor="@color/color_3c"
app:layout_constraintLeft_toRightOf="@id/tv_pay_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_time" />
<TextView
android:id="@+id/tv_delivery_state"
style="@style/order_item_info_title_textStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:gravity="right"
android:textColor="@color/color_3c"
app:layout_constraintLeft_toRightOf="@id/tv_pay_method"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_logistics_order_print_state"
tools:text="已通知物流"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:gravity="center"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_8"
android:textColor="@color/white"
android:textSize="@dimen/dp_12"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_delivery_state"
tools:text="訂單狀態"
tools:textColor="@color/theme_333_color" />
<TextView
android:id="@+id/tv_order_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_7"
android:gravity="center_horizontal"
android:maxWidth="@dimen/dp_100"
android:textColor="@color/red_600"
android:textSize="@dimen/sp_16"
app:layout_constraintLeft_toRightOf="@id/tv_address"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_order_state"
tools:text="$14141144"
tools:textColor="@color/theme_333_color" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.lihang.ShadowLayout>
<FrameLayout
android:id="@+id/fl_border"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shape_order_border"
android:visibility="gone" />
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cold_chain_refresh_layout"
android:layout_width="match_parent" android:background="@color/white"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/cold_chain_order_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include
android:id="@+id/layout_nodata"
layout="@layout/layout_no_data" />
</FrameLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:id="@+id/layout_btn_item"
android:layout_height="@dimen/dp_40"
android:gravity="center"
android:layout_marginStart="@dimen/dp_1"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_btn_mark"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"/>
<TextView
android:id="@+id/tv_btn_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_4"
android:textColor="@color/white"
android:textSize="@dimen/dp_14" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="@dimen/dp_10">
<TextView
android:id="@+id/tv_discount_text"
style="@style/otherOrder_bill_textStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="折扣名:" />
<TextView
android:id="@+id/tv_discount_amount"
style="@style/otherOrder_bill_info_textStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
tools:text="折扣金額" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="other_order_info_dialog_content_marginLeft">@dimen/dp_10</dimen>
<dimen name="other_order_info_dialog_content_marginRight">@dimen/dp_10</dimen>
</resources>
\ No newline at end of file
<resources>
<string name="cold_chain_name">凍鏈</string>
<string name="str_order_code">訂單碼:%1$s</string>
</resources>
<resources>
<!-- 訂單列表item的下單時間字體樣式-->
<style name="order_item_twelve_textStyle">
<item name="android:textColor">@color/color_66</item>
<item name="android:textSize">@dimen/dp_12</item>
</style>
<!-- 訂單列表item的訂單信息名稱字體樣式-->
<style name="order_item_info_textStyle">
<item name="android:textColor">@color/theme_text_color</item>
<item name="android:textSize">@dimen/dp_12</item>
</style>
<!-- 訂單列表item的訂單信息名稱字體樣式-->
<style name="order_item_info_title_textStyle">
<item name="android:textColor">@color/theme_text_color</item>
<item name="android:textSize">@dimen/dp_12</item>
</style>
<!-- 訂單詳情小標題文字大小-->
<style name="order_details_title_Style">
<item name="android:textSize">@dimen/dp_16</item>
<item name="android:textColor">@color/theme_333_color</item>
<item name="android:textStyle">bold</item>
</style>
<style name="otherOrder_details_twelve_text_Style">
<item name="android:textSize">@dimen/dp_12</item>
<item name="android:textColor">@color/color_3c</item>
</style>
</resources>
apply from: rootProject.file('cc-settings.gradle')
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
if (project.ext.runAsApp) {
applicationId "com.gingersoft.gsa.delivery_pick_mode"
}
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.android["versionCode"]
versionName rootProject.ext.android["versionName"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
resourcePrefix "otherOrder"
dataBinding {
enabled = true
}
// viewBinding {
// enabled = true
// }
buildTypes {
debug {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["debugLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["debugUseCanary"]
minifyEnabled false
proguardFiles 'proguard.cfg'
}
release {
buildConfigField "boolean", "LOG_DEBUG", rootProject.ext.buildType["releaseLogDebug"]
buildConfigField "boolean", "USE_CANARY", rootProject.ext.buildType["releaseUseCanary"]
minifyEnabled false
zipAlignEnabled false
proguardFiles 'proguard.cfg'
}
}
}
kapt {
useBuildCache = true
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
kapt rootProject.ext.dependencies["dagger2-compiler"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
// alternatively, just LiveData
implementation "android.arch.lifecycle:livedata:1.1.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha01"
//协程
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
//gson和scalars轉換器
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.ethanhua:skeleton:1.1.2'
implementation 'io.supercharge:shimmerlayout:2.1.0'
if (project.ext.runAsApp) {
addComponent 'component-print'
}
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.gsa.delivery_pick_mode">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application>
<activity
android:name=".ui.activity.DeliveryOrderMainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="action.gingersoft.DELIVERY_ORDER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".ui.activity.HistoryOrderActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.DeliverySettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.OrderDetailsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.PayActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.LogActivity"
android:screenOrientation="portrait" />
<activity
android:name=".mvp.ui.activity.SendOrderActivity"
android:screenOrientation="portrait" />
<meta-data
android:name="com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity
android:name=".mvp.ui.activity.AddressListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".mvp.ui.activity.PrjQueryActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gingersoft.gsa.delivery_pick_mode">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="com.gingersoft.gsa.cloud.app.GsaCloudApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_android"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".mvp.ui.activity.PrjQueryActivity" />
<activity android:name=".mvp.ui.activity.AddressListActivity" />
<activity android:name=".ui.activity.LogActivity" />
<activity android:name=".ui.activity.OrderDetailsActivity" />
<activity
android:name=".ui.activity.DeliveryOrderMainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.gingersoft.gsa.cloud.common.service.ICommandService" />
<meta-data
android:name="com.gingersoft.gsa.cloud.common.config.globalconfig.GlobalConfiguration"
android:value="ConfigModule" />
<activity android:name=".ui.activity.HistoryOrderActivity" />
</application>
</manifest>
\ No newline at end of file
package delivery_pick_module;
import com.billy.cc.core.component.CC;
import com.jess.arms.base.BaseApplication;
/**
* Created by Wyh on 2020/1/7.
*/
public class MyApp extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
CC.enableVerboseLog(true);
CC.enableDebug(true);
CC.enableRemoteCC(true);
}
}
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base application theme. -->
<style name="user_register_AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimary</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode;
import android.content.Intent;
import com.billy.cc.core.component.CC;
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.component.ComponentName;
import com.gingersoft.gsa.cloud.common.service.ICommandService;
import com.gingersoft.gsa.delivery_pick_mode.data.network.ServiceCreator;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity.PrjQueryActivity;
import com.gingersoft.gsa.delivery_pick_mode.mvp.ui.activity.SendOrderActivity;
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.DeliveryOrderMainActivity;
import com.gingersoft.gsa.delivery_pick_mode.ui.activity.HistoryOrderActivity;
public class DeliveryPickComponent implements IComponent {
@Override
public String getName() {
//组件的名称,调用此组件的方式:
// CC.obtainBuilder("ComponentA")...build().callAsync()
return ComponentName.COMPONENT_DELIVERYPICK;
}
/**
* 组件被调用时的入口
* 要确保每个逻辑分支都会调用到CC.sendCCResult,
* 包括try-catch,if-else,switch-case-default,startActivity
*
* @param cc 组件调用对象,可从此对象中获取相关信息
* @return true:将异步调用CC.sendCCResult(...),用于异步实现相关功能,例如:文件加载、网络请求等
* false:会同步调用CC.sendCCResult(...),即在onCall方法return之前调用,否则将被视为不合法的实现
*/
@Override
public boolean onCall(CC cc) {
String actionName = cc.getActionName();
switch (actionName) {
case "getInfo":
getInfo(cc);
break;
case "getLifecycleFragment":
//demo for provide fragment object to other component
getLifecycleFragment(cc);
break;
case "lifecycleFragment.addText":
lifecycleFragmentDoubleText(cc);
break;
case "orderActivity":
CCUtil.navigateTo(cc, DeliveryOrderMainActivity.class);
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
case "closeHeart":
Intent intent = new Intent(cc.getContext(), ICommandService.class);
cc.getContext().stopService(intent);
break;
case "historyActivity":
CCUtil.navigateTo(cc, HistoryOrderActivity.class);
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
case "initAddress":
ServiceCreator.INSTANCE.init();
break;
case "SendOrder":
CCUtil.navigateTo(cc, SendOrderActivity.class);
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
case "PrjQueryActivity":
CCUtil.navigateTo(cc, PrjQueryActivity.class);
CC.sendCCResult(cc.getCallId(), CCResult.success());
break;
default:
// cc.callAsync(new IComponentCallback() {
// @Override
// public void onResult(CC cc, CCResult result) {
//
// }
// });
//这个逻辑分支上没有调用CC.sendCCResult(...),是一种错误的示例
//并且方法的返回值为false,代表不会异步调用CC.sendCCResult(...)
//在LocalCCInterceptor中将会返回错误码为-10的CCResult
break;
}
return false;
}
private void lifecycleFragmentDoubleText(CC cc) {
// LifecycleFragment lifecycleFragment = cc.getParamItem("fragment");
// if (lifecycleFragment != null) {
// String text = cc.getParamItem("text", "");
// lifecycleFragment.addText(text);
// CC.sendCCResult(cc.getCallId(), CCResult.success());
// } else {
// CC.sendCCResult(cc.getCallId(), CCResult.error("no fragment params"));
// }
}
private void getLifecycleFragment(CC cc) {
// CC.sendCCResult(cc.getCallId(), CCResult.successWithNoKey(new LifecycleFragment()));
}
private void getInfo(CC cc) {
String userName = "billy";
CC.sendCCResult(cc.getCallId(), CCResult.success("userName", userName));
}
}
package com.gingersoft.gsa.delivery_pick_mode.data
import com.gingersoft.gsa.cloud.common.utils.gson.GsonUtils
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
import okhttp3.MediaType
import okhttp3.RequestBody
class DeliveryRepository private constructor(private val network: DeliveryNetwork) {
suspend fun queryDeliveryList(restaurantId: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("restaurantId", restaurantId)
.build()
network.queryDeliveryList(requestBody)
}
suspend fun addDeliveryConfig(data: DeliveryConfig.Data.DeliveryInfo) = withContext(Dispatchers.IO) {
val requestBody = RequestBody.create(MediaType.parse("application/json"), GsonUtils.GsonString(data)!!)
network.addDeliveryList(requestBody)
}
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()
network.updateDelivery(requestBody)
}
companion object {
private lateinit var instance: DeliveryRepository
fun getInstance(network: DeliveryNetwork): DeliveryRepository {
if (!Companion::instance.isInitialized) {
synchronized(DeliveryRepository::class.java) {
if (!Companion::instance.isInitialized) {
instance = DeliveryRepository(network)
}
}
}
return instance
}
}
}
\ No newline at end of file
package com.gingersoft.gsa.delivery_pick_mode.data
import com.gingersoft.gsa.delivery_pick_mode.data.network.CoolWeatherNetwork
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.FormBody
class HistoryOrderRepository private constructor(private val network: CoolWeatherNetwork) {
suspend fun getHistoryOrderList(restaurantId: String, status: String, startDate: String, endDate: String, pageIndex: String, pageSize: String, orderType: String,orderFrom:Int, orderNo: String = "", phone: String = "") = withContext(Dispatchers.IO) {
// val builder = FormBody.Builder()
// .add("restaurantId", restaurantId)
// .add("status", status)//4為已完成 6為取消
// .add("pageIndex", pageIndex)
// .add("pageSize", pageSize)
// .add("orderNo", orderNo)
// .add("startDate", startDate)
// .add("endDate", endDate)
//// .add("phone", phone)
// .add("param", phone)//訂單號或手機號
// .add("orderType", "2,7")//訂單類型 2 線上外賣訂單,7 自取訂單
// if (orderType == 8) {
// builder.add("orderType", orderType.toString())
// }
// val requestBody = builder.build()
val heWeather = network.getHistoryOrderList(restaurantId,startDate, endDate, phone, status, orderType,orderFrom, pageIndex, pageSize)
heWeather
}
suspend fun getOrderInfo(orderId: String) = withContext(Dispatchers.IO) {
val requestBody = FormBody.Builder()
.add("orderId", orderId)
.build()
val data = network.getOrderInfo(requestBody)
data
}
companion object {
private lateinit var instance: HistoryOrderRepository
fun getInstance(network: CoolWeatherNetwork): HistoryOrderRepository {
if (!::instance.isInitialized) {
synchronized(HistoryOrderRepository::class.java) {
if (!::instance.isInitialized) {
instance = HistoryOrderRepository(network)
}
}
}
return instance
}
}
}
\ No newline at end of file
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