Jelajahi Sumber

处理图片上传问题

yuwenjun 4 tahun lalu
induk
melakukan
1cce75bb09

+ 2 - 1
src/components/qrcode/index.vue

@@ -2,7 +2,7 @@
   <div class="code-container">
     <transition name="fade">
       <div v-if="isVisible" class="qrcode">
-        <div class="title">{{ productInfo.productName }}</div>
+        <div class="title">{{ productInfo.authParty }}</div>
         <div class="sncode"><span>仪器SN码:</span>{{ hanldeSNcode(productInfo.snCode) }}</div>
         <div class="content">
           <img :src="imgUrl" alt="">
@@ -64,6 +64,7 @@ export default {
     },
     // 初始化二维码
     async initQrcode() {
+      console.log(this.productInfo)
       this.qrcodePath = `${this.wwwServer}/product/auth/product-${this.productInfo?.productId}.html`
       // 二维码配置
       const options = {

+ 1 - 1
src/layout/components/Navbar.vue

@@ -57,7 +57,7 @@ export default {
       'proxyInfo'
     ]),
     userName() {
-      return this.proxyInfo?.name || this.name
+      return this.name
     }
   },
   methods: {

+ 1 - 1
src/views/supplier/auth/index.vue

@@ -52,7 +52,7 @@
               删除
             </el-button>
           </template>
-          <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}`)">
+          <el-button type="primary" size="mini" @click="$_navigationTo(`/product?id=${row.authId}&authParty=${row.authParty}`)">
             商品列表
           </el-button>
         </template>

+ 7 - 7
src/views/supplier/components/uploadFile.vue

@@ -41,7 +41,7 @@ export default {
 
   data() {
     return {
-      // 图片上传接口
+      // 文件上传接口
       action: process.env.VUE_APP_UPLOAD_API + '/shop/upload/file',
       accept: '.doc,.ppt,.pdf',
       // 请求参数
@@ -78,14 +78,14 @@ export default {
       this.params.authUserId = this.authUserId || -1
       this.$refs.upload.submit()
     },
-    // 图片上传之前的钩子
+    // 文件上传之前的钩子
     beforeUpload(file) {
       this.params.authUserId = this.authUserId || -1
-      const size = file.size
-      if (size > 1024 * 2000) {
-        this.$message.warning('文件上传大小超出限制(≤2MB)')
-        return false
-      }
+      // const size = file.size
+      // if (size > 1024 * 2000) {
+      //   this.$message.warning('文件上传大小超出限制(≤2MB)')
+      //   return false
+      // }
     },
     remove() {
       this.$emit('remove')

+ 3 - 0
src/views/supplier/product/index.vue

@@ -85,6 +85,7 @@ export default {
 
   data() {
     return {
+      authParty: '',
       tableKey: 0,
       list: null,
       total: 0,
@@ -105,6 +106,7 @@ export default {
   },
   created() {
     this.listQuery.authId = this.$route.query.id
+    this.authParty = this.$route.query.authParty
     this.getList()
   },
 
@@ -170,6 +172,7 @@ export default {
     // 显示二维码
     handleShowQRcode(item) {
       this.productInfo = item
+      this.productInfo.authParty = this.authParty
       this.showQRcode = true
     }
   }