team.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="money-box">
  5. <view class="goback-box" @click="toBack"><image class="goback" src="../../static/img/fanhui.png" mode=""></image></view>
  6. <view class="header">我的推广</view>
  7. <image src="../../static/img/anchor9.png" mode="" class="money_bg"></image>
  8. <view class="money">
  9. <text>共</text>
  10. {{ all.all || 0 }}
  11. <text>人</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="navbar flex">
  16. <view class="nav-item">
  17. <view class="num">0</view>
  18. <view class="font">个人消费</view>
  19. </view>
  20. <view class="xian"></view>
  21. <view class="nav-item">
  22. <view class="num">0</view>
  23. <view class="font">团体消费</view>
  24. </view>
  25. </view>
  26. <view class="swiper-box" :style="{ height: height }">
  27. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData" :style="{ height: height }">
  28. <!-- 空白页 -->
  29. <!-- <empty v-if="list.length === 0"></empty> -->
  30. <!-- 订单列表 -->
  31. <view class="order-item flex" v-for="(item, index) in list" :key="index">
  32. <view class="title-box flex_item">
  33. <view class="title-avatar"><image :src="item.avatar || '/static/error/missing-face.png'"></image></view>
  34. <view class="list_tpl">
  35. <view class="title">
  36. <text>{{ item.mobile || item.email }}</text>
  37. </view>
  38. <view class="time">
  39. <text>{{ item.time }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <uni-load-more :status="loadingType"></uni-load-more>
  45. </scroll-view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import { spread_children,num } from '@/api/user.js';
  51. import { mapState, mapMutations } from 'vuex';
  52. import { getMoneyStyle, getTime } from '@/utils/rocessor.js';
  53. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  54. import empty from '@/components/empty';
  55. export default {
  56. components: {
  57. empty,
  58. uniLoadMore
  59. },
  60. onReady(res) {
  61. var obj = this;
  62. uni.getSystemInfo({
  63. success: resu => {
  64. const query = uni.createSelectorQuery();
  65. query.select('.swiper-box').boundingClientRect();
  66. query.exec(function(res) {
  67. console.log(res, 'ddddddddddddd');
  68. obj.height = resu.windowHeight - res[0].top + 'px';
  69. console.log('打印页面的剩余高度', obj.height);
  70. });
  71. },
  72. fail: res => {}
  73. });
  74. },
  75. data() {
  76. return {
  77. // 头部图高度
  78. height: '',
  79. tabCurrentIndex: 0,
  80. all: '',
  81. list: [],
  82. loadingType: 'more',
  83. limit: 10,
  84. page: 1,
  85. id: ''
  86. };
  87. },
  88. onShow() {
  89. this.id = this.userInfo.id;
  90. num().then(({data}) =>{
  91. console.log(data)
  92. this.all = data
  93. })
  94. this.loadData();
  95. },
  96. computed: {
  97. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  98. },
  99. methods: {
  100. loadData() {
  101. const obj = this;
  102. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  103. return;
  104. }
  105. obj.loadingType == 'loading';
  106. spread_children({ limit: obj.limit, page: obj.page }, obj.id).then(({ data }) => {
  107. data.forEach(e => {
  108. e.time = getTime(e.createtime);
  109. });
  110. console.log(data,'123456');
  111. obj.list = obj.list.concat(data);
  112. // obj.list = data
  113. obj.page++;
  114. if (data.length == obj.limit) {
  115. obj.loadingType = 'more';
  116. return
  117. } else {
  118. obj.loadingType = 'noMore';
  119. }
  120. });
  121. },
  122. navto(e) {
  123. uni.navigateTo({
  124. url: e
  125. });
  126. },
  127. toBack() {
  128. uni.switchTab({
  129. url: '/pages/user/user'
  130. });
  131. }
  132. }
  133. };
  134. </script>
  135. <style lang="scss">
  136. page {
  137. background: #f1f1f1;
  138. height: 100%;
  139. }
  140. .content-money {
  141. height: 480rpx;
  142. padding-bottom: 30rpx;
  143. background: $page-color-base;
  144. position: relative;
  145. .moneyTx {
  146. position: absolute;
  147. top: 150rpx;
  148. right: 0rpx;
  149. width: 150rpx;
  150. padding: 10rpx 30rpx;
  151. border: 2px solid #ffffff;
  152. border-top-left-radius: 99rpx;
  153. border-bottom-left-radius: 99rpx;
  154. color: #ffffff;
  155. line-height: 1;
  156. font-size: $font-base;
  157. }
  158. .buttom-box {
  159. background-color: #ffffff;
  160. text-align: center;
  161. margin: 0 30rpx;
  162. padding: 20rpx 0;
  163. border-radius: $border-radius-sm;
  164. margin-top: -60rpx;
  165. .buttom {
  166. font-size: $font-lg;
  167. flex-grow: 1;
  168. }
  169. .interval {
  170. width: 2px;
  171. height: 60rpx;
  172. background-color: #eeeeee;
  173. }
  174. .icon {
  175. height: 50rpx;
  176. width: 48rpx;
  177. margin: 0 auto;
  178. .icon-img {
  179. width: 100%;
  180. height: 100%;
  181. }
  182. }
  183. }
  184. }
  185. .money-box {
  186. height: 470rpx;
  187. color: #FFFFFF;
  188. text-align: center;
  189. position: relative;
  190. .header {
  191. position: absolute;
  192. left: 0;
  193. top: 0;
  194. width: 100%;
  195. height: 80rpx;
  196. font-size: 32rpx;
  197. font-weight: 700;
  198. z-index: 99;
  199. display: flex;
  200. justify-content: center;
  201. align-items: center;
  202. }
  203. .goback-box {
  204. position: absolute;
  205. left: 18rpx;
  206. top: 0;
  207. height: 80rpx;
  208. display: flex;
  209. align-items: center;
  210. }
  211. .goback {
  212. z-index: 100;
  213. width: 34rpx;
  214. height: 34rpx;
  215. }
  216. .money_bg {
  217. width: 100%;
  218. height: 470rpx;
  219. display: block;
  220. }
  221. .text {
  222. padding-top: 80rpx;
  223. font-size: $font-sm;
  224. }
  225. .money {
  226. position: absolute;
  227. top: 0;
  228. width: 100%;
  229. padding-top: 186rpx;
  230. font-size: 60rpx;
  231. font-weight: bold;
  232. font-size: 82rpx;
  233. text {
  234. font-size: 36rpx;
  235. }
  236. }
  237. }
  238. .navbar {
  239. width: 702rpx;
  240. height: auto;
  241. padding: 20rpx 0;
  242. background: #FFFFFF;
  243. border-radius: 10rpx;
  244. position: relative;
  245. z-index: 10;
  246. margin: -60rpx auto;
  247. .xian {
  248. width: 2rpx;
  249. height: 54rpx;
  250. background: #eeeeee;
  251. }
  252. .nav-item {
  253. display: flex;
  254. flex-direction: column;
  255. justify-content: center;
  256. align-items: center;
  257. height: 100%;
  258. font-size: 15px;
  259. color: #fff;
  260. position: relative;
  261. width: 50%;
  262. .num {
  263. font-size: 32rpx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. color: #333333;
  267. }
  268. .font {
  269. margin-top: 10rpx;
  270. font-size: 28rpx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #000;
  274. }
  275. }
  276. }
  277. //列表
  278. .swiper-box {
  279. margin-top: 74rpx;
  280. background: #FFFFFF;
  281. .order-item {
  282. padding: 20rpx 30rpx;
  283. line-height: 1.5;
  284. .title-box {
  285. width: 100%;
  286. .title-avatar {
  287. width: 100rpx;
  288. height: 100rpx;
  289. margin-right: 25rpx;
  290. border-radius: 100%;
  291. image {
  292. width: 100%;
  293. height: 100%;
  294. border-radius: 100%;
  295. }
  296. }
  297. .list_tpl {
  298. width: 85%;
  299. .title {
  300. font-size: $font-lg;
  301. color: $font-color-base;
  302. overflow: hidden; //超出的文本隐藏
  303. text-overflow: ellipsis; //溢出用省略号显示
  304. white-space: nowrap;
  305. }
  306. .time {
  307. font-size: $font-base;
  308. color: $font-color-light;
  309. }
  310. }
  311. }
  312. .money {
  313. color: #db1935;
  314. font-size: $font-lg;
  315. }
  316. }
  317. }
  318. .content {
  319. height: 100%;
  320. .empty-content {
  321. background-color: #000;
  322. }
  323. }
  324. </style>