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 7d747089
authored
Oct 20, 2022
by
zhangquan
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
细节处理
1 parent
e72a06f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
59 deletions
pages/checkProduct/checkProduct.js
pages/tab/discovery/components/product/product.js
pages/tab/discovery/constant/data.js
pages/tab/discovery/discovery.js
pages/checkProduct/checkProduct.js
View file @
7d74708
...
...
@@ -14,6 +14,7 @@ Page({
senceData
,
actNum
:
0
,
activeNavIdx
:
0
,
fromLocal
:
0
,
// 模态框
isShow
:
true
,
...
...
@@ -75,6 +76,59 @@ Page({
isShow
:
true
,
});
},
createImg
(){
if
(
this
.
data
.
isShow
&&
this
.
data
.
fromLocal
==
1
){
let
{
actNum
,
activeNavIdx
}
=
this
.
data
;
let
img
=
`
${
IMGURL
}
scene/longpic
${
actNum
+
1
}
.png`
wx
.
showLoading
({
title
:
'图片加载中'
,
})
wx
.
getImageInfo
({
src
:
img
,
success
:(
res
)
=>
{
ActivityApi
.
getActivityVisitorList
({
actNum
,
activeNavIdx
}).
then
(
response
=>
{
let
imgW
=
res
.
width
/
5
,
imgH
=
res
.
height
/
5
;
this
.
setData
({
imgH
:
(
imgH
/
imgW
)
*
450
})
let
drawFun
=
new
Draw
({
width
:
imgW
,
height
:
imgH
});
let
arr
=
[
456
,
222
,
0
,
496
]
let
imgList
=
[
{
x
:
0
,
y
:
0
,
width
:
imgW
,
height
:
imgH
,
url
:
img
,
},
{
x
:
imgW
-
64
,
y
:
imgH
-
arr
[
actNum
]
-
64
,
width
:
64
,
height
:
64
,
url
:
response
,
//二维码
},
];
drawFun
.
begin
({
imageList
:
imgList
,
}).
then
(
resp
=>
{
console
.
log
(
'posterUrl.path'
,
resp
)
this
.
setData
({
posterUrl
:
resp
.
path
,
});
wx
.
hideLoading
()
})
console
.
log
(
response
,
'response'
)
})
}
})
}
},
// 分享按钮
handleClick
(
e
)
{
let
{
index
}
=
e
.
currentTarget
.
dataset
;
...
...
@@ -119,69 +173,21 @@ Page({
},
onRoute
(
options
)
{
console
.
log
(
"options: "
,
options
);
let
{
actNum
,
activeNavIdx
}
=
options
let
{
actNum
,
activeNavIdx
,
fromLocal
}
=
options
this
.
setData
({
actNum
,
activeNavIdx
activeNavIdx
,
fromLocal
})
this
.
createImg
()
},
noPageAuth
:
true
,
/**
* 生命周期函数--监听页面加载
*/
onLoad
(
options
)
{
if
(
this
.
data
.
isShow
){
let
{
actNum
}
=
this
.
data
;
let
img
=
`
${
IMGURL
}
scene/longpic
${
actNum
+
1
}
.png`
wx
.
showLoading
({
title
:
'加载图片中'
,
})
wx
.
getImageInfo
({
src
:
img
,
success
:(
res
)
=>
{
ActivityApi
.
getActivityVisitorList
({
actNum
,
activeNavIdx
:
0
}).
then
(
response
=>
{
let
imgW
=
res
.
width
/
5
,
imgH
=
res
.
height
/
5
;
this
.
setData
({
imgH
:
(
imgH
/
imgW
)
*
450
})
let
drawFun
=
new
Draw
({
width
:
imgW
,
height
:
imgH
});
let
arr
=
[
456
,
222
,
0
,
496
]
let
imgList
=
[
{
x
:
0
,
y
:
0
,
width
:
imgW
,
height
:
imgH
,
url
:
img
,
},
{
x
:
imgW
-
64
,
y
:
imgH
-
arr
[
actNum
]
-
64
,
width
:
64
,
height
:
64
,
url
:
response
,
//二维码
},
];
drawFun
.
begin
({
imageList
:
imgList
,
}).
then
(
resp
=>
{
console
.
log
(
'posterUrl.path'
,
resp
)
this
.
setData
({
posterUrl
:
resp
.
path
,
});
wx
.
hideLoading
()
})
console
.
log
(
response
,
'response'
)
})
}
})
}
},
/**
...
...
pages/tab/discovery/components/product/product.js
View file @
7d74708
...
...
@@ -117,7 +117,7 @@ Component({
},
toSharePage
()
{
let
{
actNum
,
activeNavIdx
,
senceData
}
=
this
.
data
;
wx
.
$router
.
go
(
"checkProduct"
,
{
actNum
,
activeNavIdx
,
senceData
});
wx
.
$router
.
go
(
"checkProduct"
,
{
actNum
,
activeNavIdx
,
senceData
,
fromLocal
:
1
});
},
}
})
pages/tab/discovery/constant/data.js
View file @
7d74708
...
...
@@ -76,11 +76,11 @@ var senceData = [
img
:
'product-img3'
,
proName
:
'漆面保护膜'
,
price
:
'12000'
,
profit
:
'21600
00
'
,
profit
:
'21600
万
'
,
type
:
'membrane'
,
productType
:
'protectMembrane'
,
path
:
'paintProtect'
,
sale
:
100
,
//销量
sale
:
100
00
,
//销量
varType
:
1
},
{
...
...
@@ -91,7 +91,7 @@ var senceData = [
type
:
'membrane'
,
productType
:
'colorMembrane'
,
path
:
'changingFilm'
,
sale
:
100
,
//销量
sale
:
100
00
,
//销量
varType
:
1
}
]
...
...
pages/tab/discovery/discovery.js
View file @
7d74708
...
...
@@ -86,7 +86,7 @@ Page({
showCalculate
()
{
this
.
setData
({
visible
:
!
this
.
data
.
visible
,
isReset
:
false
,
isReset
:
false
});
},
clickDialog
(
e
)
{
...
...
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