promotion.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 || 0 }}
  8. <text>{{$t('hea.ren')}}</text>
  9. </view>
  10. <view class="text">{{$t('hea.wdtgrs')}}</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: height }">
  25. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData" :style="{ height: height }">
  26. <!-- 空白页 -->
  27. <!-- <empty v-if="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 || '/static/error/missing-face.png'"></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 { spread_children,num } from '@/api/user.js';
  49. import { mapState, mapMutations } from 'vuex';
  50. import { getMoneyStyle, getTime } 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(res) {
  59. var obj = this;
  60. uni.getSystemInfo({
  61. success: resu => {
  62. const query = uni.createSelectorQuery();
  63. query.select('.swiper-box').boundingClientRect();
  64. query.exec(function(res) {
  65. console.log(res, 'ddddddddddddd');
  66. obj.height = resu.windowHeight - res[0].top + 'px';
  67. console.log('打印页面的剩余高度', obj.height);
  68. });
  69. },
  70. fail: res => {}
  71. });
  72. },
  73. data() {
  74. return {
  75. // 头部图高度
  76. height: '',
  77. tabCurrentIndex: 0,
  78. all: '',
  79. list: [],
  80. loadingType: 'more',
  81. limit: 10,
  82. page: 1,
  83. id: ''
  84. };
  85. },
  86. onShow() {
  87. this.id = this.userInfo.id;
  88. num().then(({data}) =>{
  89. this.all = data
  90. })
  91. this.loadData();
  92. },
  93. computed: {
  94. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  95. },
  96. methods: {
  97. loadData() {
  98. const obj = this;
  99. if (obj.loadingType == 'noMore' || obj.loadingType == 'loading') {
  100. return;
  101. }
  102. obj.loadingType == 'loading';
  103. spread_children({ limit: obj.limit, page: obj.page }, obj.id).then(({ data }) => {
  104. data.forEach(e => {
  105. e.time = getTime(e.createtime);
  106. });
  107. console.log(data,'123456');
  108. obj.list = obj.list.concat(data);
  109. // obj.list = data
  110. obj.page++;
  111. if (data.length == obj.limit) {
  112. obj.loadingType = 'more';
  113. return
  114. } else {
  115. obj.loadingType = 'noMore';
  116. }
  117. });
  118. },
  119. navto(e) {
  120. uni.navigateTo({
  121. url: e
  122. });
  123. }
  124. }
  125. };
  126. </script>
  127. <style lang="scss">
  128. page {
  129. background: #000;
  130. height: 100%;
  131. }
  132. .content-money {
  133. height: 480rpx;
  134. padding-bottom: 30rpx;
  135. background: $page-color-base;
  136. position: relative;
  137. .bg {
  138. position: absolute;
  139. width: 100%;
  140. }
  141. .moneyTx {
  142. position: absolute;
  143. top: 150rpx;
  144. right: 0rpx;
  145. width: 150rpx;
  146. padding: 10rpx 30rpx;
  147. border: 2px solid #ffffff;
  148. border-top-left-radius: 99rpx;
  149. border-bottom-left-radius: 99rpx;
  150. color: #ffffff;
  151. line-height: 1;
  152. font-size: $font-base;
  153. }
  154. .buttom-box {
  155. background-color: #ffffff;
  156. text-align: center;
  157. margin: 0 30rpx;
  158. padding: 20rpx 0;
  159. border-radius: $border-radius-sm;
  160. margin-top: -60rpx;
  161. .buttom {
  162. font-size: $font-lg;
  163. flex-grow: 1;
  164. }
  165. .interval {
  166. width: 2px;
  167. height: 60rpx;
  168. background-color: #eeeeee;
  169. }
  170. .icon {
  171. height: 50rpx;
  172. width: 48rpx;
  173. margin: 0 auto;
  174. .icon-img {
  175. width: 100%;
  176. height: 100%;
  177. }
  178. }
  179. }
  180. }
  181. .money-box {
  182. // background-color: $base-color;
  183. padding-top: var(--status-bar-height);
  184. height: 368rpx;
  185. color: #fad6b0;
  186. text-align: center;
  187. position: relative;
  188. .text {
  189. font-size: $font-sm;
  190. }
  191. .money {
  192. padding-top: 147rpx;
  193. font-size: 47px;
  194. font-family: PingFang SC;
  195. font-weight: bold;
  196. text {
  197. font-size: 24px;
  198. }
  199. }
  200. }
  201. .navbar {
  202. width: 702rpx;
  203. height: auto;
  204. padding: 20rpx 0;
  205. background: linear-gradient(90deg, #393326, #27221d);
  206. border: 2rpx solid #f5d2ad;
  207. border-radius: 10rpx;
  208. position: relative;
  209. z-index: 10;
  210. margin: 0 auto;
  211. .xian {
  212. width: 2rpx;
  213. height: 54rpx;
  214. background: #eeeeee;
  215. }
  216. .nav-item {
  217. display: flex;
  218. flex-direction: column;
  219. justify-content: center;
  220. align-items: center;
  221. height: 100%;
  222. font-size: 15px;
  223. color: #fff;
  224. position: relative;
  225. width: 50%;
  226. .num {
  227. font-size: 32rpx;
  228. font-family: PingFang SC;
  229. font-weight: bold;
  230. color: #fad6b0;
  231. }
  232. .font {
  233. font-size: 28rpx;
  234. font-family: PingFang SC;
  235. font-weight: 500;
  236. color: #ffffff;
  237. }
  238. }
  239. }
  240. //列表
  241. .swiper-box {
  242. margin-top: 20rpx;
  243. .order-item {
  244. padding: 20rpx 30rpx;
  245. line-height: 1.5;
  246. .title-box {
  247. width: 100%;
  248. .title-avatar {
  249. width: 100rpx;
  250. height: 100rpx;
  251. margin-right: 25rpx;
  252. border-radius: 100%;
  253. image {
  254. width: 100%;
  255. height: 100%;
  256. border-radius: 100%;
  257. }
  258. }
  259. .list_tpl {
  260. width: 85%;
  261. .title {
  262. font-size: $font-lg;
  263. color: $font-color-base;
  264. overflow: hidden; //超出的文本隐藏
  265. text-overflow: ellipsis; //溢出用省略号显示
  266. white-space: nowrap;
  267. }
  268. .time {
  269. font-size: $font-base;
  270. color: $font-color-light;
  271. }
  272. }
  273. }
  274. .money {
  275. color: #db1935;
  276. font-size: $font-lg;
  277. }
  278. }
  279. }
  280. .content {
  281. height: 100%;
  282. .empty-content {
  283. background-color: #000;
  284. }
  285. }
  286. </style>