Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dfe234d2
authored
Oct 11, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加网址转化二维码功能
parent
f27e9650
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
182 additions
and
23 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/dayu/bigfish/ui/ManagerActivity.java
app/src/main/java/com/dayu/bigfish/utils/HxManager.java
baseSDK/build.gradle
baseSDK/src/main/java/com/dayu/utils/QRCodeUtils.java
build.gradle
orderCenter/src/main/java/com/dayu/order/api/OrderApiFactory.java
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
orderCenter/src/main/java/com/dayu/order/common/OrderConstant.java
orderCenter/src/main/java/com/dayu/order/presenter/multipleprocess/MultipleProcessPresenter.java
orderCenter/src/main/java/com/dayu/order/presenter/qrcode/QRCodeContract.java
orderCenter/src/main/java/com/dayu/order/presenter/qrcode/QRCodePresenter.java
orderCenter/src/main/java/com/dayu/order/ui/activity/QrCodeActivity.java
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
orderCenter/src/main/java/com/dayu/order/ui/fragment/OrderDetaillsFragment.java
orderCenter/src/main/res/layout/qr_code_layout.xml
app/src/main/AndroidManifest.xml
View file @
dfe234d2
...
...
@@ -140,6 +140,7 @@
android:screenOrientation=
"portrait"
/>
<activity
android:name=
"com.dayu.bigfish.ui.ManagerActivity"
android:launchMode=
"singleTask"
android:screenOrientation=
"portrait"
/>
</application>
...
...
app/src/main/java/com/dayu/bigfish/ui/ManagerActivity.java
View file @
dfe234d2
package
com
.
dayu
.
bigfish
.
ui
;
import
android.content.Intent
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentManager
;
import
android.support.v4.app.FragmentTransaction
;
...
...
@@ -9,6 +10,7 @@ import android.view.View;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.dayu.base.ui.activity.BaseActivity
;
import
com.dayu.bigfish.R
;
import
com.dayu.bigfish.api.protocol.InformBean
;
import
com.dayu.bigfish.databinding.ActivityManagerBinding
;
import
com.dayu.bigfish.presenter.manager.ManagerContract
;
import
com.dayu.bigfish.presenter.manager.ManagerPresenter
;
...
...
@@ -50,6 +52,7 @@ public class ManagerActivity extends BaseActivity<ManagerPresenter, ActivityMana
showHideFragment
(
1
,
0
);
mBind
.
msg
.
setImageResource
(
R
.
mipmap
.
icon_news
);
});
doAction
(
getIntent
());
}
private
void
addFragment
()
{
...
...
@@ -82,6 +85,30 @@ public class ManagerActivity extends BaseActivity<ManagerPresenter, ActivityMana
}
}
public
void
doAction
(
Intent
intent
)
{
InformBean
info
=
(
InformBean
)
intent
.
getSerializableExtra
(
Constants
.
MESSAGE_INFO
);
if
(
info
!=
null
)
{
int
secondIndex
=
0
;
if
(
info
.
getCategory
()
==
1
)
{
secondIndex
=
0
;
//系统通知
}
else
if
(
info
.
getCategory
()
==
2
)
{
secondIndex
=
1
;
//大鱼通知
}
showHideFragment
(
1
,
0
);
mBind
.
msg
.
setImageResource
(
R
.
mipmap
.
icon_news
);
if
(
mMessageFragment
!=
null
)
{
mMessageFragment
.
setIndex
(
secondIndex
);
mMessageFragment
.
swtichFragment
(
secondIndex
);
}
}
}
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
doAction
(
intent
);
}
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
...
...
app/src/main/java/com/dayu/bigfish/utils/HxManager.java
View file @
dfe234d2
...
...
@@ -126,16 +126,6 @@ public class HxManager {
if
(!(
boolean
)
SPUtils
.
get
(
Constants
.
HX_STATE
,
true
))
{
return
;
}
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
2
))
{
MediaPlayer
player
=
MediaPlayer
.
create
(
mContext
,
R
.
raw
.
new_order
);
player
.
start
();
}
else
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
4
))
{
MediaPlayer
player
=
MediaPlayer
.
create
(
mContext
,
R
.
raw
.
manager_order
);
player
.
start
();
}
else
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
5
))
{
MediaPlayer
player
=
MediaPlayer
.
create
(
mContext
,
R
.
raw
.
eu_order
);
player
.
start
();
}
Intent
intent
;
if
(
UserManager
.
getInstance
().
getRole
()
==
Constants
.
MANAGER_NOSITE_ENGINEER
||
UserManager
.
getInstance
().
getRole
()
==
Constants
.
MANAGER
)
{
...
...
@@ -170,6 +160,18 @@ public class HxManager {
if
(
notificationManager
!=
null
)
{
notificationManager
.
notify
(
0
,
builder
.
build
());
}
int
res
=
-
1
;
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
2
))
{
res
=
R
.
raw
.
new_order
;
}
else
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
4
))
{
res
=
R
.
raw
.
manager_order
;
}
else
if
(
info
.
getCategory
()
==
1
&&
(
info
.
getFunctionType
()
==
5
))
{
res
=
R
.
raw
.
eu_order
;
}
if
(
res
!=
-
1
)
{
MediaPlayer
player
=
MediaPlayer
.
create
(
mContext
,
res
);
player
.
start
();
}
mCount
++;
BadgeNumberManager
.
from
(
mContext
).
setBadgeNumber
(
mCount
);
BadgeNumberUtils
.
setBadgeNumberXiaoMi
(
notification
,
mCount
);
...
...
@@ -204,7 +206,7 @@ public class HxManager {
//注册环信消息监听
EMClient
.
getInstance
().
chatManager
().
addMessageListener
(
msgListener
);
//注册一个监听连接状态的listener
//注册一个监听连接状态的listener
//TODO 打开单设备登录.
// EMClient.getInstance().addConnectionListener(new MyConnectionListener());
}
...
...
baseSDK/build.gradle
View file @
dfe234d2
...
...
@@ -65,7 +65,7 @@ dependencies {
//jsbridge
api
'com.github.lzyzsd:jsbridge:1.0.4'
//zxing
api
'com.google.zxing:core:3.3.
2
'
api
'com.google.zxing:core:3.3.
3
'
api
'com.journeyapps:zxing-android-embedded:3.5.0'
api
project
(
':locationComponent'
)
...
...
baseSDK/src/main/java/com/dayu/utils/QRCodeUtils.java
0 → 100644
View file @
dfe234d2
package
com
.
dayu
.
utils
;
import
android.graphics.Bitmap
;
import
com.google.zxing.BarcodeFormat
;
import
com.google.zxing.MultiFormatWriter
;
import
com.google.zxing.WriterException
;
import
com.google.zxing.common.BitMatrix
;
import
com.journeyapps.barcodescanner.BarcodeEncoder
;
/**
* Created by luofan
* on 2018/10/11.
*/
public
class
QRCodeUtils
{
public
static
Bitmap
createBitmap
(
String
str
){
Bitmap
bitmap
=
null
;
BitMatrix
result
;
MultiFormatWriter
multiFormatWriter
=
new
MultiFormatWriter
();
try
{
result
=
multiFormatWriter
.
encode
(
str
,
BarcodeFormat
.
QR_CODE
,
800
,
800
);
BarcodeEncoder
barcodeEncoder
=
new
BarcodeEncoder
();
bitmap
=
barcodeEncoder
.
createBitmap
(
result
);
}
catch
(
WriterException
e
){
e
.
printStackTrace
();
}
catch
(
IllegalArgumentException
iae
){
return
null
;
}
return
bitmap
;
}
}
build.gradle
View file @
dfe234d2
...
...
@@ -5,8 +5,8 @@ buildscript {
ext
.
build_tools_version
=
"27.0.3"
ext
.
min_sdk_version
=
16
ext
.
target_sdk_version
=
23
ext
.
version_code
=
1
6
ext
.
verson_name
=
"1.9.
3
"
ext
.
version_code
=
1
7
ext
.
verson_name
=
"1.9.
4
"
ext
.
gradle_version
=
'3.1.4'
ext
.
isReleaseMinify
=
true
ext
.
isDebugMinify
=
true
...
...
orderCenter/src/main/java/com/dayu/order/api/OrderApiFactory.java
View file @
dfe234d2
...
...
@@ -141,4 +141,8 @@ public class OrderApiFactory {
public
static
Observable
<
Boolean
>
certificationLive
(
RequestBody
body
)
{
return
Api
.
getService
(
OrderService
.
class
).
certificationLive
(
body
).
compose
(
Api
.
applySchedulers
());
}
public
static
Observable
<
String
>
createUrl
(
int
orderId
)
{
return
Api
.
getService
(
OrderService
.
class
).
createUrl
(
orderId
).
compose
(
Api
.
applySchedulers
());
}
}
orderCenter/src/main/java/com/dayu/order/api/OrderService.java
View file @
dfe234d2
...
...
@@ -315,4 +315,12 @@ interface OrderService {
*/
@POST
(
OrderConstant
.
FACE_CERTIFICAITON
)
Observable
<
BaseResponse
<
Boolean
>>
certificationLive
(
@Body
RequestBody
body
);
/**
* 获取客户验收url.
* @param orderId
* @return
*/
@GET
(
OrderConstant
.
CREATE_URL
)
Observable
<
BaseResponse
<
String
>>
createUrl
(
@Path
(
"orderId"
)
int
orderId
);
}
orderCenter/src/main/java/com/dayu/order/common/OrderConstant.java
View file @
dfe234d2
...
...
@@ -73,10 +73,10 @@ public class OrderConstant {
*/
public
final
static
String
KA_ADDRESS
=
"/api-ka-user/"
+
"companyAddress/default/companyId/{companyId}"
;
/**
/**
* 获取厂商选择的收货地址.
*/
public
final
static
String
KA_SELECT_ADDRESS
=
"/api-ka-user/"
+
"/companyAddress/sendAddress"
;
public
final
static
String
KA_SELECT_ADDRESS
=
"/api-ka-user/"
+
"/companyAddress/sendAddress"
;
/**
* 申请备件.
...
...
@@ -156,6 +156,11 @@ public class OrderConstant {
/**
* 接单活体检测校验.
*/
public
final
static
String
FACE_CERTIFICAITON
=
"/api-third/"
+
"detect/receiptOrderVerify"
;
public
final
static
String
FACE_CERTIFICAITON
=
"/api-third/"
+
"detect/receiptOrderVerify"
;
/**
* 获取客户验收url
*/
public
final
static
String
CREATE_URL
=
"/api-user"
+
"/account/createUrlByOrderId/{orderId}"
;
}
orderCenter/src/main/java/com/dayu/order/presenter/multipleprocess/MultipleProcessPresenter.java
View file @
dfe234d2
...
...
@@ -171,6 +171,7 @@ public class MultipleProcessPresenter extends MultipleProcessContract.Presenter
if
(
integer
==
6
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
TYPE
,
1
);
bundle
.
putInt
(
Constants
.
ORDER_ID
,
mSpus
.
get
(
0
).
getOrderId
());
mView
.
startActivity
(
QrCodeActivity
.
class
,
bundle
);
}
else
{
ARouter
.
getInstance
().
build
(
RouterPath
.
PATH_MAIN
).
navigation
();
...
...
orderCenter/src/main/java/com/dayu/order/presenter/qrcode/QRCodeContract.java
0 → 100755
View file @
dfe234d2
package
com
.
dayu
.
order
.
presenter
.
qrcode
;
import
android.graphics.Bitmap
;
import
com.dayu.base.ui.presenter.BasePresenter
;
import
com.dayu.common.BaseView
;
/**
* Created by luo
* on 2016/8/4.
*/
public
interface
QRCodeContract
{
interface
View
extends
BaseView
{
void
setBitmap
(
Bitmap
bitmap
);
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
public
abstract
void
getUrl
();
}
}
orderCenter/src/main/java/com/dayu/order/presenter/qrcode/QRCodePresenter.java
0 → 100644
View file @
dfe234d2
package
com
.
dayu
.
order
.
presenter
.
qrcode
;
import
android.graphics.Bitmap
;
import
com.dayu.common.Constants
;
import
com.dayu.order.api.OrderApiFactory
;
import
com.dayu.utils.QRCodeUtils
;
/**
* Created by luofan
* on 2017/11/8.
*/
public
class
QRCodePresenter
extends
QRCodeContract
.
Presenter
{
private
int
mId
;
@Override
public
void
onAttached
()
{
mId
=
mView
.
getBundle
().
getInt
(
Constants
.
ORDER_ID
);
getUrl
();
}
@Override
public
void
getUrl
()
{
mView
.
showDialog
();
OrderApiFactory
.
createUrl
(
mId
).
subscribe
(
baseObserver
(
s
->
{
Bitmap
bitmap
=
QRCodeUtils
.
createBitmap
(
s
);
mView
.
setBitmap
(
bitmap
);
}));
}
}
orderCenter/src/main/java/com/dayu/order/ui/activity/QrCodeActivity.java
View file @
dfe234d2
package
com
.
dayu
.
order
.
ui
.
activity
;
import
android.graphics.Bitmap
;
import
android.os.Bundle
;
import
android.text.SpannableString
;
import
android.text.Spanned
;
import
android.text.style.ForegroundColorSpan
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.dayu.base.ui.activity.
DataBinding
Activity
;
import
com.dayu.base.ui.activity.
Base
Activity
;
import
com.dayu.common.Constants
;
import
com.dayu.order.R
;
import
com.dayu.order.databinding.QrCodeLayoutBinding
;
import
com.dayu.order.presenter.qrcode.QRCodeContract
;
import
com.dayu.order.presenter.qrcode.QRCodePresenter
;
import
com.dayu.provider.event.RefreshServe
;
import
com.dayu.provider.router.RouterPath
;
import
com.dayu.utils.QRCodeUtils
;
import
org.greenrobot.eventbus.EventBus
;
...
...
@@ -20,7 +24,7 @@ import org.greenrobot.eventbus.EventBus;
* on 2018/1/31.
*/
public
class
QrCodeActivity
extends
DataBindingActivity
<
QrCodeLayoutBinding
>
{
public
class
QrCodeActivity
extends
BaseActivity
<
QRCodePresenter
,
QrCodeLayoutBinding
>
implements
QRCodeContract
.
View
{
private
int
mType
;
@Override
...
...
@@ -53,4 +57,14 @@ public class QrCodeActivity extends DataBindingActivity<QrCodeLayoutBinding> {
EventBus
.
getDefault
().
post
(
new
RefreshServe
(
1
));
}
}
@Override
public
void
setPresenter
()
{
}
@Override
public
void
setBitmap
(
Bitmap
bitmap
)
{
mBind
.
qrCode
.
setImageBitmap
(
bitmap
);
}
}
orderCenter/src/main/java/com/dayu/order/ui/adapter/OrderAdapter.java
View file @
dfe234d2
...
...
@@ -237,7 +237,10 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
String
temp
=
time
;
holder
.
itemUpdataTime
.
setOnClickListener
(
v
->
{
if
(
item
.
getStatus
()
==
4
&&
item
.
getSubStatus
()
==
6
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
ORDER_ID
,
item
.
getId
());
Intent
intent
=
new
Intent
(
mContext
,
QrCodeActivity
.
class
);
intent
.
putExtra
(
Constants
.
BUNDLE
,
bundle
);
mContext
.
startActivity
(
intent
);
}
else
{
dumpSubcribeTimeActivity
(
id
,
position
,
item
.
getStatus
(),
temp
);
...
...
orderCenter/src/main/java/com/dayu/order/ui/fragment/MultiOrderDetailFragment.java
View file @
dfe234d2
...
...
@@ -106,7 +106,11 @@ public class MultiOrderDetailFragment extends DataBindingFragment<FragmentMultiD
mBind
.
customerAcceptance
.
setVisibility
(
View
.
GONE
);
}
mBind
.
customerAcceptance
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
mActivity
,
QrCodeActivity
.
class
));
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
ORDER_ID
,
detail
.
getId
());
Intent
intent
=
new
Intent
(
mActivity
,
QrCodeActivity
.
class
);
intent
.
putExtra
(
Constants
.
BUNDLE
,
bundle
);
startActivity
(
intent
);
MobclickAgent
.
onEvent
(
mActivity
,
"customer_apponitment"
);
});
if
(
detail
.
getEsignatureImg
()
==
null
)
{
...
...
orderCenter/src/main/java/com/dayu/order/ui/fragment/OrderDetaillsFragment.java
View file @
dfe234d2
...
...
@@ -70,7 +70,11 @@ public class OrderDetaillsFragment extends DataBindingFragment<FragmentOrderData
mBind
.
customerAcceptance
.
setVisibility
(
View
.
GONE
);
}
mBind
.
customerAcceptance
.
setOnClickListener
(
v
->
{
startActivity
(
new
Intent
(
mActivity
,
QrCodeActivity
.
class
));
Bundle
bundle
=
new
Bundle
();
bundle
.
putInt
(
Constants
.
ORDER_ID
,
dataBean
.
getId
());
Intent
intent
=
new
Intent
(
mActivity
,
QrCodeActivity
.
class
);
intent
.
putExtra
(
Constants
.
BUNDLE
,
bundle
);
startActivity
(
intent
);
MobclickAgent
.
onEvent
(
mActivity
,
"customer_apponitment"
);
});
mBind
.
tvOrderRmark
.
post
(()
->
{
...
...
orderCenter/src/main/res/layout/qr_code_layout.xml
View file @
dfe234d2
...
...
@@ -29,10 +29,10 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/qr_code"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"100dp"
android:src=
"@drawable/icon_appointment_code"
/>
android:layout_marginTop=
"100dp"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment