Browse Source

Merge branch 'master' of http://git.choozmo.com:3000/choozmo/hhh-home-mb

huaisianhuang 3 years ago
parent
commit
41dad0113d
2 changed files with 96 additions and 2 deletions
  1. 14 2
      yo/fb836df3b3c54c3cb0e361cd10a1ae37.html
  2. 82 0
      yo/test.html

+ 14 - 2
yo/fb836df3b3c54c3cb0e361cd10a1ae37.html

@@ -12,7 +12,6 @@
   <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
   <script>
     function copyToStage() {
-      //alert('https://m3.hhh.com.tw:18686/movexoopstostage?designerid=' + $('#did').val() + '&caseid=' + $('#cid').val());
       axios.get('https://m3.hhh.com.tw:18686/movexoopstostage?designerid=' + $('#did').val() + '&caseid=' + $('#cid').val()).then((data) => {
 
         if (data["data"] == "success") {
@@ -23,7 +22,6 @@
     }
 
     function copyPToStage() {
-      //alert('https://m3.hhh.com.tw:18686/movexoopstostage?designerid=' + $('#did').val() + '&caseid=' + $('#cid').val());
       axios.get('https://m3.hhh.com.tw:18686/movepxoopstostage?brandid=' + $('#bid').val() + '&productid=' + $('#pid').val()).then((data) => {
 
         if (data["data"] == "success") {
@@ -32,6 +30,16 @@
 
       });
     }
+
+    function copyCToStage() {
+      axios.get('https://m3.hhh.com.tw:18686/movecxoopstostage?columnid=' + $('#colid').val()).then((data) => {
+
+        if (data["data"] == "success") {
+          $('#msg')[0].innerHTML = '(' + $('#colid').val() + ') 複製成功';
+        }
+
+      });
+    }
   </script>
 </head>
 
@@ -48,6 +56,10 @@
       產品ID:<input type="text" id="pid" />
       <button onclick="copyPToStage();">複製產品到測試機</button>
     </div>
+    <div style="background-color:mediumaquamarine;">
+      專欄ID:<input type="text" id="colid" />
+      <button onclick="copyCToStage();">複製專欄到測試機</button>
+    </div>
     <div id='msg'></div>
   </div>
 

+ 82 - 0
yo/test.html

@@ -0,0 +1,82 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+  <meta name="description" content="Webpage description goes here" />
+  <meta charset="utf-8">
+  <title>Change_me</title>
+  <meta name="viewport" content="width=device-width, initial-scale=1">
+  <meta name="author" content="">
+  <link rel="stylesheet" href="css/style.css">
+  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
+  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
+  <script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
+
+</head>
+
+<body>
+
+  <div class="container">
+
+  </div>
+  <div id="like_button_container"></div>
+  <button onclick="exportcsv();">123</button> 
+  <button onclick="login();">in</button>
+  <button onclick="logout();">out</button>
+  <button onclick="test();">test</button>
+  <div id="myGrid" style="height: 600px;width:800px;" class="ag-theme-alpine"></div>
+
+  <script>
+
+    var liffID = '1656493448-Oz6Xrx97';
+
+    function login() {
+      // 登入
+      liff.login({
+        // 使用者登入後要去到哪個頁面
+        redirectUri: 'https://m3.hhh.com.tw/yo/test.html',
+        target: '_blank'
+      });
+    }
+
+    function logout() {
+      // 登出
+      liff.logout();
+    }
+
+    liff.init({
+      liffId: liffID
+    }).then(function () {
+      console.log('LIFF init');
+    });
+
+
+    function test() {
+      // 這邊開始寫使用其他功能
+      // 取得使用者類型資料
+      var context = liff.getContext();
+      console.log(context);
+
+      // 取得使用者公開資料
+      // 後台的「Scopes」要設定開啟 profile, openid
+      liff.getProfile()
+        .then(function (profile) {
+          console.log(profile);
+        });
+
+      // 取得使用者 email
+      // 後台的 Email address permission 要是「Applied」
+      // LIFF 的設定,Scopes 的「email*」要打勾
+      // 使用者在登入時,「電子郵件帳號」也要是「許可」的
+      var user = liff.getDecodedIDToken();
+      var email = user.email;
+      console.log(email);
+    }
+
+
+
+  </script>
+
+</body>
+
+</html>