tremble 4 tahun lalu
induk
melakukan
a2f3678f96
5 mengubah file dengan 74 tambahan dan 12 penghapusan
  1. TEMPAT SAMPAH
      src/assets/images/android.png
  2. TEMPAT SAMPAH
      src/assets/images/ios.png
  3. TEMPAT SAMPAH
      src/assets/images/qrcode.png
  4. 13 3
      src/pages/home/index.vue
  5. 61 9
      src/pages/myscene/index.vue

TEMPAT SAMPAH
src/assets/images/android.png


TEMPAT SAMPAH
src/assets/images/ios.png


TEMPAT SAMPAH
src/assets/images/qrcode.png


+ 13 - 3
src/pages/home/index.vue

@@ -8,10 +8,13 @@
           <div>{{item.name}}</div>
         </li>
       </ul>
-      <el-button @mouseenter.native="qrcode = true" @mouseleave.native="qrcode = false" class="download-btn" type="primary">
-        <span>APP下载</span>
+      <el-button @mouseenter.native="qrcode = true;type = 'android'" @mouseleave.native="qrcode = false" class="download-btn1" type="primary">
+        <span>安卓下载</span>
       </el-button>
-      <img v-if="qrcode" :src="require(`@/assets/images/qrcode.png`)" alt="">
+      <el-button @mouseenter.native="qrcode = true;type = 'ios'" @mouseleave.native="qrcode = false" class="download-btn" type="primary">
+        <span>IOS下载</span>
+      </el-button>
+      <img v-if="qrcode" :style="{right:type==='ios'?'0px':'100px'}" :src="require(`@/assets/images/${type==='ios'?'ios':'android'}.png`)" alt="">
     </div>
   </div>
 </template>
@@ -69,6 +72,7 @@ export default {
     return {
       lists,
       loading: false,
+      type: '',
       qrcode: false
     }
   },
@@ -105,6 +109,12 @@ export default {
     border-radius: 3px;
     background-color: #fff;
     position: relative;
+    .download-btn1{
+      right: 140px;
+      top: 10px;
+      position: absolute;
+    }
+
     .download-btn{
       position: absolute;
       top: 10px;

+ 61 - 9
src/pages/myscene/index.vue

@@ -28,6 +28,7 @@
 
       <el-table-column label="操作" width="300">
           <template slot-scope="scope">
+           <span class="o-span" v-if="roleType==='admin'" @click="send(scope.row)">发送</span>
            <span class="o-span" v-if="roleType==='admin'" @click="reCalculate(scope.row)">重算</span>
            <span class="o-span" v-if="roleType==='admin'" @click="zipScene(scope.row)">{{scope.row.downloadStatus === '已打包'?'重新':''}}打包</span>
            <span class="o-span" v-if="roleType==='admin'" @click="download(scope.row)">下载</span>
@@ -88,7 +89,10 @@ const statusArr = {
 const downloadArr = {
   '0': '打包中',
   '-1': '未打包',
-  '1': '已打包'
+  '1': '已打包',
+  '2': '文件发送成功',
+  '3': '文件发送失败,',
+  '4': '传输中'
 }
 
 const authority = {
@@ -140,6 +144,61 @@ export default {
       this.loading = false
     },
 
+    async send (item) {
+      // '0': '计算中',
+      // '-1': '计算出错',
+      // '-2': '计算完成',
+      // '1': '计算完成'
+      console.log(item.downloadStatus)
+
+      if (item.downloadStatus === '未打包') {
+        return this.$notify.info({
+          title: '消息',
+          message: '未打包,请打包后发送'
+        })
+      }
+      if (item.downloadStatus === '传输中') {
+        return this.$notify.info({
+          title: '消息',
+          message: '发送中,请稍后'
+        })
+      }
+
+      this.$confirm('此操作将会发送该场景, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        let res = await this.$http({
+          method: 'get',
+          data: {
+            id: item.id
+          },
+          url: `api/manage/center/scene/send/${item.id}`,
+          headers: {
+            Authorization: window.localStorage.getItem('token')
+          }
+        })
+
+        if (res.status === 2000) {
+          this.$alert(`正在发送,请稍等`, '提示', {
+            confirmButtonText: '确定',
+            callback: action => {
+              this.refresh()
+            }
+          })
+        } else {
+          this.loading = false
+          this.$notify.error({
+            title: '错误',
+            message: res.message
+          })
+        }
+      }).catch(() => {
+
+      })
+    },
+
     async reCalculate (item) {
       // '0': '计算中',
       // '-1': '计算出错',
@@ -177,10 +236,7 @@ export default {
           })
         }
       }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消'
-        })
+
       })
     },
 
@@ -318,10 +374,6 @@ export default {
           })
         }
       }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消删除'
-        })
       })
     },