Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c14c61df
authored
Oct 29, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修改
1 parent
eb0b2703
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
26 deletions
components/sharePopup/sharePopup.js
components/sharePopup/sharePopup.wxml
packageActivity/pages/taskDetail/taskDetail.js
pages/tab/index/components/activeBox/activeBox.js
utils/Draw.js
components/sharePopup/sharePopup.js
View file @
c14c61d
...
...
@@ -17,6 +17,7 @@ Component({
navHeight
:
thisPage
.
data
.
navHeight
})
if
(
val
.
showSharePopup
)
{
wx
.
$api
.
showLoading
()
val
.
boxImageHeight
=
66
// 计算弹窗图片区域最大高度
wx
.
$util
.
getViewInfo
(
'.layout'
,
res
=>
{
...
...
@@ -24,7 +25,7 @@ Component({
postersBoxHeight
:
res
.
height
*
0.7
,
})
wx
.
getImageInfo
({
src
:
val
.
posterImg
,
src
:
`
${
val
.
posterImg
}
?v=
${
Date
.
now
()}
`
,
success
(
e
)
{
_this
.
setData
({
postersImageHeight
:
(
e
.
height
/
e
.
width
)
*
247
...
...
@@ -45,21 +46,14 @@ Component({
*/
data
:
{
USERINFO
:
wx
.
$storage
.
get
(
'userInfo'
),
activityTypList
:
index_const
.
data
.
activityTypList
,
imageLoaded
:
false
activityTypList
:
index_const
.
data
.
activityTypList
},
/**
* 组件的方法列表
*/
methods
:
{
imageLoaded
(
event
)
{
if
(
event
.
detail
.
width
)
{
this
.
setData
({
imageLoaded
:
true
})
}
},
async
init
(
n
)
{
wx
.
$api
.
showLoading
()
const
drawfun
=
new
Draw
({
width
:
279
,
height
:
n
.
postersImageHeight
+
76
,
...
...
@@ -82,7 +76,7 @@ Component({
width
:
20
,
height
:
20
,
borderRadius
:
40
,
url
:
userInfo
.
sta_avatarUrl
&&
userInfo
.
sta_avatarUrl
.
indexOf
(
'https://thirdwx.qlogo.cn'
)
>
-
1
?
userInfo
.
sta_avatarUrl
:
userInfo
.
weChatAvatarUrl
&&
userInfo
.
weChatAvatarUrl
.
indexOf
(
'https://thirdwx.qlogo.cn'
)
>
-
1
?
userInfo
.
weChatAvatarUrl
:
`
${
this
.
data
.
IMGURL
}
default_avatar.png`
url
:
userInfo
.
sta_avatarUrl
?
userInfo
.
sta_avatarUrl
:
userInfo
.
weChatAvatarUrl
?
userInfo
.
weChatAvatarUrl
:
`
${
this
.
data
.
IMGURL
}
default_avatar.png`
// url: `${this.data.IMGURL}default_avatar.png`
},
{
...
...
@@ -133,7 +127,6 @@ Component({
},
],
})
console
.
log
(
res
)
wx
.
hideLoading
()
this
.
setData
({
poster
:
res
.
path
...
...
@@ -142,7 +135,6 @@ Component({
close
()
{
let
thisPage
=
wx
.
$router
.
getPageInstance
()
this
.
setData
({
imageLoaded
:
false
,
poster
:
""
})
thisPage
.
setData
({
...
...
components/sharePopup/sharePopup.wxml
View file @
c14c61d
<!--components/sharePopup/sharePopup.wxml-->
<wxs module="fn">
var time = function(e, num) {
return getDate().getTime()
}
module.exports.time = time
</wxs>
<view class="share-popup" wx:if="{{poster}}">
<view class="share-popup-bg" wx:if="{{imageLoaded}}"/>
<view class="share-popup" wx:if="{{data.showSharePopup && poster}}">
<view class="share-popup-bg"/>
<view class="share-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<view class="close-box"
wx:if="{{imageLoaded}}"
>
<view class="close-box">
<view class="close_btn" bindtap="close">
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view>
</view>
<view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<image style="height: {{postersImageHeight + 76}}px;" src="{{poster}}"
bindload="imageLoaded"
></image>
<image style="height: {{postersImageHeight + 76}}px;" src="{{poster}}"></image>
</view>
<view class="btn-box"
wx:if="{{imageLoaded}}"
>
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
</view>
...
...
packageActivity/pages/taskDetail/taskDetail.js
View file @
c14c61d
...
...
@@ -109,7 +109,9 @@ Page({
// 跳转链接
goShareLink
(
e
)
{
let
{
linkUrl
}
=
this
.
data
.
detailInfo
let
{
detailInfo
}
=
this
.
data
// 跳转拼接的链接
let
linkUrl
=
this
.
filterJumpUrl
(
detailInfo
.
activityId
)
wx
.
$router
.
jumpH5
(
linkUrl
)
},
...
...
pages/tab/index/components/activeBox/activeBox.js
View file @
c14c61d
...
...
@@ -71,11 +71,23 @@ Component({
v
.
forEach
(
k
=>
{
k
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
ind
=
ind
let
completeStatusNum
=
0
k
.
platformMerchantMissionResponseList
.
forEach
(
val
=>
{
if
(
val
.
completeStatus
==
2
)
completeStatusNum
++
})
if
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
k
.
status
=
2
if
(
nowDate
==
k
.
time
)
{
val
.
calenderActiveIndex
=
index
this
.
setData
({
activeDateIndex
:
ind
})
}
// status 1过去日期任务全部完成 2过去日期任务有未完成的 3当前日期或未来日期
if
(
completeStatusNum
==
v
.
length
&&
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
{
k
.
status
=
1
}
else
if
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
{
k
.
status
=
2
}
else
{
k
.
status
=
3
}
ind
++
})
})
...
...
@@ -193,6 +205,7 @@ Component({
goToDetail
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
let
h5Url
=
this
.
filterJumpUrl
(
item
)
console
.
log
(
h5Url
)
wx
.
$router
.
jumpH5
(
h5Url
)
},
// 活动战报
...
...
utils/Draw.js
View file @
c14c61d
...
...
@@ -58,7 +58,6 @@ class Draw {
}
let
image
=
this
[
_canvas_
].
createImage
()
image
.
src
=
`
${
url
}
?v=
${
Date
.
now
()}
`
console
.
log
(
image
.
src
)
return
new
Promise
(
resolve
=>
{
image
.
onload
=
()
=>
{
this
[
_ctx_
].
drawImage
(
image
,
x
,
y
,
width
,
height
)
...
...
@@ -449,7 +448,7 @@ class Draw {
return
new
Promise
((
resolve
,
reject
)
=>
{
const
[
a
,
format
,
bodyData
]
=
/data:image
\/(\w
+
)
;base64,
(
.*
)
/
.
exec
(
base64data
)
||
[]
if
(
!
format
)
reject
(
new
Error
(
'ERROR_BASE64SRC_PARSE'
))
const
filePath
=
`
${
wx
.
env
.
USER_DATA_PATH
}
/tmp_base64src
${
new
Date
().
getTime
()}
.
${
format
}
`
const
filePath
=
`
${
wx
.
env
.
USER_DATA_PATH
}
/tmp_base64src
${
Date
.
now
()}
.
${
format
}
`
const
buffer
=
wx
.
base64ToArrayBuffer
(
bodyData
)
wx
.
getFileSystemManager
().
writeFile
({
filePath
,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment