bill.vue 7.8 KB

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