|
@@ -1,89 +1,43 @@
|
|
|
<template>
|
|
|
- <view class="container">
|
|
|
- <view class="title">核销记录</view>
|
|
|
- <scroll-view class="list" scroll-y @scrolltolower="loadMore">
|
|
|
- <view class="item" v-for="(item, index) in list" :key="index">
|
|
|
- <view class="order-info">
|
|
|
- <view class="order-number">订单号: {{ item.orderNumber }}</view>
|
|
|
- <view class="status">已核销</view>
|
|
|
- </view>
|
|
|
- <view class="order-details">
|
|
|
- <image class="order-image" :src="item.image" mode="aspectFit"></image>
|
|
|
- <view class="order-text">
|
|
|
- <view class="order-name">{{ item.name }}</view>
|
|
|
- <view class="order-price">价格: {{ item.price }}</view>
|
|
|
- <view class="order-quantity">数量: {{ item.quantity }}</view>
|
|
|
- <view class="order-date">日期: {{ item.date }}</view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="loading" v-if="loading">{{ loadingText }}</view>
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
+ <orderItem :list="orderList" :typeStyle.sync="typeStyle"></orderItem>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import orderItem from '../../tabbar/orderItem.vue';
|
|
|
+ import {
|
|
|
+ getOrderListApi
|
|
|
+ } from '@/api/merchant/order';
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ orderItem
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
- list: [{
|
|
|
- orderNumber: '202201010001',
|
|
|
- name: '物品A',
|
|
|
- price: '10.00',
|
|
|
- quantity: 2,
|
|
|
- date: '2022-01-01',
|
|
|
- image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.fj7OyfWIjto_yc_uLHP90wHaEn?rs=1&pid=ImgDetMain'
|
|
|
- },
|
|
|
- {
|
|
|
- orderNumber: '202201020002',
|
|
|
- name: '物品B',
|
|
|
- price: '15.00',
|
|
|
- quantity: 1,
|
|
|
- date: '2022-01-02',
|
|
|
- image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.fj7OyfWIjto_yc_uLHP90wHaEn?rs=1&pid=ImgDetMain'
|
|
|
- },
|
|
|
- {
|
|
|
- orderNumber: '202201030003',
|
|
|
- name: '物品C',
|
|
|
- price: '8.50',
|
|
|
- quantity: 3,
|
|
|
- date: '2022-01-03',
|
|
|
- image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.fj7OyfWIjto_yc_uLHP90wHaEn?rs=1&pid=ImgDetMain'
|
|
|
- },
|
|
|
- ],
|
|
|
- loading: false,
|
|
|
- loadingText: '正在加载中...'
|
|
|
+ orderList: [],
|
|
|
+ params: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ },
|
|
|
+ typeStyle: 0,
|
|
|
+ status: '2',
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getOrderList();
|
|
|
+ },
|
|
|
methods: {
|
|
|
- loadMore() {
|
|
|
- if (this.loading) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this.loading = true;
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- const newData = [{
|
|
|
- orderNumber: '202201040004',
|
|
|
- name: '物品D',
|
|
|
- price: '12.00',
|
|
|
- quantity: 1,
|
|
|
- date: '2022-01-04',
|
|
|
- image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.fj7OyfWIjto_yc_uLHP90wHaEn?rs=1&pid=ImgDetMain'
|
|
|
- },
|
|
|
- {
|
|
|
- orderNumber: '202201050005',
|
|
|
- name: '物品E',
|
|
|
- price: '20.00',
|
|
|
- quantity: 2,
|
|
|
- date: '2022-01-05',
|
|
|
- image: 'https://tse2-mm.cn.bing.net/th/id/OIP-C.fj7OyfWIjto_yc_uLHP90wHaEn?rs=1&pid=ImgDetMain'
|
|
|
- }
|
|
|
- ];
|
|
|
- this.list = [...this.list, ...newData];
|
|
|
- this.loading = false;
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ async getOrderList(status) {
|
|
|
+ let result = Object.assign({}, {
|
|
|
+ paging: `${this.params.pageNum},${this.params.pageSize}`,
|
|
|
+ status: this.status
|
|
|
+ }, );
|
|
|
+ let res = await getOrderListApi({
|
|
|
+ ...result
|
|
|
+ });
|
|
|
+ if (res.code === 'OK') {
|
|
|
+ this.orderList = res.data.records;
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|