| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import request from '@/utils/request'
- // 获取设备info
- export function sendPortDetailCmd(deviceInfo) {
- return request({
- url: '/device/sendPortDetailCmd',
- method: 'post',
- data:deviceInfo
- })
- }
- function cloneObj(obj){
- return JSON.parse(JSON.stringify(obj));
- }
- //获取接口状态
- export function getPortDetail(deviceInfo,time) {
- let data = cloneObj(deviceInfo);
- data.time = time;
- return request({
- url: '/device/getPortDetail',
- method: 'post',
- data:data
- })
- }
- //开始充电
- export function startCharge(deviceInfo) {
- return request({
- url: '/device/startCharge',
- method: 'post',
- data:deviceInfo
- })
- }
- //停止充电
- export function stopCharge(deviceInfo){
- return request({
- url: '/device/stopCharge',
- method: 'post',
- data:deviceInfo
- })
- }
- //检测是否有端口变动
- export function checkStatusChange(deviceInfo,time){
- let data = cloneObj(deviceInfo);
- data.time = time;
- return request({
- url: '/device/statusChange?time='+time,
- method: 'post',
- data:data
- })
- }
- //获取设备详情
- export function getDeviceInfoFromQrcode(qrcode){
- qrcode = encodeURIComponent(qrcode)
- return request({
- url: '/device/getDeviceInfo?qrcode='+qrcode,
- method: 'post',
- })
- }
- //获取设备预约
- export function getPlanInfo(deviceId,port){
- return request({
- url: '/device/getPlanInfo?deviceId='+deviceId+"&port="+port,
- method: 'post',
- })
- }
- //取消预约
- export function cancelPlan(planId){
- return request({
- url: '/device/cancelPlan/'+planId,
- method: 'post',
- })
- }
- //绑定设备
- export function bindDevice(qrcode){
- return request({
- url: '/device/bindDevice?qrcode='+qrcode,
- method: 'post',
- })
- }
- export function deviceList(){
- return request({
- url: '/device/deviceList',
- method: 'post',
- })
- }
- export function unBind(qrcode){
- return request({
- url: '/device/unbindDevice?qrcode='+qrcode,
- method: 'post',
- })
- }
|