myteam.vue 8.7 KB

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