Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-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 1dc2f2d2
authored
Oct 27, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改代码
1 parent
59ef301c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
197 deletions
components/CrowdfundPoster/CrowdfundPoster.js
components/CrowdfundPoster/CrowdfundPoster.json
components/CrowdfundPoster/CrowdfundPoster.wxml
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.json
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.scss
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxml
components/CrowdfundPoster/CrowdfundPoster.js
View file @
1dc2f2d
...
@@ -94,9 +94,17 @@ Component({
...
@@ -94,9 +94,17 @@ Component({
})
})
},
},
download
()
{
download
()
{
const
filePath
=
this
.
data
.
poster
const
filePath
=
this
.
data
.
poster
,
_this
=
this
wx
.
saveImageToPhotosAlbum
({
wx
.
saveImageToPhotosAlbum
({
filePath
filePath
,
success
(){
wx
.
$api
.
showToast
(
'保存成功'
)
},
fail
(
err
)
{
const
auth
=
_this
.
selectComponent
(
'#auth'
)
auth
.
check
()
}
})
})
},
},
hide
()
{
hide
()
{
...
@@ -105,6 +113,11 @@ Component({
...
@@ -105,6 +113,11 @@ Component({
poster
:
''
poster
:
''
})
})
},
},
noScroll
()
{}
noScroll
()
{},
authFail
(
e
)
{
this
.
setData
({
showAuth
:
true
})
}
}
}
})
})
\ No newline at end of file
\ No newline at end of file
components/CrowdfundPoster/CrowdfundPoster.json
View file @
1dc2f2d
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"authorize"
:
"/components/Authorize/Authorize"
}
}
}
\ No newline at end of file
\ No newline at end of file
components/CrowdfundPoster/CrowdfundPoster.wxml
View file @
1dc2f2d
...
@@ -7,4 +7,5 @@
...
@@ -7,4 +7,5 @@
提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。
提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。
</view>
</view>
</view>
</view>
</block>
\ No newline at end of file
\ No newline at end of file
</block>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
deleted
100644 → 0
View file @
59ef301
// packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
import
Draw
from
'~/utils/Draw'
Component
({
/**
* 组件的属性列表
*/
properties
:
{
item
:
{
type
:
Object
,
observer
(
n
)
{
console
.
log
(
n
,
'================='
)
this
.
init
(
n
)
}
}
},
/**
* 组件的初始数据
*/
data
:
{
},
/**
* 组件的方法列表
*/
methods
:
{
async
init
(
n
)
{
wx
.
$api
.
showLoading
()
const
drawfun
=
new
Draw
({
width
:
279
,
height
:
554
},
this
),
{
userInfo
}
=
wx
.
$storage
.
get
(),
merchantName
=
userInfo
.
merchantName
.
length
>
12
?
`
${
userInfo
.
merchantName
.
substring
(
0
,
12
)}
...`
:
userInfo
.
merchantName
,
res
=
await
drawfun
.
begin
({
imageList
:
[{
x
:
0
,
y
:
0
,
width
:
279
,
height
:
66
,
url
:
'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x
:
16
,
y
:
70
,
width
:
247
,
height
:
472
,
url
:
n
.
posterUrl
}
],
textList
:
[{
x
:
12
,
y
:
14
,
fontSize
:
14
,
color
:
'#2D2D33'
,
text
:
merchantName
,
textBaseline
:
'top'
},
{
x
:
16
+
drawfun
.
getTextWidth
(
merchantName
,
14
),
y
:
15
,
fontSize
:
12
,
color
:
'#6E6E7A'
,
text
:
'邀请你参加'
,
textBaseline
:
'top'
},
{
x
:
12
,
y
:
36
,
fontSize
:
14
,
color
:
'#1B233D'
,
text
:
n
.
activityName
,
textBaseline
:
'top'
,
fontWeight
:
500
},
{
x
:
14
+
drawfun
.
getTextWidth
(
n
.
activityName
,
14
)
+
9
,
y
:
39
,
fontSize
:
10
,
color
:
'#4466F0'
,
text
:
'众筹'
,
border
:
{
width
:
1
,
color
:
'#8FA5FF'
,
radius
:
2
,
padding
:
[
5
,
5
]
}
}
],
})
console
.
log
(
res
)
wx
.
hideLoading
()
this
.
setData
({
poster
:
res
.
path
})
},
download
()
{
const
filePath
=
this
.
data
.
poster
,
_this
=
this
wx
.
saveImageToPhotosAlbum
({
filePath
,
success
(){
wx
.
$api
.
showToast
(
'保存成功'
)
},
fail
(
err
)
{
const
auth
=
_this
.
selectComponent
(
'#auth'
)
auth
.
check
()
}
}
)
},
hide
()
{
this
.
setData
({
poster
:
''
})
},
noScroll
()
{},
authFail
(
e
)
{
this
.
setData
({
showAuth
:
true
})
}
}
})
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.json
deleted
100644 → 0
View file @
59ef301
{
"component"
:
true
,
"usingComponents"
:
{
"authorize"
:
"/components/Authorize/Authorize"
}
}
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.scss
deleted
100644 → 0
View file @
59ef301
/* packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxss */
.layout
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
998
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
.bg
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
z-index
:
-1
;
background
:
rgba
(
28
,
27
,
35
,
0
.60
);
}
.poster
{
width
:
558rpx
;
height
:
60%
;
border-radius
:
8rpx
;
}
.btn
{
width
:
320rpx
;
height
:
88rpx
;
line-height
:
88rpx
;
background-image
:
linear-gradient
(
-60deg
,
#556AF5
0%
,
#7197FF
100%
);
border-radius
:
16rpx
;
font-weight
:
500
;
font-size
:
32rpx
;
color
:
#FFFFFF
;
text-align
:
center
;
margin-top
:
32rpx
;
}
.tips
{
margin
:
16rpx
80rpx
0
;
font-size
:
24rpx
;
color
:
#FFFFFF
;
line-height
:
36rpx
;
}
}
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxml
deleted
100644 → 0
View file @
59ef301
<block wx:if="{{poster}}">
<view class="layout" catchtouchmove="noScroll">
<view class="bg" bindtap="hide"></view>
<image src="{{poster}}" class="poster" mode="aspectFit"></image>
<view class="btn" bindtap="download">保存至相册</view>
<view class="tips">
提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。
</view>
</view>
</block>
<authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" id="auth"></authorize>
\ No newline at end of file
\ No newline at end of file
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