my-points.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <template>
  2. <view>
  3. <u-picker v-model="showTime" mode="time" :params="params" @confirm="confirmTime"></u-picker>
  4. <view class="top">
  5. <view class="value">
  6. <text>积分价值</text>
  7. <text class="price">{{point}}</text>
  8. </view>
  9. <view class="flex justify-center align-center">
  10. <view class="cu-btn btn sm" style="padding: 25rpx 30rpx;" hover-class="hoverClass1" @click="$jump('/pagesA/pages/my-points/accredit')">
  11. 积分授权
  12. </view>
  13. </view>
  14. </view>
  15. <view class="data">
  16. <view class="left">
  17. <view @click.stop="showTime = true">
  18. <text>{{defaultTime || '筛选'}}</text>
  19. <text class="cuIcon-unfold padding-left-10"></text>
  20. </view>
  21. <!-- <view>
  22. <text>支出 ¥ 165.00 收入 ¥ 463.00</text>
  23. </view> -->
  24. </view>
  25. <!-- <view class="right">
  26. <text>统计</text>
  27. <text class="cuIcon-right"></text>
  28. </view> -->
  29. </view>
  30. <view class="card">
  31. <view style="display: flex;" class="cardTitle">
  32. <view class="area1 area-padding " style="padding-left: 40rpx;">
  33. <text>积分来源</text>
  34. </view>
  35. <view class="area3 area-padding">
  36. <text>积分价值</text>
  37. </view>
  38. </view>
  39. <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
  40. :up="upOption">
  41. <view @click="jump(item)" class="item" hover-class="hoverClass"
  42. v-for="(item,index) in list" :key="index">
  43. <view class="area1">
  44. <view class="item-padding">
  45. <image :src="item.channelLogo" ></image>
  46. <view class="">
  47. <text>{{item.channelName}}</text>
  48. <text>{{item.createTime}}</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="area3 text-area ">
  53. <view class="price reduce item-padding text-base" v-if="item.type=='PAY_CONSUMER'" style="font-size: 34rpx">{{item.totalPrice}}</view>
  54. <view class="price plus item-padding text-base" v-else style="font-size: 34rpx">{{item.price}}</view>
  55. </view>
  56. </view>
  57. </mescroll-body>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  63. export default {
  64. mixins: [MescrollMixin],
  65. data() {
  66. return {
  67. list:[],
  68. downOption:{
  69. auto:false
  70. },
  71. showTime:false,
  72. params: {
  73. year: true,
  74. month: true,
  75. },
  76. defaultTime:'',
  77. point:'',
  78. height:''
  79. }
  80. },
  81. onReady(){
  82. this.getElInfo()
  83. },
  84. onLoad(options) {
  85. if(options.point){
  86. this.point = options.point
  87. }
  88. },
  89. methods: {
  90. async getElInfo() {
  91. let rectInfo = await this.$u.getRect('.cardTitle');
  92. this.height = this.$u.sys().windowHeight - rectInfo.top + 'px'
  93. },
  94. jump(item){
  95. console.log(item);
  96. uni.navigateTo({
  97. url:'/pagesA/pages/bill/bill-detail?billDetail='+JSON.stringify(item)+'&type=point'
  98. })
  99. },
  100. confirmTime(e){
  101. this.defaultTime = e.year + '-' +e.month
  102. this.mescroll.resetUpScroll();
  103. },
  104. upCallback(mescroll) {
  105. let params = {
  106. current:mescroll.num,
  107. size:mescroll.size,
  108. payId:this.vuex_userId,
  109. payStatus:this.$global.payStatus.IS_PAY
  110. }
  111. if (this.defaultTime) {
  112. params.createTime = this.$dateTime.format(new Date(this.defaultTime))
  113. }
  114. try {
  115. this.$api.pointbills.list(params).then(res => {
  116. let data = res.data.records
  117. let total = res.data.total
  118. mescroll.endBySize(data.length, total);
  119. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  120. this.list = this.list.concat(data); //追加新数据
  121. })
  122. } catch (e) {
  123. this.mescroll.endErr()
  124. }
  125. },
  126. downCallback() {
  127. let _this=this
  128. setTimeout(() => {
  129. _this.mescroll.resetUpScroll();
  130. setTimeout(()=>{
  131. _this.$refs.toast.info('刷新成功')
  132. },150)
  133. },500)
  134. },
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .btn {
  140. background-color: #FC8D38;
  141. color: #FFFFFF;
  142. border-radius: 50rpx;
  143. border: 1rpx solid #FFFFFF;
  144. }
  145. .hoverClass1{
  146. box-shadow: 0rpx 0rpx 10rpx #DDDDDD;
  147. }
  148. .top {
  149. padding: 50rpx;
  150. background-color: #FC8D38;
  151. display: flex;
  152. justify-content: space-between;
  153. .value {
  154. display: flex;
  155. flex-direction: column;
  156. text-align: center;
  157. text:first-child {
  158. color: #FCE7D6;
  159. font-size: 32rpx;
  160. }
  161. text:last-child {
  162. padding-top: 10rpx;
  163. font-size: 70rpx;
  164. color: #FFFFFF;
  165. }
  166. }
  167. }
  168. .data {
  169. padding: 50rpx 0 25rpx 40rpx;
  170. display: flex;
  171. justify-content: space-between;
  172. .left {
  173. display: flex;
  174. flex-direction: column;
  175. view:first-child {
  176. font-size: 34rpx;
  177. color: #000;
  178. padding-bottom: 10rpx;
  179. }
  180. view:last-child {
  181. font-size: 26rpx;
  182. color: #666666;
  183. }
  184. }
  185. .right {
  186. padding-right: 20rpx;
  187. color: #666666;
  188. display: flex;
  189. justify-content: center;
  190. align-items: center;
  191. text-align: center;
  192. }
  193. }
  194. .card {
  195. background-color: #FFFFFF;
  196. .area-padding {
  197. padding: 40rpx 0 20rpx;
  198. }
  199. .text-area{
  200. display: flex;
  201. justify-content: flex-start;
  202. align-items: center;
  203. }
  204. .area1 {
  205. padding-left: 30rpx;
  206. width: 80%;
  207. view:first-child {
  208. display: flex;
  209. image {
  210. width: 80rpx;
  211. height: 80rpx
  212. }
  213. view {
  214. padding-left: 15rpx;
  215. padding-bottom: 5rpx;
  216. display: flex;
  217. flex-direction: column;
  218. text:first-child {
  219. font-size: 32rpx;
  220. padding-bottom: 10rpx;
  221. color: #000;
  222. }
  223. text:last-child {
  224. font-size: 22rpx;
  225. color: #888888;
  226. }
  227. }
  228. }
  229. }
  230. .area2 {
  231. width: 25%;
  232. }
  233. .area3 {
  234. width: 20%;
  235. }
  236. .item-padding {
  237. padding: 20rpx 0;
  238. }
  239. .item {
  240. padding: 5rpx;
  241. display: flex;
  242. border-bottom: 1rpx solid #DDDDDD;
  243. }
  244. .item:last-child{
  245. border: none;
  246. }
  247. }
  248. .price::after {
  249. content: '元';
  250. margin-left: 6rpx;
  251. font-size: 0.5em;
  252. }
  253. .reduce::before {
  254. content: '-';
  255. margin-right: 10rpx;
  256. }
  257. .plus::before {
  258. content: '+';
  259. margin-right: 10rpx;
  260. }
  261. </style>