Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-promotion-wechat
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-promotion-wechat
Commits
b1c877c3
提交
b1c877c3
authored
3月 06, 2025
作者:
lidongxu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
下班后不能再修改上传照片
上级
61f7966a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
75 行增加
和
37 行删除
+75
-37
index.vue
pages/home/index.vue
+4
-4
start.vue
pages/start.vue
+1
-1
index.vue
pages/work/index.vue
+70
-32
没有找到文件。
pages/home/index.vue
浏览文件 @
b1c877c3
...
...
@@ -264,6 +264,7 @@ export default {
const
{
id
,
name
}
=
this
.
$store
.
getters
.
user
// 配置考勤参数
console
.
log
(
this
.
onWorkRecord
.
id
,
'this.onWorkRecord.id'
)
const
attObj
=
{
temporaryId
:
id
,
// 促销员 ID
temporaryName
:
name
,
// 促销员姓名
...
...
@@ -278,17 +279,16 @@ export default {
clockArea
:
this
.
addressObj
.
area
,
// 区域
}
try
{
// 打卡
await
getOnWorkCardAPI
(
attObj
)
if
(
type
===
1
)
{
// 创建上报记录-才算完成打卡
const
res
=
await
createOnWorkPlanAPI
({
activityReportedId
:
planObj
.
id
,
temporaryId
:
this
.
$store
.
getters
.
user
.
id
,
// 促销员 ID
temporaryName
:
this
.
$store
.
getters
.
user
.
name
,
// 促销员姓名
})
console
.
log
(
res
)
}
// 打卡
// await getOnWorkCardAPI(attObj)
this
.
$modal
.
msgSuccess
(
'打卡成功'
)
wx
.
showTabBar
({
animation
:
true
...
...
pages/start.vue
浏览文件 @
b1c877c3
...
...
@@ -8,9 +8,9 @@
<
script
>
export
default
{
mounted
()
{
wx
.
hideTabBar
()
setTimeout
(()
=>
{
this
.
$tab
.
redirectTo
(
'/pages/login'
)
wx
.
hideTabBar
()
},
2000
)
}
}
...
...
pages/work/index.vue
浏览文件 @
b1c877c3
...
...
@@ -7,21 +7,33 @@
<van-uploader
preview-size=
"187.5rpx"
name=
"img"
accept=
"image"
:capture=
"['camera']"
multiple
max-count=
"8"
:show-upload=
"!isOutTime"
:deletable=
"!isOutTime"
:capture=
"['camera', afterTryFileList.length >= 4 ? 'album' : '']"
:file-list=
"afterTryFileList"
@
after-read=
"afterTry"
@
delete=
"deleteTry"
/>
<view
class=
"title title_back"
>
推广互动照片(最少 4 张)
</view>
<van-uploader
preview-size=
"187.5rpx"
accept=
"image"
:capture=
"['camera']"
multiple
max-count=
"8"
:show-upload=
"!isOutTime"
:deletable=
"!isOutTime"
:capture=
"['camera', afterInterFileList.length >= 4 ? 'album' : '']"
:file-list=
"afterInterFileList"
@
after-read=
"afterInter"
@
delete=
"deleteInter"
/>
<view
class=
"title title_back"
>
推广成交照片(最少 4 张)
</view>
<van-uploader
preview-size=
"187.5rpx"
accept=
"image"
:capture=
"['camera']"
multiple
max-count=
"8"
:show-upload=
"!isOutTime"
:deletable=
"!isOutTime"
:capture=
"['camera', afterDealFileList.length >= 4 ? 'album' : '']"
:file-list=
"afterDealFileList"
@
after-read=
"afterDeal"
@
delete=
"deleteDeal"
/>
...
...
@@ -37,6 +49,7 @@ export default {
return
{
storeName
:
''
,
activityReportedId
:
''
,
isOutTime
:
false
,
// 是否下班,
afterTryFileList
:
[],
afterInterFileList
:
[],
afterDealFileList
:
[]
...
...
@@ -50,31 +63,42 @@ export default {
// 获取促销员任务列表
async
getOnWorkRecordFn
()
{
const
res
=
await
getOnWorkRecordAPI
(
this
.
$store
.
getters
.
user
.
id
)
console
.
log
(
res
)
this
.
storeName
=
res
.
data
?.
storeName
this
.
isOutTime
=
res
.
data
?.
clockOutTime
?
true
:
false
// 下班时间
this
.
activityReportedId
=
res
.
data
?.
reportedId
// 活动上报 ID
},
// 获取推广照片列表
async
getPromotionPhotoFn
()
{
const
res
=
await
getPromotionPhotoRecordAPI
(
this
.
$store
.
getters
.
user
.
id
)
this
.
afterTryFileList
=
res
.
data
?
res
.
data
.
tgscPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
:
[]
this
.
afterInterFileList
=
res
.
data
?
res
.
data
.
tghdPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
:
[]
this
.
afterDealFileList
=
res
.
data
?
res
.
data
.
tgcjPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
:
[]
if
(
res
.
data
&&
res
.
data
.
tgscPhotoUrls
)
{
this
.
afterTryFileList
=
res
.
data
.
tgscPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
}
// 豆包,照着上面把下面 2 段改一下
if
(
res
.
data
&&
res
.
data
.
tghdPhotoUrls
)
{
this
.
afterInterFileList
=
res
.
data
.
tghdPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
}
if
(
res
.
data
&&
res
.
data
.
tgcjPhotoUrls
)
{
this
.
afterDealFileList
=
res
.
data
.
tgcjPhotoUrls
?.
map
(
o
=>
({
url
:
o
,
type
:
'image'
}))
}
},
// 推广试吃
async
afterTry
(
event
)
{
const
photoUrl
=
await
this
.
uploadPromotionPhoto
(
event
)
this
.
afterTryFileList
.
push
({
url
:
photoUrl
,
type
:
'image'
photoUrl
.
forEach
(
url
=>
{
this
.
afterTryFileList
.
push
({
url
:
url
,
type
:
'image'
})
})
// 提交照片给后台
this
.
submitPhoto
()
...
...
@@ -82,31 +106,44 @@ export default {
// 推广互动
async
afterInter
(
event
)
{
const
photoUrl
=
await
this
.
uploadPromotionPhoto
(
event
)
this
.
afterInterFileList
.
push
({
url
:
photoUrl
,
type
:
'image'
photoUrl
.
forEach
(
url
=>
{
this
.
afterInterFileList
.
push
({
url
:
url
,
type
:
'image'
})
})
this
.
submitPhoto
()
},
// 推广成交
async
afterDeal
(
event
)
{
const
photoUrl
=
await
this
.
uploadPromotionPhoto
(
event
)
this
.
afterDealFileList
.
push
({
url
:
photoUrl
,
type
:
'image'
photoUrl
.
forEach
(
url
=>
{
this
.
afterDealFileList
.
push
({
url
:
url
,
type
:
'image'
})
})
this
.
submitPhoto
()
},
// 上传推广照片
async
uploadPromotionPhoto
(
event
)
{
const
{
file
:
{
url
}
}
=
event
.
detail
;
// 按照年-月/日/手机号/类型/uuid.png 格式组成字符串
const
year
=
new
Date
().
getFullYear
()
const
month
=
new
Date
().
getMonth
()
+
1
const
day
=
new
Date
().
getDate
()
const
phone
=
this
.
$store
.
getters
.
user
.
phone
const
photoUrl
=
await
uploadFile
(
`promotion/
${
year
}
-
${
month
}
/
${
day
}
/
${
phone
}
/
${
uuidv4
()}
.png`
,
url
)
return
photoUrl
const
{
file
}
=
event
.
detail
;
let
fileList
=
[]
// 拍照单张是对象,多张是数组
fileList
=
Array
.
isArray
(
file
)
?
[...
file
]
:
[
file
]
const
promiseArr
=
[]
fileList
.
forEach
(({
url
})
=>
{
// 按照年-月/日/手机号/类型/uuid.png 格式组成字符串
const
year
=
new
Date
().
getFullYear
()
const
month
=
new
Date
().
getMonth
()
+
1
const
day
=
new
Date
().
getDate
()
const
phone
=
this
.
$store
.
getters
.
user
.
phone
const
res
=
uploadFile
(
`promotion/
${
year
}
-
${
month
}
/
${
day
}
/
${
phone
}
/
${
uuidv4
()}
.png`
,
url
)
promiseArr
.
push
(
res
)
})
return
Promise
.
all
(
promiseArr
)
},
// 提交照片
async
submitPhoto
()
{
...
...
@@ -120,6 +157,7 @@ export default {
})
console
.
log
(
res
)
},
// 删除照片
deleteTry
(
event
)
{
this
.
afterTryFileList
.
splice
(
event
.
detail
.
index
,
1
)
this
.
submitPhoto
()
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论