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

229 lines
5.6 KiB

5 months ago
5 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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 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. uni.navigateTo({
  110. url: "/otherPages/myOrdersManage/transaction/index?moneyType=0"
  111. })
  112. // tab.navigateTo('/otherPages/binding/partner/index?moneyType=0')
  113. // tab.navigateTo('/otherPages/workbenchManage/bindUser/index')
  114. break;
  115. case 'cash':
  116. uni.navigateTo({
  117. url: "/otherPages/binding/withdrawal/index?moneyType=0"
  118. })
  119. // tab.navigateTo('/otherPages/binding/withdrawal/index?moneyType=0')
  120. break;
  121. }
  122. /*
  123. // 处理流水明细点击
  124. const handleRunningWater = () => {
  125. if (!checkLoginAndRedirect()) return
  126. uni.navigateTo({
  127. url: "/otherPages/myOrdersManage/transaction/index?moneyType=1"
  128. })
  129. }
  130. // 处理提现点击
  131. const handleWithdraw = () => {
  132. if (!checkLoginAndRedirect()) return
  133. uni.navigateTo({
  134. url: "/otherPages/binding/withdrawal/index?moneyType=1"
  135. })
  136. }
  137. */
  138. }
  139. const state = reactive({
  140. info: {},
  141. baseInfo: {},
  142. nounthData: [],
  143. totalData: []
  144. })
  145. onShow(() => {
  146. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  147. getBaseInfo()
  148. })
  149. const getBaseInfo = () => {
  150. binBaseInfo(state.info.userId).then(res => {
  151. state.baseInfo = res.data
  152. state.nounthData = [{
  153. title: '本月注册用户',
  154. num: state.baseInfo.register_users,
  155. code: "register_users"
  156. },
  157. {
  158. title: '本月下单用户',
  159. num: state.baseInfo.register_users,
  160. code: "order_users"
  161. },
  162. {
  163. title: '本月有效用户',
  164. num: state.baseInfo.use_users,
  165. code: "use_users"
  166. },
  167. {
  168. title: '本月订单金额',
  169. num: `${state.baseInfo.order_users_money}`,
  170. color: 'red',
  171. code: "order_users_money"
  172. },
  173. {
  174. title: '本月有效订单金额',
  175. num: `${state.baseInfo.use_users_money}`,
  176. color: 'red',
  177. code: "use_users_money"
  178. },
  179. ]
  180. state.totalData = [{
  181. title: '累计注册用户',
  182. num: state.baseInfo.register_users_sum,
  183. code: "register_users_sum"
  184. },
  185. {
  186. title: '累计下单用户',
  187. num: state.baseInfo.order_users_sum,
  188. code: "order_users_sum"
  189. },
  190. {
  191. title: '累计有效用户',
  192. num: state.baseInfo.use_users_sum,
  193. code: "use_users_sum"
  194. },
  195. {
  196. title: '累计订单金额',
  197. num: `${state.baseInfo.order_users_sum_money}`,
  198. color: 'red',
  199. code: "order_users_sum_money"
  200. },
  201. {
  202. title: '累计有效订单金额',
  203. num: `${state.baseInfo.use_users_sum_money}`,
  204. color: 'red',
  205. code: "use_users_sum_money"
  206. },
  207. ]
  208. })
  209. }
  210. </script>
  211. <style scoped lang="scss">
  212. @import "index";
  213. </style>