Commit bace7c2f by 岑成威

Merge remote-tracking branch 'origin/saas+v5.8.3' into saas+v5.8.3

2 parents 7dbeb4b9 eaf46cf5
......@@ -26,7 +26,10 @@
<view :class="['sprite-icon', subIcon]"></view>
{{ subTitle }}
<template v-if="options.type == 'task' && taskList.length">
<view class="btn flex" @click="confirmAllTask">全部任务合并推送</view>
<view class="btn-box flex">
<view class="btn primary-btn flex" @click="confirmAllTask(1)">立即推送</view>
<view class="btn flex" @click="confirmAllTask(2)">暂不推送</view>
</view>
</template>
</view>
<template v-if="loadComplete">
......@@ -36,7 +39,7 @@
<task-item :key="index" :item="{
...item,
qwGroupName: options.data.qwGroupName
}" :num="index" :type="options.type" @confirmTask="confirmTask" />
}" :num="index" :type="options.type"/>
</template>
<view class="p-b"></view>
</view>
......@@ -81,15 +84,15 @@ export default {
let { type } = this.options,
title = {
task: '客户基础信息',
taskRecord: '任务记录'
taskRecord: '活动记录'
}[type]
return title
},
subTitle() {
let { type } = this.options,
title = {
task: '推送运营任务',
taskRecord: '任务记录(近7天)'
task: '推送运营活动',
taskRecord: '活动记录(近7天)'
}[type]
return title
},
......@@ -161,32 +164,18 @@ export default {
}
},
confirmTask({ confirmStatus, item }) {
let _this = this
uni.showModal({
title: confirmStatus == 1 ? '确认向客户群推送该营销任务?' : '确认不触达该营销任务?',
content: confirmStatus == 1 ? '推送后将无法撤回。' : '本次任务将终止执行。',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) _this.confirmSopTask({
taskId: item.taskId,
confirmStatus
})
}
})
},
confirmAllTask() {
confirmAllTask(confirmStatus) {
let _this = this,
{ taskList } = this,
taskIds = taskList.filter(item => item.taskStatus == 0).map(item => item.taskId)
uni.showModal({
title: '确认向客户群推送该营销任务?',
content: '推送后将无法撤回。',
title: confirmStatus == 1 ? '确认向客户群推送该营销活动?' : '确认不推送该营销活动?',
content: confirmStatus == 1 ? '推送后将无法撤回。' : '本次活动将终止执行。',
confirmColor: '#347BFF',
success(res) {
if (res.confirm) _this.confirmSopTask({
taskIds,
confirmStatus: 1
confirmStatus
}, true)
}
})
......@@ -315,15 +304,25 @@ export default {
margin-right: toRpx(18);
}
.btn {
.btn-box {
margin-left: auto;
background-color: #2C66F7;
color: #FFFFFF;
padding: 0 toRpx(32);
border-radius: toRpx(16);
height: toRpx(64);
line-height: toRpx(64);
font-size: toRpx(28);
.btn {
margin-left: toRpx(16);
padding: 0 toRpx(32);
border-radius: toRpx(8);
border: toRpx(2) solid #DCE1E6;
color: #292D33;
font-size: toRpx(26);
height: toRpx(56);
line-height: toRpx(56);
}
.primary-btn {
border-color: #2C66F71A;
background-color: #2C66F70D;
color: #2C66F7;
}
}
}
......@@ -332,9 +331,11 @@ export default {
height: toRpx(28);
}
}
.scroll-content{
.scroll-content {
height: calc(100% - #{toRpx(128)});
}
.nothing {
height: calc(100% - #{toRpx(484)});
}
......
......@@ -47,8 +47,8 @@
</view>
<view class="row-item action-col">
<view class="action-btn primary-btn" v-if="type == 0" @click="pushTask(item)">推送运营任务</view>
<view class="action-btn secondary-btn" @click="viewTaskRecord(item)">查看任务记录</view>
<view class="action-btn primary-btn" v-if="type == 0" @click="pushTask(item)">推送运营活动</view>
<view class="action-btn secondary-btn" @click="viewTaskRecord(item)">查看活动记录</view>
</view>
</view>
<template v-if="noMore">
......
<template>
<view class="task-item">
<view class="task-item-title flex">
<view class="tag flex">任务{{ num + 1 }}</view>
<view class="tag flex">活动{{ num + 1 }}</view>
<view class="text flex">
向客户群发送消息
<template v-if="type == 'taskRecord'">
......@@ -10,11 +10,7 @@
</template>
</view>
<view class="btn-box flex">
<template v-if="item.taskStatus == 0">
<view class="btn primary-btn" @click="confirmTask(1)">立即推送</view>
<view class="btn" @click="confirmTask(2)">暂不推送</view>
</template>
<template v-else>
<template v-if="item.taskStatus != 0">
<view :class="['status flex', taskStatusClass(item.taskStatus)]">{{ taskStatus(item.taskStatus) }}</view>
</template>
</view>
......@@ -39,7 +35,8 @@
</template>
<template v-else>
<!-- <video controls :src="item.mediaIds" class="video" ></video> -->
<DomVideoPlayer class="video" ref="domVideoPlayer" :src="item.mediaIds" :poster="defaultPoster" controls />
<DomVideoPlayer class="video" ref="domVideoPlayer" :src="item.mediaIds" :poster="defaultPoster"
controls />
</template>
</template>
<template v-else-if="item.messageType == 4">
......@@ -197,24 +194,6 @@ export default {
.btn-box {
margin-left: auto;
.btn {
margin-left: toRpx(16);
padding: 0 toRpx(32);
border-radius: toRpx(8);
border: toRpx(2) solid #DCE1E6;
color: #292D33;
font-size: toRpx(26);
height: toRpx(56);
line-height: toRpx(56);
}
.primary-btn {
border-color: #2C66F71A;
background-color: #2C66F70D;
color: #2C66F7;
}
.status {
display: inline-block;
padding: 0 toRpx(32);
......
......@@ -3,9 +3,9 @@
<view class="tips flex">
<view class="today flex">
<view class="sprite-icon icon-customer-sop-1"></view>
今日任务({{ toDay }})
今日活动({{ toDay }})
</view>
<view class="text">根据SOP策略生成营销任务,请及时推送客户</view>
<view class="text">根据SOP策略生成营销活动,请及时推送客户</view>
</view>
<view class="tabs-box flex">
<template v-for="(tab, index) in tabs">
......
......@@ -40,7 +40,8 @@ export default {
},
data () {
return {
sellerEmployeeList: []
sellerEmployeeList: [],
defaultEmployeeList: []
}
},
watch: {
......@@ -56,7 +57,7 @@ export default {
return this.$store.state.user.historyStatus
},
selectedId () {
if (Array.isArray(this.list) || this.employeeType === 'seller') {
if (Array.isArray(this.list) || this.employeeType === 'seller' || this.employeeType === 'default') {
return this.salesPropsUuid
}
return this.$store.state.user.customerInfo.salesUuid || this.salesPropsUuid
......@@ -68,6 +69,9 @@ export default {
if (this.employeeType === 'seller') {
return this.sellerEmployeeList
}
if (this.employeeType === 'default') {
return this.defaultEmployeeList
}
return this.$store.state.user.employeeList
}
},
......@@ -94,6 +98,17 @@ export default {
this.sellerEmployeeList = res || []
return
}
if (this.employeeType === 'default') {
if (this.defaultEmployeeList.length) return
const { shopMerchantId, sceneType } = userInfo
const apiTargetName = sceneType == 1 ? 'getEmployeeList' : 'getOrderScreenEmployeeList'
const res = await uni.$api.popupApi[apiTargetName]({
merchantId: shopMerchantId,
sceneList: [sceneType]
})
this.defaultEmployeeList = res || []
return
}
const employeeList = this.$store.state.user.employeeList
if (employeeList && employeeList.length) return
const { shopMerchantId } = userInfo
......
......@@ -325,6 +325,7 @@ export default {
}
.goods-box {
width: 100%;
overflow: visible;
.goods-img-wrap {
position: relative;
......@@ -376,17 +377,18 @@ export default {
$goods-item-height: 120px;
$shadow-space: 8px;
width: 100%;
// 向外扩展滚动视口,配合首尾 margin 消除左右空隙并保留阴影绘制空间
width: calc(100% + #{$shadow-space * 2});
margin: toRpx(28) (-$shadow-space);
height: calc(#{$goods-item-height} + #{$shadow-space * 2});
white-space: nowrap;
margin: toRpx(28) 0;
.goods-menu-inner {
display: flex;
flex-wrap: nowrap;
gap: 12px;
height: $goods-item-height;
padding: $shadow-space;
padding: $shadow-space 0;
box-sizing: content-box;
}
......@@ -398,13 +400,21 @@ export default {
height: $goods-item-height;
display: flex;
align-items: stretch;
overflow: hidden;
overflow: visible;
border: none;
border-radius: 8px;
background: #FFF;
box-shadow: 0 2px 8px 0 rgba(44, 102, 247, 0.10);
cursor: pointer;
&:first-child {
margin-left: $shadow-space;
}
&:last-child {
margin-right: $shadow-space;
}
&.active {
border: 1.5px solid rgba(44, 102, 247, 0.10);
background: linear-gradient(0deg, rgba(44, 102, 247, 0.05) 0%, rgba(44, 102, 247, 0.05) 100%), #FFF;
......@@ -417,7 +427,7 @@ export default {
top: 0;
z-index: 2;
padding: 2px 10px;
border-radius: 0 0 8px 0;
border-radius: 8px 0 8px 0;
background: linear-gradient(270deg, #FF6748 0%, #F24724 100%);
font-size: 12px;
line-height: normal;
......@@ -437,6 +447,7 @@ export default {
width: 88px;
height: $goods-item-height;
overflow: hidden;
border-radius: 8px 0 0 8px;
margin-right: toRpx(24);
}
......
......@@ -293,41 +293,50 @@ export default {
border-radius: 10px;
background: rgba(44, 102, 247, 0.05);
box-sizing: border-box;
min-height: 32px;
.customer-count-left {
.customer-count-left,
.customer-count-right {
display: flex;
align-items: center;
}
.customer-count-left {
gap: 2px;
min-width: 0;
flex: 1;
}
.customer-count-right {
gap: 2px;
flex-shrink: 0;
margin-left: 8px;
}
.customer-count-icon {
width: 16px;
height: 16px;
flex-shrink: 0;
display: block;
}
.customer-count-label {
font-size: 13px;
line-height: normal;
color: #6C6F75;
.customer-count-label,
.customer-count-num,
.customer-count-unit {
line-height: 16px;
white-space: nowrap;
}
.customer-count-right {
display: flex;
align-items: flex-start;
gap: 2px;
flex-shrink: 0;
.customer-count-label {
font-size: 13px;
color: #6C6F75;
}
.customer-count-num,
.customer-count-unit {
font-size: 14px;
line-height: normal;
font-weight: 500;
color: #2C66F7;
white-space: nowrap;
}
}
......
......@@ -520,7 +520,7 @@ export default {
methods: {
handleHomeContentTabClick(index) {
this.homeContentTabIndex = index
console.log('当前选中标签:', this.currentHomeContentTab)
this.getCustomerProfileGroupInfo()
},
_syncShowFloatLog() {
this.showFloatLog = FloatLogConfig.isLogBallVisible()
......@@ -709,7 +709,10 @@ export default {
}
},
async changeTab({ item, index }) {
if (index == 0) this.$refs.messageRef.getMessageSummary()
if (index == 0) {
this.$refs.messageRef.getMessageSummary()
this.getCustomerProfileGroupInfo()
}
this.previewOff = index != 0
this.$emit('changeTab', index)
console.log(this.$refs.leftBox.hasPopupOpen)
......@@ -730,46 +733,74 @@ export default {
* 查询策略首页数据状态(营销活动和客户列表是否有数据)
*/
async getStrategyStatus() {
this.$store.state.boutique.boutiqueActivityData = [] // 清空 boutiqueActivityData
const res = await uni.$api.activityApi.getActivityStatusAPI({merchantId: uni.$storage.get('userInfo').shopMerchantId})
console.log('%c查询策略首页数据状态(营销活动和客户列表是否有数据):', 'color: green;', res)
if (!res) return
this.marketingActivityHasData = !!res.marketingActivityHasData
this.customerListHasData = !!res.customerListHasData
this.homeContentTabIndex = 0
// 仅「限时产品活动」Tab 展示时才需拉取营销活动商品列表
if (this.marketingActivityHasData || this.customerListHasData) {
this.getActivityProductList()
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo') || {}
if (!merchantId) return
try {
const res = await uni.$api.activityApi.getActivityStatusAPI({ merchantId })
if (!res) {
this.marketingActivityHasData = false
this.customerListHasData = false
this.activityProductList = []
this.$store.state.boutique.boutiqueActivityData = []
return
}
this.marketingActivityHasData = !!res.marketingActivityHasData
this.customerListHasData = !!res.customerListHasData
this.homeContentTabIndex = 0
// 仅「限时产品活动」Tab 展示时才需拉取营销活动商品列表
if (this.marketingActivityHasData) {
await this.getActivityProductList()
} else {
this.activityProductList = []
this.$store.state.boutique.boutiqueActivityData = []
}
} catch (error) {
console.error('查询策略首页数据状态失败:', error)
}
},
/**
* 查询当前进行中的营销活动商品列表
*/
async getActivityProductList() {
const { shopMerchantId } = uni.$storage.get('userInfo')
console.log('**&&merchantId**', shopMerchantId)
const res = await uni.$api.activityApi.getActivityProductListAPI({merchantId: shopMerchantId})
console.log('查询当前进行中的营销活动商品列表:', res)
this.activityProductList = res
// console.log('查询当前进行中的营销活动商品列表:', res)
this.$store.state.boutique.boutiqueActivityData = res
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo') || {}
if (!merchantId) {
this.activityProductList = []
this.$store.state.boutique.boutiqueActivityData = []
return
}
try {
const res = await uni.$api.activityApi.getActivityProductListAPI({ merchantId })
const list = Array.isArray(res) ? res : []
this.activityProductList = list
this.$store.state.boutique.boutiqueActivityData = list
} catch (error) {
console.error('查询营销活动商品列表失败:', error)
this.activityProductList = []
this.$store.state.boutique.boutiqueActivityData = []
}
},
/**
* 查询客户建档分页查询-月按天分组
*/
async getCustomerProfileGroupInfo() {
let shopMerchantId = uni.$storage.get('userInfo').shopMerchantId
console.log('getCustomerProfileGroupInfo***merchantId:', uni.$storage.get('userInfo'))
let requestParams = {
merchantId: shopMerchantId
async getCustomerProfileGroupInfo() {
const { shopMerchantId: merchantId } = uni.$storage.get('userInfo') || {}
if (!merchantId) {
this.customerProfileList = []
return
}
const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI(requestParams)
console.log('getCustomerProfileGroupInfoAPI-月按天分组:', res)
if (res) {
this.customerProfileList = res
try {
const res = await uni.$api.customerApi.getCustomerProfileGroupInfoAPI({ merchantId })
console.log('getCustomerProfileListInfo***')
this.customerProfileList = Array.isArray(res) ? res : []
} catch (error) {
console.error('查询客户建档分组信息失败:', error)
this.customerProfileList = []
}
},
/**
......@@ -807,6 +838,7 @@ export default {
if (res.remainingSkipCount != null) {
this.prelearnData = { ...this.prelearnData, remainingSkipCount: res.remainingSkipCount }
}
await this.getPrelearnHome()
} catch (e) {
// uni.$logger?.local?.info('预学习扣减跳过次数失败', e)
}
......
......@@ -42,7 +42,9 @@
<view class="required" v-if="i.required">*</view>{{ i.label }}
</view>
<template v-if="i.type == 'readonly'">
<view class="input input--readonly text-hide">{{ getFieldDisplayValue(i) || '-' }}</view>
<view :class="['input input--readonly text-hide', { placeholderStyle: !getFieldDisplayValue(i) && i.placeholder }]">
{{ getFieldDisplayValue(i) || (i.placeholder || '-') }}
</view>
</template>
<template v-else-if="i.type == 'input'">
<input
......@@ -50,7 +52,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
......@@ -60,14 +62,18 @@
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
:start="getDatePickerStart(i)"
:end="getDatePickerEnd(i)"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -95,7 +101,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
:class="['input', { error: i.error }]"
placeholder="请选择"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
@blur="inputBlur($event, i)"
......@@ -105,14 +111,18 @@
<picker
mode="date"
fields="day"
:start="startDate"
:end="endDate"
:start="getDatePickerStart(i)"
:end="getDatePickerEnd(i)"
@change="bindDateChange($event, i.valueKey)"
:value="customerInfo[i.valueKey]"
>
<view :class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]">
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
<image
class="calendar-icon"
:src="require('@/assets/images/common/icon-calendar.png')"
mode="aspectFit"
/>
</view>
</picker>
</template>
......@@ -149,7 +159,7 @@
:maxlength="i.maxlength"
v-model="customerInfo[i.valueKey]"
class="input input--count"
placeholder="请输入"
:placeholder="`请输入${i.label}`"
placeholder-style="color:rgba(51, 51, 51, 0.2);"
confirm-type="done"
/>
......@@ -161,7 +171,7 @@
:class="['select flex', { placeholderStyle: !customerInfo[i.valueKey] }]"
@click="showPopup(i.popKey)"
>
<view class="value text-hide">{{ customerInfo[i.valueKey] || '请选择' }}</view>
<view class="value text-hide">{{ customerInfo[i.valueKey] || i.placeholder || '请选择' }}</view>
<uni-icons class="arrow" type="right" :size="16"></uni-icons>
</view>
</template>
......@@ -237,7 +247,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'customerPhone',
key: 'customerPhone',
type: 'readonly',
required: true
required: true,
placeholder: '请输入车主手机号'
},
{
label: '车型',
......@@ -252,7 +263,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'deliveryDate',
key: 'deliveryDate',
required: true,
type: 'date'
type: 'date',
dateUnlimited: true
},
// {
// label: '接待场景',
......@@ -282,7 +294,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
label: '到店日期',
valueKey: 'inviteDate',
key: 'inviteDate',
type: 'date'
type: 'date',
dateFromToday: true
},
{
label: '驻店零售',
......@@ -309,7 +322,8 @@ const phoneRex = /^[1]([3-9])[0-9]{9}$/,
valueKey: 'contact_name',
key: 'contact_id',
type: 'select',
popKey: 'groupMemberVisible'
popKey: 'groupMemberVisible',
placeholder: '请选择群成员'
},
{
label: '备注',
......@@ -413,15 +427,39 @@ export default {
return map[status] || ''
},
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
if (!this.customerId) {
return false
}
try {
const res = await uni.$api.customerApi.customerProfileInfoAPI({
id: this.customerId
})
if (!res || typeof res !== 'object') {
return false
}
if (res.deliveryDate) {
res.deliveryDate = dayjs(res.deliveryDate).format('YYYY-MM-DD')
}
if (res.createdDate) {
res.createdDate = dayjs(res.createdDate).format('YYYY-MM-DD')
}
if (res.inviteDate) {
res.inviteDate = dayjs(res.inviteDate).format('YYYY-MM-DD')
}
Object.assign(this.customerInfo, res)
if (!this.customerInfo.contact_id && res.wxId) {
this.customerInfo.contact_id = res.wxId
}
if (!this.customerInfo.contact_name && res.wxName) {
this.customerInfo.contact_name = res.wxName
}
this.syncDisplayInfo(this.customerInfo)
await this.getCustomerGroupInfo()
return true
} catch (error) {
console.error('getCustormDetail 失败', error)
return false
}
console.log('getCustomerGroupInfoAPI**customerForm*', this.customerForm)
},
async submitCustomerProfileAPI(options = {}) {
const { fromReception = false } = options
......@@ -579,11 +617,22 @@ export default {
}
},
async getCustomerGroupMemberInfoAPI(contactId) {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId: contactId
})
console.log('群成员getCustomerGroupMemberInfoAPI***', data)
this.groupMemberList = Array.isArray(data) ? data : []
const qwGroupId = contactId || this.customerInfo.qwGroupId
if (!qwGroupId) {
this.groupMemberList = []
return false
}
try {
const data = await uni.$api.customerApi.getCustomerGroupMemberInfoAPI({
qwGroupId
})
this.groupMemberList = Array.isArray(data) ? data : []
return this.groupMemberList.length > 0
} catch (error) {
console.error('getCustomerGroupMemberInfoAPI 失败', error)
this.groupMemberList = []
return false
}
},
syncDisplayInfo (info = this.customerInfo) {
this.headerSnapshot = {
......@@ -625,7 +674,7 @@ export default {
receptionSceneName: '',
standNo: '',
inviteDate: '',
createdDate: '',
createdDate: dayjs().format('YYYY-MM-DD'),
employeeName: '',
userId: '',
merchantName: '',
......@@ -647,6 +696,9 @@ export default {
if (res.inviteDate) res.inviteDate = dayjs(res.inviteDate).format("YYYY-MM-DD")
// 合并而非整对象替换,保留 initForm 中已声明的响应式字段(如 contact_name)
Object.assign(this.customerInfo, res)
if (!this.customerInfo.createdDate) {
this.customerInfo.createdDate = dayjs().format('YYYY-MM-DD')
}
if (!this.customerInfo.contact_id && res.wxId) {
this.customerInfo.contact_id = res.wxId
}
......@@ -711,6 +763,14 @@ export default {
this.customerInfo.receptionScene = item.id
}
},
getDatePickerStart (field) {
if (field.dateUnlimited) return '1970-01-01'
if (field.dateFromToday) return dayjs().format('YYYY-MM-DD')
return this.startDate
},
getDatePickerEnd (field) {
return field.dateUnlimited ? '2099-12-31' : this.endDate
},
bindDateChange (e, valueKey) {
this.customerInfo[valueKey] = e.detail.value
},
......@@ -1030,6 +1090,12 @@ export default {
margin-left: auto;
flex-shrink: 0;
}
.calendar-icon {
width: 16px;
height: 16px;
margin-left: auto;
flex-shrink: 0;
}
.error {
border: toRpx(2) solid #f24724 !important;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!