|
@@ -1,16 +1,13 @@
|
|
|
package com.wdkl.app.ncs.callingbed.fragment
|
|
|
|
|
|
-import android.content.Intent
|
|
|
import android.graphics.Color
|
|
|
import android.text.TextUtils
|
|
|
-import android.util.Log
|
|
|
import android.view.View
|
|
|
import com.enation.javashop.net.engine.model.NetState
|
|
|
import com.wdkl.app.ncs.callingbed.BuildConfig
|
|
|
import com.wdkl.app.ncs.callingbed.R
|
|
|
import com.wdkl.app.ncs.callingbed.activity.CallingbedActivity
|
|
|
import com.wdkl.app.ncs.callingbed.databinding.MainViewLayoutBinding
|
|
|
-import com.wdkl.app.ncs.callingbed.helper.SerialPortHelper
|
|
|
import com.wdkl.app.ncs.callingbed.launch.CallingbedLaunch
|
|
|
import com.wdkl.ncs.android.lib.base.BaseFragment
|
|
|
import com.wdkl.ncs.android.lib.utils.*
|
|
@@ -32,6 +29,8 @@ import org.greenrobot.eventbus.ThreadMode
|
|
|
class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>(), MainFragmentContract.View{
|
|
|
val TAG = "MainFragment"
|
|
|
|
|
|
+ val QR_CODE_URL2 = "http://n.szwdkl.cn?type=BIND_PART_AND_ADDR"
|
|
|
+
|
|
|
override fun getLayId(): Int {
|
|
|
return R.layout.main_view
|
|
|
}
|
|
@@ -114,6 +113,23 @@ class MainFragment: BaseFragment<MainFragmentPresenter, MainViewLayoutBinding>()
|
|
|
|
|
|
updateMoreConfigs(customInfo.list)
|
|
|
}
|
|
|
+
|
|
|
+ if (Constant.DEVICE_STATUS == 1 && Constant.CUSTOM_ID != -1) {
|
|
|
+ Thread {
|
|
|
+ var builder = StringBuilder()
|
|
|
+ builder.append(QR_CODE_URL2)
|
|
|
+ builder.append("&no=")
|
|
|
+ builder.append(Constant.PART_UNION_ID)
|
|
|
+ builder.append("&page=shopping")
|
|
|
+ builder.append("&addr=")
|
|
|
+ builder.append(Constant.PART_NAME)
|
|
|
+ builder.append(Constant.BED_NAME)
|
|
|
+ val code = EcodeHelper().createQRImage(builder.toString(), 180, null)
|
|
|
+ activity.runOnUiThread {
|
|
|
+ main_view_qr_code?.setImageBitmap(code)
|
|
|
+ }
|
|
|
+ }.start()
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
override fun showEvents(data: ArrayList<EventDO>) {
|