team.vue 8.3 KB

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