parent
d07a8c2f8d
commit
e7a0d071ce
@ -1,19 +1,85 @@
|
||||
import { genCard } from "./card/index";
|
||||
|
||||
function genAdCard (option) {
|
||||
// const { json5: vcard } = ctx;
|
||||
function genAdCard(ctx,option) {
|
||||
const { json5: vcard } = ctx;
|
||||
|
||||
// return {
|
||||
// type: "flex",
|
||||
// altText: vcard.altText,
|
||||
// contents: {
|
||||
// type: "carousel",
|
||||
// contents: ctx
|
||||
// },
|
||||
// };
|
||||
|
||||
console.log(option,"test");
|
||||
return option;
|
||||
return {
|
||||
type: "flex",
|
||||
altText: "廣告卡片",
|
||||
contents: {
|
||||
type: "carousel",
|
||||
contents: [
|
||||
ctx.contents,
|
||||
{
|
||||
"type": "bubble",
|
||||
"size":"mega",
|
||||
"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