uniNavBar.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view class="messageData">
  3. <view class="box-bg">
  4. <uni-nav-bar :fixed="true" dark left-icon="left" background-color='#202246' title="消息" @clickLeft="back" />
  5. </view>
  6. <view class="messageDataCharts">
  7. <qiun-data-charts type="gauge" :opts="opts" :chartData="chartData" />
  8. <view class="messageDataChartsText">
  9. <text>未读消息</text>
  10. </view>
  11. </view>
  12. <view class="msg_main">
  13. <view class="msg_main_com flex justify-between" style="margin-top:10px">
  14. <view class="msg_main_com_left">
  15. <image src="../../static/jnImage/powerPage/msgOne.png" mode=""></image>
  16. <text>电量类</text>
  17. </view>
  18. <view class="msg_main_com_right" style="background-color: #F14E51;">
  19. <text>88</text>
  20. </view>
  21. </view>
  22. <view class="msg_main_com flex justify-between" style="margin-top:10px">
  23. <view class="msg_main_com_left">
  24. <image src="../../static/jnImage/powerPage/msgTwo.png" mode=""></image>
  25. <text>安全生产</text>
  26. </view>
  27. <view class="msg_main_com_right" style="background-color: #F14E51;">
  28. <text>88</text>
  29. </view>
  30. </view>
  31. <view class="msg_main_com flex justify-between" style="margin-top:10px">
  32. <view class="msg_main_com_left">
  33. <image src="../../static/jnImage/powerPage/msgThree.png" mode=""></image>
  34. <text>公司公告</text>
  35. </view>
  36. <view class="msg_main_com_right" style="background-color: #F14E51;">
  37. <text>88</text>
  38. </view>
  39. </view>
  40. <view class="msg_main_com flex justify-between" style="margin-top:10px">
  41. <view class="msg_main_com_left">
  42. <image src="../../static/jnImage/powerPage/msgFour.png" mode=""></image>
  43. <text>会议通知</text>
  44. </view>
  45. <view class="msg_main_com_right" style="background-color: #F14E51;">
  46. <text>88</text>
  47. </view>
  48. </view>
  49. <view class="msg_main_com flex justify-between" style="margin-top:10px">
  50. <view class="msg_main_com_left">
  51. <image src="../../static/jnImage/powerPage/msgFive.png" mode=""></image>
  52. <text>其他消息</text>
  53. </view>
  54. <view class="msg_main_com_right" style="background-color: #F14E51;">
  55. <text>88</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. chartData: {},
  66. opts: {
  67. padding: undefined,
  68. title: {
  69. name: "66",
  70. fontSize: 50,
  71. color: "#fff",
  72. offsetY: -5
  73. },
  74. subtitle: {
  75. name: "",
  76. fontSize: 15,
  77. color: "#1890ff",
  78. offsetY: 0
  79. },
  80. extra: {
  81. gauge: {
  82. type: "progress",
  83. width: 20,
  84. labelColor: "#666666",
  85. startAngle: 0.75,
  86. endAngle: 0.25,
  87. startNumber: 0,
  88. endNumber: 100,
  89. labelFormat: "",
  90. splitLine: {
  91. fixRadius: -10,
  92. splitNumber: 10,
  93. width: 15,
  94. color: "#FFFFFF",
  95. childNumber: 5,
  96. childWidth: 12
  97. },
  98. pointer: {
  99. width: 24,
  100. color: "auto"
  101. }
  102. }
  103. }
  104. }
  105. }
  106. },
  107. onReady() {
  108. this.getServerData();
  109. },
  110. methods: {
  111. back() {
  112. this.$tab.navigateBack()
  113. },
  114. getServerData() {
  115. //模拟从服务器获取数据时的延时
  116. setTimeout(() => {
  117. let res = {
  118. categories: [{
  119. "value": 0.2,
  120. "color": "#1890ff"
  121. }, {
  122. "value": 0.8,
  123. "color": "#2fc25b"
  124. }, {
  125. "value": 1,
  126. "color": "#f04864"
  127. }],
  128. series: [{
  129. name: "完成率",
  130. data: 0.66
  131. }]
  132. };
  133. this.opts.title.name = '50'
  134. this.chartData = JSON.parse(JSON.stringify(res));
  135. }, 500);
  136. },
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. page {
  142. background-color: #202246;
  143. }
  144. .messageData {
  145. width: 100vw;
  146. background: url('../../static/jnImage/loginPage/windBack.png'), url('../../static/jnImage/loginPage/backWav.png');
  147. background-repeat: no-repeat, repeat;
  148. background-size: 100% 260px, 100% 5px;
  149. .box-bg {
  150. width: 100vw;
  151. padding: 5px 0;
  152. }
  153. .messageDataCharts {
  154. width: 100%;
  155. height: 300px;
  156. position: relative;
  157. .messageDataChartsText {
  158. width: 30%;
  159. height: 30px;
  160. line-height: 30px;
  161. background: #4287FF;
  162. border-radius: 15px;
  163. text-align: center;
  164. position: absolute;
  165. bottom: 30px;
  166. left: 35%;
  167. text {
  168. color: #fff;
  169. font-size: 30upx;
  170. }
  171. }
  172. }
  173. .msg_main {
  174. padding: 0 20px;
  175. .msg_main_com {
  176. padding: 10px;
  177. background-color: #3F4572;
  178. border-radius: 5px;
  179. .msg_main_com_left {
  180. image {
  181. width: 30px;
  182. height: 30px;
  183. position: relative;
  184. top: 1px;
  185. margin-right: 10px;
  186. }
  187. text {
  188. font-size: 30upx;
  189. color: #fff;
  190. position: relative;
  191. top: -8px;
  192. }
  193. }
  194. .msg_main_com_right {
  195. width: 25px;
  196. height: 25px;
  197. text-align: center;
  198. border-radius: 5px;
  199. position: relative;
  200. top: 6px;
  201. text {
  202. color: #fff;
  203. position: relative;
  204. top: 6px;
  205. }
  206. }
  207. }
  208. }
  209. }
  210. </style>