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 36bc6298
authored
Oct 31, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
代码提交
1 parent
083a4c9c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
116 additions
and
81 deletions
app.js
components/CrowdfundPoster/CrowdfundPoster.scss
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.js
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.scss
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.wxml
pages/tab/index/index.js
app.js
View file @
36bc629
// app.js
// app.js
import
*
as
Sentry
from
'./utils/lib/sentry-miniapp'
import
*
as
Sentry
from
'./utils/lib/sentry-miniapp'
// accountInfo.miniProgram.envVersion == 'release' &&
// accountInfo.miniProgram.envVersion == 'release' &&
Sentry
.
init
({
const
accountInfo
=
wx
.
getAccountInfoSync
()
//测试和生产才开发sentry
const
env
=
[
'trial'
,
'release'
]
env
.
includes
(
accountInfo
.
miniProgram
.
envVersion
)
&&
Sentry
.
init
({
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
// dsn: 'http://ebcf31c417cc4ce185782f046e4a87a2@sentry.glsx.com.cn/5'
dsn
:
'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
dsn
:
'https://59c3cfc3ffb84ed68fc0dda26fb09e12@sentry.glsx.com.cn/30'
})
})
...
...
components/CrowdfundPoster/CrowdfundPoster.scss
View file @
36bc629
...
@@ -31,7 +31,8 @@
...
@@ -31,7 +31,8 @@
width
:
320rpx
;
width
:
320rpx
;
height
:
88rpx
;
height
:
88rpx
;
line-height
:
88rpx
;
line-height
:
88rpx
;
background-image
:
linear-gradient
(
-60deg
,
#556AF5
0%
,
#7197FF
100%
);
background
:
#3666FE
;
// background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius
:
16rpx
;
border-radius
:
16rpx
;
font-weight
:
500
;
font-weight
:
500
;
font-size
:
32rpx
;
font-size
:
32rpx
;
...
...
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.js
View file @
36bc629
...
@@ -37,7 +37,7 @@ Component({
...
@@ -37,7 +37,7 @@ Component({
})
})
},
},
async
init
(
n
,
ImgWidth
,
ImgHeight
)
{
async
init
(
n
,
ImgWidth
,
ImgHeight
)
{
let
proportion
=
ImgWidth
/
2
47
let
proportion
=
ImgWidth
/
2
79
let
actualHeight
=
ImgHeight
/
proportion
let
actualHeight
=
ImgHeight
/
proportion
console
.
log
(
actualHeight
)
console
.
log
(
actualHeight
)
wx
.
$api
.
showLoading
()
wx
.
$api
.
showLoading
()
...
@@ -46,7 +46,7 @@ Component({
...
@@ -46,7 +46,7 @@ Component({
{
{
width
:
279
,
width
:
279
,
// height: 554
// height: 554
height
:
82
+
actualHeight
height
:
actualHeight
},
},
this
this
),
),
...
@@ -54,55 +54,55 @@ Component({
...
@@ -54,55 +54,55 @@ Component({
merchantName
=
userInfo
.
merchantName
.
length
>
12
?
`
${
userInfo
.
merchantName
.
substring
(
0
,
12
)}
...`
:
userInfo
.
merchantName
,
merchantName
=
userInfo
.
merchantName
.
length
>
12
?
`
${
userInfo
.
merchantName
.
substring
(
0
,
12
)}
...`
:
userInfo
.
merchantName
,
res
=
await
drawfun
.
begin
({
res
=
await
drawfun
.
begin
({
imageList
:
[
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
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
width
:
279
,
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
,
height
:
actualHeight
,
url
:
n
.
posterUrl
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
}
}
]
]
// 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
// }
// }
// ]
})
})
console
.
log
(
res
)
console
.
log
(
res
)
wx
.
hideLoading
()
wx
.
hideLoading
()
...
...
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.scss
View file @
36bc629
...
@@ -19,11 +19,32 @@
...
@@ -19,11 +19,32 @@
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
{
height
:
calc
(
100%
-
64rpx
);
overflow
:
scroll
;
}
.poster
{
.poster
{
background-color
:
#fff
;
box-sizing
:
border-box
;
// 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
;
}
}
...
@@ -31,7 +52,8 @@
...
@@ -31,7 +52,8 @@
width
:
320rpx
;
width
:
320rpx
;
height
:
88rpx
;
height
:
88rpx
;
line-height
:
88rpx
;
line-height
:
88rpx
;
background-image
:
linear-gradient
(
-60deg
,
#556AF5
0%
,
#7197FF
100%
);
background
:
#3666FE
;
// background-image: linear-gradient(-60deg, #556AF5 0%, #7197FF 100%);
border-radius
:
16rpx
;
border-radius
:
16rpx
;
font-weight
:
500
;
font-weight
:
500
;
font-size
:
32rpx
;
font-size
:
32rpx
;
...
...
pages/tab/index/components/CrowdfundPoster/CrowdfundPoster.wxml
View file @
36bc629
...
@@ -3,7 +3,10 @@
...
@@ -3,7 +3,10 @@
<!-- catchtouchmove="noScroll" -->
<!-- catchtouchmove="noScroll" -->
<view class="bg" bindtap="hide" />
<view class="bg" bindtap="hide" />
<view class="poster">
<view class="poster">
<image src="{{poster}}" mode="widthFix" />
<view class="titleTime">最近更新时间 {{item.updatedTime}}</view>
<view class="imgCon" catchtouchmove="noScroll">
<image src="{{poster}}" mode="widthFix" />
</view>
</view>
</view>
<view class="btn" bindtap="download">下载图片并转发</view>
<view class="btn" bindtap="download">下载图片并转发</view>
<!-- <view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view> -->
<!-- <view class="tips">提示:这是您的专属活动海报,请下载转发给门店员工注册并参与活动分享。请不要将此海报转发给非相关活动参与者,避免活动数据泄漏。</view> -->
...
...
pages/tab/index/index.js
View file @
36bc629
...
@@ -98,7 +98,7 @@ Page({
...
@@ -98,7 +98,7 @@ Page({
cluePageSize
:
1000
,
cluePageSize
:
1000
,
clueCurrentPage
:
1
,
clueCurrentPage
:
1
,
disLikeFlag
:
true
,
disLikeFlag
:
true
,
clueParams
:{}
//看线索参数
clueParams
:
{}
//看线索参数
},
},
//引导图
//引导图
...
@@ -527,14 +527,14 @@ Page({
...
@@ -527,14 +527,14 @@ Page({
this
.
getTagApi
(
params
)
this
.
getTagApi
(
params
)
},
},
//看线索重置
//看线索重置
resetCluelist
(){
resetCluelist
()
{
let
{
typeList
}
=
this
.
data
let
{
typeList
}
=
this
.
data
typeList
.
forEach
(
item
=>
{
typeList
.
forEach
(
item
=>
{
item
.
selectIndex
=
2
item
.
selectIndex
=
2
})
})
this
.
setData
({
this
.
setData
({
typeList
,
typeList
,
clueParams
:{}
clueParams
:
{}
})
})
//重置数据
//重置数据
this
.
clearclueData
()
this
.
clearclueData
()
...
@@ -542,7 +542,6 @@ Page({
...
@@ -542,7 +542,6 @@ Page({
},
},
filterTypeFn
(
e
)
{
filterTypeFn
(
e
)
{
let
{
typeList
}
=
this
.
data
let
{
typeList
}
=
this
.
data
let
index
=
e
.
currentTarget
.
dataset
.
index
let
index
=
e
.
currentTarget
.
dataset
.
index
// 重置筛选
// 重置筛选
...
@@ -556,8 +555,8 @@ Page({
...
@@ -556,8 +555,8 @@ Page({
wx
.
pro
.
showActionSheet
({
wx
.
pro
.
showActionSheet
({
itemList
,
itemList
,
success
(
res
)
{
success
(
res
)
{
//重置数据
//重置数据
_this
.
clearclueData
()
_this
.
clearclueData
()
// 选中全部
// 选中全部
let
selectIndex
=
res
.
tapIndex
let
selectIndex
=
res
.
tapIndex
...
@@ -579,7 +578,7 @@ Page({
...
@@ -579,7 +578,7 @@ Page({
},
{})
},
{})
console
.
log
(
params
)
console
.
log
(
params
)
// 清空数据
// 清空数据
_this
.
setData
({
typeList
,
clueParams
:
params
})
_this
.
setData
({
typeList
,
clueParams
:
params
})
_this
.
getPageApi
(
params
)
_this
.
getPageApi
(
params
)
},
},
fail
(
res
)
{
fail
(
res
)
{
...
@@ -588,10 +587,10 @@ Page({
...
@@ -588,10 +587,10 @@ Page({
})
})
},
},
//重置数据
//重置数据
clearclueData
(){
clearclueData
()
{
this
.
setData
({
this
.
setData
({
clueList
:[],
clueList
:
[],
clueCurrentPage
:
1
,
clueCurrentPage
:
1
// hasPhone: '',
// hasPhone: '',
// starTag: '',
// starTag: '',
// clueSource: '',
// clueSource: '',
...
@@ -624,17 +623,15 @@ Page({
...
@@ -624,17 +623,15 @@ Page({
},
},
//获取浏览线索数据列表
//获取浏览线索数据列表
async
getPageApi
(
param
)
{
async
getPageApi
(
param
)
{
let
{
cluePageSize
,
clueCurrentPage
,
clueList
}
=
this
.
data
let
{
cluePageSize
,
clueCurrentPage
,
clueList
}
=
this
.
data
let
params
=
{
let
params
=
{
pageSize
:
cluePageSize
,
pageSize
:
cluePageSize
,
currentPage
:
clueCurrentPage
,
currentPage
:
clueCurrentPage
,
...
param
,
...
param
}
}
let
{
code
,
data
}
=
await
pageApi
(
params
)
let
{
code
,
data
}
=
await
pageApi
(
params
)
if
(
code
==
0
)
{
if
(
code
==
0
)
{
let
arr
=
data
.
list
.
map
(
item
=>
{
let
arr
=
data
.
list
.
map
(
item
=>
{
if
(
item
.
visitList
.
length
>
5
)
{
if
(
item
.
visitList
.
length
>
5
)
{
item
.
getMoreFlag
=
true
item
.
getMoreFlag
=
true
}
}
...
@@ -645,9 +642,9 @@ Page({
...
@@ -645,9 +642,9 @@ Page({
// let concatArr = []
// let concatArr = []
// if(arr.length > 0) {
// if(arr.length > 0) {
// concatArr = clueList.concat(arr)
// concatArr = clueList.concat(arr)
// }
// }
this
.
setData
({
this
.
setData
({
clueList
:
arr
clueList
:
arr
})
})
...
@@ -659,19 +656,17 @@ Page({
...
@@ -659,19 +656,17 @@ Page({
},
},
//喜欢收藏功能
//喜欢收藏功能
async
getTagApi
(
param
)
{
async
getTagApi
(
param
)
{
let
{
clueParams
}
=
this
.
data
let
{
clueParams
}
=
this
.
data
let
res
=
await
tagApi
(
param
)
let
res
=
await
tagApi
(
param
)
console
.
log
(
'res: '
,
res
)
console
.
log
(
'res: '
,
res
)
if
(
res
.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
let
clueListPamas
=
{
let
clueListPamas
=
{
...
param
,
...
param
,
...
clueParams
...
clueParams
}
}
this
.
getPageApi
(
clueListPamas
)
this
.
getPageApi
(
clueListPamas
)
}
}
},
},
onReachBottom
()
{
onReachBottom
()
{
console
.
log
(
'滑到底部了'
)
console
.
log
(
'滑到底部了'
)
...
@@ -682,15 +677,26 @@ Page({
...
@@ -682,15 +677,26 @@ Page({
.
then
(
result
=>
{
.
then
(
result
=>
{
// console.log(result)
// console.log(result)
// 为2是已经展示过了
// 为2是已经展示过了
// if (result.status && result.status != 2) {
if
(
result
.
status
&&
result
.
status
!=
2
)
{
// debugger
let
time
=
result
.
updatedTime
.
split
(
' '
)
let
moth
=
time
[
0
].
split
(
'-'
)
let
hour
=
time
[
1
].
split
(
':'
)
moth
.
shift
()
hour
=
hour
.
slice
(
0
,
-
1
)
moth
=
moth
.
join
(
'-'
)
hour
=
hour
.
join
(
':'
)
let
updatedTime
=
`
${
moth
}
${
hour
}
`
console
.
log
(
updatedTime
)
this
.
setData
({
this
.
setData
({
posterItem
:
{
posterItem
:
{
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
}
}
})
})
//
}
}
})
})
.
catch
(
err
=>
{})
.
catch
(
err
=>
{})
},
},
...
@@ -708,7 +714,7 @@ Page({
...
@@ -708,7 +714,7 @@ Page({
gaptime
=
200
gaptime
=
200
}
}
let
_lastTime
=
null
let
_lastTime
=
null
return
function
()
{
return
function
()
{
let
_nowTime
=
+
new
Date
()
let
_nowTime
=
+
new
Date
()
if
(
_nowTime
-
_lastTime
>
gaptime
||
!
_lastTime
)
{
if
(
_nowTime
-
_lastTime
>
gaptime
||
!
_lastTime
)
{
fn
.
apply
(
this
,
arguments
)
fn
.
apply
(
this
,
arguments
)
...
@@ -729,16 +735,16 @@ Page({
...
@@ -729,16 +735,16 @@ Page({
}
}
})(),
})(),
// 上拉刷新
// 上拉刷新
scrolltolowerFn
(){
scrolltolowerFn
()
{
console
.
log
(
'scrolltolowerFn: '
)
;
console
.
log
(
'scrolltolowerFn: '
)
let
{
clueCurrentPage
,
clueParams
}
=
this
.
data
let
{
clueCurrentPage
,
clueParams
}
=
this
.
data
console
.
log
(
'clueCurrentPage: '
,
clueCurrentPage
)
;
console
.
log
(
'clueCurrentPage: '
,
clueCurrentPage
)
let
params
=
{
let
params
=
{
...
clueParams
,
...
clueParams
,
clueCurrentPage
:
clueCurrentPage
++
clueCurrentPage
:
clueCurrentPage
++
}
}
this
.
setData
({
this
.
setData
({
clueCurrentPage
clueCurrentPage
})
})
...
@@ -759,7 +765,7 @@ Page({
...
@@ -759,7 +765,7 @@ Page({
*/
*/
onPullDownRefresh
:
function
()
{
onPullDownRefresh
:
function
()
{
// console.log('onPullDownRefresh: ');
// console.log('onPullDownRefresh: ');
let
{
clueParams
}
=
this
.
data
let
{
clueParams
}
=
this
.
data
this
.
getClueInit
(
clueParams
)
this
.
getClueInit
(
clueParams
)
// this.resetCluelist()
// this.resetCluelist()
// this.onLoad()
// this.onLoad()
...
...
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