team.vue 6.4 KB

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