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 643d6712
authored
Oct 22, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix:修复二维码下载问题
1 parent
d153b831
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
48 deletions
pages/checkProduct/checkProduct.js
pages/tab/index/components/product/product.js
pages/checkProduct/checkProduct.js
View file @
643d671
...
...
@@ -17,7 +17,7 @@ Page({
headerHeight
:
0
,
senceData
,
// 模态框
isShow
:
tru
e
,
isShow
:
fals
e
,
// IMG_URL: `${IMG_URL}index`,
btnList
:
[
{
...
...
@@ -110,6 +110,7 @@ Page({
// 设置标题
this
.
shareTitle
=
`给你分享一个
${
senceData
[
actNum
]?.
productList
[
activeNavIdx
].
proName
}
~
`;
this.getImgInfo(actNum)
this.setData({
actNum,
...
...
@@ -156,7 +157,7 @@ Page({
},
// 下载海报
async download() {
let { actNum, activeNavIdx, imgHeightArr } = this.data;
let { actNum, activeNavIdx, imgHeightArr
,imgPath
} = this.data;
let wx_user_info = wx.$storage.get("wx_user_info");
// console.log('wx_user_info: ', wx_user_info.appId);
let params = {
...
...
@@ -165,59 +166,22 @@ Page({
isShare: true,
};
console.log(' wx_user_info.appId', wx_user_info)
let res = await createQrCodeApi({
appId: wx_user_info.appId,
// appId:'wx2c28337db96364d2',
path: "pages/checkProduct/checkProduct",
scene: JSON.stringify(params),
});
// console.log('res: ', res);
// let { actNum, imgHeightArr } = this.data;
//所有的长度
let imgAllHeight = imgHeightArr[actNum].reduce((total, current) => {
return total + current;
});
// 缺少视频的长度(前4张)+二维码的长度 (单位rpx)
let erCodeHeight =
imgHeightArr[actNum].slice(0, 4).reduce((total, current) => {
return total + current;
}) +
98 * 2;
let _this = this;
wx.getImageInfo({
src: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
actNum
+
1
}.
png
`,
src: imgPath,
success: async () => {
// // console.log("imgAllHeight: ", imgAllHeight);
// let drawFun = new Draw({
// width: 750,
// height: imgAllHeight,
// });
let drawFun = new Draw({
width: _this.data.imgWidth,
height: _this.data.imgHeight,
});
// let imgList = [
// {
// x: 0,
// y: 0,
// width: 750,
// height: imgAllHeight,
// url: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
// actNum + 1
// }.png`,
// },
// {
// x: 245 * 2,
// y: erCodeHeight + 30,
// width: 120 * 2,
// height: 120 * 2,
// url: `https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/discovery_prod1.png`, //二维码
// },
// ];
let arr = [456, 222, 0, 496];
let imgList = [
...
...
@@ -269,16 +233,35 @@ Page({
// },
// 图片加载事件
onloadFn(event) {
console.log("event.detail", event.detail);
wx.hideLoading();
// this.setData({
// imgHeight: (event.detail.height * 0.2).toFixed(0),
// });
// console.log("event.detail", event.detail);
this.setData({
imgHeight: event.detail.height / 5,
imgWidth: event.detail.width / 5,
});
},
// 图片视频加载回调拿到url
getImgInfo(actNum){
wx.showLoading({
title: "加载中",
});
let _this = this;
wx.getImageInfo({
src: `
https
:
//img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/longpic${
actNum
+
1
}.
png
`,
success: async (res) => {
console.log('res: ', res)
wx.hideLoading()
wx.nextTick(() => {
_this.setData({
isShow: true,
imgPath:res.path
})
})
}
})
},
// 分享获取懂得用户数
authorizedFn(e) {
let res = e.detail;
...
...
pages/tab/index/components/product/product.js
View file @
643d671
...
...
@@ -58,7 +58,6 @@ Component({
activeNavIdx
:
this
.
data
.
wrapactiveNavIdx
})
}
console
.
log
(
'outshowVideo'
,
this
.
data
.
outshowVideo
)
if
(
!
this
.
data
.
outshowVideo
){
this
.
setData
({
...
...
@@ -77,7 +76,6 @@ Component({
},
observers
:
{
actNum
:
function
(
newval
,
oldval
)
{
console
.
log
(
'newval, oldval: '
,
newval
,
oldval
);
let
navList
;
let
tab
=
[
"场景说明"
,
...
...
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