index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="header-back">
  3. <m-nav-bar :transparent="true" title="提现页面" style="color: #ffffff" />
  4. <div class="user-data">
  5. <div class="left">
  6. <m-user-avatar />
  7. <div class="name">
  8. <m-user-name />
  9. <span
  10. >可提现余额<span class="grade">{{ userInfo?.remainderPrice }}</span
  11. >元</span
  12. >
  13. <span>已提现{{ userInfo?.extractPrice }}元</span>
  14. </div>
  15. </div>
  16. <m-button @click="fn" class="continue" width="90px" height="30px" text="我要提现" />
  17. </div>
  18. </div>
  19. <div class="summary content-box">
  20. <form action="/" class="search">
  21. <van-search v-model="searchValue" shape="round" placeholder="请输入下级代理昵称" />
  22. </form>
  23. </div>
  24. <div class="test-scores content-box">
  25. <table class="table">
  26. <tr>
  27. <th>头像</th>
  28. <th>昵称</th>
  29. <th>代理等级</th>
  30. <!-- <th>分成比例</th> -->
  31. <th>分成金额</th>
  32. </tr>
  33. <tr v-for="(item, index) in otherUserInfoList.filter((item) => item.nickName.includes(searchValue))" :key="index">
  34. <td>
  35. <van-image round width="50px" height="50px" :src="item.headImage" />
  36. </td>
  37. <td>{{ item.nickName }}</td>
  38. <td>{{ item.hierarchy }}</td>
  39. <!-- <td>{{ item.percentage }}</td> -->
  40. <td>{{ item.profitPrice }}</td>
  41. </tr>
  42. </table>
  43. </div>
  44. <van-dialog v-model="show" title="我要提现" show-cancel-button>
  45. <img src="https://img01.yzcdn.cn/vant/apple-3.jpg" />
  46. </van-dialog>
  47. </template>
  48. <script lang="ts">
  49. import { CashOutModel } from '@/dataModel/cashOut';
  50. import { ref, onBeforeMount } from 'vue';
  51. import { RouterBus } from '@/hooks';
  52. const cashOutModel = new CashOutModel();
  53. /** 获取下级用户列表 */
  54. const useOtherUserInfoList = () => {
  55. const otherUserInfoList = ref<
  56. {
  57. profitPrice: string;
  58. headImage: string;
  59. nickName: string;
  60. createTime: string;
  61. hierarchy: string;
  62. openid: string;
  63. percentage: string;
  64. }[]
  65. >([]);
  66. onBeforeMount(async () => {
  67. const res = await cashOutModel.extensionIncomeList();
  68. otherUserInfoList.value.push(...res.rows);
  69. });
  70. return {
  71. otherUserInfoList,
  72. };
  73. };
  74. /** 获取用户可提现信息 */
  75. const useUserInfo = () => {
  76. const userInfo = ref<{
  77. extractPrice: string;
  78. remainderPrice: string;
  79. totalPrice: string;
  80. beneficiaryOpenid: string;
  81. headImage: string;
  82. nickName: string;
  83. }>();
  84. onBeforeMount(async () => {
  85. const res = await cashOutModel.extensionIncomePrice();
  86. userInfo.value = res;
  87. });
  88. return {
  89. userInfo,
  90. };
  91. };
  92. </script>
  93. <script lang="ts" setup>
  94. import { Dialog } from 'vant';
  95. const { otherUserInfoList } = useOtherUserInfoList();
  96. const { userInfo } = useUserInfo();
  97. const searchValue = ref('');
  98. const { goMockTest } = new RouterBus();
  99. const show = ref(false);
  100. const fn = () => {
  101. console.log(123);
  102. Dialog({
  103. title: '暂未开放',
  104. });
  105. show.value = true;
  106. };
  107. </script>
  108. <style scoped lang="scss">
  109. .header-back {
  110. width: 375px;
  111. padding-bottom: 82px;
  112. background: linear-gradient(180deg, #498ef5 0%, #4da8e6 100%);
  113. border-radius: 0px 0px 82px 82px;
  114. .user-data {
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: center;
  118. padding: 19px 17px 24px;
  119. .left {
  120. display: flex;
  121. justify-content: space-between;
  122. align-items: center;
  123. .name {
  124. display: flex;
  125. flex-direction: column;
  126. font-size: 13px;
  127. color: #ffffff;
  128. justify-content: space-between;
  129. margin-left: 6px;
  130. .grade {
  131. font-size: 24px;
  132. padding: 4px;
  133. }
  134. }
  135. }
  136. .continue {
  137. font-size: 13px;
  138. font-family: PingFang SC;
  139. font-weight: 400;
  140. line-height: 19px;
  141. color: #ffffff;
  142. background: #01c18d;
  143. }
  144. }
  145. }
  146. .content-box {
  147. width: 345px;
  148. background: #ffffff;
  149. box-shadow: 0px 0px 8px rgba(124, 129, 136, 0.2);
  150. border-radius: 10px;
  151. position: relative;
  152. left: 50%;
  153. transform: translateX(-50%);
  154. top: -82px;
  155. margin-top: 10px;
  156. }
  157. .summary {
  158. display: flex;
  159. justify-content: space-around;
  160. box-sizing: border-box;
  161. overflow: hidden;
  162. .search {
  163. width: 100%;
  164. }
  165. }
  166. .test-scores {
  167. font-size: 13px;
  168. font-family: PingFang SC;
  169. font-weight: 400;
  170. line-height: 19px;
  171. color: #0a1a33;
  172. padding: 15px;
  173. box-sizing: border-box;
  174. .table {
  175. width: 100%;
  176. border-collapse: collapse;
  177. font-size: 13px;
  178. th {
  179. padding: 5px;
  180. color: #0a1a33;
  181. }
  182. td {
  183. text-align: center;
  184. padding: 5px;
  185. color: #8a9099;
  186. }
  187. tr {
  188. &:nth-of-type(n) {
  189. background: #ffffff;
  190. }
  191. &:nth-of-type(2n) {
  192. background: rgba(73, 142, 245, 0.15);
  193. }
  194. }
  195. }
  196. }
  197. </style>