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

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