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

136 lines
2.9 KiB

2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
2 months ago
2 months ago
2 months ago
3 months ago
2 months ago
2 months ago
3 months ago
2 months ago
3 months ago
2 months ago
2 months ago
2 months 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.info.userImage" shape="circle"></up-image>
  6. <view class="header-name">
  7. <view class="font32 mb20 color-040">{{ state.baseInfo.info.userName }}</view>
  8. <view class="label1">
  9. {{ state.baseInfo.partner_level }}
  10. </view>
  11. <!-- <view class="flex font24">
  12. <view style="color: #B97132;">当前分成比例:
  13. <text style="color: #CD4732;">25%</text>
  14. </view>
  15. <view class="ml28" style="color: #B97132;">晋级后分成比例:
  16. <text style="color: #CD4732;">30%</text>
  17. </view>
  18. </view> -->
  19. <view class="color-a55 size-24 mt16" v-html="state.baseInfo.level_details">
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="bind-main">
  25. <view class="bind-main-content">
  26. <view class="bind-main-list">
  27. <!-- <up-empty
  28. mode="list"
  29. width="300px"
  30. height="300px"
  31. icon="http://cdn.uviewui.com/uview/empty/car.png"
  32. /> -->
  33. <view class="bind-tabs">
  34. <up-tabs :list="list" :current="current" lineWidth="68rpx" :activeStyle="{
  35. color: '#000000',
  36. fontWeight: 'bold',
  37. transform: 'scale(1.05)'
  38. }" :inactiveStyle="{
  39. color: '#000000',
  40. transform: 'scale(1)'
  41. }" :itemStyle="{ height: '88rpx', padding: '0 100rpx' }" lineColor="#FFBF60" @click="tabClick">
  42. </up-tabs>
  43. </view>
  44. <view >
  45. <noOrder :list="state.list" v-if="state.state == 0" />
  46. <haveOrder :list="state.list" v-if="state.state == 1" />
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup>
  54. import {
  55. ref,
  56. reactive,
  57. onMounted
  58. } from "vue"
  59. import haveOrder from "./components/haveOrder.vue"
  60. import noOrder from "./components/noOrder.vue"
  61. import {
  62. hhrMyUserList
  63. } from "@/api/home.js"
  64. import {
  65. binBaseInfo,
  66. bindCode
  67. } from "@/api/home.js"
  68. const code = ref('asdasaadsdsa')
  69. const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
  70. const current = ref(0)
  71. const list = reactive([{
  72. name: '未下单'
  73. },
  74. {
  75. name: '已下单'
  76. },
  77. ]);
  78. const state = reactive({
  79. list: [],
  80. page: {
  81. pageNumber: 1,
  82. pageSize: 100
  83. },
  84. state: 0,
  85. info: {},
  86. baseInfo: {}
  87. })
  88. onMounted(() => {
  89. getList()
  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 getList = async () => {
  106. const {
  107. code,
  108. data
  109. } = await hhrMyUserList({
  110. ...state.page,
  111. state: state.state,
  112. appUserId: state.info.userId
  113. })
  114. if (code === 200) {
  115. state.list = [...data]
  116. }
  117. }
  118. const tabClick = (item) => {
  119. state.state = item.index
  120. getList()
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. @import "index";
  125. </style>