team.vue 9.5 KB

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