Переглянути джерело

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc_app into V0.0.2

coys 2 роки тому
батько
коміт
0d52795c77

+ 11 - 5
src/views/menu/NFCmanage/index.vue

@@ -94,20 +94,26 @@ export default {
   },
   methods:{
     //自定义nfc回调
-    openNFCScanCallBack(data){
+    openNFCScanCallBack(nfcStr){
       //alert(data)
+      let nfcCode;
+      try{
+        let nfc = JSON.parse(nfcStr);
+        nfcCode =  nfc.content;
+      }catch (e) {
+        nfcCode = nfcStr.content;
+      }
       this.nfcMsg = '读取中...';
-      if(!data) {
+      if(!nfcCode) {
         this.$toast('扫描失败,请重试');
         //this.showPopup = false;
         this.nfcMsg = '将NFC贴至手机背部';
         return
       }
-      let code = JSON.parse(data).content;
       this.$toast('扫描成功');
       this.nfcInfo = {};
       this.formData = {};
-      nfcDetails(code).then(res=>{
+      nfcDetails(nfcCode).then(res=>{
         //console.log(res,'res')
         //alert(JSON.stringify(res))
         //this.showPopup = false;
@@ -117,7 +123,7 @@ export default {
           this.disable = true;
         }else {
           this.$toast('未查询到NFC相关信息');
-          this.formData.code = code;
+          this.formData.code = nfcCode;
           this.disable = false;
         }
       })

+ 72 - 44
src/views/menu/introduction/add.vue

@@ -4,17 +4,29 @@
     <div class="page-container">
       <!--   基本信息   -->
       <div class="card" v-if="taskInfo">
-        <van-panel title="介绍信内容">
+        <van-panel >
+          <template #header>
+            <van-cell title="介绍信内容">
+              <template #right-icon>
+                <div class="flex-box">
+                  <span style="color: #aaa;">添加</span>
+                  <van-switch size="20px" v-model="checked" />
+                </div>
+              </template>
+            </van-cell>
+          </template>
           <div class="panel-box">
             <van-field
               label="介绍信名称"
               required
               v-model="reformData.description"
+              placeholder="请输入"
               :maxlength="20"
               :v-model="taskInfo.orgName" />
             <van-field
               label="接待机构"
               required
+              placeholder="请输入"
               v-model="reformData.description"
               :maxlength="20"
               :v-model="taskInfo.checkItem" />
@@ -39,24 +51,24 @@
       <!--  人员列表   -->
       <div class="card" >
         <van-swipe-cell>
-          <van-card
-            class="goods-card"
-            thumb="https://img01.yzcdn.cn/vant/cat.jpeg">
-            <template #title>
-              <van-cell title="出入人员" value="出入人员"></van-cell>
-            </template>
-            <template #desc>
-              <van-cell title="出入人员" value="出入人员"></van-cell>
-            </template>
-          </van-card>
+          <div class="goods-card">
+           <div class="card-img-box">
+             <img src="https://img01.yzcdn.cn/vant/cat.jpeg" alt="">
+           </div>
+           <div class="card-cell-box">
+            <van-cell title="出入人员" value="出入人员"></van-cell>
+            <van-cell title="身份证" value="123456789012345678"></van-cell>
+            <van-cell title="单位" value="高新兴讯美科技有限公司高新兴讯"></van-cell>
+           </div>
+          </div>
           <template #right>
-            <van-button square text="删除" type="danger" class="delete-button" />
+            <van-button style="height: 100%;" square text="删除" type="danger" class="delete-button" />
           </template>
         </van-swipe-cell>
       </div>
 
       <!--  添加人员信息    -->
-      <van-collapse v-model="activeNames">
+      <van-collapse v-show="checked" v-model="activeNames">
         <van-collapse-item title="添加人员" name="1">
           <div class="panel-box">
             <van-field
@@ -106,11 +118,13 @@ import Uploader from "@/components/upload/gxuploader.vue";
 import {formatDate} from "@/filters/filter";
 import {mapGetters} from "vuex";
 import {imgUrl} from "@/utils";
+import { ImagePreview } from 'vant'
 export default defineComponent({
   components: {Uploader, DateCell},
   data(){
     return {
       activeNames:[1],
+      checked:false,
       taskInfo:[],
       //整改
       reformData: {
@@ -125,12 +139,39 @@ export default defineComponent({
   },
   methods:{
     formatDate,
+    preViewNFC(url) {
+      // this.preViewImages.images = this.nfcImage.map(v => imgUrl(v.img))
+      // this.preViewImages.startPosition = i
+      ImagePreview(url)
+    },
   }
 })
 </script>
-
+<style lang="scss">
+.intro-add{
+  .van-card{
+    padding: 20px;
+  }
+  .card-cell-box{
+    width: 70%;
+    .van-cell{
+      padding: 10px;
+      &::after{
+        left:10px;
+        right:10px;
+      }
+    }
+    .van-cell__title{
+      flex:.25;
+    }
+    .van-cell__value{
+     flex:.75;
+    }
+  }
+}
+</style>
 <style scoped lang="scss">
-.question-edit{
+.intro-add{
   height: 100%;
   overflow: hidden;
 }
@@ -190,35 +231,22 @@ export default defineComponent({
     }
   }
 }
-.nfc-img{
-  display: inline-block;
-  width: 140px;
-  height: 140px;
-  margin: 10px;
-  position: relative;
-  &:first-child{
-    margin-left: 0;
-  }
-  >img{
-    width: 100%;
-    height: 100%;
-    border: none;
-  }
-  >span{
-    position: absolute;
-    padding: 0 10px;
-    bottom: 0;
-    left: 0;
-    display: block;
-    width: 100%;
-    background-color: rgba(0,0,0,.2 );
-    color: #eaeaea;
-    font-size: 20px;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-    line-height: 30px;
-    height: 30px;
+.goods-card{
+  width: 100%;
+  display: flex;
+  align-items: center;
+  padding: 10px;
+  background-color: #fff;
+  .card-img-box{
+    width: 200px;
+    height: 200px;
+    margin-right: 10px;
+    >img{
+      width: 100%;
+      height: 100%;
+      object-fit: cover;
+      border-radius: 10px;
+    }
   }
 }
 .big-btn-box{

+ 1 - 1
src/views/menu/introduction/index.vue

@@ -14,7 +14,7 @@
           :data-list="getDictItem('question_confirm_status')"
           @change="refreshData"/>
         <div class="btn-box">
-          <van-button type="warning" size="small" @click="clickAdd">录入介绍信</van-button>
+          <van-button plain type="warning" size="small" @click="clickAdd">录入介绍信</van-button>
         </div>
       </div>
       <div class="card-list">

+ 0 - 1
src/views/menu/resumption/detail.vue

@@ -809,7 +809,6 @@ export default {
 
 .card {
   box-shadow: 0 10px 10px #eaeaea;
-  height: 50px;
 }
 
 .van-popup {

+ 9 - 2
src/views/menu/securityCheckRegister/detail.vue

@@ -233,8 +233,15 @@ export default {
 
     openNFCScanCallBack(nfcStr){
       clearInterval(this.timer);
-      let nfc = JSON.parse(nfcStr);
-      let nfcCode =  nfc.content;
+      let nfcCode = '';
+      try{
+        let nfc = JSON.parse(nfcStr);
+        nfcCode =  nfc.content;
+      }catch (e) {
+        nfcCode = nfcStr.content;
+      }
+      // let nfc = JSON.parse(nfcStr);
+      // let nfcCode =  nfc.content;
       //alert(nfcCode)
       this.checkNfcFilter(nfcCode);
     },