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

157 lines
3.4 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
2 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 style="margin-top: 17rpx; padding: 15rpx 29rpx; background-color: #FFF4E6; border-radius: 16rpx;" >
  52. <up-parse :content="configList.cumulative_reward_statement.paramValueArea" containerStyle="{
  53. color: '#A55822',
  54. fontSize: '22rpx',
  55. lineHeight: '29rpx',
  56. }"></up-parse>
  57. </view>
  58. </view>
  59. </template>
  60. <script setup>
  61. import {
  62. ref,
  63. reactive,
  64. onMounted,
  65. computed,
  66. } from "vue"
  67. import { useStore } from 'vuex'
  68. import haveOrder from "./components/haveOrder.vue"
  69. import noOrder from "./components/noOrder.vue"
  70. import {
  71. hhrMyUserList
  72. } from "@/api/home.js"
  73. import {
  74. binBaseInfo,
  75. bindCode,
  76. } from "@/api/home.js"
  77. const Store = useStore()
  78. const configList = computed(() => {
  79. return Store.getters.configList
  80. })
  81. const userInfo = computed(() => {
  82. return Store.getters.userInfo
  83. })
  84. const code = ref('asdasaadsdsa')
  85. const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
  86. const current = ref(0)
  87. const list = reactive([{
  88. name: '未下单'
  89. },
  90. {
  91. name: '已下单'
  92. },
  93. ]);
  94. const state = reactive({
  95. list: [],
  96. page: {
  97. pageNumber: 1,
  98. pageSize: 100
  99. },
  100. state: 0,
  101. info: {},
  102. baseInfo: {}
  103. })
  104. onMounted(() => {
  105. getList()
  106. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  107. getBaseInfo()
  108. })
  109. const getBaseInfo = () => {
  110. binBaseInfo(state.info.userId).then(res => {
  111. state.baseInfo = res.data
  112. })
  113. bindCode(state.info.userId).then(res => {
  114. state.code = {
  115. ...cardData,
  116. code: res.data.code
  117. }
  118. state.posterUrl = res.data.url
  119. })
  120. }
  121. const getList = async () => {
  122. const {
  123. code,
  124. data
  125. } = await hhrMyUserList({
  126. ...state.page,
  127. state: state.state,
  128. appUserId: state.info.userId
  129. })
  130. if (code === 200) {
  131. state.list = [...data]
  132. }
  133. }
  134. const tabClick = (item) => {
  135. state.state = item.index
  136. getList()
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. @import "index";
  141. </style>