我想显示amp-date-picker中某些日期的最低票价。我能够显示静态文本,但不知道如何显示动态值。到目前为止,我已经完成了以下工作(硬编码模板中的日期和状态中的值,但这将在实际环境中从json中获取)。
<!doctype html>
<html amp lang="en">
<head>
<meta charset="utf-8">
<title>Travel date picker example</title>
<link rel="canonical" href="amps.html">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="amp-experiments-opt-in" content="amp-date-picker">
<style amp-custom>
</style>
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
<noscript>
<style amp-boilerplate>
body {
-webkit-animation: none;
-moz-animation: none;
-ms-animation: none;
animation: none
}
</style></noscript>
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
<script async custom-element="amp-date-picker" src="https://cdn.ampproject.org/v0/amp-date-picker-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
<label for="Departure"><span>Departure</span></label><br />
<amp-date-picker id="DepartureDate"
type="single"
mode="overlay"
layout="container"
on="select: AMP.setState({ departure: event.date, dateType1: event.id });
activate: AMP.setState({
fare:1000
})"
format="DD-MM-YYYY"
input-selector="[name=Departure]"
class="example-picker space-between">
<div class="icon-input"></div>
<div class="ampstart-input">
<input class="border-none p0"
name="Departure"
placeholder="Pick a date">
</div>
<template type="amp-mustache"
date-template
dates="2018-07-21"
id="spooky">
<span>
{{DD}} <br />
<small>$ {{fare}}</small>
</span>
</template>
</amp-date-picker>
</body>
</html>
这显示日期和$符号,但不显示金额,请让我知道如何实现。