Commit 84cbd7e9 by 李伟康

feat(mobile): 添加移动端客户档案表单只读模式和归因说明功能

- 为InfoIcon组件添加点击事件支持
- 在OptionGroup组件中添加readonly属性控制按钮禁用状态
- 为客户档案页面添加formReadonly状态控制整个表单只读
- 为所有选项按钮添加disabled属性绑定formReadonly状态
- 添加AttributionGuide组件用于显示成交和战败归因说明
- 实现归因说明弹窗功能,包括成交类型和战败类型的详细描述
- 调整表单验证逻辑,增加窗膜品牌的条件验证
- 修改初始数据状态,将receptionResult设为null
- 将开发服务器端口从9527改为8080
- 优化代码格式化和条件判断语句结构
1 parent 95758454
<template>
<van-popup
v-model="localVisible"
position="bottom"
round
:style="{ height: '80%' }"
closeable
close-icon="cross"
:close-on-click-overlay="true"
@close="$emit('close')"
>
<div class="px-3 pt-5 pb-3 border-b border-gray-100">
<h3 class="text-[17px] font-semibold text-gray-900">{{ title }}</h3>
</div>
<div class="overflow-y-auto px-5 py-4" style="height: calc(80vh - 80px);">
<div
v-for="(item, index) in descriptions"
:key="index"
class="mb-3 last:mb-0 p-2 bg-gray-50 rounded-xl"
>
<div class="flex items-start gap-2">
<div class="w-2 h-2 rounded-full bg-green-500 flex-shrink-0 mt-2"></div>
<div class="flex-1">
<div class="text-[12px] font-semibold text-gray-900 mb-2">{{ item.label }}</div>
<div class="text-[10px] text-gray-600 leading-relaxed">{{ item.description }}</div>
</div>
</div>
</div>
</div>
</van-popup>
</template>
<script>
export default {
name: 'AttributionGuide',
props: {
visible: {
type: Boolean,
default: false
},
title: {
type: String,
default: '归因说明'
},
descriptions: {
type: Array,
default: () => []
}
},
computed: {
localVisible: {
get() {
return this.visible
},
set(value) {
if (!value) {
this.$emit('close')
}
}
}
}
}
</script>
\ No newline at end of file
<template>
<button class="text-blue-400 hover:text-blue-600 active:scale-95 transition-all p-0.5">
<button @click="$emit('click')" class="text-blue-400 hover:text-blue-600 active:scale-95 transition-all p-0.5">
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="10"></circle>
<path d="M12 16v-4"></path>
......
......@@ -8,16 +8,13 @@
<button
v-for="item in options"
:key="item.value"
:disabled="readonly"
:class="[
'px-4 py-1.5 rounded-full text-[13px] transition-all duration-200 border',
isSelected(item.value)
? 'bg-blue-600 text-white border-blue-600 font-medium'
: 'bg-gray-50 text-gray-600 border-gray-200 active:bg-gray-100'
(isSelected(item.value) ? 'bg-blue-600 text-white border-blue-600 font-medium' : 'bg-gray-50 text-gray-600 border-gray-200 active:bg-gray-100')
]"
@click="$emit('select', field, item.value)"
>
{{ item.label }}
</button>
>{{ item.label }}</button>
</div>
</div>
</template>
......@@ -30,7 +27,8 @@ export default {
required: { type: Boolean, default: false },
options: { type: Array, required: true },
field: { type: String, required: true },
value: { type: [String, Array, Number], default: '' }
value: { type: [String, Array, Number], default: '' },
readonly: { type: Boolean, default: false }
},
methods: {
isSelected(itemValue) {
......
......@@ -36,7 +36,7 @@ module.exports = {
runtimeCompiler: true,
devServer: {
disableHostCheck: true,
port: 9527, // 端口 dj-scrm-wx-work-lwk
port: 8080, // 端口 dj-scrm-wx-work-lwk
// port: 9528, // 端口 dj-scrm-wx-work-main-lwk
open: false, // 启动后打开浏览器.
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!