|
@@ -88,34 +88,34 @@ export default {
|
|
|
|
|
|
if (this.carOnline) {
|
|
|
if (this.cmdType == 'turnOnOrOff') {
|
|
|
- const switchType = this.contrilList.find(item => item.isTurnOn).isTurnOn
|
|
|
- const pData = {
|
|
|
- car_sn: car_info.car_sn,
|
|
|
- switch: switchType
|
|
|
- }
|
|
|
- const me=this
|
|
|
- common.loading();
|
|
|
- http.postApi(config.API_FLK_CAR_SWITCH, pData, (resp) => {
|
|
|
- uni.hideLoading();
|
|
|
- if (resp.data.code === 200) {
|
|
|
- common.simpleToast(me.popText + '成功');
|
|
|
- const activeTag = me.contrilList.map(item => {
|
|
|
- if('isLock' in item){
|
|
|
- item.isTurnOn = (item.isTurnOn == 1) ? 0 : 1
|
|
|
- item.name = i18n.t((item.isTurnOn == 1) ? '关机' : '开机')
|
|
|
- }
|
|
|
- return item
|
|
|
- })
|
|
|
- const tag = getFunctionTag().tag
|
|
|
- setFunctionTag({
|
|
|
- activeTag,
|
|
|
- tag
|
|
|
- })
|
|
|
- me.$emit('loadCarDetail',pData,car_sn)
|
|
|
- } else {
|
|
|
- common.simpleToast(resp.data.msg);
|
|
|
- }
|
|
|
- });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}else{
|
|
|
const testArr=[
|
|
|
{type:'findCar',opt_type:1},
|
|
@@ -147,8 +147,8 @@ export default {
|
|
|
|
|
|
const isBluetoothConnect = app.globalData.nearLockCheck
|
|
|
if(isBluetoothConnect){
|
|
|
+
|
|
|
const isTurnOn=this.contrilList.find(item => item.isTurnOn).isTurnOn==1
|
|
|
- console.log(isTurnOn,this.cmdType,this.contrilList);
|
|
|
const bluetoothCommands = {
|
|
|
'turnOnOrOff': isTurnOn?bluetooth.turnOnCar:bluetooth.turnOffCar,
|
|
|
'findCar': bluetooth.findCarCmd,
|
|
@@ -191,6 +191,36 @@ export default {
|
|
|
complete: function(res) {},
|
|
|
})
|
|
|
}
|
|
|
+ },
|
|
|
+ trunOn(){
|
|
|
+ const switchType = this.contrilList.find(item => item.isTurnOn).isTurnOn
|
|
|
+ const pData = {
|
|
|
+ car_sn: car_info.car_sn,
|
|
|
+ switch: switchType
|
|
|
+ }
|
|
|
+ const me=this
|
|
|
+ common.loading();
|
|
|
+ http.postApi(config.API_FLK_CAR_SWITCH, pData, (resp) => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (resp.data.code === 200) {
|
|
|
+ common.simpleToast(me.popText + '成功');
|
|
|
+ const activeTag = me.contrilList.map(item => {
|
|
|
+ if('isLock' in item){
|
|
|
+ item.isTurnOn = (item.isTurnOn == 1) ? 0 : 1
|
|
|
+ item.name = i18n.t((item.isTurnOn == 1) ? '关机' : '开机')
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ const tag = getFunctionTag().tag
|
|
|
+ setFunctionTag({
|
|
|
+ activeTag,
|
|
|
+ tag
|
|
|
+ })
|
|
|
+ me.$emit('loadCarDetail',pData,car_sn)
|
|
|
+ } else {
|
|
|
+ common.simpleToast(resp.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
|