| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- <template>
- <view class="distribution">
- <view class="distribution-block">
- <!-- <view class="title" @click="handleCollapse(item.id)">
- <text>{{item.label}}</text>
- <u-icon :name="getIsOpenItem(item.id) ? 'arrow-down-fill' : 'arrow-up-fill'" color="#9D9D9D" size="12">
- </u-icon>
- </view> -->
- <view class="list" v-for="info in list" :key="info.id">
- <view class="item">
- <view class="display-flex-between">
- <view class="code">
- 订单编号:{{info.order_no}}
- </view>
- <view class="time">
- {{info.date}}
- </view>
- </view>
- <view class="display-flex-between">
- <view class="name">
- <text style="color: #696969;font-weight: 400;">用户昵称:</text>{{info.order_user}}
- </view>
- <view class="amount">
- <text class="color-red">¥{{info.amount}}</text>
- <!-- <text style="font-weight: 400;">({{info.status == 0 ? '冻结':'解冻'}})</text> -->
- </view>
- </view>
- <view class="display-flex-between">
- <view class="name">
- <text style="color: #696969;font-weight: 400;">订单金额:</text>¥{{info.order_amount}}
- </view>
- <view class="amount">
- <text>{{info.status == 0 ? '冻结':'解冻'}}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- collapseIds: ["00000"],
- list: [],
- page: 1,
- pageSize: 10,
- total: 0,
- };
- },
- onLoad() {
- this.getData(true)
- },
- onReachBottom() {
- this.getData()
- },
- methods: {
- getData(initFlag) {
- if (!initFlag) {
- if (this.page * this.pageSize < this.total) {
- this.page++
- } else {
- return
- }
- } else {
- this.page = 1
- this.total = 0
- this.list = []
- }
- let sendData = {
- page: this.page,
- pageSize: this.pageSize
- }
- this.$api.getDistributionData(sendData).then(res => {
- this.list = this.list.concat(res.data.list)
- // this.list = [{ order_no: 1111, order_user: '测试', date: '2022-09-20 13:77:11', amount: 1000 }]
- this.total = res.data.page.total
- })
- },
- getIsOpenItem(id) {
- return this.collapseIds.includes(id)
- },
- handleCollapse(id) {
- if (this.getIsOpenItem(id)) {
- this.collapseIds = this.collapseIds.filter(c => c !== id)
- console.log('this.collapseIds', this.collapseIds)
- } else {
- this.collapseIds.push(id)
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .distribution {
- height: 100%;
- background-color: #F5F6F8;
- padding: 20rpx 20rpx 40rpx;
- box-sizing: border-box;
- &-block {
- &:nth-child(n+2) {
- margin-top: 20rpx;
- }
- .title {
- height: 76rpx;
- background: #ECECEC;
- border-radius: 10rpx;
- display: flex;
- align-items: center;
- font-size: 26rpx;
- font-weight: 500;
- color: #222423;
- line-height: 1;
- padding: 0 24rpx;
- text {
- margin-right: 8rpx;
- }
- }
- .item {
- // height: 159rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- padding: 20rpx 25rpx;
- margin-top: 15rpx;
- // display: flex;
- // justify-content: space-between;
- // align-items: center;
- .code {
- font-size: 28rpx;
- font-weight: 500;
- color: #222423;
- line-height: 39rpx;
- }
- .name {
- font-size: 28rpx;
- font-weight: bold;
- color: #232323;
- line-height: 39rpx;
- margin-top: 18rpx;
- }
- .time {
- font-size: 24rpx;
- font-family: PingFang SC-Medium, PingFang SC;
- font-weight: 500;
- color: #B2B2B2;
- line-height: 34rpx;
- }
- .amount {
- text-align: right;
- margin-top: 18rpx;
- font-size: 32rpx;
- font-family: PingFang SC-Bold, PingFang SC;
- font-weight: bold;
- line-height: 46rpx;
- }
- }
- }
- }
- </style>
|