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

174 lines
4.2 KiB

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