Commit 05586a78 by Lin

fix: 更新API调用和数据处理逻辑

- 在HomeFrame组件中更新获取策略状态的API调用,传递商户ID以获取真实数据。
- 在PreStudyPopup组件中恢复API调用以获取学习弹窗数据,移除模拟数据。
- 在addFiles组件中调整日期字段的处理逻辑,新增邀请日期的状态管理,确保数据一致性。
1 parent 02f63dd1
......@@ -726,12 +726,9 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/
async getStrategyStatus() {
// const res = await uni.$api.activityApi.getActivityStatusAPI()
const res = await uni.$api.activityApi.getActivityStatusAPI({merchantId: uni.$storage.get('userInfo').shopMerchantId})
console.log('查询策略首页数据状态(营销活动和客户列表是否有数据):', res)
const res = {
marketingActivityHasData: true,
customerListHasData: true
}
console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res)
if (!res) return
......
......@@ -67,24 +67,8 @@ export default {
if (item.learnStatus !== 'NOT_STUDY') return
try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = {
"activityId": 31,
"activityName": "618年中促活动A",
"packages": [
{
"activityProductId": "16",
"packageName": "tttttttt",
"includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "NOT_STUDY",
"scriptReady": true
}
],
"remainingSkipCount": 0,
"shouldPopup": true,
"muteReason": null,
"remainingActivityCount": null
}
const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
console.log('getPrelernHomePopupAPI res***', res)
if (!res) return
......
......@@ -222,8 +222,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
},
{
label: '到店日期',
valueKey: 'arrivalDate',
key: 'arrivalDate',
valueKey: 'inviteDate',
key: 'inviteDate',
type: 'date'
},
{
......@@ -264,7 +264,9 @@ export default {
customerInfo: {},
startDate: '',
endDate: '',
validateState: true
validateState: true,
employeeSelectKey: '',
inviteDateTouched: false
}
},
onLoad (options) {
......@@ -295,10 +297,15 @@ export default {
arrivalDate: '',
receptionSceneName: '',
standNo: '',
residentSaleName: '',
residentSaleId: '',
employeeName: '',
userId: '',
merchantName: '',
sellerName: '',
sellerUserId: '',
inviteDate: '',
filingDate: ''
}
this.inviteDateTouched = false
if (this.customerId) this.findVisitsInfo()
},
async findVisitsInfo () {
......@@ -306,8 +313,10 @@ export default {
id: this.customerId
})
if (res.arrivalDate) res.arrivalDate = dayjs(res.arrivalDate).format("YYYY-MM-DD")
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
if (res.filingDate) res.filingDate = dayjs(res.filingDate).format("YYYY-MM-DD")
this.customerInfo = res
this.inviteDateTouched = !!res.inviteDate
},
backPage () {
uni.navigateBack({
......@@ -340,7 +349,14 @@ export default {
}
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
const value = e.detail.value
this.customerInfo[valueKey] = value
if (valueKey === 'arrivalDate' && !this.inviteDateTouched) {
this.customerInfo.inviteDate = value
}
if (valueKey === 'inviteDate') {
this.inviteDateTouched = true
}
},
inputBlur (e, val) {
const standNoVal = this.customerInfo.standNo
......@@ -416,6 +432,8 @@ export default {
merchantId:params.merchantId,
employeeName:params.employeeName,
sellerMerchantId:params.sellerMerchantId,
sellerUserId: params.sellerUserId,
sellerName: customerInfo.sellerName,
preliminaryOrders: [
{
sceneType:1,
......@@ -429,8 +447,10 @@ export default {
carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName,
deliveryDate: params.arrivalDate ? params.arrivalDate + ' 00:00:00' : params.arrivalDate, //交付日期
inviteDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //到店日期
createdDate: params.filingDate ? params.filingDate + ' 00:00:00' : params.filingDate, //建档日期
inviteDate: params.inviteDate ? params.inviteDate + ' 00:00:00' : params.inviteDate, //到店日期
createdDate: params.filingDate, //建档日期
sellerUserld: params.sellerUserId,
sellerName: customerInfo.sellerName,
}
]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!