index.vue 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <view :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" :background-color="backgroundColor" :border="false" statusBar='true'
  5. fixed="true">
  6. </uni-nav-bar>
  7. </view>
  8. <!-- 主体 -->
  9. <image :src="navbg" class="navbg"></image>
  10. <view class="wymain">
  11. <view class="pdlr12">
  12. <view class="topbox flexc mb12" @click="getBookFn">
  13. <image :src="heabox" class="heabox flex0"></image>
  14. <view class="tit flex1">居民健康档案</view>
  15. <image :src="rimg" class="rimg flex0"></image>
  16. </view>
  17. <view class="counts mb12">
  18. <view class="tit mb5">居民年龄段分布(人)</view>
  19. <view class="txt mb10">更新时间:2024-11-25</view>
  20. <!-- 数据图 -->
  21. <view>
  22. <qiun-data-charts type="ring" :chartData="chartDataa" :opts='optsa'></qiun-data-charts>
  23. </view>
  24. </view>
  25. <view class="counts mb12">
  26. <view class="tit mb5">居民各年龄段性别分布</view>
  27. <view class="txt mb10">更新时间:2024-11-25</view>
  28. <!-- 数据图 -->
  29. <view>
  30. <qiun-data-charts type="area" :chartData="chartDatab" :opts='optsb'></qiun-data-charts>
  31. </view>
  32. </view>
  33. <view class="counts mb12">
  34. <view class="tit mb5">居民血型分布</view>
  35. <view class="txt mb10">更新时间:2024-11-25</view>
  36. <!-- 数据图 -->
  37. <view >
  38. <!-- <l-echart ref="chartc"></l-echart> -->
  39. <qiun-data-charts type="rose" :chartData="chartDatac" :opts='optsc'></qiun-data-charts>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="contbox">
  44. <view class="cont flexc mb9">
  45. <view class="line"></view>
  46. <view class="flex1 tit">健康资讯</view>
  47. <view class="morebox">
  48. <view class="flexc">更多<image :src="more"></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="hlists">
  53. <box-list :datainfo="list" :wtdt="wtdt" type='health'></box-list>
  54. </view>
  55. </view>
  56. </view>
  57. <loading></loading>
  58. <footers v-if="isfootflag" :footerindex="footerindex"></footers>
  59. </view>
  60. </template>
  61. <script>
  62. import footers from '@/components/footer/footer.vue'
  63. import boxList from "@/components/box/list.vue"
  64. export default {
  65. components: {
  66. footers,
  67. boxList
  68. },
  69. data() {
  70. return {
  71. footerindex: 'health',
  72. isfootflag: true,
  73. nvaHeight: 44,
  74. // activeColor:'#A7CDF9',
  75. // nactiveColor:'#DADADA',
  76. backgroundColor: "transparent",
  77. navbg: require("@/static/images/health/hbg.png"),
  78. heabox: require("@/static/images/health/heabox.png"),
  79. rimg: require("@/static/images/health/rimg.png"),
  80. more: require("@/static/images/health/more.png"),
  81. zhanflag: true,
  82. pageSize: 10,
  83. pageNum: 1,
  84. reachflag: true,
  85. wtdt: '',
  86. chartDataa: {
  87. "categories": [],
  88. series: [{
  89. data: [{
  90. "name": "01~10",
  91. "value": 50,
  92. labelShow: false
  93. },
  94. {
  95. "name": "11~20",
  96. "value": 30,
  97. labelShow: false
  98. },
  99. {
  100. "name": "21~30",
  101. "value": 20,
  102. labelShow: false
  103. },
  104. {
  105. "name": "31~40",
  106. "value": 18,
  107. labelShow: false
  108. },
  109. {
  110. "name": "41~50",
  111. "value": 50,
  112. labelShow: false
  113. },
  114. {
  115. "name": "51~60",
  116. "value": 30,
  117. labelShow: false
  118. },
  119. {
  120. "name": "61~70",
  121. "value": 20,
  122. labelShow: false
  123. },
  124. {
  125. "name": "71~80",
  126. "value": 18,
  127. labelShow: false
  128. },
  129. {
  130. "name": "81~90",
  131. "value": 50,
  132. labelShow: false
  133. },
  134. {
  135. "name": "91~100",
  136. "value": 30,
  137. labelShow: false
  138. },
  139. {
  140. "name": "100以上",
  141. "value": 20,
  142. labelShow: false
  143. },
  144. ]
  145. }],
  146. "enableScroll": false
  147. },
  148. optsa: {
  149. padding: [0, 0, 0, 0],
  150. color: ["#5989F8", "#B7DE5A", "#FAC858", "#EE6666", "#73C0DE", "#3BA272", "#FF8045", "#9A60B4",
  151. "#ea7ccc", "#5470C6", "#45CB99"
  152. ],
  153. title: {
  154. name: "总计",
  155. fontSize: 12,
  156. color: "#666666",
  157. },
  158. legend: {
  159. // show: false,
  160. position: "bottom",
  161. padding: 0,
  162. margin: 0,
  163. },
  164. // 副标题
  165. subtitle: {
  166. name: "5884",
  167. fontSize: 22,
  168. color: "#46CB99"
  169. },
  170. extra: {
  171. ring: {
  172. ringWidth: 20,
  173. borderWidth:1,
  174. borderRadius:30
  175. },
  176. }
  177. },
  178. chartDatab: {
  179. categories: ["1-10", "11-20", "21-30", "31-40", "41-50", "51-60", "61-70", "71-80", "81-90", "91-100",
  180. "100以上"
  181. ],
  182. series: [{
  183. name: "女性",
  184. data: [35, 8, 25, 37, 4, 20]
  185. },
  186. {
  187. name: "男性",
  188. data: [70, 40, 65, 100, 44, 68]
  189. },
  190. ]
  191. },
  192. optsb: {
  193. color: ["#5169CF", "#92CE78", ],
  194. padding: [0, 0, 0, 0],
  195. enableScroll: false,
  196. legend: {
  197. float:'right',
  198. position: "top",
  199. padding: 0,
  200. margin: 20,
  201. },
  202. xAxis: {
  203. disableGrid: true,
  204. fontSize:10
  205. },
  206. yAxis: {
  207. gridType:'dash',
  208. gridColor:'#CCCCCC',
  209. dashLength:8,
  210. splitNumber:5,
  211. min:10,
  212. max:180,
  213. data:[{
  214. axisLine:false
  215. }]
  216. },
  217. extra: {
  218. area: {
  219. type: "straight",
  220. opacity: 0.2,
  221. addLine: true,
  222. width: 2,
  223. gradient: false,
  224. activeType: "hollow"
  225. }
  226. }
  227. },
  228. chartDatac: {
  229. series: [{
  230. data: [{
  231. "name": "A型","labelText":"A型","value": 50,
  232. }, {
  233. "name": "B型","labelText":"B型","value": 30,
  234. }, {
  235. "name": "AB型","labelText":"AB型","value": 20
  236. }, {
  237. "name": "O型","labelText":"O型","value": 18
  238. }, {
  239. "name": "RH阴性","labelText":"RH阴性","value": 8
  240. }, {
  241. "name": "RH阳性","labelText":"RH阳性","value": 8
  242. }]
  243. }]
  244. },
  245. optsc: {
  246. color: ["#73C0DE", "#FC8452", "#9A60B4", "#EA7CCC", "#5470C6", "#91CC75", ],
  247. padding: [0, 0, 0, 0],
  248. enableScroll: false,
  249. legend: {
  250. show: true,
  251. position: "left",
  252. lineHeight: 25
  253. },
  254. extra: {
  255. rose: {
  256. type: "area",
  257. minRadius: 50,
  258. activeOpacity: 0.5,
  259. activeRadius: 10,
  260. offsetAngle: 0,
  261. labelWidth: 15,
  262. border: false,
  263. borderWidth: 2,
  264. borderColor: "#FFFFFF"
  265. }
  266. }
  267. },
  268. optionc: {
  269. legend: {
  270. top: 'bottom'
  271. },
  272. series: [{
  273. name: '居民血型分布',
  274. type: 'area',
  275. radius: [15, 100],
  276. center: ['50%', '50%'],
  277. roseType: 'area',
  278. itemStyle: {
  279. borderRadius: 8
  280. },
  281. data: [{
  282. value: 40,
  283. name: 'A型'
  284. },
  285. {
  286. value: 38,
  287. name: 'B型'
  288. },
  289. {
  290. value: 32,
  291. name: 'O型'
  292. },
  293. {
  294. value: 30,
  295. name: 'RH阴性'
  296. },
  297. {
  298. value: 28,
  299. name: 'RH阳性'
  300. },
  301. ]
  302. }]
  303. },
  304. list: [{
  305. noticeTitle: "您有1条报修信息,请及时查看处理!",
  306. num: '4'
  307. }, {
  308. noticeTitle: "您有1条报修信息,请及时查看处理!",
  309. num: '12'
  310. }],
  311. }
  312. },
  313. onPageScroll(e) {
  314. var scrollTop = Number(e.scrollTop);
  315. if (scrollTop > 0) {
  316. this.backgroundColor = '#48CC9A'
  317. } else {
  318. this.backgroundColor = 'transparent'
  319. }
  320. },
  321. // 上拉触底加载更多触发事件
  322. onReachBottom() {
  323. if (this.reachflag) {
  324. this.pageNum++
  325. this.getDataFn()
  326. }
  327. },
  328. onLoad: function() {
  329. uni.getSystemInfo({
  330. success: (e) => {
  331. this.nvaHeight = Number(e.statusBarHeight) + 44;
  332. }
  333. })
  334. },
  335. methods: {
  336. getBookFn() {
  337. this.$tab.navigateTo(`/health/pages/health/index`)
  338. },
  339. getDataFn() {
  340. return
  341. var params = {
  342. pageSize: this.pageSize,
  343. pageNum: this.pageNum,
  344. }
  345. params.noticeType = this.tabidx
  346. getNoticeList(params).then(res => {
  347. if (res.code == 200) {
  348. if (res.rows.length < this.pageSize) {
  349. this.reachflag = false
  350. this.wtdt = '到底了~';
  351. } else {
  352. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  353. 1)
  354. if (num < res.total) {
  355. this.reachflag = true
  356. this.wtdt = ''
  357. } else {
  358. this.reachflag = false
  359. this.wtdt = '到底了~';
  360. }
  361. }
  362. if (this.pageNum == 1) {
  363. this.list = res.rows;
  364. } else {
  365. this.list = this.list.concat(res.rows)
  366. }
  367. } else {
  368. this.$toast(res.msg)
  369. }
  370. })
  371. },
  372. }
  373. }
  374. </script>
  375. <style>
  376. page {
  377. background: #F4F6F8;
  378. }
  379. </style>
  380. <style lang="scss" scoped>
  381. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  382. .navbg{width: 100%;height: 688rpx;}
  383. .wymain{z-index: 2;position: relative;padding-top: 244rpx;}
  384. .topl{overflow: hidden;padding-left: 16rpx;
  385. image{width: 18rpx;height: 22rpx;margin-right: 14rpx;flex: 0 0 auto;}
  386. view{font-weight: bold;font-size: 26rpx;color: #272727;}
  387. }
  388. .topbox{height: 112rpx;background: #FFFFFF;border-radius: 20rpx;padding: 26rpx 18rpx;box-sizing: border-box;
  389. .heabox{width: 72rpx;height: 70rpx;margin-right: 10rpx;}
  390. .tit{font-weight: bold;font-size: 28rpx;color: #272727;}
  391. .rimg{width: 14rpx;height: 24rpx;}
  392. }
  393. .counts{
  394. background: #FFFFFF;padding: 24rpx;border-radius: 20rpx;
  395. .tit{font-weight: bold;font-size: 32rpx;color: #272727;}
  396. .txt{font-weight: 500;font-size: 22rpx;color: #AAAAAA;}
  397. }
  398. .hlists{margin: 0 24rpx 20rpx;
  399. background: #FFFFFF;padding: 0 12rpx;border-radius: 20rpx;
  400. }
  401. .contbox{padding-top: 6rpx;
  402. .cont{margin-bottom: 12rpx;position: relative;
  403. .line{width: 14rpx;height: 48rpx;margin-right: 22rpx;border-radius: 0 24rpx 24rpx 0;background-color: #45CB99;}
  404. .tit{font-size: 15px;color: #272727;font-weight: bold;}
  405. .morebox{padding-right: 24rpx;
  406. image{width: 18rpx;height: 16rpx;margin-left: 16rpx;}
  407. view{font-size: 24rpx;color: #AAAAAA;}
  408. }
  409. }
  410. }
  411. </style>