| | |
| | | import com.bsk.zhangbo.demoforbsk.R;
|
| | | import com.bsk.zhangbo.demoforbsk.base.BaseFragment;
|
| | | import com.bsk.zhangbo.demoforbsk.listeners.OkButtonClickedListener;
|
| | | import com.bsk.zhangbo.demoforbsk.util.AppApi;
|
| | | import com.bsk.zhangbo.demoforbsk.widget.BirthdayPickerDialog;
|
| | | import com.bsk.zhangbo.demoforbsk.widget.CountrySelectionPopup;
|
| | | import com.bsk.zhangbo.demoforbsk.widget.SingleSelectionPopup;
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import cn.com.basic.face.discern.common.BaseCommonCallBack;
|
| | | import cn.com.basic.face.discern.common.CommonVariables;
|
| | | import cn.com.basic.face.discern.entity.Dictionary;
|
| | | import cn.com.basic.face.discern.query.item.VistorTypeQueryItem;
|
| | |
|
| | | /**
|
| | |
| | | private View mViewName,mViewSex,mViewNation,mViewBirthday,mViewVisitorClass,mViewPhone,mViewIdClass,mViewIdNumber,mViewCompayName,mViewRemark;
|
| | | private TextView mViewNameTitle,mViewSexTitle,mViewNationTitle,mViewBirthdyTitle,mViewIdClassContent,mViewSexContent,mViewNationContent,mViewBirthdyContent,mViewVisitorClassContent,mViewVisitorClassTitle,mViewPhoneTitle,mViewIdClassTitle,mViewIdNumberTitle,mViewCompanyNameTitle,mViewRemarkTitle;
|
| | | private EditText mViewNameContent,mViewPhoneContent,mViewIdNumberContent,mViewCompanyNameContent,mViewRemarkContent;
|
| | | private List<String> mSexList;
|
| | | private List<String> mVisitorTypeList;
|
| | | private List<String> mCredentialsList;
|
| | | private List mSexList;
|
| | | private List mVisitorTypeList;
|
| | | private List mCredentialsList;
|
| | | private LinearLayout mBaseLayout;
|
| | | private int mNowYear;
|
| | | private int mNowMonth;
|
| | |
| | |
|
| | | @Override
|
| | | protected void initData() {
|
| | | RequestParams params = new RequestParams("http://192.168.1.51:8080/ssm/VisitorType/v_list.do");
|
| | | loadVisitorTypeList();
|
| | |
|
| | | loadSexList();
|
| | |
|
| | | loadCredentialsList();
|
| | |
|
| | | }
|
| | |
|
| | | private void loadCredentialsList() {
|
| | | mCredentialsList = new ArrayList<>();
|
| | | mCredentialsList.add("名片");
|
| | | mCredentialsList.add("身份证");
|
| | |
|
| | | mViewIdClassContent.setText(""+mCredentialsList.get(0));
|
| | | }
|
| | |
|
| | | private void loadSexList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.DICTIONARY_TYPE_LIST);
|
| | | params.addParameter(Dictionary.FieldNames.type, CommonVariables.DictionaryType.SEX);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | mSexList = getList(Dictionary.class);
|
| | | mViewVisitorClassContent.setText(((Dictionary)mSexList.get(0)).getName()+"");
|
| | | }
|
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | private void loadVisitorTypeList() {
|
| | | RequestParams params = new RequestParams(AppApi.BASEURL+AppApi.VISITOR_TYPE_LIST);
|
| | | x.http().get(params, new BaseCommonCallBack() {
|
| | | public void success() {
|
| | | List<VistorTypeQueryItem> items = getList(VistorTypeQueryItem.class);
|
| | |
| | | }
|
| | |
|
| | | });
|
| | |
|
| | | mSexList = new ArrayList<>();
|
| | | mSexList.add("男");
|
| | | mSexList.add("女");
|
| | | mViewSexContent.setText(mSexList.get(0));
|
| | |
|
| | | mCredentialsList = new ArrayList<>();
|
| | | mCredentialsList.add("名片");
|
| | | mCredentialsList.add("身份证");
|
| | |
|
| | | mViewIdClassContent.setText(mCredentialsList.get(0));
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | });
|
| | | break;
|
| | | case R.id.register_nation:
|
| | | // Toast.makeText(getActivity(),"中国",Toast.LENGTH_SHORT).show();
|
| | | CountrySelectionPopup countrySelectionPopup = new CountrySelectionPopup(getActivity());
|
| | | countrySelectionPopup.showAtLocation(mBaseLayout, Gravity.CENTER,0,0);
|
| | | countrySelectionPopup.addOkButtonClickedListener(new OkButtonClickedListener() {
|
| | |
| | | });
|
| | | break;
|
| | | case R.id.register_birthday:
|
| | | // Toast.makeText(getActivity(),"1990-1-1",Toast.LENGTH_SHORT).show();
|
| | | // datePickerDialog.show();
|
| | | showDatePicker();
|
| | | break;
|
| | | case R.id.register_visitor_class:
|
| | |
| | | @Override
|
| | | public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
|
| | | int month=monthOfYear+1;
|
| | | Toast.makeText(
|
| | | getActivity(),
|
| | | year + "-" + month + "-" + dayOfMonth,
|
| | | Toast.LENGTH_SHORT).show();
|
| | | mViewBirthdyContent.setText(year+"-"+month+"-"+dayOfMonth);
|
| | | }
|
| | | },date);
|
| | | myDatePickerDialog.myShow();
|