瀏覽代碼

Merge branch 'master' of https://git.citupro.com/zhengnaiwen_citu/menduner-mall-uniapp

Xiao_123 11 月之前
父節點
當前提交
c4d5b51adc
共有 4 個文件被更改,包括 47 次插入3 次删除
  1. 8 1
      pages/pay/index.vue
  2. 30 0
      project.config.json
  3. 7 0
      project.private.config.json
  4. 2 2
      sheep/request/index.js

+ 8 - 1
pages/pay/index.vue

@@ -174,7 +174,14 @@
     if (code !== 0) {
       return
     }
-    state.payMethods = getPayMethods(data)
+    const payMethods = getPayMethods(data)
+
+    // 余额不足禁用余额支付
+    if ((state?.orderInfo?.price-0) > (sheep.$store('user')?.userWallet?.balance-0)) {
+      payMethods.forEach(e => { if (e.value === 'wallet') e.disabled = true })
+    }
+    
+    state.payMethods = payMethods
   }
 
   onLoad((options) => {

+ 30 - 0
project.config.json

@@ -0,0 +1,30 @@
+{
+  "compileType": "miniprogram",
+  "setting": {
+    "coverView": true,
+    "es6": true,
+    "postcss": true,
+    "minified": true,
+    "enhance": true,
+    "showShadowRootInWxmlPanel": true,
+    "packNpmRelationList": [],
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "ignoreUploadUnusedFiles": true
+  },
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  },
+  "libVersion": "3.5.8",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "appid": "wxda4fb2d98e95b8e0",
+  "simulatorPluginLibVersion": {}
+}

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "projectname": "mall",
+  "setting": {
+    "compileHotReLoad": true
+  }
+}

+ 2 - 2
sheep/request/index.js

@@ -194,9 +194,9 @@ http.interceptors.response.use(
 					errorMessage = 'HTTP 版本不受支持';
 					break;
 			}
-			if (error.errMsg.includes('timeout')) errorMessage = '请求超时';
+			if (error?.errMsg?.includes('timeout')) errorMessage = '请求超时';
 			// #ifdef H5
-			if (error.errMsg.includes('Network'))
+			if (error?.errMsg?.includes('Network'))
 				errorMessage = window.navigator.onLine ? '服务器异常' : '请检查您的网络连接';
 			// #endif
 		}