Как использовать компонент TouchWrapper при отображении списка пересылки изображений?
В документации контента недостаточно для точной реализации компонента TouchWrapper. Кто-нибудь, кто мог бы помочь?
Я сослался на https://developer.amazon.com/docs/alexa-presentation-language/apl-touchwrapper.html
https://medium.com/@punkpocko/alexa-apl-touch-wrappers-75d62784b3e8
def can_handle(self, handler_input):
return handler_input.request_envelope.request.type = 'Alexa.Presentation.APL.UserEvent' and handler_input.request_envelope.request.arguments.length>0 and (handler_input.request_envelope.request.arguments[0] == "Desi Flavors" or handler_input.request_envelope.request.arguments[0] == 'Global Flavors')
def handle(self, handler_input):
if handler_input.request_envelope.request.arguments[0] == "Desi Flavors":
dish ='Desi Flavors'
elif handler_input.request_envelope.request.arguments[0] == "Global Flavors":
dish ='Global Flavors'
return dish
Вот JSON- {"type": "TouchWrapper", "item": {"type": "Text", "text": "", "color": "", "fontSize": ""}, "OnPress ": {" type ":" SendEvent "," arguments ": [" Desi Flavors "," Global Flavors "]}
}
Я ожидаю вывод, что если кто-то выбирает Desi Flavors, он должен храниться в переменной (dish).