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

238 lines
6.1 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. style="margin-right: 20rpx;"
  29. :style="{color:'#A55822'}" v-if="state.baseInfo.partner_new_num">
  30. 当前分成比例<text :style="{color:'#C12525'}">{{state.baseInfo.partner_new_num}}</text>
  31. </view>
  32. <view :style="{color:'#A55822'}" v-if="state.baseInfo.partner_upgrade_num">
  33. 晋级后分成比例<text :style="{color:'#C12525'}">{{state.baseInfo.partner_upgrade_num}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="bind-main">
  40. <view class="bind-main-content">
  41. <view class="top box-size mb20" :style="{borderRadius:'16rpx'}">
  42. <view class="level account">
  43. <view class="fw700">
  44. 钱包余额
  45. </view>
  46. <view class="level text">
  47. <view @click="handleGoto('detail')">
  48. 明细
  49. </view>
  50. <view class="line" @click="handleGoto('cash')">
  51. 提现
  52. </view>
  53. </view>
  54. </view>
  55. <view class="money level fw700">
  56. <text class="text1">
  57. ¥
  58. </text>
  59. <text style="color: #FF2A2A; font-size: 36rpx;">{{state.baseInfo.money}}</text>
  60. </view>
  61. <view class="line1">
  62. </view>
  63. <view class="level divide">
  64. <view class="level flex-rowl">
  65. <view >
  66. 本月订单分成:&nbsp;&nbsp;
  67. </view>
  68. ¥<view >
  69. {{state.baseInfo.new_money}}
  70. </view>
  71. </view>
  72. <view class="level flex-rowl">
  73. <view >
  74. 累积订单分成:&nbsp;&nbsp;
  75. </view>
  76. ¥<view >
  77. {{state.baseInfo.old_money}}
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="my-data">
  83. <view class="my-data-total">
  84. <cardTitle :cardTitle="mounthName"></cardTitle>
  85. <cardData :cardData="state.nounthData"></cardData>
  86. </view>
  87. </view>
  88. <view class="my-data">
  89. <view class="my-data-total">
  90. <cardTitle :cardTitle="totalName"></cardTitle>
  91. <cardData :cardData="state.totalData"></cardData>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </template>
  98. <script setup>
  99. import tab from "@/plugins/tab.js"
  100. import cardTitle from '../components/cardTitle.vue'
  101. import cardData from '../components/cardData.vue'
  102. import {
  103. ref,
  104. reactive,
  105. onMounted
  106. } from "vue"
  107. import {
  108. binBaseInfo,
  109. bindCode
  110. } from "@/api/home.js"
  111. import { onShow } from '@dcloudio/uni-app'
  112. const mounthName = ref('本月数据')
  113. const totalName = ref('累计数据')
  114. const handleGoto = (val) => {
  115. switch (val) {
  116. case 'detail':
  117. uni.navigateTo({
  118. url: "/otherPages/myOrdersManage/transaction/index?moneyType=0"
  119. })
  120. // tab.navigateTo('/otherPages/binding/partner/index?moneyType=0')
  121. // tab.navigateTo('/otherPages/workbenchManage/bindUser/index')
  122. break;
  123. case 'cash':
  124. uni.navigateTo({
  125. url: "/otherPages/binding/withdrawal/index?moneyType=0"
  126. })
  127. // tab.navigateTo('/otherPages/binding/withdrawal/index?moneyType=0')
  128. break;
  129. }
  130. /*
  131. // 处理流水明细点击
  132. const handleRunningWater = () => {
  133. if (!checkLoginAndRedirect()) return
  134. uni.navigateTo({
  135. url: "/otherPages/myOrdersManage/transaction/index?moneyType=1"
  136. })
  137. }
  138. // 处理提现点击
  139. const handleWithdraw = () => {
  140. if (!checkLoginAndRedirect()) return
  141. uni.navigateTo({
  142. url: "/otherPages/binding/withdrawal/index?moneyType=1"
  143. })
  144. }
  145. */
  146. }
  147. const state = reactive({
  148. info: {},
  149. baseInfo: {},
  150. nounthData: [],
  151. totalData: []
  152. })
  153. onShow(() => {
  154. state.info = JSON.parse(uni.getStorageSync("baseInfo"))
  155. getBaseInfo()
  156. })
  157. const getBaseInfo = () => {
  158. binBaseInfo(state.info.userId).then(res => {
  159. state.baseInfo = res.data
  160. state.nounthData = [{
  161. title: '本月注册用户',
  162. num: state.baseInfo.register_users,
  163. code: "register_users"
  164. },
  165. {
  166. title: '本月下单用户',
  167. num: state.baseInfo.register_users,
  168. code: "order_users"
  169. },
  170. {
  171. title: '本月有效用户',
  172. num: state.baseInfo.use_users,
  173. code: "use_users"
  174. },
  175. {
  176. title: '本月订单金额',
  177. num: `${state.baseInfo.order_users_money}`,
  178. color: 'red',
  179. code: "order_users_money"
  180. },
  181. {
  182. title: '本月有效订单金额',
  183. num: `${state.baseInfo.use_users_money}`,
  184. color: 'red',
  185. code: "use_users_money"
  186. },
  187. ]
  188. state.totalData = [{
  189. title: '累计注册用户',
  190. num: state.baseInfo.register_users_sum,
  191. code: "register_users_sum"
  192. },
  193. {
  194. title: '累计下单用户',
  195. num: state.baseInfo.order_users_sum,
  196. code: "order_users_sum"
  197. },
  198. {
  199. title: '累计有效用户',
  200. num: state.baseInfo.use_users_sum,
  201. code: "use_users_sum"
  202. },
  203. {
  204. title: '累计订单金额',
  205. num: `${state.baseInfo.order_users_sum_money}`,
  206. color: 'red',
  207. code: "order_users_sum_money"
  208. },
  209. {
  210. title: '累计有效订单金额',
  211. num: `${state.baseInfo.use_users_sum_money}`,
  212. color: 'red',
  213. code: "use_users_sum_money"
  214. },
  215. ]
  216. })
  217. }
  218. </script>
  219. <style scoped lang="scss">
  220. @import "index";
  221. </style>