Przeglądaj źródła

fix:移动端也传cameraId过去

xzh 4 lat temu
rodzic
commit
1eff9a6ae3

+ 7 - 3
mobile/src/components/toast/cooperation.vue

@@ -32,7 +32,7 @@ import toastZH from '@/store/language/cn/toast'
 import toastEN from '@/store/language/en/toast'
 
 export default {
-  props: ['sceneNum', 'visible', 'cooType'],
+  props: ['sceneNum', 'visible', 'cooType', 'getListParams'],
   data () {
     return {
       userName: '',
@@ -59,15 +59,19 @@ export default {
   methods: {
     async getResoureList () {
       let token = localStorage.getItem('token')
-
+      console.log(this.getListParams)
       let res = await this.$http({
         method: 'post',
         headers: {
           token
         },
+        data: this.getListParams,
         url: '/user/scene/cooperation/sceneResourceList'
       })
-      this.auth = res.data.data
+      let { include, exclude } = res.data.data
+      let filterKeyWords = exclude.map(item => item.keyWord)
+      let list = include.filter(item => filterKeyWords.indexOf(item.keyWord) === -1)
+      this.auth = list
     },
     handleClick (type = '') {
       this.$emit('closePoint', type)

+ 3 - 2
mobile/src/components/toast/index.vue

@@ -2,7 +2,7 @@
   <div>
     <binding :btype="bindingType" :visible='bindingVisible' @closePoint="()=>{bindingVisible = false,emitCallback()}"/>
     <addcart :visible='addcartVisible' :img='img' :msg='addcartmsg' :txt='addcarbtnTxt' @closePoint="handleAddCart" />
-    <cooperation :sceneNum="sceneNum" :visible='cooperationVisible' :cooType="cooType" @closePoint="handleCooClose"/>
+    <cooperation :sceneNum="sceneNum" :visible='cooperationVisible' :cooType="cooType" @closePoint="handleCooClose" :getListParams="getListParams" />
 
     <div
       class="toast-layout"
@@ -104,7 +104,8 @@ export default {
       diycomfirm: '',
       isLoaing: false,
       lang: localStorage.getItem('language') || 'zh',
-      img: this.$cdn + 'images/icon/warn.png'
+      img: this.$cdn + 'images/icon/warn.png',
+      getListParams: {}
     }
   },
   computed: {

+ 1 - 1
mobile/src/components/toast/toast.js

@@ -55,11 +55,11 @@ Toast.install = function (Vue) {
       instance.sceneNum = item.num
       instance.cooType = item.type || 'scene'
       instance.cooperationVisible = true
+      instance.getListParams = item.getListParams || {}
       instance.cooCallback = callback || function () {
       }
     },
     show: (type, msg, callback, submsg = '') => {
-      console.log(type)
       instance.img = imgs[type] || (cdn + 'images/icon/success.png')
       instance.submsg = submsg
       instance.message = msg

+ 2 - 1
mobile/src/pages/account/manage/device/index.vue

@@ -127,7 +127,8 @@ export default {
       } else {
         this.$toast.showCooperation({
           num: item.id,
-          type: 'device'
+          type: 'device',
+          getListParams: {cameraId: item.id}
         }, () => {
           this.getList()
         })

+ 4 - 1
mobile/src/pages/account/manage/myscene/index.vue

@@ -181,7 +181,10 @@ export default {
       } else {
         this.$toast.showCooperation({
           num: item.num,
-          type: 'scene'
+          type: 'scene',
+          getListParams: {
+            cameraId: item.cameraId
+          }
         }, () => {
           this.getList()
         })