|
|
@@ -99,6 +99,8 @@ function initOther() {
|
|
|
mainSearch(url, nameEn, slideDiv, typetype,"2");
|
|
|
});
|
|
|
|
|
|
+ initOther4Popup();
|
|
|
+
|
|
|
$(".apis-move-div-button3").click(function () {
|
|
|
ownClearInterval();
|
|
|
});
|
|
|
@@ -1082,4 +1084,115 @@ function insertOrUpdateWatchlistSubmit(){
|
|
|
console.log("insertOrUpdateWatchlist-submit error," + data);
|
|
|
}
|
|
|
});
|
|
|
+}
|
|
|
+
|
|
|
+function initOther4Popup(){
|
|
|
+ // 打开弹窗
|
|
|
+ $(".apis-quiet-div-button3").on("click", function () {
|
|
|
+ var selectedOption = $("select#apis-quiet-select").find("option:selected");
|
|
|
+ var url = selectedOption.attr("url");
|
|
|
+ var typetype = selectedOption.attr("typetype");
|
|
|
+ var nameEn = selectedOption.attr("nameEn");
|
|
|
+ var slideDiv = $(this).attr("slideDiv");
|
|
|
+ quietPop(url, nameEn, slideDiv, typetype);
|
|
|
+
|
|
|
+ $(".popup").fadeIn();
|
|
|
+ centerPopup(); // 调用居中函数
|
|
|
+ });
|
|
|
+
|
|
|
+ // 关闭弹窗
|
|
|
+ $(".close-btn").on("click", function () {
|
|
|
+ $(".popup").fadeOut();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 阻止表单默认提交行为
|
|
|
+ $(".popup form").on("submit", function (e) {
|
|
|
+ e.preventDefault();
|
|
|
+ alert("表单已提交!");
|
|
|
+ $(".popup").fadeOut();
|
|
|
+ });
|
|
|
+
|
|
|
+ // 实现拖动功能
|
|
|
+ let isDragging = false;
|
|
|
+ let offsetX, offsetY;
|
|
|
+
|
|
|
+ $("#draggable-popup").on("mousedown", function (e) {
|
|
|
+ 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 () {
|
|
|
+ $(".progress-container").fadeOut(); // 重置时隐藏进度条
|
|
|
+ $(".loading-icon").fadeOut(); // 重置时隐藏加载图标
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 计算并设置弹窗居中位置
|
|
|
+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) / 2;
|
|
|
+
|
|
|
+ // 设置弹窗的位置
|
|
|
+ popup.css({
|
|
|
+ left: `${left}px`,
|
|
|
+ top: `${top}px`,
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * quietPop
|
|
|
+ * @param pageNo
|
|
|
+ */
|
|
|
+function quietPop(url, nameEn, slideDiv, typetype) {
|
|
|
+ if (nameEn === 'currentPlan' || nameEn === 'orderMarginCoinCurrent') {
|
|
|
+ } else if (nameEn === 'monitorCurrency') {
|
|
|
+ } else if (nameEn === 'allPositionv2') {
|
|
|
+ } else if (nameEn === 'orderHistoryProductType') {
|
|
|
+ } else if (nameEn === 'traderList') {
|
|
|
+ } else if (nameEn === 'watchlist') {
|
|
|
+ let formContent = "";
|
|
|
+ formContent += '<div class="form-item"><label for="symbol">名称:</label><input type="text" id="symbol" placeholder="不可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="trackCategory">赛道分类:</label><input type="text" id="trackCategory" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="trackCategory2">赛道分类2:</label><input type="text" id="trackCategory2" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="issuingDate">发行日期:</label><input type="text" id="issuingDate" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="cmcId">cmcId:</label><input type="text" id="cmcId" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="coingeckoId">coingeckoId:</label><input type="text" id="coingeckoId" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="coingeckoUrl">coingeckoUrl:</label><input type="text" id="coingeckoUrl" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="feixiaohaoUrl">feixiaohaoUrl:</label><input type="text" id="feixiaohaoUrl" placeholder="可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="filterFlag">filterFlag:</label><input type="text" id="filterFlag" placeholder="不可为空"></div>';
|
|
|
+ formContent += '<div class="form-item"><label for="crudType">crudType:</label><input type="text" id="crudType" placeholder="不可为空"></div>';
|
|
|
+ $("#form-container").html(formContent);
|
|
|
+ $(".quietpop-content").html("");
|
|
|
+ } else if (nameEn === 'image') {
|
|
|
+ } else if (nameEn === 'cmcmap') {
|
|
|
+ } else if (nameEn === 'music') {
|
|
|
+ } else if (nameEn === 'currentHolding') {
|
|
|
+ } else if (nameEn === 'bookmark') {
|
|
|
+ }
|
|
|
}
|