distributorDetails.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="page">
  3. <!-- 头部吸顶区域 -->
  4. <u-sticky bgColor="#fff">
  5. <view class="header dis a-c ">
  6. <image class="avatarImg" src="/static/image/avatar.png" mode=""></image>
  7. <view class="dis f-c ml-2 ">
  8. <view class="dis a-c j-s">
  9. <view class="dis a-c">
  10. <text class="name">{{info.name}}</text>
  11. <image class="level" src="/static/image/tool/level1.png" mode=""></image>
  12. </view>
  13. <text class="time">{{info.joinTime}}加入</text>
  14. </view>
  15. <text class="phone mt-1">{{info.mobile}}</text>
  16. <view class="dis a-c referrer mt-1">
  17. <text class="mr-3">推荐人</text>
  18. <text>{{info.inviteePerson}}({{info.level==1?'一':info.level==2?'二':'三'}}级分销员)</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="tabView">
  23. <u-tabs :list="categoryList" @click="click" :current="current" :scrollable="false"
  24. :lineWidth="lineWidth" :activeStyle="{ color: '#333', fontWeight: 'bold' }"
  25. :inactiveStyle="{ color: '#999' }" :itemStyle="{ height: '48rpx' }"></u-tabs>
  26. </view>
  27. </u-sticky>
  28. <view class="content-list" v-if="current==0">
  29. <view class="item mt-2" v-for="(item,index) in ordersList" :key="index">
  30. <view class="above dis a-c ">
  31. <image class="level" src="/static/image/tool/level1.png" mode=""></image>
  32. <text class="ml-1">{{item.licenseNo}}</text>
  33. <text class="time">{{item.signingTime}}</text>
  34. </view>
  35. <view class="below mt-2 dis a-c f-wrap">
  36. <view class="view">
  37. <text class="mr-3">保费</text>
  38. <text>{{item.premium}}</text>
  39. </view>
  40. <view class="view">
  41. <text class="mr-3">贡献佣金</text>
  42. <text>{{item.commission}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="content-list" v-else v-for="(item,index) in distributorList" :key="index">
  48. <view class="item mt-2">
  49. <view class="above dis a-c ">
  50. <image class="avatar" src="/static/image/avatar.png" mode=""></image>
  51. <text class="ml-1 mr-2">{{item.name}}</text>
  52. <image class="level" src="/static/image/tool/level1.png" mode=""></image>
  53. </view>
  54. <view class="below mt-2 dis a-c f-wrap">
  55. <view class="view">
  56. <text class="mr-3">邀请人</text>
  57. <text>{{item.inviteePerson}}</text>
  58. </view>
  59. <view class="view">
  60. <text class="mr-3">贡献佣金</text>
  61. <text>{{item.commission || 0 }}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. current: 0,
  73. categoryList: [{
  74. name: '订单',
  75. },
  76. {
  77. name: '邀请分销员',
  78. },
  79. ],
  80. info: {},
  81. ordersList: [],
  82. distributorList: [],
  83. }
  84. },
  85. onShow() {
  86. },
  87. onLoad(options) {
  88. this.info = JSON.parse(options.info);
  89. this.distributorDetails();
  90. this.distributor();
  91. },
  92. computed: {
  93. //tab滑块长度
  94. lineWidth() {
  95. return this.current ? '64' : '32';
  96. }
  97. },
  98. methods: {
  99. async distributorDetails() {
  100. let res = await this.$http.post('/sysDistributionSetting/getDistributionOrder', {
  101. userId: this.info.id
  102. })
  103. if (res.code == 200) {
  104. this.ordersList = res.data;
  105. }
  106. },
  107. async distributor() {
  108. let res = await this.$http.get('/sysDistributionSetting/inviteeDistributor', {
  109. id: this.info.id,
  110. level: this.info.level,
  111. })
  112. if (res.code == 200) {
  113. this.distributorList = res.data;
  114. }
  115. },
  116. click(tab) {
  117. this.current = tab.index;
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .page {
  124. background: #f8f8f8;
  125. height: calc(100vh - 88rpx);
  126. }
  127. .tabView {
  128. padding: 20rpx 0;
  129. box-sizing: border-box;
  130. }
  131. .header {
  132. padding: 25rpx 30rpx;
  133. box-sizing: border-box;
  134. border-bottom: 1rpx solid #eee;
  135. >view {
  136. flex: 1;
  137. }
  138. .avatarImg {
  139. width: 140rpx;
  140. height: 140rpx;
  141. }
  142. .name {
  143. font-size: 32rpx;
  144. color: #333;
  145. font-weight: bold;
  146. margin-right: 20rpx;
  147. }
  148. .time {
  149. font-size: 22rpx;
  150. color: #999;
  151. }
  152. .level {
  153. width: 40rpx;
  154. height: 36rpx;
  155. }
  156. .phone {
  157. font-size: 28rpx;
  158. color: #333;
  159. }
  160. .referrer {
  161. font-size: 28rpx;
  162. >:first-child {
  163. color: #999;
  164. }
  165. >:last-child {
  166. color: #333;
  167. }
  168. }
  169. }
  170. .content-list {
  171. padding: 0 30rpx;
  172. box-sizing: border-box;
  173. .item {
  174. padding: 25rpx 30rpx;
  175. box-sizing: border-box;
  176. background: #FFFFFF;
  177. border-radius: 10rpx 10rpx 10rpx 10rpx;
  178. .above {
  179. .level {
  180. width: 40rpx;
  181. height: 36rpx;
  182. }
  183. .avatar {
  184. width: 44rpx;
  185. height: 44rpx;
  186. }
  187. .time {
  188. font-size: 22rpx;
  189. color: #999;
  190. font-weight: 400;
  191. margin-left: auto;
  192. }
  193. text {
  194. font-size: 32rpx;
  195. color: #333;
  196. font-weight: bold;
  197. }
  198. }
  199. .below {
  200. .view {
  201. width: 50%;
  202. text:first-child {
  203. font-size: 28rpx;
  204. color: #999;
  205. }
  206. text:last-child {
  207. font-size: 28rpx;
  208. color: #333;
  209. }
  210. }
  211. }
  212. }
  213. }
  214. /* 自定义tab滑块样式 */
  215. ::v-deep .u-tabs__wrapper__nav__line {
  216. background: linear-gradient(90deg, #FDE935 10%, rgba(253, 233, 53, 0.1) 100%) !important;
  217. border-radius: 6rpx;
  218. }
  219. </style>