calm 2 minggu lalu
induk
melakukan
c9f6bc1707
2 mengubah file dengan 22 tambahan dan 8 penghapusan
  1. 5 5
      config/app.js
  2. 17 3
      pages/users/order_confirm/index.vue

+ 5 - 5
config/app.js

@@ -1,13 +1,13 @@
 // let domain = "https://www.shuibeibyg.com/front-api"; // 正式环境IP
-let domain = "https://test.shuibeibyg.com/front-api"; // 测试环境IP
+// let domain = "https://test.shuibeibyg.com/front-api"; // 测试环境IP
 // let domain = 'http://192.168.100.199:8081' // 晋守桦IP
 // let domain = 'http://192.168.100.246:8081' // 韩朝龙IP
 // let domain = "http://192.168.8.29:8081"; // 宏广IP
-
-// export const H5_BASE_URL = "http://192.168.8.10:5174"; // 本地测试
-// export const H5_BASE_URL = "http://192.168.8.16:5173"; // 本地测试
+let domain = "http://192.168.124.57:8081"; // 张艺IP
+// export const H5_BASE_URL = "http://192.168.124.10:5174"; // 本地测试
+export const H5_BASE_URL = "http://192.168.124.16:5174"; // 本地测试
 // export const H5_BASE_URL = "http://192.168.100.35:5175"; // 本地测试
-export const H5_BASE_URL = "https://test.shuibeibyg.com/web-h5/"; // 测试环境H5地址
+// export const H5_BASE_URL = "https://test.shuibeibyg.com/web-h5/"; // 测试环境H5地址
 // export const H5_BASE_URL = "https://www.shuibeibyg.com/web-h5/"; // 正式环境H5地址
 
 let share = "https://www.shuibeibyg.com";

+ 17 - 3
pages/users/order_confirm/index.vue

@@ -689,7 +689,7 @@ const showStoreList = () => {
 };
 
 // 计算订单价格
-function computedPrice() {
+function computedPrice(couponTitleValue) {
   let shippingTypeValue = shippingType.value;
   postOrderComputed({
     mallType: orderInfoVo.value.mallType, // 商城类型
@@ -701,6 +701,9 @@ function computedPrice() {
     goldNum: appStore.userInfo.goldBalance, // 余料数量
   })
     .then((res) => {
+      if (couponTitleValue) {
+        couponTitle.value = couponTitleValue;
+      }
       // 成功回调
       let data = res.data; // 计算后的价格数据
       // 更新订单费用信息
@@ -787,11 +790,11 @@ const ChangCoupons = (e) => {
   }
 
   // 更新优惠券相关状态
-  couponTitle.value = couponTitleValue;
+
   couponId.value = couponIdValue;
   coupon.value.coupon = false;
   // coupon.value.list = list;
-  computedPrice();
+  computedPrice(couponTitleValue);
 };
 
 // 首次进入页面时展示默认地址
@@ -1188,6 +1191,17 @@ const SubOrder = async (e) => {
     showModal.value = true;
     return;
   }
+  // 验证余料是否充足(普通商城且有余料余量时校验)
+  // else if (orderInfoVo.value.mallType === 0 && metalTypeMap[metalType.value].balance > 0) {
+  //   const totalNeedWeight = cartInfo.value.reduce((sum, item) => {
+  //     return sum + Number(item.weight || 0) * Number(item.payNum || item.cartNum || 1);
+  //   }, 0);
+  //   if (totalNeedWeight > metalTypeMap[metalType.value].balance) {
+  //     return Toast({
+  //       title: `${metalTypeMap[metalType.value].name}余料不足,当前可用 ${metalTypeMap[metalType.value].balance}g,订单需要 ${totalNeedWeight.toFixed(2)}g`,
+  //     });
+  //   }
+  // }
   uni.showLoading({
     title: "订单支付中",
   });