bill.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. <template>
  2. <view>
  3. <u-picker v-model="showTime" mode="time" :params="params" :default-time="defaultTime" @confirm="confirmTime">
  4. </u-picker>
  5. <view class="top">
  6. <view class="tixian">
  7. <view class="value" style="margin-bottom: 50rpx;">
  8. <text>总应收</text>
  9. <text class="text-price">{{shopData.totalFunkPrice}}</text>
  10. </view>
  11. <view class="flex justify-center align-center">
  12. <view class="cu-btn btn round" style="padding: 24rpx 50rpx;" hover-class="hoverClass1"
  13. @click="$jump('/pages/mine/my-points/accredit')">
  14. 提现
  15. </view>
  16. </view>
  17. </view>
  18. <view style="display: flex;justify-content: flex-start;">
  19. <view class="value">
  20. <text>余额</text>
  21. <text class="text-price">{{shopData.withdrawTotalPrice}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="margin-top-20" style="margin-bottom: -10rpx;">
  26. <u-tabs active-color="#FC8D38" :active-item-style="activeItemStyle" :list="tabslist" bg-color="#f1f1f1"
  27. :current="current" @change="change"></u-tabs>
  28. </view>
  29. <view class="data">
  30. <view class="left">
  31. <view @click.stop="showTime = true">
  32. <text>{{defaultTime}}</text>
  33. <text class="cuIcon-unfold padding-left-10"></text>
  34. </view>
  35. <!-- <view>
  36. <text>支出 ¥ 165.00 收入 ¥ 463.00</text>
  37. </view> -->
  38. </view>
  39. <view class="right">
  40. <text>统计</text>
  41. <text class="cuIcon-right"></text>
  42. </view>
  43. </view>
  44. <view class="card">
  45. <view v-if="current==0" style="display: flex;">
  46. <view class="area1 area-padding " style="padding-left: 40rpx;">
  47. <text>积分来源</text>
  48. </view>
  49. <view class="area2 area-padding">
  50. <text>积分数量</text>
  51. </view>
  52. <view class="area3 area-padding">
  53. <text>价值</text>
  54. </view>
  55. </view>
  56. <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
  57. :down="downOption" :up="upOption">
  58. <view @click="$jump('/pages/bill/billDetail?billDetail='+JSON.stringify(item)+'&current='+current)"
  59. class="item" hover-class="hoverClass" v-for="(item,index) in list" :key="index">
  60. <block v-if="current==1">
  61. <view class="area1">
  62. <view class="item-padding">
  63. <image :src="item.channelLogo" mode="aspectFit"></image>
  64. <view class="">
  65. <text>{{item.channelName}}</text>
  66. <text>{{item.jsTime}}</text>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="area2 text-area ">
  71. <view class="item-padding">
  72. <image style="width: 35rpx;height: 35rpx;margin-bottom: -5rpx;"
  73. src="@/static/icon/points-value.png"></image>
  74. <text style="font-size: 32rpx;margin-left: 10rpx;color: #F39248;">+{{item.point}}</text>
  75. </view>
  76. </view>
  77. <view class="area3 text-area ">
  78. <view class="item-padding" style="font-size: 34rpx;color: #000;">¥{{item.pointValue}}</view>
  79. </view>
  80. </block>
  81. <block v-if="current==0">
  82. <view class="area1">
  83. <view class="item-padding">
  84. <image style="border-radius: 50%;"
  85. :src="item.userAvator?item.userAvator:'/static/icon/avatar.png'" mode="aspectFit">
  86. </image>
  87. <view class="margin-left-10">
  88. <text>{{item.userName || '微信支付'}}</text>
  89. <text>{{item.updateTime}}</text>
  90. </view>
  91. </view>
  92. </view>
  93. <view class="area3 text-area u-flex-1">
  94. <view class="item-padding"
  95. style="text-align: right;flex:1;font-size: 34rpx;color: #F39248;margin-right: 20rpx;">
  96. +¥{{item.realPayAmount}}</view>
  97. </view>
  98. </block>
  99. </view>
  100. </mescroll-body>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
  106. export default {
  107. mixins: [MescrollMixin],
  108. data() {
  109. return {
  110. activeItemStyle: {
  111. fontWeight: 800,
  112. fontSize: '36rpx'
  113. },
  114. tabslist: [{
  115. name: '余额明细'
  116. }, {
  117. name: '应收明细'
  118. }],
  119. current: 0,
  120. list: [],
  121. downOption: {
  122. auto: false
  123. },
  124. upOption: {
  125. empty: {
  126. fixed: true,
  127. top: "-180rpx"
  128. }
  129. },
  130. showTime: false,
  131. params: {
  132. year: true,
  133. month: true,
  134. },
  135. defaultTime: '',
  136. shopData: {},
  137. height: '',
  138. }
  139. },
  140. onLoad() {
  141. this.shopDetail()
  142. },
  143. onReady() {
  144. this.defaultTime = this.$dateTime.format(new Date(), 'YYYY-mm')
  145. this.getElInfo()
  146. },
  147. methods: {
  148. async getElInfo() {
  149. let rectInfo = await this.$u.getRect('.card');
  150. this.height = this.$u.sys().windowHeight - rectInfo.top + 'px'
  151. },
  152. async shopDetail() {
  153. let params = {
  154. id: this.vuex_shopId
  155. }
  156. let res = await this.$api.shop.detail(params)
  157. this.shopData = res.data
  158. },
  159. async shop() {
  160. let params = {}
  161. let res = await this.$api.shop.remainDetailPage(params)
  162. },
  163. confirmTime(e) {
  164. this.defaultTime = e.year + '-' + e.month
  165. this.downCallback()
  166. },
  167. upCallback(mescroll) {
  168. if (!this.vuex_shopId) {
  169. return
  170. }
  171. let params = {
  172. shopId: this.vuex_shopId,
  173. current: mescroll.num,
  174. size: mescroll.size,
  175. }
  176. if (this.defaultTime) {
  177. params.monthTime = this.defaultTime
  178. } else {
  179. params.monthTime = this.$dateTime.format(new Date(), 'YYYY-mm')
  180. }
  181. try {
  182. if (this.current == 1) {
  183. this.$api.shop.yingshouPage(params).then(res => {
  184. let data = res.data.records
  185. let total = res.data.total
  186. mescroll.endBySize(data.length, total);
  187. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  188. this.list = this.list.concat(data); //追加新数据
  189. })
  190. } else if (this.current == 0) {
  191. this.$api.shop.remainDetailPage(params).then(res => {
  192. let data = res.data.records
  193. let total = res.data.total
  194. mescroll.endBySize(data.length, total);
  195. if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
  196. this.list = this.list.concat(data); //追加新数据
  197. })
  198. }
  199. } catch (e) {
  200. this.mescroll.endErr()
  201. }
  202. },
  203. downCallback() {
  204. setTimeout(() => {
  205. this.mescroll.resetUpScroll();
  206. }, 200)
  207. },
  208. change(index) {
  209. this.current = index;
  210. this.downCallback()
  211. }
  212. }
  213. }
  214. </script>
  215. <style lang="scss" scoped>
  216. .btn {
  217. background-color: #FC8D38;
  218. color: #FFFFFF;
  219. border-radius: 50rpx;
  220. border: 1rpx solid #FFFFFF;
  221. }
  222. .hoverClass1 {
  223. box-shadow: 0rpx 0rpx 10rpx #DDDDDD;
  224. }
  225. .top {
  226. padding: 36rpx 50rpx;
  227. background-image: linear-gradient(to right, #FBA33D, #FF8D32);
  228. display: flex;
  229. flex-direction: column;
  230. justify-content: center;
  231. .tixian {
  232. display: flex;
  233. justify-content: space-between;
  234. }
  235. .value {
  236. display: flex;
  237. flex-direction: column;
  238. text-align: center;
  239. text:first-child {
  240. text-align: left;
  241. color: #FCD7BD;
  242. font-size: 32rpx;
  243. }
  244. text:last-child {
  245. padding-top: 10rpx;
  246. font-size: 60rpx;
  247. color: #FFFFFF;
  248. }
  249. }
  250. }
  251. .data {
  252. padding: 50rpx 0 25rpx 40rpx;
  253. display: flex;
  254. justify-content: space-between;
  255. .left {
  256. display: flex;
  257. flex-direction: column;
  258. view:first-child {
  259. font-size: 34rpx;
  260. color: #000;
  261. padding-bottom: 10rpx;
  262. }
  263. view:last-child {
  264. font-size: 26rpx;
  265. color: #666666;
  266. }
  267. }
  268. .right {
  269. padding-right: 20rpx;
  270. color: #666666;
  271. display: flex;
  272. justify-content: center;
  273. align-items: center;
  274. text-align: center;
  275. }
  276. }
  277. .card {
  278. background-color: #FFFFFF;
  279. .area-padding {
  280. padding: 40rpx 0 20rpx;
  281. }
  282. .text-area {
  283. display: flex;
  284. justify-content: flex-start;
  285. align-items: center;
  286. }
  287. .area1 {
  288. padding-left: 30rpx;
  289. width: 55%;
  290. view:first-child {
  291. display: flex;
  292. image {
  293. width: 80rpx;
  294. height: 80rpx
  295. }
  296. view {
  297. padding-left: 15rpx;
  298. padding-bottom: 5rpx;
  299. display: flex;
  300. flex-direction: column;
  301. text:first-child {
  302. font-size: 32rpx;
  303. padding-bottom: 10rpx;
  304. color: #000;
  305. }
  306. text:last-child {
  307. font-size: 22rpx;
  308. color: #888888;
  309. }
  310. }
  311. }
  312. }
  313. .area2 {
  314. width: 25%;
  315. }
  316. .area3 {
  317. width: 20%;
  318. }
  319. .item-padding {
  320. padding: 20rpx 0;
  321. }
  322. .item {
  323. padding: 5rpx;
  324. display: flex;
  325. border-bottom: 1rpx solid #DDDDDD;
  326. }
  327. .item:last-child {
  328. border: none;
  329. }
  330. }
  331. </style>