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

205 lines
5.0 KiB

2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 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 ml20 ">
  5. <up-image width="140rpx" height="140rpx" :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" v-if="state.baseInfo.info.userHhRole == 1">
  9. 初级伴宠师
  10. </view>
  11. <view class="label1" v-if="state.baseInfo.info.userHhRole == 2">
  12. 中级伴宠师
  13. </view>
  14. <view class="label1"v-if="state.baseInfo.info.userHhRole == 3">
  15. 高级伴宠师
  16. </view>
  17. <view class="size-22" style="color: #B97132;">
  18. 已加入合伙人:{{state.baseInfo.partner_day}}
  19. </view>
  20. <view class="flex font24">
  21. <view style="color: #B97132;">当前分成比例
  22. <text style="color: #CD4732;">{{state.baseInfo.partner_new_num}}</text>
  23. </view>
  24. <view style="color: #B97132;">晋级后分成比例
  25. <text style="color: #CD4732;">{{state.baseInfo.partner_upgrade_num}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="bind-main">
  32. <view class="bind-main-content">
  33. <view class="top box-size mb20" :style="{borderRadius:'16rpx'}">
  34. <view class="level account">
  35. <view class="fw700">
  36. 钱包余额
  37. </view>
  38. <view class="level text">
  39. <view @click="handleGoto('detail')">
  40. 明细
  41. </view>
  42. <view class="line" @click="handleGoto('cash')">
  43. 提现
  44. </view>
  45. </view>
  46. </view>
  47. <view class="money level fw700">
  48. <text class="text1">
  49. ¥
  50. </text>
  51. <text style="color: #FF2A2A; font-size: 36rpx;">{{state.baseInfo.money}}</text>
  52. </view>
  53. <view class="line1">
  54. </view>
  55. <view class="level divide">
  56. <view class="level flex-rowl">
  57. <view >
  58. 本月订单分成:&nbsp;&nbsp;
  59. </view>
  60. ¥<view >
  61. {{state.baseInfo.new_money}}
  62. </view>
  63. </view>
  64. <view class="level flex-rowl">
  65. <view >
  66. 累积订单分成:&nbsp;&nbsp;
  67. </view>
  68. ¥<view >
  69. {{state.baseInfo.old_money}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="my-data">
  75. <view class="my-data-total">
  76. <cardTitle :cardTitle="mounthName"></cardTitle>
  77. <cardData :cardData="state.nounthData"></cardData>
  78. </view>
  79. </view>
  80. <view class="my-data">
  81. <view class="my-data-total">
  82. <cardTitle :cardTitle="totalName"></cardTitle>
  83. <cardData :cardData="state.totalData"></cardData>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script setup>
  91. import tab from "@/plugins/tab.js"
  92. import cardTitle from '../components/cardTitle.vue'
  93. import cardData from '../components/cardData.vue'
  94. import {
  95. ref,
  96. reactive,
  97. onMounted
  98. } from "vue"
  99. import {
  100. binBaseInfo,
  101. bindCode
  102. } from "@/api/home.js"
  103. import { onShow } from '@dcloudio/uni-app'
  104. const mounthName = ref('本月数据')
  105. const totalName = ref('累计数据')
  106. const handleGoto = (val) => {
  107. switch (val) {
  108. case 'detail':
  109. tab.navigateTo('/otherPages/binding/partner/index')
  110. // tab.navigateTo('/otherPages/workbenchManage/bindUser/index')
  111. break;
  112. case 'cash':
  113. tab.navigateTo('/otherPages/binding/withdrawal/index')
  114. break;
  115. }
  116. }
  117. const state = reactive({
  118. info: {},
  119. baseInfo: {},
  120. nounthData: [],
  121. totalData: []
  122. })
  123. onShow(() => {
  124. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  125. getBaseInfo()
  126. })
  127. const getBaseInfo = () => {
  128. binBaseInfo(state.info.userId).then(res => {
  129. state.baseInfo = res.data
  130. state.nounthData = [{
  131. title: '本月注册用户',
  132. num: state.baseInfo.register_users,
  133. code: "register_users"
  134. },
  135. {
  136. title: '本月下单用户',
  137. num: state.baseInfo.register_users,
  138. code: "order_users"
  139. },
  140. {
  141. title: '本月有效用户',
  142. num: state.baseInfo.use_users,
  143. code: "use_users"
  144. },
  145. {
  146. title: '本月订单金额',
  147. num: `${state.baseInfo.order_users_money}`,
  148. color: 'red',
  149. code: "order_users_money"
  150. },
  151. {
  152. title: '本月有效订单金额',
  153. num: `${state.baseInfo.use_users_money}`,
  154. color: 'red',
  155. code: "use_users_money"
  156. },
  157. ]
  158. state.totalData = [{
  159. title: '累计注册用户',
  160. num: state.baseInfo.register_users_sum,
  161. code: "register_users_sum"
  162. },
  163. {
  164. title: '累计下单用户',
  165. num: state.baseInfo.order_users_sum,
  166. code: "order_users_sum"
  167. },
  168. {
  169. title: '累计有效用户',
  170. num: state.baseInfo.use_users_sum,
  171. code: "use_users_sum"
  172. },
  173. {
  174. title: '累计订单金额',
  175. num: `${state.baseInfo.order_users_sum_money}`,
  176. color: 'red',
  177. code: "order_users_sum_money"
  178. },
  179. {
  180. title: '累计有效订单金额',
  181. num: `${state.baseInfo.use_users_sum_money}`,
  182. color: 'red',
  183. code: "use_users_sum_money"
  184. },
  185. ]
  186. })
  187. }
  188. </script>
  189. <style scoped lang="scss">
  190. @import "index";
  191. </style>