JDcool.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. },
  66. onReady(res) {
  67. // 初始化获取页面宽度
  68. var _this = this;
  69. uni.getSystemInfo({
  70. success: resu => {
  71. const query = uni.createSelectorQuery();
  72. query.select('.swiper-box').boundingClientRect();
  73. query.exec(function(res) {
  74. _this.maxheight = resu.windowHeight - res[0].top + 'px';
  75. console.log('打印页面的剩余高度', _this.height);
  76. });
  77. },
  78. fail: res => {}
  79. });
  80. },
  81. onLoad() {
  82. this.loadData();
  83. },
  84. methods: {
  85. toBack() {
  86. uni.switchTab({
  87. url: '/pages/user/user'
  88. });
  89. },
  90. loadData() {
  91. let obj = this
  92. jdCoool({
  93. page: obj.page,
  94. limit: obj.limit
  95. }).then(res => {
  96. console.log(res);
  97. obj.dataList = res.data.data;
  98. console.log(obj.dataList, '我是强儿die');
  99. obj.dataList = obj.dataList.map(item => {
  100. item.add_time = getTime(item.add_time);
  101. console.log(item.add_time);
  102. return item;
  103. })
  104. obj.limit = res.count
  105. obj.jd = res.data.sum
  106. // uni.hideLoading({
  107. // title:'加载中'
  108. // })
  109. // uni.hideLoading()
  110. if(res.length>0){
  111. obj.dataList = obj.dataList.concat(res.data.data[0])
  112. obj.page++;
  113. }
  114. //判断是否还有数据,有改为more,没有各位noMore
  115. if(obj.limit == res.data.data.length){
  116. obj.loadingType = 'more'
  117. return
  118. }else{
  119. obj.loadingType = 'noMore'
  120. }
  121. uni.hideLoading()
  122. // this.$set(obj.dataList,'loaded',true)
  123. }).catch(e=>{
  124. console.log(e);
  125. })
  126. }
  127. }
  128. };
  129. </script>
  130. <style lang="scss">
  131. page {
  132. background: #ffffff;
  133. height: 100%;
  134. }
  135. .content-money {
  136. background: $page-color-base;
  137. // border: 2px solid #ffffff;
  138. // padding-top: var(--status-bar-height);
  139. .moneyTx {
  140. position: absolute;
  141. top: 120rpx;
  142. right: 0rpx;
  143. // width: 150rpx;
  144. padding: 10rpx 10rpx;
  145. border: 2px solid #ffffff;
  146. border-top-left-radius: 15rpx;
  147. border-bottom-left-radius: 15rpx;
  148. line-height: 1;
  149. font-size: $font-base;
  150. background: #ffffff;
  151. }
  152. .buttom-box {
  153. background-color: #ffffff;
  154. text-align: center;
  155. margin: 0 30rpx;
  156. padding: 20rpx 0;
  157. border-radius: $border-radius-sm;
  158. margin-top: -60rpx;
  159. .buttom {
  160. font-size: $font-lg;
  161. flex-grow: 1;
  162. }
  163. .interval {
  164. width: 2px;
  165. height: 60rpx;
  166. background-color: #eeeeee;
  167. }
  168. .icon {
  169. height: 36rpx;
  170. width: 36rpx;
  171. margin: 0 auto;
  172. .icon-img {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. }
  177. }
  178. }
  179. .money-box {
  180. height: 430rpx;
  181. color: #ffffff;
  182. text-align: center;
  183. position: relative;
  184. background-color: pink;
  185. .header {
  186. position: absolute;
  187. left: 0;
  188. top: 0;
  189. width: 100%;
  190. height: 80rpx;
  191. font-size: 32rpx;
  192. font-weight: 700;
  193. z-index: 99;
  194. display: flex;
  195. justify-content: center;
  196. align-items: center;
  197. }
  198. .goback-box {
  199. position: absolute;
  200. left: 18rpx;
  201. top: 0;
  202. height: 80rpx;
  203. display: flex;
  204. align-items: center;
  205. }
  206. .goback {
  207. z-index: 100;
  208. width: 34rpx;
  209. height: 34rpx;
  210. }
  211. .money_bg {
  212. width: 100%;
  213. height: 430rpx;
  214. display: block;
  215. }
  216. .text {
  217. padding-top: 80rpx;
  218. font-size: $font-lg;
  219. }
  220. .money {
  221. position: absolute;
  222. top: 0;
  223. width: 100%;
  224. padding-top: 186rpx;
  225. font-size: 84rpx;
  226. font-weight: bold;
  227. }
  228. .tip {
  229. position: absolute;
  230. top: 0;
  231. width: 100%;
  232. text-align: center;
  233. padding-top: 304rpx;
  234. font-size: 26rpx;
  235. font-family: PingFang SC;
  236. font-weight: 500;
  237. color: #FFFFFF;
  238. }
  239. }
  240. .title {
  241. height: 82rpx;
  242. line-height: 82rpx;
  243. text-align: center;
  244. font-size: 30rpx;
  245. font-family: PingFang SC;
  246. font-weight: 500;
  247. color: #333333;
  248. border-bottom: 1px solid #f0f0f0;
  249. }
  250. // 列表
  251. .swiper-box {
  252. .order-item {
  253. padding: 18rpx 24rpx 14rpx;
  254. border-bottom: 1px solid #f0f0f0;
  255. .left {
  256. justify-content: flex-start;
  257. .avator {
  258. width: 70rpx;
  259. height: 70rpx;
  260. border-radius: 50rpx;
  261. background: #03A9F4;
  262. image {
  263. width: 70rpx;
  264. height: 70rpx;
  265. border-radius: 50rpx;
  266. }
  267. }
  268. .order-font {
  269. margin-left: 10rpx;
  270. font-size: 30rpx;
  271. font-family: PingFang SC;
  272. font-weight: 500;
  273. color: #3F454B;
  274. text {
  275. color: #FF4D4C;
  276. }
  277. }
  278. }
  279. .time {
  280. font-size: 22rpx;
  281. font-family: PingFang SC;
  282. font-weight: 400;
  283. color: #999999;
  284. }
  285. }
  286. }
  287. .content {
  288. height: 100%;
  289. .empty-content {
  290. background-color: #ffffff;
  291. }
  292. }
  293. </style>