初始化

This commit is contained in:
2025-12-11 09:50:02 +08:00
commit c25e282398
127 changed files with 63158 additions and 0 deletions

260
lib/RequestingCenter.js Normal file
View File

@@ -0,0 +1,260 @@
import reqeust from 'request.js'
import reqeust1 from 'request1.js'
// 本地环境
// const Url = "http://192.168.0.104:81/ApiWx/";
// const Url = "http://localhost:56306/ApiWx/";
// 生产环境
const Url = "https://auth.blv-oa.com/ApiWx/";
const BoonliveUrl = "https://auth.blv-oa.com/Upgrade/";
// 测试环境
//const Url = "http://auth.blv-oa.com:996/ApiWx/";
const appid = 5;
var token = null
//获取token
function gettoken(){
if (token == null) {
token = wx.getStorageSync('xiaoxi_token') || ""
}
return token;
}
export function settoken(val) {
token = val;
}
//账号密码登录
export async function Login(params) {
token = null;
params.appid = appid
return await reqeust({
title: "登录中",
url: Url + 'Login',
data: params || {}
})
};
//token登录
export async function LoginToken(params) {
token = null;
params.appid = appid
return await reqeust({
title: "登录中",
url: Url + 'LoginToken',
data: params || {}
})
}
//获取酒店信息
export async function GetHostsInfo(params) {
params.appid = appid
params.token = gettoken();
return await reqeust({
title: "加载中...",
url: Url + 'HostsInfo',
data: params || {}
})
}
//绑定Mac地址
export async function GetMAC(params) {
params.token = gettoken();
return await reqeust({
title: params.MAC == "" ? "解绑中..." : "绑定中...",
url: Url + 'GetMAC',
data: params || {}
})
}
// 日志信息
export async function Logsinfo(params) {
params.token = gettoken();
return await reqeust({
title: "加载中...",
url: Url + 'Logsinfo',
data: params || {}
})
}
// 反馈错误
export async function ErrorInfo(params) {
params.token = gettoken();
return await reqeust({
title: "反馈中...",
url: Url + 'ErrorInfo',
data: params || {}
})
}
// 查询人脸机是否绑定
export async function CheckFaceSN(params) {
params.token = gettoken();
return await reqeust({
title:"查询中...",
url: Url + 'CheckFaceSN',
data: params || {}
})
}
// 绑定人脸机
export async function GetFaceSN(params) {
params.token = gettoken();
return await reqeust({
title: params.isjb ? "解绑中..." : "绑定中...",
url: Url + 'GetFaceSN',
data: params || {}
})
}
//开门测试
export async function OpenDoorTest(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发开门命令中",
url: Url + 'OpenDoorTest',
data: params || {}
})
}
//重启测试
export async function RestartTheDevice(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发重启命令中",
url: Url + 'RestartTheDevice',
data: params || {}
})
}
//获取设备信息测试
export async function GeteDeviceInfomation(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发获取设备信息命令中",
url: Url + 'GeteDeviceInfomation',
data: params || {}
})
}
//删除所有住户人员信息
export async function DeletePeopleFromDeviceByGroup(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发删除所有住户人员信息命令中",
url: Url + 'DeletePeopleFromDeviceByGroup',
data: params || {}
})
}
export async function GetThePeopleListOfDevice(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "获取人员信息列表",
url: Url + 'GetThePeopleListOfDevice',
data: params || {}
})
}
//开房
export async function openRommCheckin(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发开房命令",
url: Url + 'openRommCheckin',
data: params || {}
})
}
//退房
export async function roomCheckOut(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "下发退房命令",
url: Url + 'roomCheckOut',
data: params || {}
})
}
//获取房型
export async function GetRoomType(params){
params.token = gettoken();
console.log(params)
return await reqeust({
title: "获取酒店房型信息",
url: Url + 'GetRoomTypeAndModalsList',
data: params || {}
})
}
//获取房型下的房间
export async function GetRoomTypeNode(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: "获取酒店房间信息",
url: BoonliveUrl + 'GetDeviceInfo',
data: params || {}
})
}
export async function WebChatUpgrade(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: "准备设备升级",
url: BoonliveUrl + 'WebChatUpgrade',
data: params || {}
})
}
export async function GetRoomTypeAndModalsListLog(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: "获取房间配置回路信息",
url: BoonliveUrl + 'GetRoomTypeAndModalsListLog',
data: params || {}
})
}
export async function QueryUpdateHostStatus(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: null,
url: BoonliveUrl + 'QueryUpdateHostStatus',
data: params || {}
})
}
export async function ForwardQueryUpdateHostProgressBar(params){
params.token = gettoken();
// console.log(params)
return await reqeust1({
title: null,
url: BoonliveUrl + 'ForwardQueryUpdateHostProgressBar',
data: params || {}
})
}
export async function SetRCULight(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: null,
url: BoonliveUrl + 'SetRCULight',
data: params || {}
})
}
export async function SetRCUAir(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: null,
url: BoonliveUrl + 'SetRCUAir',
data: params || {}
})
}
export async function SetRCUCurtain(params){
params.token = gettoken();
console.log(params)
return await reqeust1({
title: null,
url: BoonliveUrl + 'SetRCUCurtain',
data: params || {}
})
}
SetRCUCurtain

