Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
ybf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xulili
ybf
Commits
9f2b12ed
Commit
9f2b12ed
authored
Mar 16, 2020
by
Z
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Z: Dot: discount 页面和 qrCode 页面的 actionId, voucherId, unionId 做了准备与传递。等获取到数据即可拼接。
parent
18fe2e61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
51 deletions
+76
-51
index.vue
ybf_wx/src/views/qrCode/index.vue
+67
-49
index.vue
ybf_wx/src/views/sideNav/discount/index.vue
+9
-2
No files found.
ybf_wx/src/views/qrCode/index.vue
View file @
9f2b12ed
<
template
>
<div
class=
"qr-code"
>
<img
id=
"image"
src=
""
alt=
""
>
</div>
<div
class=
"qr-code"
>
<img
id=
"image"
src
alt
/
>
</div>
</
template
>
<
script
>
import
axios
from
'axios'
export
default
{
name
:
'index'
,
data
()
{
return
{
accessToken
:
""
}
import
axios
from
"axios"
;
export
default
{
name
:
"index"
,
data
()
{
return
{
accessToken
:
""
,
nowUrl
:
""
,
activeId
:
""
,
voucherId
:
""
,
unionId
:
""
};
},
mounted
()
{
this
.
getAcessToken
();
this
.
createCode
();
},
methods
:
{
cleanUrl
()
{
const
url
=
this
.
$route
;
this
.
activeId
=
url
.
split
(
"&"
)[
1
];
this
.
voucherId
=
url
.
split
(
"&"
)[
2
];
this
.
unionId
=
url
.
split
(
"&"
)[
3
];
},
mounted
()
{
this
.
getAcessToken
()
this
.
createCode
()
getAcessToken
()
{
let
_this
=
this
;
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/oauth2/getAccessToken"
,
method
:
"get"
}).
then
(
res
=>
{
_this
.
accessToken
=
res
.
data
.
data
;
_this
.
createCode
();
});
},
methods
:
{
getAcessToken
(){
let
_this
=
this
axios
({
url
:
"http://139.155.48.151:8085/workWx/auth/oauth2/getAccessToken"
,
method
:
"get"
,
}).
then
(
res
=>
{
_this
.
accessToken
=
res
.
data
.
data
_this
.
createCode
()
})
},
createCode
()
{
let
pageUrl
=
`/wxx/cgi-bin/wxaapp/createwxaqrcode?access_token=
${
this
.
accessToken
}
`
$
.
ajax
({
type
:
"POST"
,
url
:
pageUrl
,
data
:
JSON
.
stringify
({
"path"
:
"pages/signIn/signIn"
}),
xhrFields
:
{
responseType
:
"arraybuffer"
},
success
:
function
(
res
)
{
let
imgUrl
=
'data:image/png;base64,'
+
btoa
(
new
Uint8Array
(
res
).
reduce
((
data
,
byte
)
=>
data
+
String
.
fromCharCode
(
byte
),
''
))
$
(
'#image'
).
attr
(
'src'
,
imgUrl
)
},
error
:
function
(
data
)
{
console
.
log
(
data
)
}
});
}
createCode
()
{
let
pageUrl
=
`/wxx/cgi-bin/wxaapp/createwxaqrcode?access_token=
${
this
.
accessToken
}
`
;
$
.
ajax
({
type
:
"POST"
,
url
:
pageUrl
,
data
:
JSON
.
stringify
({
path
:
"pages/signIn/signIn"
}),
data
:
JSON
.
stringify
({
path
:
`pages/coupon/detail/detailid=
${
this
.
voucherId
}
&actionid=
${
this
.
activeId
}
&unionid=
${
this
.
unionId
}
`
}),
xhrFields
:
{
responseType
:
"arraybuffer"
},
success
:
function
(
res
)
{
let
imgUrl
=
"data:image/png;base64,"
+
btoa
(
new
Uint8Array
(
res
).
reduce
(
(
data
,
byte
)
=>
data
+
String
.
fromCharCode
(
byte
),
""
)
);
$
(
"#image"
).
attr
(
"src"
,
imgUrl
);
},
error
:
function
(
data
)
{
console
.
log
(
data
);
}
});
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.qr-code
{
text-align
:
center
;
padding-top
:
50px
;
#image
{
display
:
inline-block
;
width
:
60%
;
}
}
.qr-code
{
text-align
:
center
;
padding-top
:
50px
;
#image
{
display
:
inline-block
;
width
:
60%
;
}
}
</
style
>
ybf_wx/src/views/sideNav/discount/index.vue
View file @
9f2b12ed
...
...
@@ -103,7 +103,11 @@ export default {
userId
:
""
,
unionId
:
""
,
userInfo
:
""
,
defaultImgUrl
:
"/mainSale/test-city.png"
defaultImgUrl
:
"/mainSale/test-city.png"
,
now
:
{
activeId
:
""
,
voucherId
:
""
,
}
},
zlist
:
{
voucher
:
[],
...
...
@@ -227,6 +231,9 @@ export default {
},
zVoucherPick
(
inActiveId
,
inVoucherId
)
{
this
.
zcache
.
now
.
activeId
=
String
(
inActiveId
)
this
.
zcache
.
now
.
voucherId
=
String
(
inVoucherId
)
this
.
zVoucherUrlDel
();
const
postData
=
{
...
...
@@ -275,7 +282,7 @@ export default {
msgtype
:
"text"
,
//消息类型,必填
news
:
{
// link: "http://qywx2.100smartdata.com/voucherInfo", //H5消息页面url 必填
link
:
`http://qywx2.100smartdata.com/qrCode?
${
inur
}
`
,
//H5消息页面url 必填
link
:
`http://qywx2.100smartdata.com/qrCode?
Url=
${
inur
}
&activeId=
${
this
.
zcache
.
now
.
activeId
}
&voucherId=
${
this
.
zcache
.
now
.
voucherId
}
&unionId=
${
this
.
zcache
.
unionId
}
`
,
//H5消息页面url 必填
title
:
"Z: h5消息标题"
,
//H5消息标题
desc
:
inUrl
,
//H5消息摘要
// imgUrl: "http://qywx2.100smartdata.com/hi.jpg" //H5消息封面图片URL
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment