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 41c080c1
authored
Oct 29, 2022
by
张晓玮
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'zhangxw_dev_3.0' into 'v3.0'
Zhangxw dev 3.0 See merge request
!106
2 parents
617151dd
c14c61df
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 @
41c080c
...
@@ -17,6 +17,7 @@ Component({
...
@@ -17,6 +17,7 @@ Component({
navHeight
:
thisPage
.
data
.
navHeight
navHeight
:
thisPage
.
data
.
navHeight
})
})
if
(
val
.
showSharePopup
)
{
if
(
val
.
showSharePopup
)
{
wx
.
$api
.
showLoading
()
val
.
boxImageHeight
=
66
val
.
boxImageHeight
=
66
// 计算弹窗图片区域最大高度
// 计算弹窗图片区域最大高度
wx
.
$util
.
getViewInfo
(
'.layout'
,
res
=>
{
wx
.
$util
.
getViewInfo
(
'.layout'
,
res
=>
{
...
@@ -24,7 +25,7 @@ Component({
...
@@ -24,7 +25,7 @@ Component({
postersBoxHeight
:
res
.
height
*
0.7
,
postersBoxHeight
:
res
.
height
*
0.7
,
})
})
wx
.
getImageInfo
({
wx
.
getImageInfo
({
src
:
val
.
posterImg
,
src
:
`
${
val
.
posterImg
}
?v=
${
Date
.
now
()}
`
,
success
(
e
)
{
success
(
e
)
{
_this
.
setData
({
_this
.
setData
({
postersImageHeight
:
(
e
.
height
/
e
.
width
)
*
247
postersImageHeight
:
(
e
.
height
/
e
.
width
)
*
247
...
@@ -45,21 +46,14 @@ Component({
...
@@ -45,21 +46,14 @@ Component({
*/
*/
data
:
{
data
:
{
USERINFO
:
wx
.
$storage
.
get
(
'userInfo'
),
USERINFO
:
wx
.
$storage
.
get
(
'userInfo'
),
activityTypList
:
index_const
.
data
.
activityTypList
,
activityTypList
:
index_const
.
data
.
activityTypList
imageLoaded
:
false
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
imageLoaded
(
event
)
{
if
(
event
.
detail
.
width
)
{
this
.
setData
({
imageLoaded
:
true
})
}
},
async
init
(
n
)
{
async
init
(
n
)
{
wx
.
$api
.
showLoading
()
const
drawfun
=
new
Draw
({
const
drawfun
=
new
Draw
({
width
:
279
,
width
:
279
,
height
:
n
.
postersImageHeight
+
76
,
height
:
n
.
postersImageHeight
+
76
,
...
@@ -82,7 +76,7 @@ Component({
...
@@ -82,7 +76,7 @@ Component({
width
:
20
,
width
:
20
,
height
:
20
,
height
:
20
,
borderRadius
:
40
,
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`
// url: `${this.data.IMGURL}default_avatar.png`
},
},
{
{
...
@@ -133,7 +127,6 @@ Component({
...
@@ -133,7 +127,6 @@ Component({
},
},
],
],
})
})
console
.
log
(
res
)
wx
.
hideLoading
()
wx
.
hideLoading
()
this
.
setData
({
this
.
setData
({
poster
:
res
.
path
poster
:
res
.
path
...
@@ -142,7 +135,6 @@ Component({
...
@@ -142,7 +135,6 @@ Component({
close
()
{
close
()
{
let
thisPage
=
wx
.
$router
.
getPageInstance
()
let
thisPage
=
wx
.
$router
.
getPageInstance
()
this
.
setData
({
this
.
setData
({
imageLoaded
:
false
,
poster
:
""
poster
:
""
})
})
thisPage
.
setData
({
thisPage
.
setData
({
...
...
components/sharePopup/sharePopup.wxml
View file @
41c080c
<!--components/sharePopup/sharePopup.wxml-->
<!--components/sharePopup/sharePopup.wxml-->
<wxs module="fn">
<view class="share-popup" wx:if="{{data.showSharePopup && poster}}">
var time = function(e, num) {
<view class="share-popup-bg"/>
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-box" style="transform: translate(-50%, calc(-50% + {{navHeight / 2}}px));">
<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">
<view class="close_btn" bindtap="close">
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
<image webp src="{{IMGURL}}popup_close_btn.png"></image>
</view>
</view>
</view>
</view>
<view class="share-popup-content" style="max-height: {{postersBoxHeight}}px;">
<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>
<view class="btn-box"
wx:if="{{imageLoaded}}"
>
<view class="btn-box">
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="btn" bind:tap="saveImage">保存至相册</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
<view class="tip">提示:这是您的专属活动海报,请保存至手机相册后转发给客户微信,系统将自动记录成交订单归属,并发放积分奖励!</view>
</view>
</view>
...
...
packageActivity/pages/taskDetail/taskDetail.js
View file @
41c080c
...
@@ -109,7 +109,9 @@ Page({
...
@@ -109,7 +109,9 @@ Page({
// 跳转链接
// 跳转链接
goShareLink
(
e
)
{
goShareLink
(
e
)
{
let
{
linkUrl
}
=
this
.
data
.
detailInfo
let
{
detailInfo
}
=
this
.
data
// 跳转拼接的链接
let
linkUrl
=
this
.
filterJumpUrl
(
detailInfo
.
activityId
)
wx
.
$router
.
jumpH5
(
linkUrl
)
wx
.
$router
.
jumpH5
(
linkUrl
)
},
},
...
...
pages/tab/index/components/activeBox/activeBox.js
View file @
41c080c
...
@@ -71,11 +71,23 @@ Component({
...
@@ -71,11 +71,23 @@ Component({
v
.
forEach
(
k
=>
{
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
.
time
=
(
new
Date
(
k
.
activityTime
).
getMonth
()
+
1
).
toString
().
padStart
(
2
,
"0"
)
+
"月"
+
new
Date
(
k
.
activityTime
).
getDate
().
toString
().
padStart
(
2
,
"0"
)
+
"日"
k
.
ind
=
ind
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
(
d
.
getTime
()
>
new
Date
(
`
${
k
.
activityTime
.
replace
(
/-/g
,
'/'
)}
23:59:59`
).
getTime
())
k
.
status
=
2
if
(
nowDate
==
k
.
time
)
{
if
(
nowDate
==
k
.
time
)
{
val
.
calenderActiveIndex
=
index
val
.
calenderActiveIndex
=
index
this
.
setData
({
activeDateIndex
:
ind
})
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
++
ind
++
})
})
})
})
...
@@ -193,6 +205,7 @@ Component({
...
@@ -193,6 +205,7 @@ Component({
goToDetail
(
e
)
{
goToDetail
(
e
)
{
let
{
item
}
=
e
.
currentTarget
.
dataset
let
{
item
}
=
e
.
currentTarget
.
dataset
let
h5Url
=
this
.
filterJumpUrl
(
item
)
let
h5Url
=
this
.
filterJumpUrl
(
item
)
console
.
log
(
h5Url
)
wx
.
$router
.
jumpH5
(
h5Url
)
wx
.
$router
.
jumpH5
(
h5Url
)
},
},
// 活动战报
// 活动战报
...
...
utils/Draw.js
View file @
41c080c
...
@@ -58,7 +58,6 @@ class Draw {
...
@@ -58,7 +58,6 @@ class Draw {
}
}
let
image
=
this
[
_canvas_
].
createImage
()
let
image
=
this
[
_canvas_
].
createImage
()
image
.
src
=
`
${
url
}
?v=
${
Date
.
now
()}
`
image
.
src
=
`
${
url
}
?v=
${
Date
.
now
()}
`
console
.
log
(
image
.
src
)
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
resolve
=>
{
image
.
onload
=
()
=>
{
image
.
onload
=
()
=>
{
this
[
_ctx_
].
drawImage
(
image
,
x
,
y
,
width
,
height
)
this
[
_ctx_
].
drawImage
(
image
,
x
,
y
,
width
,
height
)
...
@@ -449,7 +448,7 @@ class Draw {
...
@@ -449,7 +448,7 @@ class Draw {
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
[
a
,
format
,
bodyData
]
=
/data:image
\/(\w
+
)
;base64,
(
.*
)
/
.
exec
(
base64data
)
||
[]
const
[
a
,
format
,
bodyData
]
=
/data:image
\/(\w
+
)
;base64,
(
.*
)
/
.
exec
(
base64data
)
||
[]
if
(
!
format
)
reject
(
new
Error
(
'ERROR_BASE64SRC_PARSE'
))
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
)
const
buffer
=
wx
.
base64ToArrayBuffer
(
bodyData
)
wx
.
getFileSystemManager
().
writeFile
({
wx
.
getFileSystemManager
().
writeFile
({
filePath
,
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