fission.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  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="https://cgst.liuniu946.com/image/fission.png" mode=""></image></view>
  10. <view class="money-box">
  11. <view class="money">
  12. {{ userInfo.white_integral | getMoneyStyle }}
  13. <text>人</text>
  14. </view>
  15. </view>
  16. </view>
  17. <swiper :style="{ height: height }" class="swiper-box" duration="300">
  18. <swiper-item class="tab-content">
  19. <scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  20. <!-- 空白页 -->
  21. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  22. <!-- 订单列表 -->
  23. <view>
  24. <view class="order-item flex" v-for="(item, index) in 10" :key="index" @click="navto('/pages/shop/fission-other')">
  25. <view class="title-box flex_item">
  26. <view class="title-avatar"><image src="../../static/error/missing-face.png"></image></view>
  27. <view class="list_tpl">
  28. <view class="title"><text>御风</text></view>
  29. <view class="time"><text>13541202523</text></view>
  30. </view>
  31. </view>
  32. <view class="money">
  33. 待裂变:
  34. <text class="status">3</text>
  35. <text class="jt">></text>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- <uni-load-more :status="tabItem.loadingType" v-if="!(tabItem.orderList.length == 0 && tabItem.loaded)"></uni-load-more> -->
  40. </scroll-view>
  41. </swiper-item>
  42. </swiper>
  43. </view>
  44. </template>
  45. <script>
  46. import { mapState, mapMutations } from 'vuex';
  47. import { getWhiteJf, getUserInfo } from '@/api/user.js';
  48. import { spreadCommission, userBalance } from '@/api/wallet.js';
  49. import { getMoneyStyle } from '@/utils/rocessor.js';
  50. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  51. import empty from '@/components/empty';
  52. export default {
  53. filters: {
  54. getMoneyStyle
  55. },
  56. components: {
  57. empty,
  58. uniLoadMore
  59. },
  60. onReady(res) {
  61. var _this = this;
  62. uni.getSystemInfo({
  63. success: resu => {
  64. const query = uni.createSelectorQuery();
  65. query.select('.swiper-box').boundingClientRect();
  66. query.exec(function(res) {
  67. _this.height = resu.windowHeight - res[0].top + 'px';
  68. console.log('打印页面的剩余高度', _this.height);
  69. });
  70. },
  71. fail: res => {}
  72. });
  73. },
  74. data() {
  75. return {
  76. height: '',
  77. // 头部图高度
  78. maxheight: '',
  79. navList: [],
  80. money: ''
  81. };
  82. },
  83. onLoad(options) {},
  84. onShow() {
  85. // this.loadData();
  86. // // 获取用户余额
  87. // getUserInfo({}).then(({ data }) => {
  88. // this.money = data.now_money;
  89. // this.setUserInfo(data);
  90. // });
  91. },
  92. computed: {
  93. ...mapState(['userInfo'])
  94. },
  95. methods: {
  96. ...mapMutations(['setUserInfo', 'setOrderInfo']),
  97. toBack() {
  98. uni.navigateBack({});
  99. },
  100. // 页面跳转
  101. navto(e) {
  102. uni.navigateTo({
  103. url: e
  104. });
  105. },
  106. //获取收入支出信息
  107. async loadData(source) {
  108. let obj = this;
  109. //这里是将订单挂载到tab列表下
  110. if (source === 'tabChange' && navItem.loaded === true) {
  111. //tab切换只有第一次需要加载数据
  112. return;
  113. }
  114. if (navItem.loadingType === 'loading') {
  115. //防止重复加载
  116. return;
  117. }
  118. // 修改当前对象状态为加载中
  119. navItem.loadingType = 'loading';
  120. getWhiteJf({
  121. page: navItem.page,
  122. limit: navItem.limit,
  123. pm: navItem.state
  124. })
  125. .then(({ data }) => {
  126. this.zc = data.zc;
  127. this.sr = data.sr;
  128. navItem.orderList = navItem.orderList.concat(data.list);
  129. navItem.page++;
  130. if (navItem.limit == data.list.length) {
  131. navItem.loadingType = 'more';
  132. } else {
  133. navItem.loadingType = 'noMore';
  134. }
  135. this.$set(navItem, 'loaded', true);
  136. })
  137. .catch(e => {
  138. console.log(e);
  139. });
  140. },
  141. //swiper 切换
  142. changeTab(e) {
  143. this.tabCurrentIndex = e.target.current;
  144. this.loadData('tabChange');
  145. },
  146. //顶部tab点击
  147. tabClick(index) {
  148. this.tabCurrentIndex = index;
  149. }
  150. }
  151. };
  152. </script>
  153. <style lang="scss">
  154. page {
  155. background: #fff;
  156. height: 100%;
  157. }
  158. .status_bar {
  159. height: var(--status-bar-height);
  160. width: 100%;
  161. }
  162. .content-money {
  163. position: relative;
  164. height: 430rpx;
  165. .content-bg {
  166. position: absolute;
  167. top: 0;
  168. left: 0;
  169. right: 0;
  170. width: 750rpx;
  171. height: 430rpx;
  172. image {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. }
  177. .body-title {
  178. height: 80rpx;
  179. text-align: center;
  180. font-size: 35rpx;
  181. position: relative;
  182. .header {
  183. position: absolute;
  184. left: 0;
  185. top: 0;
  186. width: 100%;
  187. font-size: 36rpx;
  188. font-family: PingFang SC;
  189. font-weight: bold;
  190. color: #fffeff;
  191. height: 80rpx;
  192. font-size: 36rpx;
  193. font-weight: 700;
  194. z-index: 9;
  195. display: flex;
  196. justify-content: center;
  197. align-items: center;
  198. }
  199. .goback-box {
  200. position: absolute;
  201. left: 18rpx;
  202. top: 0;
  203. height: 80rpx;
  204. display: flex;
  205. align-items: center;
  206. }
  207. .goback {
  208. z-index: 100;
  209. width: 34rpx;
  210. height: 34rpx;
  211. }
  212. }
  213. }
  214. .money-box {
  215. position: relative;
  216. z-index: 2;
  217. padding-top: 100rpx;
  218. color: #ffffff;
  219. text-align: center;
  220. /* #ifdef APP-PLUS */
  221. padding-top: 30rpx;
  222. /* #endif */
  223. .money {
  224. font-size: 72rpx;
  225. font-family: PingFang SC;
  226. font-weight: bold;
  227. color: #ffffff;
  228. text {
  229. font-size: 36rpx;
  230. }
  231. }
  232. .text {
  233. font-size: 30rpx;
  234. }
  235. }
  236. //列表
  237. .swiper-box {
  238. .order-item:last-child {
  239. margin-bottom: 60rpx;
  240. }
  241. .order-item {
  242. padding: 20rpx 30rpx;
  243. line-height: 1.5;
  244. .title-box {
  245. width: 100%;
  246. .title-avatar {
  247. width: 100rpx;
  248. height: 100rpx;
  249. margin-right: 25rpx;
  250. image {
  251. width: 100%;
  252. height: 100%;
  253. border-radius: 100%;
  254. }
  255. }
  256. .list_tpl {
  257. width: 50%;
  258. .title {
  259. font-size: $font-lg;
  260. color: $font-color-base;
  261. overflow: hidden; //超出的文本隐藏
  262. text-overflow: ellipsis; //溢出用省略号显示
  263. white-space: nowrap;
  264. }
  265. .time {
  266. margin-top: 15rpx;
  267. font-size: 22rpx;
  268. color: $font-color-light;
  269. }
  270. }
  271. }
  272. .money {
  273. width: 30%;
  274. font-size: 30rpx;
  275. font-family: PingFang SC;
  276. font-weight: 500;
  277. color: #333333;
  278. text-align: right;
  279. .status {
  280. color: #ff4c4c;
  281. }
  282. .jt {
  283. color: #999999;
  284. display: inline-block;
  285. margin-left: 10rpx;
  286. }
  287. }
  288. }
  289. }
  290. .list-scroll-content {
  291. background: #ffffff;
  292. height: 100%;
  293. }
  294. .content {
  295. height: 100%;
  296. background-color: #ffffff;
  297. }
  298. .btn-box {
  299. width: 674rpx;
  300. height: 88rpx;
  301. background: linear-gradient(0deg, #2e58ff, #32c6ff);
  302. border-radius: 44rpx;
  303. font-size: 36rpx;
  304. font-family: PingFang SC;
  305. font-weight: 500;
  306. color: #ffffff;
  307. text-align: center;
  308. line-height: 88rpx;
  309. position: fixed;
  310. bottom: 48rpx;
  311. left: 0;
  312. right: 0;
  313. margin: 0 auto;
  314. }
  315. </style>