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

166 lines
3.9 KiB

2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month 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 month ago
2 months ago
1 month 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="label1" v-if="state.baseInfo.info.userHhRole == 1">
  12. 初级伴宠师
  13. </view>
  14. <view class="label1" v-if="state.baseInfo.info.userHhRole == 2">
  15. 中级伴宠师
  16. </view>
  17. <view class="label1"v-if="state.baseInfo.info.userHhRole == 3">
  18. 高级伴宠师
  19. </view>
  20. <view class="flex font24">
  21. <view :style="{color:'#A55822'}">当前分成比例
  22. <text :style="{color:'#C12525'}">{{state.baseInfo.partner_new_num}}</text>
  23. </view>
  24. <view :style="{color:'#A55822'}">晋级后分成比例
  25. <text :style="{color:'#C12525'}">{{state.baseInfo.partner_upgrade_num}}</text>
  26. </view>
  27. </view>
  28. <view class="color-a55 size-24 mt16" v-html="state.baseInfo.level_details">
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bind-main">
  34. <view class="bind-main-content">
  35. <view class="bind-main-list">
  36. <!-- <up-empty
  37. mode="list"
  38. width="300px"
  39. height="300px"
  40. icon="http://cdn.uviewui.com/uview/empty/car.png"
  41. /> -->
  42. <view class="bind-tabs">
  43. <up-tabs :list="list" :current="current" lineWidth="68rpx" :activeStyle="{
  44. color: '#000000',
  45. fontWeight: 'bold',
  46. transform: 'scale(1.05)'
  47. }" :inactiveStyle="{
  48. color: '#000000',
  49. transform: 'scale(1)'
  50. }" :itemStyle="{ height: '88rpx', padding: '0 100rpx' }" lineColor="#FFBF60" @click="tabClick">
  51. </up-tabs>
  52. </view>
  53. <view >
  54. <noOrder :list="state.list" v-if="state.state == 0" />
  55. <haveOrder :list="state.list" v-if="state.state == 1" />
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. <view style="margin-top: 17rpx; padding: 15rpx 29rpx; background-color: #FFF4E6; border-radius: 16rpx;" >
  61. <up-parse :content="configList.cumulative_reward_statement.paramValueArea" containerStyle="{
  62. color: '#A55822',
  63. fontSize: '22rpx',
  64. lineHeight: '29rpx',
  65. }"></up-parse>
  66. </view>
  67. </view>
  68. </template>
  69. <script setup>
  70. import {
  71. ref,
  72. reactive,
  73. onMounted,
  74. computed,
  75. } from "vue"
  76. import { onShow } from '@dcloudio/uni-app'
  77. import { useStore } from 'vuex'
  78. import haveOrder from "./components/haveOrder.vue"
  79. import noOrder from "./components/noOrder.vue"
  80. import {
  81. hhrMyUserList
  82. } from "@/api/home.js"
  83. import {
  84. binBaseInfo,
  85. bindCode,
  86. } from "@/api/home.js"
  87. const Store = useStore()
  88. const configList = computed(() => {
  89. return Store.getters.configList
  90. })
  91. const userInfo = computed(() => {
  92. return Store.getters.userInfo
  93. })
  94. const code = ref('asdasaadsdsa')
  95. const url = ref('https://uview-plus.jiangruyi.com/components/button.html')
  96. const current = ref(0)
  97. const list = reactive([{
  98. name: '未下单'
  99. },
  100. {
  101. name: '已下单'
  102. },
  103. ]);
  104. const state = reactive({
  105. list: [],
  106. page: {
  107. pageNumber: 1,
  108. pageSize: 100
  109. },
  110. state: 0,
  111. info: {},
  112. baseInfo: {}
  113. })
  114. onShow(() => {
  115. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  116. getBaseInfo()
  117. getList()
  118. })
  119. const getBaseInfo = () => {
  120. binBaseInfo(state.info.userId).then(res => {
  121. state.baseInfo = res.data
  122. })
  123. bindCode(state.info.userId).then(res => {
  124. state.code = {
  125. ...cardData,
  126. code: res.data.code
  127. }
  128. state.posterUrl = res.data.url
  129. })
  130. }
  131. const getList = async () => {
  132. const {content} = await hhrMyUserList({
  133. ...state.page,
  134. state: state.state,
  135. appUserId: state.info.userId
  136. })
  137. // if (code === 200) {
  138. state.list = [...content]
  139. // }
  140. }
  141. const tabClick = (item) => {
  142. state.state = item.index
  143. getList()
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. @import "index";
  148. </style>