myteam.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="status_bar">
  5. <!-- 这里是状态栏 -->
  6. </view>
  7. <!-- <view class="body-title">
  8. <view class="goback-box" @click="toBack">
  9. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  10. </view>
  11. <view class="header">我的推广</view>
  12. </view> -->
  13. <view class="content-bg">
  14. <image src="../../static/img/tg-bg.png" mode=""></image>
  15. </view>
  16. <view class="money-box">
  17. <view class="money">{{ all|| '0' }}</view>
  18. <view>我的影响指数</view>
  19. </view>
  20. <view class="money-box flex" style="padding-top: 20rpx;" >
  21. <view style="flex-grow: 1;" @click="navto('/pages/user/model/phb')"></view>
  22. <view style="flex-grow: 1;text-align: right;padding-right: 20rpx;" @click="navto('/pages/user/teamph')" v-if="userInfo.info_audit_status == 1">团队排行榜</view>
  23. </view>
  24. </view>
  25. <scroll-view class="list-scroll-content" :style="{ height: maxheight }" scroll-y @scrolltolower="loadData">
  26. <!-- <empty v-if="loaded === true && list.length === 0" :style="{ height: maxheight }"></empty> -->
  27. <view v-for="(item, index) in list" :key="index" class="order-item flex">
  28. <view class="title-box flex_item">
  29. <view class="title-avatar">
  30. <image :src="item.auth_info.avatar || item.avatar"></image>
  31. </view>
  32. <view class="list_tpl">
  33. <view class="title">
  34. <view class="title-name clamp">{{item.auth_info.name || item.nickname }}</view>
  35. </view>
  36. <view class="time">
  37. <text>ID:{{ item.uid }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <uni-load-more :status="loadingType"></uni-load-more>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. mapState,
  49. mapMutations
  50. } from 'vuex';
  51. import {
  52. getChildList
  53. } from '@/api/user.js'
  54. export default {
  55. onReady(res) {
  56. var _this = this;
  57. uni.getSystemInfo({
  58. success: resu => {
  59. const query = uni.createSelectorQuery();
  60. query.select('.list-scroll-content').boundingClientRect();
  61. query.exec(function(res) {
  62. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  63. console.log('打印页面的剩余高度', _this.height);
  64. });
  65. },
  66. fail: res => {}
  67. });
  68. },
  69. data() {
  70. return {
  71. // 头部图高度
  72. maxheight: '',
  73. loadingType: 'more',
  74. list: [],
  75. page: 1, //当前页数
  76. all: '',
  77. page: 1,
  78. pageSize: 10,
  79. loaded: false,
  80. };
  81. },
  82. computed: {
  83. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  84. ...mapState(['baseURL'])
  85. },
  86. onLoad(options) {},
  87. onShow() {
  88. this.loadData();
  89. },
  90. methods: {
  91. // 页面跳转
  92. navto(e) {
  93. uni.navigateTo({
  94. url: e
  95. });
  96. },
  97. //获取收入支出信息
  98. async loadData(source) {
  99. //这里是将订单挂载到tab列表下
  100. let that = this
  101. if (that.loadingType === 'loading') {
  102. //防止重复加载
  103. return;
  104. }
  105. if (that.loadingType === 'noMore') {
  106. //防止重复加载
  107. return;
  108. }
  109. // 修改当前对象状态为加载中
  110. that.loadingType = 'loading';
  111. getChildList({
  112. page: that.page,
  113. pageSize: that.pageSize,
  114. })
  115. .then(({
  116. data
  117. }) => {
  118. that.all = data.totalCount
  119. that.list = that.list.concat(data.list)
  120. that.page++
  121. if (that.pageSize == data.list.length) {
  122. //判断是否还有数据, 有改为 more, 没有改为noMore
  123. that.loadingType = 'more';
  124. } else {
  125. //判断是否还有数据, 有改为 more, 没有改为noMore
  126. that.loadingType = 'noMore';
  127. }
  128. that.$set(that, 'loaded', true);
  129. })
  130. .catch(e => {
  131. console.log(e);
  132. });
  133. },
  134. //swiper 切换
  135. changeTab(e) {
  136. this.tabCurrentIndex = e.target.current;
  137. this.loadData('tabChange');
  138. },
  139. //顶部tab点击
  140. tabClick(index) {
  141. this.tabCurrentIndex = index;
  142. },
  143. // 点击返回 我的页面
  144. toBack() {
  145. uni.switchTab({
  146. url: '/pages/user/user'
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss">
  153. page {
  154. background: #f8f8f8;
  155. height: 100%;
  156. }
  157. .status_bar {
  158. height: var(--status-bar-height);
  159. width: 100%;
  160. background: #5dbc7c;
  161. }
  162. .content-money {
  163. position: relative;
  164. height: 480rpx;
  165. .content-bg {
  166. position: absolute;
  167. top: 0;
  168. left: 0;
  169. right: 0;
  170. width: 750rpx;
  171. height: 480rpx;
  172. image {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. }
  177. .body-title {
  178. height: 80rpx;
  179. text-align: center;
  180. font-size: 35rpx;
  181. position: relative;
  182. .header {
  183. position: absolute;
  184. left: 0;
  185. top: 0;
  186. width: 100%;
  187. font-size: 36rpx;
  188. font-family: PingFang SC;
  189. font-weight: bold;
  190. color: #fffeff;
  191. height: 80rpx;
  192. font-size: 36rpx;
  193. font-weight: 700;
  194. z-index: 9;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. }
  199. .goback-box {
  200. position: absolute;
  201. left: 18rpx;
  202. top: 0;
  203. height: 80rpx;
  204. display: flex;
  205. align-items: center;
  206. }
  207. .goback {
  208. z-index: 100;
  209. width: 34rpx;
  210. height: 34rpx;
  211. }
  212. }
  213. }
  214. .money-box {
  215. position: relative;
  216. z-index: 2;
  217. padding-top: 90rpx;
  218. color: #ffffff;
  219. text-align: center;
  220. .money {
  221. font-size: 72rpx;
  222. font-family: PingFang SC;
  223. font-weight: bold;
  224. color: #ffffff;
  225. }
  226. .text {
  227. font-size: 30rpx;
  228. }
  229. }
  230. .order-item {
  231. padding: 20rpx 30rpx;
  232. line-height: 1.5;
  233. background-color: #fff;
  234. .title-box {
  235. width: 100%;
  236. .title-avatar {
  237. flex-shrink: 0;
  238. width: 100rpx;
  239. height: 100rpx;
  240. margin-right: 25rpx;
  241. border-radius: 100%;
  242. image {
  243. width: 100%;
  244. height: 100%;
  245. border-radius: 100%;
  246. }
  247. }
  248. .list_tpl {
  249. width: 85%;
  250. .title {
  251. display: flex;
  252. justify-content: flex-start;
  253. font-size: $font-lg;
  254. color: $font-color-base;
  255. overflow: hidden; //超出的文本隐藏
  256. text-overflow: ellipsis; //溢出用省略号显示
  257. white-space: nowrap;
  258. line-height: 1;
  259. text-align: center;
  260. .title-name {
  261. max-width: 40%;
  262. }
  263. .dl {
  264. margin-left: 10rpx;
  265. width: 93rpx;
  266. height: 32rpx;
  267. border-radius: 16rpx;
  268. image {
  269. width: 93rpx;
  270. height: 32rpx;
  271. border-radius: 16rpx;
  272. }
  273. }
  274. .class {
  275. display: inline-block;
  276. margin-left: 10rpx;
  277. padding: 6rpx;
  278. text-align: center;
  279. border: 1px solid #2e58ff;
  280. border-radius: 16rpx;
  281. font-size: 20rpx;
  282. font-family: PingFang SC;
  283. font-weight: 500;
  284. color: #2e58ff;
  285. }
  286. }
  287. .time {
  288. font-size: $font-lg;
  289. color: $font-color-light;
  290. }
  291. }
  292. }
  293. .money {
  294. width: 50%;
  295. text-align: right;
  296. color: #db1935;
  297. font-size: $font-lg;
  298. }
  299. }
  300. .yeji {
  301. position: relative;
  302. margin: -72rpx auto 0;
  303. width: 690rpx;
  304. height: 143rpx;
  305. background: #ffffff;
  306. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  307. border-radius: 10rpx;
  308. display: flex;
  309. align-items: center;
  310. .yeji-a {
  311. width: 50%;
  312. display: flex;
  313. flex-direction: column;
  314. justify-content: center;
  315. align-items: center;
  316. .yeji-top {
  317. font-size: 28rpx;
  318. font-family: PingFang SC;
  319. font-weight: bold;
  320. color: #333333;
  321. }
  322. .yeji-buttom {
  323. font-size: 42rpx;
  324. font-family: PingFang SC;
  325. font-weight: bold;
  326. color: #333333;
  327. }
  328. }
  329. .border {
  330. width: 1rpx;
  331. height: 51rpx;
  332. background: #dddddd;
  333. }
  334. }
  335. .navbar {
  336. margin-top: 20rpx;
  337. display: flex;
  338. height: 88rpx;
  339. padding: 0 5px;
  340. background: #fff;
  341. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  342. position: relative;
  343. z-index: 10;
  344. .nav-item {
  345. flex: 1;
  346. display: flex;
  347. justify-content: center;
  348. align-items: center;
  349. height: 100%;
  350. font-size: 15px;
  351. color: #999999;
  352. position: relative;
  353. &.current {
  354. color: #000;
  355. &:after {
  356. content: '';
  357. position: absolute;
  358. left: 50%;
  359. bottom: 0;
  360. transform: translateX(-50%);
  361. width: 44px;
  362. height: 0;
  363. border-bottom: 2px solid #fe5b38;
  364. }
  365. }
  366. }
  367. }
  368. .buttom-box {
  369. position: relative;
  370. background-color: #ffffff;
  371. text-align: center;
  372. padding: 30rpx 0;
  373. .buttom {
  374. flex-grow: 1;
  375. }
  376. .money {
  377. font-size: 32rpx;
  378. font-weight: bold;
  379. color: #ff4173;
  380. }
  381. .text {
  382. padding-bottom: 26rpx;
  383. font-size: 28rpx;
  384. font-weight: 500;
  385. color: #666666;
  386. &.current {
  387. border-bottom: 2px solid #ff4173;
  388. }
  389. }
  390. .icon {
  391. height: 50rpx;
  392. width: 48rpx;
  393. margin: 0 auto;
  394. .icon-img {
  395. width: 100%;
  396. height: 100%;
  397. }
  398. }
  399. }
  400. </style>