myApps.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <view>
  3. <u-navbar title="我的应用" title-color="#101010"></u-navbar>
  4. <!-- 用电管理 -->
  5. <view class="apps-content">
  6. <view class="title">
  7. 用电管理
  8. </view>
  9. <view class="apps-groups">
  10. <view class="item" @click="gotoUrl('/pages/equipmentDataMonitoring/dataMonitoring-list')"
  11. v-if="codes.indexOf('detector')!=-1">
  12. <view class="item-icon">
  13. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  14. </view>
  15. <view class="item-name">
  16. 设备数据监控
  17. </view>
  18. </view>
  19. <!-- <view class="item" @click="gotoUrl('/pages/equipmentDataMonitoring/equipmentElectricity')"
  20. v-if="codes.indexOf('reading')!=-1">
  21. <view class="item-icon item-icon2">
  22. <image class="img" src="@/assets/img/iconPark-order.svg" mode=""></image>
  23. </view>
  24. <view class="item-name">
  25. 设备用电量
  26. </view>
  27. </view> -->
  28. <view class="item" @click="gotoUrl('/pages/equipmentInformation/equipmentInformation')">
  29. <view class="item-icon item-icon3">
  30. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  31. </view>
  32. <view class="item-name">
  33. 设备信息
  34. </view>
  35. </view>
  36. <view class="item" @click="gotoUrl('/pages/abnormal/abnormalAlarmRecord')"
  37. v-if="abnormalRecordsList.length != 0">
  38. <view class="item-icon item-icon4">
  39. <image class="img" src="@/assets/img/iconPark-order.svg" mode=""></image>
  40. </view>
  41. <view class="item-name">
  42. 异常告警记录
  43. </view>
  44. </view>
  45. <view class="item" v-if="false">
  46. <view class="item-icon item-icon5">
  47. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  48. </view>
  49. <view class="item-name">
  50. 异常设备排名
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 工单管理 -->
  56. <view class="apps-content" v-if="false">
  57. <view class="title">
  58. 工单管理
  59. </view>
  60. <view class="apps-groups">
  61. <view class="item">
  62. <view class="item-icon">
  63. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  64. </view>
  65. <view class="item-name">
  66. 工单统计
  67. </view>
  68. </view>
  69. <view class="item">
  70. <view class="item-icon item-icon6">
  71. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  72. </view>
  73. <view class="item-name">
  74. 故障上报
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. <energyCenterTabbar :current="1"></energyCenterTabbar>
  80. </view>
  81. </template>
  82. <script>
  83. import energyCenterTabbar from '@/components/energyCenterTabbar.vue'
  84. import * as API from '@/apis/pagejs/index.js'
  85. export default {
  86. components: {
  87. energyCenterTabbar
  88. },
  89. data() {
  90. return {
  91. codes: '',
  92. abnormalRecordsList: []
  93. }
  94. },
  95. onReady() {
  96. var date = new Date();
  97. var year = date.getFullYear();
  98. var month = date.getMonth()+1 >= 10 ? date.getMonth()+1 : '0'+(date.getMonth()+1);
  99. this.queryDate = year + '-' + month;
  100. this.getfindByOpenId();
  101. this.getAbnormalAlarmRecord();
  102. },
  103. methods: {
  104. // 异常告警记录
  105. getAbnormalAlarmRecord() {
  106. uni.showLoading({
  107. title: "加载中",
  108. mask: true,
  109. })
  110. API.alarmRecord({
  111. queryDate: this.queryDate,
  112. configId: '',
  113. pageIndex: 1,
  114. pageSize: 3,
  115. companyId: this.companyId
  116. }).then((response) => {
  117. uni.hideLoading();
  118. this.abnormalRecordsList = response.data.data;
  119. }).catch(error => {
  120. uni.showToast({
  121. title: error,
  122. icon: "none"
  123. })
  124. })
  125. },
  126. // 商户ID
  127. getfindByOpenId() {
  128. uni.showLoading({
  129. title: "加载中",
  130. mask: true,
  131. })
  132. API.findByOpenId({
  133. openId: this.carhelp.getOpenId()
  134. }).then((response) => {
  135. uni.hideLoading();
  136. this.codes = response.data.regUser.codes;
  137. }).catch(error => {
  138. uni.showToast({
  139. title: error,
  140. icon: "none"
  141. })
  142. })
  143. },
  144. }
  145. }
  146. </script>
  147. <style lang="scss" scoped>
  148. .apps-content{
  149. background-color: #fff;
  150. margin-bottom: 24rpx;
  151. .title{
  152. padding: 32rpx;
  153. color: rgb(51,51,51);
  154. font-size: 36rpx;
  155. font-weight: bold;
  156. border-bottom: 1px solid #f2f4f6;
  157. }
  158. .apps-groups{
  159. display: flex;
  160. flex-wrap: wrap;
  161. .item{
  162. width: 50%;
  163. display: flex;
  164. padding: 32rpx 24rpx;
  165. align-items: center;
  166. border-right: 1px solid #f2f4f6;
  167. .item-icon{
  168. border-radius: 8px;
  169. background: linear-gradient(180deg, rgba(93,155,255,1) 0%,rgba(0,97,255,1) 100%);
  170. width: 72rpx;
  171. height: 72rpx;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. .img{
  176. width: 48rpx;
  177. height: 48rpx;
  178. }
  179. }
  180. .item-icon2{
  181. background: linear-gradient(178.44deg, rgba(122,232,227,1) 3.96%,rgba(57,182,182,1) 100.6%)
  182. }
  183. .item-icon3{
  184. background: linear-gradient(179.2deg, rgba(168,178,238,1) 6.28%,rgba(123,123,240,1) 96.94%);
  185. }
  186. .item-icon4{
  187. background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  188. }
  189. .item-icon5{
  190. background: linear-gradient(181.79deg, rgba(117,213,224,1) -1.13%,rgba(53,153,203,1) 94.2%);
  191. }
  192. .item-icon6{
  193. background: linear-gradient(180.4deg, rgba(127,213,151,1) 2.1%,rgba(67,176,116,1) 101.21%);
  194. }
  195. .item-name{
  196. color: rgba(51,51,51,1);
  197. font-size: 36rpx;
  198. margin-left: 16rpx;
  199. font-weight: bold;
  200. }
  201. }
  202. }
  203. }
  204. </style>