point-bills.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="" style="height: 100vh;">
  3. <view class="head_box u-flex u-row-center u-col-center">
  4. <view class="card-box">
  5. <view class="card-head u-flex u-col-center">
  6. <view class="card-title u-m-r-10">可提现积分(元)</view>
  7. <view class="u-iconfont uicon-eye" style="color: #fff;font-size: 50rpx;"></view>
  8. </view>
  9. <view class="money-num u-p-t-50">{{dataInfo.point}}</view>
  10. <view class="padding-top-40 text-white text-df">
  11. <text>总收益:¥ {{dataInfo.totalPoint}}</text>
  12. <text class="margin-left-30">今日收益:¥ {{dataInfo.todayPoint}}</text>
  13. </view>
  14. <button @click="$jump('/pages/withdraw/withdraw')" class="u-reset-button withdraw-btn">提现</button>
  15. </view>
  16. </view>
  17. <view @click.stop="showTime = true" class="flex justify-between" style="font-size: 24rpx;color: #666666;background-color: #f6f6f6;">
  18. <view class="flex">
  19. <view class="bg-white cu-btn round margin-30 sm">
  20. <text>{{defaultTime}}</text>
  21. <text class="cuIcon-triangledownfill text-gray" style="font-size: 50rpx;"></text>
  22. </view>
  23. <!-- <view class="total-box">收入¥0.00 支出¥0.00</view> -->
  24. </view>
  25. <!-- <view class="center margin-right-30">
  26. 统计
  27. <text class="cuIcon-right"></text>
  28. </view> -->
  29. </view>
  30. <scroll-view scroll-x class="bg-white nav">
  31. <view class="flex text-center">
  32. <view class="cu-item flex-sub" :class="index==stateCurrent?'text-base cur text-xl text-bold ':'text-lg'"
  33. v-for="(item,index) in statusList" :key="index" @tap="onTab(index)">
  34. {{item.name}}
  35. </view>
  36. </view>
  37. </scroll-view>
  38. <u-sticky v-if="stateCurrent==0" offset-top="0" :enable="true">
  39. <view class="flex bg-white u-border-top " style="padding: 30rpx">
  40. <view style="width: 51%;margin-left: 60rpx;">
  41. 来源
  42. </view>
  43. <view class="text-center" style="width: 25%;">
  44. 折扣
  45. </view>
  46. <view class="text-right" style="width: 24%;margin-right: 20rpx;">
  47. 金额
  48. </view>
  49. </view>
  50. </u-sticky>
  51. <view v-show="stateCurrent==0" class="bg-white safe-area-inset-bottom tabsClass" style="height: 100%;">
  52. <mescroll :down="downOption" :up="upOption" @up="upCallback" :fixed="false" @down="downCallback"
  53. @init="mescrollInit">
  54. <navigator :url="'/pages/my-bills/bills-detail?id='+item.id+'&type=all'" class="u-border-bottom flex" v-for="(item,index) in list" :key="index">
  55. <view class="area1">
  56. <image :src="item.avatar?item.avatar:'/static/icon/avatar.png'" mode=""></image>
  57. <view>
  58. <text>{{item.nickName || '用户支付'}}</text>
  59. <text>{{item.createTime}}</text>
  60. </view>
  61. </view>
  62. <view class="area2">
  63. <text>{{item.discount==-1 || item.discount==0?'无折扣':item.discount +'折'}}</text>
  64. </view>
  65. <view class="area3">
  66. <text class="text-base">+¥{{item.balanceNum || 0}}</text>
  67. </view>
  68. </navigator>
  69. </mescroll>
  70. </view>
  71. <view class="center flex-direction" style="width: 100%;margin-top: 180rpx;" v-show="stateCurrent==1">
  72. <u-empty text="暂无数据" src="/static/icon/empty5.png" icon-size="260"></u-empty>
  73. </view>
  74. <u-picker v-model="showTime" mode="time" :params="params" @confirm="confirmTime">
  75. </u-picker>
  76. </view>
  77. </template>
  78. <script>
  79. import mescroll from '@/components/mescroll-body/mescroll-uni.vue'
  80. export default {
  81. components: {
  82. mescroll
  83. },
  84. props: {
  85. type: Number,
  86. dataInfo:Object
  87. },
  88. data() {
  89. return {
  90. stateCurrent: 0, //默认
  91. statusList: [{
  92. name: '收入',
  93. value: 0
  94. },
  95. {
  96. name: '支出',
  97. value: 1
  98. }
  99. ],
  100. //时间
  101. showTime: false,
  102. params: {
  103. year: true,
  104. month: true,
  105. },
  106. defaultTime: '',
  107. //数据
  108. list: [],
  109. mescroll: null,
  110. upOption: {
  111. noMoreSize: 5,
  112. auto: false,
  113. },
  114. // 下拉配置参数
  115. downOption: {
  116. use: false,
  117. auto: false
  118. },
  119. };
  120. },
  121. watch: {
  122. type() {
  123. if (!this.isInit && this.type === 2) {
  124. this.mescroll.resetUpScroll()
  125. }
  126. }
  127. },
  128. mounted() {
  129. if (!this.isInit && this.type === 2) {
  130. this.mescroll.resetUpScroll()
  131. }
  132. },
  133. created() {
  134. this.defaultTime = this.$dateTime.format(new Date(), 'YYYY-mm')
  135. },
  136. methods: {
  137. mescrollInit(mescroll) {
  138. this.mescroll = mescroll
  139. },
  140. onTab(index) {
  141. this.stateCurrent = index
  142. this.mescroll.resetUpScroll();
  143. },
  144. confirmTime(e) {
  145. this.defaultTime = e.year + '-' + e.month
  146. this.mescroll.resetUpScroll();
  147. },
  148. upCallback(mescroll) {
  149. console.log("balance");
  150. let params = {
  151. receiveId: this.vuex_shopId,
  152. current: mescroll.num,
  153. size: mescroll.size,
  154. payStatus: this.$global.PAY_STATUS.SUCCESS,
  155. billType:'balanceNum'
  156. }
  157. if (this.defaultTime) {
  158. params.createTime = this.$dateTime.format(new Date(this.defaultTime))
  159. } else {
  160. params.createTime = this.$dateTime.format(new Date())
  161. }
  162. try {
  163. this.$api.bills.list(params).then(res => {
  164. let data = res.data.records
  165. let total = res.data.total
  166. mescroll.endBySize(data.length, total);
  167. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  168. this.list = this.list.concat(data); //追加新数据
  169. })
  170. } catch (e) {
  171. this.mescroll.endErr()
  172. }
  173. },
  174. downCallback() {
  175. setTimeout(() => {
  176. this.mescroll.resetUpScroll();
  177. }, 500)
  178. },
  179. }
  180. };
  181. </script>
  182. <style>
  183. page {
  184. background-color: #FFFFFF;
  185. }
  186. </style>
  187. <style lang="scss" scoped>
  188. .area1 {
  189. $img-width: 70rpx;
  190. width: 54%;
  191. display: flex;
  192. height: 120rpx;
  193. justify-content: center;
  194. align-items: center;
  195. image {
  196. display: flex;
  197. align-items: center;
  198. justify-content: center;
  199. width: $img-width;
  200. height: $img-width;
  201. border-radius: 50%;
  202. }
  203. view {
  204. width: calc(100% - $img-width);
  205. display: flex;
  206. flex-direction: column;
  207. justify-content: space-between;
  208. margin-left: 10rpx;
  209. }
  210. text:first-child {
  211. margin-bottom: 8rpx;
  212. }
  213. text:last-child {
  214. margin-top: 8rpx;
  215. color: #999;
  216. }
  217. }
  218. .area2 {
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. text-align: center;
  223. width: 22%;
  224. margin-top: 10rpx;
  225. font-weight: 300;
  226. color: #666;
  227. }
  228. .area3 {
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. width: 24%;
  233. font-size: 32rpx;
  234. margin-top: 10rpx;
  235. }
  236. .head_box {
  237. font-weight: 300;
  238. background-color: #fff;
  239. padding: 30rpx 0;
  240. .card-box {
  241. width: 700rpx;
  242. min-height: 300rpx;
  243. padding: 40rpx 40rpx 0rpx;
  244. background-color: #ff9201;
  245. box-shadow: 1rpx 5rpx 16rpx 0 rgba(255, 148, 71, .6);
  246. border-radius: 30rpx;
  247. overflow: hidden;
  248. position: relative;
  249. .card-head {
  250. color: #fff;
  251. font-size: 30rpx;
  252. }
  253. .money-num {
  254. font-size: 70rpx;
  255. line-height: 70rpx;
  256. font-weight: 500;
  257. color: #ffffff;
  258. }
  259. .reduce-num {
  260. font-size: 26rpx;
  261. font-weight: 400;
  262. color: #ffffff;
  263. }
  264. .withdraw-btn {
  265. width: 120rpx;
  266. height: 60rpx;
  267. line-height: 60rpx;
  268. background: #ffffff;
  269. border-radius: 30px;
  270. font-size: 24rpx;
  271. font-weight: 500;
  272. color: #ff9201;
  273. position: absolute;
  274. right: 30rpx;
  275. top: 40rpx;
  276. }
  277. }
  278. }
  279. .total-box {
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. margin-right: 40rpx;
  284. font-size: 24rpx;
  285. font-weight: 500;
  286. color: #999999;
  287. }
  288. </style>