hookehuyr

fix 购物车列表一次性全查出来

<!--
* @Date: 2024-07-23 12:53:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-07-24 18:26:06
* @LastEditTime: 2024-07-25 13:21:17
* @FilePath: /temple_material_request/src/views/material_pre_request.vue
* @Description: 待申领物资页面
-->
......@@ -29,42 +29,35 @@
</van-col>
</van-row>
</van-sticky>
<van-list
v-model:loading="loading"
:finished="finished"
finished-text="没有更多了"
@load="onLoad"
>
<div v-for="item in list" :id="item.id" :key="item" class="list-boxer">
<van-row align="center" justify="space-between">
<van-col span="16" style="display: flex;">
<span v-if="item.edit">
<van-icon v-if="item.checked" @click="onCheck(item)" name="checked" size="1.25rem" :color="styleColor.baseColor" />
<van-icon v-else name="passed" @click="onCheck(item)" size="1.25rem" />&nbsp;&nbsp;
</span>
<div class="van-ellipsis" :style="{ color: styleColor.baseColor, textDecoration: 'underline' }" @click="onClickTitle(item)">
{{ item.name }}
</div>
</van-col>
<van-col span="8" style="display: flex; align-items: center;">
<van-field
v-model="item.num"
style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;"
label=""
label-width="0"
input-align="center"
placeholder="数量"
type="number"
:disabled="!item.edit"
@blur="onBlur(item)"
>
<template #left-icon></template>
</van-field>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
</van-col>
</van-row>
<div v-if="item.error" style="padding: 0.5rem 2rem 0 0; font-size: 0.85rem; color: red; text-align: right;">输入值有误</div>
</div>
</van-list>
<div v-for="item in list" :id="item.id" :key="item" class="list-boxer">
<van-row align="center" justify="space-between">
<van-col span="16" style="display: flex;">
<span v-if="item.edit">
<van-icon v-if="item.checked" @click="onCheck(item)" name="checked" size="1.25rem" :color="styleColor.baseColor" />
<van-icon v-else name="passed" @click="onCheck(item)" size="1.25rem" />&nbsp;&nbsp;
</span>
<div class="van-ellipsis" :style="{ color: styleColor.baseColor, textDecoration: 'underline' }" @click="onClickTitle(item)">
{{ item.name }}
</div>
</van-col>
<van-col span="8" style="display: flex; align-items: center;">
<van-field
v-model="item.num"
style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;"
label=""
label-width="0"
input-align="center"
placeholder="数量"
type="number"
:disabled="!item.edit"
@blur="onBlur(item)"
>
<template #left-icon></template>
</van-field>&nbsp;&nbsp;<span style="font-size: 0.9rem; color: #666;">个</span>
</van-col>
</van-row>
<div v-if="item.error" style="padding: 0.5rem 2rem 0 0; font-size: 0.85rem; color: red; text-align: right;">输入值有误</div>
</div>
<div style="height: 6rem;"></div>
<div style="position: fixed; left: 0; right: 0; bottom:4.5rem; padding: 1rem;">
<van-button icon="plus" type="primary" :color="styleColor.baseColor" plain block @click="addMore">添加更多</van-button>
......@@ -287,7 +280,9 @@ const onConfirm = ({ selectedValues, selectedOptions }) => {
};
onMounted(() => {
minDate.value = new Date()
minDate.value = new Date();
// 测试
onLoad()
})
const addMore = () => { // 添加更多回调
......