Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-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 c86ac337
authored
Oct 19, 2022
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
二维码定位
1 parent
0f35ea2d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
73 deletions
api/activityApi/ActivityApi.js
pages/checkProduct/checkProduct.js
pages/checkProduct/checkProduct.scss
pages/checkProduct/checkProduct.wxml
api/activityApi/ActivityApi.js
View file @
c86ac33
...
@@ -58,6 +58,12 @@ class ActivityApi {
...
@@ -58,6 +58,12 @@ class ActivityApi {
...
data
...
data
})
})
}
}
getActivityVisitorList
(
data
)
{
return
api
.
post
({
method
:
`scrm.api.busassistant.activity.createQrCode`
,
...
data
})
}
}
}
export
default
ActivityApi
export
default
ActivityApi
\ No newline at end of file
\ No newline at end of file
pages/checkProduct/checkProduct.js
View file @
c86ac33
...
@@ -2,6 +2,7 @@ const navStyle = "background-color: #fff";
...
@@ -2,6 +2,7 @@ const navStyle = "background-color: #fff";
import
{
senceData
}
from
"~/pages/tab/discovery/constant/data"
;
import
{
senceData
}
from
"~/pages/tab/discovery/constant/data"
;
import
Draw
from
"~/utils/Draw.js"
;
import
Draw
from
"~/utils/Draw.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
{
IMG_URL
}
from
"~/utils/constantData.js"
;
import
ActivityApi
from
'~/api/activityApi/index'
const
IMGURL
=
IMG_URL
const
IMGURL
=
IMG_URL
Page
({
Page
({
/**
/**
...
@@ -11,7 +12,7 @@ Page({
...
@@ -11,7 +12,7 @@ Page({
navStyle
,
navStyle
,
headerHeight
:
0
,
headerHeight
:
0
,
senceData
,
senceData
,
actNum
:
0
,
actNum
:
3
,
// 模态框
// 模态框
isShow
:
true
,
isShow
:
true
,
...
@@ -92,16 +93,15 @@ Page({
...
@@ -92,16 +93,15 @@ Page({
},
},
// 下载海报
// 下载海报
download
()
{
download
()
{
if
(
this
.
data
.
posterUrl
){
if
(
this
.
data
.
posterUrl
){
wx
.
saveImageToPhotosAlbum
({
wx
.
saveImageToPhotosAlbum
({
filePath
:
this
.
data
.
posterUrl
,
//仅为示例,并非真实的资源
filePath
:
this
.
data
.
posterUrl
,
//仅为示例,并非真实的资源
success
(
res
)
{
success
(
res
)
{
console
.
log
(
'res: '
,
res
);
console
.
log
(
'res: '
,
res
);
wx
.
$api
.
showToast
(
'图片下载成功!'
)
}
}
})
})
}
}
this
.
modelClose
();
this
.
modelClose
();
},
},
//模态框关闭
//模态框关闭
...
@@ -125,57 +125,56 @@ Page({
...
@@ -125,57 +125,56 @@ Page({
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
(
options
)
{
onLoad
(
options
)
{
// actNum,activeNavIdx
if
(
this
.
data
.
isShow
){
let
{
actNum
,
imgHeightArr
}
=
this
.
data
;
let
{
actNum
}
=
this
.
data
;
//所有的长度
let
img
=
`
${
IMGURL
}
scene/longpic
${
actNum
+
1
}
.png`
let
imgAllHeight
=
imgHeightArr
[
actNum
].
reduce
((
total
,
current
)
=>
{
wx
.
showLoading
({
return
total
+
current
;
title
:
'加载图片中'
,
});
})
// 缺少视频的长度(前4张)+二维码的长度 (单位rpx)
wx
.
getImageInfo
({
let
erCodeHeight
=
src
:
img
,
imgHeightArr
[
actNum
].
slice
(
0
,
4
).
reduce
((
total
,
current
)
=>
{
success
:(
res
)
=>
{
return
total
+
current
;
ActivityApi
.
getActivityVisitorList
({
})
+
actNum
,
activeNavIdx
:
0
98
*
2
;
}).
then
(
response
=>
{
let
imgW
=
res
.
width
/
5
,
imgH
=
res
.
height
/
5
;
console
.
log
(
"imgAllHeight: "
,
imgAllHeight
);
this
.
setData
({
let
W
=
750
/
4
imgH
:
(
imgH
/
imgW
)
*
450
let
H
=
imgAllHeight
/
4
})
let
drawFun
=
new
Draw
({
let
drawFun
=
new
Draw
({
width
:
W
,
width
:
imgW
,
height
:
H
height
:
imgH
});
});
console
.
log
(
`
${
IMGURL
}
scene/longpic
${
let
imgList
=
[
actNum
+
1
{
}.
png
`)
x
:
0
,
let imgList = [
y
:
0
,
{
width
:
imgW
,
x: 0,
height
:
imgH
,
y: 0,
url
:
img
,
width: W,
},
height: H,
{
url: `
$
{
IMGURL
}
scene/longpic
${
x
:
imgW
-
64
,
actNum
+
1
y
:
imgH
-
496
-
64
,
}.
png
`,
width
:
64
,
},
height
:
64
,
{
url
:
response
,
//二维码
// x: 245*2,
},
// y: erCodeHeight-11,
];
x:0,
drawFun
.
begin
({
y:0,
imageList
:
imgList
,
width: 120*2,
}).
then
(
resp
=>
{
height: 120*2,
console
.
log
(
'posterUrl.path'
,
resp
)
url: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/discovery_prod1.png`, //二维码
this
.
setData
({
},
posterUrl
:
resp
.
path
,
];
});
drawFun
.
begin
({
wx
.
hideLoading
()
imageList
:
imgList
,
})
}).
then
(
res
=>
{
console
.
log
(
response
,
'response'
)
console
.
log
(
'posterUrl.path'
,
res
)
})
this
.
setData
({
}
posterUrl
:
res
.
path
,
})
});
}
})
},
},
/**
/**
...
...
pages/checkProduct/checkProduct.scss
View file @
c86ac33
...
@@ -15,8 +15,8 @@ page{
...
@@ -15,8 +15,8 @@ page{
top
:
20%
;
top
:
20%
;
left
:
50%
;
left
:
50%
;
transform
:
translateX
(
-50%
);
transform
:
translateX
(
-50%
);
width
:
225
px
;
width
:
450r
px
;
height
:
311
px
;
height
:
622r
px
;
// background-color: red;
// background-color: red;
overflow
:
auto
;
overflow
:
auto
;
.img
{
.img
{
...
@@ -31,23 +31,23 @@ page{
...
@@ -31,23 +31,23 @@ page{
left
:
0
;
left
:
0
;
bottom
:
0
;
bottom
:
0
;
width
:
100%
;
width
:
100%
;
height
:
154
px
;
height
:
308r
px
;
background
:
#ffffff
;
background
:
#ffffff
;
border-radius
:
8px
8
px
0
0
;
border-radius
:
16rpx
16r
px
0
0
;
.top
{
.top
{
display
:
flex
;
display
:
flex
;
justify-content
:
space-around
;
justify-content
:
space-around
;
.btn
{
.btn
{
padding-top
:
16
px
;
padding-top
:
32r
px
;
}
}
.img
{
.img
{
display
:
block
;
display
:
block
;
margin
:
0
auto
8
px
;
margin
:
0
auto
16r
px
;
width
:
40
px
;
width
:
80r
px
;
height
:
40
px
;
height
:
80r
px
;
}
}
.name
{
.name
{
font-size
:
12
px
;
font-size
:
24r
px
;
color
:
#323436
;
color
:
#323436
;
text-align
:
center
;
text-align
:
center
;
line-height
:
32rpx
;
line-height
:
32rpx
;
...
@@ -63,12 +63,12 @@ page{
...
@@ -63,12 +63,12 @@ page{
}
}
}
}
.btom
{
.btom
{
margin
:
18
px
auto
0
;
margin
:
36r
px
auto
0
;
width
:
343
px
;
width
:
686r
px
;
height
:
44
px
;
height
:
88r
px
;
line-height
:
44
px
;
line-height
:
88r
px
;
border
:
1
px
solid
#eeeeee
;
border
:
2r
px
solid
#eeeeee
;
border-radius
:
4
px
;
border-radius
:
8r
px
;
text-align
:
center
;
text-align
:
center
;
}
}
}
}
...
...
pages/checkProduct/checkProduct.wxml
View file @
c86ac33
...
@@ -7,14 +7,13 @@
...
@@ -7,14 +7,13 @@
<product actNum="{{actNum}}" senceData="{{senceData}}" isShare="{{true}}"/>
<product actNum="{{actNum}}" senceData="{{senceData}}" isShare="{{true}}"/>
<!-- 分享弹框 -->
<!-- 分享弹框 -->
<view class="share-wrap" wx:if="{{isShow}}">
<view class="share-wrap" wx:if="{{isShow}}">
<view class="img-wrap">
<view class="img-wrap"
wx:if="{{posterUrl}}"
>
<image class="img" style="height:{{imgH
eight}}
px" src="{{posterUrl}}" bindload="onloadFn" />
<image class="img" style="height:{{imgH
}}r
px" src="{{posterUrl}}" bindload="onloadFn" />
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<!-- <block wx:for="{{imgList}}" wx:key="*this">
<image class="img" src="{{item}}"/>
<image class="img" src="{{item}}"/>
</block> -->
</block> -->
</view>
</view>
<button></button>
<view class="btns" wx:if="{{posterUrl}}">
<view class="btns">
<view class="top">
<view class="top">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<view class="btn" wx:for="{{btnList}}" wx:key="name" bindtap="handleClick" data-index="{{index}}">
<block wx:if="{{index == 0}}">
<block wx:if="{{index == 0}}">
...
...
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