Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-ui
Commits
5c8653fb
提交
5c8653fb
authored
10月 29, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(promotion/plan/detail/tasklist.vue): 新增:勤策移动端_内置网页_促销管理_增加促销员手机号显示和拨打/复制功能
上级
c4fdce9f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
88 行增加
和
4 行删除
+88
-4
index.vue
.../mobile/pages/cp_activity/promotion/plan/detail/index.vue
+2
-1
taskList.vue
...bile/pages/cp_activity/promotion/plan/detail/taskList.vue
+86
-3
没有找到文件。
src/views/mobile/pages/cp_activity/promotion/plan/detail/index.vue
浏览文件 @
5c8653fb
...
...
@@ -202,7 +202,8 @@ const getPlanDetail = async () => {
province
:
o
.
reported
.
province
,
// 省份
city
:
o
.
reported
.
city
,
// 城市
addr
:
o
.
clock
.
clockInAddress
,
// 地址
temporaryName
:
o
.
reported
.
temporaryName
,
// 临时名称
temporaryName
:
o
.
reported
.
temporaryName
,
// 用户名
phone
:
o
.
clock
.
phone
,
// 手机号码
photoList
:
photoDialogList
,
// 照片列表
}
}
)
...
...
src/views/mobile/pages/cp_activity/promotion/plan/detail/taskList.vue
浏览文件 @
5c8653fb
...
...
@@ -14,13 +14,17 @@
<van-cell
v-for=
"item, index in planList"
:key=
"item.id"
>
<template
#
title
>
<p
class=
"cell-info"
>
<span>
促销员名字:
{{
item
.
temporaryName
}}
</span>
<div
class=
"cell-info"
>
<div
class=
"info"
>
<span>
促销员名字:
{{
item
.
temporaryName
}}
</span>
<span
class=
"phone-link"
@
click=
"showPhonePicker(item)"
>
手机号码:
{{
item
.
phone
}}
</span>
</div>
<van-button
class=
"delete-btn"
type=
"danger"
v-if=
"showDelete(planDetail)"
@
click=
"deleteView(item, index)"
>
删除此打卡记录
</van-button>
</
p
>
</
div
>
<p>
打卡参考地址:
{{
item
.
province
+
item
.
city
+
item
.
addr
}}
</p>
</
template
>
<
template
#
label
>
...
...
@@ -50,6 +54,12 @@
@
change=
"onChange"
>
<
template
v-slot:index
>
第
{{
index
+
1
}}
张
</
template
>
</van-image-preview>
<!-- 手机号码选择器 -->
<van-action-sheet
v-model:show=
"showPicker"
:actions=
"phoneActions"
cancel-text=
"取消"
@
select=
"onPickerConfirm"
/>
</template>
<
script
setup
>
...
...
@@ -95,6 +105,35 @@ const onChange = (ind) => {
index
.
value
=
ind
}
// 手机号码选择器相关
const
showPicker
=
ref
(
false
)
const
currentPhoneItem
=
ref
(
null
)
// 现在要拨打或复制的信息对象
const
phoneActions
=
ref
([
{
name
:
'拨打电话'
,
value
:
'call'
},
{
name
:
'复制号码'
,
value
:
'copy'
}
])
const
showPhonePicker
=
(
item
)
=>
{
currentPhoneItem
.
value
=
item
showPicker
.
value
=
true
}
// 选择器确认事件
const
onPickerConfirm
=
(
value
)
=>
{
const
phone
=
currentPhoneItem
.
value
.
phone
switch
(
value
.
value
)
{
case
'call'
:
// 拨打电话
window
.
location
.
href
=
`tel:
${
phone
}
`
break
case
'copy'
:
// 复制号码
copyToClipboard
(
phone
)
break
}
showPicker
.
value
=
false
}
// 删除计划
// 是否展示删除按钮
const
showDelete
=
(
row
)
=>
{
...
...
@@ -104,6 +143,39 @@ const showDelete = (row) => {
// return date === currentDate
return
true
}
// 复制到剪贴板
const
copyToClipboard
=
(
text
)
=>
{
if
(
navigator
.
clipboard
&&
window
.
isSecureContext
)
{
navigator
.
clipboard
.
writeText
(
text
).
then
(()
=>
{
showNotify
({
type
:
'success'
,
message
:
'号码已复制'
})
}).
catch
(()
=>
{
fallbackCopyText
(
text
)
})
}
else
{
fallbackCopyText
(
text
)
}
}
// 兼容性复制方法
const
fallbackCopyText
=
(
text
)
=>
{
const
textArea
=
document
.
createElement
(
'textarea'
)
textArea
.
value
=
text
textArea
.
style
.
position
=
'fixed'
textArea
.
style
.
left
=
'-999999px'
textArea
.
style
.
top
=
'-999999px'
document
.
body
.
appendChild
(
textArea
)
textArea
.
focus
()
textArea
.
select
()
try
{
document
.
execCommand
(
'copy'
)
showNotify
({
type
:
'success'
,
message
:
'号码已复制'
})
}
catch
(
err
)
{
showNotify
({
type
:
'warning'
,
message
:
'复制失败,请手动复制'
})
}
document
.
body
.
removeChild
(
textArea
)
}
// 点击删除
const
deleteView
=
(
item
,
index
)
=>
{
// 确认是否删除
...
...
@@ -159,6 +231,17 @@ const deleteView = (item, index) => {
align-items
:
center
;
margin-bottom
:
10px
;
.info
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
space-between
;
.phone-link
{
color
:
#1989fa
;
cursor
:
pointer
;
}
}
.delete-btn
{
height
:
30px
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论