18
lib/Toast.js Normal file
View File

@@ -0,0 +1,18 @@
export function Toastsuccess(title,success,time) {
wx.showToast({
title:title || '成功',
icon:'success',
mask:true,
duration:time||1500,
success:success || null
})
}
export function ToastError(title,success,time) {
wx.showToast({
title:title,
icon:'none',
mask:true,
duration:time||1500,
success:success || null
})
}

61
lib/request.js Normal file
View File

@@ -0,0 +1,61 @@
//请求数量
let show = 0;
export default async function reqeust(params) {
show++;
return new Promise((resolve, reject) => {
wx.showLoading({
title: params.title,
mask:true
})
wx.request({
url: params.url,
method: params.method || 'post',
data: params.data || {},
success: res => {
resolve(res.data)
},
fail: err => {
reject(err)
},
complete:()=>{
show--;
if(show==0){
wx.hideLoading()
}
}
})
}).catch((error) => {
throw new Error(error);
})
}
// export default async function reqeust1(params) {
// show++;
// return new Promise((resolve, reject) => {
// wx.showLoading({
// title: params.title,
// mask:true
// })
// wx.request({
// header: {
// contentType: 'application/x-www-form-urlencoded', // 填入服务名称
// },
// url: params.url,
// method: params.method || 'post',
// data: params.data || {},
// success: res => {
// resolve(res.data)
// },
// fail: err => {
// reject(err)
// },
// complete:()=>{
// show--;
// if(show==0){
// wx.hideLoading()
// }
// }
// })
// }).catch((error) => {
// throw new Error(error);
// })
// }

65
lib/request1.js Normal file
View File

@@ -0,0 +1,65 @@
//请求数量
let show = 0;
export default async function reqeust(params) {
show++;
return new Promise((resolve, reject) => {
wx.showLoading({
title: params.title,
mask:true
})
wx.request({
header: {
contentType: 'application/x-www-form-urlencoded', // 填入服务名称
},
url: params.url,
method: params.method || 'post',
data: params.data || {},
success: res => {
resolve(res.data)
},
fail: err => {
reject(err)
},
complete:()=>{
show--;
if(show==0){
wx.hideLoading()
}
}
})
}).catch((error) => {
throw new Error(error);
})
}
// export default async function reqeust1(params) {
// show++;
// return new Promise((resolve, reject) => {
// wx.showLoading({
// title: params.title,
// mask:true
// })
// wx.request({
// header: {
// contentType: 'application/x-www-form-urlencoded', // 填入服务名称
// },
// url: params.url,
// method: params.method || 'post',
// data: params.data || {},
// success: res => {
// resolve(res.data)
// },
// fail: err => {
// reject(err)
// },
// complete:()=>{
// show--;
// if(show==0){
// wx.hideLoading()
// }
// }
// })
// }).catch((error) => {
// throw new Error(error);
// })
// }