update: 细节优化

This commit is contained in:
admin 2024-05-23 13:37:29 +08:00
parent f433f725cd
commit e86e17b7c9
2 changed files with 15 additions and 13 deletions

View File

@ -562,16 +562,16 @@ watch(
// contrlModalParams.userSelect.list = res.data; // contrlModalParams.userSelect.list = res.data;
// } // }
// }); // });
ReceiveProductApi.getAllReProducts().then((res) => { // ReceiveProductApi.getAllReProducts().then((res) => {
if (res.code === 200) { // if (res.code === 200) {
contrlModalParams.productSelect.list = _.map( // contrlModalParams.productSelect.list = _.map(
res.data as any, // res.data as any,
function (item: any) { // function (item: any) {
return { name: item.reProductsName, ...item }; // return { name: item.reProductsName, ...item };
} // }
); // );
} // }
}); // });
const handleSelect = (key: string, v: any) => { const handleSelect = (key: string, v: any) => {
contrlModalParams[key].isShow = false; contrlModalParams[key].isShow = false;
if (key === "userSelect") { if (key === "userSelect") {

View File

@ -91,12 +91,14 @@ export const http = <T>(options: UniApp.RequestOptions) => {
//2.根据后端返回的数据调用一次或者两次replace替换 //2.根据后端返回的数据调用一次或者两次replace替换
var json1=json.replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2') var json1=json.replace(/:s*([0-9]{15,})s*(,?)/g, ': "$1" $2')
//3.手动转换回json数据即可 //3.手动转换回json数据即可
let res1 = JSON.parse(json1); let res1:any = JSON.parse(json1);
console.log(res1) console.log(res1)
if (res.statusCode >= 200 && res.statusCode < 300) { if (res.statusCode >= 200 && res.statusCode < 300) {
if ( if (
(res1 as any).code === 1001 || res1.code === 1001 ||
(res1 as any).code === 1002 res1.code === 1002 ||
res1.code === 1003 ||
res1.code === 1004
) { ) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",