hookehuyr

✨ feat(申领物质页面): 参考上一次活动的领用页面,数量的默认值不在使用 total_apply_number 字段,改成使用 total_number 字段

1 <!-- 1 <!--
2 * @Date: 2024-07-23 12:53:15 2 * @Date: 2024-07-23 12:53:15
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-07-29 17:40:24 4 + * @LastEditTime: 2024-11-11 13:39:14
5 * @FilePath: /temple_material_request/src/views/material_request.vue 5 * @FilePath: /temple_material_request/src/views/material_request.vue
6 * @Description: 申领物资页面 6 * @Description: 申领物资页面
7 --> 7 -->
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
37 </van-col> 37 </van-col>
38 <van-col span="8" style="display: flex; align-items: center;"> 38 <van-col span="8" style="display: flex; align-items: center;">
39 <van-field 39 <van-field
40 - v-model="item.total_apply_number" 40 + v-model="item.total_number"
41 style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;" 41 style="border: 1px solid #f0f0f0; padding: 0; border-radius: 5px;"
42 label="" 42 label=""
43 label-width="0" 43 label-width="0"
...@@ -173,7 +173,7 @@ const onCheck = (item) => { // 单选操作 ...@@ -173,7 +173,7 @@ const onCheck = (item) => { // 单选操作
173 const onBlur = (item) => { // 输入框失去焦点回调 173 const onBlur = (item) => { // 输入框失去焦点回调
174 if (item.checked) { 174 if (item.checked) {
175 // 错误提示 175 // 错误提示
176 - if (item.total_apply_number === null || item.total_apply_number === '') { 176 + if (item.total_number === null || item.total_number === '') {
177 item.error = true; 177 item.error = true;
178 } else { 178 } else {
179 item.error = false; 179 item.error = false;
...@@ -253,7 +253,7 @@ const addShoppingCart = async () => { // 加入购物车 ...@@ -253,7 +253,7 @@ const addShoppingCart = async () => { // 加入购物车
253 return; 253 return;
254 } 254 }
255 // 校验购物车值 255 // 校验购物车值
256 - let error_list = shop_cart_list.value.filter((item) => { if (item.total_apply_number === null || item.total_apply_number === '') { return item;} }) 256 + let error_list = shop_cart_list.value.filter((item) => { if (item.total_number === null || item.total_number === '') { return item;} })
257 if (error_list.length) { 257 if (error_list.length) {
258 // 跳到第一个错误框 258 // 跳到第一个错误框
259 scrollToSection(error_list[0].id); 259 scrollToSection(error_list[0].id);
...@@ -265,7 +265,7 @@ const addShoppingCart = async () => { // 加入购物车 ...@@ -265,7 +265,7 @@ const addShoppingCart = async () => { // 加入购物车
265 } 265 }
266 // 266 //
267 shop_cart_list.value.forEach(item => { 267 shop_cart_list.value.forEach(item => {
268 - item.apply_number = item.total_apply_number; 268 + item.apply_number = item.total_number;
269 }); 269 });
270 // 请求购物车接口 270 // 请求购物车接口
271 const { code, data } = await addCartAPI({ activity_id, good_list: shop_cart_list.value }); 271 const { code, data } = await addCartAPI({ activity_id, good_list: shop_cart_list.value });
......