team.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. <template>
  2. <view class="content">
  3. <view class="view1"
  4. style="box-shadow: rgba(183, 183, 183, 0.3) 1px 1px 10px 1px;border-radius: 20upx;margin-bottom: 20upx;">
  5. <view style="display: flex;">
  6. <view style="margin: 70upx 0 0 20upx;height: 100upx; width: 300upx; text-align: center;">
  7. <view style="font-size: 56upx;font-weight: 800;">{{ teamCount }} <text
  8. style="font-size: 24rpx;">人</text> </view>
  9. <view style="font-size: 24upx;margin-left: 20upx;color: #999999;">已邀请</view>
  10. </view>
  11. <view style="margin: 70upx 0 0 75upx;height: 100upx; width: 300upx;text-align: center;" @click="goDet">
  12. <view style="font-size: 56upx;font-weight: 800;"><text
  13. style="font-size: 28rpx;">¥</text>{{ teamMoney?teamMoney:0 }}</view>
  14. <view style="font-size: 24upx;color: #999999;">我的收益</view>
  15. </view>
  16. </view>
  17. <!-- <view style="margin: 20rpx 30rpx;font-size: 28rpx;color: #557EFD;" v-if="yijiyongjin">
  18. *可得邀请好友消费奖励的{{yijiyongjin*100}}%</view> -->
  19. <view style="margin: 20rpx 30rpx;font-size: 28rpx;color: #2474FF;" v-if="yijiyongjin">
  20. *可得一级好友平台佣金的{{yijiyongjin*100}}%</view>
  21. <view style="margin: 20rpx 30rpx;font-size: 28rpx;color: #2474FF;" v-if="erjiyongjin">
  22. *可得二级好友平台佣金的{{erjiyongjin*100}}%</view>
  23. <button class="yaoqing_btn" @click="goYao">邀请好友</button>
  24. </view>
  25. <view class="navbar">
  26. <view class="nav-item" :class="{current: type == 1}" @click="changeList(1)">
  27. 一级( {{countChildren}} )
  28. </view>
  29. <view class="nav-item" :class="{current: type == 2}" @click="changeList(2)">
  30. 二级( {{countChildrenChildren}} )
  31. </view>
  32. </view>
  33. <view class="view2"
  34. style="box-shadow: rgba(183, 183, 183, 0.3) 1px 1px 10px 1px;border-radius: 20upx;margin-bottom: 50upx;">
  35. <view style="display: flex;flex-direction: row;padding: 20upx;">
  36. <view style="width: 15%;">编号</view>
  37. <view style="width: 20%;">头像</view>
  38. <view style="width: 40%;">昵称</view>
  39. <view style="width: 35%;text-align: center;">时间</view>
  40. </view>
  41. <view class="flex justify-between align-center padding" v-if="list.length > 0" v-for="(item, index) in list"
  42. :key="index" style="margin-bottom: 16upx;">
  43. <view style="width: 15%;">
  44. <view style="font-size: 28upx;margin-left: 15upx;margin-top: 6upx;">{{ index + 1 }}
  45. </view>
  46. </view>
  47. <view style="width: 20%;">
  48. <image :src="item.avatar?item.avatar:'../../static/image/logo.png'" class="round"
  49. style="width: 50rpx;height: 50rpx;"></image>
  50. </view>
  51. <view style="width: 40%;display: flex;flex-direction: row;align-items: center;">
  52. <view style="font-size: 28upx;width: 90%;overflow: hidden;">{{ item.userName?item.userName:'' }}
  53. </view>
  54. </view>
  55. <view style="width: 35%;text-align: center;">
  56. <view style="font-size: 28upx;">
  57. {{ item.createTime.substr(0,10) }}
  58. </view>
  59. </view>
  60. </view>
  61. <empty v-if="list.length==0" style="height: 50vh;position: relative;"></empty>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. import empty from '@/components/empty.vue'
  67. export default {
  68. components: {
  69. empty
  70. },
  71. data() {
  72. return {
  73. countChildren: 0,
  74. countChildrenChildren: 0,
  75. YaoqingShangJin: 0,
  76. setting: 1,
  77. list: [],
  78. page: 1,
  79. limit: 10,
  80. type: 1,
  81. status: 0,
  82. teamCount: 0,
  83. teamMoney: 0,
  84. isFenxiao: '否',
  85. oneTeamCount: 0,
  86. twoTeamCount: 0,
  87. yijiyongjin: '',
  88. erjiyongjin: '',
  89. currentTab: 0,
  90. tabsnva: [{
  91. loadingType: ''
  92. }],
  93. tabList: [{
  94. state: 'zs',
  95. text: '一级',
  96. type: 1,
  97. number: 0
  98. }, {
  99. state: 'fzs',
  100. text: '二级',
  101. type: 2,
  102. number: 0
  103. }],
  104. count: 0,
  105. };
  106. },
  107. onLoad() {
  108. let YaoqingShangJin = this.$queue.getData('YaoqingShangJin');
  109. if (YaoqingShangJin && YaoqingShangJin != 0) {
  110. this.YaoqingShangJin = YaoqingShangJin;
  111. }
  112. //用户信息
  113. this.getUserInfo();
  114. //邀请的用户
  115. this.getMoney();
  116. //用户推广信息
  117. this.getTeamMoney()
  118. },
  119. methods: {
  120. getUserInfo() {
  121. this.$Request.getT('/app/user/selectUserById').then(res => {
  122. console.log(res)
  123. if (res.code == 0) {
  124. this.yijiyongjin = res.data.divideScale ? res.data.divideScale : 0;
  125. this.erjiyongjin = res.data.divideTwoScale ? res.data.divideTwoScale : 0;
  126. uni.setStorageSync('avatar', res.data.avatar)
  127. uni.setStorageSync('invitationCode', res.data.invitationCode)
  128. uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
  129. uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
  130. }
  131. });
  132. },
  133. //用户推广信息
  134. getTeamMoney() {
  135. this.$Request.getT('/app/orders/selectTeamStatistics').then(res => {
  136. if (res.code == 0) {
  137. this.teamMoney = res.data.teamMoney
  138. this.teamCount = res.data.teamCount
  139. this.countChildren = res.data.oneTeamCount ? res.data.oneTeamCount : 0
  140. this.countChildrenChildren = res.data.twoTeamCount ? res.data.twoTeamCount : 0
  141. }
  142. });
  143. },
  144. goYao() {
  145. uni.navigateTo({
  146. url: '/pages/my/invitationUser'
  147. });
  148. },
  149. changeList(zhishu) {
  150. this.page = 1
  151. this.type = zhishu
  152. this.getMoney()
  153. },
  154. //切换一级二级
  155. changeTab(e) {
  156. console.log('eeeeeeeee', e)
  157. this.currentTab = e.target.current;
  158. if (this.currentTab == 0) {
  159. this.type = 1
  160. this.getMoney()
  161. } else if (this.currentTab == 1) {
  162. this.type = 2
  163. this.getMoney()
  164. }
  165. },
  166. //邀请的用户
  167. getMoney() {
  168. this.loadingType = 1;
  169. uni.showLoading({
  170. title: '加载中...'
  171. });
  172. let data = {
  173. page: this.page,
  174. limit: this.limit,
  175. type: this.type,
  176. }
  177. this.$Request.getT('/app/orders/selectTeamUserList', data).then(res => {
  178. if (res.code == 0 && res.data) {
  179. this.count = res.data.totalPage
  180. if (this.page == 1) {
  181. this.list = res.data.list
  182. } else {
  183. this.list = [...this.list, ...res.data.list]
  184. }
  185. }
  186. uni.hideLoading();
  187. });
  188. },
  189. goDet() {
  190. uni.navigateTo({
  191. url: './earnings'
  192. })
  193. }
  194. },
  195. onPullDownRefresh: function() {
  196. this.page = 0;
  197. this.limit = 0;
  198. this.list = [];
  199. this.getMoney();
  200. },
  201. onReachBottom() {
  202. if (this.list.length < this.count) {
  203. this.page = this.page + 1;
  204. this.getMoney()
  205. } else {
  206. uni.showToast({
  207. title: '没有更多了',
  208. icon: 'none'
  209. })
  210. }
  211. },
  212. };
  213. </script>
  214. <style lang="scss">
  215. @import '../../static/css/index.css';
  216. .view1 {
  217. background-color: #FFFFFF;
  218. width: 93%;
  219. // height: 300upx;
  220. margin-left: 26upx;
  221. border-radius: 20upx;
  222. margin-top: 20upx;
  223. padding-bottom: 32upx;
  224. }
  225. .view2 {
  226. background-color: #FFFFFF;
  227. width: 93%;
  228. // height: 100%;
  229. border-top-left-radius: 20upx;
  230. border-top-right-radius: 20upx;
  231. margin-left: 26upx;
  232. margin-top: 20upx;
  233. }
  234. .navbar {
  235. display: flex;
  236. height: 40px;
  237. box-shadow: 0 1px 5px rgba(0, 0, 0, .06);
  238. position: relative;
  239. z-index: 10;
  240. margin: 0 24rpx;
  241. border-radius: 50rpx;
  242. overflow: hidden;
  243. .nav-item {
  244. flex: 1;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. height: 100%;
  249. font-size: 15px;
  250. position: relative;
  251. &.current {
  252. background-color: #2474FF;
  253. color: #FFFFFF;
  254. &:after {
  255. content: '';
  256. position: absolute;
  257. left: 50%;
  258. bottom: 0;
  259. transform: translateX(-50%);
  260. width: 44px;
  261. height: 0;
  262. // border-bottom: 2px solid $base-color;
  263. }
  264. }
  265. }
  266. }
  267. .yaoqing_btn {
  268. // width: 80%;
  269. margin-top: 30upx;
  270. height: 86upx;
  271. line-height: 86upx;
  272. color: #FFFFFF;
  273. background: #2474FF;
  274. margin-left: 32upx;
  275. margin-right: 32upx;
  276. border-radius: 50rpx;
  277. background-size: 100%;
  278. }
  279. </style>