parent
d07a8c2f8d
commit
e7a0d071ce
@ -1,19 +1,85 @@
|
|||||||
import { genCard } from "./card/index";
|
function genAdCard(ctx,option) {
|
||||||
|
const { json5: vcard } = ctx;
|
||||||
function genAdCard (option) {
|
|
||||||
// const { json5: vcard } = ctx;
|
|
||||||
|
|
||||||
// return {
|
return {
|
||||||
// type: "flex",
|
type: "flex",
|
||||||
// altText: vcard.altText,
|
altText: "廣告卡片",
|
||||||
// contents: {
|
contents: {
|
||||||
// type: "carousel",
|
type: "carousel",
|
||||||
// contents: ctx
|
contents: [
|
||||||
// },
|
ctx.contents,
|
||||||
// };
|
{
|
||||||
|
"type": "bubble",
|
||||||
console.log(option,"test");
|
"size":"mega",
|
||||||
return option;
|
"hero": {
|
||||||
|
"type": "image",
|
||||||
|
"url": option.ad_image,
|
||||||
|
"size": "full",
|
||||||
|
"aspectMode": "cover",
|
||||||
|
"aspectRatio": "19:11",
|
||||||
|
"action": {
|
||||||
|
"type": "uri",
|
||||||
|
"uri": option.link
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"body": {
|
||||||
|
"type": "box",
|
||||||
|
"layout": "vertical",
|
||||||
|
"contents": [
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": option.ad_title,
|
||||||
|
"weight": "bold",
|
||||||
|
"size": "xl",
|
||||||
|
"color": "#333333"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "text",
|
||||||
|
"text": option.ad_desc,
|
||||||
|
"color": "#666666",
|
||||||
|
"size": "md",
|
||||||
|
"wrap": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"type": "box",
|
||||||
|
"layout": "vertical",
|
||||||
|
"spacing": "sm",
|
||||||
|
"color": "#6c6664",
|
||||||
|
"contents": [
|
||||||
|
{
|
||||||
|
"type": "button",
|
||||||
|
"style": "primary",
|
||||||
|
"height": "sm",
|
||||||
|
"color": "#6c6664",
|
||||||
|
"action": {
|
||||||
|
"type": "uri",
|
||||||
|
"label": "test link",
|
||||||
|
"uri": "https://linecorp.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "box",
|
||||||
|
"layout": "vertical",
|
||||||
|
"contents": [],
|
||||||
|
"margin": "sm"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"flex": 0
|
||||||
|
},
|
||||||
|
"styles": {
|
||||||
|
"body": {
|
||||||
|
"backgroundColor": "#eeeeee"
|
||||||
|
},
|
||||||
|
"footer": {
|
||||||
|
"backgroundColor": "#eeeeee"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export { genAdCard}
|
export { genAdCard };
|
||||||
Loading…
Reference in new issue