ソースを参照

1、修改pdf报告

LAPTOP-AMA5TPO8\zhongyi 4 年 前
コミット
d0a989a42e

+ 1 - 0
app/src/main/AndroidManifest.xml

@@ -61,6 +61,7 @@
         <activity android:name=".ui.My.change.ChangeIFMTActivity" />
         <activity android:name=".ui.webview.PDFActivity" />
         <activity android:name=".ui.toreview.VnToreViewActivity" />
+        <activity android:name=".pdf.RportPDFActivity"/>
         <activity
             android:name=".ui.webview.WebActivity"
             android:screenOrientation="portrait" />

+ 127 - 0
app/src/main/java/com/zy/bvvm/helper/DownloadPDF.java

@@ -0,0 +1,127 @@
+package com.zy.bvvm.helper;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Environment;
+import android.provider.MediaStore;
+import android.view.View;
+import android.widget.Toast;
+
+import com.github.dfqin.grantor.PermissionListener;
+import com.github.dfqin.grantor.PermissionsUtil;
+
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import io.reactivex.annotations.NonNull;
+
+public class DownloadPDF {
+
+    //下载权限
+    static final String[] PERMISSION = new String[]{
+            Manifest.permission.WRITE_EXTERNAL_STORAGE,
+            Manifest.permission.READ_EXTERNAL_STORAGE,
+    };
+
+    //下载pdf报告
+    public static void  requestCemera(Activity context, View layout){
+        if (PermissionsUtil.hasPermission(context, PERMISSION)) {
+            //有访问的权限
+            completeDown( context, layout);        //布局
+//            ScreenshotUtil.saveScreenshotFromView(rl,MainActivity.this);
+        } else {
+            PermissionsUtil.requestPermission(context, new PermissionListener() {
+                @Override
+                public void permissionGranted(@NonNull String[] permissions) {
+                    //用户授予了访问的权限
+//                    ScreenshotUtil.saveScreenshotFromView(rl,MainActivity.this);
+                    completeDown(context, layout);
+                }
+
+
+                @Override
+                public void permissionDenied(@NonNull String[] permissions) {
+                    //用户拒绝了访问的申请
+                }
+            }, PERMISSION);
+        }
+    };
+    private static void completeDown(Activity activity, View view) {
+        File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), System.currentTimeMillis() + ".jpg");
+        //Bitmap bitmap = screenShot(MainActivity.this);
+        Bitmap bitmap = captureView(view);
+        try {
+            if (!file.exists())
+                file.createNewFile();
+            boolean ret = save(bitmap, file, Bitmap.CompressFormat.JPEG, true);
+            if (ret) {
+                //通知相册更新
+                MediaStore.Images.Media.insertImage(activity.getContentResolver(), BitmapFactory.decodeFile(file.getAbsolutePath()), file.getName(), null);
+                Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
+                Uri uri = Uri.fromFile(file);
+                intent.setData(uri);
+                Toast.makeText(activity.getApplicationContext(), "截图已保持至 " + file.getAbsolutePath(), Toast.LENGTH_SHORT).show();
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public static Bitmap captureView(View view) {
+        // 根据View的宽高创建一个空的Bitmap
+        Bitmap bitmap = Bitmap.createBitmap(
+                view.getWidth(),
+                view.getHeight(),
+                Bitmap.Config.RGB_565);
+        // 利用该Bitmap创建一个空的Canvas
+        Canvas canvas = new Canvas(bitmap);
+        // 绘制背景(可选)
+        canvas.drawColor(Color.WHITE);
+        // 将view的内容绘制到我们指定的Canvas上
+        view.draw(canvas);
+        return bitmap;
+    }
+
+    /**
+     * 保存图片到文件File。
+     *
+     * @param src     源图片
+     * @param file    要保存到的文件
+     * @param format  格式
+     * @param recycle 是否回收
+     * @return true 成功 false 失败
+     */
+    public static boolean save(Bitmap src, File file, Bitmap.CompressFormat format, boolean recycle) {
+        if (isEmptyBitmap(src))
+            return false;
+
+        OutputStream os;
+        boolean ret = false;
+        try {
+            os = new BufferedOutputStream(new FileOutputStream(file));
+            ret = src.compress(format, 100, os);
+            if (recycle && !src.isRecycled())
+                src.recycle();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        return ret;
+    }
+
+    /**
+     * Bitmap对象是否为空。
+     */
+    public static boolean isEmptyBitmap(Bitmap src) {
+        return src == null || src.getWidth() == 0 || src.getHeight() == 0;
+    }
+}

+ 376 - 0
app/src/main/java/com/zy/bvvm/pdf/RportPDFActivity.java

@@ -0,0 +1,376 @@
+package com.zy.bvvm.pdf;
+
+import android.Manifest;
+import android.annotation.SuppressLint;
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.hjq.bar.OnTitleBarListener;
+import com.hjq.bar.TitleBar;
+import com.zy.bvvm.R;
+import com.zy.bvvm.helper.DownloadPDF;
+import com.zy.bvvm.helper.HttpUtils;
+import com.zy.bvvm.helper.SPUtils;
+import com.zy.bvvm.mvp.MvpActivity;
+import com.zy.bvvm.ui.bean.ModelListBean;
+import com.zy.bvvm.ui.bean.VerificationCodeBean;
+import com.zy.bvvm.ui.bean.VnDetailBean;
+import com.zy.bvvm.ui.report.vndetail.VnDetailContract;
+import com.zy.bvvm.ui.report.vndetail.VnDetailPresenter;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Response;
+
+public class RportPDFActivity extends MvpActivity<VnDetailPresenter> implements VnDetailContract.View, View.OnClickListener {
+
+    //产品信息
+    //左边
+    @BindView(R.id.tv_left_info_01)
+    TextView left_info_01;
+    @BindView(R.id.tv_left_info_02)
+    TextView left_info_02;
+    @BindView(R.id.tv_left_info_03)
+    TextView left_info_03;
+    @BindView(R.id.tv_left_info_04)
+    TextView left_info_04;
+    //右边
+    @BindView(R.id.tv_right_info_01)
+    TextView right_info_01;
+    @BindView(R.id.tv_right_info_02)
+    TextView right_info_02;
+    @BindView(R.id.tv_right_info_03)
+    TextView right_info_03;
+    @BindView(R.id.tv_right_info_04)
+    TextView right_info_04;
+    //报告编号
+    @BindView(R.id.tv_pdf_number)
+    TextView pdf_number;
+    //报告时间
+    @BindView(R.id.tv_pdf_time)
+    TextView pdf_time;
+    //报告状态
+    @BindView(R.id.iv_pdf_state)
+    ImageView pdf_state;
+    //二维码
+    @BindView(R.id.iv_pdf_QR_code)
+    ImageView pdf_QR_code;
+
+    //map图片
+    @BindView(R.id.iv_map_image)
+    ImageView map_image;
+    @BindView(R.id.iv_locaion)
+    ImageView map_location;
+    @BindView(R.id.tv_address)
+    TextView map_address;
+
+    //标题
+    @BindView(R.id.tv_pdf_title)
+    TitleBar pdf_title;
+
+    //布局
+    @BindView(R.id.ll_all_layoout)
+    LinearLayout all_layout;
+
+    //报警状态
+    private boolean isWarning = true;
+    //数据详情
+    private VnDetailBean.DataBean chipModel = null;
+    //状态
+    private int status;
+    private double lng = 0.0;
+    private double lat = 0.0;
+    private static final int ERROR = 1;
+    private static final int SUCCESS = 2;
+    private String address;
+    //下载权限
+    static final String[] PERMISSION = new String[]{
+            Manifest.permission.WRITE_EXTERNAL_STORAGE,
+            Manifest.permission.READ_EXTERNAL_STORAGE,
+    };
+    private String nextbtn;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+//        setContentView(R.layout.activity_rport_p_d_f);
+        ButterKnife.bind(this);    //必须要这一句,不然会出现奔溃
+    }
+
+    @Override
+    protected int getLayoutId() {
+        return R.layout.activity_rport_p_d_f;
+    }
+
+    @Override
+    protected int getTitleId() {
+        return R.id.tv_pdf_title;
+    }
+
+    @Override
+    protected void initView() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            chipModel = (VnDetailBean.DataBean) intent.getSerializableExtra("dataBean");
+            isWarning = intent.getBooleanExtra("isWarning", true);
+            status = intent.getIntExtra("status", 0);
+            nextbtn = intent.getStringExtra("nextbtn");
+        }
+    }
+
+    @Override
+    protected void initData() {
+        pdf_title.setOnTitleBarListener(new OnTitleBarListener() {
+            @Override
+            public void onLeftClick(View v) {
+                //判断数据来源
+                if (nextbtn.equals("read")) {
+                    finish();
+                }
+            }
+
+            @Override
+            public void onTitleClick(View v) {
+
+            }
+
+            @Override
+            public void onRightClick(View v) {
+                //下载pdf报告
+//                requestCemera();
+                DownloadPDF.requestCemera(getActivity(), all_layout);
+            }
+        });
+        //页面赋值
+        setViewData();
+    }
+
+
+    @Override
+    public void onClick(View v) {
+
+    }
+
+
+    /**
+     * 显示详细信息
+     */
+    @SuppressLint("SetTextI18n")
+    private void setViewData() {
+        pdf_number.setText("报告编号:" + chipModel.getCodeX());       //报告编号
+        pdf_time.setText("报告日期:" + chipModel.getDatetime());        //时间
+        //左边
+        left_info_01.setText(TextUtils.isEmpty(chipModel.getVaccineName()) ? "N/A" : chipModel.getVaccineName());     //商品名称
+        left_info_02.setText(TextUtils.isEmpty(chipModel.getVaccineCommonName()) ? "N/A" : chipModel.getVaccineCommonName());     //通用名称
+        left_info_03.setText(TextUtils.isEmpty(chipModel.getFactoryName()) ? "N/A" : chipModel.getFactoryName());     //生产企业名称
+        left_info_04.setText(TextUtils.isEmpty(chipModel.getVaccineExpiryDate()) ? "N/A" : chipModel.getVaccineExpiryDate() + "个月");     //有效期
+        //右边
+        right_info_01.setText(TextUtils.isEmpty(chipModel.getVaccineCategory()) ? "N/A" : chipModel.getVaccineCategory());    //规格
+        right_info_02.setText(TextUtils.isEmpty(chipModel.getStandardCode()) ? "N/A" : chipModel.getStandardCode());    //药品本位码
+        right_info_03.setText(TextUtils.isEmpty(chipModel.getApprovalNumber()) ? "N/A" : chipModel.getApprovalNumber());    //药品批准文号
+        right_info_04.setText(TextUtils.isEmpty(chipModel.getIdentificationCode()) ? "N/A" : chipModel.getIdentificationCode());    //国家药品标识码
+        //报警状态
+        if (isWarning == true) {
+            pdf_state.setImageResource(R.mipmap.pdf_image_warning);
+        } else {
+            pdf_state.setImageResource(R.mipmap.pdf_image_adopt);
+        }
+        //获取地图信息图片
+        setMapInfo();
+    }
+
+    /**
+     * 展示地图
+     */
+    private void setMapInfo() {
+        //获取经纬度
+        gpsToLocation();
+    }
+
+    private void gpsToLocation() {
+        String location[] = SPUtils.get("LOCATION", "").toString().split(",");
+        Double latitude = null;
+        Double longitude = null;
+        if (location.length > 1) {
+            latitude = Double.parseDouble(location[0]);
+            longitude = Double.parseDouble(location[1]);
+        }
+        //经纬度GPS转高得地图
+        String url = "https://restapi.amap.com/v3/assistant/coordinate/convert?locations=" + longitude + "," + latitude + "&coordsys=gps&key=166b0ac8c36df284fc779fd662237017";
+        Log.e("url", url);
+        HttpUtils.doGet(url, new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+//                toast(errorMsg);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                String asd = response.body().string();
+                try {
+                    JSONObject jsonObject = new JSONObject(asd);
+                    if (jsonObject.getString("info").equals("ok")) {
+                        String locations = jsonObject.getString("locations");
+//                        SPUtils.put("LOCATIONS", locations);
+//                        return locations;
+                        //
+                        getAddressInfo(locations);
+
+                    }
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+    /**
+     * 根据经纬度逆地理查询地址
+     *
+     * @param locations
+     */
+    private void getAddressInfo(String locations) {
+        String url = "https://restapi.amap.com/v3/geocode/regeo?&location=" + locations + "&key=166b0ac8c36df284fc779fd662237017";
+        Log.e("url", url);
+        HttpUtils.doGet(url, new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+//                toast(errorMsg);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                String asd = response.body().string();
+                try {
+                    JSONObject jsonObject = new JSONObject(asd);
+                    if (jsonObject.getString("status").equals("1")) {
+//                        address = jsonObject.getString("formatted_address");
+                        address = jsonObject.getJSONObject("regeocode").getString("formatted_address");
+                        getMapInfo(locations);
+                    }
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+    }
+
+    private void getMapInfo(String locations) {
+        String url = "https://restapi.amap.com/v3/staticmap?location=" + locations + "&scale=2&zoom=14&size=512*307&key=166b0ac8c36df284fc779fd662237017";
+//        String url = "https://restapi.amap.com/v3/staticmap?markers=mid,0xFF0000,A:116.37359,39.92437&labels=%E6%9C%9D%E9%98%B3%E5%85%AC%E5%9B%AD,2,0,16,0xFFFFFF,0x008000:116.37359,39.92437&key=166b0ac8c36df284fc779fd662237017";
+        Log.e("url", url);
+        HttpUtils.doGet(url, new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+//                toast(errorMsg);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                Log.e("map", response.body().toString());
+                //获取流
+                InputStream in = response.body().byteStream();
+                //转为bitmap
+                Bitmap bitmap = BitmapFactory.decodeStream(in);
+                //使用Hanlder发送消息
+                Message msg = Message.obtain();
+
+                msg.what = SUCCESS;
+                msg.obj = bitmap;
+
+                handler.sendMessage(msg);
+//                map_image.setImageBitmap(bitmap);
+            }
+        });
+    }
+
+
+    private Handler handler = new Handler() {
+        @SuppressLint("HandlerLeak")
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case SUCCESS:
+                    map_location.setVisibility(View.VISIBLE);
+                    if (address != null) {
+                        map_address.setVisibility(View.VISIBLE);
+                        map_address.setText(address);
+                    } else {
+                        map_address.setVisibility(View.GONE);
+                    }
+                    map_image.setImageBitmap((Bitmap) msg.obj);
+                    break;
+                case ERROR:
+                    Toast.makeText(RportPDFActivity.this, "请求超时", Toast.LENGTH_SHORT).show();
+
+                    break;
+            }
+        }
+    };
+
+    @Override
+    protected VnDetailPresenter createPresenter() {
+        return new VnDetailPresenter();
+    }
+
+    @Override
+    public void getDetailError(String msg) {
+
+    }
+
+    @Override
+    public void getDetailSuccess(VnDetailBean data) {
+
+    }
+
+
+    @Override
+    public void getSendMailError(String msg) {
+
+    }
+
+    @Override
+    public void getSendMailSuccess(VnDetailBean data) {
+
+    }
+
+    @Override
+    public void getmlistError(String msg) {
+
+    }
+
+    @Override
+    public void getmlistSuccess(ModelListBean data) {
+
+    }
+
+    @Override
+    public void getToReviewError(String msg) {
+
+    }
+
+    @Override
+    public void getToReviewSuccess(VerificationCodeBean data) {
+
+    }
+}

