family-list.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view class="user-setting-box">
  3. <!-- #ifndef MP-TOUTIAO -->
  4. <Navbar background-color="#fff" color="#333" title="家庭管理"></Navbar>
  5. <!-- #endif -->
  6. <view class="content">
  7. <view class="family-item" v-for="item in familyList" :key="item.fid" @click="toFamilyDetail(item)">
  8. <view class="left">
  9. <view class="name">{{item.familyName}}</view>
  10. <view class="info">
  11. <view>{{item.babyNumber}}个宝宝</view>
  12. <view>{{item.memberNumber}}个成员</view>
  13. </view>
  14. </view>
  15. <view class="right">
  16. <IconText :code="`\ue88e`" color="#94B2FF" size="16" class="icon"></IconText>
  17. </view>
  18. </view>
  19. <view class="add-btn" @click="toAddFamily">
  20. <IconText :code="`\ue899`" color="#fff" size="16" class="icon"></IconText>
  21. 新建家庭
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script lang="ts">
  27. import {
  28. Component,
  29. Mixins
  30. } from 'vue-property-decorator';
  31. import loginMixin from '@/common/mixins/loginMixin.ts';
  32. // import {
  33. // namespace
  34. // } from 'vuex-class';
  35. // const baseModule = namespace('base');
  36. @Component({})
  37. export default class SelectBaby extends Mixins(loginMixin) {
  38. // @baseModule.Getter('_userInfo') _userInfo: any;
  39. familyList: any = [{}];
  40. onShow() {
  41. this.getFamilyList();
  42. }
  43. getFamilyList() {
  44. this.$http
  45. .get({
  46. url: this.$api.getFamilyList
  47. })
  48. .then((res : any) => {
  49. this.familyList = res.list;
  50. }, (err : any) => {
  51. console.log(err);
  52. });
  53. }
  54. toFamilyDetail(item: any){
  55. this.$Router.push({
  56. path: '/packages/family/family-setting',
  57. query: {
  58. fid: item.fid
  59. }
  60. })
  61. }
  62. toAddFamily(){
  63. this.$Router.push({
  64. path: '/packages/family/add-family',
  65. })
  66. }
  67. handleStep(item: any){
  68. this.$Router.push({
  69. path: this.$Route.query.path,
  70. query: {
  71. fid: item.fid
  72. }
  73. })
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. page{
  79. background: #f5f5f5;
  80. }
  81. .user-setting-box {
  82. // background: #F5F5F5;
  83. height: 100vh;
  84. // @include flex-y(flex-start);
  85. .content {
  86. width: 100%;
  87. padding: 0 vw(15);
  88. box-sizing: border-box;
  89. @include flex-y(flex-start);
  90. padding-bottom: vw(50);
  91. .family-item{
  92. width: 100%;
  93. height: vw(80);
  94. @include flex-x();
  95. padding: vw(12) vw(18);
  96. box-sizing: border-box;
  97. background: #fff;
  98. border-radius: vw(10);
  99. margin-top: vw(10);
  100. .left{
  101. @include flex-y(center, flex-start);
  102. .name{
  103. @include word-vw(14, #333);
  104. font-weight: bold;
  105. }
  106. .info{
  107. @include flex-x(flex-start);
  108. @include word-vw(12, #999);
  109. margin-top: vw(5);
  110. view{
  111. margin-right: vw(5);
  112. }
  113. }
  114. }
  115. .right{
  116. }
  117. }
  118. .add-btn{
  119. @include wh(120, 44);
  120. border-radius: vw(22);
  121. background: #618EFF;
  122. @include flex-x(center);
  123. @include word-vw(14, #fff);
  124. box-shadow: 0px 6px 4px rgba(53, 106, 240, 0.15);
  125. margin-top: vw(32);
  126. .icon{
  127. margin-right: vw(3);
  128. }
  129. }
  130. }
  131. }
  132. </style>