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

144 lines
3.9 KiB

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