JDcool.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="money-box">
  5. <view class="goback-box" @click="toBack">
  6. <image class="goback" src="../../static/img/fanhui.png" mode=""></image>
  7. </view>
  8. <view class="header">金豆池</view>
  9. <image class="money_bg" src="../../static/img/anchor8.png"></image>
  10. <view class="money">{{jd}}</view>
  11. <view class="tip">
  12. 金豆数量
  13. </view>
  14. </view>
  15. </view>
  16. <view class="title">
  17. - 实时累计 -
  18. </view>
  19. <scroll-view class="swiper-box" scroll-y>
  20. <!-- 空白页 -->
  21. <!-- <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty> -->
  22. <!-- 订单列表 -->
  23. <template>
  24. <view v-for="(item, index) in dataList" class="order-item flex">
  25. <view class="left flex">
  26. <view class="avator">
  27. <image :src="item.pay_evaluation" mode=""></image>
  28. </view>
  29. <view class="order-font">
  30. {{item.user.real_name}}扣除<text>{{item.use_integral}}</text>个金豆
  31. </view>
  32. </view>
  33. <view class="time">
  34. {{item.add_time}}
  35. </view>
  36. </view>
  37. </template>
  38. <!-- <uni-load-more :status="tabItem.loadingType"></uni-load-more> -->
  39. </scroll-view>
  40. </view>
  41. </template>
  42. <script>
  43. import {
  44. getTime
  45. } from '@/utils/rocessor.js'
  46. import {
  47. jdCoool
  48. } from '@/api/wallet.js';
  49. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  50. import empty from '@/components/empty';
  51. export default {
  52. components: {
  53. empty,
  54. uniLoadMore
  55. },
  56. data() {
  57. return {
  58. jd: 0,
  59. loadingType: 'more',
  60. limit: 10, //每次加载多少信息
  61. page: 1, //页数
  62. dataList: []
  63. }
  64. },
  65. onReady(res) {
  66. // 初始化获取页面宽度
  67. var _this = this;
  68. uni.getSystemInfo({
  69. success: resu => {
  70. const query = uni.createSelectorQuery();
  71. query.select('.swiper-box').boundingClientRect();
  72. query.exec(function(res) {
  73. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  74. console.log('打印页面的剩余高度', _this.height);
  75. });
  76. },
  77. fail: res => {}
  78. });
  79. },
  80. onLoad() {
  81. this.loadData();
  82. },
  83. methods: {
  84. toBack() {
  85. uni.switchTab({
  86. url: '/pages/user/user'
  87. });
  88. },
  89. loadData() {
  90. let obj = this
  91. if(obj.loadingType == 'noMore'){
  92. return
  93. }
  94. jdCoool({
  95. page: obj.page,
  96. limit: obj.limit
  97. }).then(res => {
  98. console.log(res);
  99. obj.jd = res.data.sum
  100. res.data.data = res.data.data.map(item => {
  101. item.add_time = getTime(item.add_time);
  102. let data = item.add_time.split(' ');
  103. item.add_time = data[0]
  104. return item;
  105. })
  106. obj.dataList = obj.dataList.concat(res.data.data)
  107. obj.page++;
  108. //判断是否还有数据,有改为more,没有各位noMore
  109. if(obj.limit == res.data.data.length){
  110. obj.loadingType = 'more'
  111. return
  112. }else{
  113. obj.loadingType = 'noMore'
  114. }
  115. this.$set(obj.dataList,'loaded',true)
  116. }).catch(e=>{
  117. console.log(e);
  118. })
  119. }
  120. }
  121. };
  122. </script>
  123. <style lang="scss">
  124. page {
  125. background: #ffffff;
  126. height: 100%;
  127. }
  128. .content-money {
  129. background: $page-color-base;
  130. // border: 2px solid #ffffff;
  131. // padding-top: var(--status-bar-height);
  132. .moneyTx {
  133. position: absolute;
  134. top: 120rpx;
  135. right: 0rpx;
  136. // width: 150rpx;
  137. padding: 10rpx 10rpx;
  138. border: 2px solid #ffffff;
  139. border-top-left-radius: 15rpx;
  140. border-bottom-left-radius: 15rpx;
  141. line-height: 1;
  142. font-size: $font-base;
  143. background: #ffffff;
  144. }
  145. .buttom-box {
  146. background-color: #ffffff;
  147. text-align: center;
  148. margin: 0 30rpx;
  149. padding: 20rpx 0;
  150. border-radius: $border-radius-sm;
  151. margin-top: -60rpx;
  152. .buttom {
  153. font-size: $font-lg;
  154. flex-grow: 1;
  155. }
  156. .interval {
  157. width: 2px;
  158. height: 60rpx;
  159. background-color: #eeeeee;
  160. }
  161. .icon {
  162. height: 36rpx;
  163. width: 36rpx;
  164. margin: 0 auto;
  165. .icon-img {
  166. width: 100%;
  167. height: 100%;
  168. }
  169. }
  170. }
  171. }
  172. .money-box {
  173. height: 430rpx;
  174. color: #ffffff;
  175. text-align: center;
  176. position: relative;
  177. background-color: pink;
  178. .header {
  179. position: absolute;
  180. left: 0;
  181. top: 0;
  182. width: 100%;
  183. height: 80rpx;
  184. font-size: 32rpx;
  185. font-weight: 700;
  186. z-index: 99;
  187. display: flex;
  188. justify-content: center;
  189. align-items: center;
  190. }
  191. .goback-box {
  192. position: absolute;
  193. left: 18rpx;
  194. top: 0;
  195. height: 80rpx;
  196. display: flex;
  197. align-items: center;
  198. }
  199. .goback {
  200. z-index: 100;
  201. width: 34rpx;
  202. height: 34rpx;
  203. }
  204. .money_bg {
  205. width: 100%;
  206. height: 430rpx;
  207. display: block;
  208. }
  209. .text {
  210. padding-top: 80rpx;
  211. font-size: $font-lg;
  212. }
  213. .money {
  214. position: absolute;
  215. top: 0;
  216. width: 100%;
  217. padding-top: 186rpx;
  218. font-size: 84rpx;
  219. font-weight: bold;
  220. }
  221. .tip {
  222. position: absolute;
  223. top: 0;
  224. width: 100%;
  225. text-align: center;
  226. padding-top: 304rpx;
  227. font-size: 26rpx;
  228. font-family: PingFang SC;
  229. font-weight: 500;
  230. color: #FFFFFF;
  231. }
  232. }
  233. .title {
  234. height: 82rpx;
  235. line-height: 82rpx;
  236. text-align: center;
  237. font-size: 30rpx;
  238. font-family: PingFang SC;
  239. font-weight: 500;
  240. color: #333333;
  241. border-bottom: 1px solid #f0f0f0;
  242. }
  243. // 列表
  244. .swiper-box {
  245. .order-item {
  246. padding: 18rpx 24rpx 14rpx;
  247. border-bottom: 1px solid #f0f0f0;
  248. .left {
  249. justify-content: flex-start;
  250. .avator {
  251. width: 70rpx;
  252. height: 70rpx;
  253. border-radius: 50rpx;
  254. background: #03A9F4;
  255. image {
  256. width: 70rpx;
  257. height: 70rpx;
  258. border-radius: 50rpx;
  259. }
  260. }
  261. .order-font {
  262. margin-left: 10rpx;
  263. font-size: 30rpx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. color: #3F454B;
  267. text {
  268. color: #FF4D4C;
  269. }
  270. }
  271. }
  272. .time {
  273. font-size: 22rpx;
  274. font-family: PingFang SC;
  275. font-weight: 400;
  276. color: #999999;
  277. }
  278. }
  279. }
  280. .content {
  281. height: 100%;
  282. .empty-content {
  283. background-color: #ffffff;
  284. }
  285. }
  286. </style>