Commit 71a516ab by ChenXianbin

提交代码,地址为服务器地址

parent 0ce7eb3a
...@@ -49,15 +49,15 @@ module.exports = { ...@@ -49,15 +49,15 @@ module.exports = {
}, },
module: { module: {
rules: [ rules: [
{ // {
test: /\.(js|vue)$/, // test: /\.(js|vue)$/,
loader: 'eslint-loader', // loader: 'eslint-loader',
enforce: 'pre', // enforce: 'pre',
include: [resolve('src'), resolve('test')], // include: [resolve('src'), resolve('test')],
options: { // options: {
formatter: require('eslint-friendly-formatter') // formatter: require('eslint-friendly-formatter')
} // }
}, // },
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'mpvue-loader', loader: 'mpvue-loader',
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>mpvue_quickstart</title> <title>mpvue_quickstart</title>
</head> </head>
<body> <body style="width:100%;height:100%">
<div id="app"></div> <div id="app" style="width:100%;height:100%"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
</html> </html>
<template> <template>
<div class="index-page"> <div class="index-page" v-bind:style="{ paddingTop: isActive[0]+25*isActive[1] + 'rpx'}">
<img src="../../assets/img/index-bg.jpg" class="index-bg"/> <p class="navigator_text" v-bind:style="{ top: isActive[0]-4*isActive[1]+ 'rpx'}">我的手机</p>
<img src="../../assets/img/index-bg.jpg" class="index-bg" />
<img src="../../assets/img/index-bg-cover.png" class="index-bg-cover" /> <img src="../../assets/img/index-bg-cover.png" class="index-bg-cover" />
<img src="../../assets/img/index-start-button.jpg" class="index-start-button" @click="handleStart"/> <img src="../../assets/img/index-start-button.jpg" class="index-start-button" @click="handleStart" />
<!-- <navigator <navigator v-if="config.more_fun && !config.more_fun.hide" class="navigator" path="" target="miniProgram" open-type="navigate" :app-id="config.more_fun.appid">
v-if="config.more_fun && !config.more_fun.hide" <img src="../../assets/img/btn-more.png" class="btn-more" @tap="handleMore" v-if="config.more_fun && !config.more_fun.hide" />
class="navigator" </navigator>
path=""
target="miniProgram" open-type="navigate" :app-id="config.more_fun.appid" > -->
<img src="../../assets/img/btn-more.png" class="btn-more" @tap="handleMore" v-if="config.more_fun && !config.more_fun.hide" />
<!-- </navigator> -->
</div> </div>
</template> </template>
...@@ -19,45 +16,66 @@ export default { ...@@ -19,45 +16,66 @@ export default {
computed: { computed: {
config() { config() {
return store.state.indexPage.config return store.state.indexPage.config
},
isActive() {
console.warn('show')
let height = 0,pixelRatio=1;
wx.getSystemInfo({
success: res => {
this.pageStyle = 'padding-top:' + res.statusBarHeight + 'rpx'
console.warn(res.statusBarHeight)
console.warn(res.pixelRatio)
// res.pixelRatio
height = res.statusBarHeight*res.pixelRatio;
pixelRatio = res.pixelRatio
}
})
return [height,pixelRatio];
} }
}, },
onLoad () { onLoad() {
console.log(this.$root.$mp.query, this.$root.$mp.appOptions, this.$root.$mp) // console.log(
// this.$root.$mp.query,
// this.$root.$mp.appOptions,
// this.$root.$mp
// );
}, },
onPageScroll () { onShow() {},
console.log('page is scroll') onPageScroll() {
// console.log('page is scroll')
}, },
beforeCreate () { beforeCreate() {
console.log('page is before create') // console.log('page is before create')
}, },
data () { data() {
return { return {
userInfo: {} userInfo: {}
} }
}, },
components: { components: {},
},
methods: { methods: {
handleStart() { handleStart() {
wx.setStorageSync('commited', false)
wx.navigateTo({ wx.navigateTo({
url: '/pages/counter/main' url: '/pages/counter/main'
}) })
}, },
handleMore() { handleMore() {
return false
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
appId: this.config.more_fun.appid, appId: this.config.more_fun.appid,
path: '', path: '',
success() { success() {
console.log('打开成功') // console.log("打开成功");
} }
}) })
} }
}, },
created () { created() {},
} mounted() {}
} }
</script> </script>
...@@ -69,6 +87,7 @@ export default { ...@@ -69,6 +87,7 @@ export default {
background: #c9baa8; background: #c9baa8;
text-align: center; text-align: center;
padding: 30rpx 0 0; padding: 30rpx 0 0;
padding-top: 160rpx;
} }
.index-bg { .index-bg {
position: absolute; position: absolute;
...@@ -96,4 +115,18 @@ export default { ...@@ -96,4 +115,18 @@ export default {
height: 123rpx; height: 123rpx;
z-index: 4; z-index: 4;
} }
.navigator {
opacity: 1;
background: rgba(0, 0, 0, 0);
}
.navigator_text {
text-align: center;
font-size: 40rpx;
color: #555555;
position: fixed;
top: 60rpx;
font-family: 'Microsoft Yahei';
width: 100%;
z-index: 100;
}
</style> </style>
...@@ -11,8 +11,8 @@ function setAuthorization (header) { ...@@ -11,8 +11,8 @@ function setAuthorization (header) {
Authorization = header Authorization = header
} }
const log = console.log const log = console.log
// fly.config.baseURL = 'https://minigame.api.wxagame.com/game-mobile/api/v1/'
fly.config.baseURL = 'https://test-api.wxagame.com/game-mobile/api/v1/' fly.config.baseURL = 'https://test-api.wxagame.com/game-mobile/api/v1/'
// add token // add token
fly.interceptors.request.use((config, promise) => { fly.interceptors.request.use((config, promise) => {
log(config, 'request config') log(config, 'request config')
......
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