猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.5 KiB

2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
3 months ago
  1. <template>
  2. <view class="bind-user">
  3. <view class="bind-user-header">
  4. <view class="flex mb28" v-if="state.baseInfo && state.baseInfo.info">
  5. <up-image width="120rpx" height="120rpx"
  6. :src="state.baseInfo.info.userImage" shape="circle"></up-image>
  7. <view class="header-name">
  8. <view class="font32 mb20" :style="{ color: '#000', fontSize: '32rpx' }">
  9. {{state.baseInfo.info.userName}}
  10. </view>
  11. <view class="flex-rowl">
  12. <view class="label1 mr20">
  13. {{ state.baseInfo.partner_level }}
  14. </view>
  15. <view class="size-22" style="color: #B97132;">
  16. 已加入合伙人:{{state.baseInfo.partner_day}}
  17. </view>
  18. </view>
  19. <!-- <view class="flex font24">
  20. <view>当前分成比例
  21. <text>25%</text>
  22. </view>
  23. <view>晋级后分成比例
  24. <text>30%</text>
  25. </view>
  26. </view> -->
  27. </view>
  28. </view>
  29. </view>
  30. <view class="bind-main">
  31. <myData v-show="showFlag === 'data'"></myData>
  32. <levelInfo v-show="showFlag === 'level'"></levelInfo>
  33. </view>
  34. <view class="bind-user-foot flex-around">
  35. <view class="tab-bar flex-colc" @click="tabBarClick('data')">
  36. <up-image width="46rpx" height="46rpx" :src="tabBarList[dataNum]"></up-image>
  37. <view class="size-24 color-999" :class="{ activeColor: dataNum === 1 }">我的数据</view>
  38. </view>
  39. <view class="tab-bar flex-colc" @click="tabBarClick('level')">
  40. <up-image width="46rpx" height="46rpx" :src="tabBarList[levelNum]"></up-image>
  41. <view :class="['size-24', 'color-999', { activeColor: levelNum === 3 }]">等级信息</view>
  42. </view>
  43. </view>
  44. <!-- <view class="bind-main">
  45. <up-swiper
  46. :list="list3"
  47. previousMargin="30"
  48. nextMargin="30"
  49. circular
  50. :autoplay="false"
  51. radius="10"
  52. bgColor="#FFBF60"
  53. height="300rpx"
  54. ></up-swiper>
  55. </view> -->
  56. </view>
  57. </template>
  58. <script setup>
  59. import myData from './commponents/myData.vue'
  60. import levelInfo from './commponents/levelInfo.vue'
  61. import {
  62. reactive,
  63. ref,
  64. onMounted
  65. } from "vue";
  66. import {
  67. binBaseInfo,
  68. bindCode
  69. } from "@/api/home.js"
  70. const tabBarList = reactive([
  71. '/static/images/levelTabBar/data.png',
  72. '/static/images/levelTabBar/data_.png',
  73. '/static/images/levelTabBar/level.png',
  74. '/static/images/levelTabBar/level_.png',
  75. ])
  76. const dataNum = ref(1)
  77. const levelNum = ref(2)
  78. const showFlag = ref('data')
  79. // const list3 = reactive([
  80. // 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  81. // 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  82. // 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  83. // ]);
  84. // const code = ref('asdasaadsdsa')
  85. // const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
  86. const state = reactive({
  87. info: {},
  88. baseInfo: {}
  89. })
  90. onMounted(() => {
  91. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  92. getBaseInfo()
  93. })
  94. const getBaseInfo = () => {
  95. binBaseInfo(state.info.userId).then(res => {
  96. state.baseInfo = res.data
  97. })
  98. bindCode(state.info.userId).then(res => {
  99. state.code = {
  100. ...cardData,
  101. code: res.data.code
  102. }
  103. state.posterUrl = res.data.url
  104. })
  105. }
  106. const tabBarClick = (flag) => {
  107. showFlag.value = flag
  108. switch (flag) {
  109. case 'data':
  110. dataNum.value = 1
  111. levelNum.value = 2
  112. break;
  113. case 'level':
  114. dataNum.value = 0
  115. levelNum.value = 3
  116. break;
  117. default:
  118. break;
  119. }
  120. }
  121. </script>
  122. <style scoped lang="scss">
  123. @import "index";
  124. </style>