猫妈狗爸伴宠师小程序前端代码
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.

146 lines
4.0 KiB

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