HHE-5476 12 ore fa
parent
commit
cabbd7d188
9 ha cambiato i file con 1414 aggiunte e 747 eliminazioni
  1. 17 9
      api/user.js
  2. 430 426
      pages.json
  3. 94 43
      pages/mall/dapan.vue
  4. 437 200
      pages/user/index.vue
  5. 34 3
      pages/users/SVIP/SVIP.vue
  6. 50 32
      pages/users/VIP/VIP.vue
  7. 12 7
      stores/app.js
  8. 7 3
      stores/rights.js
  9. 333 24
      utils/util.js

+ 17 - 9
api/user.js

@@ -1,11 +1,11 @@
 import request from "@/utils/request.js";
-import Cache from "@/utils/cache.js"
+import Cache from "@/utils/cache.js";
 /**
  * 获取用户信息
- * 
-*/
-export function getUserInfo(){
-  return request.get('user');
+ *
+ */
+export function getUserInfo() {
+  return request.get("user");
 }
 
 /**
@@ -13,12 +13,12 @@ export function getUserInfo(){
  * @param data object 用户手机号 也只能
  */
 export function loginMobile(data) {
-  return request.post("login/mobile", data, { noAuth : true });
+  return request.post("login/mobile", data, { noAuth: true });
 }
 
 // 根据用户ID查询用户等级详细信息
 export function getUserLevelInfo(userId) {
-  return request.get(`user/level/detail/${userId}`);
+  return request.get(`user/level/detail-v16/${userId}`);
 }
 
 /**
@@ -106,7 +106,7 @@ export function getCodeApi() {
  *
  */
 export function getQrcode(data) {
-  return request.get('qrcode',data);
+  return request.get("qrcode", data);
 }
 /**
  * armg-2025/8/21-获取协议
@@ -189,4 +189,12 @@ export function getDefaultAccount() {
  */
 export function withdrawToCard(data) {
   return request.post("extract/cash", data);
-}
+}
+
+/**
+ * 企微客服列表
+ *
+ */
+export function getCustomerServiceList(data) {
+  return request.get("customer-service/list", data);
+}

+ 430 - 426
pages.json