+ 9 - 9
app/src/main/java/com/zy/bvvm/ui/login/LoginActivity.java

@@ -300,15 +300,15 @@ public class LoginActivity extends MvpActivity<LoginPresenter> implements LoginC
 //                    case 2: //医生
 //                        startActivityFinish(HomeActivity.class);
 //                        break;
-                    case 3: //医药企业管理员
-                        startActivityFinish(FactorAdminActivity.class);
-                        break;
-                    case 4: //医药企业操作员
-                        if (!checkGpsAndNfc()) {
-                            return;
-                        }
-                        startActivityFinish(FactoryOperatorActivity.class);
-                        break;
+//                    case 3: //医药企业管理员
+//                        startActivityFinish(FactorAdminActivity.class);
+//                        break;
+//                    case 4: //医药企业操作员
+//                        if (!checkGpsAndNfc()) {
+//                            return;
+//                        }
+//                        startActivityFinish(FactoryOperatorActivity.class);
+//                        break;
                     default:
                         startActivityFinish(ReadingActivity02.class);
                         break;

+ 5 - 1
app/src/main/java/com/zy/bvvm/ui/vaccination/ReadingActivity02.java

@@ -47,6 +47,7 @@ import com.zy.bvvm.helper.NFCTools;
 import com.zy.bvvm.helper.SPUChip;
 import com.zy.bvvm.helper.SPUtils;
 import com.zy.bvvm.helper.SoundPoolHelper;
