Skip to content

Instantly share code, notes, and snippets.

@hcchen
Last active July 19, 2020 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcchen/3a7e0069307ae3bb53520d4718bd4a77 to your computer and use it in GitHub Desktop.
Save hcchen/3a7e0069307ae3bb53520d4718bd4a77 to your computer and use it in GitHub Desktop.
<%
function gaScreenView (vcard) {
return `https://www.google-analytics.com/collect?${Qs.stringify({
an: 'LINE 台水數位版名片',
cd: `台水一般版-2020/07/19-${vcard.mobile}`, // 畫面名稱,在此用來紀錄數位版名片的版本
cid: vcard.uuid, // uuid
ds: 'app', // 資料來源,填寫為 app
t: 'screenview',
tid: 'UA-39556213-12', // GA 追蹤代碼
ul: 'zh-tw', // locale
v: 1, // api version
})}`
}
%>
{
altText: '請在手機上查看「${vcard.name_tw}」的名片。',
type: 'flex',
contents: {
type: 'bubble',
size: 'giga',
body: {
layout: 'horizontal',
paddingAll: '20px',
type: 'box',
contents: [
{
flex: 314,
layout: 'vertical',
type: 'box',
contents: [
{
aspectMode: 'fit',
aspectRatio: '2008:639',
size: 'full',
type: 'image',
url: 'https://www.water.gov.tw/Img/logo_2.png',
action: {
type: 'uri',
label: 'action',
uri: 'https://www.water.gov.tw?openExternalBrowser=1',
},
},
{
flex: 1,
layout: 'vertical',
type: 'box',
contents: [
{
type: 'filler',
},
],
},
{
margin: 'xl',
size: 'xxs',
text: '${vcard.title_tw}',
type: 'text',
wrap: true,
},
{
size: 'lg',
text: '${vcard.name_tw}',
type: 'text',
weight: 'bold',
wrap: true,
},
{
margin: 'xl',
size: 'xxs',
text: '${vcard.title_en}',
type: 'text',
wrap: true,
},
{
size: 'lg',
text: '${vcard.name_en}',
type: 'text',
weight: 'bold',
wrap: true,
},
],
},
{
flex: 624,
layout: 'vertical',
margin: 'xl',
spacing: 'sm',
type: 'box',
contents: [
{
aspectMode: 'fit',
aspectRatio: '580:93',
size: 'full',
type: 'image',
url: 'https://i.imgur.com/AkL7eqf.png',
action: {
type: 'uri',
label: 'action',
uri: 'https://www.water.gov.tw?openExternalBrowser=1',
},
},
{
layout: 'horizontal',
margin: 'lg',
spacing: 'md',
type: 'box',
contents: [
{
flex: 0,
layout: 'vertical',
type: 'box',
contents: [
{
align: 'center',
color: '#E2231A',
flex: 0,
size: 'sm',
text: 'M',
type: 'text',
weight: 'bold',
},
{
align: 'center',
color: '#E2231A',
flex: 0,
size: 'sm',
text: 'T',
type: 'text',
weight: 'bold',
},
{
align: 'center',
color: '#E2231A',
flex: 0,
size: 'sm',
text: 'F',
type: 'text',
weight: 'bold',
},
],
},
{
type: 'box',
layout: 'vertical',
contents: [
{
size: 'sm',
text: '+886 ${vcard.mobile.slice(1)}',
type: 'text',
action: {
type: 'uri',
label: 'action',
uri: 'tel:${vcard.mobile}',
},
},
{
size: 'sm',
text: '+886 4 2224 4191 #${vcard.ext}',
type: 'text',
action: {
type: 'uri',
label: 'action',
uri: 'tel:04-22244191,${vcard.ext}',
},
},
{
size: 'sm',
text: '+886 4 2224 4201',
type: 'text',
},
],
},
],
},
{
margin: 'lg',
text: '${vcard.email}',
type: 'text',
wrap: true,
action: {
type: 'uri',
label: 'action',
uri: 'mailto:${vcard.email}',
},
},
{
margin: 'lg',
size: 'xxs',
text: '40455 台中市雙十路二段2-1號',
type: 'text',
action: {
type: 'uri',
label: 'action',
uri: 'https://bit.ly/2DYQScI?openExternalBrowser=1',
},
},
{
margin: 'none',
size: 'xxs',
text: 'No. 1-1, Sec. 2, Shuangshi Rd., North Dist., Taichung City 404, Taiwan (R.O.C.)',
type: 'text',
wrap: true,
action: {
type: 'uri',
label: 'action',
uri: 'https://bit.ly/2DYQScI?openExternalBrowser=1',
},
},
{
size: 'xxs',
text: '統一編號 52242444',
type: 'text',
},
],
},
{
height: '1px',
layout: 'vertical',
offsetStart: '0px',
offsetTop: '0px',
position: 'absolute',
type: 'box',
width: '1px',
contents: [
{
aspectMode: 'fit',
aspectRatio: '1:1',
size: 'full',
type: 'image',
url: '${gaScreenView(vcard)}',
},
],
},
],
},
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment