hookehuyr

fix 购物车显示逻辑调整,获取列表方式调整

1 <!-- 1 <!--
2 * @Date: 2024-07-23 16:24:08 2 * @Date: 2024-07-23 16:24:08
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-07-26 15:12:39 4 + * @LastEditTime: 2024-07-26 16:37:21
5 * @FilePath: /temple_material_request/src/components/chooseMaterial/index.vue 5 * @FilePath: /temple_material_request/src/components/chooseMaterial/index.vue
6 * @Description: 选择物资组件 6 * @Description: 选择物资组件
7 --> 7 -->
8 <template> 8 <template>
9 - <div v-if="showBottom" class="choose-material-page"> 9 + <div class="choose-material-page">
10 <van-popup 10 <van-popup
11 v-model:show="showBottom" 11 v-model:show="showBottom"
12 position="bottom" 12 position="bottom"
...@@ -118,10 +118,7 @@ const getList = async () => { ...@@ -118,10 +118,7 @@ const getList = async () => {
118 } 118 }
119 119
120 onMounted(async () => { 120 onMounted(async () => {
121 - // 获取物资列表 121 +
122 - getList();
123 - // 购物车数量
124 - getCartCount();
125 }); 122 });
126 123
127 const getCartCount = async () => { 124 const getCartCount = async () => {
...@@ -138,6 +135,15 @@ watch( ...@@ -138,6 +135,15 @@ watch(
138 (v) => { 135 (v) => {
139 showBottom.value = v; 136 showBottom.value = v;
140 if (v) { 137 if (v) {
138 + // 重置查询条件
139 + offset.value = 0;
140 + limit.value = 20;
141 + finished.value = false;
142 + list.value = [];
143 + // 获取物资列表
144 + getList();
145 + // 购物车数量
146 + getCartCount();
141 } 147 }
142 } 148 }
143 ); 149 );
......