index.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. <template>
  2. <view class="container">
  3. <view class="distribution">
  4. <view class="bg"></view>
  5. <view class="userInfo">
  6. <view class="u-plr30">
  7. <view class="head u-flex-center-sb">
  8. <view class="u-flex">
  9. <image v-if="accountInfo.headPhoto" :src="accountInfo.headPhoto"></image>
  10. <image v-else :src="$defaultAvatar" class="pc-avatar" mode="aspectFill" />
  11. <view class="u-ml30 u-mt15">
  12. <view class="u-font30 u-1A1A1A u-text1" style="width: 350rpx">{{
  13. accountInfo.nickname
  14. }}</view>
  15. <view class="u-mt5 u-font24">邀请码:
  16. <text class="u-mr30">{{ accountInfo.invitationCode }}</text>
  17. <text class="u-FF0000" @click="copy(accountInfo.invitationCode)">复制</text>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="u-plr30">
  24. <view class="list-item u-mt30">
  25. <view class="u-flex">
  26. <view class="iconfont bg-E8F9EF">&#xe634;</view>
  27. <!-- 可提现 -->
  28. <text class="u-bold u-font28 u-1A1A1A u-ml15 u-mt15">可提现金额</text>
  29. </view>
  30. <view class="bg-fff u-mt20 u-flex-center-sb">
  31. <view class="u-00BF5A u-bold u-font36 u-flex">
  32. <rich-text :nodes="$mUtil.priceBigSmall(accountInfo.balance)"></rich-text>
  33. </view>
  34. <view class="u-flex-center">
  35. <view class="wd-btn" @click="goWithdrawDeposit">
  36. <button class="u-font24">点击提现</button>
  37. </view>
  38. <!-- <view class="wd-btn u-ml10 bgc" @click="goWithdrawDeposittwo">
  39. <button class="u-font24">转入余额</button>
  40. </view> -->
  41. </view>
  42. </view>
  43. </view>
  44. <view class="list-item u-mt30">
  45. <view class="u-flex">
  46. <view class="iconfont bg-E8F9EF">&#xe614;</view>
  47. <text class="u-bold u-font28 u-1A1A1A u-ml15 u-mt15">我的伙伴</text>
  48. </view>
  49. <view class="bg-fff u-mt20 u-flex-center-sb" @click="goPartner">
  50. <view>直接伙伴</view>
  51. <view>
  52. <text class="u-FF0000">{{ accountInfo.partnerNum || 0 }}</text> 人
  53. <text class="iconfont u-font24 u-999 u-ml15">&#xe6c7;</text>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="list-item u-mt30">
  58. <view class="u-flex-center-sb">
  59. <view class="u-flex-center">
  60. <view class="iconfont bg-E8F9EF">&#xe645;</view>
  61. <text class="u-bold u-font28 u-1A1A1A u-ml15 u-mt15">分销订单</text>
  62. </view>
  63. <view class="u-flex-center" @click="getMoenyList">
  64. <text class="u-font24 u-999">历史订单</text>
  65. <text class="iconfont u-font24 u-999 u-mr30">&#xe671;</text>
  66. </view>
  67. </view>
  68. <view class="bg-fff u-mt20 u-flex-center-sa">
  69. <view>
  70. <view>本周订单</view>
  71. <view class="u-text-center u-mt10">
  72. <text class="u-00BF5A u-bold">{{
  73. userordergains.weekNum || 0
  74. }}</text>
  75. <text class="u-font20 u-666 u-ml5">单</text>
  76. </view>
  77. </view>
  78. <view>
  79. <view>本月订单</view>
  80. <view class="u-text-center u-mt10">
  81. <text class="u-00BF5A u-bold">
  82. {{ userordergains.monthNum || 0 }}
  83. </text>
  84. <text class="u-font20 u-666 u-ml5">单</text>
  85. </view>
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <!--页面加载动画-->
  93. <ldLoading isFullScreen :active="loading"></ldLoading>
  94. </view>
  95. </template>
  96. <script setup>
  97. import { ref } from "vue";
  98. import { onShow } from "@dcloudio/uni-app";
  99. import { distributionUserOrderGainsCount_Api } from "@/api/agencyCenter.js";
  100. import { userInfo } from "@/api/login.js";
  101. const loading = ref(true);
  102. const accountInfo = ref({}); // 用户信息
  103. const userordergains = ref({}); // 分销订单
  104. // 获取用户信息
  105. const getUserInfo = () => {
  106. userInfo().then((res) => {
  107. uni.stopPullDownRefresh();
  108. if (res && res.code == 200) {
  109. accountInfo.value = res.data || {};
  110. }
  111. });
  112. }
  113. // 获取会员的时间范围内内的分销订单数
  114. const getCount_Api = (type) => {
  115. distributionUserOrderGainsCount_Api(type).then((res) => {
  116. if (res && res.code == 200) {
  117. if (type == "week") {
  118. userordergains.value.weekNum = res.data || 0;
  119. } else if (type == "month") {
  120. userordergains.value.monthNum = res.data || 0;
  121. }
  122. }
  123. });
  124. }
  125. // 生命周期
  126. onShow((options) => {
  127. getUserInfo();
  128. getCount_Api("week");
  129. getCount_Api("month");
  130. });
  131. // 方法
  132. // 分润订单
  133. const getMoenyList = () => {
  134. uni.navigateTo({
  135. url: "moneyList",
  136. });
  137. };
  138. // 提现
  139. const goWithdrawDeposit = () => {
  140. uni.navigateTo({
  141. url: "/pages/user/wallet/reflect?pageType=2",
  142. });
  143. };
  144. // 转入余额
  145. const goWithdrawDeposittwo = () => {
  146. uni.navigateTo({
  147. url: "withdrawTwo",
  148. });
  149. };
  150. // 我的伙伴
  151. const goPartner = () => {
  152. uni.navigateTo({
  153. url: "partner",
  154. });
  155. };
  156. // 复制邀请码
  157. const copy = (code) => {
  158. uni.setClipboardData({
  159. data: code,
  160. success: () => {
  161. uni.showToast({
  162. title: "复制成功",
  163. });
  164. },
  165. });
  166. };
  167. </script>
  168. <style lang="scss" scoped>
  169. .distribution {
  170. position: relative;
  171. view {
  172. font-size: 28rpx;
  173. }
  174. .bg {
  175. width: 100%;
  176. height: 185rpx;
  177. background-color: #fa6138;
  178. }
  179. .userInfo {
  180. position: absolute;
  181. top: 68rpx;
  182. width: 100%;
  183. .head {
  184. background-color: #fffaee;
  185. padding: 40rpx 30rpx 36rpx;
  186. border-radius: 20rpx;
  187. image {
  188. width: 106rpx;
  189. height: 106rpx;
  190. border: 4rpx solid #ffffff;
  191. border-radius: 50%;
  192. }
  193. .font80 {
  194. font-size: 80rpx;
  195. color: #fa6138;
  196. }
  197. }
  198. }
  199. .list-item {
  200. .bg-E8F9EF {
  201. background-color: #e8f9ef;
  202. color: #fa6138;
  203. padding: 10rpx;
  204. width: 50rpx;
  205. height: 50rpx;
  206. line-height: 50rpx;
  207. text-align: center;
  208. border-radius: 50%;
  209. box-sizing: border-box;
  210. }
  211. .bg-fff {
  212. background-color: #ffffff;
  213. box-sizing: border-box;
  214. padding: 30rpx;
  215. border-radius: 20rpx;
  216. box-shadow: 0 0 20rpx #eee;
  217. .wd-btn button {
  218. width: 175rpx;
  219. height: 60rpx;
  220. border-radius: 30px;
  221. background-color: #f7f7f7;
  222. }
  223. }
  224. }
  225. }
  226. </style>