promotion.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <image src="../../static/img/promation.png" mode="" class="bg"></image>
  5. <view class="money-box">
  6. <view class="money">
  7. {{ all }}
  8. <text>人</text>
  9. </view>
  10. <view class="text">我的推广人数</view>
  11. </view>
  12. </view>
  13. <view class="navbar flex">
  14. <view class="nav-item">
  15. <view class="num">5</view>
  16. <view class="font">奖励层数</view>
  17. </view>
  18. <view class="xian"></view>
  19. <view class="nav-item">
  20. <view class="num">120</view>
  21. <view class="font">成交人数</view>
  22. </view>
  23. </view>
  24. <view class="swiper-box" :style="{ height: maxheight + 'px' }">
  25. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  26. <!-- 空白页 -->
  27. <empty v-if="loaded === true && list.length === 0"></empty>
  28. <!-- 订单列表 -->
  29. <view class="order-item flex" v-for="(item, index) in list" :key="index">
  30. <view class="title-box flex_item">
  31. <view class="title-avatar"><image :src="item.avatar"></image></view>
  32. <view class="list_tpl">
  33. <view class="title">
  34. <text>{{ item.email || item.phone }}</text>
  35. </view>
  36. <view class="time">
  37. <text>{{ item.time }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <uni-load-more :status="loadingType"></uni-load-more>
  43. </scroll-view>
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. import { spreadCommission, userBalance } from '@/api/wallet.js';
  49. import { mapState, mapMutations } from 'vuex';
  50. import { getMoneyStyle } from '@/utils/rocessor.js';
  51. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  52. import empty from '@/components/empty';
  53. export default {
  54. components: {
  55. empty,
  56. uniLoadMore
  57. },
  58. onReady() {
  59. //初始化获取页面宽度
  60. uni.createSelectorQuery()
  61. .select('.content')
  62. .fields(
  63. {
  64. size: true
  65. },
  66. data => {
  67. console.log(data);
  68. console.log(Math.floor((data.width / 750) * 300));
  69. //保存头部高度
  70. this.maxheight = data.height - Math.floor((data.width / 750) * 570);
  71. console.log(this.maxheight);
  72. }
  73. )
  74. .exec();
  75. },
  76. data() {
  77. return {
  78. // 头部图高度
  79. maxheight: '',
  80. tabCurrentIndex: 0,
  81. all: '100',
  82. list: '',
  83. loadingType: 'more'
  84. };
  85. },
  86. onLoad(options) {},
  87. onShow() {
  88. // this.loadData();
  89. },
  90. methods: {
  91. navto(e) {
  92. uni.navigateTo({
  93. url: e
  94. });
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="scss">
  100. page {
  101. background: #000;
  102. height: 100%;
  103. }
  104. .content-money {
  105. padding-bottom: 30rpx;
  106. background: $page-color-base;
  107. position: relative;
  108. .bg {
  109. position: absolute;
  110. width: 100%;
  111. }
  112. .moneyTx {
  113. position: absolute;
  114. top: 150rpx;
  115. right: 0rpx;
  116. width: 150rpx;
  117. padding: 10rpx 30rpx;
  118. border: 2px solid #ffffff;
  119. border-top-left-radius: 99rpx;
  120. border-bottom-left-radius: 99rpx;
  121. color: #ffffff;
  122. line-height: 1;
  123. font-size: $font-base;
  124. }
  125. .buttom-box {
  126. background-color: #ffffff;
  127. text-align: center;
  128. margin: 0 30rpx;
  129. padding: 20rpx 0;
  130. border-radius: $border-radius-sm;
  131. margin-top: -60rpx;
  132. .buttom {
  133. font-size: $font-lg;
  134. flex-grow: 1;
  135. }
  136. .interval {
  137. width: 2px;
  138. height: 60rpx;
  139. background-color: #eeeeee;
  140. }
  141. .icon {
  142. height: 50rpx;
  143. width: 48rpx;
  144. margin: 0 auto;
  145. .icon-img {
  146. width: 100%;
  147. height: 100%;
  148. }
  149. }
  150. }
  151. }
  152. .money-box {
  153. // background-color: $base-color;
  154. padding-top: var(--status-bar-height);
  155. height: 368rpx;
  156. color: #fad6b0;
  157. text-align: center;
  158. position: relative;
  159. .text {
  160. font-size: $font-sm;
  161. }
  162. .money {
  163. padding-top: 147rpx;
  164. font-size: 47px;
  165. font-family: PingFang SC;
  166. font-weight: bold;
  167. text {
  168. font-size: 24px;
  169. }
  170. }
  171. }
  172. .navbar {
  173. width: 702rpx;
  174. height: auto;
  175. padding: 20rpx 0;
  176. background: linear-gradient(90deg, #393326, #27221d);
  177. border: 2rpx solid #f5d2ad;
  178. border-radius: 10rpx;
  179. position: relative;
  180. z-index: 10;
  181. margin: 0 auto;
  182. .xian {
  183. width: 2rpx;
  184. height: 54rpx;
  185. background: #eeeeee;
  186. }
  187. .nav-item {
  188. display: flex;
  189. flex-direction: column;
  190. justify-content: center;
  191. align-items: center;
  192. height: 100%;
  193. font-size: 15px;
  194. color: #fff;
  195. position: relative;
  196. width: 50%;
  197. .num {
  198. font-size: 32rpx;
  199. font-family: PingFang SC;
  200. font-weight: bold;
  201. color: #fad6b0;
  202. }
  203. .font {
  204. font-size: 28rpx;
  205. font-family: PingFang SC;
  206. font-weight: 500;
  207. color: #ffffff;
  208. }
  209. }
  210. }
  211. //列表
  212. .swiper-box {
  213. padding-top: 10rpx;
  214. .order-item {
  215. padding: 20rpx 30rpx;
  216. line-height: 1.5;
  217. .title-box {
  218. width: 100%;
  219. .title-avatar {
  220. width: 100rpx;
  221. height: 100rpx;
  222. margin-right: 25rpx;
  223. border-radius: 100%;
  224. image {
  225. width: 100%;
  226. height: 100%;
  227. border-radius: 100%;
  228. }
  229. }
  230. .list_tpl {
  231. width: 85%;
  232. .title {
  233. font-size: $font-lg;
  234. color: $font-color-base;
  235. overflow: hidden; //超出的文本隐藏
  236. text-overflow: ellipsis; //溢出用省略号显示
  237. white-space: nowrap;
  238. }
  239. .time {
  240. font-size: $font-base;
  241. color: $font-color-light;
  242. }
  243. }
  244. }
  245. .money {
  246. color: #db1935;
  247. font-size: $font-lg;
  248. }
  249. }
  250. }
  251. .content {
  252. height: 100%;
  253. .empty-content {
  254. background-color: #000;
  255. }
  256. }
  257. </style>