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