Selaa lähdekoodia

fix(云机剪贴板): 修复清空剪贴板

zengzhixiang 2 vuotta sitten
vanhempi
commit
8b66070296

+ 20 - 7
static/screenAndroid/WXtrialInterface.html

@@ -42,7 +42,10 @@
       rel="stylesheet"
       href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css"
     />
+    <!-- <link rel="stylesheet" href="../static/lib/swiper/swiper-bundle.min.css" />
+    <script src="../static/lib/swiper/swiper-bundle.js"></script> -->
     <script src="../static/lib/doT-1.1.3/doT.min.js"></script>
+    <script src="../static/lib/qs.js"></script>
   </head>
 
   <body class="scroll h-player" style="overscroll-behavior: contain">
@@ -67,7 +70,7 @@
       </div>
       <div class="slide-wrapper-content">
         {{~ it :item:index }}
-        <div class="slide-wrapper">
+        <div class="slide-wrapper" data-id="{{= item.id}}">
           <div class="slide-scroll animate-slide-start">
             <div
               class="slide-content"
@@ -964,14 +967,24 @@
       }
       // 清空剪贴板
       function handleClear() {
-        var ids = '';
-        cutList.forEach(function (item) {
-          ids += 'ids=' + item.id + '&';
-        });
-        ids = ids.substring(0, ids.lastIndexOf('&'));
+        // var ids = '';
+        // cutList.forEach(function (item) {
+        //   ids += 'ids=' + item.id + '&';
+        // });
+
+        // ids = ids.substring(0, ids.lastIndexOf('&'));
+
         $.confirm('确定清空剪贴板?', function () {
           $.ajax({
-            url: baseUrl + '/api/public/v5/shear/content?' + ids,
+            url:
+              baseUrl +
+              '/api/public/v5/shear/content' +
+              Qs.stringify(
+                {
+                  ids: Array.from($('.slide-wrapper')).map((v) => v.dataset.id),
+                },
+                { arrayFormat: 'repeat', addQueryPrefix: true },
+              ),
             headers: {
               Authorization: token,
             },

+ 18 - 7
static/screenIos/WXtrialInterface.html

@@ -46,6 +46,7 @@
     <!-- <link rel="stylesheet" href="../static/lib/swiper/swiper-bundle.min.css" />
     <script src="../static/lib/swiper/swiper-bundle.js"></script> -->
     <script src="../static/lib/doT-1.1.3/doT.min.js"></script>
+    <script src="../static/lib/qs.js"></script>
   </head>
 
   <body class="scroll h-player" style="overscroll-behavior: contain">
@@ -70,7 +71,7 @@
       </div>
       <div class="slide-wrapper-content">
         {{~ it :item:index }}
-        <div class="slide-wrapper">
+        <div class="slide-wrapper" data-id="{{= item.id}}">
           <div class="slide-scroll animate-slide-start">
             <div
               class="slide-content"
@@ -683,14 +684,24 @@
       }
       // 清空剪贴板
       function handleClear() {
-        var ids = '';
-        cutList.forEach(function (item) {
-          ids += 'ids=' + item.id + '&';
-        });
-        ids = ids.substring(0, ids.lastIndexOf('&'));
+        // var ids = '';
+        // cutList.forEach(function (item) {
+        //   ids += 'ids=' + item.id + '&';
+        // });
+
+        // ids = ids.substring(0, ids.lastIndexOf('&'));
+
         $.confirm('确定清空剪贴板?', function () {
           $.ajax({
-            url: baseUrl + '/api/public/v5/shear/content?' + ids,
+            url:
+              baseUrl +
+              '/api/public/v5/shear/content' +
+              Qs.stringify(
+                {
+                  ids: Array.from($('.slide-wrapper')).map((v) => v.dataset.id),
+                },
+                { arrayFormat: 'repeat', addQueryPrefix: true },
+              ),
             headers: {
               Authorization: token,
             },

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 2054 - 0
static/static/lib/qs.js