balanceLog.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <view class="container">
  3. <view class="hander-top">
  4. <view class="icon-back-wrap" @click="onBack">
  5. <image
  6. class="icon-back"
  7. src="@/static/preview/icon-back.png"
  8. mode="widthFix"
  9. />
  10. </view>
  11. <!-- <view class="count">数智钱包</view> -->
  12. <view class="capsule"></view>
  13. </view>
  14. <div class="h_top">
  15. <div class="balance_box">
  16. <div class="b_teg">商户余额(元)</div>
  17. <div class="dinB balance">¥{{ localInfo.merchant_money }}</div>
  18. <div class="b_static flex_r flex_ac flex_jb">
  19. <div>
  20. <span>总收入</span>
  21. <span class="fw">¥{{ total_money || 0 }}</span>
  22. </div>
  23. <div>
  24. <span>今日收入</span>
  25. <span class="fw">¥{{ day_income || 0 }}</span>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="btn_bar flex_r flex_jb">
  31. <div
  32. class="btn_item"
  33. @click="getToCash"
  34. >
  35. <span class="ico iconfont">&#xe603;</span>
  36. <span class="btn_txt">去提现</span>
  37. </div>
  38. <div
  39. class="btn_item conv"
  40. @click="goto('/pagesC/convert/index')"
  41. >
  42. <!-- <span class="ico iconfont">&#xe68a;</span> -->
  43. <image class="ico" src="https://teaclub.oss-cn-chengdu.aliyuncs.com/CloudShop/icon/convert.png" mode="widthFix" />
  44. <span class="btn_txt">去转化</span>
  45. </div>
  46. </div>
  47. <!-- 资金列表 -->
  48. <div class="detailList">
  49. <div class="tit"><span>流水明细</span></div>
  50. <!-- 顶部导航 -->
  51. <view class="Tab_con flex_r flex_ac flex_jb">
  52. <view
  53. class="tab_list flex_r flex_ac"
  54. :class="current == index ? 'active' : ''"
  55. v-for="(item, index) in TabList"
  56. :key="index"
  57. @tap="SetStatus(index)"
  58. >{{ item.title }}</view
  59. >
  60. </view>
  61. <!-- 顶部导航-end -->
  62. <div class="li" v-for="(i, s) in list" :key="s">
  63. <p class="flex_r flex_jb">
  64. <span class="s1">{{ statusList[i.type_id] }}</span>
  65. <span>
  66. {{ i.act }}
  67. <span class="s2">{{ parseFloat(i.num).toFixed(2) }}</span>
  68. </span>
  69. </p>
  70. <p class="flex_r flex_jb">
  71. <span class="s3">{{ i.create_time }}</span>
  72. <span class="s3">余额¥{{ i.after }}</span>
  73. </p>
  74. </div>
  75. </div>
  76. <!-- <view class="con">
  77. <view class="list" v-for="(item, index) in list" :key="index">
  78. <view class="list_head flex_r flex_ac flex_jb">
  79. <view class="head_name">{{ item.remark }}</view>
  80. <view :class="['head_price',item.act == '+' ? 'g_color' : '']">{{ item.act }}{{item.num }}</view>
  81. </view>
  82. <view class="list_con flex_r flex_ac flex_jb">
  83. <view class="list_time">{{ item.create_time }}</view>
  84. <view class="list_balance">余额{{ item.after }}</view>
  85. </view>
  86. </view>
  87. <not-goods v-if="haveGoods" textStr="暂无流水信息"></not-goods>
  88. </view> -->
  89. <!-- 资金列表 -->
  90. </view>
  91. </template>
  92. <script>
  93. let page = 1;
  94. import { post } from "@/request/api.js";
  95. import notGoods from "@/components/not-goods/index.vue";
  96. export default {
  97. components: {
  98. notGoods,
  99. },
  100. data() {
  101. return {
  102. haveGoods: false, // 是否有商品
  103. current: 0,
  104. TabList: [
  105. { title: "全部", sauts: 0 },
  106. { title: "收入", sauts: 1 },
  107. { title: "支出", sauts: 2 },
  108. ],
  109. list: [],
  110. page:1,
  111. localInfo: uni.getStorageSync("localInfo"),
  112. total_money: 0,
  113. day_income: 0,
  114. statusList: {}
  115. };
  116. },
  117. onLoad(da) {
  118. this.current = da.s || 0
  119. },
  120. onShow() {
  121. this.page = 1;
  122. this.list = [];
  123. this.loadData();
  124. this.getData()
  125. },
  126. methods: {
  127. loadData() {
  128. let data = {
  129. page: this.page,
  130. rows:20,
  131. type_id: this.current,
  132. };
  133. uni.showLoading({ mask: true });
  134. post("v1/merchant/commission", data).then((res) => {
  135. uni.hideLoading();
  136. if (res.code === 0) {
  137. this.statusList = JSON.parse(res.data.statusList)
  138. if (res.data.data.data.length > 0) {
  139. this.list = this.list.concat(res.data.data.data);
  140. } else {
  141. if (this.page == 1) {
  142. this.haveGoods = true;
  143. this.page = -1;
  144. } else {
  145. this.page = -1;
  146. this.$toast("暂无更多");
  147. }
  148. }
  149. } else {
  150. if (page == 1) {
  151. this.haveGoods = true;
  152. this.page = -1;
  153. } else {
  154. this.page = -1;
  155. this.$toast("暂无更多");
  156. }
  157. }
  158. });
  159. },
  160. getData(){
  161. post("v1/merchant/myShop").then((res) => {
  162. if (res.code == 0) {
  163. this.total_money = res.data.total_money,
  164. this.day_income = res.data.day_income
  165. }
  166. });
  167. },
  168. SetStatus(i) {
  169. this.current = i;
  170. this.page = 1;
  171. this.list = [];
  172. this.haveGoods = false;
  173. this.loadData();
  174. },
  175. onBack() {
  176. uni.navigateBack();
  177. },
  178. // 跳转到提现页面
  179. getToCash(type) {
  180. this.goto("/pages/cash/index", { type })
  181. },
  182. },
  183. /**
  184. * 页面上拉触底事件的处理函数
  185. */
  186. onReachBottom() {
  187. let _this = this
  188. if (this.page != -1) {
  189. setTimeout(function () {
  190. ++_this.page;
  191. _this.loadData();
  192. }, 800);
  193. }
  194. },
  195. };
  196. </script>
  197. <style lang="scss">
  198. // 页面配置
  199. // 页面配置-end
  200. // 顶部列表
  201. .tab_list {
  202. height: 100%;
  203. box-sizing: border-box;
  204. font-size: 30rpx;
  205. color: #808080;
  206. }
  207. .Tab_con {
  208. width: 100%;
  209. height: 92rpx;
  210. background: #fff;
  211. padding: 0 30rpx;
  212. box-sizing: border-box;
  213. border-bottom: 1rpx solid rgba($color: #d3aa79, $alpha: 0.3);
  214. }
  215. .active {
  216. color: #1bbd89;
  217. border-bottom: 6rpx solid #1bbd89;
  218. }
  219. // 顶部列表-end
  220. // 资金列表
  221. .con {
  222. border-top: 16rpx solid #f4f4f4;
  223. }
  224. .list_con {
  225. width: 100%;
  226. overflow: hidden;
  227. }
  228. .list_head {
  229. width: 100%;
  230. overflow: hidden;
  231. margin-bottom: 5rpx;
  232. }
  233. .list_time {
  234. font-size: 24rpx;
  235. color: #a1a1a1;
  236. }
  237. .list_balance {
  238. font-size: 24rpx;
  239. color: #a1a1a1;
  240. }
  241. .head_price {
  242. font-size: 32rpx;
  243. font-family: "SourceHanSansCN-Medium";
  244. }
  245. .head_name {
  246. font-size: 30rpx;
  247. color: #212121;
  248. font-family: "SourceHanSansCN-Medium";
  249. }
  250. .list {
  251. width: 100%;
  252. overflow: hidden;
  253. padding: 30rpx;
  254. box-sizing: border-box;
  255. border-bottom: 3rpx solid #f4f4f4;
  256. }
  257. // 资金列表-end
  258. // 状态颜色
  259. .g_color {
  260. color: #1bbd89;
  261. }
  262. .y_color {
  263. color: #f15b21;
  264. }
  265. // 状态颜色-end
  266. .h_top {
  267. background: linear-gradient(#d3aa79, #f3d6b2);
  268. height: 420rpx;
  269. position: relative;
  270. .balance_box {
  271. position: absolute;
  272. bottom: 0;
  273. left: 0;
  274. padding: 0 32rpx 38rpx;
  275. width: 100%;
  276. text-align: center;
  277. .b_teg {
  278. font-size: 28rpx;
  279. margin-bottom: 3rpx;
  280. // color: rgba($color: #000, $alpha: 0.65);
  281. }
  282. .balance {
  283. font-size: 60rpx;
  284. color: #333;
  285. }
  286. .b_static {
  287. font-size: 28rpx;
  288. padding: 30rpx 30rpx 0;
  289. .fw{
  290. font-weight: 700;
  291. }
  292. }
  293. }
  294. }
  295. .hander-top {
  296. position: absolute;
  297. z-index: 1000;
  298. top: 108rpx;
  299. left: 0;
  300. display: flex;
  301. justify-content: space-between;
  302. width: 100%;
  303. padding: 0 32rpx;
  304. box-sizing: border-box;
  305. .icon-back-wrap {
  306. width: 64rpx;
  307. height: 64rpx;
  308. .icon-back {
  309. width: 64rpx;
  310. height: 64rpx;
  311. }
  312. }
  313. .count {
  314. color: #222;
  315. font-size: 35rpx;
  316. line-height: 64rpx;
  317. }
  318. .capsule {
  319. width: 120rpx;
  320. }
  321. }
  322. .btn_bar {
  323. padding: 30rpx 32rpx;
  324. .btn_item {
  325. width: 280rpx;
  326. height: 70rpx;
  327. line-height: 70rpx;
  328. text-align: center;
  329. background: rgba($color: #000, $alpha: 0.15);
  330. display: flex;
  331. flex-direction: row;
  332. align-items: center;
  333. justify-content: center;
  334. border-radius: 10rpx;
  335. &.corc {
  336. background-color: #d3aa79;
  337. color: #fff;
  338. }
  339. &.conv {
  340. color: #fff;
  341. background-color: #18bb88;
  342. }
  343. image {
  344. width: 50rpx;
  345. height: 50rpx;
  346. background: #fff;
  347. border-radius: 50%;
  348. }
  349. }
  350. .ico {
  351. color: #d3aa79;
  352. width: 50rpx;
  353. height: 50rpx;
  354. background: #fff;
  355. border-radius: 50%;
  356. display: flex;
  357. flex-direction: row;
  358. align-items: center;
  359. justify-content: center;
  360. font-size: 36rpx;
  361. }
  362. .btn_txt {
  363. height: 50rpx;
  364. width: calc(76% - 50rpx);
  365. line-height: 50rpx;
  366. }
  367. }
  368. .detailList {
  369. width: calc(100% - 64rpx);
  370. padding: 0 10rpx;
  371. border-radius: 12rpx;
  372. margin-bottom: 36rpx;
  373. margin-left: 32rpx;
  374. background-color: #fff;
  375. .tit {
  376. padding: 28rpx 32rpx 10rpx;
  377. span {
  378. display: inline-block;
  379. padding-left: 16rpx;
  380. font-size: 32rpx;
  381. font-weight: 700;
  382. height: 32rpx;
  383. line-height: 32rpx;
  384. border-left: 8rpx solid #d3aa79;
  385. }
  386. }
  387. .li {
  388. padding: 22rpx 0;
  389. border-bottom: 1px solid rgba($color: #d3aa79, $alpha: 0.3);
  390. margin: 0 30rpx;
  391. p {
  392. margin-bottom: 8rpx;
  393. font-size: 30rpx;
  394. &:last-child {
  395. margin-bottom: 0;
  396. font-size: 25rpx;
  397. color: #999;
  398. }
  399. }
  400. .s2 {
  401. font-weight: bold;
  402. &::before {
  403. content: "¥";
  404. font-size: 25rpx;
  405. }
  406. }
  407. &:last-child {
  408. border: none;
  409. }
  410. }
  411. }
  412. </style>