增加 - 解绑、补打条码
parent
ab0c066f18
commit
3febefc900
@ -1,20 +0,0 @@
|
||||
{
|
||||
"version": 3,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.example.aucma_mes",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 5,
|
||||
"versionName": "1.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
"elementType": "File"
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.example.aucma_mes;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.example.aucma_mes.base.BaseActivity;
|
||||
import com.example.aucma_mes.databinding.ActivityUnbindBinding;
|
||||
import com.example.aucma_mes.entity.CheckSum;
|
||||
import com.example.aucma_mes.entity.Result;
|
||||
import com.example.aucma_mes.utils.MyRecultCall;
|
||||
import com.example.aucma_mes.utils.SharedPreferencesUtils;
|
||||
import com.lzy.okgo.OkGo;
|
||||
import com.lzy.okgo.model.Response;
|
||||
|
||||
public class UnbindActivity extends BaseActivity {
|
||||
private ActivityUnbindBinding binding;
|
||||
private boolean type;
|
||||
private String uri;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
binding = DataBindingUtil.setContentView(this, R.layout.activity_unbind);
|
||||
getSupportActionBar().hide();
|
||||
type = getIntent().getBooleanExtra("type", false);
|
||||
if (type){
|
||||
uri="/api/unbindBarCode";
|
||||
binding.setTitle("条码解绑");
|
||||
} else{
|
||||
uri="/api/rebarCode";
|
||||
binding.setTitle("补打条码");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void sanInfo(String code) {
|
||||
binding.unbindBoxCode.setText(code);
|
||||
}
|
||||
|
||||
public void unBindSubmit(View view) {
|
||||
|
||||
OkGo.<Result>post(url + uri).tag(this)
|
||||
.headers("Authorization", SharedPreferencesUtils.getstring("token", ""))
|
||||
.params("barCode", binding.unbindBoxCode.getText().toString().trim()).execute(new MyRecultCall(dialog, this) {
|
||||
@Override
|
||||
public void onSuccess(Response<Result> response) {
|
||||
super.onSuccess(response);
|
||||
Result result = response.body();
|
||||
Toast.makeText(UnbindActivity.this, result.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
if (type&&result.getCode()==200) {
|
||||
binding.unbindBoxCode.setText(null);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void unBindSubmit1(View view) {
|
||||
sanInfo("123");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".UnbindActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:background="@color/blue"
|
||||
android:gravity="center|left"
|
||||
android:paddingStart="12dp"
|
||||
android:text="@{title}"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
android:layout_marginEnd="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/text_style1"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="箱壳条码:" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/unbind_boxCode"
|
||||
style="@style/san_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
style="@style/button_true_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="20dp"
|
||||
android:onClick="unBindSubmit"
|
||||
android:text="提交" />
|
||||
<Button
|
||||
style="@style/button_true_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_margin="20dp"
|
||||
android:onClick="unBindSubmit1"
|
||||
android:visibility="gone"
|
||||
android:text="test" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue