SyuanYu 2 лет назад
Родитель
Сommit
6c1a126e3b
40 измененных файлов с 2553 добавлено и 0 удалено
  1. BIN
      misa-program-1/.DS_Store
  2. BIN
      misa-program-1/icon/badge.png
  3. BIN
      misa-program-1/icon/example.png
  4. BIN
      misa-program-1/icon/icon.ico
  5. BIN
      misa-program-1/icon/liff.png
  6. 61 0
      misa-program-1/index.html
  7. 378 0
      misa-program-1/js/liff-functions.js
  8. 84 0
      misa-program-1/js/liff-init.js
  9. BIN
      misa-program-2/.DS_Store
  10. BIN
      misa-program-2/icon/badge.png
  11. BIN
      misa-program-2/icon/example.png
  12. BIN
      misa-program-2/icon/icon.ico
  13. BIN
      misa-program-2/icon/liff.png
  14. 61 0
      misa-program-2/index.html
  15. 369 0
      misa-program-2/js/liff-functions.js
  16. 84 0
      misa-program-2/js/liff-init.js
  17. BIN
      misa-program-3/.DS_Store
  18. BIN
      misa-program-3/icon/badge.png
  19. BIN
      misa-program-3/icon/example.png
  20. BIN
      misa-program-3/icon/icon.ico
  21. BIN
      misa-program-3/icon/liff.png
  22. 61 0
      misa-program-3/index.html
  23. 369 0
      misa-program-3/js/liff-functions.js
  24. 84 0
      misa-program-3/js/liff-init.js
  25. BIN
      misa-program-4/.DS_Store
  26. BIN
      misa-program-4/icon/badge.png
  27. BIN
      misa-program-4/icon/example.png
  28. BIN
      misa-program-4/icon/icon.ico
  29. BIN
      misa-program-4/icon/liff.png
  30. 61 0
      misa-program-4/index.html
  31. 360 0
      misa-program-4/js/liff-functions.js
  32. 85 0
      misa-program-4/js/liff-init.js
  33. BIN
      misa-program-5/.DS_Store
  34. BIN
      misa-program-5/icon/badge.png
  35. BIN
      misa-program-5/icon/example.png
  36. BIN
      misa-program-5/icon/icon.ico
  37. BIN
      misa-program-5/icon/liff.png
  38. 61 0
      misa-program-5/index.html
  39. 351 0
      misa-program-5/js/liff-functions.js
  40. 84 0
      misa-program-5/js/liff-init.js

BIN
misa-program-1/.DS_Store


BIN
misa-program-1/icon/badge.png


BIN
misa-program-1/icon/example.png


BIN
misa-program-1/icon/icon.ico


BIN
misa-program-1/icon/liff.png


+ 61 - 0
misa-program-1/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <title>MISA 資訊分享</title>
+  <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="stylesheet" href="/css/style.css">
+</head>
+
+<body>
+  <div id="message">
+    <center>
+      <img style="margin: 0; width: 250px; image-rendering: -webkit-optimize-contrast;" src="https://s3cdn.yourator.co/banners/banners/000/001/645/home/06dc43274281d1bd66f4a49adbbae354ec3426b8.png"
+        alt="">
+      <h2>成功領導者的決策思維 <br> LINE 傳單分享</h2>
+    </center>
+
+    <div class="step-container">
+      <div class="step-item">
+        <div>
+          <img src="/liff2/img/phone.png" alt="">
+        </div>
+        <div class="text">
+          <h3>如何 2 步驟分享給好友</h3>
+          <div>
+            <p>步驟 1</p>
+            <p>請點擊登入 LINE 帳號。<br>(第一次使用需授予許可)</p>
+          </div>
+          <img src="/liff2/img/arrow.png" alt="">
+          <div>
+            <p>步驟 2</p>
+            <p>請點擊「發傳單給最多十位好友」,<br>選擇發送對象後按下分享即可傳送。</p>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <center>
+      <img
+        src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
+        style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
+    </center>
+
+    <center>
+      <button onclick="login()">登入 LINE</button>
+      <button onclick="logout()">登出 LINE</button>
+      <button id="senddm" onclick="shareTargetPicker()">發傳單給最多十個好友</button>
+    </center>
+  </div>
+
+  <p id="load">ChoozMo</p>
+  <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
+  <script src="js/liff-init.js?1234"></script>
+  <script src="js/liff-functions.js?12345"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+</body>
+
+</html>

+ 378 - 0
misa-program-1/js/liff-functions.js

@@ -0,0 +1,378 @@
+function getProfile() {
+  liff
+    .getProfile()
+    .then(profile => {
+      console.log(JSON.stringify(profile));
+      window.alert(JSON.stringify(profile));
+    })
+    .catch(e => {
+      console.log(e);
+      window.alert(e);
+    });
+}
+function getAccessToken() {
+  window.alert(liff.getAccessToken());
+}
+function getContext() {
+  window.alert(JSON.stringify(liff.getContext()));
+}
+
+function sendMessage() {
+  liff
+    .sendMessages([{ type: "text", text: "中文測試 Hello from LIFF2.0" }])
+    .then(() => {
+      window.alert("Message has been sent");
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function login() {
+  liff.login();
+}
+
+function scanCode() {
+  liff
+    .scanCode()
+    .then(result => {
+      window.alert(JSON.stringify(result));
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function openWindow() {
+  liff.openWindow({
+    url: "https://line.me/1657386781-XARmDogn",
+    external: true
+  });
+}
+
+function closeWindow() {
+  liff.closeWindow();
+}
+
+function logout() {
+  if (liff.isLoggedIn()) {
+    liff.logout();
+    window.alert("Successfully to Logout");
+    location.reload();
+  }
+}
+
+
+// function createFlexMessageData() {
+//   var flex = {
+//     "type": "flex",
+//     "altText": redistitle,
+//     "contents": redisdata,
+//   };
+
+//   return flex;
+// }
+
+var _title = "MISA 向您分享了最新消息!";
+
+function createFlexMessageData() {
+  var myFlexContent = {
+    "type": "bubble",
+    "hero": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "text",
+              "text": "「高爾夫球」教我的決策思維!",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            },
+            {
+              "type": "text",
+              "text": "危機意識,步步為營",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            }
+          ],
+          "paddingAll": "15px"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "size": "full",
+              "margin": "none",
+              "url": "https://imgur.com/q9CAJyY.jpg",
+              "offsetTop": "-10px"
+            }
+          ],
+          "paddingStart": "5px",
+          "paddingEnd": "5px",
+          "height": "190px"
+        }
+      ]
+    },
+    "body": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "text",
+          "text": "曾國棟董事長從打球過程中",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "淬鍊出一套高爾夫的企業經營心法",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "separator",
+          "margin": "xl"
+        },
+        {
+          "type": "text",
+          "text": "前面打得很順",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "xl"
+        },
+        {
+          "type": "text",
+          "text": "後面卻沒有步步為營",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "反而導致慘敗",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "企業經營如同",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "xl"
+        },
+        {
+          "type": "text",
+          "text": "一帆風順時更要保持警醒",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        },
+        {
+          "type": "text",
+          "text": "建立避險機制",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        },
+        {
+          "type": "text",
+          "text": "做好風險管控",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        }
+      ],
+      "offsetTop": "-20px"
+    },
+    "footer": {
+      "type": "box",
+      "layout": "vertical",
+      "spacing": "sm",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "立即上課",
+                "uri": "https://www.misaglobal.org/program-packages/736f4c40-d411-4f1f-bc05-c4bcc417dc43"
+              },
+              "color": "#ffffff"
+            }
+          ],
+          "backgroundColor": "#f39a00",
+          "cornerRadius": "md"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "活動分享",
+                "uri": "https://liff.googo.org/misa-program-1/?openInAppBrowser=1&openExternalBrowser=1"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "3 分鐘精華",
+                "uri": "https://www.youtube.com/watch?v=OJmSi2vk_nI"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "url": "https://static.kolable.com/images/misa/logo.png/120?v=1641520480847"
+            }
+          ],
+          "margin": "none",
+          "position": "absolute",
+          "offsetStart": "108px",
+          "offsetTop": "135px"
+        }
+      ],
+      "flex": 0,
+      "height": "195px",
+      "offsetTop": "-10px"
+    }
+  };
+
+  var flex = {
+    "type": "flex",
+    "altText": _title,
+    "contents": myFlexContent,
+  };
+
+  return flex;
+}
+
+var redisdata = '';
+
+function shareTargetPicker() {
+
+  liff.shareTargetPicker([
+    createFlexMessageData()
+  ])
+    .then(function (res) {
+      if (res) {
+        // succeeded in sending a message through TargetPicker
+        console.log(`[${res.status}] Message sent!`)
+      } else {
+        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
+        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
+          // LINE 10.3.0 - 10.10.0
+          // Old LINE will access here regardless of user's action
+          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
+        } else {
+          // LINE 10.11.0 -
+          // sending message canceled
+          console.log('TargetPicker was closed!')
+        }
+      }
+    }).catch(function (error) {
+      // something went wrong before sending a message
+      console.log('something wrong happen', error)
+    })
+
+  // const url = 'https://liff.googo.org:9898/misa-liff'
+  // axios
+  //   .get(url)
+  //   .then(({data}) => {
+  //     redisdata=data.data;
+  //     redistitle=data.title;
+  //     console.log(redistitle);
+  //     console.log(redisdata);
+
+  //     liff.shareTargetPicker([
+  //       {
+  //         type: "text",
+  //         text: "Test!"
+  //       }
+  //     ])
+  //       .then(
+  //         console.log("ShareTargetPicker was launched")
+  //       ).catch(function (res) {
+  //         alert(res);
+  //         console.log("Failed to launch ShareTargetPicker", res)
+  //       })
+
+  //     // liff
+  //     // .shareTargetPicker([
+  //     //   createFlexMessageData()      
+  //     // ])
+  //     // .then(() => {
+  //     //   alert("Shared to the friend(s) you picked");
+  //     // })
+  //     // .catch(function(res) {
+  //     //   alert(res);
+  //     // });
+
+  //   });
+}

+ 84 - 0
misa-program-1/js/liff-init.js

@@ -0,0 +1,84 @@
+// ----- Configuration Zone! -----
+// Don't forget to change this to your LIFF ID
+
+const liffId = "1660714165-oE477Llr";
+
+// Don't forget to change this to your LIFF ID
+
+liff.init(
+  { liffId: liffId },
+  () => {
+    initLIFF();
+  },
+  err => {
+    window.alert(err);
+  }
+);
+function initLIFF() {
+  if (liff.isLoggedIn()) {
+    liff
+      .getProfile()
+      .then(profile => {
+        document.getElementById("profileImage").src = profile.pictureUrl;
+        // document.getElementById("userId").innerHTML = profile.userId;
+        // document.getElementById("displayName").innerHTML = profile.displayName;
+        // document.getElementById("statusMessage").innerHTML =
+        //   profile.statusMessage;
+        // document.getElementById("pictureUrl").href = profile.pictureUrl;
+        // document.getElementById("pictureUrl").innerHTML = profile.pictureUrl;
+        // document.getElementById(
+        //   "email"
+        // ).innerHTML = liff.getDecodedIDToken().email;
+      })
+      .catch(e => {
+        // document.getElementById("userId").innerHTML = "No data, " + e;
+        // document.getElementById("displayName").innerHTML = "No data, " + e;
+        // document.getElementById("statusMessage").innerHTML = "No data, " + e;
+        // document.getElementById("pictureUrl").innerHTML = "No data, " + e;
+        // document.getElementById("email").innerHTML = "No data, " + e;
+      });
+  } else {
+    // document.getElementById("userId").innerHTML = "No data, Login first";
+    // document.getElementById("displayName").innerHTML = "No data, Login first";
+    // document.getElementById("statusMessage").innerHTML = "No data, Login first";
+    // document.getElementById("pictureUrl").innerHTML = "No data, Login first";
+    // document.getElementById("email").innerHTML = "No data, Login first";
+  }
+
+  // document.getElementById("getOS").innerHTML = liff.getOS();
+  // document.getElementById("getLanguage").innerHTML = liff.getLanguage();
+  // document.getElementById("getVersion").innerHTML = liff.getVersion();
+  // document.getElementById("isInClient").innerHTML = liff.isInClient();
+  // document.getElementById("isLoggedIn").innerHTML = liff.isLoggedIn();
+  var context = liff.getContext();
+  if (context !== null) {
+    // document.getElementById("context_type").innerHTML = context.type;
+    // document.getElementById("context_viewType").innerHTML = context.viewType;
+    // document.getElementById("context_userId").innerHTML = context.userId;
+    if (context.utouId) {
+      // document.getElementById("context_utouId").innerHTML = context.utouId;
+    } else {
+      // document.getElementById("context_utouId").innerHTML =
+      // "You are not in the utou";
+    }
+    if (context.roomId) {
+      // document.getElementById("context_roomId").innerHTML = context.roomId;
+    } else {
+      // document.getElementById("context_roomId").innerHTML =
+      // "You are not in the room";
+    }
+    if (context.groupId) {
+      // document.getElementById("context_groupId").innerHTML = context.groupId;
+    } else {
+      // document.getElementById("context_groupId").innerHTML =
+      //   "You are not in the group ";
+    }
+  } else {
+    // document.getElementById("context_type").innerHTML = "No data.";
+    // document.getElementById("context_viewType").innerHTML = "No data.";
+    // document.getElementById("context_userId").innerHTML = "No data.";
+    // document.getElementById("context_utouId").innerHTML = "No data.";
+    // document.getElementById("context_roomId").innerHTML = "No data.";
+    // document.getElementById("context_groupId").innerHTML = "No data.";
+  }
+}

BIN
misa-program-2/.DS_Store


BIN
misa-program-2/icon/badge.png


BIN
misa-program-2/icon/example.png


BIN
misa-program-2/icon/icon.ico


BIN
misa-program-2/icon/liff.png


+ 61 - 0
misa-program-2/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <title>MISA 資訊分享</title>
+  <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="stylesheet" href="/css/style.css">
+</head>
+
+<body>
+  <div id="message">
+    <center>
+      <img style="margin: 0; width: 250px; image-rendering: -webkit-optimize-contrast;" src="https://s3cdn.yourator.co/banners/banners/000/001/645/home/06dc43274281d1bd66f4a49adbbae354ec3426b8.png"
+        alt="">
+      <h2>行動 EMBA 學程 品牌業務力系列 <br> LINE 傳單分享</h2>
+    </center>
+
+    <div class="step-container">
+      <div class="step-item">
+        <div>
+          <img src="/liff2/img/phone.png" alt="">
+        </div>
+        <div class="text">
+          <h3>如何 2 步驟分享給好友</h3>
+          <div>
+            <p>步驟 1</p>
+            <p>請點擊登入 LINE 帳號。<br>(第一次使用需授予許可)</p>
+          </div>
+          <img src="/liff2/img/arrow.png" alt="">
+          <div>
+            <p>步驟 2</p>
+            <p>請點擊「發傳單給最多十位好友」,<br>選擇發送對象後按下分享即可傳送。</p>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <center>
+      <img
+        src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
+        style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
+    </center>
+
+    <center>
+      <button onclick="login()">登入 LINE</button>
+      <button onclick="logout()">登出 LINE</button>
+      <button id="senddm" onclick="shareTargetPicker()">發傳單給最多十個好友</button>
+    </center>
+  </div>
+
+  <p id="load">ChoozMo</p>
+  <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
+  <script src="js/liff-init.js?1234"></script>
+  <script src="js/liff-functions.js?12345"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+</body>
+
+</html>

+ 369 - 0
misa-program-2/js/liff-functions.js

@@ -0,0 +1,369 @@
+function getProfile() {
+  liff
+    .getProfile()
+    .then(profile => {
+      console.log(JSON.stringify(profile));
+      window.alert(JSON.stringify(profile));
+    })
+    .catch(e => {
+      console.log(e);
+      window.alert(e);
+    });
+}
+function getAccessToken() {
+  window.alert(liff.getAccessToken());
+}
+function getContext() {
+  window.alert(JSON.stringify(liff.getContext()));
+}
+
+function sendMessage() {
+  liff
+    .sendMessages([{ type: "text", text: "中文測試 Hello from LIFF2.0" }])
+    .then(() => {
+      window.alert("Message has been sent");
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function login() {
+  liff.login();
+}
+
+function scanCode() {
+  liff
+    .scanCode()
+    .then(result => {
+      window.alert(JSON.stringify(result));
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function openWindow() {
+  liff.openWindow({
+    url: "https://line.me/1657386781-XARmDogn",
+    external: true
+  });
+}
+
+function closeWindow() {
+  liff.closeWindow();
+}
+
+function logout() {
+  if (liff.isLoggedIn()) {
+    liff.logout();
+    window.alert("Successfully to Logout");
+    location.reload();
+  }
+}
+
+
+// function createFlexMessageData() {
+//   var flex = {
+//     "type": "flex",
+//     "altText": redistitle,
+//     "contents": redisdata,
+//   };
+
+//   return flex;
+// }
+
+var _title = "MISA 向您分享了最新消息!";
+
+function createFlexMessageData() {
+  var myFlexContent = {
+    "type": "bubble",
+    "hero": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "text",
+              "text": "MISA 行動 EMBA 學程",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            }
+          ],
+          "paddingAll": "15px"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "size": "full",
+              "margin": "none",
+              "url": "https://imgur.com/syIAmOu.jpg",
+              "offsetTop": "-0px"
+            }
+          ],
+          "paddingStart": "5px",
+          "paddingEnd": "5px",
+          "height": "210px"
+        }
+      ]
+    },
+    "body": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "text",
+          "text": "王國雄 董事長與戴勝益",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "共同創立王品集團",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "separator",
+          "margin": "xl"
+        },
+        {
+          "type": "text",
+          "text": "7年前,他揮別待了超過 20 年的老東家",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "wrap": true,
+          "margin": "xl"
+        },
+        {
+          "type": "text",
+          "text": "宣布創立成真咖啡",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "在一次遠赴非洲的尋豆之旅",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "發現當地潔淨水資源匱乏",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "決定每年捐出企業獲利的 50%",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        },
+        {
+          "type": "text",
+          "text": "在當地鑿井做公益",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        },
+        {
+          "type": "text",
+          "text": "至今已鑿出 14 口井",
+          "weight": "bold",
+          "size": "15px",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        }
+      ],
+      "offsetTop": "-10px"
+    },
+    "footer": {
+      "type": "box",
+      "layout": "vertical",
+      "spacing": "sm",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "立即上課",
+                "uri": "https://www.misaglobal.org/program-packages/c5cf20ab-6c6f-4178-af2c-8824b79f1a5b"
+              },
+              "color": "#ffffff"
+            }
+          ],
+          "backgroundColor": "#f39a00",
+          "cornerRadius": "md"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "活動分享",
+                "uri": "https://liff.googo.org/misa-program-2/?openInAppBrowser=1&openExternalBrowser=1"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "3 分鐘精華",
+                "uri": "https://www.youtube.com/watch?v=-4APlHVCszQ"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "url": "https://static.kolable.com/images/misa/logo.png/120?v=1641520480847"
+            }
+          ],
+          "margin": "none",
+          "position": "absolute",
+          "offsetStart": "108px",
+          "offsetTop": "135px"
+        }
+      ],
+      "flex": 0,
+      "height": "195px",
+      "offsetTop": "-10px"
+    }
+  };
+
+  var flex = {
+    "type": "flex",
+    "altText": _title,
+    "contents": myFlexContent,
+  };
+
+  return flex;
+}
+
+var redisdata = '';
+
+function shareTargetPicker() {
+
+  liff.shareTargetPicker([
+    createFlexMessageData()
+  ])
+    .then(function (res) {
+      if (res) {
+        // succeeded in sending a message through TargetPicker
+        console.log(`[${res.status}] Message sent!`)
+      } else {
+        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
+        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
+          // LINE 10.3.0 - 10.10.0
+          // Old LINE will access here regardless of user's action
+          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
+        } else {
+          // LINE 10.11.0 -
+          // sending message canceled
+          console.log('TargetPicker was closed!')
+        }
+      }
+    }).catch(function (error) {
+      // something went wrong before sending a message
+      console.log('something wrong happen', error)
+    })
+
+  // const url = 'https://liff.googo.org:9898/misa-liff'
+  // axios
+  //   .get(url)
+  //   .then(({data}) => {
+  //     redisdata=data.data;
+  //     redistitle=data.title;
+  //     console.log(redistitle);
+  //     console.log(redisdata);
+
+  //     liff.shareTargetPicker([
+  //       {
+  //         type: "text",
+  //         text: "Test!"
+  //       }
+  //     ])
+  //       .then(
+  //         console.log("ShareTargetPicker was launched")
+  //       ).catch(function (res) {
+  //         alert(res);
+  //         console.log("Failed to launch ShareTargetPicker", res)
+  //       })
+
+  //     // liff
+  //     // .shareTargetPicker([
+  //     //   createFlexMessageData()      
+  //     // ])
+  //     // .then(() => {
+  //     //   alert("Shared to the friend(s) you picked");
+  //     // })
+  //     // .catch(function(res) {
+  //     //   alert(res);
+  //     // });
+
+  //   });
+}

+ 84 - 0
misa-program-2/js/liff-init.js

@@ -0,0 +1,84 @@
+// ----- Configuration Zone! -----
+// Don't forget to change this to your LIFF ID
+
+const liffId = "1660714180-mrqll5pO";
+
+// Don't forget to change this to your LIFF ID
+
+liff.init(
+  { liffId: liffId },
+  () => {
+    initLIFF();
+  },
+  err => {
+    window.alert(err);
+  }
+);
+function initLIFF() {
+  if (liff.isLoggedIn()) {
+    liff
+      .getProfile()
+      .then(profile => {
+        document.getElementById("profileImage").src = profile.pictureUrl;
+        // document.getElementById("userId").innerHTML = profile.userId;
+        // document.getElementById("displayName").innerHTML = profile.displayName;
+        // document.getElementById("statusMessage").innerHTML =
+        //   profile.statusMessage;
+        // document.getElementById("pictureUrl").href = profile.pictureUrl;
+        // document.getElementById("pictureUrl").innerHTML = profile.pictureUrl;
+        // document.getElementById(
+        //   "email"
+        // ).innerHTML = liff.getDecodedIDToken().email;
+      })
+      .catch(e => {
+        // document.getElementById("userId").innerHTML = "No data, " + e;
+        // document.getElementById("displayName").innerHTML = "No data, " + e;
+        // document.getElementById("statusMessage").innerHTML = "No data, " + e;
+        // document.getElementById("pictureUrl").innerHTML = "No data, " + e;
+        // document.getElementById("email").innerHTML = "No data, " + e;
+      });
+  } else {
+    // document.getElementById("userId").innerHTML = "No data, Login first";
+    // document.getElementById("displayName").innerHTML = "No data, Login first";
+    // document.getElementById("statusMessage").innerHTML = "No data, Login first";
+    // document.getElementById("pictureUrl").innerHTML = "No data, Login first";
+    // document.getElementById("email").innerHTML = "No data, Login first";
+  }
+
+  // document.getElementById("getOS").innerHTML = liff.getOS();
+  // document.getElementById("getLanguage").innerHTML = liff.getLanguage();
+  // document.getElementById("getVersion").innerHTML = liff.getVersion();
+  // document.getElementById("isInClient").innerHTML = liff.isInClient();
+  // document.getElementById("isLoggedIn").innerHTML = liff.isLoggedIn();
+  var context = liff.getContext();
+  if (context !== null) {
+    // document.getElementById("context_type").innerHTML = context.type;
+    // document.getElementById("context_viewType").innerHTML = context.viewType;
+    // document.getElementById("context_userId").innerHTML = context.userId;
+    if (context.utouId) {
+      // document.getElementById("context_utouId").innerHTML = context.utouId;
+    } else {
+      // document.getElementById("context_utouId").innerHTML =
+      // "You are not in the utou";
+    }
+    if (context.roomId) {
+      // document.getElementById("context_roomId").innerHTML = context.roomId;
+    } else {
+      // document.getElementById("context_roomId").innerHTML =
+      // "You are not in the room";
+    }
+    if (context.groupId) {
+      // document.getElementById("context_groupId").innerHTML = context.groupId;
+    } else {
+      // document.getElementById("context_groupId").innerHTML =
+      //   "You are not in the group ";
+    }
+  } else {
+    // document.getElementById("context_type").innerHTML = "No data.";
+    // document.getElementById("context_viewType").innerHTML = "No data.";
+    // document.getElementById("context_userId").innerHTML = "No data.";
+    // document.getElementById("context_utouId").innerHTML = "No data.";
+    // document.getElementById("context_roomId").innerHTML = "No data.";
+    // document.getElementById("context_groupId").innerHTML = "No data.";
+  }
+}

BIN
misa-program-3/.DS_Store


BIN
misa-program-3/icon/badge.png


BIN
misa-program-3/icon/example.png


BIN
misa-program-3/icon/icon.ico


BIN
misa-program-3/icon/liff.png


+ 61 - 0
misa-program-3/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <title>MISA 資訊分享</title>
+  <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="stylesheet" href="/css/style.css">
+</head>
+
+<body>
+  <div id="message">
+    <center>
+      <img style="margin: 0; width: 250px; image-rendering: -webkit-optimize-contrast;" src="https://s3cdn.yourator.co/banners/banners/000/001/645/home/06dc43274281d1bd66f4a49adbbae354ec3426b8.png"
+        alt="">
+      <h2>成功企業家的用人管理術 <br> LINE 傳單分享</h2>
+    </center>
+
+    <div class="step-container">
+      <div class="step-item">
+        <div>
+          <img src="/liff2/img/phone.png" alt="">
+        </div>
+        <div class="text">
+          <h3>如何 2 步驟分享給好友</h3>
+          <div>
+            <p>步驟 1</p>
+            <p>請點擊登入 LINE 帳號。<br>(第一次使用需授予許可)</p>
+          </div>
+          <img src="/liff2/img/arrow.png" alt="">
+          <div>
+            <p>步驟 2</p>
+            <p>請點擊「發傳單給最多十位好友」,<br>選擇發送對象後按下分享即可傳送。</p>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <center>
+      <img
+        src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
+        style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
+    </center>
+
+    <center>
+      <button onclick="login()">登入 LINE</button>
+      <button onclick="logout()">登出 LINE</button>
+      <button id="senddm" onclick="shareTargetPicker()">發傳單給最多十個好友</button>
+    </center>
+  </div>
+
+  <p id="load">ChoozMo</p>
+  <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
+  <script src="js/liff-init.js?1234"></script>
+  <script src="js/liff-functions.js?12345"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+</body>
+
+</html>

+ 369 - 0
misa-program-3/js/liff-functions.js

@@ -0,0 +1,369 @@
+function getProfile() {
+  liff
+    .getProfile()
+    .then(profile => {
+      console.log(JSON.stringify(profile));
+      window.alert(JSON.stringify(profile));
+    })
+    .catch(e => {
+      console.log(e);
+      window.alert(e);
+    });
+}
+function getAccessToken() {
+  window.alert(liff.getAccessToken());
+}
+function getContext() {
+  window.alert(JSON.stringify(liff.getContext()));
+}
+
+function sendMessage() {
+  liff
+    .sendMessages([{ type: "text", text: "中文測試 Hello from LIFF2.0" }])
+    .then(() => {
+      window.alert("Message has been sent");
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function login() {
+  liff.login();
+}
+
+function scanCode() {
+  liff
+    .scanCode()
+    .then(result => {
+      window.alert(JSON.stringify(result));
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function openWindow() {
+  liff.openWindow({
+    url: "https://line.me/1657386781-XARmDogn",
+    external: true
+  });
+}
+
+function closeWindow() {
+  liff.closeWindow();
+}
+
+function logout() {
+  if (liff.isLoggedIn()) {
+    liff.logout();
+    window.alert("Successfully to Logout");
+    location.reload();
+  }
+}
+
+
+// function createFlexMessageData() {
+//   var flex = {
+//     "type": "flex",
+//     "altText": redistitle,
+//     "contents": redisdata,
+//   };
+
+//   return flex;
+// }
+
+var _title = "MISA 向您分享了最新消息!";
+
+function createFlexMessageData() {
+  var myFlexContent = {
+    "type": "bubble",
+    "hero": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "text",
+              "text": "缺工浪潮來襲",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            },
+            {
+              "type": "text",
+              "text": "全球掀起人才保衛戰",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            }
+          ],
+          "paddingAll": "15px"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "size": "full",
+              "margin": "none",
+              "url": "https://imgur.com/5Dqezpb.jpg",
+              "offsetTop": "-0px"
+            }
+          ],
+          "paddingStart": "5px",
+          "paddingEnd": "5px",
+          "height": "210px"
+        }
+      ]
+    },
+    "body": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "text",
+          "text": "「留才」",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "是企業經營非常重要的培育藍圖",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "separator",
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "重視員工、儲備人才",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "並且願意將資源分享給每位員工",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "平時藉由考核機會與員工作心談",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "了解員工的想法",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "幫助員工解決工作上遇到的難題",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "考核不能流於形式,只注重分數。",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "margin": "sm",
+          "wrap": true
+        }
+      ],
+      "offsetTop": "-10px"
+    },
+    "footer": {
+      "type": "box",
+      "layout": "vertical",
+      "spacing": "sm",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "立即上課",
+                "uri": "https://www.misaglobal.org/program-packages/52fe849d-84c2-4b99-97f7-c24878a4d3af"
+              },
+              "color": "#ffffff"
+            }
+          ],
+          "backgroundColor": "#f39a00",
+          "cornerRadius": "md"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "活動分享",
+                "uri": "https://liff.googo.org/misa-program-3/?openInAppBrowser=1&openExternalBrowser=1"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "3 分鐘精華",
+                "uri": "https://www.youtube.com/watch?v=O27PYwI1ri0&t=15s"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "url": "https://static.kolable.com/images/misa/logo.png/120?v=1641520480847"
+            }
+          ],
+          "margin": "none",
+          "position": "absolute",
+          "offsetStart": "108px",
+          "offsetTop": "135px"
+        }
+      ],
+      "flex": 0,
+      "height": "195px",
+      "offsetTop": "-10px"
+    }
+  };
+
+  var flex = {
+    "type": "flex",
+    "altText": _title,
+    "contents": myFlexContent,
+  };
+
+  return flex;
+}
+
+var redisdata = '';
+
+function shareTargetPicker() {
+
+  liff.shareTargetPicker([
+    createFlexMessageData()
+  ])
+    .then(function (res) {
+      if (res) {
+        // succeeded in sending a message through TargetPicker
+        console.log(`[${res.status}] Message sent!`)
+      } else {
+        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
+        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
+          // LINE 10.3.0 - 10.10.0
+          // Old LINE will access here regardless of user's action
+          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
+        } else {
+          // LINE 10.11.0 -
+          // sending message canceled
+          console.log('TargetPicker was closed!')
+        }
+      }
+    }).catch(function (error) {
+      // something went wrong before sending a message
+      console.log('something wrong happen', error)
+    })
+
+  // const url = 'https://liff.googo.org:9898/misa-liff'
+  // axios
+  //   .get(url)
+  //   .then(({data}) => {
+  //     redisdata=data.data;
+  //     redistitle=data.title;
+  //     console.log(redistitle);
+  //     console.log(redisdata);
+
+  //     liff.shareTargetPicker([
+  //       {
+  //         type: "text",
+  //         text: "Test!"
+  //       }
+  //     ])
+  //       .then(
+  //         console.log("ShareTargetPicker was launched")
+  //       ).catch(function (res) {
+  //         alert(res);
+  //         console.log("Failed to launch ShareTargetPicker", res)
+  //       })
+
+  //     // liff
+  //     // .shareTargetPicker([
+  //     //   createFlexMessageData()      
+  //     // ])
+  //     // .then(() => {
+  //     //   alert("Shared to the friend(s) you picked");
+  //     // })
+  //     // .catch(function(res) {
+  //     //   alert(res);
+  //     // });
+
+  //   });
+}

+ 84 - 0
misa-program-3/js/liff-init.js

@@ -0,0 +1,84 @@
+// ----- Configuration Zone! -----
+// Don't forget to change this to your LIFF ID
+
+const liffId = "1660714182-7Q08831D";
+
+// Don't forget to change this to your LIFF ID
+
+liff.init(
+  { liffId: liffId },
+  () => {
+    initLIFF();
+  },
+  err => {
+    window.alert(err);
+  }
+);
+function initLIFF() {
+  if (liff.isLoggedIn()) {
+    liff
+      .getProfile()
+      .then(profile => {
+        document.getElementById("profileImage").src = profile.pictureUrl;
+        // document.getElementById("userId").innerHTML = profile.userId;
+        // document.getElementById("displayName").innerHTML = profile.displayName;
+        // document.getElementById("statusMessage").innerHTML =
+        //   profile.statusMessage;
+        // document.getElementById("pictureUrl").href = profile.pictureUrl;
+        // document.getElementById("pictureUrl").innerHTML = profile.pictureUrl;
+        // document.getElementById(
+        //   "email"
+        // ).innerHTML = liff.getDecodedIDToken().email;
+      })
+      .catch(e => {
+        // document.getElementById("userId").innerHTML = "No data, " + e;
+        // document.getElementById("displayName").innerHTML = "No data, " + e;
+        // document.getElementById("statusMessage").innerHTML = "No data, " + e;
+        // document.getElementById("pictureUrl").innerHTML = "No data, " + e;
+        // document.getElementById("email").innerHTML = "No data, " + e;
+      });
+  } else {
+    // document.getElementById("userId").innerHTML = "No data, Login first";
+    // document.getElementById("displayName").innerHTML = "No data, Login first";
+    // document.getElementById("statusMessage").innerHTML = "No data, Login first";
+    // document.getElementById("pictureUrl").innerHTML = "No data, Login first";
+    // document.getElementById("email").innerHTML = "No data, Login first";
+  }
+
+  // document.getElementById("getOS").innerHTML = liff.getOS();
+  // document.getElementById("getLanguage").innerHTML = liff.getLanguage();
+  // document.getElementById("getVersion").innerHTML = liff.getVersion();
+  // document.getElementById("isInClient").innerHTML = liff.isInClient();
+  // document.getElementById("isLoggedIn").innerHTML = liff.isLoggedIn();
+  var context = liff.getContext();
+  if (context !== null) {
+    // document.getElementById("context_type").innerHTML = context.type;
+    // document.getElementById("context_viewType").innerHTML = context.viewType;
+    // document.getElementById("context_userId").innerHTML = context.userId;
+    if (context.utouId) {
+      // document.getElementById("context_utouId").innerHTML = context.utouId;
+    } else {
+      // document.getElementById("context_utouId").innerHTML =
+      // "You are not in the utou";
+    }
+    if (context.roomId) {
+      // document.getElementById("context_roomId").innerHTML = context.roomId;
+    } else {
+      // document.getElementById("context_roomId").innerHTML =
+      // "You are not in the room";
+    }
+    if (context.groupId) {
+      // document.getElementById("context_groupId").innerHTML = context.groupId;
+    } else {
+      // document.getElementById("context_groupId").innerHTML =
+      //   "You are not in the group ";
+    }
+  } else {
+    // document.getElementById("context_type").innerHTML = "No data.";
+    // document.getElementById("context_viewType").innerHTML = "No data.";
+    // document.getElementById("context_userId").innerHTML = "No data.";
+    // document.getElementById("context_utouId").innerHTML = "No data.";
+    // document.getElementById("context_roomId").innerHTML = "No data.";
+    // document.getElementById("context_groupId").innerHTML = "No data.";
+  }
+}

BIN
misa-program-4/.DS_Store


BIN
misa-program-4/icon/badge.png


BIN
misa-program-4/icon/example.png


BIN
misa-program-4/icon/icon.ico


BIN
misa-program-4/icon/liff.png


+ 61 - 0
misa-program-4/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <title>MISA 資訊分享</title>
+  <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="stylesheet" href="/css/style.css">
+</head>
+
+<body>
+  <div id="message">
+    <center>
+      <img style="margin: 0; width: 250px; image-rendering: -webkit-optimize-contrast;" src="https://s3cdn.yourator.co/banners/banners/000/001/645/home/06dc43274281d1bd66f4a49adbbae354ec3426b8.png"
+        alt="">
+        <h2>行動 EMBA 學程 領導力系列 <br> LINE 傳單分享</h2>
+    </center>
+
+    <div class="step-container">
+      <div class="step-item">
+        <div>
+          <img src="/liff2/img/phone.png" alt="">
+        </div>
+        <div class="text">
+          <h3>如何 2 步驟分享給好友</h3>
+          <div>
+            <p>步驟 1</p>
+            <p>請點擊登入 LINE 帳號。<br>(第一次使用需授予許可)</p>
+          </div>
+          <img src="/liff2/img/arrow.png" alt="">
+          <div>
+            <p>步驟 2</p>
+            <p>請點擊「發傳單給最多十位好友」,<br>選擇發送對象後按下分享即可傳送。</p>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <center>
+      <img
+        src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
+        style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
+    </center>
+
+    <center>
+      <button onclick="login()">登入 LINE</button>
+      <button onclick="logout()">登出 LINE</button>
+      <button id="senddm" onclick="shareTargetPicker()">發傳單給最多十個好友</button>
+    </center>
+  </div>
+
+  <p id="load">ChoozMo</p>
+  <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
+  <script src="js/liff-init.js?1234"></script>
+  <script src="js/liff-functions.js?12345"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+</body>
+
+</html>

+ 360 - 0
misa-program-4/js/liff-functions.js

@@ -0,0 +1,360 @@
+function getProfile() {
+  liff
+    .getProfile()
+    .then(profile => {
+      console.log(JSON.stringify(profile));
+      window.alert(JSON.stringify(profile));
+    })
+    .catch(e => {
+      console.log(e);
+      window.alert(e);
+    });
+}
+function getAccessToken() {
+  window.alert(liff.getAccessToken());
+}
+function getContext() {
+  window.alert(JSON.stringify(liff.getContext()));
+}
+
+function sendMessage() {
+  liff
+    .sendMessages([{ type: "text", text: "中文測試 Hello from LIFF2.0" }])
+    .then(() => {
+      window.alert("Message has been sent");
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function login() {
+  liff.login();
+}
+
+function scanCode() {
+  liff
+    .scanCode()
+    .then(result => {
+      window.alert(JSON.stringify(result));
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function openWindow() {
+  liff.openWindow({
+    url: "https://line.me/1657386781-XARmDogn",
+    external: true
+  });
+}
+
+function closeWindow() {
+  liff.closeWindow();
+}
+
+function logout() {
+  if (liff.isLoggedIn()) {
+    liff.logout();
+    window.alert("Successfully to Logout");
+    location.reload();
+  }
+}
+
+
+// function createFlexMessageData() {
+//   var flex = {
+//     "type": "flex",
+//     "altText": redistitle,
+//     "contents": redisdata,
+//   };
+
+//   return flex;
+// }
+
+var _title = "MISA 向您分享了最新消息!";
+
+function createFlexMessageData() {
+  var myFlexContent = {
+    "type": "bubble",
+    "hero": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "text",
+              "text": "佳世達 陳其宏",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            },
+            {
+              "type": "text",
+              "text": "領導者要掌握巨觀的角度",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            }
+          ],
+          "paddingAll": "15px"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "size": "full",
+              "margin": "none",
+              "url": "https://imgur.com/pbLVOh1.jpg",
+              "offsetTop": "-0px"
+            }
+          ],
+          "paddingStart": "5px",
+          "paddingEnd": "5px",
+          "height": "210px"
+        }
+      ]
+    },
+    "body": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "text",
+          "text": "佳世達科技在陳其宏董事長的領導下",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "集團以聯盟式投資成長策略、",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "「互惠雙贏」的價值觀",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "separator",
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "投資布局超過 70 家",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "海內外企業籌組「聯合艦隊」",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "他將分享,有了願景之後",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "如何展開贏的策略",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        }
+      ],
+      "offsetTop": "-10px"
+    },
+    "footer": {
+      "type": "box",
+      "layout": "vertical",
+      "spacing": "sm",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "立即上課",
+                "uri": "https://www.misaglobal.org/program-packages/2d002dd6-c44f-4309-84d5-23890b3e02e8"
+              },
+              "color": "#ffffff"
+            }
+          ],
+          "backgroundColor": "#f39a00",
+          "cornerRadius": "md"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "活動分享",
+                "uri": "https://liff.googo.org/misa-program-4/?openInAppBrowser=1&openExternalBrowser=1"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "3 分鐘精華",
+                "uri": "https://www.youtube.com/watch?v=aIogpHhSGVg&t=47s"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "url": "https://static.kolable.com/images/misa/logo.png/120?v=1641520480847"
+            }
+          ],
+          "margin": "none",
+          "position": "absolute",
+          "offsetStart": "108px",
+          "offsetTop": "135px"
+        }
+      ],
+      "flex": 0,
+      "height": "195px",
+      "offsetTop": "-10px"
+    }
+  };
+
+  var flex = {
+    "type": "flex",
+    "altText": _title,
+    "contents": myFlexContent,
+  };
+
+  return flex;
+}
+
+var redisdata = '';
+
+function shareTargetPicker() {
+
+  liff.shareTargetPicker([
+    createFlexMessageData()
+  ])
+    .then(function (res) {
+      if (res) {
+        // succeeded in sending a message through TargetPicker
+        console.log(`[${res.status}] Message sent!`)
+      } else {
+        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
+        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
+          // LINE 10.3.0 - 10.10.0
+          // Old LINE will access here regardless of user's action
+          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
+        } else {
+          // LINE 10.11.0 -
+          // sending message canceled
+          console.log('TargetPicker was closed!')
+        }
+      }
+    }).catch(function (error) {
+      // something went wrong before sending a message
+      console.log('something wrong happen', error)
+    })
+
+  // const url = 'https://liff.googo.org:9898/misa-liff'
+  // axios
+  //   .get(url)
+  //   .then(({data}) => {
+  //     redisdata=data.data;
+  //     redistitle=data.title;
+  //     console.log(redistitle);
+  //     console.log(redisdata);
+
+  //     liff.shareTargetPicker([
+  //       {
+  //         type: "text",
+  //         text: "Test!"
+  //       }
+  //     ])
+  //       .then(
+  //         console.log("ShareTargetPicker was launched")
+  //       ).catch(function (res) {
+  //         alert(res);
+  //         console.log("Failed to launch ShareTargetPicker", res)
+  //       })
+
+  //     // liff
+  //     // .shareTargetPicker([
+  //     //   createFlexMessageData()      
+  //     // ])
+  //     // .then(() => {
+  //     //   alert("Shared to the friend(s) you picked");
+  //     // })
+  //     // .catch(function(res) {
+  //     //   alert(res);
+  //     // });
+
+  //   });
+}

+ 85 - 0
misa-program-4/js/liff-init.js

@@ -0,0 +1,85 @@
+// ----- Configuration Zone! -----
+// Don't forget to change this to your LIFF ID
+
+const liffId = "1660714186-5oOaaqAO";
+
+// Don't forget to change this to your LIFF ID
+
+liff.init(
+  { liffId: liffId },
+  () => {
+    initLIFF();
+  },
+  err => {
+    window.alert(err);
+  }
+);
+function initLIFF() {
+  if (liff.isLoggedIn()) {
+    liff
+      .getProfile()
+      .then(profile => {
+        document.getElementById("profileImage").src = profile.pictureUrl;
+        // document.getElementById("userId").innerHTML = profile.userId;
+        // document.getElementById("displayName").innerHTML = profile.displayName;
+        // document.getElementById("statusMessage").innerHTML =
+        //   profile.statusMessage;
+        // document.getElementById("pictureUrl").href = profile.pictureUrl;
+        // document.getElementById("pictureUrl").innerHTML = profile.pictureUrl;
+        // document.getElementById(
+        //   "email"
+        // ).innerHTML = liff.getDecodedIDToken().email;
+      })
+      .catch(e => {
+        // document.getElementById("userId").innerHTML = "No data, " + e;
+        // document.getElementById("displayName").innerHTML = "No data, " + e;
+        // document.getElementById("statusMessage").innerHTML = "No data, " + e;
+        // document.getElementById("pictureUrl").innerHTML = "No data, " + e;
+        // document.getElementById("email").innerHTML = "No data, " + e;
+      });
+  } else {
+    // document.getElementById("userId").innerHTML = "No data, Login first";
+    // document.getElementById("displayName").innerHTML = "No data, Login first";
+    // document.getElementById("statusMessage").innerHTML = "No data, Login first";
+    // document.getElementById("pictureUrl").innerHTML = "No data, Login first";
+    // document.getElementById("email").innerHTML = "No data, Login first";
+  }
+
+  // document.getElementById("getOS").innerHTML = liff.getOS();
+  // document.getElementById("getLanguage").innerHTML = liff.getLanguage();
+  // document.getElementById("getVersion").innerHTML = liff.getVersion();
+  // document.getElementById("isInClient").innerHTML = liff.isInClient();
+  // document.getElementById("isLoggedIn").innerHTML = liff.isLoggedIn();
+  var context = liff.getContext();
+  if (context !== null) {
+    // document.getElementById("context_type").innerHTML = context.type;
+    // document.getElementById("context_viewType").innerHTML = context.viewType;
+    // document.getElementById("context_userId").innerHTML = context.userId;
+    if (context.utouId) {
+      // document.getElementById("context_utouId").innerHTML = context.utouId;
+    } else {
+      // document.getElementById("context_utouId").innerHTML =
+      // "You are not in the utou";
+    }
+    if (context.roomId) {
+      // document.getElementById("context_roomId").innerHTML = context.roomId;
+    } else {
+      // document.getElementById("context_roomId").innerHTML =
+      // "You are not in the room";
+    }
+    if (context.groupId) {
+      // document.getElementById("context_groupId").innerHTML = context.groupId;
+    } else {
+      // document.getElementById("context_groupId").innerHTML =
+      //   "You are not in the group ";
+    }
+  } else {
+    // document.getElementById("context_type").innerHTML = "No data.";
+    // document.getElementById("context_viewType").innerHTML = "No data.";
+    // document.getElementById("context_userId").innerHTML = "No data.";
+    // document.getElementById("context_utouId").innerHTML = "No data.";
+    // document.getElementById("context_roomId").innerHTML = "No data.";
+    // document.getElementById("context_groupId").innerHTML = "No data.";
+  }
+}
+

BIN
misa-program-5/.DS_Store


BIN
misa-program-5/icon/badge.png


BIN
misa-program-5/icon/example.png


BIN
misa-program-5/icon/icon.ico


BIN
misa-program-5/icon/liff.png


+ 61 - 0
misa-program-5/index.html

@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1" />
+  <title>MISA 資訊分享</title>
+  <link rel="shortcut icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="icon" href="icon/icon.ico" type="image/x-icon" />
+  <link rel="stylesheet" href="/css/style.css">
+</head>
+
+<body>
+  <div id="message">
+    <center>
+      <img style="margin: 0; width: 250px; image-rendering: -webkit-optimize-contrast;" src="https://s3cdn.yourator.co/banners/banners/000/001/645/home/06dc43274281d1bd66f4a49adbbae354ec3426b8.png"
+        alt="">
+        <h2>主管必修的 10 堂課 <br> LINE 傳單分享</h2>
+    </center>
+
+    <div class="step-container">
+      <div class="step-item">
+        <div>
+          <img src="/liff2/img/phone.png" alt="">
+        </div>
+        <div class="text">
+          <h3>如何 2 步驟分享給好友</h3>
+          <div>
+            <p>步驟 1</p>
+            <p>請點擊登入 LINE 帳號。<br>(第一次使用需授予許可)</p>
+          </div>
+          <img src="/liff2/img/arrow.png" alt="">
+          <div>
+            <p>步驟 2</p>
+            <p>請點擊「發傳單給最多十位好友」,<br>選擇發送對象後按下分享即可傳送。</p>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <center>
+      <img
+        src="https://firebasestorage.googleapis.com/v0/b/uce-bot.appspot.com/o/user.jpg?alt=media&token=554b90c5-562c-469a-bfee-f36b5e3f54c9"
+        style="border-radius: 10px;" width="150px" height="150px" id="profileImage" />
+    </center>
+
+    <center>
+      <button onclick="login()">登入 LINE</button>
+      <button onclick="logout()">登出 LINE</button>
+      <button id="senddm" onclick="shareTargetPicker()">發傳單給最多十個好友</button>
+    </center>
+  </div>
+
+  <p id="load">ChoozMo</p>
+  <script src="https://static.line-scdn.net/liff/edge/2.1/sdk.js"></script>
+  <script src="js/liff-init.js?1234"></script>
+  <script src="js/liff-functions.js?12345"></script>
+  <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
+</body>
+
+</html>

+ 351 - 0
misa-program-5/js/liff-functions.js

@@ -0,0 +1,351 @@
+function getProfile() {
+  liff
+    .getProfile()
+    .then(profile => {
+      console.log(JSON.stringify(profile));
+      window.alert(JSON.stringify(profile));
+    })
+    .catch(e => {
+      console.log(e);
+      window.alert(e);
+    });
+}
+function getAccessToken() {
+  window.alert(liff.getAccessToken());
+}
+function getContext() {
+  window.alert(JSON.stringify(liff.getContext()));
+}
+
+function sendMessage() {
+  liff
+    .sendMessages([{ type: "text", text: "中文測試 Hello from LIFF2.0" }])
+    .then(() => {
+      window.alert("Message has been sent");
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function login() {
+  liff.login();
+}
+
+function scanCode() {
+  liff
+    .scanCode()
+    .then(result => {
+      window.alert(JSON.stringify(result));
+    })
+    .catch(e => {
+      window.alert(e);
+    });
+}
+
+function openWindow() {
+  liff.openWindow({
+    url: "https://line.me/1657386781-XARmDogn",
+    external: true
+  });
+}
+
+function closeWindow() {
+  liff.closeWindow();
+}
+
+function logout() {
+  if (liff.isLoggedIn()) {
+    liff.logout();
+    window.alert("Successfully to Logout");
+    location.reload();
+  }
+}
+
+
+// function createFlexMessageData() {
+//   var flex = {
+//     "type": "flex",
+//     "altText": redistitle,
+//     "contents": redisdata,
+//   };
+
+//   return flex;
+// }
+
+var _title = "MISA 向您分享了最新消息!";
+
+function createFlexMessageData() {
+  var myFlexContent = {
+    "type": "bubble",
+    "hero": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "text",
+              "text": "有貪婪老闆,必有貪污員工",
+              "color": "#f39a00",
+              "align": "center",
+              "offsetTop": "3px",
+              "size": "lg",
+              "weight": "bold"
+            }
+          ],
+          "paddingAll": "15px"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "size": "full",
+              "margin": "none",
+              "url": "https://imgur.com/r8w9gsF.jpg",
+              "offsetTop": "-10px"
+            }
+          ],
+          "paddingStart": "5px",
+          "paddingEnd": "5px",
+          "height": "190px"
+        }
+      ]
+    },
+    "body": {
+      "type": "box",
+      "layout": "vertical",
+      "contents": [
+        {
+          "type": "text",
+          "text": "老闆的道德標準",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "是員工道德標準的上限",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "絕對是公司每個人的「榜樣」",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "text",
+          "text": "而身為老闆者最好的態度是:",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "xxl"
+        },
+        {
+          "type": "text",
+          "text": "利益迴避,公私分明",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        },
+        {
+          "type": "separator",
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "何飛鵬社長 用真實案例",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "lg"
+        },
+        {
+          "type": "text",
+          "text": "帶領你進入主管必修的私房學",
+          "weight": "bold",
+          "size": "md",
+          "align": "center",
+          "wrap": true,
+          "margin": "sm"
+        }
+      ],
+      "offsetTop": "-20px"
+    },
+    "footer": {
+      "type": "box",
+      "layout": "vertical",
+      "spacing": "sm",
+      "contents": [
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "立即上課",
+                "uri": "https://www.misaglobal.org/program-packages/37397536-2d1e-44eb-b59a-fb0baa4646bf"
+              },
+              "color": "#ffffff"
+            }
+          ],
+          "backgroundColor": "#f39a00",
+          "cornerRadius": "md"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "活動分享",
+                "uri": "https://liff.googo.org/misa-program-5/?openInAppBrowser=1&openExternalBrowser=1"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "button",
+              "style": "link",
+              "height": "sm",
+              "action": {
+                "type": "uri",
+                "label": "3 分鐘精華",
+                "uri": "https://www.youtube.com/watch?v=hLGQN0qWDm0&t=7s"
+              },
+              "color": "#f39a00"
+            }
+          ],
+          "cornerRadius": "md",
+          "margin": "lg",
+          "borderColor": "#f39a00",
+          "borderWidth": "normal"
+        },
+        {
+          "type": "box",
+          "layout": "vertical",
+          "contents": [
+            {
+              "type": "image",
+              "url": "https://static.kolable.com/images/misa/logo.png/120?v=1641520480847"
+            }
+          ],
+          "margin": "none",
+          "position": "absolute",
+          "offsetStart": "108px",
+          "offsetTop": "135px"
+        }
+      ],
+      "flex": 0,
+      "height": "195px",
+      "offsetTop": "-10px"
+    }
+  };
+
+  var flex = {
+    "type": "flex",
+    "altText": _title,
+    "contents": myFlexContent,
+  };
+
+  return flex;
+}
+
+var redisdata = '';
+
+function shareTargetPicker() {
+
+  liff.shareTargetPicker([
+    createFlexMessageData()
+  ])
+    .then(function (res) {
+      if (res) {
+        // succeeded in sending a message through TargetPicker
+        console.log(`[${res.status}] Message sent!`)
+      } else {
+        const [majorVer, minorVer] = (liff.getLineVersion() || "").split('.');
+        if (parseInt(majorVer) == 10 && parseInt(minorVer) < 11) {
+          // LINE 10.3.0 - 10.10.0
+          // Old LINE will access here regardless of user's action
+          console.log('TargetPicker was opened at least. Whether succeeded to send message is unclear')
+        } else {
+          // LINE 10.11.0 -
+          // sending message canceled
+          console.log('TargetPicker was closed!')
+        }
+      }
+    }).catch(function (error) {
+      // something went wrong before sending a message
+      console.log('something wrong happen', error)
+    })
+
+  // const url = 'https://liff.googo.org:9898/misa-liff'
+  // axios
+  //   .get(url)
+  //   .then(({data}) => {
+  //     redisdata=data.data;
+  //     redistitle=data.title;
+  //     console.log(redistitle);
+  //     console.log(redisdata);
+
+  //     liff.shareTargetPicker([
+  //       {
+  //         type: "text",
+  //         text: "Test!"
+  //       }
+  //     ])
+  //       .then(
+  //         console.log("ShareTargetPicker was launched")
+  //       ).catch(function (res) {
+  //         alert(res);
+  //         console.log("Failed to launch ShareTargetPicker", res)
+  //       })
+
+  //     // liff
+  //     // .shareTargetPicker([
+  //     //   createFlexMessageData()      
+  //     // ])
+  //     // .then(() => {
+  //     //   alert("Shared to the friend(s) you picked");
+  //     // })
+  //     // .catch(function(res) {
+  //     //   alert(res);
+  //     // });
+
+  //   });
+}

+ 84 - 0
misa-program-5/js/liff-init.js

@@ -0,0 +1,84 @@
+// ----- Configuration Zone! -----
+// Don't forget to change this to your LIFF ID
+
+const liffId = "1660714189-vdEJJNZL";
+
+// Don't forget to change this to your LIFF ID
+
+liff.init(
+  { liffId: liffId },
+  () => {
+    initLIFF();
+  },
+  err => {
+    window.alert(err);
+  }
+);
+function initLIFF() {
+  if (liff.isLoggedIn()) {
+    liff
+      .getProfile()
+      .then(profile => {
+        document.getElementById("profileImage").src = profile.pictureUrl;
+        // document.getElementById("userId").innerHTML = profile.userId;
+        // document.getElementById("displayName").innerHTML = profile.displayName;
+        // document.getElementById("statusMessage").innerHTML =
+        //   profile.statusMessage;
+        // document.getElementById("pictureUrl").href = profile.pictureUrl;
+        // document.getElementById("pictureUrl").innerHTML = profile.pictureUrl;
+        // document.getElementById(
+        //   "email"
+        // ).innerHTML = liff.getDecodedIDToken().email;
+      })
+      .catch(e => {
+        // document.getElementById("userId").innerHTML = "No data, " + e;
+        // document.getElementById("displayName").innerHTML = "No data, " + e;
+        // document.getElementById("statusMessage").innerHTML = "No data, " + e;
+        // document.getElementById("pictureUrl").innerHTML = "No data, " + e;
+        // document.getElementById("email").innerHTML = "No data, " + e;
+      });
+  } else {
+    // document.getElementById("userId").innerHTML = "No data, Login first";
+    // document.getElementById("displayName").innerHTML = "No data, Login first";
+    // document.getElementById("statusMessage").innerHTML = "No data, Login first";
+    // document.getElementById("pictureUrl").innerHTML = "No data, Login first";
+    // document.getElementById("email").innerHTML = "No data, Login first";
+  }
+
+  // document.getElementById("getOS").innerHTML = liff.getOS();
+  // document.getElementById("getLanguage").innerHTML = liff.getLanguage();
+  // document.getElementById("getVersion").innerHTML = liff.getVersion();
+  // document.getElementById("isInClient").innerHTML = liff.isInClient();
+  // document.getElementById("isLoggedIn").innerHTML = liff.isLoggedIn();
+  var context = liff.getContext();
+  if (context !== null) {
+    // document.getElementById("context_type").innerHTML = context.type;
+    // document.getElementById("context_viewType").innerHTML = context.viewType;
+    // document.getElementById("context_userId").innerHTML = context.userId;
+    if (context.utouId) {
+      // document.getElementById("context_utouId").innerHTML = context.utouId;
+    } else {
+      // document.getElementById("context_utouId").innerHTML =
+      // "You are not in the utou";
+    }
+    if (context.roomId) {
+      // document.getElementById("context_roomId").innerHTML = context.roomId;
+    } else {
+      // document.getElementById("context_roomId").innerHTML =
+      // "You are not in the room";
+    }
+    if (context.groupId) {
+      // document.getElementById("context_groupId").innerHTML = context.groupId;
+    } else {
+      // document.getElementById("context_groupId").innerHTML =
+      //   "You are not in the group ";
+    }
+  } else {
+    // document.getElementById("context_type").innerHTML = "No data.";
+    // document.getElementById("context_viewType").innerHTML = "No data.";
+    // document.getElementById("context_userId").innerHTML = "No data.";
+    // document.getElementById("context_utouId").innerHTML = "No data.";
+    // document.getElementById("context_roomId").innerHTML = "No data.";
+    // document.getElementById("context_groupId").innerHTML = "No data.";
+  }
+}