index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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="plr12">
  12. <view class="htop">
  13. <view class="flexcj plr15 mb6">
  14. <view class="tit">健康档案</view>
  15. <view class="more" @click="getMoreFn">查看更多</view>
  16. </view>
  17. <view class="txt plr15 mb12">点击查看更多,关爱家人健康~</view>
  18. <view class="hswiper">
  19. <view class="hslist ">
  20. <image :src="hbga" class="imga"></image>
  21. <view class="hsbox flexat">
  22. <view class="line"></view>
  23. <view class="flex1">
  24. <view class="name flexat">袁玥<view>业主</view></view>
  25. <view class="txt">38岁/B型</view>
  26. <view class="txt">165cm/67kg</view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="hslist bgb">
  31. <image :src="hbgb" class="imga"></image>
  32. <view class="hsbox flexat">
  33. <view class="line"></view>
  34. <view class="flex1">
  35. <view class="name flexat">袁玥<view>丈夫</view></view>
  36. <view class="txt">38岁/B型</view>
  37. <view class="txt">165cm/67kg</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <image :src="hbgc" class="moreimg"></image>
  44. </view>
  45. <view class="contbox">
  46. <view class="cont flexc mb9">
  47. <view class="line"></view>
  48. <view class="flex1 tit">健康资讯</view>
  49. <view class="morebox">
  50. <view class="flexc">更多<image :src="more"></image>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="hlists">
  55. <box-list :datainfo="list" :wtdt="wtdt" type='health'></box-list>
  56. </view>
  57. </view>
  58. </view>
  59. <loading></loading>
  60. <footers v-if="isfootflag" :footerindex="footerindex"></footers>
  61. </view>
  62. </template>
  63. <script>
  64. import footers from '@/components/footer/footer.vue'
  65. import boxList from "@/components/box/list.vue"
  66. export default {
  67. components: {
  68. footers,
  69. boxList
  70. },
  71. data() {
  72. return {
  73. footerindex: 'health',
  74. isfootflag: true,
  75. nvaHeight: 44,
  76. // activeColor:'#A7CDF9',
  77. // nactiveColor:'#DADADA',
  78. backgroundColor: "transparent",
  79. navbg: require("@/static/images/health/hbg.png"),
  80. hbga:require("@/static/images/health/hbga.png"),
  81. hbgb:require("@/static/images/health/hbgb.png"),
  82. hbgc:require("@/static/images/health/hbgc.png"),
  83. more: require("@/static/images/health/more.png"),
  84. zhanflag: true,
  85. pageSize: 10,
  86. pageNum: 1,
  87. reachflag: true,
  88. wtdt: '',
  89. list: [{
  90. noticeTitle: "您有1条报修信息,请及时查看处理!",
  91. num: '4'
  92. }, {
  93. noticeTitle: "您有1条报修信息,请及时查看处理!",
  94. num: '12'
  95. }],
  96. }
  97. },
  98. onPageScroll(e) {
  99. var scrollTop = Number(e.scrollTop);
  100. if (scrollTop > 0) {
  101. this.backgroundColor = '#48CC9A'
  102. } else {
  103. this.backgroundColor = 'transparent'
  104. }
  105. },
  106. // 上拉触底加载更多触发事件
  107. onReachBottom() {
  108. if (this.reachflag) {
  109. this.pageNum++
  110. this.getDataFn()
  111. }
  112. },
  113. onLoad: function() {
  114. uni.getSystemInfo({
  115. success: (e) => {
  116. this.nvaHeight = Number(e.statusBarHeight) + 44;
  117. }
  118. })
  119. },
  120. methods: {
  121. getMoreFn() {
  122. this.$tab.navigateTo(`/health/pages/health/detail`)
  123. },
  124. getDataFn() {
  125. return
  126. var params = {
  127. pageSize: this.pageSize,
  128. pageNum: this.pageNum,
  129. }
  130. params.noticeType = this.tabidx
  131. getNoticeList(params).then(res => {
  132. if (res.code == 200) {
  133. if (res.rows.length < this.pageSize) {
  134. this.reachflag = false
  135. this.wtdt = '到底了~';
  136. } else {
  137. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum -
  138. 1)
  139. if (num < res.total) {
  140. this.reachflag = true
  141. this.wtdt = ''
  142. } else {
  143. this.reachflag = false
  144. this.wtdt = '到底了~';
  145. }
  146. }
  147. if (this.pageNum == 1) {
  148. this.list = res.rows;
  149. } else {
  150. this.list = this.list.concat(res.rows)
  151. }
  152. } else {
  153. this.$toast(res.msg)
  154. }
  155. })
  156. },
  157. }
  158. }
  159. </script>
  160. <style>
  161. page {
  162. background: #F4F6F8;
  163. }
  164. </style>
  165. <style lang="scss" scoped>
  166. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  167. .navbg{width: 100%;height: 688rpx;}
  168. .wymain{z-index: 2;position: relative;padding-top: 244rpx;}
  169. .htop{background: #FFFFFF;padding: 22rpx 0 32rpx;
  170. border-radius: 20rpx;margin-bottom: 28rpx;
  171. .tit{font-weight: bold;font-size: 32rpx;color: #272727;}
  172. .more{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
  173. .txt{font-weight: 500;font-size: 24rpx;color: #666666;}
  174. .hswiper{flex-wrap: nowrap;display: flex;align-items: center;overflow: auto;padding-left:32rpx;padding-right: 8rpx;
  175. .hslist{margin-right: 24rpx;width: 384rpx;height: 174rpx;position: relative;
  176. .imga{width: 384rpx;height: 174rpx;}
  177. .hsbox{position: absolute;left: 0;top: 0;right: 0;bottom: 0;padding:26rpx 24rpx 0rpx;
  178. .line{width: 8rpx;height: 30rpx;border-radius: 4rpx;margin-right: 16rpx;flex: 0 0 auto;margin-top: 6rpx;background: #FF9E00;
  179. // &.bga{}
  180. // &.bgb{background: #45CB99;}
  181. }
  182. .name{font-weight: bold;font-size: 32rpx;color: #FFFFFF;margin-bottom: 12rpx;
  183. view{font-weight: bold;border-radius: 16rpx;border: 2rpx solid #FFFFFF;color: #FFFFFF;
  184. font-size: 22rpx;margin-left: 18rpx;padding: 0 8rpx;margin-top: 4rpx;
  185. }
  186. }
  187. .txt{font-weight: 500;font-size: 24rpx;color: #FFFFFF;line-height: 36rpx;}
  188. }
  189. &.bgb{
  190. .line{background: #45CB99;}
  191. .name{color: #272727;
  192. view{border: 2rpx solid #FF9E00;color: #FF9E00;}
  193. }
  194. .txt{color: #666666;}
  195. }
  196. }
  197. }
  198. }
  199. .moreimg{width: 100%;height: 150rpx;margin-bottom: 34rpx;}
  200. .hlists{margin: 0 24rpx 20rpx;
  201. background: #FFFFFF;padding: 0 12rpx;border-radius: 20rpx;
  202. }
  203. .contbox{padding-top: 6rpx;
  204. .cont{margin-bottom: 12rpx;position: relative;
  205. .line{width: 14rpx;height: 48rpx;margin-right: 22rpx;border-radius: 0 24rpx 24rpx 0;background-color: #45CB99;}
  206. .tit{font-size: 15px;color: #272727;font-weight: bold;}
  207. .morebox{padding-right: 24rpx;
  208. image{width: 18rpx;height: 16rpx;margin-left: 16rpx;}
  209. view{font-size: 24rpx;color: #AAAAAA;}
  210. }
  211. }
  212. }
  213. </style>