增加版型

main
Wayne Hsu 3 years ago
parent 0efbe72b3d
commit a957d0847f

@ -0,0 +1,13 @@
NODE_ENV = production
VUE_ENV = h888
VUE_APP_LINE_LIFF_ID = 1657876696-564NGMxy
VUE_APP_SEND_URL = https://liff.line.me/1657876696-564NGMxy
VUE_APP_API_URL = https://card.h888.fun/appapi/v1
VUE_APP_IMAGE_URL = https://card.h888.fun/storage
VUE_APP_MC_URL = https://liff.line.me/1657876696-564NGMxy

@ -10,4 +10,4 @@ VUE_APP_API_URL = https://card.slash1000.com/appapi/v1
VUE_APP_IMAGE_URL = https://card.slash1000.com/storage VUE_APP_IMAGE_URL = https://card.slash1000.com/storage
VUE_APP_MC_URL = https://liff.line.me/1657876696-MKYDJKgm VUE_APP_MC_URL = https://liff.line.me/1661025693-veEM0lwZ

@ -7,7 +7,8 @@
"build": "vue-cli-service build", "build": "vue-cli-service build",
"build:dev": "vue-cli-service build --mode development", "build:dev": "vue-cli-service build --mode development",
"build:sta": "vue-cli-service build --mode stage", "build:sta": "vue-cli-service build --mode stage",
"build:slash": "vue-cli-service build --mode slash" "build:slash": "vue-cli-service build --mode slash",
"build:h888": "vue-cli-service build --mode h888"
}, },
"dependencies": { "dependencies": {
"@line/liff": "^2.19.0", "@line/liff": "^2.19.0",

@ -0,0 +1,243 @@
import store from '@/store'
function genCard(vcard) {
let action = {
address: null,
email: null,
tel: null,
phone: null,
}
if (vcard.address) {
action.address = `
,"action": {
"type": "uri",
"label": "action",
"uri": "https://www.google.com.tw/maps/place/${encodeURIComponent(
vcard.address
)}"
}
`
}
if (vcard.email) {
action.email = `
,"action": {
"type": "uri",
"label": "action",
"uri": "mailto:${vcard.email}"
}
`
}
if (vcard.tel) {
action.tel = `
,"action": {
"type": "uri",
"label": "action",
"uri": "tel:${vcard.tel}"
}
`
}
if (vcard.phone) {
action.phone = `
,"action": {
"type": "uri",
"label": "action",
"uri": "tel:${vcard.phone}"
}
`
}
let card = `
{
"altText": "SlashCard電子名片",
"type": "flex",
"contents": {
"type": "bubble",
"size": "giga",
"body": {
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "image",
"url": "https://card.h888.fun/images/background/jci.png?v=10",
"size": "full",
"aspectMode": "cover",
"aspectRatio": "544:308",
"gravity": "top"
},
{
"type": "box",
"layout": "horizontal",
"contents": [
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "image",
"url": "${vcard.avatar}"
}
],
"width": "80%",
"offsetTop": "10%",
"position": "absolute",
"action": {
"type": "uri",
"label": "action",
"uri": "${vcard.nfcurl}&cardid=1"
}
},
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "加入好友",
"color": "#FFFFFF",
"size": "xs",
"align": "center"
}
],
"backgroundColor": "#66B3FF",
"cornerRadius": "5px",
"paddingTop": "5px",
"paddingBottom": "5px",
"margin": "md",
"paddingStart": "5px",
"paddingEnd": "5px",
"action": {
"type": "uri",
"label": "action",
"uri": "https://line.naver.jp/ti/p/~${vcard.line}"
}
},
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": "分享名片",
"color": "#FFFFFF",
"size": "xs"
}
],
"backgroundColor": "#66B3FF",
"cornerRadius": "5px",
"paddingTop": "5px",
"paddingBottom": "5px",
"margin": "md",
"paddingStart": "5px",
"paddingEnd": "5px",
"action": {
"type": "uri",
"label": "action",
"uri": "${process.env.VUE_APP_SEND_URL}/?userid=${vcard.user_id}&cardid=1"
}
}
],
"position": "absolute",
"offsetBottom": "10%"
}
],
"width": "23%",
"alignItems": "center",
"height": "100%"
},
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": " ${vcard.company}",
"color": "#0066cc",
"align": "end",
"weight": "regular",
"size": "md"
},
{
"type": "text",
"text": " ${vcard.tel} ${vcard.address}",
"align": "end",
"size": "xxs"
${action.address}
},
{
"type": "text",
"text": " ${vcard.email}",
"align": "end",
"size": "xxs"
${action.email}
}
],
"width": "100%",
"offsetTop": "65%",
"offsetEnd": "5%"
},
{
"type": "box",
"layout": "vertical",
"contents": [
{
"type": "text",
"text": " ${vcard.name}",
"align": "end",
"color": "#66B3FF"
},
{
"type": "text",
"text": " ${vcard.title}",
"size": "sm",
"align": "end"
},
{
"type": "text",
"text": " ${vcard.phone}",
"size": "sm",
"align": "end"
${action.phone}
}
],
"width": "45%",
"offsetTop": "30%",
"position": "absolute",
"offsetEnd": "5%"
}
],
"width": "77%"
}
],
"position": "absolute",
"width": "100%",
"height": "100%"
}
],
"position": "relative",
"spacing": "none",
"margin": "none",
"paddingAll": "none"
}
}}
`
return { card: card}
}
export default genCard ;

@ -2,7 +2,7 @@ import { genCard as Card0 } from "./card0.js";
import { genCard as Card1 } from "./card1.js"; import { genCard as Card1 } from "./card1.js";
import { genCard as Card2 } from "./card2.js"; import { genCard as Card2 } from "./card2.js";
import { genCard as Card3 } from "./card3.js"; import { genCard as Card3 } from "./card3.js";
import { genCard as Card4 } from "./card4.js"; import Card5 from "./card5.js";
export function genCard(opt) { export function genCard(opt) {
switch (opt.tid) { switch (opt.tid) {
@ -21,6 +21,9 @@ export function genCard(opt) {
case 4: case 4:
return Card4(opt.vcard); return Card4(opt.vcard);
break; break;
case 5:
return Card5(opt.vcard);
break;
default: default:
throw new Error("params error"); throw new Error("params error");
break; break;

@ -75,7 +75,7 @@ onBeforeMount(async () => {
if (card1Res.code !== 200) { if (card1Res.code !== 200) {
Toast('操作錯誤!!!') Toast('操作錯誤!!!')
console.log('error ec001') console.log('error ec001')
window.location.replace('https://liff.line.me/1656948609-xMp7dWAz') // window.location.replace(process.env.VUE_APP_SEND_URL)
} }
state.value.user = card1Res.data state.value.user = card1Res.data

@ -3,7 +3,7 @@ module.exports = {
disableHostCheck: true disableHostCheck: true
}, },
publicPath: ["production", "stage", "slash"].includes(process.env.VUE_ENV) ? '/send' : '/send', publicPath: ["production", "stage", "slash"].includes(process.env.VUE_ENV) ? '/send' : '/send',
outputDir: ["production", "stage", "slash"].includes(process.env.VUE_ENV) ? '../api/public/send' : './dist', outputDir: ["production", "stage", "slash"].includes(process.env.VUE_ENV) ? '../build/send' : './dist',
} }
Loading…
Cancel
Save