|
@@ -1,18 +1,22 @@
|
|
|
// const GATEWAY_URL = "http://23.37.100.87:8084";
|
|
|
// const GATEWAY_URL = "http://23.37.100.80:8084";
|
|
|
-const GATEWAY_URL = "http://192.168.0.95:8084"
|
|
|
+const GATEWAY_URL = "http://192.168.0.100:8084"
|
|
|
const PAGE_BASIC = GATEWAY_URL + "/basic";
|
|
|
let sceneThemes;
|
|
|
$(function() {
|
|
|
let datas = get(PAGE_BASIC + '/apiNoProcess/scence/getAllSceneAndThemeAndSystem');
|
|
|
console.log(datas);
|
|
|
+ // 场景主题
|
|
|
const scenes = datas.scenes;
|
|
|
sceneThemes = datas.sceneThemes;
|
|
|
initSences(scenes);
|
|
|
initThemes(sceneThemes);
|
|
|
initAncment(); //初始化通知公告
|
|
|
- let back = 0;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ // 下面的轮播图
|
|
|
+ let back = 0;
|
|
|
$("#btn_back").click(function() {
|
|
|
if (back < ($(".item-box>.item").length - 7)) {
|
|
|
back++;
|
|
@@ -101,9 +105,11 @@ $(function() {
|
|
|
|
|
|
});
|
|
|
// <img src="${PAGE_BASIC + item.sceneImgPath}" alt=""><p>${item.voice}</p>
|
|
|
+// 初始化场景
|
|
|
function initSences(scenes) {
|
|
|
let str = '';
|
|
|
scenes.forEach(item => {
|
|
|
+ // 图片路径
|
|
|
str += `<div class="item" data-id='${item.id}' style="background-image: url(${PAGE_BASIC + item.sceneImgPath});">
|
|
|
<div class="content">
|
|
|
<div class="card-info">
|
|
@@ -115,7 +121,7 @@ function initSences(scenes) {
|
|
|
$('.cards-box').empty().append(str);
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+// 初始化主题
|
|
|
function initThemes(themes) {
|
|
|
let str = '';
|
|
|
themes.forEach(item => {
|
|
@@ -177,7 +183,7 @@ function clickAncmentList(id) {
|
|
|
$(".notice").append(html);
|
|
|
}
|
|
|
|
|
|
-// 请求函数
|
|
|
+// 请求函数封装
|
|
|
function get(url, data, success, error) {
|
|
|
return request(url, 'GET', data, success, error)
|
|
|
}
|
|
@@ -188,6 +194,7 @@ function post(url, data, success, error) {
|
|
|
|
|
|
function request(url, type, data, success, error) {
|
|
|
var datas = null;
|
|
|
+ // 这里有个异步操作 代码是从上到下执行执行
|
|
|
$.ajax({
|
|
|
type: type,
|
|
|
async: false,
|
|
@@ -200,6 +207,8 @@ function request(url, type, data, success, error) {
|
|
|
success(json.data);
|
|
|
}
|
|
|
datas = json.data;
|
|
|
+ console.log(datas);
|
|
|
+ // 终止运行
|
|
|
return;
|
|
|
}
|
|
|
if (error) {
|