index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="hdetail" :style="'padding-top:'+nvaHeight+'px;'">
  3. <view class="navbox">
  4. <uni-nav-bar color="#ffffff" left-icon="left" title="积分商城" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true" @clickLeft="getBackFn">
  5. </uni-nav-bar>
  6. <!-- 家人 -->
  7. <view class="headbox flexc" :style="'backgroundColor:'+backgroundColor">
  8. <view class="htop" :class="tabval==idx?'act':''" v-for="(ite,idx) in list" :key="idx" @click="getTabFn(idx)">
  9. <view class="img"><image :src="heada" class="imaga"></image></view>
  10. <view class="tit">{{ite.tit}}</view>
  11. </view>
  12. <view class="htop" @click="getAddFn">
  13. <view class="img add"><image :src="addimg"></image></view>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- 主体 -->
  18. <view class="wymain" >
  19. </view>
  20. <loading></loading>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. components:{},
  26. data(){
  27. return{
  28. nvaHeight:44,
  29. // activeColor:'#A7CDF9',
  30. // nactiveColor:'#DADADA',
  31. backgroundColor: "transparent",
  32. }
  33. },
  34. watch:{
  35. lookfalg(val){
  36. if(val){
  37. }
  38. }
  39. },
  40. onPageScroll(e) {
  41. var scrollTop = Number(e.scrollTop);
  42. if (scrollTop > 0) {
  43. this.backgroundColor = '#48CC9A'
  44. } else {
  45. this.backgroundColor = 'transparent'
  46. }
  47. },
  48. onLoad: function() {
  49. uni.getSystemInfo({
  50. success: (e) => {
  51. this.nvaHeight = Number(e.statusBarHeight)+44;
  52. }
  53. })
  54. },
  55. methods:{
  56. getClose(){
  57. this.type="";
  58. },
  59. getCodeFn(){
  60. this.type='code'
  61. },
  62. getAddFn(){
  63. this.$tab.navigateTo(`/health/pages/health/add`)
  64. },
  65. getZhanFn(idx){
  66. this.zhanList[idx].zhanflag=!this.zhanList[idx].zhanflag
  67. },
  68. getBackFn(){
  69. uni.navigateBack({
  70. delta:1
  71. })
  72. },
  73. getCode(code){
  74. var idCard='123456789'
  75. const firstPart = idCard.slice(0, 1);
  76. // 生成中间8位的星号
  77. const middlePart = '*'.repeat(idCard.length-2);
  78. // 获取后4位
  79. const lastPart = idCard.slice(idCard.length-1);
  80. var s= firstPart + middlePart + lastPart;
  81. console.log(s)
  82. // return firstPart + middlePart + lastPart;
  83. },
  84. getTabFn(val){
  85. this.tabval=val;
  86. },
  87. getDataFn(){
  88. var params={
  89. pageSize:this.pageSize,
  90. pageNum: this.pageNum,
  91. }
  92. params.noticeType=this.tabidx
  93. getNoticeList(params).then(res=>{
  94. if(res.code==200){
  95. }else{
  96. this.$toast(res.msg)
  97. }
  98. })
  99. },
  100. }
  101. }
  102. </script>
  103. <style>
  104. page{background:#F4F6F8;}
  105. </style>
  106. <style lang="scss" scoped>
  107. .w100{width: 100%;}
  108. .hdetail{
  109. background: linear-gradient(180deg, #FFB132 0%, #FE5A0E 49%, #FFFFFF 100%) no-repeat;background-size: 100% 722rpx;min-height: 100vh;box-sizing: border-box;
  110. }
  111. .navbox{position: fixed;left: 0;right: 0;top: 0;z-index: 4; }
  112. .wymain{z-index: 2;position: relative;padding: 0 24rpx 24rpx;}
  113. </style>