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

132 lines
3.4 KiB

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