增加 1 修改 2
parent
f8b61fef03
commit
ee6ada7129
@ -0,0 +1,71 @@
|
||||
package com.example.pulit;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.example.pulit.util.MyOkGoCallback;
|
||||
import com.example.pulit.util.Resust;
|
||||
import com.example.pulit.util.SharedPreferencesUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
|
||||
public class LtActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.lt_code)
|
||||
TextView ltCode;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_lt);
|
||||
ButterKnife.bind(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scanInfo(String info) {
|
||||
ltCode.setText(info);
|
||||
dialog.show();
|
||||
OkGo.<Resust>get("http://" + SharedPreferencesUtils.getstring("ip", null) + "/api/xl_material/MaterialVerification")
|
||||
.params("barCode", info)
|
||||
.execute(new MyOkGoCallback() {
|
||||
@Override
|
||||
public void onSuccess(Response<Resust> response) {
|
||||
super.onSuccess(response);
|
||||
dialog.dismiss();
|
||||
|
||||
Resust body = response.body();
|
||||
tipDialog.showMsg(body.isSuccess(), body.getMsg());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<Resust> response) {
|
||||
super.onError(response);
|
||||
dialog.dismiss();
|
||||
Toast.makeText(LtActivity.this, "网络请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@OnClick({R.id.lt_title_back, R.id.lt_scan})
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.lt_title_back:
|
||||
this.finish();
|
||||
break;
|
||||
case R.id.lt_scan:
|
||||
super.sanCode();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".LtActivity"
|
||||
android:orientation="vertical">
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:background="@color/blue"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/title_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="料筒验证" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/lt_title_back"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="15dp"
|
||||
android:src="@mipmap/icon_back" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/text_view"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="扫描料桶" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lt_code"
|
||||
style="@style/text_view2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/lt_scan"
|
||||
style="@style/button_style1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="202dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="触发扫描" />
|
||||
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue