team.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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 || 0 }}
  11. <text>人</text>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="navbar flex">
  16. <view class="nav-item">
  17. <view class="num">{{ userInfo.consume }}</view>
  18. <view class="font">个人消费</view>
  19. </view>
  20. <view class="xian"></view>
  21. <view class="nav-item">
  22. <view class="num">{{ userInfo.trem_consume }}</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.nickname }}</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 } 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. this.loadData();
  91. },
  92. computed: {
  93. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  94. },
  95. methods: {
  96. loadData() {
  97. const obj = this;
  98. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  99. return;
  100. }
  101. obj.loadingType == 'loading';
  102. spread({ limit: obj.limit, page: obj.page }).then(({ data }) => {
  103. console.log(data,'123456')
  104. obj.all = data.total;
  105. obj.list = obj.list.concat(data.list);
  106. obj.page++;
  107. if (data.length == obj.limit) {
  108. obj.loadingType = 'more';
  109. return
  110. } else {
  111. obj.loadingType = 'noMore';
  112. }
  113. });
  114. },
  115. navto(e) {
  116. uni.navigateTo({
  117. url: e
  118. });
  119. },
  120. toBack() {
  121. uni.switchTab({
  122. url: '/pages/user/user'
  123. });
  124. }
  125. }
  126. };
  127. </script>
  128. <style lang="scss">
  129. page {
  130. background: #f1f1f1;
  131. height: 100%;
  132. }
  133. .content-money {
  134. height: 480rpx;
  135. padding-bottom: 30rpx;
  136. background: $page-color-base;
  137. position: relative;
  138. .moneyTx {
  139. position: absolute;
  140. top: 150rpx;
  141. right: 0rpx;
  142. width: 150rpx;
  143. padding: 10rpx 30rpx;
  144. border: 2px solid #ffffff;
  145. border-top-left-radius: 99rpx;
  146. border-bottom-left-radius: 99rpx;
  147. color: #ffffff;
  148. line-height: 1;
  149. font-size: $font-base;
  150. }
  151. .buttom-box {
  152. background-color: #ffffff;
  153. text-align: center;
  154. margin: 0 30rpx;
  155. padding: 20rpx 0;
  156. border-radius: $border-radius-sm;
  157. margin-top: -60rpx;
  158. .buttom {
  159. font-size: $font-lg;
  160. flex-grow: 1;
  161. }
  162. .interval {
  163. width: 2px;
  164. height: 60rpx;
  165. background-color: #eeeeee;
  166. }
  167. .icon {
  168. height: 50rpx;
  169. width: 48rpx;
  170. margin: 0 auto;
  171. .icon-img {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. }
  176. }
  177. }
  178. .money-box {
  179. height: 470rpx;
  180. color: #FFFFFF;
  181. text-align: center;
  182. position: relative;
  183. .header {
  184. position: absolute;
  185. left: 0;
  186. top: 0;
  187. width: 100%;
  188. height: 80rpx;
  189. font-size: 32rpx;
  190. font-weight: 700;
  191. z-index: 99;
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. }
  196. .goback-box {
  197. position: absolute;
  198. left: 18rpx;
  199. top: 0;
  200. height: 80rpx;
  201. display: flex;
  202. align-items: center;
  203. }
  204. .goback {
  205. z-index: 100;
  206. width: 34rpx;
  207. height: 34rpx;
  208. }
  209. .money_bg {
  210. width: 100%;
  211. height: 470rpx;
  212. display: block;
  213. }
  214. .text {
  215. padding-top: 80rpx;
  216. font-size: $font-sm;
  217. }
  218. .money {
  219. position: absolute;
  220. top: 0;
  221. width: 100%;
  222. padding-top: 186rpx;
  223. font-size: 60rpx;
  224. font-weight: bold;
  225. font-size: 82rpx;
  226. text {
  227. font-size: 36rpx;
  228. }
  229. }
  230. }
  231. .navbar {
  232. width: 702rpx;
  233. height: auto;
  234. padding: 20rpx 0;
  235. background: #FFFFFF;
  236. border-radius: 10rpx;
  237. position: relative;
  238. z-index: 10;
  239. margin: -60rpx auto;
  240. .xian {
  241. width: 2rpx;
  242. height: 54rpx;
  243. background: #eeeeee;
  244. }
  245. .nav-item {
  246. display: flex;
  247. flex-direction: column;
  248. justify-content: center;
  249. align-items: center;
  250. height: 100%;
  251. font-size: 15px;
  252. color: #fff;
  253. position: relative;
  254. width: 50%;
  255. .num {
  256. font-size: 32rpx;
  257. font-family: PingFang SC;
  258. font-weight: 500;
  259. color: #333333;
  260. }
  261. .font {
  262. margin-top: 10rpx;
  263. font-size: 28rpx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. color: #000;
  267. }
  268. }
  269. }
  270. //列表
  271. .swiper-box {
  272. margin-top: 74rpx;
  273. background: #FFFFFF;
  274. .order-item {
  275. padding: 20rpx 30rpx;
  276. line-height: 1.5;
  277. .title-box {
  278. width: 100%;
  279. .title-avatar {
  280. width: 100rpx;
  281. height: 100rpx;
  282. margin-right: 25rpx;
  283. border-radius: 100%;
  284. image {
  285. width: 100%;
  286. height: 100%;
  287. border-radius: 100%;
  288. }
  289. }
  290. .list_tpl {
  291. width: 85%;
  292. .title {
  293. font-size: $font-lg;
  294. color: $font-color-base;
  295. overflow: hidden; //超出的文本隐藏
  296. text-overflow: ellipsis; //溢出用省略号显示
  297. white-space: nowrap;
  298. }
  299. .time {
  300. font-size: $font-base;
  301. color: $font-color-light;
  302. }
  303. }
  304. }
  305. .money {
  306. color: #db1935;
  307. font-size: $font-lg;
  308. }
  309. }
  310. }
  311. .content {
  312. height: 100%;
  313. .empty-content {
  314. background-color: #000;
  315. }
  316. }
  317. </style>