pages/infoBreakdown/index.vue
@@ -42,6 +42,17 @@
         }
      });
   }
   function toScan(){
      // 调用二维码扫描接口
      uni.scanCode({
         scanType: ['qrCode'],
         success: function (res) {
            console.log('条码内容:' + res.result);
            form.value.facilityCode = res.result
         }
      });
   }
   async function submit(){
      form.value.url = uploadList.value
      //去掉数组中空字符串,数组转字符串
@@ -77,8 +88,8 @@
                  <form>
                     <view class="form-item">
                        <view class="label">设备号:</view>
                        <input class="item-input" v-model="form.facilityCode" name="input" placeholder="请扫描水机站牌二维码或输入设备号" />
                        <image src="../../static/images/addCard/code.png" alt=""></image>
                        <input class="item-input" v-model="form.facilityCode" name="input" placeholder="请扫描或输入设备号" />
                        <image @click="toScan()" src="../../static/images/addCard/code.png" alt=""></image>
                     </view>
                     <view class="form-item">
                        <view class="label">联系方式:</view>
@@ -100,6 +111,7 @@
                     <block v-for="(item,index) in uploadList">
                        <view @click="uploadImg(index)" class="upload-img-item">
                           <image v-if="item" :src="item"></image>
                           <image v-else class="default-img" src="../../static/images/other/img-add.png" alt=""></image>
                        </view>
                     </block>
                  </view>
@@ -150,8 +162,14 @@
                  align-items: center;
                  border-bottom: 1rpx solid rgba(111, 111, 111, 0.1);
                  height:100rpx;
                  .label{
                     width:160rpx;
                  }
                  input{
                     width:340rpx;
                  }
                  image{
                     margin-left:60rpx;
                     margin-left:50rpx;
                     width:50rpx;
                     height:50rpx;
                  }
@@ -159,8 +177,8 @@
            }
            .upload-box{
               .upload-title{
                  color: #5b93dc;
                  margin: 10rpx 20rpx 0;
                  color: #6a717e;
                  margin-top: 10rpx;
               }
               .upload-img{
                  display: flex;
@@ -174,9 +192,16 @@
                        border-radius:20rpx;
                        border:1rpx dashed #b7d4ff;
                        margin-bottom: 10rpx;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        image{
                           width:180rpx;
                           height:180rpx;
                           width:170rpx;
                           height:170rpx;
                        }
                        .default-img{
                           width:120rpx;
                           height:120rpx;
                        }
                  }
               }
@@ -192,6 +217,8 @@
            left: calc(50% - 35%);
            text-align: center;
            border-radius:50rpx;
            color: #5b93dc;
            letter-spacing:5rpx;
         }
      }
   }