detailPage.nvue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="media-item view" >
  3. <view class="list" >
  4. <view class="top" @click="changeO">
  5. <view class="t-v1">
  6. <view
  7. :class="newsItem.alarmLevel == 0 ?'bg1' :newsItem.alarmLevel == 1 ? 'bg2' :newsItem.alarmLevel == 2 ?'bg3' :newsItem.alarmLevel == 3 ?'bg4':'bg5'">
  8. </view>
  9. <text class="c1">{{newsItem.pointName}}</text>
  10. </view>
  11. </view>
  12. <view class="center" @click="changeO">
  13. <view class="c-v1">
  14. <text class="icon">&#xe608;</text>
  15. <text class="name">{{newsItem.time}}</text>
  16. </view>
  17. <text class="c4">{{newsItem.result}}</text>
  18. </view>
  19. <view v-if="newsItem.show && info.length >0" class="swipers">
  20. <swiper class="swiper-box" :indicator-dots="true" indicator-color="#0581FD">
  21. <swiper-item v-for="(item ,index) in info" :key="index" @click="imgpre">
  22. <image @load="(e) =>loadimg(item)" :lazy-load="true" class="swiper-box" :src="item"></image>
  23. </swiper-item>
  24. </swiper>
  25. </view>
  26. </view>
  27. <!-- <image src="http://192.168.1.144:8088/app/data/getImage?path=/2022/1/19/1138/CCD/16412819490000_440189026_20220119092221.jpg" mode=""></image> -->
  28. </view>
  29. </template>
  30. <script>
  31. var domModule = weex.requireModule('dom');
  32. domModule.addRule('fontFace', {
  33. 'fontFamily': "iconfont",
  34. 'src': "url('/static/iconfont.ttf')"
  35. })
  36. import {api_config} from '@/config.js'
  37. export default {
  38. props: {
  39. newsItem: {
  40. type: Object,
  41. default: function(e) {
  42. return {}
  43. }
  44. },
  45. type: {
  46. type: [Number, String],
  47. default: ''
  48. },
  49. },
  50. data(){
  51. return {
  52. info:[]
  53. }
  54. },
  55. mounted() {
  56. this.$set(this.newsItem,'show',false)
  57. this.newsItem.show = false
  58. this.newsItem.image ? this.info.push((api_config+'/app/data/getImage?path='+this.newsItem.image)) :''
  59. this.newsItem.infrared ? this.info.push(api_config+'/app/data/getImage?path='+this.newsItem.infrared) :''
  60. },
  61. methods: {
  62. imgpre(){
  63. uni.previewImage({
  64. urls:this.info,
  65. })
  66. },
  67. loadimg(e){
  68. },
  69. changeO() {
  70. this.$set(this.newsItem,'show',!this.newsItem.show)
  71. },
  72. }
  73. }
  74. </script>
  75. <style scoped lang="scss">
  76. .swipers{
  77. margin-top: 10rpx;
  78. .swiper-box{
  79. height: 400rpx;
  80. width: 680rpx;
  81. }
  82. }
  83. .icon {
  84. font-family: iconfont;
  85. font-size: 12px;
  86. color: #666666;
  87. }
  88. .bg1 {
  89. width: 11rpx;
  90. height: 11rpx;
  91. background: #31B643;
  92. border-radius: 50%;
  93. }
  94. .bg2 {
  95. width: 11rpx;
  96. height: 11rpx;
  97. background: #2F86EC;
  98. border-radius: 50%;
  99. }
  100. .bg3 {
  101. width: 11rpx;
  102. height: 11rpx;
  103. background: #F9D25C;
  104. border-radius: 50%;
  105. }
  106. .bg4 {
  107. width: 11rpx;
  108. height: 11rpx;
  109. background: #EC782F;
  110. border-radius: 50%;
  111. }
  112. .bg5 {
  113. width: 11rpx;
  114. height: 11rpx;
  115. background: #E80F0F;
  116. border-radius: 50%;
  117. }
  118. .media-item {
  119. background-color: #fff;
  120. margin-top: 20rpx;
  121. .c1 {
  122. font-size: 30rpx;
  123. color: #000000;
  124. padding-left: 5rpx;
  125. }
  126. .c2 {
  127. font-size: 30rpx;
  128. color: #999;
  129. }
  130. .c2 {
  131. font-size: 30rpx;
  132. color: #999;
  133. }
  134. .c4 {
  135. font-size: 28rpx;
  136. margin-top: 15rpx;
  137. color: #299F48;
  138. }
  139. .list {
  140. margin: 10rpx;
  141. padding: 20rpx;
  142. .top {
  143. flex-direction: row;
  144. justify-content: space-between;
  145. .t-v1 {
  146. flex-direction: row;
  147. align-items: center;
  148. }
  149. }
  150. .center {
  151. padding-left: 5rpx;
  152. flex-direction: row;
  153. text-overflow: ellipsis;
  154. justify-content: space-between;
  155. .c-v1 {
  156. flex-direction: row;
  157. margin-top: 15rpx;
  158. align-items: center;
  159. }
  160. .name {
  161. font-size: 26rpx;
  162. padding-left: 8rpx;
  163. color: #666;
  164. }
  165. }
  166. .bottom {
  167. flex-direction: row;
  168. justify-content: space-between;
  169. .ic {
  170. display: flex;
  171. flex-direction: row;
  172. align-items: center;
  173. }
  174. .code {
  175. text-overflow: ellipsis;
  176. lines: 1;
  177. font-size: 30rpx;
  178. margin-left: 8rpx;
  179. color: #999;
  180. width: 300rpx;
  181. }
  182. .icon {
  183. margin-right: 0;
  184. }
  185. }
  186. }
  187. }
  188. </style>