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 f94dea52
authored
Oct 26, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加活动海报
1 parent
1a22e947
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
4 deletions
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
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.json
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml
utils/Draw.js
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.js
0 → 100644
View file @
f94dea5
// 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
(),
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
:
userInfo
.
merchantName
,
textBaseline
:
'top'
}]
})
console
.
log
(
res
)
wx
.
hideLoading
()
this
.
setData
({
poster
:
res
.
path
,
show
:
true
})
},
hide
()
{
this
.
setData
({
show
:
false
,
poster
:
''
})
}
}
})
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.json
0 → 100644
View file @
f94dea5
{
"component"
:
true
,
"usingComponents"
:
{}
}
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.scss
0 → 100644
View file @
f94dea5
/* packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxss */
.layout
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
998
;
.bg
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
z-index
:
-1
;
background
:
rgba
(
28
,
27
,
35
,
0
.60
);
box-shadow
:
0
0
0
0
rgba
(
255
,
255
,
255
,
0
.80
)
,
0
0
1px
0
rgba
(
92
,
114
,
246
,
0
.30
)
,
inset
0
0
1px
0
rgba
(
93
,
115
,
235
,
0
.30
);
}
.poster
{
width
:
558rpx
;
height
:
1108rpx
;
border-radius
:
8rpx
;
}
}
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/CrowdfundPoster/CrowdfundPoster.wxml
0 → 100644
View file @
f94dea5
<block wx:if="{{show}}">
<view class="layout">
<view class="bg" bindtap="hide"></view>
<image src="{{poster}}" class="poster"></image>
</view>
</block>
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
View file @
f94dea5
...
@@ -132,6 +132,12 @@ Component({
...
@@ -132,6 +132,12 @@ Component({
}
}
})
})
})
})
},
download
(
e
){
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
posterItem
:
item
})
}
}
}
}
})
})
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.json
View file @
f94dea5
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"crowdfund-poster"
:
"../CrowdfundPoster/CrowdfundPoster"
}
}
}
\ No newline at end of file
\ No newline at end of file
packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml
View file @
f94dea5
...
@@ -12,7 +12,8 @@
...
@@ -12,7 +12,8 @@
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head">
<view class="head">
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="text-hide head-title">{{item.activityName}}</view>
<view class="head-link" bindtap="handleCopy" data-idx="{{index}}">复制活动链接</view>
<view class="head-link" bindtap="download" data-item="{{item}}">下载海报</view>
<!-- <view class="head-link" bindtap="handleCopy" data-idx="{{index}}">复制活动链接</view> -->
</view>
</view>
<view class="content">
<view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx">
...
@@ -67,4 +68,5 @@
...
@@ -67,4 +68,5 @@
</view>
</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
\ No newline at end of file
</view>
<crowdfund-poster item="{{posterItem}}" />
\ No newline at end of file
\ No newline at end of file
utils/Draw.js
View file @
f94dea5
...
@@ -16,7 +16,7 @@ class Draw {
...
@@ -16,7 +16,7 @@ class Draw {
type
:
'2d'
,
type
:
'2d'
,
width
,
width
,
height
,
height
,
compInst
:
isCompInst
compInst
:
isCompInst
}),
}),
ctx
=
canvas
.
getContext
(
'2d'
)
ctx
=
canvas
.
getContext
(
'2d'
)
this
[
_canvas_
]
=
canvas
this
[
_canvas_
]
=
canvas
...
@@ -65,6 +65,13 @@ class Draw {
...
@@ -65,6 +65,13 @@ class Draw {
if
(
callback
)
callback
()
if
(
callback
)
callback
()
resolve
(
imageParams
)
resolve
(
imageParams
)
}
}
image
.
onerror
=
err
=>
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'图片加载失败'
,
icon
:
'error'
})
}
})
})
}
}
toRpx
(
val
)
{
toRpx
(
val
)
{
...
...
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