123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- <template>
- <view class="pos-r padding-lr-sm">
- <use-tabbar :tabbar="false" />
- <!-- 我的余额区域 -->
- <view class="gold-section" v-if="fetch && fetch.cash">
- <view class="item dflex dflex-flow-c">
- <text>总收益:{{fetch.cash}}</text>
- </view>
- </view>
- <!-- 记录列表 -->
- <view class="record-list margin-top-sm" v-if="fetch">
- <view class="record-title fs fwbd ft-black margin-bottom-sm">收益记录</view>
- <u-empty v-if="fetch['list'] && fetch['list'].length <= 0" marginTop="30" mode="data" text="暂无记录"></u-empty>
-
- <view v-else>
- <view class="record-item" v-for="(item, index) in fetch['list']" :key="index">
- <view class="record-left">
- <view class="record-name">{{ item.action_name }}</view>
- <view class="record-desc" v-if="item.desc">{{ item.desc }}</view>
- <view class="record-time">{{ item.cdate }}</view>
- </view>
- <view class="record-amount" :class="{ income: item.type == 1, expense: item.type == 2, lock: item.type == 3 }">
- <text v-if="item.type == 1">+</text>
- <text v-if="item.type == 3">待入账</text>
- <text>{{ item.money }}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="safe-area-inset-bottom"></view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- fetch: {},
- type: 0,
- id: 0,
- }
- },
- onLoad(options) {
- this.type = options.type;
- this.id = options.id;
- if (!this.type || !this.id) {
- return Dever.goUser()
- }
- },
- onShow() {
- this.loadList(1);
- },
- //下拉刷新
- onPullDownRefresh() {
- this.loadList(1);
- },
- //加载更多
- onReachBottom() {
- this.loadList(2);
- },
- methods: {
- loadList(page) {
- this.DeverApi.page([page, 'list'], this, 'sales.getProfit', {sales_type:this.type, sales_id: this.id});
- },
- }
- }
- </script>
- <style lang="scss">
- .gold-section {
- background: #ffffff;
- border-radius: 24rpx;
- padding: 32rpx;
- .dflex-b {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .title {
- font-size: 32rpx;
- font-weight: bold;
- color: #333;
- }
- .link {
- font-size: 24rpx;
- color: #ff9800;
- text-decoration: underline;
- }
- .balance-number {
- margin-top: 20rpx;
- .price {
- font-size: 48rpx;
- color: #ff9800;
- font-weight: bold;
- }
- }
- .amount-summary {
- display: flex;
- justify-content: space-between;
- margin-top: 32rpx;
- .summary-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- .label {
- font-size: 24rpx;
- color: #888;
- }
- .value {
- margin-top: 10rpx;
- font-size: 30rpx;
- font-weight: 600;
- color: #333;
- }
- }
- }
- }
- .card-tile {
- border-radius: 24rpx;
- padding: 30rpx;
- background: #ffffff;
- display: flex;
- align-items: center;
- justify-content: center;
- transition: all 0.2s ease-in-out;
- .icon {
- font-size: 60rpx;
- margin-right: 24rpx;
- }
- .text-content {
- display: flex;
- flex-direction: column;
- .title {
- font-size: 30rpx;
- font-weight: 600;
- color: #333;
- }
- .desc {
- font-size: 24rpx;
- color: #999;
- margin-top: 6rpx;
- }
- }
- &:active {
- transform: scale(0.97);
- }
- &:first-child {
- margin-right: 10rpx;
- }
- }
- .wpre-50 .card-tile {
- &:first-child {
- margin-bottom: 12rpx;
- margin-right: 0rpx;
- }
- }
- .record-list {
- background: #ffffff;
- border-radius: 20rpx;
- padding: 30rpx;
- .record-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- }
- .record-item {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx 0;
- border-bottom: 1px solid #f0f0f0;
- &:last-child {
- border-bottom: none;
- }
- .record-left {
- display: flex;
- flex-direction: column;
- .record-name {
- font-size: 28rpx;
- color: #333;
- }
- .record-desc {
- font-size: 28rpx;
- color: #999;
- }
- .record-time {
- font-size: 24rpx;
- color: #999;
- margin-top: 6rpx;
- }
- }
- .record-amount {
- font-size: 28rpx;
- font-weight: bold;
- &.income {
- color: #4caf50;
- }
- &.expense {
- color: #f44336;
- }
-
- &.lock {
- color: #999;
- }
- }
- }
- }
- .empty-record {
- text-align: center;
- padding: 60rpx 0;
- .empty-icon {
- width: 160rpx;
- height: 160rpx;
- margin-bottom: 20rpx;
- opacity: 0.6;
- }
- .empty-text {
- font-size: 28rpx;
- color: #999;
- }
- }
- </style>
|