abbott_2024_event/bin/app.publish/Line/page1.html

179 lines
6.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>測試2</title>
<link href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600" rel="stylesheet"><!-- End Google font -->
<!-- BEGIN PLUGINS STYLES -->
<link rel="stylesheet" href="assets/vendor/@fortawesome/fontawesome-free/css/all.min.css"><!-- END PLUGINS STYLES -->
<!-- BEGIN THEME STYLES -->
<link rel="stylesheet" href="assets/stylesheets/theme.min.css" data-skin="default">
<link rel="stylesheet" href="assets/stylesheets/custom.css">
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-F1FH9SR1JC"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
//gtag('config', 'G-2G92RZQS1G');
gtag('config', 'G-F1FH9SR1JC');
</script>
</head>
<body>
<div class="app">
<!-- .app-main -->
<main class="app-main">
<!-- .wrapper -->
<div class="wrapper">
<!-- .page -->
<div class="page">
<div class="page-inner">
<!-- .form-group -->
<div class="form-group">
<button id="getcoupon_btn" class="btn btn-lg btn-primary btn-block" type="button">領取試用</button>
</div><!-- /.form-group -->
</div>
</div><!-- /.page -->
</div><!-- /.wrapper -->
</main><!-- /.app-main -->
</div>
<script src="jquery/jquery.min.js"></script>
<script src="assets/vendor/jquery.cookie/jquery.cookie.js"></script>
<script src="assets/vendor/popper.js/umd/popper.min.js"></script>
<script src="assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
<script src="bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="assets/javascript/theme.js"></script> <!-- END THEME JS -->
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script>
// VConsole 默认会挂载到 `window.VConsole` 上
var vConsole = new window.VConsole();
// 接下来即可照常使用 `console` 等方法
//console.log('Hello world');
// 结束调试后,可移除掉
//vConsole.destroy();
</script>
<script>
var search_url = location.search;
var line_uid = "";
var line_name = "";
$(document).ready(function () {
(function ($) {
$.UrlParam = function (name) {
//宣告正規表達式
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
/*
* window.location.search 獲取URL ?之後的參數(包含問號)
* substr(1) 獲取第一個字以後的字串(就是去除掉?號)
* match(reg) 用正規表達式檢查是否符合要查詢的參數
*/
var r = window.location.search.substr(1).match(reg);
//如果取出的參數存在則取出參數的值否則回穿null
if (r != null) return unescape(r[2]); return '';
}
})(jQuery);
var utm_source = escape($.UrlParam("utm_source"));
var utm_medium = escape($.UrlParam("utm_medium"));
var utm_campaign = escape($.UrlParam("utm_campaign"));
var utm_content = escape($.UrlParam("utm_content"));
var utm_term = escape($.UrlParam("utm_term"));
var line_uid = $.UrlParam("uid");
var user_name = $.UrlParam("username");
var phone = $.UrlParam("phone");
if (line_uid == '' || user_name == '') {
alert('請先登入Line綁定會員!');
location.href = "https://liff.line.me/1655253332-w8On6p2r?traceId=109&&utm_source=" + utm_source + "&utm_medium=" + utm_medium + "&utm_campaign=" + utm_campaign + "&utm_content=" + utm_content + "&utm_term=" + utm_term;
}
$('#getcoupon_btn').on('click', function () {
//alert($.UrlParam("utm_campaign"));
gtag('event', 'click', {
'button': 'sample',
'utm_source': $.UrlParam("utm_source"),
'utm_medium': $.UrlParam("utm_medium"),
'utm_campaign': $.UrlParam("utm_campaign"),
'utm_content': $.UrlParam("utm_content"),
'utm_term': $.UrlParam("utm_term")
});
location.href = "https://www.abbott-nutrition.com.tw/pediasure/trial2020.html" + search_url;
});
});
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
}
}
return false;
};
//var liffID = '2006708411-0lWgQ4Va';
//liff.init({
// liffId: liffID
//}).then(function () {
// //if (!liff.isInClient()) {
// // alert("請在Line App裡開啟!");
// // return;
// //}
// console.log('LIFF init');
// // 這邊開始寫使用其他功能
// if (!liff.isLoggedIn()) {
// console.log("你還沒登入Line哦");
// //liff.login({ redirectUri: "https://abbott-2024-event.bremennetwork.tw/abbott-2024/Line/" + search_url });
// liff.login({ redirectUri: "https://www.abbott-nutrition.com.tw/pediasure/4Ip2xCJElotaBUKBNJuz9sUY5/" + search_url });
// } else {
// method = getUrlParameter("method");
// //alert(method);
// liff.getProfile()
// .then(profile => {
// line_uid = profile.userId;
// line_name = profile.displayName;
// })
// .catch((err) => {
// console.log('error', err);
// });
// }
//}).catch(function (error) {
// console.log(error);
//});
</script>
</body>
</html>