Как использовать компонент TouchWrapper при отображении списка пересылки изображений? - PullRequest
0 голосов
/ 01 мая 2019

В документации недостаточно содержимого для точной реализации компонента 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- { "Тип": "TouchWrapper", "вещь":{ «Тип»: «Текст», "текст":"", "цвет":"", "размер шрифта":"" }, "OnPress": { "Тип": "SendEvent", "аргументы": [ "Дези Флейворс", "Глобал Флейворс" ] }

}

Я ожидаю вывод, что если кто-то выбирает Desi Flavors, он должен храниться в переменной (тарелке).

...