myteam.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view :class="[AppTheme]" class="all_box onelevel">
  3. <!-- #ifdef APP-PLUS || MP-WEIXIN -->
  4. <u-sticky offsetTop="0" style="z-index: 10;">
  5. <!-- #endif -->
  6. <!-- #ifdef H5 -->
  7. <u-sticky offsetTop="-45" style="z-index: 10;">
  8. <!-- #endif -->
  9. <view class="navbar">
  10. <u-tabs ref="uTabs" :list="modelData" :activeStyle="{
  11. color: primary,
  12. transform: 'scale(1.05)'
  13. }" :inactiveStyle="{
  14. color: '#606266',
  15. transform: 'scale(1)'
  16. }" lineWidth="30" :scrollable="false" keyName="label" :lineColor="primary" :current="initIndex"
  17. @click="handle">
  18. </u-tabs>
  19. </view>
  20. </u-sticky>
  21. <view class="user bg-linear-gradient">
  22. <view>
  23. <view style="color: #fff;" class="red" v-cloak>{{ yaoqing || 0 }}</view>
  24. <view style="color: #fff;" class="name">已邀请人数</view>
  25. </view>
  26. <view>
  27. <view style="color: #fff;" class="red" v-cloak>{{ tMoney || 0 }}</view>
  28. <view style="color: #fff;" class="name">推荐总奖金</view>
  29. </view>
  30. </view>
  31. <view class="bonus ">
  32. <view class="detail">奖金明细</view>
  33. <view class="bonus-t">
  34. <text>头像</text>
  35. <text style="margin-left:46rpx;">昵称</text>
  36. <text>累计奖励</text>
  37. </view>
  38. <ul class="bonus-b">
  39. <li v-for="(item, index) in mingXi" :key="index">
  40. <image :src="item.headimgurl" alt="" v-if="item.headimgurl" />
  41. <image :src="settingFile.root_img+'/static/app/tab-my.png'" alt="" v-else="item.headimgurl" />
  42. <text class="nickname" v-if="item.nickname" v-cloak>{{ item.nickname }}</text>
  43. <text class="name" v-else>xx用户</text>
  44. <text class="red text-neutral" v-cloak>{{ item.total_yj }}</text>
  45. </li>
  46. </ul>
  47. <u-loadmore v-if="mingXi.length" :line="true" :status="status" :dashed='false' />
  48. <u-empty margin-top="60" style="height: 0% !important;width: 100%;" v-if="mingXi.length == 0"
  49. text="暂无更多数据" mode="list"></u-empty>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import mineApi from '@/api/mine/index';
  55. export default {
  56. data() {
  57. return {
  58. primary: this.$theme.primary,
  59. settingFile: getApp().globalData.siteinfo,
  60. index: 0,
  61. newList: [],
  62. oldList: [],
  63. initIndex: 0,
  64. content: '<p></p>',
  65. modelData: [{
  66. label: '一级用户'
  67. }, {
  68. label: '二级用户'
  69. }],
  70. yaoqing: 0,
  71. mingXi: [],
  72. name: '',
  73. tMoney: 0,
  74. page: 1,
  75. status: 'loadmore',
  76. };
  77. },
  78. methods: {
  79. handle(e) {
  80. this.index = e.index;
  81. this.initIndex = e.index;
  82. this.page = 1;
  83. if (this.index == 0) {
  84. this.getlist(1);
  85. } else {
  86. this.getlist(2);
  87. }
  88. },
  89. getlist(type) {
  90. var that = this;
  91. mineApi.myuser({
  92. type: type,
  93. p: that.page
  94. }).then(ret => {
  95. that.status = 'nomore'
  96. if (that.page == 1) {
  97. that.mingXi = [];
  98. }
  99. ret.data.cache.forEach(item => {
  100. that.mingXi.push(item);
  101. });
  102. if (ret.data.cache.length == 10) {
  103. that.status = 'loadmore'
  104. } else {
  105. that.status = 'nomore'
  106. }
  107. that.yaoqing = ret.data.total;
  108. });
  109. },
  110. },
  111. onReachBottom() {
  112. console.log('上拉加载了', this.initIndex)
  113. this.page++
  114. this.status = 'loading'
  115. if (this.initIndex == 0) {
  116. this.getlist(1);
  117. } else {
  118. this.getlist(2);
  119. }
  120. },
  121. onLoad(options) {
  122. this.getlist(1);
  123. this.tMoney = options.totalMoney;
  124. }
  125. };
  126. </script>
  127. <style lang="scss">
  128. .navbar {
  129. background-color: #ffffff;
  130. }
  131. .block {
  132. width: 100%;
  133. height: 75rpx;
  134. background: #f1f1f1;
  135. padding-top: 70rpx;
  136. .fle {
  137. width: 100%;
  138. margin-top: 90rpx;
  139. display: flex;
  140. align-items: center;
  141. height: 70rpx;
  142. position: fixed;
  143. background-color: #ffffff;
  144. top: 0;
  145. width: 100%;
  146. .item {
  147. width: 50%;
  148. text-align: center;
  149. line-height: 70rpx;
  150. }
  151. .line50 {
  152. position: absolute;
  153. bottom: -4rpx;
  154. left: 0;
  155. width: 18%;
  156. height: 6rpx;
  157. background-color: #ff8300;
  158. }
  159. .line100 {
  160. position: absolute;
  161. bottom: -4rpx;
  162. left: 0;
  163. transform: translateX(100%);
  164. width: 18%;
  165. height: 6rpx;
  166. background-color: #ff8300;
  167. }
  168. }
  169. }
  170. .onelevel {
  171. width: 100%;
  172. height: 100%;
  173. background: #f1f1f1;
  174. }
  175. .aui-bar.aui-bar-nav {
  176. position: fixed;
  177. top: 0;
  178. width: 100%;
  179. background-color: #ffc924;
  180. }
  181. .user {
  182. width: calc(100% - 35rpx);
  183. margin: 0 auto;
  184. height: 176rpx;
  185. margin-top: 15rpx;
  186. display: flex;
  187. justify-content: space-around;
  188. border-radius: 10rpx;
  189. }
  190. .user view {
  191. text-align: center;
  192. }
  193. .user view .red {
  194. margin-left: 10rpx;
  195. margin-top: 48rpx;
  196. font-size: 30rpx;
  197. font-family: PingFang SC;
  198. font-weight: bold;
  199. color: #ff1f1f;
  200. }
  201. .user view .name {
  202. margin-top: 24rpx;
  203. font-size: 30rpx;
  204. font-family: PingFang SC;
  205. font-weight: bold;
  206. color: #333333;
  207. }
  208. .bonus {
  209. width: calc(100% - 38rpx);
  210. margin: 0 auto;
  211. padding-bottom: 40rpx;
  212. margin-top: 20rpx;
  213. background-color: #ffffff;
  214. border-radius: 10rpx;
  215. min-height: 75vh;
  216. }
  217. .bonus .detail {
  218. padding-top: 34rpx;
  219. text-align: center;
  220. font-size: 30rpx;
  221. font-family: PingFang SC;
  222. font-weight: bold;
  223. color: rgba(51, 51, 51, 1);
  224. }
  225. .bonus .bonus-t {
  226. display: flex;
  227. width: calc(100% - 68rpx);
  228. margin: 40rpx auto;
  229. justify-content: space-between;
  230. }
  231. .bonus .bonus-t text {
  232. font-size: 26rpx;
  233. font-family: PingFang SC;
  234. font-weight: bold;
  235. color: rgba(153, 153, 153, 1);
  236. }
  237. .bonus-b {
  238. width: calc(100% - 68rpx);
  239. }
  240. .bonus-b li {
  241. width: calc(100% - 68rpx);
  242. margin: 30rpx auto;
  243. display: flex;
  244. justify-content: space-between;
  245. height: 72rpx;
  246. align-items: center;
  247. }
  248. .bonus-b li image {
  249. width: 72rpx;
  250. height: 72rpx;
  251. border-radius: 50%;
  252. }
  253. .bonus-b li .name {
  254. width: 170rpx;
  255. text-align: center;
  256. font-size: 24rpx;
  257. font-weight: bold;
  258. color: #666666;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. white-space: nowrap;
  262. }
  263. .bonus-b li .nickname {
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. }
  268. .bonus-b li .red {
  269. /*width:104rpx;*/
  270. text-align: center;
  271. font-size: 24rpx;
  272. font-family: PingFang SC;
  273. font-weight: bold;
  274. }
  275. </style>