|
@@ -15,7 +15,7 @@ import {
|
|
|
Toast
|
|
|
} from 'vant'
|
|
|
import { formatterDate } from '@/helpers/utils'
|
|
|
-import { goodsType, orderType } from '@/constant'
|
|
|
+import { goodsType, orderType, returnType } from '@/constant'
|
|
|
|
|
|
import iconTeacher from '@common/images/icon_teacher.png'
|
|
|
import request from '@/helpers/request'
|
|
@@ -64,28 +64,31 @@ export default defineComponent({
|
|
|
},
|
|
|
methods: {
|
|
|
async getList() {
|
|
|
+ this.loading = true
|
|
|
try {
|
|
|
const params = {
|
|
|
...this.params,
|
|
|
searchDate: dayjs(this.currentDate).format('YYYY-MM')
|
|
|
}
|
|
|
- const res = await request.post('/api-student/userOrder/page', {
|
|
|
+ const url =
|
|
|
+ this.type === 'buy'
|
|
|
+ ? '/api-student/userOrder/page'
|
|
|
+ : '/api-student/UserOrderRefunds/page'
|
|
|
+ const { code, data } = await request.post(url, {
|
|
|
data: params
|
|
|
})
|
|
|
- this.loading = false
|
|
|
- const result = res.data || {}
|
|
|
- // 处理重复请求数据
|
|
|
- if (this.list.length > 0 && result.pageNo === 1) {
|
|
|
- return
|
|
|
+ if (code === 200) {
|
|
|
+ const result = data || {}
|
|
|
+ this.list = this.list.concat(result.rows || [])
|
|
|
+ this.finished = result.pageNo >= result.totalPage
|
|
|
+ this.params.page = result.pageNo + 1
|
|
|
+ this.dataShow = this.list.length > 0
|
|
|
}
|
|
|
- this.list = this.list.concat(result.rows || [])
|
|
|
- this.finished = result.pageNo >= result.totalPage
|
|
|
- this.params.page = result.pageNo + 1
|
|
|
- this.dataShow = this.list.length > 0
|
|
|
} catch {
|
|
|
this.dataShow = false
|
|
|
this.finished = true
|
|
|
}
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
onDetail(item: any) {
|
|
|
this.$router.push({
|
|
@@ -203,7 +206,7 @@ export default defineComponent({
|
|
|
</Sticky>
|
|
|
{this.dataShow ? (
|
|
|
<List
|
|
|
- v-model:loading={this.loading}
|
|
|
+ loading={this.loading}
|
|
|
finished={this.finished}
|
|
|
finishedText=" "
|
|
|
class={[styles.list]}
|
|
@@ -218,7 +221,7 @@ export default defineComponent({
|
|
|
>
|
|
|
<Cell
|
|
|
title={dayjs(item.createTime).format('YYYY-MM-DD HH:mm')}
|
|
|
- value={orderType[item.status]}
|
|
|
+ value={this.type ==='buy' ? orderType[item.status] : returnType[item.status]}
|
|
|
valueClass={styles.tradeType}
|
|
|
/>
|
|
|
<Cell
|
|
@@ -236,7 +239,7 @@ export default defineComponent({
|
|
|
<div class={styles.content}>
|
|
|
<span class={styles.price}>
|
|
|
¥
|
|
|
- {(this as any).$filters.moneyFormat(item.actualPrice)}
|
|
|
+ {(this as any).$filters.moneyFormat(item.actualPrice || item.actualAmount)}
|
|
|
</span>
|
|
|
</div>
|
|
|
)
|