Commit 721e254f authored by shiyl's avatar shiyl

新建商户订单组件

parent 7eb87917
...@@ -163,6 +163,21 @@ class XRouterPathConstants { ...@@ -163,6 +163,21 @@ class XRouterPathConstants {
// 订单 — 订单列表 // 订单 — 订单列表
const val ORDER_LIST_ACTIVITY = "/b/user_order/order_list" const val ORDER_LIST_ACTIVITY = "/b/user_order/order_list"
/**
* BMerchantOrder组件内的页面
*/
// 商户订单 — 订单中心
const val MERCHANT_ORDER_CENTER_ACTIVITY = "/b/merchant_order/merchant_order_center"
// 商户订单 — 订单列表
const val MERCHANT_ORDER_LIST_ACTIVITY = "/b/merchant_order/merchant_order_list"
// 商户订单 — 订单搜索
const val MERCHANT_ORDER_SEARCH_ACTIVITY = "/b/merchant_order/merchant_order_search"
// 商户订单 — 订单详情
const val MERCHANT_ORDER_DETAILS_ACTIVITY = "/b/merchant_order/merchant_order_details"
/** /**
* C端页面 * C端页面
*/ */
......
/build
\ No newline at end of file
if (rootProject.ext.android.isApplication) {
apply plugin: 'com.android.application'
apply plugin: 'yac-engine'
} else {
apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
rootProject.ext.artifact_id = 'merchantOrder'
apply from:'../../publish.gradle'
android {
compileSdkVersion build_versions.compileSdkVersion
defaultConfig {
if (rootProject.ext.android.isApplication) {
applicationId "com.yidian.shenghuoquan.bmerchantorder"
}
minSdkVersion build_versions.minSdkVersion
targetSdkVersion build_versions.targetSdkVersion
versionCode rootProject.ext.android.versionCode
versionName rootProject.ext.android.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main {
if (rootProject.ext.android.isApplication) {
manifest.srcFile 'src/main/manifest/AndroidManifest.xml'
} else {
manifest.srcFile 'src/main/AndroidManifest.xml'
}
}
}
buildFeatures {
viewBinding true
dataBinding true
}
kapt {
generateStubs = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
rootProject.ext.dependencies.other.each {
implementation project(it)
}
compileOnly rootProject.ext.dependencies.privateImplementation
testImplementation rootProject.ext.dependencies.testImplementation
androidTestImplementation rootProject.ext.dependencies.androidTestImplementation
}
\ No newline at end of file
# 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
package com.yidian.shenghuoquan.bmerchantorder
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.yidian.shenghuoquan.bmerchantorder.test", appContext.packageName)
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yidian.shenghuoquan.bmerchantorder">
<application>
<activity
android:name=".ui.MerchantOrderCenterActivity"
android:theme="@style/AppTheme" />
</application>
</manifest>
\ No newline at end of file
package com.yidian.shenghuoquan.bmerchantorder.app
import android.content.Intent
import com.yidian.bcommon.app.YdBaseApplication
import com.yidian.bcommon.constant.XRouterPathConstants
import com.yidian.news.util.ProcessUtil
import com.yidian.xpage.XPageManager
import com.yidian.xpage.node.XPageHandler
import com.yidian.xpage.node.XPageNode
import com.yidian.xpage.node.XPageNodePageType
import com.yidian.yac.core.core.YacModuleSpec
@YacModuleSpec
class BMerchantOrderApplication: YdBaseApplication() {
override fun onCreate() {
super.onCreate()
if (ProcessUtil.isMainProcess(this)) {
registerXPage()
initService()
}
}
private fun initService() {
}
private fun registerXPage() {
ClassMapUtil.xPageNodeMap.forEach {
val node = XPageNode(it.key, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, it.value)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
})
XPageManager.registeredNode(node)
}
}
}
package com.yidian.shenghuoquan.bmerchantorder.app
import com.yidian.bcommon.constant.XRouterPathConstants
import com.yidian.shenghuoquan.bmerchantorder.ui.MerchantOrderCenterActivity
/**
* 注册XPageNode工具类
*/
object ClassMapUtil {
val xPageNodeMap = mapOf(
XRouterPathConstants.Companion.MERCHANT_ORDER_CENTER_ACTIVITY to MerchantOrderCenterActivity::class.java,
// XRouterPathConstants.Companion.MERCHANT_ORDER_LIST_ACTIVITY to OrderDetailActivity::class.java,
// XRouterPathConstants.Companion.MERCHANT_ORDER_SEARCH_ACTIVITY to SelectPickupPointActivity::class.java,
// XRouterPathConstants.Companion.MERCHANT_ORDER_DETAILS_ACTIVITY to OrderListActivity::class.java,
)
}
package com.yidian.shenghuoquan.bmerchantorder.ui
import androidx.activity.viewModels
import com.yidian.bcommon.constant.XRouterPathConstants
import com.yidian.bcommon.mvvm.BaseMvvmActivity
import com.yidian.shenghuoquan.bmerchantorder.R
import com.yidian.shenghuoquan.bmerchantorder.databinding.BmerchantorderActivityMerchantOrderCenterBinding
import com.yidian.shenghuoquan.bmerchantorder.viewmodel.MerchantOrderCenterViewModel
import com.yidian.xpage.XPageViewProtocol
/**
* 商户订单中心
*/
class MerchantOrderCenterActivity : BaseMvvmActivity<BmerchantorderActivityMerchantOrderCenterBinding, MerchantOrderCenterViewModel>(),
XPageViewProtocol {
override val layoutId: Int = R.layout.bmerchantorder_activity_merchant_order_center
override val vm: MerchantOrderCenterViewModel by viewModels()
override fun getXPageName(): String {
return XRouterPathConstants.MERCHANT_ORDER_CENTER_ACTIVITY
}
override fun initView() {
}
}
package com.yidian.shenghuoquan.bmerchantorder.viewmodel
import com.yidian.bcommon.mvvm.BaseViewModel
class MerchantOrderCenterViewModel : BaseViewModel() {
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yidian.shenghuoquan.bmerchantorder">
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="vm"
type="com.yidian.shenghuoquan.bmerchantorder.viewmodel.MerchantOrderCenterViewModel" />
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
\ No newline at end of file
package com.yidian.shenghuoquan.bmerchantorder
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
...@@ -11,7 +11,7 @@ import com.yidian.xpage.node.XPageNodePageType ...@@ -11,7 +11,7 @@ import com.yidian.xpage.node.XPageNodePageType
import com.yidian.yac.core.core.YacModuleSpec import com.yidian.yac.core.core.YacModuleSpec
@YacModuleSpec @YacModuleSpec
class BOrderApplication: YdBaseApplication() { class BUserOrderApplication: YdBaseApplication() {
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
......
...@@ -11,3 +11,4 @@ include ':Components:BGeneralBusiness' ...@@ -11,3 +11,4 @@ include ':Components:BGeneralBusiness'
include ':Components:BUserOrder' include ':Components:BUserOrder'
include ':Components:BMediator' include ':Components:BMediator'
include ':Components:BDemo' include ':Components:BDemo'
include ':Components:BMerchantOrder'
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