Commit e90ca0a4 by 李伟康

提交代码

1 parent a93a2249
...@@ -3,22 +3,12 @@ import { Notify } from 'vant' ...@@ -3,22 +3,12 @@ import { Notify } from 'vant'
let requestCount = 0 let requestCount = 0
let wwRequestCount = 0 let wwRequestCount = 0
const WxConfig = { const WxConfig = {
init (jsApiList = []) { async init (jsApiList = []) {
const isWxWork = window.$ISWXWORK const isWxWork = window.$ISWXWORK
return new Promise((resolve, reject) => { jsApiList.map(e => {
jsApiList.map(e => { if (e == 'chooseImage') jsApiList.push('getLocalImgData')
if (e == 'chooseImage') jsApiList.push('getLocalImgData')
})
if (isWxWork) {
return this.getWWConfig(jsApiList).then(() => {
resolve()
})
} else {
return this.getWxConfig(jsApiList).then(() => {
resolve()
})
}
}) })
await this[isWxWork ? 'getWWConfig' : 'getWxConfig'](jsApiList)
}, },
getWWConfig (jsApiList) { getWWConfig (jsApiList) {
wwRequestCount += 1 wwRequestCount += 1
...@@ -48,11 +38,9 @@ const WxConfig = { ...@@ -48,11 +38,9 @@ const WxConfig = {
signature: data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法, signature: data.signature, // 必填,签名,见附录-JS-SDK使用权限签名算法,
jsApiList: ['getContext', ...jsApiList], jsApiList: ['getContext', ...jsApiList],
success (res) { success (res) {
console.log(res, 'ww_config')
resolve() resolve()
}, },
fail (err) { fail (err) {
console.log(err, 'ww_config')
Notify(message) Notify(message)
// util.refreshPage(JSONStringify(err)).then(() => { // util.refreshPage(JSONStringify(err)).then(() => {
// window.location.reload() // window.location.reload()
...@@ -61,7 +49,7 @@ const WxConfig = { ...@@ -61,7 +49,7 @@ const WxConfig = {
}) })
} else { } else {
if (wwRequestCount < 3) this.getWWConfig(jsApiList) if (wwRequestCount < 3) this.getWWConfig(jsApiList)
else Notify(message) else Notify(message)
// util.refreshPage('获取WWCONFIG失败').then(() => { // util.refreshPage('获取WWCONFIG失败').then(() => {
// window.location.reload() // window.location.reload()
// }) // })
...@@ -252,7 +240,7 @@ const WxConfig = { ...@@ -252,7 +240,7 @@ const WxConfig = {
}) })
}, },
/**获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃) */ /**获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃) */
onMenuShareTimeline(params){ onMenuShareTimeline (params) {
delete params.desc delete params.desc
return new Promise((resolve) => { return new Promise((resolve) => {
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
......
...@@ -230,12 +230,9 @@ export default { ...@@ -230,12 +230,9 @@ export default {
scrollY: 0, scrollY: 0,
updata: Date.now(), updata: Date.now(),
distanceKey: Date.now(), distanceKey: Date.now(),
noAuthAddress: false,
showKf: false, showKf: false,
viewFlag: false, viewFlag: false,
audio: null, audioFlag: false
audioFlag: false,
videoUrl: ''
} }
}, },
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
...@@ -246,7 +243,7 @@ export default { ...@@ -246,7 +243,7 @@ export default {
}, },
created () { created () {
let _this = this let _this = this
let jsApiList = ['getLocation', const jsApiList = ['getLocation',
'openLocation', 'openLocation',
'getNetworkType', 'getNetworkType',
'onMenuShareAppMessage', 'onMenuShareAppMessage',
...@@ -265,9 +262,6 @@ export default { ...@@ -265,9 +262,6 @@ export default {
beforeDestroy () { beforeDestroy () {
if (window.$AUDIO) window.$AUDIO.stopVideo() if (window.$AUDIO) window.$AUDIO.stopVideo()
}, },
mounted () {
},
methods: { methods: {
refresh (activityStatus) { refresh (activityStatus) {
this.updata = Date.now() this.updata = Date.now()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!