Commit 17b44a31 by 潘琦

部分android手机白板问题;

parent 2cb97849
...@@ -60,7 +60,7 @@ const webpackConfig = merge(baseWebpackConfig, { ...@@ -60,7 +60,7 @@ const webpackConfig = merge(baseWebpackConfig, {
}), }),
// extract css into its own file // extract css into its own file
new ExtractTextPlugin({ new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css'), filename: utils.assetsPath('css/[name].[contenthash].css?v=' + timeStamp),
// Setting the following option to `false` will not extract CSS from codesplit chunks. // Setting the following option to `false` will not extract CSS from codesplit chunks.
// Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack. // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
// It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`, // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,10 +15,13 @@ ...@@ -15,10 +15,13 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"babel-polyfill": "^6.26.0",
"es6-promise": "^4.2.8",
"mint-ui": "^2.2.13", "mint-ui": "^2.2.13",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"qrcodejs2": "0.0.2", "qrcodejs2": "0.0.2",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-cookies": "^1.5.13",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",
"vue-signature": "^2.4.3", "vue-signature": "^2.4.3",
"vuex": "^3.1.1", "vuex": "^3.1.1",
......
<template> <template>
<div id="app" class="full-height"> <div id="app" v-cloak class="full-height">
<keep-alive> <!-- <keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view> <router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive> </keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view> <router-view v-if="!$route.meta.keepAlive"></router-view> -->
<router-view></router-view>
</div> </div>
</template> </template>
......
...@@ -12,38 +12,52 @@ const defaultUrl = baseUrl.authUrl ...@@ -12,38 +12,52 @@ const defaultUrl = baseUrl.authUrl
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
console.log('缓冲设置') console.log('缓冲设置')
console.log('code ===' + store.getters.code) console.log('code ===' + store.getters.code)
// 判断链接是否被微信分享篡改,false需重定向
if (redirectUrl()) {
// store.dispatch('setToken', '')
// store.dispatch('setUserId', '')
// let accessToken = store.getters.access_token
let storecode = store.getters.code let storecode = store.getters.code
if (!storecode || storecode === '') { if (!storecode || storecode === '') {
let params = getParamsByUrl(window.location.href) let params = getParamsByUrl(window.location.href)
if (params.code) { if (params.code) {
store.dispatch('setCode', params.code) store.dispatch('setCode', params.code)
getOauthFn(() => { getOauthFn(() => {
// wxpermission(0, () => {})
next() next()
}) })
} else { } else {
getWXOauth() getWXOauth(() => {
}
} else {
// wxpermission(0, () => {})
next() next()
})
} }
} else { } else {
if (globalNewUrl !== '') { next()
window.location.href = globalNewUrl
}
} }
// 判断链接是否被微信分享篡改,false需重定向
// if (redirectUrl()) {
// // store.dispatch('setToken', '')
// // store.dispatch('setUserId', '')
// // let accessToken = store.getters.access_token
// let storecode = store.getters.code
// if (!storecode || storecode === '') {
// let params = getParamsByUrl(window.location.href)
// if (params.code) {
// store.dispatch('setCode', params.code)
// getOauthFn(() => {
// // wxpermission(0, () => {})
// next()
// })
// } else {
// getWXOauth()
// }
// } else {
// // wxpermission(0, () => {})
// next()
// }
// } else {
// if (globalNewUrl !== '') {
// window.location.href = globalNewUrl
// }
// }
// store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77') // store.dispatch('setToken', '490cd9b7-dca7-4cc3-87e9-5eacbb5a5d77')
}) })
let getWXOauth = () => { let getWXOauth = (callback) => {
console.log()
let url = removeUrlParam('code') let url = removeUrlParam('code')
// store.dispatch('setCode', '') // store.dispatch('setCode', '')
let authId = '' let authId = ''
...@@ -52,6 +66,12 @@ let getWXOauth = () => { ...@@ -52,6 +66,12 @@ let getWXOauth = () => {
store.dispatch('setAuthId', getParamsByUrl(window.location.href).auth_id) store.dispatch('setAuthId', getParamsByUrl(window.location.href).auth_id)
} }
window.location.href = defaultUrl + '/wxoauth/route?redirect_uri=' + encodeURIComponent(url) + authId + '&auth_scene=voucher' window.location.href = defaultUrl + '/wxoauth/route?redirect_uri=' + encodeURIComponent(url) + authId + '&auth_scene=voucher'
const u = navigator.userAgent
const isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 // g
// const isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/) // ios终端
if (isAndroid) {
callback()
}
} }
let getOauthFn = (callback) => { let getOauthFn = (callback) => {
...@@ -67,7 +87,9 @@ let getOauthFn = (callback) => { ...@@ -67,7 +87,9 @@ let getOauthFn = (callback) => {
} else { } else {
store.dispatch('setCode', '') store.dispatch('setCode', '')
setTimeout(function () { setTimeout(function () {
getWXOauth() getWXOauth(() => {
callback()
})
}, 3 * 1000) }, 3 * 1000)
Toast({ Toast({
message: '微信token已失效!', message: '微信token已失效!',
...@@ -98,6 +120,12 @@ const getUserByTokenFn = (token, code, callback) => { ...@@ -98,6 +120,12 @@ const getUserByTokenFn = (token, code, callback) => {
let accountId = res.accountid let accountId = res.accountid
if (accountId && accountId !== '') { if (accountId && accountId !== '') {
store.dispatch('setAccountId', accountId) store.dispatch('setAccountId', accountId)
} else {
Toast({
message: 'account id不能为空!',
position: 'center',
duration: 3 * 1000
})
} }
if (res.ext && res.ext !== '') { if (res.ext && res.ext !== '') {
let extOBJ = JSON.parse(res.ext) let extOBJ = JSON.parse(res.ext)
...@@ -112,7 +140,9 @@ const getUserByTokenFn = (token, code, callback) => { ...@@ -112,7 +140,9 @@ const getUserByTokenFn = (token, code, callback) => {
callback() callback()
} else { } else {
setTimeout(function () { setTimeout(function () {
getWXOauth() getWXOauth(() => {
callback()
})
}, 3 * 1000) }, 3 * 1000)
Toast({ Toast({
message: 'user id不能为空!', message: 'user id不能为空!',
...@@ -122,7 +152,9 @@ const getUserByTokenFn = (token, code, callback) => { ...@@ -122,7 +152,9 @@ const getUserByTokenFn = (token, code, callback) => {
} }
} else { } else {
setTimeout(function () { setTimeout(function () {
getWXOauth() getWXOauth(() => {
callback()
})
}, 3 * 1000) }, 3 * 1000)
Toast({ Toast({
message: 'token不能为空!', message: 'token不能为空!',
...@@ -138,47 +170,49 @@ const getUserByTokenFn = (token, code, callback) => { ...@@ -138,47 +170,49 @@ const getUserByTokenFn = (token, code, callback) => {
duration: 3 * 1000 duration: 3 * 1000
}) })
setTimeout(function () { setTimeout(function () {
getWXOauth() getWXOauth(() => {
callback()
})
}, 3 * 1000) }, 3 * 1000)
}) })
} }
let globalNewUrl = '' // let globalNewUrl = ''
// 判断链接是否被微信分享篡改 // 判断链接是否被微信分享篡改
const redirectUrl = () => { // const redirectUrl = () => {
const curUrl = window.location.href // const curUrl = window.location.href
const curUrlArr = curUrl.split('?') // const curUrlArr = curUrl.split('?')
// Toast({ // // Toast({
// message: curUrl, // // message: curUrl,
// position: 'center', // // position: 'center',
// duration: 2 * 1000 // // duration: 2 * 1000
// }) // // })
// console.log(curUrlArr[1].indexOf('from=singlemessage')) // // console.log(curUrlArr[1].indexOf('from=singlemessage'))
if (curUrlArr.length === 3 && curUrlArr[1].indexOf('from=singlemessage') >= 0) { // if (curUrlArr.length === 3 && curUrlArr[1].indexOf('from=singlemessage') >= 0) {
let newUrl = curUrlArr[0] + '#' + curUrlArr[1].split('#')[1] + '?' + curUrlArr[2] // let newUrl = curUrlArr[0] + '#' + curUrlArr[1].split('#')[1] + '?' + curUrlArr[2]
// Toast({ // // Toast({
// message: curUrlArr[2], // // message: curUrlArr[2],
// position: 'center', // // position: 'center',
// duration: 5 * 1000 // // duration: 5 * 1000
// }) // // })
globalNewUrl = newUrl // globalNewUrl = newUrl
// window.location.href = newUrl // // window.location.href = newUrl
return false // return false
} else if (curUrl.indexOf('?scene=0') >= 0) { // } else if (curUrl.indexOf('?scene=0') >= 0) {
let newUrl = curUrl.replace('?scene=0', '') // let newUrl = curUrl.replace('?scene=0', '')
globalNewUrl = newUrl // globalNewUrl = newUrl
return false // return false
} else if (curUrl.indexOf('/voucher/?') >= 0) { // } else if (curUrl.indexOf('/voucher/?') >= 0) {
const urlArr = curUrl.split('/voucher/?') // const urlArr = curUrl.split('/voucher/?')
const locationStr = urlArr[0] // const locationStr = urlArr[0]
const pathArr = urlArr[1].split('#') // const pathArr = urlArr[1].split('#')
let newUrl = locationStr + '/voucher/#' + pathArr[1] // let newUrl = locationStr + '/voucher/#' + pathArr[1]
globalNewUrl = newUrl // globalNewUrl = newUrl
return false // return false
} else { // } else {
return true // return true
} // }
} // }
// const nextToPath = (to, from, next) => { // const nextToPath = (to, from, next) => {
// let toquery = to.query // let toquery = to.query
......
...@@ -707,14 +707,15 @@ export default { ...@@ -707,14 +707,15 @@ export default {
}) })
}, },
getUserSignInfoFn () { // 获取用户签约信息 getUserSignInfoFn () { // 获取用户签约信息
if (this.accountId === null || this.accountId === '') { // if (this.accountId === null || this.accountId === '') {
this.$toast({ // this.$toast({
message: '用户account id不能为空!', // message: '用户account id不能为空!',
position: 'center', // position: 'center',
duration: 3000 // duration: 3000
}) // })
return // return
} else if (this.pageType == null) { // }
if (this.pageType == null) {
this.$toast({ this.$toast({
message: '页面参数不完整!', message: '页面参数不完整!',
position: 'center', position: 'center',
...@@ -1103,6 +1104,20 @@ export default { ...@@ -1103,6 +1104,20 @@ export default {
} }
}, },
confirmSignature () { confirmSignature () {
if (!this.accountId && store.getters.accountId && store.getters.accountId !== '') {
this.accountId = store.getters.accountId
} else if (!this.accountId && (!store.getters.accountId || store.getters.accountId === '')) {
this.$toast({
message: 'account id不能为空',
position: 'center',
duration: 3 * 1000
})
}
// this.$toast({
// message: 'account id=' + this.accountId,
// position: 'center',
// duration: 3 * 1000
// })
if (parseInt(this.pageType) === 0) { if (parseInt(this.pageType) === 0) {
if (this.signState === '1' && this.isSign === 0) { // 已签约已审核通过 跳转至首页 if (this.signState === '1' && this.isSign === 0) { // 已签约已审核通过 跳转至首页
this.$router.push({ this.$router.push({
......
...@@ -663,14 +663,15 @@ export default { ...@@ -663,14 +663,15 @@ export default {
}) })
}, },
getUserSignInfoFn () { // 获取用户签约信息 getUserSignInfoFn () { // 获取用户签约信息
if (this.accountId === null || this.accountId === '') { // if (this.accountId === null || this.accountId === '') {
this.$toast({ // this.$Indicator.close()
message: '用户account id不能为空!', // this.$toast({
position: 'center', // message: '用户account id不能为空!',
duration: 3000 // position: 'center',
}) // duration: 3000
return // })
} // return
// }
let params = { let params = {
type: this.pageType, type: this.pageType,
accountId: this.accountId accountId: this.accountId
...@@ -1024,6 +1025,20 @@ export default { ...@@ -1024,6 +1025,20 @@ export default {
} }
}, },
confirmSignature () { confirmSignature () {
if (!this.accountId && store.getters.accountId && store.getters.accountId !== '') {
this.accountId = store.getters.accountId
} else if (!this.accountId && (!store.getters.accountId || store.getters.accountId === '')) {
this.$toast({
message: 'account id不能为空',
position: 'center',
duration: 3 * 1000
})
}
// this.$toast({
// message: 'account id=' + this.accountId,
// position: 'center',
// duration: 3 * 1000
// })
if (parseInt(this.pageType) === 0) { if (parseInt(this.pageType) === 0) {
if (this.signState === '1') { // 已审核通过 跳转至首页 if (this.signState === '1') { // 已审核通过 跳转至首页
this.$router.push({ this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment