index.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <view class="account">
  3. <view class="search flex aic">
  4. <u-search placeholder="请输入充值账户" searchIconColor="#2A200A" placeholderColor="#959AA3" bgColor="#F2F3F7" v-model="searchValue" :showAction="false" maxlength="30" height="60rpx" @search="upCallback"></u-search>
  5. <view class="date flex aic" @click="show = true">
  6. <text>日期</text>
  7. <re-icon name="icon-xiala" :customStyle="{ fontSize: '10rpx',marginLeft:'10rpx'}"></re-icon>
  8. </view>
  9. </view>
  10. <view class="tabulation">
  11. <mescroll-body height="100%" ref="mescrollRef" bottom="200" @init="mescrollInit" @down="downCallback" :up="upOption" @up="upCallback">
  12. <view class="list" v-if="list.length">
  13. <view class="list-item" v-for="(item,index) in list" :key="index">
  14. <view class="top flex aic jcsb">
  15. <text class="word">{{item.packageName}}</text>
  16. <text class="money">+{{item.totalAmount}}</text>
  17. </view>
  18. <view class="btom flex-column">
  19. <text>充值账户:178 8394 2382</text>
  20. <text>有效期至:{{item.expireTime}}</text>
  21. <text>赠送用户明细:{{item.trafficSize}}</text>
  22. <text>套餐金额:{{item.trafficPrice}}</text>
  23. <text>套餐折扣:178 8394 2382</text>
  24. <text>实付金额:178 8394 2382</text>
  25. <text>预估收益:178 8394 2382</text>
  26. <text>充值时间:{{item.payTime}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. <no-data :statusType="2" :top="0" tipsText="暂无数据" v-if="!isInit&&!list.length"></no-data>
  31. </mescroll-body>
  32. </view>
  33. <u-datetime-picker ref="datetimePicker" closeOnClickOverlay :show="show" v-model="value" mode="date" @confirm="confirm" @close="show = false" @cancel="show = false"></u-datetime-picker>
  34. </view>
  35. </template>
  36. <script>
  37. import MescrollMixin from "@/plugins/mescroll/components/mescroll-uni/mescroll-mixins.js"
  38. import MescrollBody from '@/plugins/mescroll/components/mescroll-uni/mescroll-uni.vue'
  39. import { getOrderPage } from '@/apis/main'
  40. export default {
  41. components: {
  42. MescrollBody
  43. },
  44. data(){
  45. return{
  46. isInit: true, // 初次进入页面
  47. show:false,
  48. searchValue:'',
  49. value: Number(new Date()),
  50. list:[]
  51. }
  52. },
  53. onShow(){
  54. if(!this.isInit){
  55. this.initPage()
  56. }
  57. },
  58. mixins: [MescrollMixin],
  59. methods: {
  60. // 初始化
  61. initPage() {
  62. this.$nextTick(()=> {
  63. this.mescroll.resetUpScroll()
  64. this.mescroll.scrollTo(0, 300)
  65. })
  66. },
  67. confirm(e) {
  68. console.log('confirm', e)
  69. this.show = false
  70. this.date = e.value[0].label
  71. this.$nextTick(() => {
  72. this.mescroll.resetUpScroll()
  73. this.mescroll.scrollTo(0, 300)
  74. })
  75. },
  76. // 获取数据
  77. async upCallback(page){
  78. const res = await getOrderPage({
  79. current:page.num,
  80. size:page.size,
  81. username:this.searchValue
  82. })
  83. if (res) {
  84. //设置列表数据
  85. if (page.num === 1) { //如果是第一页需手动制空列表
  86. this.list = res.records
  87. } else {
  88. this.list = this.list.concat(res.records) //追加新数据
  89. }
  90. this.mescroll.endSuccess(res.records.length, res.total > this.list.length)
  91. }else{
  92. this.mescroll.endErr()
  93. }
  94. uni.hideLoading()
  95. this.isInit = false
  96. }
  97. },
  98. }
  99. </script>
  100. <style lang="scss" scoped>
  101. .account{
  102. height: 100%;
  103. background: #fff;
  104. display: flex;
  105. flex-direction: column;
  106. .search{
  107. padding: 12rpx 24rpx;
  108. .date{
  109. width: 112rpx;
  110. height: 48rpx;
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. }
  115. }
  116. .tabulation{
  117. // flex-grow: 1;
  118. width: 100%;
  119. height: calc(100% - 43.6rpx);
  120. overflow: hidden;
  121. background: linear-gradient(360deg,#FFFFFF 60%, #FF911A 100%);
  122. padding: 24rpx 20rpx;
  123. .list{
  124. height: 100%;
  125. background: #FFFFFF;
  126. border-radius: 16rpx;
  127. padding: 32rpx;
  128. .list-item{
  129. margin-bottom: 56rpx;
  130. .top{
  131. font-size: 32rpx;
  132. .word{
  133. font-weight: 500;
  134. color: #000000;
  135. }
  136. .money{
  137. font-weight: bold;
  138. color: #EF3B24;
  139. }
  140. }
  141. .btom{
  142. margin-top: 24rpx;
  143. text{
  144. font-weight: 400;
  145. font-size: 28rpx;
  146. color: #7a7a7a;
  147. margin-bottom: 16rpx;
  148. }
  149. text:nth-last-child(1){
  150. margin-bottom: 0;
  151. }
  152. }
  153. }
  154. .list-item:nth-last-child(1){
  155. margin-bottom: 0;
  156. }
  157. }
  158. }
  159. }
  160. </style>