pull/26/head
Xie Changrong 3 years ago
parent 4d08d4be05
commit b208d0aea3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 169 KiB

@ -19,9 +19,9 @@
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_history.xml" value="0.22" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_main.xml" value="0.1" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_main2.xml" value="0.10235507246376811" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_menu.xml" value="0.33" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_menu.xml" value="0.25" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_no_pick.xml" value="0.2" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_sign_up.xml" value="0.10235507246376811" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_sign_up.xml" value="0.22" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/activity_wait.xml" value="0.18" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/buttom.xml" value="0.10235507246376811" />
<entry key="..\:/shijianer/xcr_se/src/Logistics/app/src/main/res/layout/forget.xml" value="0.2630208333333333" />

@ -21,6 +21,9 @@ import com.example.logistics.R;
import com.example.logistics.manager.goodManager;
public class FindUI extends Fragment implements View.OnClickListener{
private String TAG = "FindUI";
private Context mContext;
private Button mButton;
private EditText mPickUpCode;
@ -33,12 +36,16 @@ public class FindUI extends Fragment implements View.OnClickListener{
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Log.d(TAG, "onCreate");
View view = inflater.inflate(R.layout.my_fragment1,container,false);
mButton = (Button)view.findViewById(R.id.Sea_Button);
mPickUpCode = (EditText)view.findViewById(R.id.Sea_PickUpCode);
mPhoneNum = (EditText)view.findViewById(R.id.Sea_PhoneNum);
mButton.setOnClickListener(this);
mContext = getActivity();
return view;
}
@ -46,7 +53,10 @@ public class FindUI extends Fragment implements View.OnClickListener{
public void onClick(View v) {
switch(v.getId()){
case R.id.Sea_Button:
Log.d(TAG, "search");
search(v);
break;
}
}

@ -17,6 +17,7 @@ import androidx.fragment.app.FragmentManager;
import com.example.logistics.R;
public class MenuActivity extends AppCompatActivity implements View.OnClickListener{
private LinearLayout ly_one,ly_two,ly_three;
private TextView mTextView1,mTextView2,mTextView3;
private TextView mTextNum1,mTextNum2,mTextNum3;
@ -29,6 +30,7 @@ public class MenuActivity extends AppCompatActivity implements View.OnClickListe
private String owner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu);

@ -246,9 +246,12 @@ public class PickUpUI extends Fragment implements View.OnClickListener{
boolean flag1 = operationManager.add(pickupcode, user);
boolean flag2 = goodManager.delete(pickupcode);
boolean flag = flag1 & flag2;
if (flag) {
msg = 1;
if (!flag1) {
msg = 2;
}
if(!flag2){
msg = 3;
}
hand1.sendEmptyMessage(msg);
@ -268,9 +271,9 @@ public class PickUpUI extends Fragment implements View.OnClickListener{
Toast.makeText(mContext, "加入队列成功", Toast.LENGTH_SHORT).show();
joinQueue();
}else if(msg.what == 2){
Toast.makeText(mContext, "手机号错误", Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, "出库失败", Toast.LENGTH_SHORT).show();
}else if(msg.what == 3){
Toast.makeText(mContext, "取件码不存在", Toast.LENGTH_SHORT).show();
Toast.makeText(mContext, "保存记录失败", Toast.LENGTH_SHORT).show();
}
}
};

@ -6,6 +6,7 @@ import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
@ -16,8 +17,12 @@ import com.example.logistics.manager.userManager;
import com.example.logistics.entity.User;
public class SignUpUI extends Activity {
private String TAG = "SignUpUI";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);
@ -28,16 +33,20 @@ public class SignUpUI extends Activity {
new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "SignUp:onClick");
register(v);
}
}
);
// 返回登录按钮监听器
backLoginButton.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
// 跳转到登录界面
Log.d(TAG, "BackLogin:onClick");
Intent intent = new Intent(SignUpUI.this, LoginUI.class);
startActivity(intent);
}
@ -47,6 +56,9 @@ public class SignUpUI extends Activity {
}
public void register(View view){
Log.d(TAG, "register");
EditText userName = (EditText) this.findViewById(R.id.UserNameEdit);
EditText passWord = (EditText) this.findViewById(R.id.PassWordEdit);
EditText passWordAgain = (EditText) this.findViewById(R.id.PassWordAgainEdit);
@ -58,16 +70,33 @@ public class SignUpUI extends Activity {
String strPhoneNumber = phone.getText().toString().trim();
if (strUserName.length() > 10) {
Log.d(TAG, "username out of length");
Toast.makeText(SignUpUI.this, "用户名长度必须小于10", Toast.LENGTH_SHORT).show();
} else if (strUserName.length() == 0) {
Log.d(TAG, "username is none");
Toast.makeText(SignUpUI.this, "用户名不能为空!", Toast.LENGTH_SHORT).show();
} else if (strPassWord.length() > 16) {
Log.d(TAG, "password out of length");
Toast.makeText(SignUpUI.this, "密码长度必须小于16", Toast.LENGTH_SHORT).show();
} else if (strPassWord.length() == 0) {
Log.d(TAG, "password is none");
Toast.makeText(SignUpUI.this, "密码不能为空!", Toast.LENGTH_SHORT).show();
} else if (!strPassWord.equals(strPassWordAgain)) {
Log.d(TAG, "password is not same");
Toast.makeText(SignUpUI.this, "两次密码输入不一致!", Toast.LENGTH_SHORT).show();
} else {
Log.d(TAG, "register success");
Toast.makeText(SignUpUI.this, "注册成功!", Toast.LENGTH_SHORT).show();
User user = new User();
@ -78,17 +107,27 @@ public class SignUpUI extends Activity {
new Thread(){
@Override
public void run(){
Log.d(TAG, "register thread");
int msg = 0;
userManager userManager = new userManager();
User uu = userManager.findUser(user.getUserName());
if(uu != null){
Log.d(TAG, "have this account");
msg = 1; //have this account
}else{
Log.d(TAG, "have no this account");
boolean flag = userManager.register(user);
if(flag){
Log.d(TAG, "register success");
msg = 2;
}
}
hand.sendEmptyMessage(msg);
@ -100,14 +139,24 @@ public class SignUpUI extends Activity {
@SuppressLint("HandlerLeak")
final Handler hand = new Handler(){
public void handleMessage(Message msg){
Log.d(TAG, "msg is:" + msg.toString());
if(msg.what == 0){
Toast.makeText(getApplicationContext(), "注册失败", Toast.LENGTH_SHORT).show();
}else if(msg.what == 1){
Toast.makeText(getApplicationContext(), "该账号已存在,请换一个注册", Toast.LENGTH_SHORT).show();
}else if(msg.what == 2){
Toast.makeText(getApplicationContext(), "注册成功", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(SignUpUI.this, LoginUI.class);
startActivity(intent);
}
}
};

Loading…
Cancel
Save