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

178 lines
4.2 KiB

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