12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- import fly from "./main";
- // 设备列表
- export function game_devices($params = {}) {
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/device-list", $params);
- }
- // 开始游戏
- export function gameStart($params) {
- return fly.post("game/game-start", $params);
- }
- //结束游戏
- export function gameEnd($params) {
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/game-over", $params);
- }
- //游戏记录详情
- export function gameDetail($record_id) {
- let $params = {};
- $params["game_record_id"] = $record_id;
- // $params["game_record_id"] = "9389";
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/game-detail", $params);
- }
- //折线图图表
- export function gameLineChart($params) {
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/line", $params);
- }
- // 添加折线图的点
- export function gameAddLine($params) {
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/add-line", $params);
- }
- //获取游戏记录
- export function gameList($params = {}) {
- $params["access_token"] = wx.getStorageSync("token");
- return fly.post("game/game-list", $params);
- }
- //2021年10月21日15:08:57
- //获取设备
- export function getDeviceBySn($sn) {
- let $params = {
- "access_token": wx.getStorageSync("token"),
- "sn": $sn
- }
- return fly.post("equipment/equipment-search", $params)
- }
- //2021年10月22日11:11:03
- // 写入设备
- export function setDeviceInDb($this, $deviceId) {
- let $params = $this.device_data;
- $params["access_token"] = wx.getStorageSync("token")
- wx.getSystemInfo({
- success(res) {
- switch (res.platform) {
- case "android":
- default:
- $params['is_android'] = 0;
- break;
- case "ios":
- $params['is_android'] = 2;
- break;
- }
- if (res.platform == "ios") {
- $params['ios_device_id'] = $deviceId
- } else {
- $params['device_id'] = $deviceId;
- }
- }
- })
- return fly.post("https://testadmin.shuimuai.com/equipment/factory", $params)
- }
|