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

196 lines
4.7 KiB

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