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