Commit 2760ce9b by Lin

功能(activity):增强活动详情和客户资料处理

- 更新了 env.js 中的索引以优化配置。
- 在 activity.js 中新增 getPrelearnScriptBoardAPI 方法,用于获取预学习脚本数据。
- 重构 HomeFrame 中的 getActivityProductList 方法,使用 shopMerchantId 进行 API 调用。
- 在 activityDetail.vue 中增强了 AI 状态常量,并改进了 handlePrelearnClick 的错误处理。
- 更新 prelearnBridge.vue,使 webview 使用安全 URL 并调整了产品 ID 的处理方式。
- 通过增加详细日志记录和客户资料管理的新方法,优化了 customerPages。feat:
1 parent da70e4ca
......@@ -74,5 +74,11 @@ module.exports = {
...data
})
},
getPrelearnScriptBoardAPI(data) {
return http.post({
method: 'dj.api.pad.prelearn.script.board',
projectName: 'pad',
...data
})
},
}
......@@ -158,6 +158,7 @@ export default {
})
},
handleGoCustomerDetail(item) {
console.log('handleGoCustomerDetail***', item)
uni.navigateTo({
url: `/pages/common/customerPages/detailFiles?customerId=${item.id}`,
animationType: 'pop-in',
......
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 1
const index = 2
/**
*
0本地
......
......@@ -31,6 +31,19 @@
<script>
const GOODS_COVER = require('@/assets/images/common/goods-activity-cover.png')
const PRELEARN_AI_STATUS = {
GENERATING: 'GENERATING',
MODIFIED: 'MODIFIED',
DELETED: 'DELETED',
READY: 'READY'
}
const PRELEARN_AI_STATUS_TIPS = {
[PRELEARN_AI_STATUS.GENERATING]: 'AI生成中',
[PRELEARN_AI_STATUS.MODIFIED]: '策略更新重写中',
[PRELEARN_AI_STATUS.DELETED]: '任务已失效'
}
export default {
name: 'ActuvityDetail',
data() {
......@@ -54,18 +67,6 @@ export default {
try {
this.goodsInfo = JSON.parse(decodeURIComponent(options.row))
console.log('[actuvityDetail] 商品完整数据 goodsInfo:', this.goodsInfo)
console.log('[actuvityDetail] 商品名称:', this.goodsInfo.name)
console.log('[actuvityDetail] 活动时间:', this.goodsInfo.startTime, '至', this.goodsInfo.endTime)
console.log('[actuvityDetail] 是否主推:', this.goodsInfo.isMainPush)
console.log('[actuvityDetail] 活动类型:', this.goodsInfo.activityTypeLabel)
console.log('[actuvityDetail] 车型:', this.goodsInfo.carSeriesName)
console.log('[actuvityDetail] 商品描述:', this.goodsInfo.description)
console.log('[actuvityDetail] 售价:', this.goodsInfo.price)
console.log('[actuvityDetail] 原价:', this.goodsInfo.originalPrice)
console.log('[actuvityDetail] 主图:', this.goodsInfo.mainImageUrl)
console.log('[actuvityDetail] 缩略图:', this.goodsInfo.thumbImageUrl)
console.log('[actuvityDetail] 详情图:', this.goodsInfo.detailImageUrl)
console.log('[actuvityDetail] 商品ID:', this.goodsInfo.id || this.goodsInfo.productId)
} catch (error) {
console.error('[actuvityDetail] 解析商品详情参数失败:', error)
uni.showToast({
......@@ -82,7 +83,7 @@ export default {
animationDuration: 100
})
},
handlePrelearnClick() {
async handlePrelearnClick() {
if (!this.goodsInfo?.id && !this.goodsInfo?.productId) {
uni.showToast({
title: '商品信息不完整',
......@@ -90,11 +91,27 @@ export default {
})
return
}
const row = encodeURIComponent(JSON.stringify(this.goodsInfo))
uni.navigateTo({
url: `/pages/common/prelearnBridge?row=${row}&entrySource=package_detail`
})
try {
const res = await uni.$api.activityApi.getPrelearnScriptBoardAPI({
activityId: this.goodsInfo.activityId,
activityProductId: this.goodsInfo.productId
})
console.log('getPrelearnScriptBoardAPI**前置*', res)
const { aiStatus } = res || {}
if (aiStatus !== PRELEARN_AI_STATUS.READY) {
const tip = PRELEARN_AI_STATUS_TIPS[aiStatus] || '剧本未就绪,请稍后重试'
uni.showToast({ title: tip, icon: 'none' })
return
}
const row = encodeURIComponent(JSON.stringify(res))
uni.navigateTo({
url: `/pages/common/prelearnBridge?row=${row}&entrySource=package_detail`
})
} catch (error) {
console.error('[actuvityDetail] 预学习剧本查询失败:', error)
}
}
}
}
......
......@@ -377,7 +377,7 @@ export default {
})
let { customerInfo, customerForm, optionalForm } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
targetApi = customerInfo.id ? 'submitPreliminaryOrderAPI' : 'submitPreliminaryOrderAPI',
params = {
merchantId: shopMerchantId,
bussinessScene: sceneType == 0 ? 1 : 2
......@@ -430,6 +430,8 @@ export default {
sellerMerchantId:params.sellerMerchantId,
preliminaryOrders: [
{
sceneType:1,
baseSceneCode:'100101',
customerName:params.customerName,
customerPhone:params.customerPhone,
carBrand:params.carBrand,
......@@ -438,9 +440,9 @@ export default {
carChildsBrandName:'',
carSeriesId:params.carTypeId,
carSeriesName:params.carTypeName,
deliveryDate:params.arrivalDate, //交付日期
inviteDate:'', //到店日期
createdDate:'', //建档日期
deliveryDate:'2026-06-25 00:00:00', //交付日期
inviteDate:'2026-06-25 00:00:00', //到店日期
createdDate:'2026-06-25', //建档日期
}
]
}
......
......@@ -384,6 +384,9 @@
},
onLoad (options) {
this.customerId = options.customerId || ''
console.log('customerId**options*', this.customerId)
this.getCustormDetail()
this.getCustomerGroupInfo()
this.initForm()
},
mounted () {
......@@ -391,6 +394,74 @@
this.endDate = dayjs(dayjs().add(30, 'day')).format("YYYY-MM-DD")
},
methods: {
async submitCustomerProfileAPI() {
// carModel:问界M7,
// carModelId: 1149147,
// carBrand:AITO 问界,
// carBrandId:3454,
// oneCarBrand:鸿蒙智行,
// oneCarBrandId:2978
let requestParams = {
"id": 33804,
"customerName": "李四哈哈525235",
"customerPhone": "13312123261",
"customerStatus": 1,
"standNo": null,
"inviteDate": null,
"carBrandId": 3454,
"carBrand": "AITO 问界",
"carChildsBrandId": 1149147,
"carChildsBrandName": "问界M7",
"carSeriesId": 2978,
"carSeriesName": "鸿蒙智行",
"deliveryDate": "2026-06-25 18:54:46",
"createdDate": "2026-06-25 18:54:46",
"customerSource": 5,
"merchantId": 44211227,
"merchantName": "明明崇文4s店A",
"userId": "8a014b824abb42bd84bb5145043eabc2",
"employeeName": "王璐琦",
"advanceUserId": "0ad2caf3e55e44baa32b4ef3c5edd039",
"advanceUserName": "王lq",
"qwGroupId": null,
"qwGroupName": null,
"wxId": null,
"wxName": null,
"remark": null
}
console.log('submitCustomerProfileAPI***', requestParams)
const res = await uni.$api.customerApi.submitCustomerProfileAPI(requestParams)
console.log('submitCustomerProfileAPI***', res)
},
async getCustormDetail() {
console.log('getCustormDetailAPI***', this.customerId)
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
console.log('getCustormDetailAPI***', res)
if(res) {
this.customerForm = res.data.data
}
},
async getCustomerGroupInfo() {
// let customerGroupParam = this.customerForm.customerName + this.customerForm.customerPhone.slice(7,11)
// console.log('g张三525235*', customerGroupParam)
const data = await uni.$api.customerApi.getCustomerGroupInfoAPI({
customerGroupParam: '退款5468'
})
console.log('getCustomerGroupInfoAPI***', data)
// http 层已在 code=0 时 resolve(data.data),此处 data 即为业务数据,无需再取 data.data
const contactId = data.contact_id
if (contactId) {
await this.getCustomerGroupMemberInfoAPI(contactId)
}
},
async getCustomerGroupMemberInfoAPI(contactId) {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId: contactId
})
console.log('群成员getCustomerGroupMemberInfoAPI***', data)
},
getUpgradeStatusType (label) {
if (label === '已升级') return 'success'
if (label === '待跟进') return 'warning'
......@@ -422,10 +493,10 @@
groupMemberId: '',
groupRemark: ''
}
if (this.customerId) this.findVisitsInfo()
// if (this.customerId) this.findVisitsInfo()
},
async findVisitsInfo () {
const res = await uni.$api.customerApi.findVisitsInfo({
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
if (res.customerTag) this.customerTag = res.customerTag
......@@ -480,6 +551,7 @@
this.customerInfo[valueKey] = e.detail.value
},
async submit () {
this.submitCustomerProfileAPI()
if (this.check) return
try {
this.customerForm.map(e => {
......@@ -487,7 +559,7 @@
})
let { customerInfo, customerForm, optionalForm, groupForm, customerTag } = this,
{ shopMerchantId, sceneType } = uni.$storage.get("userInfo"),
targetApi = customerInfo.id ? 'updateVisitsInfo' : 'saveVisitsInfo',
targetApi = customerInfo.id ? 'submitCustomerProfileAPI' : 'submitCustomerProfileAPI',
params = {
customerTag,
merchantId: shopMerchantId,
......@@ -511,11 +583,12 @@
oneCarBrand: customerInfo.oneCarBrand,
oneCarBrandId: customerInfo.oneCarBrandId
})
params.customerTagName = params.customerTagName.replace(/|/g, ',')
uni.showLoading({
mask: true
})
const res = await uni.$api.customerApi[targetApi](params),
const res = await uni.$api.customerApi[targetApi](requestParams),
_this = this
if (res) {
if (res == '1') {
......
......@@ -68,7 +68,7 @@ export default {
prelearnContext: {
activityId: '31',
activityProductId: '16',
staffUuid: uni.$storage.get('userInfo').uuid,
staffUuid: '849845165165164849489',
staffName: uni.$storage.get('userInfo').name,
merchantId: String(uni.$storage.get('userInfo').merchantId ?? ''),
entrySource: 'home_popup',
......@@ -136,7 +136,7 @@ export default {
},
},
onLoad(options) {
const defaultUrl = 'http://192.168.1.68:4173/prelearning.html'
const defaultUrl = 'https://single-pages.test.glsx.com.cn/prelearning.html'
this.webviewUrl = options.url ? decodeURIComponent(options.url) : defaultUrl
if (options.prelearnData) {
try {
......@@ -166,7 +166,7 @@ export default {
this.goodsInfo = JSON.parse(decodeURIComponent(options.row))
console.log('[prelearnBridge] 商品完整数据 goodsInfo:', this.goodsInfo)
const productId = this.goodsInfo.id || this.goodsInfo.productId || this.goodsInfo.activityProductId
const productId =this.goodsInfo.productId
if (productId) {
this.prelearnContext.activityProductId = String(productId)
}
......@@ -737,24 +737,24 @@ export default {
},
async back() {
try {
// const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
const res = {
"activityId": 31,
"activityName": "618年中促活动A",
"packages": [
{
"activityProductId": "16",
"packageName": "tttttttt",
"includes": ['原厂定制车衣','玻璃贴膜'],
"learnStatus": "STUDIED",
"scriptReady": true
}
],
"remainingSkipCount": 0,
"shouldPopup": true,
"muteReason": null,
"remainingActivityCount": null
}
const res = await uni.$api.commonApi.getPrelernHomePopupAPI()
// const res = {
// "activityId": 31,
// "activityName": "618年中促活动A",
// "packages": [
// {
// "activityProductId": "16",
// "packageName": "tttttttt",
// "includes": ['原厂定制车衣','玻璃贴膜'],
// "learnStatus": "STUDIED",
// "scriptReady": true
// }
// ],
// "remainingSkipCount": 0,
// "shouldPopup": true,
// "muteReason": null,
// "remainingActivityCount": null
// }
console.log('[prelearnBridge] getPrelernHomePopupAPI res:', res)
// if (!res) {
// this.navigateBack()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!