Skip to content

Commit

Permalink
Merge pull request rock-app#30 from Darren-chenchen/master
Browse files Browse the repository at this point in the history
修复android5.0预览界面不显示问题
  • Loading branch information
zakiso authored Oct 26, 2018
2 parents 736fd1a + c805ee5 commit 7551200
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
7 changes: 4 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
},
"dependencies": {
"axios": "^0.17.1",
"babel-polyfill": "^6.26.0",
"element-ui": "^2.1.0",
"less-loader": "^4.1.0",
"vue": "^2.5.2",
"vue-context-menu": "^2.0.6",
"vue-infinite-scroll": "^2.0.2",
"vue-lazyload": "^1.1.4",
"vue-qr": "^1.2.8",
"vue-router": "^3.0.1",
"vue-context-menu": "^2.0.6",
"vue-infinite-scroll": "^2.0.2"
"vue-router": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
Expand Down
33 changes: 21 additions & 12 deletions client/src/components/appDetail/appPreView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<!--中间-->
<div :class="getContentClass()" v-if="this.appBaseData">
<div :class="getLeftClass()">
<div v-if="this.isIos || this.isAndroid">
<!--手机上查看-->
<div v-show="isPhone">
<p>手机</p>
<phoneWrapper
:appBaseData="appBaseData"
:appVersionInfo="appVersionInfo"
Expand All @@ -15,7 +17,9 @@
</div>


<div class="pcWrapper" v-if="!this.isIos && !this.isAndroid">
<!--pc上查看-->
<div class="pcWrapper" v-show="!isPhone">
<p>33333333</p>
<img class="appicon" :src="getIconUrl()" alt="">
<p class="title">{{this.appBaseData.appName}}</p>
<div class="info">
Expand All @@ -32,8 +36,8 @@
</div>


<!--手机视图-->
<div class="preview-mobilewrapper" v-show="this.showQRCode">
<!--右侧二维码-->
<div class="preview-mobilewrapper" v-show="!isPhone">
<img class="mobieImg" src='../../assets/ic_mobilphone.png'>
<vue-qr class="qrcodeImg" :text="downloadUrl" :margin="20"></vue-qr>
<p class="codetips">请扫描二维码下载APP</p>
Expand All @@ -59,8 +63,8 @@
appBaseData: null,
downloadUrl: '',
platformStr: '',
showQRCode: false,
pwd: ''
pwd: '',
isPhone: false
}
},
computed: {
Expand Down Expand Up @@ -93,16 +97,21 @@
}
}
},
created() {
mounted() {
this.getAppInfo(this.$route.params.id)
// 判断是否是手机设备
if (this.isIos || this.isAndroid) {
this.showQRCode = false
this.isPhone = true
} else {
this.showQRCode = true
this.isPhone = false
}
},
created() {
this.$nextTick(() => {
})
},
methods: {
getTableBackground(index) {
if (index % 2 === 0) {
Expand Down Expand Up @@ -131,7 +140,7 @@
}
}, reject => {
this.$message.error('服务器错误')
})
},
getIconUrl() {
Expand Down Expand Up @@ -173,14 +182,14 @@
},
getContentClass() {
// 判断是否是手机设备
if (this.isIos || this.isAndroid) {
if (this.isPhone) {
return 'preview-middlewrapper-forPhone'
} else {
return 'preview-middlewrapper'
}
},
getLeftClass() {
if (this.isIos || this.isAndroid) {
if (this.isPhone) {
return 'left-forPhone'
} else {
return 'left'
Expand Down
4 changes: 3 additions & 1 deletion client/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import {configAxios} from './api/basehttp'
import VueLazyLoad from 'vue-lazyload'
import infiniteScroll from 'vue-infinite-scroll'

// 解决android5.0 上预览界面不显示的问题
import 'babel-polyfill'

Vue.use(infiniteScroll)

Vue.config.productionTip = false
Expand Down Expand Up @@ -50,7 +53,6 @@ Vue.use(VueLazyLoad, {
loading: require('./assets/logo.png')
})


// 配置接口信息
configAxios()

Expand Down

0 comments on commit 7551200

Please sign in to comment.