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
6bee6688
Commit
6bee6688
authored
Mar 16, 2020
by
Z
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Z: Dot: Next: Create QRCode in views/voucherInfo/index.vue
parent
51a2c9eb
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
329 additions
and
117 deletions
+329
-117
package.json
ybf_wx/package.json
+1
-0
test-city.png
ybf_wx/public/mainSale/test-city.png
+0
-0
ea.js
ybf_wx/src/api/sidebar/ea.js
+1
-1
qrcode.jpeg
ybf_wx/src/assets/qrcode.jpeg
+0
-0
index.js
ybf_wx/src/router/index.js
+35
-13
aCommon.js
ybf_wx/src/utils/aCommon.js
+146
-91
home.vue
ybf_wx/src/views/home.vue
+3
-0
index.vue
ybf_wx/src/views/sideNav/discount/index.vue
+79
-12
test-city.png
ybf_wx/src/views/sideNav/discount/test-city.png
+0
-0
index.vue
ybf_wx/src/views/voucherInfo/index.vue
+59
-0
qrcode.jpeg
ybf_wx/src/views/voucherInfo/qrcode.jpeg
+0
-0
yarn.lock
ybf_wx/yarn.lock
+5
-0
No files found.
ybf_wx/package.json
View file @
6bee6688
...
...
@@ -14,6 +14,7 @@
"axios"
:
"^0.19.1"
,
"core-js"
:
"^3.4.4"
,
"js-md5"
:
"^0.7.3"
,
"jssdk"
:
"^0.0.1"
,
"vant"
:
"^2.3.3"
,
"vue"
:
"^2.6.10"
,
"vue-router"
:
"^3.1.3"
,
...
...
ybf_wx/public/mainSale/test-city.png
View replaced file @
51a2c9eb
View file @
6bee6688
3.42 MB
|
W:
|
H:
730 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ybf_wx/src/api/sidebar/ea.js
View file @
6bee6688
...
...
@@ -5,7 +5,7 @@ export function getVoucherList(inData) {
let
postData
=
{
args
:
inData
}
alert
(
`--->PostToEA: ea.js: postData =
${
JSON
.
stringify
(
postData
)}
`
)
//
alert(`--->PostToEA: ea.js: postData =${JSON.stringify(postData)}`)
return
request
({
url
:
''
,
method
:
'post'
,
...
...
ybf_wx/src/assets/qrcode.jpeg
0 → 100644
View file @
6bee6688
30.3 KB
ybf_wx/src/router/index.js
View file @
6bee6688
...
...
@@ -117,6 +117,11 @@ const routes = [
name
:
'newInfo'
,
component
:
()
=>
import
(
'@/views/message/newInfo'
)
},
{
path
:
'/voucherInfo'
,
name
:
'VoucherInfo'
,
component
:
()
=>
import
(
'@/views/voucherInfo/index'
)
},
// {
// path: '/about',
// name: 'about',
...
...
@@ -133,19 +138,36 @@ const router = new VueRouter({
routes
})
// const whiteList = ['/discount']
// router.beforeEach((to, from ,next) => {
// if (whiteList.indexOf(to.path) !== -1) {
// next()
// } else {
// if(sessionStorage.getItem('unionid')) {
// next()
// } else {
// getUnionId(to)
// // next()
// }
// }
// })
// const whiteList = ['/', '/home','/home/']
const
whiteList
=
[
'/discount'
,
'discount'
]
// const whiteList = ['/discount', 'discount', '/voucherInfo', 'voucherInfo']
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
// alert(`--->route: beforeEach: to =${JSON.stringify(to)}. from =${from}. next =${JSON.stringify(next)}`)
if
(
whiteList
.
indexOf
(
to
.
path
)
!=
-
1
)
{
// alert(`--->route: beforeEach: If: UnIn whiteList.`)
if
(
sessionStorage
.
getItem
(
'zConfigWx'
)
===
'Pass'
){
next
()
}
else
{
configWx
(
to
)
}
}
else
{
// alert(`--->route: beforeEach: If: In whiteList.`)
next
()
}
// if (whiteList.indexOf(to.path) !== -1) {
// next()
// } else {
// if(sessionStorage.getItem('unionid')) {
// next()
// } else {
// getUnionId(to)
// // next()
// }
// }
})
// async function getUnionId (to) {
// await getXToken()
...
...
ybf_wx/src/utils/aCommon.js
View file @
6bee6688
...
...
@@ -52,91 +52,123 @@ function isIosOrAndroid() {
Vue
.
prototype
.
getAgentAuth
=
function
()
{
zlog
(
'%c--->IN: getAgentAuth: location.href ='
,
'color: orange;'
,
location
.
href
)
// alert(`--->zCommon.js: IN.`)
let
postData
=
{
// businessId: sessionStorage.getItem('businessId'),
// pageUrl: encodeURIComponent(this.isIosOrAndroid() === 'android' ? location.href.split('#')[0] : window.initUrl)
pageUrl
:
encodeURIComponent
(
location
.
href
.
split
(
'#'
)[
0
])
}
// alert(`--->zCommon.js: postData =${JSON.stringify(postData)}`)
let
header
=
{
token
:
sessionStorage
.
getItem
(
'XToken'
),
corpId
:
INFO
.
corpId
,
agentId
:
INFO
.
agentId
,
}
// alert(`--->zCommon.js: header =${JSON.stringify(header)}`)
console
.
log
(
'%c--->getAgentAuth: getJsSdkSignature: PD ='
,
'background: orange;'
,
header
)
wxRequest
(
'/workWx/auth/base/getJsSdkSignature'
,
qs
.
stringify
(
postData
),
header
).
then
(
res
=>
{
if
(
res
.
result
===
'success'
)
{
console
.
log
(
'%c--->getAgentAuth: getJsSdkSignature: RD ='
,
'background: limegreen;'
,
res
.
data
)
wxRequest
(
'/workWx/auth/base/getJsSdkSignature'
,
qs
.
stringify
(
postData
),
header
)
.
then
(
res
=>
{
// alert(`--->zCommon.js: getJsSdkSignature: then.`)
// alert(`--->zCommon.js: getJsSdkSignature: then: res =${JSON.stringify(res)}`)
let
config
=
res
.
data
wx
.
config
({
beta
:
true
,
debug
:
false
,
//调试的时候可以开启
appId
:
config
.
jsApiSignature
.
appId
,
// 必填,公众号的唯一标识
timestamp
:
config
.
jsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
config
.
jsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
config
.
jsApiSignature
.
signature
,
// 必填,签名
// 根据自己的需求,填写 jsapilist 内容
jsApiList
:
[
'agentConfig'
]
})
wx
.
ready
(
function
()
{
zlog
(
'%c--->getAgentAuth: getJsSdkSignature: Ready.'
,
'color: red;'
)
if
(
res
.
result
===
'success'
)
{
console
.
log
(
'%c--->getAgentAuth: getJsSdkSignature: RD ='
,
'background: limegreen;'
,
res
.
data
)
// alert(`--->zCommon.js: getJsSdkSignature: then: res.result === "success".`)
// JS-SDK配置信息验证失败时会进入此方法
wx
.
error
(
function
(
res
)
{
alert
(
"JS-SDK配置信息验证失败
\
r
\n
"
+
JSON
.
stringify
(
res
));
let
config
=
res
.
data
wx
.
config
({
beta
:
true
,
debug
:
true
,
//调试的时候可以开启
appId
:
config
.
jsApiSignature
.
appId
,
// 必填,公众号的唯一标识
timestamp
:
config
.
jsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
config
.
jsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
config
.
jsApiSignature
.
signature
,
// 必填,签名
// 根据自己的需求,填写 jsapilist 内容
jsApiList
:
[
'agentConfig'
]
})
// 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口
wx
.
checkJsApi
({
jsApiList
:
[
'agentConfig'
,
'sendChatMessage'
],
success
:
function
(
res
)
{
if
(
res
.
errMsg
!=
"checkJsApi:ok"
)
{
alert
(
"JS-SDK接口检测失败:"
+
JSON
.
stringify
(
res
));
return
false
;
}
else
{
wxRequest
(
'/workWx/auth/base/getAgentJsSdkSignature'
,
qs
.
stringify
(
data
),
header
).
then
(
res
=>
{
// alert('getAgentJsSdkSignature:ok')
if
(
res
.
result
===
'success'
)
{
let
agentConfig
=
res
.
data
wx
.
agentConfig
({
corpid
:
agentConfig
.
agentJsApiSignature
.
appId
,
// 必填,企业微信的 corpid,必须与当前登录的企业一致
agentid
:
agentConfig
.
agentId
,
// 必填,企业微信的应用id
timestamp
:
agentConfig
.
agentJsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
agentConfig
.
agentJsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
agentConfig
.
agentJsApiSignature
.
signature
,
// 必填,签名,agentConfig所以为应用签名
jsApiList
:
[
'sendChatMessage'
],
//必填
success
:
function
(
res
)
{
// alert('agentConfig:ok')
// router.push(to)
// 回调
//1、发起申请申请时后,审批状态发生变化时
//2、发起申请申请时后,在“审批中”状态,有任意审批人进行审批操作时
// alert('wx.agentConfig 回调'+res.errMsg);
},
fail
:
function
(
res
)
{
// alert('回调失败:'+res.errMsg)
if
(
res
.
errMsg
.
indexOf
(
'is not a function'
)
>
-
1
)
{
alert
(
'<i class="weui-icon-warn">版本过低请升级</i>'
)
}
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.config: end.`)
wx
.
ready
(
function
()
{
zlog
(
'%c--->getAgentAuth: getJsSdkSignature: Ready.'
,
'color: red;'
)
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: IN.`)
// JS-SDK配置信息验证失败时会进入此方法
wx
.
error
(
function
(
res
)
{
alert
(
"JS-SDK配置信息验证失败
\
r
\n
"
+
JSON
.
stringify
(
res
));
})
// 配置成功后验证API接口在当前客户端是否支持:判断当前客户端版本是否支持指定JS接口
wx
.
checkJsApi
(
{
jsApiList
:
[
'agentConfig'
,
'sendChatMessage'
],
success
:
function
(
res
)
{
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: success.`)
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: success. res =${JSON.stringify(res)}`)
if
(
res
.
errMsg
!=
"checkJsApi:ok"
)
{
alert
(
"JS-SDK接口检测失败:"
+
JSON
.
stringify
(
res
));
return
false
;
}
else
{
wxRequest
(
'/workWx/auth/base/getAgentJsSdkSignature'
,
qs
.
stringify
(
postData
),
header
)
.
then
(
res
=>
{
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: res.`)
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: res =${JSON.stringify(res)}`)
// alert('getAgentJsSdkSignature:ok')
if
(
res
.
result
===
'success'
)
{
let
agentConfig
=
res
.
data
wx
.
agentConfig
({
corpid
:
agentConfig
.
agentJsApiSignature
.
appId
,
// 必填,企业微信的 corpid,必须与当前登录的企业一致
agentid
:
agentConfig
.
agentId
,
// 必填,企业微信的应用id
timestamp
:
agentConfig
.
agentJsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
agentConfig
.
agentJsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
agentConfig
.
agentJsApiSignature
.
signature
,
// 必填,签名,agentConfig所以为应用签名
jsApiList
:
[
'sendChatMessage'
],
//必填
success
:
function
(
res
)
{
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res.`)
// alert(`!-->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: wx.agentConfig: res =${JSON.stringify(res)}`)
// alert('agentConfig:ok')
// router.push(to)
// 回调
//1、发起申请申请时后,审批状态发生变化时
//2、发起申请申请时后,在“审批中”状态,有任意审批人进行审批操作时
// alert('wx.agentConfig 回调'+res.errMsg);
},
fail
:
function
(
res
)
{
// alert('回调失败:'+res.errMsg)
if
(
res
.
errMsg
.
indexOf
(
'is not a function'
)
>
-
1
)
{
alert
(
'<i class="weui-icon-warn">版本过低请升级</i>'
)
}
}
})
}
})
.
catch
(
err
=>
{
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: err.`)
// alert(`--->zCommon.js: getJsSdkSignature: then: wx.ready: wx.checkJsApi: getAgentJsSdkSignature: err =${JSON.stringify(err)}`)
})
}
}
)
}
}
}
)
})
})
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
errorMsg
})
}
}).
catch
(
err
=>
{
console
.
log
(
err
,
'err'
)
})
}
else
{
this
.
$message
({
type
:
'error'
,
message
:
res
.
errorMsg
})
}
})
.
catch
(
err
=>
{
// alert(`--->zCommon.js: getJsSdkSignature: catch.`)
// alert(`--->zCommon.js: getJsSdkSignature: catch: err =${JSON.stringify(err)}`)
console
.
log
(
err
,
'err'
)
})
}
function
configWx
(
to
)
{
...
...
@@ -161,7 +193,7 @@ function configWx(to) {
nonceStr
:
config
.
jsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
config
.
jsApiSignature
.
signature
,
// 必填,签名
// 根据自己的需求,填写 jsapilist 内容
jsApiList
:
[
'agentConfig'
,
'getCurExternalContact'
]
jsApiList
:
[
'agentConfig'
,
'getCurExternalContact'
]
})
wx
.
ready
(
function
()
{
// JS-SDK配置信息验证失败时会进入此方法
...
...
@@ -172,6 +204,9 @@ function configWx(to) {
wx
.
checkJsApi
({
jsApiList
:
[
'agentConfig'
,
'getCurExternalContact'
],
success
:
function
(
res
)
{
// alert(`--->wx.checkJsApi: success. res =${JSON.stringify(res)}`);
// router.push(to)
if
(
res
.
errMsg
!=
"checkJsApi:ok"
)
{
alert
(
"JS-SDK接口检测失败:"
+
JSON
.
stringify
(
res
));
return
false
;
...
...
@@ -179,33 +214,53 @@ function configWx(to) {
}
})
wxRequest
(
'/workWx/auth/base/getAgentJsSdkSignature'
,
qs
.
stringify
(
data
),
header
).
then
(
res
=>
{
if
(
res
.
result
==
'success'
)
{
let
agentConfig
=
res
.
data
wx
.
agentConfig
({
corpid
:
agentConfig
.
agentJsApiSignature
.
appId
,
// 必填,企业微信的corpid,必须与当前登录的企业一致
agentid
:
agentConfig
.
agentId
,
// 必填,企业微信的应用id
timestamp
:
agentConfig
.
agentJsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
agentConfig
.
agentJsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
agentConfig
.
agentJsApiSignature
.
signature
,
// 必填,签名,agentConfig所以为应用签名
jsApiList
:
[
'getCurExternalContact'
],
//必填
success
:
function
(
res
)
{
// alert('agentConfig:ok')
// router.push(to)
getUnionid
(
to
)
// 回调
//1、发起申请申请时后,审批状态发生变化时
//2、发起申请申请时后,在“审批中”状态,有任意审批人进行审批操作时
// alert('wx.agentConfig 回调'+res.errMsg);
},
fail
:
function
(
res
)
{
if
(
res
.
errMsg
.
indexOf
(
'is not a function'
)
>
-
1
)
{
alert
(
'<i class="weui-icon-warn">版本过低请升级</i>'
)
// alert(`--->configWx/getJsSdkSignature: next: getAgentJsSdkSignature.`)
// alert(`--->configWx/getJsSdkSignature: next: getAgentJsSdkSignature: data =${qs.stringify(postData)}. header =${JSON.stringify(header)}`)
wxRequest
(
'/workWx/auth/base/getAgentJsSdkSignature'
,
qs
.
stringify
(
postData
),
header
)
.
then
(
res
=>
{
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: IN.`)
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: res =${JSON.stringify(res)}`)
if
(
res
.
result
==
'success'
)
{
let
agentConfig
=
res
.
data
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: res.result == 'success'.`)
wx
.
agentConfig
({
corpid
:
agentConfig
.
agentJsApiSignature
.
appId
,
// 必填,企业微信的corpid,必须与当前登录的企业一致
agentid
:
agentConfig
.
agentId
,
// 必填,企业微信的应用id
timestamp
:
agentConfig
.
agentJsApiSignature
.
timestamp
,
// 必填,生成签名的时间戳
nonceStr
:
agentConfig
.
agentJsApiSignature
.
nonceStr
,
// 必填,生成签名的随机串
signature
:
agentConfig
.
agentJsApiSignature
.
signature
,
// 必填,签名,agentConfig所以为应用签名
jsApiList
:
[
'getCurExternalContact'
],
//必填
success
:
function
(
res
)
{
// alert('agentConfig:ok')
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: res =${res}`)
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: then: agentConfig: to =${JSON.stringify(to)}`)
sessionStorage
.
setItem
(
'zConfigWx'
,
'Pass'
)
router
.
push
(
to
)
// getUnionid(to)
// 回调
//1、发起申请申请时后,审批状态发生变化时
//2、发起申请申请时后,在“审批中”状态,有任意审批人进行审批操作时
// alert('wx.agentConfig 回调'+res.errMsg);
},
fail
:
function
(
res
)
{
// alert(`--->A: err =${res}`)
// alert(`--->A: err =${JSON.stringify(res)}`)
if
(
res
.
errMsg
.
indexOf
(
'is not a function'
)
>
-
1
)
{
alert
(
'<i class="weui-icon-warn">版本过低请升级</i>'
)
}
}
}
})
}
})
})
}
})
.
catch
(
err
=>
{
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: catch: err.`)
// alert(`--->configWx/getJsSdkSignature/getAgentJsSdkSignature: catch: err =${JSON.stringify(err)}`)
})
})
}
else
{
this
.
$message
({
...
...
ybf_wx/src/views/home.vue
View file @
6bee6688
...
...
@@ -92,6 +92,7 @@ export default {
// this.zTestGetNowUrlInfo();
},
created
()
{
// alert(`--->home: created.`)
this
.
zReadyUserId
()
// this.zReadyUserId();
// this.zTestGetNowUrlInfo();
...
...
@@ -103,6 +104,7 @@ export default {
"color: orange;"
,
this
.
$route
.
query
.
code
);
if
(
this
.
$route
.
query
.
code
===
undefined
)
{
this
.
zTestPreAuthCode
();
}
else
{
...
...
@@ -126,6 +128,7 @@ export default {
// 测试-获取预授权码
// redirectUrI: encodeURIComponent(location.href.split('#')[0]),
zTestPreAuthCode
()
{
// alert(`--->home: zTestPreAuthCode: IN.`)
const
basicInfo
=
{
head
:
"https://open.weixin.qq.com/connect/oauth2/authorize?"
,
appId
:
"wwd1cdbca7b8b2b6c4"
,
...
...
ybf_wx/src/views/sideNav/discount/index.vue
View file @
6bee6688
...
...
@@ -28,7 +28,7 @@
<div
v-if=
"zlist.voucherUrl !== ''"
class=
"voucherUrl"
>
<div
@
click=
"zpick"
>
小程序Url:
{{
zlist
.
voucherUrl
}}
</div>
</div>
</div>
-->
</div>
-->
</div>
<div
...
...
@@ -61,8 +61,15 @@
<div
class=
"zListActive"
>
<div
class=
"lists"
>
<div
v-if=
"zlist.voucherUrl !== ''"
class=
"voucherUrl"
>
<div
@
click=
"zpick"
>
小程序Url:
</div>
<div
@
click=
"zpick"
>
{{
zlist
.
voucherUrl
}}
</div>
<div
@
click=
"zpick"
>
小程序Url:
{{
String
(
zlist
.
voucherUrl
).
slice
(
-
2
)
}}
</div>
<div
v-if=
"String(zlist.voucherUrl).slice(-2) === '97'"
@
click=
"zpick('text', String(zlist.voucherUrl))"
>
{{
zlist
.
voucherUrl
}}
</div>
<div
v-if=
"String(zlist.voucherUrl).slice(-2) !== '97'"
@
click=
"zpick('h5', String(zlist.voucherUrl))"
>
{{
zlist
.
voucherUrl
}}
</div>
</div>
</div>
</div>
...
...
@@ -126,11 +133,13 @@ export default {
},
created
()
{
zlog
(
"%c--->Created."
,
"color: orange"
);
// alert(`--->discount: IN.`);
// configWx()
this
.
zcache
.
userId
=
this
.
$route
.
params
.
userId
;
// zlog('%c--->userId =', this.zcache.userId)
this
.
zReadyGetUserFromId
();
// this.zReadySetVoucherList();
this
.
getAgentAuth
();
},
mounted
()
{
// zlog("%c--->Mounted.", "color: orange");
...
...
@@ -218,26 +227,84 @@ export default {
zVoucherPick
(
inActiveId
,
inVoucherId
)
{
this
.
zVoucherUrlDel
();
const
postData
=
{
appCode
:
"0697"
,
action_id
:
Number
(
inActiveId
),
coupon_id
:
Number
(
inVoucherId
)
};
zlog
(
"%c--->VoucherWxUrl: PD ="
,
"background: red;"
,
postData
);
getVoucherWxUrl
(
postData
).
then
(
res
=>
{
zlog
(
"%c--->VoucherWxUrl: RD ="
,
"background: green;"
,
res
);
this
.
zVoucherUrlSet
(
res
.
result
.
link
);
});
},
zpick
()
{
zlog
(
"%c--->Click: Url ="
,
"background: orange;"
,
String
(
this
.
zlist
.
voucherUrl
)
);
window
.
wx
.
miniProgram
.
navigateTo
({
url
:
this
.
zlist
.
voucherUrl
});
zpick
(
inMsgType
,
inUrl
)
{
alert
(
`--->discount.vue: zpick: IN.`
);
switch
(
inMsgType
)
{
case
"text"
:
wx
.
invoke
(
"sendChatMessage"
,
{
msgtype
:
"text"
,
//消息类型,必填
text
:
{
content
:
inUrl
}
},
function
(
res
)
{
if
(
res
.
err_msg
==
"sendChatMessage:ok"
)
{
alert
(
"--->discount.vue: zpick: text 分享成功!"
);
}
else
if
(
res
.
err_msg
!=
"sendChatMessage:ok"
)
{
alert
(
`--->discount.vue: zpick: text 分享失败: res =
${
res
.
err_msg
}
`
);
}
}
);
break
;
case
"h5"
:
wx
.
invoke
(
"sendChatMessage"
,
{
msgtype
:
"text"
,
//消息类型,必填
news
:
{
link
:
"http://qywx2.100smartdata.com/voucherInfo"
,
//H5消息页面url 必填
title
:
"Z: h5消息标题"
,
//H5消息标题
desc
:
inUrl
,
//H5消息摘要
// imgUrl: "http://qywx2.100smartdata.com/hi.jpg" //H5消息封面图片URL
imgUrl
:
inUrl
//H5消息封面图片URL
}
},
function
(
res
)
{
if
(
res
.
err_msg
==
"sendChatMessage:ok"
)
{
alert
(
"--->discount.vue: zpick: h5 分享成功!"
);
}
else
if
(
res
.
err_msg
!=
"sendChatMessage:ok"
)
{
alert
(
`--->discount.vue: zpick: h5 分享失败: res =
${
res
}
`
);
alert
(
`--->discount.vue: zpick: h5 分享失败: res =
${
res
.
err_msg
}
`
);
}
}
);
break
;
default
:
break
;
}
// zlog(
// "%c--->Click: Url =",
// "background: orange;",
// String(this.zlist.voucherUrl)
// );
// window.wx.miniProgram.navigateTo({
// url: this.zlist.voucherUrl
// });
},
zVoucherSet
(
inArray
)
{
this
.
zlist
.
voucher
=
inArray
;
...
...
ybf_wx/src/views/sideNav/discount/test-city.png
0 → 100644
View file @
6bee6688
730 KB
ybf_wx/src/views/voucherInfo/index.vue
0 → 100644
View file @
6bee6688
<
template
>
<div
class=
"main"
>
<div>
Hola World.
</div>
<img
src=
"../../assets/qrcode.jpeg"
alt=
"Please Scan QRCode."
/>
<button
@
click=
"redirect"
>
redirect
</button>
</div>
</
template
>
<
script
>
const
zlog
=
console
.
log
.
bind
(
console
);
export
default
{
name
:
"voucherInfo"
,
data
()
{
return
{};
},
created
()
{
alert
(
"--->voucherInfo: Created."
);
// wx.miniProgram.navigateTo({url: '/path/to/page'})
// wx.miniProgram.navigateTo({url: '/pages/coupon/detail/detailid=100000338&actionid=97'})
},
mounted
()
{},
methods
:
{
redirect
()
{
// wx.miniProgram.navigateTo({url: '/pages/coupon/detail/detailid=100000338&actionid=97'})
alert
(
'--->voucherInfo: redirect: IN.'
)
window
.
location
.
href
=
'https://mp.weixin.qq.com/a/~PLEzZIqxoasdl5QDu_HZEw~~'
;
// wx.navigateToMiniProgram({
// appId: "1000004",
// path: "page/index/index?id=123",
// extraData: {
// foo: "bar"
// },
// success(res) {
// alert(`--->voucherInfo: navigateToMiniProgram: res.`)
// alert(`--->voucherInfo: navigateToMiniProgram: res =${JSON.stringify(res)}`)
// // 打开成功
// },
// fail(err) {
// alert(`--->voucherInfo: navigateToMiniProgram: err.`)
// alert(`--->voucherInfo: navigateToMiniProgram: err =${JSON.stringify(err)}`)
// // 打开成功
// }
// });
}
}
};
</
script
>
<
style
scoped
>
.main
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
flex-start
;
align-items
:
center
;
}
</
style
>
ybf_wx/src/views/voucherInfo/qrcode.jpeg
0 → 100644
View file @
6bee6688
30.3 KB
ybf_wx/yarn.lock
View file @
6bee6688
...
...
@@ -4789,6 +4789,11 @@ jsprim@^1.2.2:
json-schema "0.2.3"
verror "1.10.0"
jssdk@^0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/jssdk/-/jssdk-0.0.1.tgz#923d8163c63e223f8d60f1305014201964e1aaf0"
integrity sha1-kj2BY8Y+Ij+NYPEwUBQgGWThqvA=
killable@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892"
...
...
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