|
@@ -0,0 +1,230 @@
|
|
|
+window.onload = function () {
|
|
|
+ $.ajax({
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
+ url: "/open/getEventPlanningList",
|
|
|
+ data: {
|
|
|
+ pageSize: 10,
|
|
|
+ pageNo: 1
|
|
|
+ },
|
|
|
+ success: function (data) {
|
|
|
+ console.log(data);
|
|
|
+ if (data.error && data.error.length) {
|
|
|
+ alert("数据加载失败,请刷新页面");
|
|
|
+ } else {
|
|
|
+ $.each(data.data.list, function (index, item) {
|
|
|
+ console.log(index, item);
|
|
|
+
|
|
|
+ let part = `<li>
|
|
|
+ <a href="javascript:;">
|
|
|
+ <div class="newslist_img"><img src="${globalConfig.avatarUploadHost + item.pictureUrl}" alt=""></div>
|
|
|
+ <div class="newslist_content">
|
|
|
+ <h6 class="title">${item.title}</h6>
|
|
|
+ <div class="date">${item.createTimes}</div>
|
|
|
+ <p class="content">${item.content}</p>
|
|
|
+ </div>
|
|
|
+ </a>
|
|
|
+ </li>`
|
|
|
+ $(".app .newslist").prepend(part)
|
|
|
+ $(".app .newslist li .newslist_img").css({
|
|
|
+ "float": "left",
|
|
|
+ "width": "345px",
|
|
|
+ "height": "200px"
|
|
|
+ })
|
|
|
+ $(".app .newslist li .newslist_img img").css({
|
|
|
+ "width": "345px",
|
|
|
+ "height": "200px"
|
|
|
+ })
|
|
|
+ $(".app .newslist li .newslist_content").css({
|
|
|
+ "float": "left",
|
|
|
+ "width": "735px",
|
|
|
+ "margin-left": "70px",
|
|
|
+ "height": "200px"
|
|
|
+ })
|
|
|
+ $(".app .newslist li .newslist_content .title").css({
|
|
|
+ "color": "#333",
|
|
|
+ "font-size": "24px"
|
|
|
+ })
|
|
|
+ $(".app .newslist li .newslist_content .date").css({
|
|
|
+ "color": "#666",
|
|
|
+ "font-size": "17px",
|
|
|
+ "margin": "12px 0"
|
|
|
+ })
|
|
|
+ $(".app .newslist li .newslist_content .content").css({
|
|
|
+ "color": "#666",
|
|
|
+ "display": "-webkit-box",
|
|
|
+ "-webkit-box-orient": "vertical",
|
|
|
+ "-webkit-line-clamp": "6",
|
|
|
+ "overflow": "hidden"
|
|
|
+ })
|
|
|
+ $(".app .newslist li").css({
|
|
|
+ "width": "1250px",
|
|
|
+ "height": "272px",
|
|
|
+ "padding": "36px 50px",
|
|
|
+ "transition": "all .36s ease",
|
|
|
+ "position": "relative",
|
|
|
+ "top": "0",
|
|
|
+ "left": "0"
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ let page = `<div class="page_ctrl">
|
|
|
+ <span class="page_total">共 ${Math.ceil(data.data.totalCount/10)} 页</span>
|
|
|
+ <button class="prev_page"><</button>
|
|
|
+ <button class="">></button>
|
|
|
+ <span class="page_total">到第</span>
|
|
|
+ <input class="input_page_num" type="text">
|
|
|
+ <span class="page_total">页</span>
|
|
|
+ <button>确定</button>
|
|
|
+ </div>`
|
|
|
+ let pagebtn =
|
|
|
+
|
|
|
+ $(".app .page_1").prepend(page)
|
|
|
+ $(".app .page_1").css({"margin": "40px 0"})
|
|
|
+ $(".app .page_1 .page_ctrl").css({
|
|
|
+ "text-align": "center",
|
|
|
+ "margin": "10px auto",
|
|
|
+ "box-sizing": "border-box"
|
|
|
+ })
|
|
|
+ $(".app .page_1 .page_ctrl .page_total").css({
|
|
|
+ "font-size" : "15px",
|
|
|
+ "color": "#999"
|
|
|
+ })
|
|
|
+ $(".app .page_1 .page_ctrl .prev_page").css({
|
|
|
+ "cursor": "default",
|
|
|
+ "opacity": ".7",
|
|
|
+ "background": "#eee",
|
|
|
+ "color": "#616161",
|
|
|
+ "border": "1px solid #999999"
|
|
|
+ })
|
|
|
+ $(".app .page_ctrl button,.app .input_page_num").css({
|
|
|
+ "font-size": "12px",
|
|
|
+ "width": "32px",
|
|
|
+ "height": "32px",
|
|
|
+ "line-height": "32px",
|
|
|
+ "background": "#ffffff",
|
|
|
+ "border-radius": "25px",
|
|
|
+ "color": "#999999",
|
|
|
+ "cursor": "point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