|
|
@@ -173,6 +173,21 @@ function search(pageNo, startFlag, searchSelectFlag) {
|
|
|
scoreStr = videoInfo.score;
|
|
|
}
|
|
|
|
|
|
+ var str2 = "";
|
|
|
+ if (bigType == '骑兵') {
|
|
|
+ str2 = " <span class=\"pic-tag pic-text\">" +
|
|
|
+ " <span class='tag xp' + identificationCode='" + videoInfo.identificationCode + "' title='" + videoInfo.javdbUrl + "' style=\"background-color: rgba(0,0,0,0);\">" + videoInfo.xpCount + "</span>" +
|
|
|
+ " <input type='hidden' commentFirst='" + videoInfo.commentFirst + "'>" +
|
|
|
+ " <input type='hidden' commentTwo='" + videoInfo.comment + "'>" +
|
|
|
+ " <input type='hidden' commentXp='" + videoInfo.commentXp + "'>" +
|
|
|
+ " <input type='hidden' commentScore='" + videoInfo.score + "'>" +
|
|
|
+ " <input type='hidden' bigType='骑兵'>" +
|
|
|
+ " <span class=\"text-right\" style='float:right' title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
|
|
|
+ " </span>";
|
|
|
+ } else {
|
|
|
+ str2 = " <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>";
|
|
|
+ }
|
|
|
+
|
|
|
str += "<li class=\"col-lg-8 col-md-6 col-sm-4 col-xs-3\">" +
|
|
|
" <div class=\"myui-vodlist__box\">" +
|
|
|
" <a class=\"myui-vodlist__thumb lazyload\" title=\"\" style=\"background-image: url("apics/" + videoInfo.imgUrl + "");\">" +
|
|
|
@@ -182,7 +197,7 @@ function search(pageNo, startFlag, searchSelectFlag) {
|
|
|
" <input type='hidden' javdbUrl='" + videoInfo.javdbUrl + "'>" +
|
|
|
" <span class=\"tag identificationDate\" title=\"" + orginUrl + "\" style=\"background-color: #00C0FF;\">" + date + "</span>" +
|
|
|
" </span>" +
|
|
|
- " <span class=\"pic-text text-right\" title='" + (videoInfo.comment === '' ? '暂无评论' : videoInfo.comment) + "'>" + scoreStr + "</span>" +
|
|
|
+ str2 +
|
|
|
" </a>" +
|
|
|
" <div class=\"myui-vodlist__detail\">" +
|
|
|
" <h4 class=\"videodetail title text-overflow\" identificationCode='" + videoInfo.identificationCode + "' orginUrl='" + orginUrl + "'><a title=\" " + videoInfo.name + " \">" + videoInfo.name + "</a></h4>" +
|
|
|
@@ -424,4 +439,156 @@ function initContentEvent() {
|
|
|
window.open(orginUrlArr[1]);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ initOther4Popup();
|
|
|
+}
|
|
|
+
|
|
|
+function initOther4Popup(){
|
|
|
+ // 打开弹窗
|
|
|
+ $("span.xp").on("click", function () {
|
|
|
+ let parent = $(this).parent();
|
|
|
+ var commentfirst = parent.find("input[type='hidden']").eq(0).attr("commentfirst");
|
|
|
+ var commenttwo = parent.find("input[type='hidden']").eq(1).attr("commenttwo");
|
|
|
+ var commentxp = parent.find("input[type='hidden']").eq(2).attr("commentxp");
|
|
|
+ var commentscore = parent.find("input[type='hidden']").eq(3).attr("commentscore");
|
|
|
+ var bigtype = parent.find("input[type='hidden']").eq(4).attr("bigtype");
|
|
|
+ var identificationCode = $(this).attr("identificationCode");
|
|
|
+ quietPop(bigtype, identificationCode, commentfirst, commenttwo, commentxp, commentscore);
|
|
|
+
|
|
|
+ $(".popup").fadeIn();
|
|
|
+ centerPopup(); // 调用居中函数
|
|
|
+ });
|
|
|
+
|
|
|
+ // 关闭弹窗
|
|
|
+ $(".close-btn").on("click", function () {
|
|
|
+ $(".popup").fadeOut();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 阻止表单默认提交行为
|
|
|
+ $(".popup form").on("submit", function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+
|
|
|
+ var nameEn = $("#popup-form-hidden-nameEn").val();
|
|
|
+ if (nameEn === '骑兵') {
|
|
|
+ insertOrUpdateQibingSubmit();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 实现拖动功能
|
|
|
+ let isDragging = false;
|
|
|
+ let offsetX, offsetY;
|
|
|
+
|
|
|
+ $("#draggable-popup h2").on("mousedown", function (e) {
|
|
|
+ // 判断如果点击在 input 或 select 上,不触发拖动
|
|
|
+ if ($(e.target).closest("input, select, label").length) {
|
|
|
+ return; // 如果按在 input 或 select 上,不启动拖动
|
|
|
+ }
|
|
|
+
|
|
|
+ isDragging = true;
|
|
|
+ offsetX = e.clientX - $(this).offset().left;
|
|
|
+ offsetY = e.clientY - $(this).offset().top;
|
|
|
+ $(this).css("cursor", "grabbing"); // 改变鼠标指针样式
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("mousemove", function (e) {
|
|
|
+ if (isDragging) {
|
|
|
+ const left = e.clientX - offsetX;
|
|
|
+ const top = e.clientY - offsetY;
|
|
|
+ $("#draggable-popup").css({
|
|
|
+ left: `${left}px`,
|
|
|
+ top: `${top}px`,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ $(document).on("mouseup", function () {
|
|
|
+ isDragging = false;
|
|
|
+ $("#draggable-popup").css("cursor", "move"); // 恢复鼠标指针样式
|
|
|
+ });
|
|
|
+
|
|
|
+ // 重置按钮的功能
|
|
|
+ $("#reset-button").on("click", function () {
|
|
|
+ $("#result-container").fadeOut(); // 隐藏请求结果区域
|
|
|
+ $(".loading-icon").fadeOut(); // 重置时隐藏加载图标
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 显示加载图标
|
|
|
+function showLoading() {
|
|
|
+ $("#result-content").text(""); // 清空内容
|
|
|
+ $("#result-container").hide(); // 使用 hide() 快速隐藏
|
|
|
+ $("#loading-icon").fadeIn(); // 显示加载图标
|
|
|
+}
|
|
|
+
|
|
|
+// 计算并设置弹窗居中位置
|
|
|
+function centerPopup() {
|
|
|
+ const popup = $("#draggable-popup");
|
|
|
+ const windowWidth = $(window).width();
|
|
|
+ const windowHeight = $(window).height();
|
|
|
+ const popupWidth = popup.outerWidth();
|
|
|
+ const popupHeight = popup.outerHeight();
|
|
|
+
|
|
|
+ // 计算弹窗的位置
|
|
|
+ const left = (windowWidth - popupWidth) / 2;
|
|
|
+ const top = (windowHeight - popupHeight) / 4;
|
|
|
+
|
|
|
+ // 设置弹窗的位置
|
|
|
+ popup.css({
|
|
|
+ left: `${left}px`,
|
|
|
+ top: `${top}px`,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+function quietPop(bigtype, identificationCode, commentfirst, commenttwo, commentxp, commentscore) {
|
|
|
+ if (bigtype === '骑兵') {
|
|
|
+ let formContent = "";
|
|
|
+ formContent += '<div class="form-item"><label for="identificationCode">code:</label><input readonly type="text" name="identificationCode" style="border:revert;" value="' + identificationCode + '"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="commentfirst">commentfirst:</label><textarea rows="5" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commentfirst">' + commentfirst + '</textarea></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="commenttwo">commenttwo:</label><textarea rows="5" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commenttwo">' + commenttwo + '</textarea></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="commentxp">commentxp:</label><textarea rows="6" cols="100" style="background: antiquewhite;width: 100%;height: 100%;" name="commentxp">' + commentxp +'</textarea></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="commentscore">commentscore:</label><input type="text" name="commentscore" placeholder="可为空" style="border:revert;" value="' + commentscore + '"></div>';
|
|
|
+ $("#form-container-2").html(formContent);
|
|
|
+
|
|
|
+ $("#popup-form-hidden-nameEn").val(bigtype);
|
|
|
+
|
|
|
+ $("#draggable-popup > h2").text("InsertOrUpdate4Qibing");
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function insertOrUpdateQibingSubmit(){
|
|
|
+ var formData = new FormData($("#popup-form")[0]);
|
|
|
+ formData.append("userName", getCookie('username'));
|
|
|
+ $.ajax({
|
|
|
+ url: "videoInfo/insertOrUpdateQibing", //请求的url地址
|
|
|
+ dataType: "json", //返回格式为json
|
|
|
+ data: formData, //参数值
|
|
|
+ type: "post", //请求方式
|
|
|
+ processData: false,// 告诉jQuery不要去处理发送的数据
|
|
|
+ contentType: false,// 告诉jQuery不要去设置Content-Type请求头
|
|
|
+ async: true, //请求是否异步,默认为异步,这也是ajax重要特性
|
|
|
+ success: function (data) {
|
|
|
+ //$(".popup > .watchlist-loading").css("display", "none");
|
|
|
+ //请求成功时处理
|
|
|
+ if (data != null && $.trim(data) != "" && data.success) {
|
|
|
+ $("#searchbutton").click();
|
|
|
+ } else {
|
|
|
+ //$("#insertOrUpdateAlert").html(data.message);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 在请求成功后填充数据到结果区域
|
|
|
+ $("#result-content").text(JSON.stringify(data, null, 2));
|
|
|
+ $("#loading-icon").fadeOut();
|
|
|
+ $("#result-container").fadeIn(); // 显示结果区域
|
|
|
+ },
|
|
|
+ beforeSend: function () {
|
|
|
+ //$(".popup > .watchlist-loading").css("display", "block");
|
|
|
+ showLoading(); // 显示加载状态
|
|
|
+ },
|
|
|
+ complete: function () {
|
|
|
+ },
|
|
|
+ error: function (data) {
|
|
|
+ //请求出错处理
|
|
|
+ console.log("insertOrUpdateQibing-submit error," + data);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|