Compare commits

...

2 Commits

Author SHA1 Message Date
赵毅
7961d4a5a2 优化线上环境和测试环境的接口调用判断 2025-10-15 15:28:26 +08:00
赵毅
5121c23802 修复团购订单支付后报错的bug 2025-10-15 09:01:05 +08:00
2 changed files with 11 additions and 7 deletions

View File

@ -374,6 +374,9 @@ export default {
//
verifyCode: '',
//
isGroupBuyValid: true
};
},
computed: {
@ -592,7 +595,7 @@ export default {
//
const currentTime = new Date().getTime();
let isGroupBuyValid = true;
this.isGroupBuyValid = true;
//
for (let supplierId in this.supplierGroups) {
@ -601,18 +604,18 @@ export default {
const activityInfo = item.commodity_goods_info.group_buy_activity_info;
// isGroupBuyValidfalse
if (!activityInfo) {
isGroupBuyValid = false;
this.isGroupBuyValid = false;
break;
}
const startTime = new Date(activityInfo.start_time).getTime();
const endTime = new Date(activityInfo.end_time).getTime();
if (!(currentTime >= startTime && currentTime <= endTime)) {
isGroupBuyValid = false;
this.isGroupBuyValid = false;
break;
}
}
if (!isGroupBuyValid) break;
if (!this.isGroupBuyValid) break;
}
// isafterSaletrue
@ -653,7 +656,7 @@ export default {
const params = {
user_id: uni.getStorageSync('userId'),
// shopCarListisAdvertrue
order_cate : this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
order_cate : this.carList.some(item => item.isAdver === true) ? 3 : (this.isGroupBuyValid ? 2 : 1),
goods_list: Object.keys(this.supplierGroups).map(supplierId => {
const group = this.supplierGroups[supplierId];
const firstItem = group[0];
@ -715,7 +718,7 @@ export default {
success: (payRes) => {
const params = {
order_id: orderId,
from: this.carList.some(item => item.isAdver === true) ? 3 : (isGroupBuyValid ? 2 : 1),
from: this.carList.some(item => item.isAdver === true) ? 3 : (this.isGroupBuyValid ? 2 : 1),
group_buy_activity_id: this.group_buy_activity_id,
adver_id: this.carList.some(item => item.isAdver === true) ? this.carList.find(item => item.isAdver === true).adver_id : ''
}

View File

@ -55,7 +55,8 @@ const getCurrentEnvironment = () => {
// 获取当前环境配置
const currentEnv = getCurrentEnvironment();
const envConfig = environments[currentEnv] || environments.development;
console.log("🚀 ~ currentEnv:", currentEnv)
const envConfig = environments[currentEnv] || environments.production;
export const RequsetUrl = envConfig.apiUrl; // 请求地址前缀
export const picUrl = envConfig.picUrl; // 图片地址前缀