ljc il y a 1 jour
Parent
commit
c32e5301b6

+ 1 - 1
components/cwg-droplist.vue

@@ -196,7 +196,7 @@ const handleItemClick = (command) => {
 //
 const handleMenuClick = (item, index) => {
   emit('menuClick', { value: item, index })
-  console.log('menuClick', item, index, '关闭', props.hideOnClick)
+  // console.log('menuClick', item, index, '关闭', props.hideOnClick)
   if (props.hideOnClick) {
     closeMenu()
   }

+ 3 - 5
components/cwg-file-picker-wrapper.vue

@@ -474,10 +474,8 @@ const handleFile = async (fileData) => {
   }
 }
 const startUpload = async () => {
-  uni.showToast({
-    title: 'Loading...',
-    icon: 'loading',
-    duration: 10000000,
+  uni.showLoading({
+    // title: 'Loading...',
     mask: true
   })
 
@@ -496,7 +494,7 @@ const startUpload = async () => {
     }
   }
 
-  uni.hideToast()
+  uni.hideLoading()
 }
 
 const uploadFile = async (fileItem) => {

+ 32 - 18
pages/ib/components/pointDialog.vue

@@ -232,29 +232,43 @@ const closeDia = () => {
 
 const confirmDia = async () => {
   // 确认按钮点击事件
-  const loginConfig = []
-  Object.keys(commissionAccountTypeSettings.value).forEach((key) => {
-    const setting = commissionAccountTypeSettings.value[key]
-    if (setting.selectedItem) {
-      loginConfig.push(setting.selectedItem)
-    }
-  })
-  let res = await ibApi.customCommissionPoint({
-    id: dialogForm.value.id,
-    loginConfig,
-  })
-  if (res.code == Code.StatusOK) {
-    uni.showToast({
-      title: t('Msg.ModifySuccess'),
+  try {
+    uni.showLoading({
+      mask: true
     })
-    closeDia()
-  } else {
+    const loginConfig = []
+    Object.keys(commissionAccountTypeSettings.value).forEach((key) => {
+      const setting = commissionAccountTypeSettings.value[key]
+      if (setting.selectedItem) {
+        loginConfig.push(setting.selectedItem)
+      }
+    })
+    let res = await ibApi.customCommissionPoint({
+      id: dialogForm.value.id,
+      loginConfig,
+    })
+    if (res.code == Code.StatusOK) {
+      uni.showToast({
+        title: t('Msg.ModifySuccess'),
+      })
+      closeDia()
+      emit('confirm')
+    } else {
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      })
+    }
+  }catch (e){
+    // console.log('error',e)
     uni.showToast({
-      title: res.msg,
+      title: e.msg,
       icon: 'none',
     })
+  }finally {
+    uni.hideLoading()
   }
-  emit('confirm')
+
 }
 </script>
 <style lang="scss" scoped>

+ 1 - 1
pages/ib/customer.vue

@@ -229,7 +229,7 @@
   listApi.value = ibApi.customerSubs
 
   const handleSearch = (params: any) => {
-    console.log(params)
+    // console.log(params)
     // 合并表单的过滤参数,同时保留当前的 belongsType 标签选中状态
     search.value = {
       ...params,

+ 11 - 1
utils/request.js

@@ -138,7 +138,11 @@ const responseInterceptor = (response, options = {}) => {
     if (data.code === 200) {
       return data;
     } else if (data.code === 400) {
-      return Promise.reject(data);
+      // uni.showToast({
+      //   title: data.msg,
+      //   icon: "none",
+      // });
+      return data
     } else {
       uni.showToast({
         title: data.msg || "请求失败",
@@ -184,7 +188,11 @@ export const request = async (options) => {
 
   return new Promise((resolve, reject) => {
     const needLoading = urlLoading.some(item => config.url.includes(item));
+    console.log(needLoading,config.url)
     if (!needLoading) {
+      // uni.showLoading({
+      //   mask:true
+      // })
       // showLoading();
     }
     uni.request({
@@ -197,6 +205,7 @@ export const request = async (options) => {
           reject(err);
         } finally {
           if (!needLoading) {
+            // uni.hideLoading()
             // hideLoading();
           }
         }
@@ -205,6 +214,7 @@ export const request = async (options) => {
         const handledError = errorHandler(error);
         reject(handledError);
         if (!needLoading) {
+          // uni.hideLoading()
           // hideLoading();
         }
       },