Commit e90ca0a4 by 李伟康

提交代码

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