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

195 lines
4.6 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month 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.upgrade_image" 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 class="">
  49. 本月订单分成:&nbsp;&nbsp;
  50. </view>
  51. ¥<view class="">
  52. {{state.baseInfo.new_money}}
  53. </view>
  54. </view>
  55. <view class="level flex-rowl">
  56. <view class="">
  57. 累积订单分成:&nbsp;&nbsp;
  58. </view>
  59. ¥<view class="">
  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. const mounthName = ref('本月数据')
  95. const totalName = ref('累计数据')
  96. const handleGoto = (val) => {
  97. switch (val) {
  98. case 'detail':
  99. tab.navigateTo('/otherPages/binding/partner/index')
  100. // tab.navigateTo('/otherPages/workbenchManage/bindUser/index')
  101. break;
  102. case 'cash':
  103. tab.navigateTo('/otherPages/binding/withdrawal/index')
  104. break;
  105. }
  106. }
  107. const state = reactive({
  108. info: {},
  109. baseInfo: {},
  110. nounthData: [],
  111. totalData: []
  112. })
  113. onMounted(() => {
  114. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  115. getBaseInfo()
  116. })
  117. const getBaseInfo = () => {
  118. binBaseInfo(state.info.userId).then(res => {
  119. state.baseInfo = res.data
  120. state.nounthData = [{
  121. title: '本月注册用户',
  122. num: state.baseInfo.register_users,
  123. code: "register_users"
  124. },
  125. {
  126. title: '本月下单用户',
  127. num: state.baseInfo.register_users,
  128. code: "order_users"
  129. },
  130. {
  131. title: '本月有效用户',
  132. num: state.baseInfo.use_users,
  133. code: "use_users"
  134. },
  135. {
  136. title: '本月订单金额',
  137. num: `${state.baseInfo.order_users_money}`,
  138. color: 'red',
  139. code: "order_users_money"
  140. },
  141. {
  142. title: '本月有效订单金额',
  143. num: `${state.baseInfo.use_users_money}`,
  144. color: 'red',
  145. code: "use_users_money"
  146. },
  147. ]
  148. state.totalData = [{
  149. title: '累计注册用户',
  150. num: state.baseInfo.register_users_sum,
  151. code: "register_users_sum"
  152. },
  153. {
  154. title: '累计下单用户',
  155. num: state.baseInfo.order_users_sum,
  156. code: "order_users_sum"
  157. },
  158. {
  159. title: '累计有效用户',
  160. num: state.baseInfo.use_users_sum,
  161. code: "use_users_sum"
  162. },
  163. {
  164. title: '累计订单金额',
  165. num: `${state.baseInfo.order_users_sum_money}`,
  166. color: 'red',
  167. code: "order_users_sum_money"
  168. },
  169. {
  170. title: '累计有效订单金额',
  171. num: `${state.baseInfo.use_users_sum_money}`,
  172. color: 'red',
  173. code: "use_users_sum_money"
  174. },
  175. ]
  176. })
  177. }
  178. </script>
  179. <style scoped lang="scss">
  180. @import "index";
  181. </style>