@@ -1,429 +1,433 @@
 {
-	"easycom": {
-		"autoscan": true,
-		"custom": {
-			"^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
-			"^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
-			"^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
-		}
-	},
-	"pages": [
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "首页",
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationBarTextStyle": "black",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-			"path": "pages/mall/dapan",
-			"style": {
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationBarTextStyle": "white",
-				"navigationBarTitleText": "大盘"
-			}
-		},
-		{
-			"path": "pages/user/index",
-			"style": {
-				"navigationBarTitleText": "个人中心",
-				"navigationStyle": "custom"
-			}
-		},
-		{
-		  "path": "pages/change_password/change_password",
-		  "style": {
-		    "navigationBarTitleText": "修改密码",
-		    "navigationBarBackgroundColor": "#ffe079",
-		    "navigationBarTextStyle": "black",
-		    "enablePullDownRefresh": false
-		  }
-		},
+  "easycom": {
+    "autoscan": true,
+    "custom": {
+      "^u--(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
+      "^up-(.*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue",
+      "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue"
+    }
+  },
+  "pages": [
+    {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "首页",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "black",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/mall/dapan",
+      "style": {
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "white",
+        "navigationBarTitleText": "大盘"
+      }
+    },
+    {
+      "path": "pages/user/index",
+      "style": {
+        "navigationBarTitleText": "个人中心",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/change_password/change_password",
+      "style": {
+        "navigationBarTitleText": "修改密码",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "black",
+        "enablePullDownRefresh": false
+      }
+    },
 
-		{
-			"path": "pages/order_addcart/order_addcart",
-			"style": {
-				"navigationBarTitleText": "购物车",
-				"navigationBarBackgroundColor": "#fff",
-				"navigationBarTextStyle": "black"
-			}
-		},
-		{
-			"path": "pages/goods_cate/goods_cate",
-			"style": {
-				"navigationBarTitleText": "商品分类",
-				"navigationBarBackgroundColor": "#fff",
-				"navigationBarTextStyle": "black"
-			}
-		},
-		{
-			"path": "pages/order_list/index",
-			"style": {
-				"navigationBarTitleText": "我的订单",
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationBarTextStyle": "black"
-			}
-		},
-		{
-			"path": "pages/order_details/index",
-			"style": {
-				"navigationBarTitleText": "订单详情",
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationBarTextStyle": "black",
-				"app-plus": {
-					// #ifdef APP-PLUS
-					"titleNView": {
-						"type": "default"
-					}
-					// #endif
-				}
-			}
-		},
-		{
-			"path": "pages/order_pay_status/index",
-			"style": {
-				"navigationBarTitleText": "支付成功",
-				"navigationBarBackgroundColor": "#FFFFFF",
-				"navigationBarTextStyle": "black"
-			}
-		},
-		{
-			"path": "pages/merchantCenter/index",
-			"style": {
-				"navigationBarTitleText": "门店主页",
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationStyle": "custom"
-			}
-		},
+    {
+      "path": "pages/order_addcart/order_addcart",
+      "style": {
+        "navigationBarTitleText": "购物车",
+        "navigationBarBackgroundColor": "#fff",
+        "navigationBarTextStyle": "black"
+      }
+    },
+    {
+      "path": "pages/goods_cate/goods_cate",
+      "style": {
+        "navigationBarTitleText": "商品分类",
+        "navigationBarBackgroundColor": "#fff",
+        "navigationBarTextStyle": "black"
+      }
+    },
+    {
+      "path": "pages/order_list/index",
+      "style": {
+        "navigationBarTitleText": "我的订单",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "black"
+      }
+    },
+    {
+      "path": "pages/order_details/index",
+      "style": {
+        "navigationBarTitleText": "订单详情",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "black",
+        "app-plus": {
+          // #ifdef APP-PLUS
+          "titleNView": {
+            "type": "default"
+          }
+          // #endif
+        }
+      }
+    },
+    {
+      "path": "pages/order_pay_status/index",
+      "style": {
+        "navigationBarTitleText": "支付成功",
+        "navigationBarBackgroundColor": "#FFFFFF",
+        "navigationBarTextStyle": "black"
+      }
+    },
+    {
+      "path": "pages/merchantCenter/index",
+      "style": {
+        "navigationBarTitleText": "门店主页",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationStyle": "custom"
+      }
+    },
 
-		{
-			"path": "pages/webview/index",
-			"style": {
-				"navigationBarTitleText": "服务",
-				"navigationBarBackgroundColor": "#ffe079",
-				"navigationBarTextStyle": "black"
-			}
-		}
-	],
-	"subPackages": [
-		{
-			"root": "pages/users",
-			"name": "users",
-			"pages": [
-				{
-					"path": "login/index",
-					"style": {
-						"navigationBarTitleText": "登录",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "app_login/index",
-					"style": {
-						"navigationBarTitleText": "绑定手机号",
-						"navigationStyle": "custom"
-					}
-				},
-				{
-					"path": "wechat_login/index",
-					"style": {
-						"navigationBarTitleText": "登录"
-					}
-				},
-				{
-					"path": "my_merchant/index",
-					"style": {
-						"navigationBarTitleText": "我的商家",
-						"navigationBarBackgroundColor": "#FFE079",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "share/index",
-					"style": {
-						"navigationBarTitleText": "成为门店会员",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "card_page/index",
-					"style": {
-						"navigationBarTitleText": "卡包管理",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				},
-				{
-					"path": "card_page/create",
-					"style": {
-						"navigationBarTitleText": "卡包编辑",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				},
-				{
-					"path": "user_address_list/index",
-					"style": {
-						"navigationBarTitleText": "地址管理",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				},
-				{
-					"path": "user_address/index",
-					"style": {
-						"navigationBarTitleText": "添加地址",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				},
-				{
-					"path": "order_confirm/index",
-					"style": {
-						"navigationBarTitleText": "提交订单",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "browsing_history/index",
-					"style": {
-						"navigationBarTitleText": "浏览足迹",
-						"navigationBarBackgroundColor": "#fff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "user_asset/stock_in/stock_in",
-					"style": {
-						"navigationBarTitleText": "补仓",
-						"navigationBarBackgroundColor": "#fff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "user_asset/asset_info/asset_info",
-					"style": {
-						"navigationBarTitleText": "资产明细",
-						"navigationBarBackgroundColor": "#fff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "user_asset/record_list/record_list",
-					"style": {
-						"navigationBarTitleText": "交易明细",
-						"navigationBarBackgroundColor": "#fff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "user_return_list/index",
-					"style": {
-						"navigationBarTitleText": "退货列表",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				},
-				{
-					"path": "vault/index",
-					"style": {
-						"navigationBarTitleText": "钱包",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "user_goods_collection/index",
-					"style": {
-						"navigationBarTitleText": "收藏商品",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "VIP/VIP",
-					"style": {
-						"navigationBarTitleText": "VIP权益"
-					}
-				},
-				{
-					"path": "SVIP/SVIP",
-					"style": {
-						"navigationBarTitleText": "SVIP权益"
-					}
-				},
-				{
-					"path": "personal_info/personal_info",
-					"style": {
-						"navigationBarTitleText": "个人资料",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"enablePullDownRefresh": false
-					}
-				},
-				{
-					"path": "goods_return/index",
-					"style": {
-						"navigationBarTitleText": "申请退货",
-						"navigationBarBackgroundColor": "#ffe079",
-						"navigationBarTextStyle": "black",
-						"app-plus": {
-							// #ifdef APP-PLUS
-							"titleNView": {
-								"type": "default"
-							}
-							// #endif
-						}
-					}
-				}
-			]
-		},
-		{
-			"root": "pages/merchantCenters",
-			"name": "merchantCenters",
-			"pages": [
-				{
-					"path": "merchant",
-					"style": {
-						"navigationBarTitleText": "商家主页",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black",
-						"enablePullDownRefresh": false
-					}
-				},
-				{
-					"path": "postInformation",
-					"style": {
-						"navigationBarTitleText": "发布商品",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "productManagement",
-					"style": {
-						"navigationBarTitleText": "商品管理",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "releaseProduct",
-					"style": {
-						"navigationBarTitleText": "发布商品",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "productCenter",
-					"style": {
-						"navigationBarTitleText": "产品中心",
-						"navigationBarBackgroundColor": "#ffffff",
-						"navigationBarTextStyle": "black"
-					}
-				}
-			]
-		},
-		{
-			"root": "pages/goods",
-			"name": "goods",
-			"pages": [
-				{
-					"path": "goods_details/index",
-					"style": {
-						"navigationStyle": "custom",
-						"navigationBarTextStyle": "black"
-					}
-				},
-				{
-					"path": "goods_search/index",
-					"style": {
-						"navigationBarBackgroundColor": "#FFE079",
-						"navigationBarTitleText": "搜索商品",
-						"navigationBarTextStyle": "black"
-					}
-				}
-			]
-		}
-	],
-	"globalStyle": {
-		"navigationBarBackgroundColor": "#F8F8F8",
-		"navigationBarTextStyle": "black",
-		"navigationBarTitleText": "水贝商城",
-		"backgroundColor": "#ffe079"
-	},
-	"tabBar": {
-		"color": "#999999",
-		"selectedColor": "#F8C008",
-		"borderStyle": "black",
-		"backgroundColor": "#ffffff",
-		"list": [
-			{
-				"pagePath": "pages/index/index",
-				"iconPath": "static/images/tabbar/1-001.png",
-				"selectedIconPath": "static/images/tabbar/1-003.png",
-				"text": "首页"
-			},
-			{
-				"pagePath": "pages/goods_cate/goods_cate",
-				"iconPath": "static/images/2-001.png",
-				"selectedIconPath": "static/images/2-003.png",
-				"text": "分类"
-			},
-			{
-				"pagePath": "pages/order_addcart/order_addcart",
-				"iconPath": "static/images/tabbar/3-001.png",
-				"selectedIconPath": "static/images/tabbar/3-003.png",
-				"text": "购物车"
-			},
-			{
-				"pagePath": "pages/user/index",
-				"iconPath": "static/images/tabbar/4-001.png",
-				"selectedIconPath": "static/images/tabbar/4-003.png",
-				"text": "我的"
-			}
-		]
-	},
-	"uniIdRouter": {}
-}
+    {
+      "path": "pages/webview/index",
+      "style": {
+        "navigationBarTitleText": "服务",
+        "navigationBarBackgroundColor": "#ffe079",
+        "navigationBarTextStyle": "black"
+      }
+    }
+  ],
+  "subPackages": [
+    {
+      "root": "pages/users",
+      "name": "users",
+      "pages": [
+        {
+          "path": "login/index",
+          "style": {
+            "navigationBarTitleText": "登录",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "app_login/index",
+          "style": {
+            "navigationBarTitleText": "绑定手机号",
+            "navigationStyle": "custom"
+          }
+        },
+        {
+          "path": "wechat_login/index",
+          "style": {
+            "navigationBarTitleText": "登录"
+          }
+        },
+        {
+          "path": "my_merchant/index",
+          "style": {
+            "navigationBarTitleText": "我的商家",
+            "navigationBarBackgroundColor": "#FFE079",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "share/index",
+          "style": {
+            "navigationBarTitleText": "成为门店会员",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "card_page/index",
+          "style": {
+            "navigationBarTitleText": "卡包管理",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        },
+        {
+          "path": "card_page/create",
+          "style": {
+            "navigationBarTitleText": "卡包编辑",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        },
+        {
+          "path": "user_address_list/index",
+          "style": {
+            "navigationBarTitleText": "地址管理",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        },
+        {
+          "path": "user_address/index",
+          "style": {
+            "navigationBarTitleText": "添加地址",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        },
+        {
+          "path": "order_confirm/index",
+          "style": {
+            "navigationBarTitleText": "提交订单",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "browsing_history/index",
+          "style": {
+            "navigationBarTitleText": "浏览足迹",
+            "navigationBarBackgroundColor": "#fff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "user_asset/stock_in/stock_in",
+          "style": {
+            "navigationBarTitleText": "补仓",
+            "navigationBarBackgroundColor": "#fff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "user_asset/asset_info/asset_info",
+          "style": {
+            "navigationBarTitleText": "资产明细",
+            "navigationBarBackgroundColor": "#fff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "user_asset/record_list/record_list",
+          "style": {
+            "navigationBarTitleText": "交易明细",
+            "navigationBarBackgroundColor": "#fff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "user_return_list/index",
+          "style": {
+            "navigationBarTitleText": "退货列表",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        },
+        {
+          "path": "vault/index",
+          "style": {
+            "navigationBarTitleText": "钱包",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "user_goods_collection/index",
+          "style": {
+            "navigationBarTitleText": "收藏商品",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "VIP/VIP",
+          "style": {
+            "navigationBarTitleText": "VIP权益",
+            "navigationBarBackgroundColor": "#2f2e3e",
+            "navigationBarTextStyle": "white"
+          }
+        },
+        {
+          "path": "SVIP/SVIP",
+          "style": {
+            "navigationBarTitleText": "SVIP权益",
+            "navigationBarBackgroundColor": "#212121",
+            "navigationBarTextStyle": "white"
+          }
+        },
+        {
+          "path": "personal_info/personal_info",
+          "style": {
+            "navigationBarTitleText": "个人资料",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "enablePullDownRefresh": false
+          }
+        },
+        {
+          "path": "goods_return/index",
+          "style": {
+            "navigationBarTitleText": "申请退货",
+            "navigationBarBackgroundColor": "#ffe079",
+            "navigationBarTextStyle": "black",
+            "app-plus": {
+              // #ifdef APP-PLUS
+              "titleNView": {
+                "type": "default"
+              }
+              // #endif
+            }
+          }
+        }
+      ]
+    },
+    {
+      "root": "pages/merchantCenters",
+      "name": "merchantCenters",
+      "pages": [
+        {
+          "path": "merchant",
+          "style": {
+            "navigationBarTitleText": "商家主页",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black",
+            "enablePullDownRefresh": false
+          }
+        },
+        {
+          "path": "postInformation",
+          "style": {
+            "navigationBarTitleText": "发布商品",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "productManagement",
+          "style": {
+            "navigationBarTitleText": "商品管理",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "releaseProduct",
+          "style": {
+            "navigationBarTitleText": "发布商品",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "productCenter",
+          "style": {
+            "navigationBarTitleText": "产品中心",
+            "navigationBarBackgroundColor": "#ffffff",
+            "navigationBarTextStyle": "black"
+          }
+        }
+      ]
+    },
+    {
+      "root": "pages/goods",
+      "name": "goods",
+      "pages": [
+        {
+          "path": "goods_details/index",
+          "style": {
+            "navigationStyle": "custom",
+            "navigationBarTextStyle": "black"
+          }
+        },
+        {
+          "path": "goods_search/index",
+          "style": {
+            "navigationBarBackgroundColor": "#FFE079",
+            "navigationBarTitleText": "搜索商品",
+            "navigationBarTextStyle": "black"
+          }
+        }
+      ]
+    }
+  ],
+  "globalStyle": {
+    "navigationBarBackgroundColor": "#F8F8F8",
+    "navigationBarTextStyle": "black",
+    "navigationBarTitleText": "水贝商城",
+    "backgroundColor": "#ffe079"
+  },
+  "tabBar": {
+    "color": "#999999",
+    "selectedColor": "#F8C008",
+    "borderStyle": "black",
+    "backgroundColor": "#ffffff",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "iconPath": "static/images/tabbar/1-001.png",
+        "selectedIconPath": "static/images/tabbar/1-003.png",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/goods_cate/goods_cate",
+        "iconPath": "static/images/2-001.png",
+        "selectedIconPath": "static/images/2-003.png",
+        "text": "分类"
+      },
+      {
+        "pagePath": "pages/order_addcart/order_addcart",
+        "iconPath": "static/images/tabbar/3-001.png",
+        "selectedIconPath": "static/images/tabbar/3-003.png",
+        "text": "购物车"
+      },
+      {
+        "pagePath": "pages/user/index",
+        "iconPath": "static/images/tabbar/4-001.png",
+        "selectedIconPath": "static/images/tabbar/4-003.png",
+        "text": "我的"
+      }
+    ]
+  },
+  "uniIdRouter": {}
+}

+ 94 - 43
pages/mall/dapan.vue

@@ -13,9 +13,9 @@
       <span
         class="status-right"
         style="margin-left: 10px"
-        :class="{ active: isWeekend }"
+        :class="{ active: !isOpen }"
       >
-        {{ isWeekend ? "闭盘" : "开盘" }}
+        {{ !isOpen ? "闭盘" : "开盘" }}
       </span>
     </view>
     <view class="notice-box">
@@ -350,12 +350,12 @@
                 </view>
                 <view class="col" style="width: calc(100% / 13 * (10 / 3))">
                   <view class="symbole-price">
-                    <view class="symbol-price-rise">{{
-                      vipagTodayHigh.toFixed(2)
-                    }}</view>
-                    <view class="symbol-price-fall fall">{{
-                      vipagTodayLow.toFixed(2)
-                    }}</view>
+                    <view class="symbol-price-rise">
+                      {{ vipagTodayHigh.toFixed(2) }}
+                    </view>
+                    <view class="symbol-price-fall fall">
+                      {{ vipagTodayLow.toFixed(2) }}
+                    </view>
                   </view>
                 </view>
               </view>
@@ -363,18 +363,16 @@
           </view>
 
           <view class="tips">
-            <view>会员等级在此基础上有优惠,等级越高,</view>
-            <view>买卖金价格越划算,以上数据仅供参考!</view>
+            <up-parse :content="dapan_agreement"></up-parse>
             <!-- <view @click="navigate">点击查看详情</view> -->
           </view>
           <view class="pageFooter">
             <view class="item">
               <view class="address">
-                <view
-                  >{{ appStore.$wxConfig.mailerName }} :{{
-                    appStore.$wxConfig.mailerPhone
-                  }}</view
-                >
+                <view>
+                  {{ appStore.$wxConfig.mailerName }} :
+                  {{ appStore.$wxConfig.mailerPhone }}
+                </view>
                 <view class="address-detail" style="margin-top: 4px">
                   <text class="receive-address">地址:</text>
                   {{ appStore.$wxConfig.mailingAddress }}
@@ -396,14 +394,17 @@ import { useRealtimeTimestamp } from "@/utils/useRealtimeTimestamp.js";
 import { useAppStore } from "@/stores/app";
 import { getUserLevelInfo } from "@/api/user";
 import useRealGoldPrice from "@/hooks/useRealGoldPrice";
-
+import { agreementGetoneApi } from "@/api/user";
 import { useToast } from "@/hooks/useToast";
+import { getMiniProgramData } from "@/api/api";
+import { Calc } from "@/utils/util";
+
 const { Toast } = useToast();
 
 // 全局状态和时间
 const appStore = useAppStore();
 const { timestamp } = useRealtimeTimestamp();
-
+const isOpen = ref(false);
 const contactHandle = () => {
   uni.navigateTo({ url: "/pages/message_create/message_create" });
 };
@@ -443,15 +444,56 @@ const adjustKgoldPrice = ref({});
 const adjustPtPrice = ref({});
 const adjustAgPrice = ref({});
 
+// svip权益
+const svipGoldPrice = ref(0);
+const svipKgoldPrice = ref(0);
+const svipPtPrice = ref(0);
+const svipAgPrice = ref(0);
+
 onLoad(() => {
   getUserBenefits();
+  agreementGetoneFn();
+
+  appStore.isLogin && updateWxSettingInfo();
 });
+
+const updateWxSettingInfo = async () => {
+  const { data } = await getMiniProgramData();
+  if (!data?.metalConfigs) return;
+  data.metalConfigs.forEach((item) => {
+    switch (item.metalType) {
+      case "au":
+        svipGoldPrice.value = item.svipDiscountPerGram || 0;
+        break;
+      case "kau":
+        svipKgoldPrice.value = item.svipDiscountPerGram || 0;
+        break;
+      case "pt":
+        svipPtPrice.value = item.svipDiscountPerGram || 0;
+        break;
+      case "ag":
+        svipAgPrice.value = item.svipDiscountPerGram || 0;
+        break;
+      default:
+        break;
+    }
+  });
+};
+
+const dapan_agreement = ref("");
+
+const agreementGetoneFn = () => {
+  agreementGetoneApi({ name: "dapan_agreement" }).then((res) => {
+    dapan_agreement.value = res.data?.content;
+  });
+};
+
 const getUserBenefits = async () => {
   try {
     const res = await getUserLevelInfo(appStore?.userInfo?.userId || 0);
 
-    userBenefits.value = res.data || { sold: 0, buy: 0 }; // 默认权益为0,避免NaN
-
+    userBenefits.value = res.data || { sold: 0, buy: 0, silverSold: 0 }; // 默认权益为0,避免NaN
+    isOpen.value = res.data?.isOpen;
     if (
       userBenefits?.value?.nobleMeta &&
       userBenefits.value.nobleMeta.length > 0
@@ -479,7 +521,7 @@ const getUserBenefits = async () => {
     }
   } catch (error) {
     console.error("获取用户权益失败:", error);
-    userBenefits.value = { sold: 0, buy: 0 }; // 出错时默认权益为0
+    userBenefits.value = { sold: 0, buy: 0, silverSold: 0 }; // 出错时默认权益为0
   }
 };
 
@@ -488,6 +530,12 @@ const vipRealGoldRecyclePrice = computed(() => {
   // console.log("vipRealGoldRecyclePrice", realGoldRecyclePrice.value);
   // console.log("userBenefits", userBenefits.value.sold);
   // console.log("adjustGoldPrice", adjustGoldPrice.value.buyPriceAdjust);
+  // console.log(
+  //   "================>",
+  //   Number(realGoldRecyclePrice.value) +
+  //     Number(userBenefits.value.sold) -
+  //     Number(adjustGoldPrice.value.buyPriceAdjust)
+  // );
 
   return (
     Number(realGoldRecyclePrice.value) +
@@ -525,11 +573,14 @@ const viprealPtprice = computed(
     Number(userBenefits.value.buy) +
     Number(adjustPtPrice.value.sellPriceAdjust)
 );
-const viprealAgRecyclePrice = computed(
-  () =>
-    Number(realAgRecyclePrice.value) +
-    Number(userBenefits.value.sold) -
-    Number(adjustAgPrice.value.buyPriceAdjust)
+const viprealAgRecyclePrice = computed(() =>
+  Calc.add(
+    Number(realAgRecyclePrice.value),
+    Number(userBenefits.value.silverSold || 0)
+  )
+    .sub(Number(adjustAgPrice.value.buyPriceAdjust))
+    .truncate()
+    .valueOf()
 );
 const viprealAgprice = computed(
   () =>
@@ -538,18 +589,22 @@ const viprealAgprice = computed(
     Number(adjustAgPrice.value.sellPriceAdjust)
 );
 
-// SVIP 价格计算(回购价多+0.3,销售价复用VIP)
-const svipRealGoldRecyclePrice = computed(
-  () => vipRealGoldRecyclePrice.value + 0.3
+// SVIP 价格计算(回购价多+0.02,销售价复用VIP)
+const svipRealGoldRecyclePrice = computed(() =>
+  Calc.add(vipRealGoldRecyclePrice.value, svipGoldPrice.value)
+    .truncate()
+    .valueOf()
 );
-const sviprealKGoldRecyclePrice = computed(
-  () => viprealKGoldRecyclePrice.value + 0.3
+const sviprealKGoldRecyclePrice = computed(() =>
+  Calc.add(viprealKGoldRecyclePrice.value, svipKgoldPrice.value)
+    .truncate()
+    .valueOf()
 );
-const sviprealPtRecyclePrice = computed(
-  () => viprealPtRecyclePrice.value + 0.3
+const sviprealPtRecyclePrice = computed(() =>
+  Calc.add(viprealPtRecyclePrice.value, svipPtPrice.value).truncate().valueOf()
 );
-const sviprealAgRecyclePrice = computed(
-  () => viprealAgRecyclePrice.value + 0.3
+const sviprealAgRecyclePrice = computed(() =>
+  Calc.add(viprealAgRecyclePrice.value, svipAgPrice.value).truncate().valueOf()
 );
 
 // 高低价计算
@@ -677,26 +732,26 @@ watch(viprealAgprice, async (newVal, oldVal) => {
 
 // SVIP 价格监听(仅回购价)
 watch(svipRealGoldRecyclePrice, async (newVal, oldVal) => {
-  // 排除初始无权益时的0.3
-  if (Math.abs(newVal - 0.3) < 0.001) return;
+  // 排除初始无权益时的0.02
+  if (Math.abs(newVal - 0.02) < 0.001) return;
   await nextTick();
   svipGoldRecyclePrev.value = oldVal;
 });
 
 watch(sviprealKGoldRecyclePrice, async (newVal, oldVal) => {
-  if (Math.abs(newVal - 0.3) < 0.001) return;
+  if (Math.abs(newVal - 0.02) < 0.001) return;
   await nextTick();
   svipKGoldRecyclePrev.value = oldVal;
 });
 
 watch(sviprealPtRecyclePrice, async (newVal, oldVal) => {
-  if (Math.abs(newVal - 0.3) < 0.001) return;
+  if (Math.abs(newVal - 0.02) < 0.001) return;
   await nextTick();
   svipPtRecyclePrev.value = oldVal;
 });
 
 watch(sviprealAgRecyclePrice, async (newVal, oldVal) => {
-  if (Math.abs(newVal - 0.3) < 0.001) return;
+  if (Math.abs(newVal - 0.02) < 0.001) return;
   await nextTick();
   svipAgRecyclePrev.value = oldVal;
 });
@@ -875,10 +930,6 @@ page {
 }
 
 .tips {
-  font-size: 26rpx;
-  color: #d8bb7d;
-  text-align: center;
-  line-height: 1.8;
   margin-top: 20rpx;
 }
 

File diff suppressed because it is too large
+ 437 - 200
pages/user/index.vue


+ 34 - 3
pages/users/SVIP/SVIP.vue

@@ -75,6 +75,7 @@ import WechatPayment from "@/components/payment/WechatPayment.vue";
 // 引入后端接口(按需补充:如“创建会员订单”“标记SVIP身份”的接口)
 // import { createVipOrder, markUserSvip } from "@/api/vip";
 import { onLoad } from "@dcloudio/uni-app";
+import { getMiniProgramData } from "@/api/api";
 
 // 状态管理
 const appStore = useAppStore();
@@ -99,8 +100,8 @@ const taskList = ref([
     icon: "https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/svip/%E8%B7%AF%E5%BE%84733%403x.png",
   },
   {
-    name: "卖出特权",
-    reward: "卖出价+0.3/克",
+    name: "回收特权",
+    reward: "回收价+0.02/克",
     icon: "https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/svip/huishoutequan.png",
   },
   {
@@ -110,7 +111,7 @@ const taskList = ref([
   },
   {
     name: "超级工具",
-    reward: "自动卖出,金价预警使用权限",
+    reward: "自动回收,金价预警使用权限",
     icon: "https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/svip/chaojigongju.png",
   },
   {
@@ -137,8 +138,38 @@ const percentExperience = computed(() => {
 // 页面加载时获取会员价格
 onLoad(() => {
   getSvipPrice();
+
+  appStore.isLogin && updateWxSettingInfo();
 });
 
+const updateWxSettingInfo = async () => {
+  const { data } = await getMiniProgramData();
+  if (!data?.metalConfigs) return;
+
+  // svip权益
+  let svipGoldPrice = 0;
+  let svipPtPrice = 0;
+  let svipAgPrice = 0;
+
+  data.metalConfigs.forEach((item) => {
+    switch (item.metalType) {
+      case "au":
+        svipGoldPrice = item.svipDiscountPerGram || 0;
+        break;
+      case "pt":
+        svipPtPrice = item.svipDiscountPerGram || 0;
+        break;
+      case "ag":
+        svipAgPrice = item.svipDiscountPerGram || 0;
+        break;
+      default:
+        break;
+    }
+  });
+
+  taskList.value[1].reward = `黄金回收价+${svipGoldPrice}/克\n铂金回收价+${svipPtPrice}/克\n白银回收价+${svipAgPrice}/克`;
+};
+
 /**
  * 获取SVIP会员价格(单位:元)
  */

+ 50 - 32
pages/users/VIP/VIP.vue

@@ -55,14 +55,17 @@
         </view>
         <view class="benefit-desc">
           <view>当前已解锁权益:</view>
-          <view>
-            买金-<text>{{ appStore.$userInfo?.buy || 0 }}</text
-            >元/克
+          <view v-if="appStore.$userInfo?.buy && appStore.$userInfo?.buy != 0">
+            买金-
+            <text>{{ appStore.$userInfo?.buy || 0 }} </text>
+            元/克
           </view>
-          <view>
-            卖出+<text
-              ><text>{{ appStore.$userInfo?.sold || 0 }}</text></text
-            >元/克
+          <view
+            v-if="appStore.$userInfo?.sold && appStore.$userInfo?.sold != 0"
+          >
+            回收+
+            <text>{{ appStore.$userInfo?.sold || 0 }}</text>
+            元/克
           </view>
           <view>
             购物折扣:<text>{{ appStore.$userInfo?.discount || "无" }}</text
@@ -78,20 +81,20 @@
           <text class="task-name">{{ task.name }}</text>
           <text class="task-reward">{{ task.reward }}</text>
         </view>
-		<view class="submit-btn">
-			<up-button
-			  v-if="!appStore.$wxConfig?.auditModeEnabled"
-			  @click="toPages(task)"
-			  type="warning"
-			  :text="task.btnText"
-			  size="mini"
-			  shape="circle"
-			></up-button>
-		</view>
-        
+        <view
+          v-if="!appStore.$wxConfig?.auditModeEnabled"
+          class="submit-btn"
+          @click="toPages(task)"
+        >
+          {{ task.btnText }}
+        </view>
       </view>
     </view>
 
+    <view class="tip">
+      <up-parse :content="vip_level_detail"></up-parse>
+    </view>
+
     <!-- vip成长系统 -->
     <view class="vip-level-box">
       <view class="vip-level-title">会员成长系统</view>
@@ -114,15 +117,15 @@
           </view>
           <view class="content-item">{{ item.experience }}</view>
           <view class="content-item quanyi" style="width: 27%">
-            <text
-              >买金- <text class="gw"> {{ item.buy }}元/克</text>
+            <text v-if="item.buy !== '0.00'">
+              买金- <text class="gw"> {{ item.buy }}元/克 </text>
             </text>
-            <text>
+            <text v-if="item.sold !== '0.00'">
               卖金+<text class="gw"> {{ item.sold }}元/克</text>
             </text>
-            <text
-              >购物 :<text class="gw zk">{{ item.discount }} 折</text></text
-            >
+            <text>
+              购物 :<text class="gw zk">{{ item.discount }} 折</text>
+            </text>
           </view>
         </view>
         <veiw class="content-desc">
@@ -156,17 +159,27 @@ import { ref, computed, onMounted } from "vue";
 import { useAppStore } from "@/stores/app";
 import { onLoad, onShareAppMessage } from "@dcloudio/uni-app";
 import { levelGrowthList } from "@/api/svip";
+import { agreementGetoneApi } from "@/api/user";
 
 const appStore = useAppStore();
 let leveList = ref([]);
 const showInvite = ref(false);
 
 onMounted(() => {
-  console.log("mounted1", appStore.$userInfo);
-
   getLevelGrowthList();
+  agreementGetoneFn();
+
+  console.log("appStore.$userInfo?.buy", appStore.$userInfo);
 });
 
+const vip_level_detail = ref("");
+
+const agreementGetoneFn = () => {
+  agreementGetoneApi({ name: "vip_level_detail" }).then((res) => {
+    vip_level_detail.value = res.data?.content;
+  });
+};
+
 // 权益列表数据
 const benefitList = ref([
   {
@@ -457,9 +470,14 @@ onShareAppMessage(() => {
   border-radius: 8rpx;
   margin-bottom: 16rpx;
   background-color: #f4f3f1;
-  .submit-btn {
-    width: 120rpx;
-  }
+}
+.submit-btn {
+  background: #ffbf40;
+  color: #fff;
+  text-align: center;
+  padding: 4rpx 12rpx;
+  font-size: 22rpx;
+  border-radius: 10rpx;
 }
 .task-desc {
   display: flex;
@@ -544,8 +562,8 @@ onShareAppMessage(() => {
   margin-top: 20rpx;
   font-size: 22rpx;
 }
-
-uni-page-body{
-	background-color: #fff !important;
+.tip {
+  margin-bottom: 20rpx;
+  padding: 0 20rpx;
 }
 </style>

+ 12 - 7
stores/app.js

@@ -39,11 +39,11 @@ export const useAppStore = defineStore("app", {
         signGrowthValue: 0,
       },
       // 店铺信息
-      shopInfo:{
-        name:"水贝001号店铺",
-        shopId:"001"
+      shopInfo: {
+        name: "水贝001号店铺",
+        shopId: "001",
       },
-      merchantId:null,
+      merchantId: null,
     };
   },
   getters: {
@@ -96,7 +96,6 @@ export const useAppStore = defineStore("app", {
       document.body.style.backgroundColor = color;
     },
     UPDATE_USERINFO(userInfo) {
-		console.log("appStore.userInfo更新===>",userInfo)
       this.userInfo = userInfo;
       Cache.set(USER_INFO, userInfo);
     },
@@ -131,8 +130,14 @@ export const useAppStore = defineStore("app", {
     // 获取小程序基本配置
     async GET_WX_CONFIG() {
       try {
-        const res = await getMiniProgramData();
-        this.wxConfig = { ...res.data };
+        const { data } = await getMiniProgramData();
+        const configDate = {
+          ...data,
+          alipayList: data.alipayList ? JSON.parse(data.alipayList) : [],
+          bankCardList: data.bankCardList ? JSON.parse(data.bankCardList) : [],
+        };
+        this.wxConfig = configDate;
+        return configDate;
       } catch (e) {
         console.log("GET_WX_CONFIG-stores-res", e);
         throw e;

+ 7 - 3
stores/rights.js

@@ -10,14 +10,18 @@ export const useStoreRights = defineStore("rights", () => {
   const getUserBenefits = async (id) => {
     try {
       const res = await getUserLevelInfo(id);
-      userBenefits.value = res.data || { sold: 0, buy: 0 }; // 默认权益为0,避免NaN
+      userBenefits.value = {
+        ...res.data,
+        sold: res.data.sold || 0,
+        buy: res.data.buy || 0,
+        silverSold: res.data.silverSold || 0,
+      };
     } catch (error) {
       console.error("获取用户权益失败:", error);
-      userBenefits.value = { sold: 0, buy: 0 }; // 出错时默认权益为0
+      userBenefits.value = { sold: 0, buy: 0, silverSold: 0 }; // 出错时默认权益为0
     }
   };
 
-  // 4. 返回需要暴露的状态、计算属性、方法
   return {
     userBenefits,
     getUserBenefits,

+ 333 - 24
utils/util.js

@@ -6,7 +6,7 @@ import { getJoinRolesAPI } from "@/api/joinus";
 import { footprintScan } from "@/api/merchant.js";
 import { pathToBase64 } from "@/plugin/image-tools/index.js";
 import { useToast } from "@/hooks/useToast";
-import pageJson from '@/pages.json';
+import pageJson from "@/pages.json";
 const appStore = useAppStore(); // 调用函数获取实例
 export default {
   /**
@@ -866,35 +866,37 @@ export function isTabBarPage() {
   // 获取当前页面栈
   const pages = getCurrentPages();
   // 获取当前页面路径(不包含参数部分)
-  if(!pages[pages.length - 1]){
+  if (!pages[pages.length - 1]) {
     return false;
   }
   const currentPagePath = pages[pages.length - 1].route;
   // 获取 app.json 中的 tabBar 配置
-  const tabBarPages = getApp().globalData.tabBarPages || (() => {
-    // 从 app.json 中读取 tabBar 配置
-    // const appJson = import('@/pages.json');
-    // console.log('pageJson', pageJson)
-    const tabBarList = pageJson.tabBar ? pageJson.tabBar.list : [];
-    // 提取所有 tabBar 页面的路径
-    const pages = tabBarList.map(item => item.pagePath);
-    // 缓存到全局数据中,避免重复解析
-    getApp().globalData.tabBarPages = pages;
-    return pages;
-  })();
+  const tabBarPages =
+    getApp().globalData.tabBarPages ||
+    (() => {
+      // 从 app.json 中读取 tabBar 配置
+      // const appJson = import('@/pages.json');
+      // console.log('pageJson', pageJson)
+      const tabBarList = pageJson.tabBar ? pageJson.tabBar.list : [];
+      // 提取所有 tabBar 页面的路径
+      const pages = tabBarList.map((item) => item.pagePath);
+      // 缓存到全局数据中,避免重复解析
+      getApp().globalData.tabBarPages = pages;
+      return pages;
+    })();
 
   // 判断当前页面是否在 tabBar 配置中
   return tabBarPages.includes(currentPagePath);
 }
 
 // 获取邀请码
-export async function getSceneInfo (e,index) {
+export async function getSceneInfo(e, index) {
   if (e.scene) {
     const decodedScene = decodeURIComponent(e.scene);
     const params = {};
     if (decodedScene) {
-      decodedScene.split('&').forEach(item => {
-        const [key, value] = item.split('=');
+      decodedScene.split("&").forEach((item) => {
+        const [key, value] = item.split("=");
         if (key && value) {
           params[key] = value;
         }
@@ -902,14 +904,14 @@ export async function getSceneInfo (e,index) {
     }
 
     if (params.merchantId) appStore.UPDATE_MERCHANT_ID(params.merchantId);
-    if(index == 'index' && appStore.userInfo){
-      let obj ={
-        merchantId:params.merchantId,
-        userId:appStore.userInfo.userId
-      }
-      await footprintScan(obj)
+    if (index == "index" && appStore.userInfo) {
+      let obj = {
+        merchantId: params.merchantId,
+        userId: appStore.userInfo.userId,
+      };
+      await footprintScan(obj);
     }
-    console.log("获取邀请码-params", params)
+    console.log("获取邀请码-params", params);
     return params;
   }
   return {};
@@ -972,4 +974,311 @@ export async function addRecommenderRole(remark) {
       duration: 2000,
     });
   }
-}
+}
+
+/**
+ * 精确计算工具(支持直接调用和链式调用)
+ * 使用方法:
+ * import { Calc } from '@/utils/util'
+ *
+ * // 直接计算(两个参数)
+ * const sum = Calc.add(0.1, 0.2).valueOf(); // 0.3
+ *
+ * // 链式调用(后续方法传入一个参数,基于前一步结果计算)
+ * const result = Calc.add(1, 2).sub(1).mul(3).div(2).fixed(1).valueOf(); // 3.0
+ *
+ * // 截断示例:40.66 截断2位 → 40.66;40.666 截断2位 → 40.66
+ * const truncResult = Calc.truncate(40.666, 2).valueOf(); // 40.66
+ *
+ * // 注意点
+ * 需要在最后调用一次.valueOf()获取最终值,否则会返回一个Calc对象。
+ */
+export const Calc = {
+  // 存储当前计算值
+  currentValue: null,
+
+  /**
+   * 重置当前值(内部使用,确保每次计算独立性)
+   */
+  _reset() {
+    this.currentValue = null;
+    return this;
+  },
+
+  /**
+   * 内部工具:校验并转换为有效数字(核心修复点)
+   * @param {any} num - 待校验的数值
+   * @returns {Number} 有效数字(无效则返回 0)
+   */
+  _validateNum(num) {
+    // 过滤 Infinity/-Infinity/NaN/undefined/null/空字符串
+    if (
+      num === undefined ||
+      num === null ||
+      num === "" ||
+      !isFinite(num) ||
+      isNaN(Number(num))
+    ) {
+      return 0;
+    }
+    // 转换为数字类型(处理字符串数字,如 "123.45")
+    return Number(num);
+  },
+
+  /**
+   * 内部工具:解析数值字符串,返回整数部分、小数部分、小数位数、符号
+   * @param {Number|String} num - 待解析的数值
+   * @returns {Object} 解析结果
+   */
+  _parseNumStr(num) {
+    // 第一步:先校验并转换为有效数字(修复 NaN 问题)
+    const validNum = this._validateNum(num);
+    const str = String(validNum).trim().replace(/^\+/, ""); // 移除正号
+
+    const isNegative = str.startsWith("-");
+    const absStr = isNegative ? str.slice(1) : str;
+    const [integerPart = "0", decimalPart = "0"] = absStr.split(".");
+
+    // 处理纯小数(如.123)或纯整数(如123.)的情况
+    const cleanInteger = integerPart || "0";
+    const cleanDecimal = decimalPart || "0";
+
+    return {
+      isNegative,
+      integerPart: cleanInteger,
+      decimalPart: cleanDecimal,
+      decimalLength: cleanDecimal.length,
+    };
+  },
+
+  /**
+   * 内部工具:对齐两个数的小数位数,转换为大整数
+   * @param {Number|String} num1 - 数值1
+   * @param {Number|String} num2 - 数值2
+   * @returns {Object} 对齐后的整数和缩放比例
+   */
+  _alignDecimals(num1, num2) {
+    const n1 = this._parseNumStr(num1);
+    const n2 = this._parseNumStr(num2);
+    const maxDecimalLen = Math.max(n1.decimalLength, n2.decimalLength);
+
+    // 补零对齐小数位数
+    const n1DecimalPadded = n1.decimalPart.padEnd(maxDecimalLen, "0");
+    const n2DecimalPadded = n2.decimalPart.padEnd(maxDecimalLen, "0");
+
+    // 转换为大整数(避免普通整数溢出)
+    const n1Int =
+      BigInt(n1.integerPart + n1DecimalPadded) * (n1.isNegative ? -1n : 1n);
+    const n2Int =
+      BigInt(n2.integerPart + n2DecimalPadded) * (n2.isNegative ? -1n : 1n);
+
+    return {
+      int1: n1Int,
+      int2: n2Int,
+      scale: BigInt(10 ** maxDecimalLen), // 缩放比例(10^最大小数位数)
+    };
+  },
+
+  /**
+   * 加法运算(修复精度问题 + 入参校验)
+   */
+  add(a, b) {
+    // 链式调用/直接调用参数处理
+    const [arg1, arg2] =
+      this.currentValue === null ? [a, b] : [this.currentValue, a];
+
+    const { int1, int2, scale } = this._alignDecimals(arg1, arg2);
+    const sumInt = int1 + int2;
+    // 转换回小数(BigInt转Number,确保精度)
+    this.currentValue = Number(sumInt) / Number(scale);
+
+    return this;
+  },
+
+  /**
+   * 减法运算(修复精度问题 + 入参校验)
+   */
+  sub(a, b) {
+    const [arg1, arg2] =
+      this.currentValue === null ? [a, b] : [this.currentValue, a];
+
+    const { int1, int2, scale } = this._alignDecimals(arg1, arg2);
+    const subInt = int1 - int2;
+    this.currentValue = Number(subInt) / Number(scale);
+
+    return this;
+  },
+
+  /**
+   * 乘法运算(修复精度问题 + 入参校验)
+   */
+  mul(a, b) {
+    const [arg1, arg2] =
+      this.currentValue === null ? [a, b] : [this.currentValue, a];
+
+    const n1 = this._parseNumStr(arg1);
+    const n2 = this._parseNumStr(arg2);
+
+    // 转换为整数(移除小数点)
+    const n1Int =
+      BigInt(n1.integerPart + n1.decimalPart) * (n1.isNegative ? -1n : 1n);
+    const n2Int =
+      BigInt(n2.integerPart + n2.decimalPart) * (n2.isNegative ? -1n : 1n);
+
+    // 总小数位数
+    const totalDecimalLen = n1.decimalLength + n2.decimalLength;
+    const scale = BigInt(10 ** totalDecimalLen);
+
+    // 相乘后除以缩放比例
+    const mulInt = n1Int * n2Int;
+    this.currentValue = Number(mulInt) / Number(scale);
+
+    return this;
+  },
+
+  /**
+   * 除法运算(修复精度问题 + 入参校验)
+   */
+  div(a, b) {
+    const [arg1, arg2] =
+      this.currentValue === null ? [a, b] : [this.currentValue, a];
+
+    // 先校验除数是否为有效数字(避免 0/NaN 混淆)
+    const validArg2 = this._validateNum(arg2);
+    if (validArg2 === 0) {
+      throw new Error("除数不能为0");
+    }
+
+    const n1 = this._parseNumStr(arg1);
+    const n2 = this._parseNumStr(arg2);
+
+    // 转换为整数(移除小数点)
+    const n1Int =
+      BigInt(n1.integerPart + n1.decimalPart) * (n1.isNegative ? -1n : 1n);
+    const n2Int =
+      BigInt(n2.integerPart + n2.decimalPart) * (n2.isNegative ? -1n : 1n);
+
+    // 计算缩放比例:10^(n2小数位数 - n1小数位数)
+    const decimalDiff = n2.decimalLength - n1.decimalLength;
+    const scale = BigInt(10 ** Math.abs(decimalDiff));
+    let divResult;
+
+    if (decimalDiff >= 0) {
+      divResult = (n1Int * scale) / n2Int;
+    } else {
+      divResult = n1Int / (n2Int * scale);
+    }
+
+    // 处理除法精度(保留15位小数,避免无限循环)
+    this.currentValue =
+      Number(divResult) / Number(BigInt(10 ** Math.max(0, -decimalDiff)));
+
+    return this;
+  },
+
+  /**
+   * 四舍五入保留指定小数位
+   */
+  fixed(num, n) {
+    let targetNum, decimalPlaces;
+    if (this.currentValue === null) {
+      targetNum = this._validateNum(num); // 修复:校验入参
+      decimalPlaces = arguments.length >= 2 ? n : 2;
+    } else {
+      targetNum = this.currentValue;
+      decimalPlaces = num !== undefined ? num : 2;
+    }
+
+    decimalPlaces = Math.max(0, Math.floor(parseInt(decimalPlaces, 10) || 0));
+    const pow10 = Math.pow(10, decimalPlaces);
+    this.currentValue = Math.round(targetNum * pow10) / pow10;
+
+    return this;
+  },
+
+  /**
+   * 截断保留指定小数位
+   */
+  truncate(num, n) {
+    let targetNum, decimalPlaces;
+    if (this.currentValue === null) {
+      targetNum = this._validateNum(num); // 修复:校验入参
+      decimalPlaces = arguments.length >= 2 ? n : 2;
+    } else {
+      targetNum = this.currentValue;
+      decimalPlaces = num !== undefined ? num : 2;
+    }
+
+    decimalPlaces = Math.max(0, Math.floor(parseInt(decimalPlaces, 10) || 0));
+
+    const numStr = targetNum.toString();
+    const dotIndex = numStr.indexOf(".");
+
+    let integerPart, decimalPart;
+    if (dotIndex === -1) {
+      integerPart = numStr;
+      decimalPart = "";
+    } else {
+      integerPart = numStr.substring(0, dotIndex);
+      decimalPart = numStr.substring(dotIndex + 1);
+    }
+
+    let truncatedDecimal;
+    if (decimalPlaces === 0) {
+      truncatedDecimal = "";
+    } else {
+      truncatedDecimal = decimalPart.substring(0, decimalPlaces);
+      if (truncatedDecimal.length < decimalPlaces) {
+        truncatedDecimal = truncatedDecimal.padEnd(decimalPlaces, "0");
+      }
+    }
+
+    let resultStr;
+    if (decimalPlaces === 0) {
+      resultStr = integerPart;
+    } else {
+      resultStr = `${integerPart}.${truncatedDecimal}`;
+    }
+
+    this.currentValue = parseFloat(resultStr);
+
+    return this;
+  },
+
+  /**
+   * 保留两位小数,若第三位小数大于0则进一
+   */
+  fixedUpTwo(num) {
+    // 处理目标数值:链式调用用currentValue,直接调用用传入的num
+    let targetNum =
+      this.currentValue === null ? this._validateNum(num) : this.currentValue;
+
+    // 处理NaN/非数值情况(已被_validateNum兜底,此处冗余校验)
+    if (isNaN(targetNum)) {
+      this.currentValue = 0.0;
+      return this;
+    }
+
+    const multiplied = targetNum * 1000;
+    const integerPart = Math.floor(multiplied);
+    const thirdDecimal = integerPart % 10;
+
+    let result;
+    if (thirdDecimal > 0) {
+      result = (Math.floor(targetNum * 100) + 1) / 100;
+    } else {
+      result = Math.floor(targetNum * 100) / 100;
+    }
+
+    this.currentValue = parseFloat(result.toFixed(2));
+
+    return this;
+  },
+
+  // 获取最终值
+  valueOf() {
+    const result = this.currentValue;
+    this._reset();
+    return result;
+  },
+};