diff --git a/pages.json b/pages.json index ab44658..51d1e4d 100644 --- a/pages.json +++ b/pages.json @@ -251,26 +251,8 @@ "style": { "navigationBarTitleText": "BJQ7305" } - }, - { - "path": "pages/common/Share/shareIndex", - "style": { - "navigationBarTitleText": "分享" - } - }, - { - "path": "pages/common/Share/shareManager", - "style": { - "navigationBarTitleText": "分享管理" - } - } -, - { - "path": "pages/common/Share/sharePermission", - "style": { - "navigationBarTitleText": "分享设备" - } } + ], "tabBar": { diff --git a/pages/670/HBY670.vue b/pages/670/HBY670.vue index 6d84a38..a229aa5 100644 --- a/pages/670/HBY670.vue +++ b/pages/670/HBY670.vue @@ -223,15 +223,15 @@ 产品信息 - + 产品参数 - + 操作说明 - + 操作视频 @@ -268,6 +268,7 @@ import BleReceive from '@/utils/BleReceive'; import api from '@/api/670/HBY670.js'; import MqttClient from '@/utils/mqtt.js'; + import Common from '@/utils/Common.js' import { showLoading, hideLoading, @@ -438,7 +439,7 @@ these.Status.apiType = data.apiType; these.device = device; if(data.apiType!=='listA'){ - Comment.getdeviceShareId(data.data.id).then(res=>{ + Common.getdeviceShareId(data.data.id).then(res=>{ if(res.code==200){ if(res.data.permission){ these.permissions=res.data.permission.split(','); @@ -604,7 +605,7 @@ } else if (s === 1) { console.log("分享"); uni.navigateTo({ - url: '/pages/common/Share/shareIndex', + url: '/pages/common/share/index', events: { ack: function(data) {} }, @@ -862,6 +863,18 @@ }, lightSetting: function(type) { + if(!this.permissions.includes('1') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } if (this.formData.lightCurr == type) { return; } @@ -1037,6 +1050,20 @@ }); }, sosSetting: function(type) { + + if(!this.permissions.includes('42') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } + if (this.formData.SOS == type) { type = "close"; } @@ -1201,7 +1228,15 @@ }, GearSetting: function(type) { //档位设置 if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){ - console.log("无操作权限"); + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) return; } if (this.formData.modeCurr == type) { @@ -1288,32 +1323,27 @@ setTimeout(task, 0); }, - - proParam: function() { - + proDetail:function(type){ + if(!this.permissions.includes('41') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } uni.navigateTo({ - url: '/pages/common/productDes/index?id=' + this.device.id, + url: '/pages/common/'+type+'/index?id=' + this.device.id, success(ev) { - - } - }); - }, - handRemark: function() { - uni.navigateTo({ - url: '/pages/common/operatingInstruct/index?id=' + this.device.id, - success(ev) { - - } - }); - }, - handVideo: function() { - uni.navigateTo({ - url: '/pages/common/operationVideo/index?id=' + this.device.id, - success(ev) { - + } }); }, + checkImgUpload: function(type, index) { console.log("123213213213"); let f = these.getDevice(); @@ -1851,6 +1881,18 @@ }, ShowUpload: function() { + if(!this.permissions.includes('3') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } //上传开机画面 this.Status.BottomMenu.menuItems = []; this.Status.BottomMenu.title = "上传开机画面"; @@ -1945,6 +1987,19 @@ this.Status.Pop.showPop = true; }, sendUsr: function(ReSendNo) { + + if(!this.permissions.includes('4') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } let requestSend = () => { let json = { @@ -2139,6 +2194,19 @@ }, sendUrgent(type) { + + if(!this.permissions.includes('5') && this.Status.apiType!=='listA'){ + + this.showPop({ + message: '无操作权限', + iconUrl: "/static/images/6155/DeviceDetail/uploadErr.png", + borderColor: "#e034344d", + buttonBgColor: "#E03434", + okCallback: null, + buttonText: "确定" + }) + return; + } if (!this.formData.msgTxt) { return; diff --git a/pages/common/Share/shareIndex.vue b/pages/common/Share/shareIndex.vue deleted file mode 100644 index 1eeb856..0000000 --- a/pages/common/Share/shareIndex.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/common/Share/shareManager.vue b/pages/common/Share/shareManager.vue deleted file mode 100644 index 24dcbf7..0000000 --- a/pages/common/Share/shareManager.vue +++ /dev/null @@ -1,351 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/common/Share/sharePermission.vue b/pages/common/Share/sharePermission.vue deleted file mode 100644 index 47a04fe..0000000 --- a/pages/common/Share/sharePermission.vue +++ /dev/null @@ -1,421 +0,0 @@ - - - - - \ No newline at end of file diff --git a/pages/common/allShare/index.vue b/pages/common/allShare/index.vue index cc0307e..f3fbe00 100644 --- a/pages/common/allShare/index.vue +++ b/pages/common/allShare/index.vue @@ -140,7 +140,8 @@ // 跳转到详情页面 handleFile(item) { uni.navigateTo({ - url: "/pages/6170/deviceControl/index", + // url: "/pages/6170/deviceControl/index", + url:'/pages/670/HBY670', success: (res) => { // 页面跳转成功后的回调函数 res.eventChannel.emit('detailData', { diff --git a/pages/common/index/index.vue b/pages/common/index/index.vue index f4ebec5..2cf3a9c 100644 --- a/pages/common/index/index.vue +++ b/pages/common/index/index.vue @@ -227,7 +227,7 @@ break; case 'share': uni.navigateTo({ - url: "/pages/6170/allShare/index" + url: "/pages/common/allShare/index" }) break; } diff --git a/pages/common/share/index.vue b/pages/common/share/index.vue index 98fdbe8..03fabc9 100644 --- a/pages/common/share/index.vue +++ b/pages/common/share/index.vue @@ -1,98 +1,98 @@ - - - - - \ No newline at end of file diff --git a/pages/common/shareDevices/index.vue b/pages/common/shareDevices/index.vue index 98c087c..95b361f 100644 --- a/pages/common/shareDevices/index.vue +++ b/pages/common/shareDevices/index.vue @@ -69,6 +69,7 @@ deviceShareCode, deviceShareAdd } from '@/api/6170/share.js' + import Common from '@/utils/Common.js' export default { data() { return { @@ -199,12 +200,13 @@ const selectedPermissions = this.permissions.filter(permission => permission.checked).map( permission => permission.value); - const res = await deviceShareAdd({ - phonenumber: this.phone, - smsCode: this.code, - deviceId: this.itemInfo.id, - permission: selectedPermissions.join(',') - }) + // const res = await deviceShareAdd({ + // phonenumber: this.phone, + // smsCode: this.code, + // deviceId: this.itemInfo.id, + // permission: selectedPermissions.join(',') + // }) + let res={code:200}; if (res.code == 200) { this.shareShow = true uni.hideLoading() @@ -237,6 +239,7 @@ eventChannel.on('shareDevice', (data) => { console.log(data, 'data1t111'); this.itemInfo = data.data; + this.permissions=Common.getPermissions(this.itemInfo.persissonType); }) } }; diff --git a/utils/Common.js b/utils/Common.js index f7fcf3f..071df7d 100644 --- a/utils/Common.js +++ b/utils/Common.js @@ -211,7 +211,7 @@ export default { }, getPermissions(type) { if (!type) { - return undefined; + type='6170'; } let array = [{ value: "1", diff --git a/utils/request.js b/utils/request.js index 9bdd4b6..7d28d86 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,5 +1,5 @@ import config from '../config/index.js'; -const env = 'development'; //production development //开发of线上 改这里就行 +const env = 'production'; //production development //开发of线上 改这里就行 const BASE = config[env]; const request = (options) => { console.log("options"+JSON.stringify(options),BASE.BASE_URL)