修改了下载方式

master
许宏杰 10 months ago
parent 9098930415
commit 85f6bfa41b

@ -28,6 +28,10 @@ import { Loading } from 'vant'
Vue.use(Loading)
import { installApk } from './util/sbIf.js'
Vue.prototype.$installApk = installApk
import moment from 'moment'
import 'moment/locale/zh-cn'

@ -1,13 +1,18 @@
export function phoneIf() {
var u = navigator.userAgent,
isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
if (isAndroid) {
return 'Android'
}
if (isiOS) {
return 'IOS'
}
return ''
}
export function phoneIf(){
var u = navigator.userAgent,
isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
if (isAndroid) {
return 'Android'
}
if (isiOS) {
return 'IOS'
}
return ''
export function installApk() {
let temp = document.createElement('a') // 创建a标签
temp.href = 'https://www.jichuanglanhai.com/demo/vx-url.html'
temp.click()
}

@ -19,8 +19,6 @@
</template>
<script>
import { Toast } from 'vant'
import { phoneIf } from '@/util/sbIf.js'
export default {
data() {
return {}
@ -28,16 +26,7 @@ export default {
created() {},
methods: {
handlerDownload() {
let temp = document.createElement('a') // a
const equipment = phoneIf()
if (equipment == 'IOS') {
temp.href = 'https://www.jichuanglanhai.com/demo/vx-url.html' //
} else if (equipment == 'Android') {
temp.href = 'https://www.pgyer.com/6TpZ' //
} else {
Toast(`暂未开发${equipment}版本app`)
}
temp.click()
this.$installApk()
},
},
}

@ -2,17 +2,24 @@
<div class="vx-container">
<div class="general-header"></div>
<div class="header-bg"></div>
<div :class="$route.name == '巡检详情' ? 'general-view-two' : 'general-view'" :style="{
height: $store.state.showBtnData.isShow == 'true' ? '' : '79%',
top: $store.state.showBtnData.isShow == 'true' ? '' : '46%',
transform:
$store.state.showBtnData.isShow == 'true' ? '' : 'translateY(-46%)',
}">
<div
:class="$route.name == '巡检详情' ? 'general-view-two' : 'general-view'"
:style="{
height: $store.state.showBtnData.isShow == 'true' ? '' : '79%',
top: $store.state.showBtnData.isShow == 'true' ? '' : '46%',
transform:
$store.state.showBtnData.isShow == 'true' ? '' : 'translateY(-46%)',
}"
>
<router-view />
</div>
<div class="general-footnote">
<div class="back-home" v-show="$store.state.showBtnData.isShow == 'true'" @click="backHome">
<div
class="back-home"
v-show="$store.state.showBtnData.isShow == 'true'"
@click="backHome"
>
<img src="@/assets/image/vxEwm/back.png" alt="" class="back-icon" />
<span> 返回{{ $store.state.showBtnData.text }}</span>
</div>
@ -28,8 +35,6 @@
</template>
<script>
import { Toast } from 'vant'
import { phoneIf } from '@/util/sbIf.js'
export default {
data() {
return {}
@ -65,16 +70,7 @@ export default {
}
},
handlerDownload() {
let temp = document.createElement('a') // a
const equipment = phoneIf()
if (equipment == 'IOS') {
temp.href = 'https://www.jichuanglanhai.com/demo/vx-url.html' //
} else if (equipment == 'Android') {
temp.href = 'https://www.pgyer.com/6TpZ' //
} else {
Toast(`暂未开发${equipment}版本app`)
}
temp.click()
this.$installApk()
},
},
}

@ -19,8 +19,6 @@
</template>
<script>
import { Toast } from 'vant'
import { phoneIf } from '@/util/sbIf.js'
export default {
data() {
return {}
@ -28,16 +26,7 @@ export default {
created() {},
methods: {
handlerDownload() {
let temp = document.createElement('a') // a
const equipment = phoneIf()
if (equipment == 'IOS') {
temp.href = 'https://www.jichuanglanhai.com/demo/vx-url.html' //
} else if (equipment == 'Android') {
temp.href = 'https://www.pgyer.com/6TpZ' //
} else {
Toast(`暂未开发${equipment}版本app`)
}
temp.click()
this.$installApk()
},
},
}

Loading…
Cancel
Save