SyuanYu преди 2 години
родител
ревизия
5e7d512c4a
променени са 1 файла, в които са добавени 11 реда и са изтрити 17 реда
  1. 11 17
      misa/js/liff-functions.js

+ 11 - 17
misa/js/liff-functions.js

@@ -94,7 +94,7 @@ function createFlexMessageData() {
     "altText": redistitle,
     "contents": redisdata,
   };
-
+  alert(`${flex}`)
   return flex;
 }
 
@@ -109,22 +109,16 @@ function shareTargetPicker() {
       redistitle = data.title;
       console.log(redistitle);
       console.log(redisdata);
-      alert('測試');
-      alert(`redistitle: ${redistitle},redisdata: ${redisdata}`);
-      // liff
-      //   .shareTargetPicker([
-      //     createFlexMessageData()
-      //   ])
-      //   .then(() => {
-      //     alert("Shared to the friend(s) you picked");
-      //   })
-      //   .catch(function (res) {
-      //     alert(res);
-      //   });
 
-      liff.openWindow({
-        url: `https://access.line.me/oauth2/v2.1/liff/shareTargetPicker?liffId=1657114132-lvaMW1wP&ott=NpQQmuPeYKY07A0gt12Ge2`, // URL for another LIFF app
-        external: false
-      });
+      liff.shareTargetPicker([
+        createFlexMessageData()
+      ])
+        .then(() => {
+          alert("Shared to the friend(s) you picked");
+        })
+        .catch(function (res) {
+          alert('發送錯誤', res);
+        });
+
     });
 }