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

152 lines
3.4 KiB

3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
1 month ago
3 weeks ago
2 weeks ago
3 weeks ago
1 month ago
3 weeks ago
3 weeks ago
3 weeks ago
3 weeks ago
1 month ago
3 weeks ago
1 month ago
3 weeks ago
3 weeks ago
3 weeks 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. } from "vue"
  66. import { useStore } from 'vuex'
  67. import haveOrder from "./components/haveOrder.vue"
  68. import noOrder from "./components/noOrder.vue"
  69. import {
  70. hhrMyUserList
  71. } from "@/api/home.js"
  72. import {
  73. binBaseInfo,
  74. bindCode,
  75. computed,
  76. } from "@/api/home.js"
  77. const store = useStore()
  78. const configList = computed(() => {
  79. return store.getters.configList
  80. })
  81. const code = ref('asdasaadsdsa')
  82. const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
  83. const current = ref(0)
  84. const list = reactive([{
  85. name: '未下单'
  86. },
  87. {
  88. name: '已下单'
  89. },
  90. ]);
  91. const state = reactive({
  92. list: [],
  93. page: {
  94. pageNumber: 1,
  95. pageSize: 100
  96. },
  97. state: 0,
  98. info: {},
  99. baseInfo: {}
  100. })
  101. onMounted(() => {
  102. getList()
  103. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  104. getBaseInfo()
  105. })
  106. const getBaseInfo = () => {
  107. binBaseInfo(state.info.userId).then(res => {
  108. state.baseInfo = res.data
  109. })
  110. bindCode(state.info.userId).then(res => {
  111. state.code = {
  112. ...cardData,
  113. code: res.data.code
  114. }
  115. state.posterUrl = res.data.url
  116. })
  117. }
  118. const getList = async () => {
  119. const {
  120. code,
  121. data
  122. } = await hhrMyUserList({
  123. ...state.page,
  124. state: state.state,
  125. appUserId: state.info.userId
  126. })
  127. if (code === 200) {
  128. state.list = [...data]
  129. }
  130. }
  131. const tabClick = (item) => {
  132. state.state = item.index
  133. getList()
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. @import "index";
  138. </style>