+import com.zy.bvvm.pdf.RportPDFActivity;
 import com.zy.bvvm.ui.bean.VnDetailBean;
 import com.zy.bvvm.ui.event.ReadingErrorEvent;
 import com.zy.bvvm.ui.home.BaseNfcActivity;
@@ -841,7 +842,10 @@ public class ReadingActivity02 extends BaseNfcActivity implements UploadChipCont
     public void uploadChipSuccess(VnDetailBean data) {
         VnDetailBean.DataBean dataBean = data.getData();
         /*   if (!dataBean.isReviewed()) {*/
-        Intent in = new Intent(ReadingActivity02.this, VnReportDetailForDoctorActivity01.class);
+        //废弃
+//        Intent in = new Intent(ReadingActivity02.this, VnReportDetailForDoctorActivity01.class);
+        //新的pdf报告页面
+        Intent in = new Intent(ReadingActivity02.this, RportPDFActivity.class);
         Log.e("getReviewId", "" + dataBean.getReviewId());
         in.putExtra("dataBean", dataBean);
         in.putExtra("isWarning", isWarning);

+ 6 - 0
app/src/main/res/drawable/line_01.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="line">
+    <stroke android:color="@color/line_06" android:width="1dp" android:dashGap="4dp" android:dashWidth="4dp"></stroke>
+    <size android:height="1dp"></size>
+</shape>

+ 50 - 0
app/src/main/res/layout/activity_rport_p_d_f.xml

@@ -0,0 +1,50 @@
+<?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"
+    android:orientation="vertical"
+    android:background="#FFFFFF"
+    tools:context=".pdf.RportPDFActivity">
+    <com.hjq.bar.TitleBar
+        android:id="@+id/tv_pdf_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        app:title="邦德威"
+        app:titleSize="17sp"
+        app:titleColor="@color/text_11"
+        app:rightIcon="@mipmap/pdf_download"
+        app:lineVisible="false"/>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="@color/view_background_2"/>
+    <androidx.core.widget.NestedScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <LinearLayout
+            android:id="@+id/ll_all_layoout"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical"
+            android:paddingLeft="15dp"
+            android:paddingRight="15dp"
+            android:background="@color/view_background_1">
+            <!--布局一:详情-->
+            <include layout="@layout/layout_pdf_01"/>
+            <!--报警状态-->
+            <include layout="@layout/layout_pdf_02"/>
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="8dp"
+                android:layerType="software"
+                android:background="@drawable/line_01"/>
+            <!--地图信息-->
+            <include layout="@layout/layout_pdf_03"/>
+
+            <!--二维码和文字提示-->
+            <include layout="@layout/layout_pdf_05"/>
+        </LinearLayout>
+    </androidx.core.widget.NestedScrollView>
+</LinearLayout>

+ 61 - 0
app/src/main/res/layout/layout_pdf_01.xml

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="产品追溯报告"
+        android:textSize="14sp"
+        android:textColor="@color/text_11"
+        android:layout_gravity="center_horizontal"
+        android:layout_marginTop="8dp" />
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="3dp"
+        android:layout_marginTop="3dp"
+        android:background="@color/line_13"/>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1.5dp"
+        android:layout_marginTop="2dp"
+        android:background="@color/line_13"/>
+<LinearLayout
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:layout_marginTop="8dp">
+    <TextView
+        android:id="@+id/tv_pdf_number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:layout_marginLeft="50dp"
+        android:text="报告编号:01234567890123"
+        android:textSize="7sp"/>
+    <TextView
+        android:id="@+id/tv_pdf_time"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginRight="50dp"
+        android:text="报告日期:2021/08/09 10:30:00"
+        android:textSize="7sp"/>
+</LinearLayout>
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="7dp"
+        android:layout_marginBottom="8dp"
+        android:text="产品详情"
+        android:textSize="12sp"
+        android:textColor="@color/text_07"/>
+    <!--字段详情-->
+        <include layout="@layout/layout_pdf_info_01"/>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="8dp"
+        android:layout_marginTop="15dp"
+        android:background="@drawable/line_01"
+        android:layerType="software"/>
+</LinearLayout>

+ 56 - 0
app/src/main/res/layout/layout_pdf_02.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:paddingTop="15dp"
+    android:paddingBottom="27dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:layout_marginRight="20dp"
+        android:layout_weight="1"
+        android:orientation="vertical">
+
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="4dp"
+            android:gravity="center_vertical"
+            android:orientation="horizontal">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="追溯结果:"
+                android:textColor="@color/text_11"
+                android:textSize="14sp"
+                android:textStyle="bold" />
+
+            <TextView
+                android:id="@+id/tv_pdf_state"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="未见异常"
+                android:textColor="@color/text_14"
+                android:textSize="17sp" />
+        </LinearLayout>
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="未发现异常,请核对内外包装与本报告\n所载数据是否一致,并按相关规定使用"
+            android:textColor="@color/text_13"
+            android:textSize="10sp" />
+
+    </LinearLayout>
+
+    <ImageView
+        android:id="@+id/iv_pdf_state"
+        android:layout_width="70dp"
+        android:layout_height="70dp"
+        android:src="@mipmap/pdf_image_adopt" />
+
+</LinearLayout>

+ 47 - 0
app/src/main/res/layout/layout_pdf_03.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="10dp"
+        android:layout_marginTop="15dp"
+        android:text="追溯地地图"
+        android:textSize="12sp"
+        />
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="210dp">
+        <ImageView
+            android:id="@+id/iv_map_image"
+            android:layout_width="match_parent"
+            android:layout_height="210dp"
+            android:scaleType="fitXY"/>
+        <ImageView
+            android:id="@+id/iv_locaion"
+            android:layout_width="40dp"
+            android:layout_height="40dp"
+            android:layout_centerInParent="true"
+            android:src="@mipmap/map_location"
+            android:visibility="gone"/>
+
+        <TextView
+            android:id="@+id/tv_address"
+            android:layout_width="90dp"
+            android:layout_height="wrap_content"
+            android:background="@mipmap/floating_window"
+            android:layout_marginBottom="1dp"
+            android:layout_centerHorizontal="true"
+            android:layout_above="@id/iv_locaion"
+            android:padding="10dp"
+            android:visibility="gone"
+            android:gravity="center"
+            android:text=""
+            android:textSize="7sp"
+            android:textColor="@color/text_13"/>
+    </RelativeLayout>
+
+    
+</LinearLayout>

+ 38 - 0
app/src/main/res/layout/layout_pdf_05.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_marginTop="28dp"
+    android:layout_marginBottom="35dp"
+    android:orientation="horizontal"
+    android:paddingTop="8dp"
+    android:paddingBottom="8dp"
+    android:background="#F3F3F3"
+    android:gravity="center_vertical">
+    <ImageView
+        android:id="@+id/iv_pdf_QR_code"
+        android:layout_width="86dp"
+        android:layout_height="86dp"
+        android:layout_marginLeft="6dp"
+        android:src="@mipmap/qrcode"/>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="7dp"
+        android:layout_marginRight="8dp"
+        android:orientation="vertical">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="免责声明:"
+            android:textSize="9sp"
+            android:textColor="@color/text_12"/>
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="@string/pdf_text_01"
+            android:textSize="7sp"
+            android:textColor="@color/text_13"/>
+    </LinearLayout>
+</LinearLayout>

+ 173 - 0
app/src/main/res/layout/layout_pdf_info_01.xml

@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal">
+
+    <LinearLayout
+        android:id="@+id/layout_pdf_info_01"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_weight="5"
+        android:layout_marginRight="30dp">
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="商品名称.........."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_left_info_01"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="通用名称.........."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_left_info_02"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="生产企业名称..."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_left_info_03"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="有效期.............."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_left_info_04"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/layout_pdf_info_02"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_marginRight="10dp"
+        android:layout_weight="5">
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="规格......................"
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_right_info_01"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="药品本位码..........."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_right_info_02"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="药品批准文号......."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_right_info_03"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="4dp"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="国家药品标识码..."
+                android:textSize="7sp"
+                android:textColor="@color/text_13"/>
+            <TextView
+                android:id="@+id/tv_right_info_04"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text=""
+                android:textSize="7sp"
+                android:textColor="@color/text_12"/>
+        </LinearLayout>
+    </LinearLayout>
+</LinearLayout>

BIN
app/src/main/res/mipmap-xxhdpi/floating_window.png


BIN
app/src/main/res/mipmap-xxhdpi/map_location.png


BIN
app/src/main/res/mipmap-xxhdpi/pdf_download.png


BIN
app/src/main/res/mipmap-xxhdpi/pdf_image_adopt.png


BIN
app/src/main/res/mipmap-xxhdpi/pdf_image_review.png


BIN
app/src/main/res/mipmap-xxhdpi/pdf_image_warning.png


BIN
app/src/main/res/mipmap-xxhdpi/qrcode.png


+ 6 - 1
app/src/main/res/values/colors.xml

@@ -20,7 +20,8 @@
     <color name="tv_blue">#308BE9</color>
     <color name="divider_gray">#d9d9d9</color>
 
-
+    <color name="line_06">#666666</color>
+    <color name="line_13">#0E7FF2</color>
     <color name="line_15">#D8D8D8</color>
 
     <color name="text_01">#CF2138</color>
@@ -32,8 +33,12 @@
     <color name="text_07">#000000</color>
     <color name="text_08">#2C8DF8</color>
     <color name="text_11">#333333</color>
+    <color name="text_12">#222222</color>
+    <color name="text_13">#666666</color>
+    <color name="text_14">#2B9F2C</color>
     <color name="text_17">#F22828</color>
 
     <color name="view_background_1">#FFFFFF</color>
+    <color name="view_background_2">#F6F6F6</color>
     <color name="view_background_4">#FFFFFF</color>
 </resources>

+ 6 - 0
app/src/main/res/values/strings.xml

@@ -166,6 +166,12 @@
     <string name="verson_title">提示</string>
     <string name="verson_close">好的</string>
 
+    <!--pdf报告-->
+    <string name="pdf_text_01">
+        本报告基于多重加密全程追溯数据得出。报告中所提供的信息仅供参考,可作为判定产品质量、产品真伪的佐证。本报告不是产品质量好坏或真伪的结论性报告,不能以此报告所载内容作为判定产品质量好坏或真伪的唯一依据。本报告最终解释权归产品生产企业所有,未经书面许可,任何机构和个人不得以任何形式翻版、复制或发布本报告,不得对本报告进行有悖原意的引用、删除和修改。发布者将通过法律途径维护其一切权利。
+    </string>
+
+
     <!--疫苗提示信息-->
     <string name="vaccine_tips_01">提示:注射疫苗后,请用注射专用创口贴或消毒棉球轻压针眼几分钟,至不出血。请勿揉搓接种部位。接种疫苗后休息30分钟再离开。</string>