景徳镇旅游微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
4.4 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="Locations">
  3. <view class="Locations-list">
  4. <view class="main">
  5. <image
  6. class="main-image"
  7. src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img"
  8. mode="aspectFill"></image>
  9. <view class="info">
  10. <view class="title">
  11. 陶阳里景区
  12. </view>
  13. <view class="tips">
  14. 6个遗产点
  15. </view>
  16. <view class="btn">
  17. <image src="/static/image/tourGuide/a.png"
  18. mode=""></image>
  19. <text class=""
  20. @click="textToSpeech">
  21. 语音讲解
  22. </text>
  23. </view>
  24. </view>
  25. <view class="controls">
  26. <view class="f">
  27. <image src="/static/image/tourGuide/f.png" mode=""></image>
  28. </view>
  29. <view class="btn"
  30. @click="show = !show">
  31. <text class="">
  32. {{ show ? '收起' : '展开' }}
  33. </text>
  34. <uv-icon
  35. :name="show ? 'arrow-up' : 'arrow-down'"
  36. size="30rpx"></uv-icon>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="list"
  41. v-if="show">
  42. <view class="main"
  43. v-for="(item, index) in 10"
  44. :key="index">
  45. <image
  46. class="main-image"
  47. src="https://img-s-msn-com.akamaized.net/tenant/amp/entityid/BB1msKSi.img"
  48. mode="aspectFill"></image>
  49. <view class="info">
  50. <view class="title">
  51. 陶阳里景区
  52. </view>
  53. <view class="tips">
  54. 6个遗产点
  55. </view>
  56. </view>
  57. <view class="controls">
  58. <view class="f">
  59. <image
  60. src="/static/image/tourGuide/f.png" mode=""></image>
  61. </view>
  62. <view class="f">
  63. <image
  64. @click="textToSpeech"
  65. src="/static/image/tourGuide/a.png" mode=""></image>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. // var plugin = requirePlugin("WechatSI")
  75. // "plugins" : {
  76. // "WechatSI" : {
  77. // "version" : "0.3.1",
  78. // "provider" : "wx069ba97219f66d99"
  79. // }
  80. // }
  81. export default {
  82. data() {
  83. return {
  84. show : true,
  85. context : uni.createInnerAudioContext(),
  86. }
  87. },
  88. methods: {
  89. textToSpeech(){
  90. console.log('textToSpeech');
  91. let self = this
  92. plugin.textToSpeech({
  93. lang: "zh_CN",
  94. tts: true,
  95. content: "景德镇市陶阳里御窑景区位于景德镇的城市中心地带,北起瓷都大桥、昌江大道,南至昌江大桥、西至沿江西路,东至莲社路、胜利路。 自宋以来,景德镇先民“沿河建窑,因窑成市”,渐呈“码头—民窑—老街—里弄—御窑”聚落的历史空间和瓷业肌理,形成了世界建筑史上绝无仅有的老城格局,成就了中国“东方瓷国”的盛誉,陶瓷成为了中国走向世界,世界认识中国的文化符号。这里是景德镇历史上制瓷业的中心、原点和高峰,是“一带一路”海上陶瓷之路的零公里起点,是研究皇家御窑制瓷历史文化和景德镇陶瓷技艺,讲好景德镇故事,传播中国声音的“窗口”和“名片”。",
  96. success: function(res) {
  97. self.context.src = res.filename;
  98. self.context.play()
  99. },
  100. fail: function(res) {
  101. console.log("fail tts", res)
  102. }
  103. })
  104. },
  105. }
  106. }
  107. </script>
  108. <style scoped lang="scss">
  109. .Locations{
  110. .Locations-list{
  111. .main{
  112. display: flex;
  113. margin: 20rpx;
  114. .main-image{
  115. width: 150rpx;
  116. height: 150rpx;
  117. border-radius: 20rpx;
  118. }
  119. .info{
  120. margin-left: 20rpx;
  121. .title{
  122. font-size: 30rpx;
  123. font-weight: 900;
  124. }
  125. .tips{
  126. font-size: 24rpx;
  127. color: #999999;
  128. margin-top: 10rpx;
  129. }
  130. }
  131. .controls{
  132. margin-left: auto;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: center;
  136. align-items: center;
  137. .f{
  138. image{
  139. width: 50rpx;
  140. height: 50rpx;
  141. }
  142. }
  143. }
  144. .btn{
  145. padding: 10rpx;
  146. font-size: 22rpx;
  147. color: $uni-color;
  148. border: 1rpx solid $uni-color;
  149. background-color: #F4E4C4;
  150. display: flex;
  151. justify-content: center;
  152. align-items: center;
  153. margin-top: 10rpx;
  154. border-radius: 15rpx;
  155. image{
  156. width: 25rpx;
  157. height: 25rpx;
  158. }
  159. text{
  160. margin: 0 10rpx;
  161. }
  162. }
  163. }
  164. .list{
  165. padding-left: 40rpx;
  166. .main{
  167. align-items: center;
  168. .main-image{
  169. width: 140rpx;
  170. height: 140rpx;
  171. }
  172. .controls{
  173. flex-direction: row;
  174. .f{
  175. margin: 30rpx;
  176. image{
  177. width: 40rpx;
  178. height: 40rpx;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. }
  186. </style>