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 99e908be
authored
Nov 17, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
第一轮bug修复
1 parent
893fdbca
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
283 additions
and
271 deletions
components/CrowdfundPoster/CrowdfundPoster.js
components/CrowdfundPoster/CrowdfundPoster.scss
components/CrowdfundPoster/CrowdfundPoster.wxml
login/index/components/Box/Box.js
packagesList/apply/pages/apply.js
packagesList/mineDetail/pages/customerManagement.js
packagesList/mineDetail/pages/customerManagement.scss
packagesList/mineDetail/pages/customerManagement.wxml
packagesList/mineDetail/pages/messageBox.js
packagesList/mineDetail/pages/messageBox.wxml
packagesList/packageOutput/pages/openBusiness.js
packagesList/pages/apply.js
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.scss
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.wxml
pages/tab/index/components/indexClue/indexClue.js
pages/tab/index/index.js
pages/tab/index/index.json
pages/tab/index/index.scss
pages/tab/index/index.wxml
pages/tab/output/components/client/client.js
pages/tab/output/components/merchant/mrechant.js
project.private.config.json
utils/Draw.js
components/CrowdfundPoster/CrowdfundPoster.js
View file @
99e908b
...
@@ -9,13 +9,16 @@ Component({
...
@@ -9,13 +9,16 @@ Component({
item
:
{
item
:
{
type
:
Object
,
type
:
Object
,
observer
(
n
)
{
observer
(
n
)
{
this
.
check
(
n
).
then
(
res
=>
{
this
.
check
(
n
)
if
(
res
)
this
.
setData
({
.
then
(
res
=>
{
if
(
res
)
this
.
setData
({
poster
:
res
,
poster
:
res
,
show
:
true
show
:
true
})
})
else
this
.
begin
()
else
this
.
begin
()
}).
catch
(()
=>
this
.
begin
())
})
.
catch
(()
=>
this
.
begin
())
}
}
},
},
findKey
:
{
findKey
:
{
...
@@ -40,9 +43,7 @@ Component({
...
@@ -40,9 +43,7 @@ Component({
*/
*/
methods
:
{
methods
:
{
begin
()
{
begin
()
{
let
{
let
{
item
}
=
this
.
data
item
}
=
this
.
data
item
.
posterUrl
&&
this
.
getImageInfo
(
item
)
item
.
posterUrl
&&
this
.
getImageInfo
(
item
)
},
},
check
(
n
)
{
check
(
n
)
{
...
@@ -51,16 +52,12 @@ Component({
...
@@ -51,16 +52,12 @@ Component({
})
})
const
fileList
=
wx
.
$storage
.
get
(
'fileList'
)
||
[],
const
fileList
=
wx
.
$storage
.
get
(
'fileList'
)
||
[],
fn
=
wx
.
getFileSystemManager
(),
fn
=
wx
.
getFileSystemManager
(),
{
{
findKey
}
=
this
.
data
findKey
}
=
this
.
data
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
fileList
.
length
)
{
if
(
fileList
.
length
)
{
fn
.
readdir
({
fn
.
readdir
({
dirPath
:
wx
.
env
.
USER_DATA_PATH
,
dirPath
:
wx
.
env
.
USER_DATA_PATH
,
success
({
success
({
files
})
{
files
})
{
console
.
log
(
files
,
'文件列表'
)
console
.
log
(
files
,
'文件列表'
)
if
(
files
.
length
<
21
)
{
if
(
files
.
length
<
21
)
{
let
item
=
fileList
.
find
(
e
=>
e
[
findKey
]
===
n
[
findKey
])
let
item
=
fileList
.
find
(
e
=>
e
[
findKey
]
===
n
[
findKey
])
...
@@ -84,7 +81,8 @@ Component({
...
@@ -84,7 +81,8 @@ Component({
}
else
reject
()
}
else
reject
()
})
})
},
},
getImageInfo
(
n
,
width
,
height
)
{
getImageInfo
(
n
)
{
console
.
log
(
n
)
wx
.
$api
.
showLoading
(
'处理中'
)
wx
.
$api
.
showLoading
(
'处理中'
)
let
that
=
this
let
that
=
this
wx
.
getImageInfo
({
wx
.
getImageInfo
({
...
@@ -102,26 +100,37 @@ Component({
...
@@ -102,26 +100,37 @@ Component({
})
})
},
},
async
init
(
n
,
ImgWidth
,
ImgHeight
)
{
async
init
(
n
,
ImgWidth
,
ImgHeight
)
{
let
proportion
=
ImgWidth
/
247
// debugger
let
actualHeight
=
ImgHeight
/
proportion
// const {pixelRatio} = wx.getWindowInfo()
console
.
log
(
actualHeight
)
let
actualWidth
=
247
//默认宽度
let
canvasHeight
=
1959
//最大高度
let
proportion
=
ImgWidth
/
actualWidth
//图片实例化对应的比例
let
actualHeight
=
ImgHeight
/
proportion
//实际高度
// 解决 createOffscreenCanvas 最大高度不能超过4096的问题
// 这个 pixelRatio 不写是默认两倍 需转换计算
if
(
actualHeight
>
canvasHeight
)
{
actualWidth
=
actualWidth
/
(
actualHeight
/
canvasHeight
)
actualHeight
=
canvasHeight
}
// console.log(actualHeight)
n
.
activityName
=
n
.
activityName
.
length
>
12
?
`
${
n
.
activityName
.
substring
(
0
,
12
)}
...`
:
n
.
activityName
n
.
activityName
=
n
.
activityName
.
length
>
12
?
`
${
n
.
activityName
.
substring
(
0
,
12
)}
...`
:
n
.
activityName
const
drawfun
=
new
Draw
(
{
const
drawfun
=
new
Draw
(
// 大画布
width
:
279
,
{
// height: 554
// height: 554
height
:
82
+
actualHeight
width
:
actualWidth
+
32
,
height
:
actualHeight
+
82
// pixelRatio
},
},
this
this
),
),
{
{
userInfo
}
=
wx
.
$storage
.
get
(),
userInfo
}
=
wx
.
$storage
.
get
(),
merchantName
=
userInfo
.
merchantName
.
length
>
12
?
`
${
userInfo
.
merchantName
.
substring
(
0
,
12
)}
...`
:
userInfo
.
merchantName
,
merchantName
=
userInfo
.
merchantName
.
length
>
12
?
`
${
userInfo
.
merchantName
.
substring
(
0
,
12
)}
...`
:
userInfo
.
merchantName
,
{
findKey
}
=
this
.
data
let
imageList
=
[
{
{
findKey
}
=
this
.
data
,
res
=
await
drawfun
.
begin
({
imageList
:
[{
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
width
:
279
,
width
:
279
,
...
@@ -131,12 +140,13 @@ Component({
...
@@ -131,12 +140,13 @@ Component({
{
{
x
:
16
,
x
:
16
,
y
:
70
,
y
:
70
,
width
:
247
,
width
:
actualWidth
,
height
:
actualHeight
,
height
:
actualHeight
,
url
:
n
.
posterUrl
url
:
n
.
posterUrl
}
}
],
]
textList
:
[{
let
textList
=
[
{
x
:
12
,
x
:
12
,
y
:
14
,
y
:
14
,
fontSize
:
14
,
fontSize
:
14
,
...
@@ -169,6 +179,21 @@ Component({
...
@@ -169,6 +179,21 @@ Component({
}
}
}
}
]
]
if
((
n
.
type
=
'warReport'
))
{
imageList
=
[
{
x
:
0
,
y
:
0
,
width
:
actualWidth
+
32
,
height
:
actualHeight
+
82
,
url
:
n
.
posterUrl
}
]
textList
=
[]
}
let
res
=
await
drawfun
.
begin
({
imageList
,
textList
})
})
console
.
log
(
res
)
console
.
log
(
res
)
wx
.
hideLoading
()
wx
.
hideLoading
()
...
@@ -211,9 +236,7 @@ Component({
...
@@ -211,9 +236,7 @@ Component({
})
})
},
},
longpress
()
{
longpress
()
{
let
{
let
{
_item_
}
=
this
.
data
_item_
}
=
this
.
data
this
.
triggerEvent
(
'longtouch'
,
_item_
)
this
.
triggerEvent
(
'longtouch'
,
_item_
)
}
}
}
}
...
...
components/CrowdfundPoster/CrowdfundPoster.scss
View file @
99e908b
...
@@ -18,17 +18,23 @@
...
@@ -18,17 +18,23 @@
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
z-index
:
-1
;
z-index
:
-1
;
background
:
rgba
(
0
,
0
,
0
,
.
8
);
background
:
rgba
(
0
,
0
,
0
,
.8
);
}
}
.poster
{
.poster
{
box-sizing
:
border-box
;
width
:
500rpx
;
width
:
500rpx
;
height
:
68%
;
height
:
68%
;
// height: 1108rpx;
// height: 1108rpx;
overflow
:
scroll
;
overflow
:
scroll
;
border-radius
:
8rpx
8rpx
0
0
;
border-radius
:
8rpx
8rpx
0
0
;
}
.pd
{
padding
:
32rpx
;
background-color
:
#fff
;
}
}
.btn
{
.btn
{
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
...
@@ -41,6 +47,7 @@
...
@@ -41,6 +47,7 @@
font-size
:
32rpx
;
font-size
:
32rpx
;
color
:
#3666FE
;
color
:
#3666FE
;
margin-top
:
-2rpx
;
margin-top
:
-2rpx
;
.icon
{
.icon
{
width
:
40rpx
;
width
:
40rpx
;
height
:
40rpx
;
height
:
40rpx
;
...
@@ -53,9 +60,22 @@
...
@@ -53,9 +60,22 @@
font-size
:
24rpx
;
font-size
:
24rpx
;
color
:
#FFFFFF
;
color
:
#FFFFFF
;
line-height
:
36rpx
;
line-height
:
36rpx
;
.underline
{
.underline
{
font-weight
:
600
;
font-weight
:
600
;
text-decoration
:
underline
;
text-decoration
:
underline
;
}
}
}
}
}
}
.titleTime
{
height
:
64rpx
;
line-height
:
64rpx
;
width
:
100%
;
// background-color: rgba(54, 102, 254, 0.08);
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
24rpx
;
color
:
#fff
;
text-align
:
center
;
}
\ No newline at end of file
\ No newline at end of file
components/CrowdfundPoster/CrowdfundPoster.wxml
View file @
99e908b
<block wx:if="{{show}}">
<block wx:if="{{show}}">
<!--
catchtouchmove="noScroll" -->
<!-- catchtouchmove="noScroll"
catchtouchmove="noScroll" -->
<view class="layout">
<view class="layout">
<view class="bg" bindtap="hide" />
<view class="bg" bindtap="hide" />
<block wx:if="{{scrollImg}}">
<block wx:if="{{scrollImg}}">
<view class="poster">
<view class="poster {{item.type == 'warReport'?'pd':''}}">
<!-- <scroll-view scroll-x="false" scroll-y="true" style="height: 100%"> -->
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<image src="{{poster}}" mode="widthFix" show-menu-by-longpress />
<image
<!-- </scroll-view> -->
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
bindlongpress="longpress" />
</scroll-view>
</view>
</view>
</block>
</block>
<block wx:else>
<block wx:else>
<image src="{{poster}}" class="poster" mode="widthFix" show-menu-by-longpress bindlongpress="longpress" />
<view class="poster {{item.type == 'warReport'?'pd':''}}">
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<image
src="{{poster}}"
class="poster"
mode="widthFix"
show-menu-by-longpress
bindlongpress="longpress" />
</scroll-view>
</view>
</block>
</block>
<view class="btn">
<view class="btn">
<glsx-image src="output/longtap.png" class="icon"></glsx-image
>
<glsx-image src="output/longtap.png" class="icon" /
>
长按图片转发
长按图片转发
</view>
</view>
<view class="tips">温馨提示:您可以转发到门店群,门店员工通过扫描海报二维码可以注册登录 <text class="underline">门店助手</text> 小程序,执行活动任务,转发活动链接促成订单。</view>
<view wx:if="{{item.type == 'warReport'}}" class="titleTime">最近更新时间: {{item.updatedTime}}</view>
<view wx:else class="tips">
温馨提示:您可以转发到门店群,门店员工通过扫描海报二维码可以注册登录
<text class="underline">门店助手</text>
小程序,执行活动任务,转发活动链接促成订单。
</view>
</view>
</view>
</block>
</block>
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
<!-- <authorize scopeType="writePhotosAlbum" bindfail="authFail" show="{{showAuth}}" isShowCheck="{{false}}" id="auth" /> -->
login/index/components/Box/Box.js
View file @
99e908b
// login/index/components/LoginBox.js
// login/index/components/LoginBox.js
import
USERAPI
from
'~/api/usersApi/index'
import
USERAPI
from
'~/api/usersApi/index'
import
{
import
{
checkLoginUserInfo
,
setLoginInfo
,
loginModal
}
from
'~/login/lib/index'
checkLoginUserInfo
,
setLoginInfo
,
loginModal
}
from
'~/login/lib/index'
import
md5
from
'~/utils/lib/md5'
import
md5
from
'~/utils/lib/md5'
import
network
from
'~/utils/network'
import
network
from
'~/utils/network'
import
{
import
{
imgUrlMixin
}
from
'~/mixins/index'
imgUrlMixin
}
from
'~/mixins/index'
let
thisPage
let
thisPage
Component
({
Component
({
behaviors
:
[
imgUrlMixin
],
behaviors
:
[
imgUrlMixin
],
...
@@ -32,6 +26,8 @@ Component({
...
@@ -32,6 +26,8 @@ Component({
code
:
''
,
code
:
''
,
account
:
''
,
account
:
''
,
password
:
''
password
:
''
// account: 'bb123456',
// password: 'bb123456'
},
},
phoneReady
:
false
,
phoneReady
:
false
,
countDown
:
null
countDown
:
null
...
@@ -49,11 +45,8 @@ Component({
...
@@ -49,11 +45,8 @@ Component({
},
},
/**输入回调 */
/**输入回调 */
input
(
e
)
{
input
(
e
)
{
const
{
const
{
value
}
=
e
.
detail
,
value
{
name
}
=
e
.
currentTarget
.
dataset
}
=
e
.
detail
,
{
name
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
this
.
setData
({
[
`formData.
${
name
}
`
]:
value
[
`formData.
${
name
}
`
]:
value
})
})
...
@@ -66,9 +59,7 @@ Component({
...
@@ -66,9 +59,7 @@ Component({
},
},
/**清除input value */
/**清除input value */
clear
(
e
)
{
clear
(
e
)
{
const
{
const
{
name
}
=
e
.
currentTarget
.
dataset
name
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
this
.
setData
({
[
`formData.
${
name
}
`
]:
''
[
`formData.
${
name
}
`
]:
''
})
})
...
@@ -77,21 +68,14 @@ Component({
...
@@ -77,21 +68,14 @@ Component({
},
},
/**获取验证码 */
/**获取验证码 */
getSmsCode
()
{
getSmsCode
()
{
const
{
const
{
phoneReady
,
formData
,
count
}
=
this
.
data
,
phoneReady
,
formData
,
count
}
=
this
.
data
,
countDown
=
60
countDown
=
60
if
(
!
phoneReady
||
count
)
return
if
(
!
phoneReady
||
count
)
return
this
.
setData
({
this
.
setData
({
smsLoading
:
true
smsLoading
:
true
})
})
USERAPI
.
getSmsCode
(
formData
.
phone
)
USERAPI
.
getSmsCode
(
formData
.
phone
)
.
then
(({
.
then
(({
code
,
message
})
=>
{
code
,
message
})
=>
{
this
.
setData
({
this
.
setData
({
smsLoading
:
false
smsLoading
:
false
})
})
...
@@ -112,9 +96,7 @@ Component({
...
@@ -112,9 +96,7 @@ Component({
count
:
countDown
count
:
countDown
})
})
setTimeout
(()
=>
{
setTimeout
(()
=>
{
let
{
let
{
count
}
=
this
.
data
count
}
=
this
.
data
this
.
setData
({
this
.
setData
({
count
:
--
count
count
:
--
count
})
})
...
@@ -127,13 +109,11 @@ Component({
...
@@ -127,13 +109,11 @@ Component({
},
},
/**检查输入框内容 */
/**检查输入框内容 */
checkFormData
()
{
checkFormData
()
{
const
{
const
{
loginType
,
formData
}
=
this
.
data
loginType
,
formData
}
=
this
.
data
if
(
loginType
!=
0
)
{
if
(
loginType
!=
0
)
{
if
(
loginType
==
1
)
{
if
(
loginType
==
1
)
{
this
.
setData
({
this
.
setData
(
{
phoneReady
:
formData
.
phone
&&
thisPage
.
validate
.
methods
.
tel
(
formData
.
phone
)
phoneReady
:
formData
.
phone
&&
thisPage
.
validate
.
methods
.
tel
(
formData
.
phone
)
},
},
()
=>
{
()
=>
{
...
@@ -151,39 +131,30 @@ Component({
...
@@ -151,39 +131,30 @@ Component({
},
},
/**手机号&帐号密码登录 */
/**手机号&帐号密码登录 */
login
()
{
login
()
{
const
{
const
{
formData
,
loginType
}
=
this
.
data
,
formData
,
loginType
}
=
this
.
data
,
target
=
{
target
=
{
1
:
'phoneSmsLogin'
,
1
:
'phoneSmsLogin'
,
2
:
'accountLogin'
2
:
'accountLogin'
}
[
loginType
],
}[
loginType
],
obj
=
obj
=
loginType
==
1
?
{
loginType
==
1
?
{
mobile
:
formData
.
phone
,
mobile
:
formData
.
phone
,
code
:
formData
.
code
code
:
formData
.
code
}
:
{
}
:
{
userName
:
formData
.
account
,
userName
:
formData
.
account
,
password
:
md5
(
formData
.
password
)
password
:
md5
(
formData
.
password
)
}
}
this
.
setBtnLoading
()
this
.
setBtnLoading
()
USERAPI
[
target
](
obj
)
USERAPI
[
target
](
obj
)
.
then
(({
.
then
(({
code
,
data
,
message
})
=>
{
code
,
data
,
message
})
=>
{
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
if
(
loginType
==
1
)
checkLoginUserInfo
(
data
)
if
(
loginType
==
1
)
checkLoginUserInfo
(
data
)
else
{
else
{
const
{
const
{
autoLogin
}
=
thisPage
.
data
,
autoLogin
{
sessionId
,
loginUserInfoList
}
=
data
,
}
=
thisPage
.
data
,
{
sessionId
,
loginUserInfoList
}
=
data
,
validTime
=
3600
*
24
*
7
*
1
e3
,
validTime
=
3600
*
24
*
7
*
1
e3
,
autoLoginFailureTime
=
Date
.
now
()
+
validTime
autoLoginFailureTime
=
Date
.
now
()
+
validTime
if
(
autoLogin
&&
loginUserInfoList
[
0
])
{
if
(
autoLogin
&&
loginUserInfoList
[
0
])
{
...
@@ -209,20 +180,14 @@ Component({
...
@@ -209,20 +180,14 @@ Component({
})
})
},
},
/**微信登录 */
/**微信登录 */
wxLogin
({
wxLogin
({
detail
})
{
detail
})
{
if
(
!
detail
.
code
)
{
if
(
!
detail
.
code
)
{
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
wx
.
$api
.
showToast
(
'当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
)
return
return
}
}
this
.
setBtnLoading
()
this
.
setBtnLoading
()
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
)
USERAPI
.
authUserPhone
(
detail
,
this
.
loginToken
)
.
then
(({
.
then
(({
code
,
data
,
message
})
=>
{
code
,
data
,
message
})
=>
{
if
(
code
==
'0'
)
checkLoginUserInfo
(
data
)
if
(
code
==
'0'
)
checkLoginUserInfo
(
data
)
else
{
else
{
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
...
@@ -230,9 +195,7 @@ Component({
...
@@ -230,9 +195,7 @@ Component({
}
}
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
})
})
.
catch
(({
.
catch
(({
errMsg
})
=>
{
errMsg
})
=>
{
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
this
.
init
()
this
.
init
()
...
@@ -252,11 +215,7 @@ Component({
...
@@ -252,11 +215,7 @@ Component({
network
.
getNetworkType
()
network
.
getNetworkType
()
thisPage
=
wx
.
$router
.
getPageInstance
()
thisPage
=
wx
.
$router
.
getPageInstance
()
try
{
try
{
const
{
const
{
data
,
code
,
message
}
=
await
USERAPI
.
wxCodeLogin
()
data
,
code
,
message
}
=
await
USERAPI
.
wxCodeLogin
()
if
(
code
==
'0'
)
{
if
(
code
==
'0'
)
{
thisPage
.
setData
({
thisPage
.
setData
({
disabled
:
false
disabled
:
false
...
@@ -264,9 +223,7 @@ Component({
...
@@ -264,9 +223,7 @@ Component({
this
.
loginToken
=
data
this
.
loginToken
=
data
}
else
this
.
reLogin
(
message
)
}
else
this
.
reLogin
(
message
)
wx
.
hideLoading
()
wx
.
hideLoading
()
}
catch
({
}
catch
({
errMsg
})
{
errMsg
})
{
// console.error(errMsg)
// console.error(errMsg)
this
.
reLogin
()
this
.
reLogin
()
}
}
...
...
packagesList/apply/pages/apply.js
View file @
99e908b
...
@@ -58,6 +58,7 @@ Page({
...
@@ -58,6 +58,7 @@ Page({
baseCustomer
:
carObj
.
selNum
,
baseCustomer
:
carObj
.
selNum
,
clueId
clueId
}
}
// return wx.$api.showToast('申请成功')
// return wx.$api.showToast('申请成功')
applyApi
applyApi
.
merchantApply
(
params
)
.
merchantApply
(
params
)
...
@@ -67,7 +68,10 @@ Page({
...
@@ -67,7 +68,10 @@ Page({
wx
.
$api
.
showToast
(
'申请成功'
)
wx
.
$api
.
showToast
(
'申请成功'
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
wx
.
$router
.
back
(
page
=>
{
wx
.
$router
.
back
(
page
=>
{
page
.
getClueInit
&&
page
.
getClueInit
()
// console.log()
// console.log(node.getClueInit)
let
node
=
page
.
selectComponent
(
'#indexclue'
)
node
.
getClueInit
&&
node
.
getClueInit
()
})
})
},
1000
)
},
1000
)
}
}
...
...
packagesList/mineDetail/pages/customerManagement.js
View file @
99e908b
...
@@ -103,11 +103,11 @@ Component({
...
@@ -103,11 +103,11 @@ Component({
*/
*/
methods
:
{
methods
:
{
restPageNum
()
{
restPageNum
()
{
console
.
log
(
'restPageNum'
)
//
console.log('restPageNum')
this
.
setData
({
this
.
setData
({
pageNum
:
1
pageNum
:
1
})
})
this
.
getMerchantCustomInfoList
()
this
.
getMerchantCustomInfoList
(
'reset'
)
},
},
scrollonReachBottom
()
{
scrollonReachBottom
()
{
// console.log('scrollonReachBottom')
// console.log('scrollonReachBottom')
...
@@ -121,7 +121,7 @@ Component({
...
@@ -121,7 +121,7 @@ Component({
this
.
getMerchantCustomInfoList
()
this
.
getMerchantCustomInfoList
()
},
},
// 分页查询客户列表
// 分页查询客户列表
getMerchantCustomInfoList
()
{
getMerchantCustomInfoList
(
type
)
{
wx
.
$api
.
showLoading
(
'加载中...'
)
wx
.
$api
.
showLoading
(
'加载中...'
)
let
{
pageNum
,
pageSize
,
customerList
}
=
this
.
data
let
{
pageNum
,
pageSize
,
customerList
}
=
this
.
data
let
params
=
{
let
params
=
{
...
@@ -150,7 +150,14 @@ Component({
...
@@ -150,7 +150,14 @@ Component({
})
})
.
catch
(
err
=>
{})
.
catch
(
err
=>
{})
.
finally
(()
=>
{
.
finally
(()
=>
{
if
(
type
==
'reset'
)
{
wx
.
$api
.
showToast
({
title
:
'刷新成功'
,
icon
:
'success'
})
}
else
{
wx
.
$api
.
hideLoading
()
wx
.
$api
.
hideLoading
()
}
})
})
},
},
submit
(
data
)
{
submit
(
data
)
{
...
...
packagesList/mineDetail/pages/customerManagement.scss
View file @
99e908b
...
@@ -15,8 +15,13 @@ page {
...
@@ -15,8 +15,13 @@ page {
font-size
:
28rpx
;
font-size
:
28rpx
;
caret-color
:
#3666FE
;
caret-color
:
#3666FE
;
width
:
430rpx
;
width
:
430rpx
;
}
}
.disabled
{
// color: #333;
color
:
#a6a9ad
;
}
.customerBox
{
.customerBox
{
...
...
packagesList/mineDetail/pages/customerManagement.wxml
View file @
99e908b
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<!-- type="number" -->
<!-- type="number" -->
<input
<input
placeholder="{{item.isEdit? childItem['placeholder']:''}}"
placeholder="{{item.isEdit? childItem['placeholder']:''}}"
class="input"
class="input
{{item.isEdit&&(ind == 0|| ind == 1) ? 'disabled':''}}
"
placeholder-class="placeholder-class"
placeholder-class="placeholder-class"
maxlength="{{childItem.maxLength}}"
maxlength="{{childItem.maxLength}}"
value="{{item[childItem['key']] }}"
value="{{item[childItem['key']] }}"
...
...
packagesList/mineDetail/pages/messageBox.js
View file @
99e908b
...
@@ -85,12 +85,13 @@ Component({
...
@@ -85,12 +85,13 @@ Component({
current
:
valueurl
current
:
valueurl
})
})
},
},
downLoad
(
e
)
{
showPoster
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
const
{
item
}
=
e
.
currentTarget
.
dataset
this
.
setData
({
this
.
setData
({
posterItem
:
{
posterItem
:
{
activityName
:
item
.
activityName
,
activityName
:
item
.
activityName
,
posterUrl
:
item
.
valueUrl
posterUrl
:
item
.
valueUrl
,
crowdFundActivityId
:
item
.
valueUrl
}
}
})
})
},
},
...
@@ -105,11 +106,11 @@ Component({
...
@@ -105,11 +106,11 @@ Component({
// },
// },
async
copyLink
(
e
)
{
async
copyLink
(
e
)
{
const
{
item
}
=
e
.
currentTarget
.
dataset
,
const
{
item
}
=
e
.
currentTarget
.
dataset
,
posterObj
=
this
.
selectComponent
(
'#poster'
)
,
posterObj
=
this
.
selectComponent
(
'#poster'
)
{
options
}
=
wx
.
$router
.
getPageInstance
()
//
{ options } = wx.$router.getPageInstance()
// item.crowdFundActivityId
// item.crowdFundActivityId
console
.
log
(
options
)
//
console.log(options)
try
{
try
{
let
flag
=
await
posterObj
.
check
(
item
)
let
flag
=
await
posterObj
.
check
(
item
)
posterObj
.
setData
({
posterObj
.
setData
({
...
@@ -188,7 +189,10 @@ Component({
...
@@ -188,7 +189,10 @@ Component({
icon
:
'error'
icon
:
'error'
}
}
}
}
wx
.
$api
.
showToast
(
toastObj
[
res
])
wx
.
$api
.
showToast
({
...
toastObj
[
res
],
duration
:
1000
})
},
},
scrollonReachBottom
(
e
)
{
scrollonReachBottom
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
...
...
packagesList/mineDetail/pages/messageBox.wxml
View file @
99e908b
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
wx:if="{{item.valueUrl}}"
wx:if="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
data-valueurl="{{item.valueUrl}}"
data-item="{{item}}"
data-item="{{item}}"
bind:tap="
downLoad
">
bind:tap="
showPoster
">
战报详情
战报详情
</view>
</view>
</view>
</view>
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
<view wx:if="{{item.messageType == 1}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="cell">
<view class="label">活动名称:</view>
<view class="label">活动名称:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName
||item.productName
}}</view>
</view>
</view>
<view class="cell">
<view class="cell">
<view class="label">开始时间:</view>
<view class="label">开始时间:</view>
...
@@ -104,11 +104,11 @@
...
@@ -104,11 +104,11 @@
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="cell" wx:if="{{item.messageType == 4}}">
<view class="label">产品名称:</view>
<view class="label">产品名称:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName
||item.productName
}}</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="label">新车交付场景:</view>
<view class="value">{{item.
activity
Name}}</view>
<view class="value">{{item.
product
Name}}</view>
</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="label">0~12个月场景:</view>
...
...
packagesList/packageOutput/pages/openBusiness.js
View file @
99e908b
...
@@ -79,7 +79,10 @@ Page({
...
@@ -79,7 +79,10 @@ Page({
// wx.$api.showToast('申请成功')
// wx.$api.showToast('申请成功')
setTimeout
(()
=>
{
setTimeout
(()
=>
{
wx
.
$router
.
back
(
page
=>
{
wx
.
$router
.
back
(
page
=>
{
page
.
getClueInit
&&
page
.
getClueInit
()
let
node
=
page
.
selectComponent
(
'#indexclue'
)
// console.log(node)
node
.
getClueInit
&&
node
.
getClueInit
()
// page.getClueInit && page.getClueInit()
})
})
},
1000
)
},
1000
)
},
},
...
@@ -102,7 +105,7 @@ Page({
...
@@ -102,7 +105,7 @@ Page({
wx
.
showToast
({
wx
.
showToast
({
title
:
'提交成功'
,
title
:
'提交成功'
,
icon
:
'success'
,
icon
:
'success'
,
duration
:
3
000
,
duration
:
2
000
,
mask
:
true
,
mask
:
true
,
success
:
()
=>
{
success
:
()
=>
{
this
.
handleJump
()
this
.
handleJump
()
...
...
packagesList/pages/apply.js
View file @
99e908b
...
@@ -67,7 +67,8 @@ Page({
...
@@ -67,7 +67,8 @@ Page({
wx
.
$api
.
showToast
(
'申请成功'
)
wx
.
$api
.
showToast
(
'申请成功'
)
setTimeout
(()
=>
{
setTimeout
(()
=>
{
wx
.
$router
.
back
(
page
=>
{
wx
.
$router
.
back
(
page
=>
{
page
.
getClueInit
&&
page
.
getClueInit
()
let
node
=
page
.
selectComponent
(
'#indexclue'
)
node
.
getClueInit
&&
node
.
getClueInit
()
})
})
},
1000
)
},
1000
)
}
}
...
...
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.scss
View file @
99e908b
...
@@ -19,47 +19,72 @@
...
@@ -19,47 +19,72 @@
background
:
rgba
(
28
,
27
,
35
,
0
.60
);
background
:
rgba
(
28
,
27
,
35
,
0
.60
);
}
}
.titleTime
{
height
:
64rpx
;
line-height
:
64rpx
;
width
:
100%
;
background-color
:
rgba
(
54
,
102
,
254
,
0
.08
);
font-family
:
PingFangSC-Regular
;
font-weight
:
400
;
font-size
:
22rpx
;
color
:
#3666FE
;
text-align
:
center
;
}
.imgCon
{
.imgCon
{
height
:
calc
(
100%
-
64rpx
);
// height: calc(100% - 64rpx);
height
:
100%
;
overflow
:
scroll
;
overflow
:
scroll
;
}
}
.poster
{
.poster
{
position
:
relative
;
background-color
:
#fff
;
background-color
:
#fff
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
padding
:
32rpx
;
// padding-bottom: 10rpx;
// padding-bottom: 10rpx;
width
:
558rpx
;
width
:
558rpx
;
// height: 60%;
// height: 60%;
height
:
1108rpx
;
height
:
1108rpx
;
// overflow: scroll;
// overflow: scroll;
border-radius
:
8rpx
;
border-radius
:
8rpx
8rpx
0
0
;
&
:
:
after
{
content
:
''
;
width
:
100%
;
height
:
132rpx
;
background
:
url('https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/bgImg.webp')
no-repeat
;
background-size
:
100%
132rpx
;
position
:
absolute
;
left
:
0
;
top
:
0
;
z-index
:
-1
;
}
// bgImg.webp
}
}
// .btn {
// width: 320rpx;
// height: 88rpx;
// line-height: 88rpx;
// background: #3666FE;
// // 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;
// }
.btn
{
.btn
{
width
:
320rpx
;
display
:
flex
;
height
:
88rpx
;
align-items
:
center
;
line-height
:
88rpx
;
justify-content
:
center
;
background
:
#3666FE
;
width
:
558rpx
;
// background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
height
:
90rpx
;
border-radius
:
16rpx
;
background
:
#F7F8FA
;
border-radius
:
0
0
12rpx
12rpx
;
font-weight
:
500
;
font-weight
:
500
;
font-size
:
32rpx
;
font-size
:
32rpx
;
color
:
#FFFFFF
;
color
:
#3666FE
;
text-align
:
center
;
margin-top
:
32rpx
;
// margin-top: -2rpx;
.icon
{
width
:
40rpx
;
height
:
40rpx
;
margin-right
:
12rpx
;
}
}
}
.tips
{
.tips
{
...
...
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.wxml
View file @
99e908b
...
@@ -3,12 +3,18 @@
...
@@ -3,12 +3,18 @@
<!-- catchtouchmove="noScroll" -->
<!-- catchtouchmove="noScroll" -->
<view class="bg" bindtap="hide" />
<view class="bg" bindtap="hide" />
<view class="poster">
<view class="poster">
<view class="titleTime">最近更新时间 {{item.updatedTime}}</view>
<!-- <view class="titleTime">最近更新时间 {{item.updatedTime}}</view> -->
<view class="imgCon" catchtouchmove="noScroll">
<!-- catchtouchmove="noScroll" -->
<image src="{{poster}}" mode="widthFix" />
<view class="imgCon">
<image src="{{poster}}" mode="widthFix" show-menu-by-longpress />
</view>
</view>
</view>
<!-- <view class="btn" bindtap="download">下载图片并转发</view> -->
<view class="btn">
<glsx-image src="output/longtap.png" class="icon" />
长按图片转发
</view>
</view>
<view class="
btn" bindtap="download">下载图片并转发
</view>
<view class="
titleTime">最近更新时间: {{item.updatedTime}}
</view>
<!-- <view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view> -->
<!-- <view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view> -->
</view>
</view>
</block>
</block>
...
...
pages/tab/index/components/indexClue/indexClue.js
View file @
99e908b
This diff is collapsed.
Click to expand it.
pages/tab/index/index.js
View file @
99e908b
...
@@ -444,7 +444,8 @@ Page({
...
@@ -444,7 +444,8 @@ Page({
activityName
:
result
.
activityName
,
activityName
:
result
.
activityName
,
// posterUrl: 'https://wx.glsx.com.cn/upload/biz/587076735934271488.png'
// posterUrl: 'https://wx.glsx.com.cn/upload/biz/587076735934271488.png'
posterUrl
:
result
.
valueUrl
,
posterUrl
:
result
.
valueUrl
,
updatedTime
updatedTime
,
type
:
'warReport'
}
}
})
})
if
(
result
.
status
&&
result
.
status
!=
2
)
{
if
(
result
.
status
&&
result
.
status
!=
2
)
{
...
...
pages/tab/index/index.json
View file @
99e908b
{
{
"usingComponents"
:
{
"usingComponents"
:
{
"vas-toast"
:
"./components/likeToast/likeToast"
,
"vas-toast"
:
"./components/likeToast/likeToast"
,
"crowdfund-poster"
:
"./components/CrowdfundPoster/CrowdfundPoster"
,
"indexProduct"
:
"./components/indexProduct/indexProduct"
,
"indexProduct"
:
"./components/indexProduct/indexProduct"
,
"indexClue"
:
"./components/indexClue/indexClue"
,
"indexClue"
:
"./components/indexClue/indexClue"
,
"FullscreenVideo"
:
"../../../components/FullscreenVideo/FullscreenVideo"
"FullscreenVideo"
:
"../../../components/FullscreenVideo/FullscreenVideo"
},
},
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"onReachBottomDistance"
:
50
"onReachBottomDistance"
:
50
...
...
pages/tab/index/index.scss
View file @
99e908b
...
@@ -107,7 +107,7 @@ page {
...
@@ -107,7 +107,7 @@ page {
left
:
0
;
left
:
0
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
z-index
:
3
;
z-index
:
999
;
}
}
}
}
...
...
pages/tab/index/index.wxml
View file @
99e908b
...
@@ -19,20 +19,21 @@
...
@@ -19,20 +19,21 @@
</view>
</view>
</view>
</view>
<!-- 托客户内容 -->
<!-- 托客户内容 -->
<indexProduct wx:if="{{tabIndx == 1 }}"
<indexProduct
wx:if="{{tabIndx == 1 }}"
bindselectCar="selectCar"
bindselectCar="selectCar"
senceData="{{senceData}}"
senceData="{{senceData}}"
actNum="{{actNum}}"
actNum="{{actNum}}"
img_version="{{img_version}}"
img_version="{{img_version}}"
headerHeight="{{headerHeight}}"
headerHeight="{{headerHeight}}"
bindrefresherrefresh="refresherrefresh"></indexProduct
>
bindrefresherrefresh="refresherrefresh" /
>
<!-- 看线索内容 -->
<!-- 看线索内容 -->
<indexClue
<indexClue
id="indexclue"
wx:if="{{tabIndx == 0 }}"
wx:if="{{tabIndx == 0 }}"
headerHeight="{{headerHeight}}"
headerHeight="{{headerHeight}}"
disLikeRecordFlag="{{disLikeRecordFlag}}"
disLikeRecordFlag="{{disLikeRecordFlag}}"
bindshowToggleToast="showToggleToast"
bindshowToggleToast="showToggleToast" />
></indexClue>
</view>
</view>
<!-- 收藏、取消提示框 -->
<!-- 收藏、取消提示框 -->
<vas-toast id='toast' />
<vas-toast id='toast' />
...
@@ -101,5 +102,5 @@
...
@@ -101,5 +102,5 @@
</view>
</view>
<crowdfund-poster item="{{posterItem}}" />
<crowdfund-poster item="{{posterItem}}" />
<!-- 全屏视频组件 -->
<!-- 全屏视频组件 -->
<FullscreenVideo id="videocomp"
src="{{videoSrc}}" title="{{videoTitle}}"></FullscreenVideo
>
<FullscreenVideo id="videocomp"
src="{{videoSrc}}" title="{{videoTitle}}" /
>
pages/tab/output/components/client/client.js
View file @
99e908b
...
@@ -60,7 +60,11 @@ Component({
...
@@ -60,7 +60,11 @@ Component({
getClientApi
(
isPull
=
false
)
{
getClientApi
(
isPull
=
false
)
{
this
.
getProfit
()
this
.
getProfit
()
this
.
getList
()
this
.
getList
()
isPull
&&
wx
.
$api
.
showToast
(
'刷新成功'
)
isPull
&&
wx
.
$api
.
showToast
({
title
:
'刷新成功'
,
icon
:
'success'
})
if
(
this
.
data
.
pageObj
.
currentPage
==
1
)
{
if
(
this
.
data
.
pageObj
.
currentPage
==
1
)
{
this
.
setData
({
this
.
setData
({
scrollTop
:
0
,
scrollTop
:
0
,
...
@@ -115,7 +119,7 @@ Component({
...
@@ -115,7 +119,7 @@ Component({
// } = e.currentTarget.dataset,
// } = e.currentTarget.dataset,
console
.
log
(
item
)
console
.
log
(
item
)
const
posterObj
=
this
.
selectComponent
(
'#poster'
)
const
posterObj
=
this
.
selectComponent
(
'#poster'
)
const
{
options
}
=
wx
.
$router
.
getPageInstance
()
const
{
options
}
=
wx
.
$router
.
getPageInstance
()
console
.
log
(
options
)
console
.
log
(
options
)
try
{
try
{
let
flag
=
await
posterObj
.
check
(
item
)
let
flag
=
await
posterObj
.
check
(
item
)
...
@@ -125,15 +129,18 @@ Component({
...
@@ -125,15 +129,18 @@ Component({
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
wx
.
$api
.
showLoading
(
'加载中...'
)
wx
.
$api
.
showLoading
(
'加载中...'
)
outputApi
.
getPosterUrl
({
outputApi
.
getPosterUrl
({
id
:
item
.
activityId
id
:
item
.
activityId
}).
then
(
res
=>
{
})
.
then
(
res
=>
{
item
.
posterUrl
=
res
item
.
posterUrl
=
res
this
.
setData
({
this
.
setData
({
posterItem
:
item
,
posterItem
:
item
,
isShowTip
:
false
isShowTip
:
false
})
})
}).
catch
(()
=>
{
})
.
catch
(()
=>
{
wx
.
$api
.
showToast
(
'下载海报失败'
)
wx
.
$api
.
showToast
(
'下载海报失败'
)
})
})
}
}
...
@@ -142,9 +149,7 @@ Component({
...
@@ -142,9 +149,7 @@ Component({
async
longtouch
(
e
)
{
async
longtouch
(
e
)
{
console
.
log
(
'长按海报'
,
e
)
console
.
log
(
'长按海报'
,
e
)
this
.
onBindRefresh
()
this
.
onBindRefresh
()
let
{
let
{
activityId
}
=
e
.
detail
activityId
}
=
e
.
detail
const
res
=
await
outputApi
.
reportPosterTrack
({
const
res
=
await
outputApi
.
reportPosterTrack
({
activityId
activityId
})
})
...
...
pages/tab/output/components/merchant/mrechant.js
View file @
99e908b
...
@@ -118,7 +118,10 @@ Component({
...
@@ -118,7 +118,10 @@ Component({
this
.
setData
({
this
.
setData
({
triggered
:
false
triggered
:
false
})
})
wx
.
$api
.
showToast
(
'刷新成功'
)
wx
.
$api
.
showToast
({
title
:
'刷新成功'
,
icon
:
'success'
})
that
.
setMerchantObj
(
current
,
result
,
itemList
[
res
.
tapIndex
],
item
)
that
.
setMerchantObj
(
current
,
result
,
itemList
[
res
.
tapIndex
],
item
)
})
})
.
catch
(
err
=>
{})
.
catch
(
err
=>
{})
...
...
project.private.config.json
View file @
99e908b
{
{
"description"
:
"项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
,
"description"
:
"项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
,
"libVersion"
:
"2.2
5.0
"
,
"libVersion"
:
"2.2
7.2
"
,
"condition"
:
{
"condition"
:
{
"miniprogram"
:
{
"miniprogram"
:
{
"list"
:
[
"list"
:
[
...
...
utils/Draw.js
View file @
99e908b
...
@@ -8,17 +8,21 @@ class Draw {
...
@@ -8,17 +8,21 @@ class Draw {
[
_canvasObject_
]
=
null
;
[
_canvasObject_
]
=
null
;
[
_canvas_
]
=
null
[
_canvas_
]
=
null
constructor
(
canvasObject
,
isCompInst
)
{
constructor
(
canvasObject
,
isCompInst
)
{
//createOffscreenCanvas height最大值 4096
this
[
_canvasObject_
]
=
canvasObject
this
[
_canvasObject_
]
=
canvasObject
this
[
_pixelRatio_
]
=
canvasObject
.
pixelRatio
||
2
this
[
_pixelRatio_
]
=
canvasObject
.
pixelRatio
||
2
const
height
=
this
.
toRpx
(
canvasObject
.
height
),
const
canvasObjectHeight
=
this
.
toRpx
(
canvasObject
.
height
)
width
=
this
.
toRpx
(
canvasObject
.
width
),
let
height
=
canvasObjectHeight
,
canvas
=
wx
.
createOffscreenCanvas
({
width
=
this
.
toRpx
(
canvasObject
.
width
)
let
canvas
=
wx
.
createOffscreenCanvas
({
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
this
[
_ctx_
]
=
ctx
this
[
_ctx_
]
=
ctx
this
[
_ctx_
].
clearRect
(
0
,
0
,
width
,
height
)
this
[
_ctx_
].
clearRect
(
0
,
0
,
width
,
height
)
...
@@ -34,14 +38,7 @@ class Draw {
...
@@ -34,14 +38,7 @@ class Draw {
async
drawImages
(
imageParams
,
callback
)
{
async
drawImages
(
imageParams
,
callback
)
{
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
save
()
this
[
_ctx_
].
save
()
let
{
let
{
borderRadius
,
height
,
width
,
url
,
x
,
y
}
=
imageParams
borderRadius
,
height
,
width
,
url
,
x
,
y
}
=
imageParams
height
=
this
.
toRpx
(
height
)
height
=
this
.
toRpx
(
height
)
width
=
this
.
toRpx
(
width
)
width
=
this
.
toRpx
(
width
)
x
=
this
.
toRpx
(
x
)
x
=
this
.
toRpx
(
x
)
...
@@ -83,13 +80,7 @@ class Draw {
...
@@ -83,13 +80,7 @@ class Draw {
return
this
[
_ctx_
].
measureText
(
text
).
width
return
this
[
_ctx_
].
measureText
(
text
).
width
}
}
// 画块形状
// 画块形状
drawFill
({
drawFill
({
x
,
y
,
width
,
height
,
color
})
{
x
,
y
,
width
,
height
,
color
})
{
height
=
this
.
toRpx
(
height
)
height
=
this
.
toRpx
(
height
)
width
=
this
.
toRpx
(
width
)
width
=
this
.
toRpx
(
width
)
x
=
this
.
toRpx
(
x
)
x
=
this
.
toRpx
(
x
)
...
@@ -102,24 +93,7 @@ class Draw {
...
@@ -102,24 +93,7 @@ class Draw {
this
[
_ctx_
].
save
()
this
[
_ctx_
].
save
()
}
}
drawText
(
textParams
)
{
drawText
(
textParams
)
{
let
{
let
{
textDecoration
,
textBaseline
,
lineHeight
,
fontWeight
,
textAlign
,
textWidth
,
maxWidth
,
fontSize
,
lastFont
,
opacity
,
lineNum
,
width
,
color
,
text
,
x
,
y
}
=
textParams
,
textDecoration
,
textBaseline
,
lineHeight
,
fontWeight
,
textAlign
,
textWidth
,
maxWidth
,
fontSize
,
lastFont
,
opacity
,
lineNum
,
width
,
color
,
text
,
x
,
y
}
=
textParams
,
font
=
this
[
_ctx_
].
font
.
split
(
'px'
)[
1
]
font
=
this
[
_ctx_
].
font
.
split
(
'px'
)[
1
]
textAlign
=
textAlign
||
'left'
textAlign
=
textAlign
||
'left'
textBaseline
=
textBaseline
||
'normal'
textBaseline
=
textBaseline
||
'normal'
...
@@ -233,17 +207,7 @@ class Draw {
...
@@ -233,17 +207,7 @@ class Draw {
this
[
_ctx_
].
stroke
()
this
[
_ctx_
].
stroke
()
}
}
drawBorder
(
params
)
{
drawBorder
(
params
)
{
let
{
let
{
x
,
y
,
text
,
color
,
width
,
radius
,
opacity
,
padding
,
fontSize
}
=
params
,
x
,
y
,
text
,
color
,
width
,
radius
,
opacity
,
padding
,
fontSize
}
=
params
,
paddingX
=
0
,
paddingX
=
0
,
paddingY
=
0
paddingY
=
0
if
(
padding
&&
padding
.
length
)
{
if
(
padding
&&
padding
.
length
)
{
...
@@ -255,7 +219,8 @@ class Draw {
...
@@ -255,7 +219,8 @@ class Draw {
endX
=
this
.
toRpx
(
x
)
+
this
.
getTextWidth
(
text
)
+
paddingX
,
endX
=
this
.
toRpx
(
x
)
+
this
.
getTextWidth
(
text
)
+
paddingX
,
startY
=
this
.
toRpx
(
y
)
-
paddingY
,
startY
=
this
.
toRpx
(
y
)
-
paddingY
,
endY
=
this
.
toRpx
(
y
+
fontSize
)
+
paddingY
/
2
,
endY
=
this
.
toRpx
(
y
+
fontSize
)
+
paddingY
/
2
,
arr
=
[{
arr
=
[
{
x
:
startX
,
x
:
startX
,
y
:
startY
,
y
:
startY
,
width
:
endX
width
:
endX
...
@@ -282,7 +247,8 @@ class Draw {
...
@@ -282,7 +247,8 @@ class Draw {
this
[
_ctx_
].
lineWidth
=
width
||
this
.
toRpx
(
1
)
this
[
_ctx_
].
lineWidth
=
width
||
this
.
toRpx
(
1
)
if
(
radius
)
{
if
(
radius
)
{
radius
=
this
.
toRpx
(
radius
)
radius
=
this
.
toRpx
(
radius
)
let
arcArr
=
[{
let
arcArr
=
[
{
moveTo
:
[
startX
,
startY
+
radius
],
moveTo
:
[
startX
,
startY
+
radius
],
arcTo
:
[
startX
,
startY
,
startX
+
radius
,
startY
]
arcTo
:
[
startX
,
startY
,
startX
+
radius
,
startY
]
},
},
...
@@ -327,16 +293,7 @@ class Draw {
...
@@ -327,16 +293,7 @@ class Draw {
}
}
drawLine
(
lineParams
,
callback
)
{
drawLine
(
lineParams
,
callback
)
{
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
let
{
let
{
noTransition
,
opacity
,
startX
,
startY
,
width
,
color
,
endX
,
endY
}
=
lineParams
noTransition
,
opacity
,
startX
,
startY
,
width
,
color
,
endX
,
endY
}
=
lineParams
if
(
!
noTransition
)
{
if
(
!
noTransition
)
{
startX
=
this
.
toRpx
(
startX
)
startX
=
this
.
toRpx
(
startX
)
startY
=
this
.
toRpx
(
startY
)
startY
=
this
.
toRpx
(
startY
)
...
@@ -355,12 +312,7 @@ class Draw {
...
@@ -355,12 +312,7 @@ class Draw {
if
(
callback
)
callback
()
if
(
callback
)
callback
()
}
}
setLineY
=
params
=>
{
setLineY
=
params
=>
{
let
{
let
{
textDecoration
,
textBaseline
,
fontSize
,
y
}
=
params
textDecoration
,
textBaseline
,
fontSize
,
y
}
=
params
let
type
=
{
let
type
=
{
underline
:
{
underline
:
{
top
:
y
+
fontSize
,
top
:
y
+
fontSize
,
...
@@ -383,11 +335,7 @@ class Draw {
...
@@ -383,11 +335,7 @@ class Draw {
}
}
return
type
[
textDecoration
][
textBaseline
]
return
type
[
textDecoration
][
textBaseline
]
}
}
setLineX
({
setLineX
({
textAlign
,
text
,
x
})
{
textAlign
,
text
,
x
})
{
let
textWidth
=
this
.
getTextWidth
(
text
)
let
textWidth
=
this
.
getTextWidth
(
text
)
let
type
=
{
let
type
=
{
left
:
x
,
left
:
x
,
...
@@ -396,13 +344,7 @@ class Draw {
...
@@ -396,13 +344,7 @@ class Draw {
}
}
return
type
[
textAlign
]
return
type
[
textAlign
]
}
}
drawRadiusRect
({
drawRadiusRect
({
borderRadius
,
height
,
width
,
x
,
y
},
callBack
)
{
borderRadius
,
height
,
width
,
x
,
y
},
callBack
)
{
let
radius
=
typeof
borderRadius
===
'string'
?
((
Number
(
borderRadius
.
split
(
'%'
)[
0
])
/
100
)
*
width
)
/
2
:
borderRadius
/
2
let
radius
=
typeof
borderRadius
===
'string'
?
((
Number
(
borderRadius
.
split
(
'%'
)[
0
])
/
100
)
*
width
)
/
2
:
borderRadius
/
2
radius
=
radius
||
0
radius
=
radius
||
0
this
[
_ctx_
].
beginPath
()
this
[
_ctx_
].
beginPath
()
...
@@ -413,12 +355,7 @@ class Draw {
...
@@ -413,12 +355,7 @@ class Draw {
}
}
if
(
callBack
)
callBack
()
if
(
callBack
)
callBack
()
}
}
getFontWidth
({
getFontWidth
({
textAlign
,
fontSize
,
text
,
x
})
{
textAlign
,
fontSize
,
text
,
x
})
{
let
type
=
{
let
type
=
{
left
:
x
,
left
:
x
,
center
:
x
-
(
fontSize
*
text
.
length
)
/
2
,
center
:
x
-
(
fontSize
*
text
.
length
)
/
2
,
...
@@ -428,12 +365,7 @@ class Draw {
...
@@ -428,12 +365,7 @@ class Draw {
}
}
drawDecoration
(
params
)
{
drawDecoration
(
params
)
{
let
{
let
{
newText
,
opacity
,
y
,
x
}
=
params
newText
,
opacity
,
y
,
x
}
=
params
let
lineX
=
x
let
lineX
=
x
let
lineY
=
y
let
lineY
=
y
lineX
=
this
.
setLineX
(
params
)
lineX
=
this
.
setLineX
(
params
)
...
@@ -505,10 +437,7 @@ const checkTextDecoration = textDecoration => {
...
@@ -505,10 +437,7 @@ const checkTextDecoration = textDecoration => {
}
}
/**网络图片转成本地资源 */
/**网络图片转成本地资源 */
const
createLocalImg
=
({
const
createLocalImg
=
({
filePath
,
fileId
},
callBack
)
=>
{
filePath
,
fileId
},
callBack
)
=>
{
wx
.
getImageInfo
({
wx
.
getImageInfo
({
src
:
filePath
,
src
:
filePath
,
success
(
res
)
{
success
(
res
)
{
...
...
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